I am sorry but it looks like you should take a step back, you should first learn about functions, pointers...and other basic stuff before touching that "advanced" library you got your self into because it will only bring you pain, take your precious time and you'll advance nowhere.
If i were you i would not "connect" those "=" operators like that, except if it is for primitive types!
You should look in GSL help documents for reference about gsl_matrix_calloc function and what it does! http://www.network-theory.co.uk/docs/gslref/Matrixallocation.html
what type of data will the return to me?
It will return pointer to a gsl_matrix witch is a struct.
Edit: Didn't read your line correctly, this should never compile: gsl_vector* e = gsl_matrix* S = gsl_matrix_calloc( n, n) ;
You can't enter type after = operator!
This is valid:
void update (gsl_matrix* S)
{
for(unsignedint i = 0; i < S->size1; ++i)
{
for(unsignedint j = 0; j < S->size2; ++j)
{
double a = gsl_matrix_get (S, i, j);
// do something with a
}
}
};
int main()
{
constunsignedint n = 3;
gsl_matrix* S = gsl_matrix_calloc(n, n);// allocates 3x3 matrix
update(S);
// here do some more stuff
gsl_matrix_free(S);// free your matrix
std::cout << "Press enter to exit...";
std::cin.get();
return 0;
}