This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
re: blas crashing programs -- solved
- From: "John Boik" <john dot boik at ompress dot com>
- To: <gsl-discuss at sources dot redhat dot com>
- Date: Fri, 4 Jul 2003 04:58:25 -0500
- Subject: re: blas crashing programs -- solved
- Reply-to: <john dot boik at ompress dot com>
Well, I figured out why blas was crashing my program. It was very simple.
I was not using an "&" before the result variable. For any other newbies
that might be out there, here is how it should look (its too bad the manual
does not give an example like this, or does it somewhere):
#include <stdio.h.>
#include <gsl/gsl_blas.h>
int main(void)
{
double a[] = {.11, .12,.13,.21,.22,.23};
double result;
// the next two lines test the dot function
gsl_vector_view D = gsl_vector_view_array(a,6);
gsl_blas_ddot(&D.vector, &D.vector, &result);
printf("result = %f\n",result);
getchar();
return 1;
}
Now the only question I have left is how to pass gsl vectors from one
function to another. Anyone want to fill me in?
Thanks,
John