Skip to content

Commit

Permalink
Merge pull request #70 from SuperFluffy/fix_linear_fit
Browse files Browse the repository at this point in the history
Fix arguments in gsl_linear_fit
  • Loading branch information
GuillaumeGomez committed Feb 26, 2019
2 parents 7655c48 + 0f5a4e3 commit a4c4d95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ffi/mod.rs
Expand Up @@ -1460,7 +1460,7 @@ extern "C" {
cov00: *mut c_double,
cov01: *mut c_double,
cov11: *mut c_double,
sumsq: c_double)
sumsq: *mut c_double)
-> c_int;
pub fn gsl_fit_wlinear(x: *const c_double,
xstride: size_t,
Expand Down
2 changes: 1 addition & 1 deletion src/fit.rs
Expand Up @@ -14,7 +14,7 @@ use enums;
/// The errors on y are assumed unknown so the variance-covariance matrix for the parameters (c0, c1) is estimated from the scatter of the points around the best-fit line and returned via the parameters (cov00, cov01, cov11).
/// The sum of squares of the residuals from the best-fit line is returned in sumsq. Note: the correlation coefficient of the data can be computed using gsl_stats_correlation (see [`Correlation`](http://www.gnu.org/software/gsl/manual/html_node/Correlation.html#Correlation)), it does not depend on the fit.
pub fn linear(x: &[f64], xstride: usize, y: &[f64], ystride: usize, n: usize, c0: &mut f64, c1: &mut f64, cov00: &mut f64,
cov01: &mut f64, cov11: &mut f64, sumsq: f64) -> enums::Value {
cov01: &mut f64, cov11: &mut f64, sumsq: &mut f64) -> enums::Value {
enums::Value::from(unsafe { ::ffi::gsl_fit_linear(x.as_ptr(), xstride, y.as_ptr(), ystride, n, c0, c1, cov00, cov01, cov11, sumsq) })
}

Expand Down

0 comments on commit a4c4d95

Please sign in to comment.