|
Custom structures containing gsl_vector: msg#00061lib.gsl.general
Hello, I have implement a data structure that stores two columns of experimental data using the gsl_vector type. However, I am having a run time error when initialising the my custom data type, EXC_BAD_ACCESS. I think it is silly pointer related problem. Can anybody help? I have highlighted the line in the following code. Regards, Dan. ___ typedef struct _Spectra { gsl_vector *x; gsl_vector *y; unsigned count; } Spectra; void MakeSpectra (Spectra *spectra, double *x, double *y, unsigned count) { /* error on the line below */ spectra->x = gsl_vector_alloc(count); spectra->y = gsl_vector_alloc(count); memcpy(spectra->x->block->data,x,count * sizeof(double)); memcpy(spectra->y->block->data,y,count * sizeof(double)); spectra->count = count; } |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | gsl_odeiv_evolve_apply: 00061, Brian Powell |
|---|---|
| Next by Date: | Memory allocation for large matrices: 00061, Helena |
| Previous by Thread: | gsl_odeiv_evolve_applyi: 00061, Brian Powell |
| Next by Thread: | Re: Custom structures containing gsl_vector: 00061, Daniel J Farrell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |