I was wondering if it would be possible to get some help on writing a cholesky function that works for complex numbers. Thus far, I have one that works for real numbers. I figured that adding a few...
Type: Posts; User: magda3227
I was wondering if it would be possible to get some help on writing a cholesky function that works for complex numbers. Thus far, I have one that works for real numbers. I figured that adding a few...
Thanks. That makes sense.
I was too stupid to figure that out.
I recently came across something that has been giving me seg. viol.
If I want to create a 2-D array of size 2x6, when I allocate memory for my pointer, I would assume that it needs to be done as...
I see.
I now also found out I'm getting segmentation violation when I try to free some of my other pointers, even though I no longer use them. I actually allocated them within in a switch...
So how is that freeing memory if the values stored within the pointer are not changed?
Doesn't it take memory to keep those values there?
In another area of my program, when I free a pointer,...
I have no idea why, but when I try to free a pointer that I allocated memory for, the free fails. I test to see if the pointer is NULL after the free, and it is not. I can still print all the values...
As far as I know, there is no pseudo random number generator for c. I don't know much about probability and statistics, but does anyone else know of a method or function (or perhaps a library that...
Not that anyone would care, but I found the error. it had to do with looping past a pointer. I was trying to access something that wasn't there. I'm not sure why it didn't show up until the second...
So then I would have to declare the matrices as such...
int row, col;
matrix1[row][col]
and then make make the row and col actual integers for each separate case?
Is that "proper"...
I am rewriting MatLab code in C and I need some direction on how to approach converting the code.
Basically, a user inputs one of 6 scenarios. Each scenario has about 6 matrices with stored...
Thank you very much matsp.
Thanks. This works...
char Scenario[7]="ABCDEF";
char UserScenario;
char *p=NULL;
Hm. It's still not working. I tried using
if(UserScenario >= 'A' && UserScenario <= 'F')
and that didn't work. I also tried making my character array into a string and searching it. It...
I was wondering how I would go about checking a character array for a specific character that keeps changing.
What I want to do is compare the User input to the string. If the user does not pick...
Thanks. I'll make sure to compile using -wall and make the changes you suggested.
Yeah, sorry. I removed that. M is a user defined value returned from a previous function that I took out because this program is huge. At the time when I use malloc, M has a non-zero value.
It's a lot...
Main Function
#include<stdio.h>
#include<stdlib.h>
#include"corrheader.h"
struct
{
I am writing some code that uses a function twice in order to create two matrices, each stored under a different variable name. However, when I try to use the function the second time, I get a...
Thank you to all who responded.
Your explanations were very helpful, especially the examples you provided. I learn visually, and they really helped me to understand what's going on and the...
I made the changes so that the second function accepts a pointer to a pointer. But how does this change the way I store the values? I'll have to change the notation for incrementing the pointer and...
My compiler gives me an error when I try to send the addresses of the pointers. It says that I'm passing from incompatible pointer types.
That's what you meant when you said passing by reference,...
I'm still learning about pointers and using malloc, so please bare with me.
I was wondering if it is possible to allocate memory for a pointer in a main function, send that pointer to another...
I was planning on using isnan, but after I had already returned the value from the function. I was going to check the variable I saved it in using isnan or isinf. Otherwise, they don't do much for me...
I'm rewriting MatLab code into C and need to send values to a complex error function. The erfcomp function produces Nan and Inf values, but when I try to return these values to my other function and...
Some of the variables are used later on, in the part of code I didn't post.
This is part of a larger program I am converting from MatLab to C. It will be linked later. The cluster number is user...