Open GuillaumeGomez opened 5 years ago
With gsl 2.2.1
, the follwing change was introduced:
** completely rewritten nonlinear least squares module, including support for large problems; the user may now control the linear solver used, the trust region updating strategy, and the scaling method. In addition, support has been added for the geodesic acceleration step (Transtrum 2011) which can speed up convergence on a wide class of problems.
I figure this is what gsl_multifit_nlinear.h
is for. At the same time, they have removed any mention of gsl_multifit_nlin.h
from the docs. Here is a mailing list question about the same issue that went unanswered: https://lists.gnu.org/archive/html/help-gsl/2017-06/msg00052.html
I'm experimenting with gsl-sys and the gsl_multifit_nlinear library as I've used it in C for some analysis. However, I'm getting a segmentation fault when I call a function to set the tunable parameters to default. I've isolated it to a Bus error in the following code snippet:
use gsl_sys::gsl_multifit_nlinear_default_parameters;
use gsl_sys::gsl_multifit_nlinear_parameters;
fn main() {
let test_params: gsl_multifit_nlinear_parameters = unsafe { gsl_multifit_nlinear_default_parameters() };
}
The C code for this function is simple enough. However I'm new to Rust and haven't been able to figure out what are causing the Bus errors or Segmentation faults.
Link to C function for gsl_multifit_nlinear_default_parameters():
It's likely that https://github.com/ampl/gsl/blob/master/multifit_nlinear/gsl_multifit_nlinear.h#L125 got updated, meaning that we write into non-existing code.
So, to confirm, a fix would be to update gsl-sys according to the README below?
https://github.com/GuillaumeGomez/rust-GSL/blob/master/gsl-sys/README.md
Hopefully yes.
I wasn't able to use GSL-sys out of the box for multifit_nlinear, so I had to write a little C to join GSL's multifit_nlinear functions with Rust. This isn't a final working version, but do you think something like the repo below could work for a pull request into rust-GSL if I fixed up the return values better?
I added the following PR:
Some links:
cc @SuperFluffy