blas crashing programs -- solved

John Boik john.boik@ompress.com
Fri Jul 4 09:58:00 GMT 2003


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




More information about the Gsl-discuss mailing list