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]

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.




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