[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] siman: fixed vs variable configurations
From: |
Brian Gough |
Subject: |
Re: [Help-gsl] siman: fixed vs variable configurations |
Date: |
Mon, 24 Apr 2006 20:07:33 +0100 |
John Gehman writes:
> As my void * argument references a complicated structure, and not a
> simple array of fixed-size elements, am I forced to use the "variable
> size" approach to siman, where I define copy, constructor, and
> destructor functions instead of just saying NULL, and set the size to 0
> instead of sizeof(double) ?
Hello,
It's not necessary to define the additional copy/constructor
functions.
You only need to pass around a pointer to the data rather than the
data itself, in addition to the system parameters.
e.g. for 25 double parameters 'x' and an arbitrary set of data
struct mysystem {
double x[25];
struct mydata * data;
}
The size parameter should then be sizeof(struct mysystem).
--
best regards,
Brian Gough
Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/