This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Naive question from novice C programmer
- From: Alex Casti <arc at camelot dot mssm dot edu>
- To: gsl-discuss at sources dot redhat dot com
- Date: Sat, 28 Sep 2002 19:41:40 -0400
- Subject: Naive question from novice C programmer
I'm fairly new to both GSL and the C programming language.
What I'm wondering is if there's a way to employ the GSL
routines that take arrays as input, where the arrays are *not*
defined the GSL way using "gsl_vector_alloc" and so forth,
but rather the usual manual way with malloc, i.e.
xarray = (double *) malloc((nsize)*sizeof(double));
I would prefer to use my own array names and definitions
because the GSL calling names are somewhat unwieldy and long.
However, it doesn't appear that I can define "xarray" as
above and then shove this into a GSL function like
gsl_vector_set_all(xarray, 10.)
When I try this I get an error complaining about incompatible
pointer types.
Am I correct in concluding that I *cannot* set my own array allocations
and use the GSL routines? Must I always use the GSL vector structs?
Thanks for your help.