public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* re: blas crashing programs -- solved
@ 2003-07-04  9:58 John Boik
  0 siblings, 0 replies; only message in thread
From: John Boik @ 2003-07-04  9:58 UTC (permalink / raw)
  To: gsl-discuss

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-04  9:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-04  9:58 blas crashing programs -- solved John Boik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).