This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

re: blas crashing programs -- solved


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]