[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] siman: fixed vs variable configurations
From: |
John Gehman |
Subject: |
Re: [Help-gsl] siman: fixed vs variable configurations |
Date: |
Fri, 28 Apr 2006 17:15:32 +1000 |
I think I worked out the problem -- the memcpy functions in siman.c
will only copy real data, like my `double rmsd`. For my gsl_vector *
values that I'm searching for/optimizing, it copies only the pointer,
and therefore the same value being pointed to are adjusted over and
over, and a real copy is never set aside as a "best".
Consequently, it would seem that I should use the "variable size"
mode of the solver so that I can provide my own copy method. Maybe
this is what is meant by "variable size mode" -- variable size
meaning dynamically allocated struct components which necessarily
used pointers rather than explicit and fixed-size components. I
presumed "variable size" meant e.g. varying the number of values
searched for (dropping insignificant eigenvalues, for example). I
thought my problem was fixed because once set, the structure did not
change size at all.
I'm learning, slowly.
Cheers, hope I didn't waste too many people's time
john
On 27/04/2006, at 5:47 PM, John Gehman wrote:
My gsl_siman_Efunc_t receives the void * argument which refers to
my data struct, a component of which is the gsl_vector which holds
the (17) values that I want to search for/optimize. The optimum
values provide for the best fit to data, and it is the rmsd between
the data and fit which I return as "Energy". I also set the "double
rmsd" component of the data struct to this same value.
...
When the minimum temperature is reached, mysystem contains the
configuration of sought-values only for the minimal energy of the
last temperature run, not the configuration corresponding to the
globally minimum value, but the ((struct mysystem *) xp )->rmsd
*does* reflect the globally minimum value, as above.