summaryrefslogtreecommitdiff
path: root/graphics/amide/files/patch-gsl_2x
blob: 14f97d80f474cf7024ed27ae0f2662be9fcf2ee5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Obtained from:
https://sourceforge.net/p/amide/mailman/message/34638848/

Description: Fix compilation against GSL >= 2.0
Author: Gert Wollny <gw.fossdev@gmail.com>
Last-Update: Sun, 22 Nov 2015 14:21:00 +0000
Bug-Debian: http://bugs.debian.org/805748

--- src/tb_profile.c	2015-11-22 14:00:16.361526795 +0100
+++ src/tb_profile.c	2015-11-22 14:14:58.993881660 +0100
@@ -32,6 +32,7 @@
 #include "ui_common.h"
 #ifdef AMIDE_LIBGSL_SUPPORT
 #include <gsl/gsl_multifit_nlin.h>
+#include <gsl/gsl_version.h>
 #endif


@@ -605,6 +606,7 @@
   result_t * result;
   gsl_multifit_fdfsolver * solver;
   gsl_matrix *covar;
+  gsl_matrix *J;
   gsl_multifit_function_fdf fdf;
   gsl_vector * init_p;
   gint iter;
@@ -668,8 +670,16 @@
     }
     while ((status == GSL_CONTINUE) && (iter < 100));

+#if GSL_MAJOR_VERSION > 1
+    {
+      gsl_matrix *J = gsl_matrix_alloc (result->line->len, num_p);;
+      gsl_multifit_fdfsolver_jac(solver, J);
+      gsl_multifit_covar (J, 0.0, covar);
+      gsl_matrix_free(J);
+    }
+#else
     gsl_multifit_covar (solver->J, 0.0, covar);
-
+#endif
     j=0;
     result->s_fit = gsl_vector_get(solver->x, j++);
     result->p_fit = gsl_vector_get(solver->x, j++);