| 1 | /* multfit/lmder.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 21 | |
| 22 | #include <stddef.h> |
| 23 | #include <stdlib.h> |
| 24 | #include <stdio.h> |
| 25 | #include <math.h> |
| 26 | #include <float.h> |
| 27 | |
| 28 | #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/ |
| 29 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 30 | #include "gsl_multifit_nlin.h"cxx . . $ `<file>/external/gsl/gsl_multifit_nlin.h`/ |
| 31 | #include "gsl_blas.h"cxx . . $ `<file>/external/gsl/gsl_blas.h`/ |
| 32 | #include "gsl_linalg.h"cxx . . $ `<file>/external/gsl/gsl_linalg.h`/ |
| 33 | #include "gsl_permutation.h"cxx . . $ `<file>/external/gsl/gsl_permutation.h`/ |
| 34 | |
| 35 | |
| 36 | typedef structcxx . . $ $anonymous_type_9e3e468d83e34f36_0# |
| 37 | { |
| 38 | size_t itercxx . . $ $anonymous_type_9e3e468d83e34f36_0#iter.; |
| 39 | double xnormcxx . . $ $anonymous_type_9e3e468d83e34f36_0#xnorm.; |
| 40 | double fnormcxx . . $ $anonymous_type_9e3e468d83e34f36_0#fnorm.; |
| 41 | double deltacxx . . $ $anonymous_type_9e3e468d83e34f36_0#delta.; |
| 42 | double parcxx . . $ $anonymous_type_9e3e468d83e34f36_0#par.; |
| 43 | gsl_matrixcxx . . $ gsl_matrix# *rcxx . . $ $anonymous_type_9e3e468d83e34f36_0#r.; |
| 44 | gsl_vectorcxx . . $ gsl_vector# *taucxx . . $ $anonymous_type_9e3e468d83e34f36_0#tau.; |
| 45 | gsl_vectorcxx . . $ gsl_vector# *diagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#diag.; |
| 46 | gsl_vectorcxx . . $ gsl_vector# *qtfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#qtf.; |
| 47 | gsl_vectorcxx . . $ gsl_vector# *newtoncxx . . $ $anonymous_type_9e3e468d83e34f36_0#newton.; |
| 48 | gsl_vectorcxx . . $ gsl_vector# *gradientcxx . . $ $anonymous_type_9e3e468d83e34f36_0#gradient.; |
| 49 | gsl_vectorcxx . . $ gsl_vector# *x_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#x_trial.; |
| 50 | gsl_vectorcxx . . $ gsl_vector# *f_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#f_trial.; |
| 51 | gsl_vectorcxx . . $ gsl_vector# *dfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#df.; |
| 52 | gsl_vectorcxx . . $ gsl_vector# *sdiagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#sdiag.; |
| 53 | gsl_vectorcxx . . $ gsl_vector# *rptdxcxx . . $ $anonymous_type_9e3e468d83e34f36_0#rptdx.; |
| 54 | gsl_vectorcxx . . $ gsl_vector# *wcxx . . $ $anonymous_type_9e3e468d83e34f36_0#w.; |
| 55 | gsl_vectorcxx . . $ gsl_vector# *work1cxx . . $ $anonymous_type_9e3e468d83e34f36_0#work1.; |
| 56 | gsl_permutationcxx . . $ gsl_permutation# * permcxx . . $ $anonymous_type_9e3e468d83e34f36_0#perm.; |
| 57 | } |
| 58 | lmder_state_tcxx . . $ lmder_state_t#; |
| 59 | |
| 60 | static int lmder_alloccxx . . $ lmder_alloc(9a5c82343a5ae9bc). (void *vstate, size_t n, size_t p); |
| 61 | static int lmder_setcxx . . $ lmder_set(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx); |
| 62 | static int lmsder_setcxx . . $ lmsder_set(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx); |
| 63 | static int setcxx . . $ set(75a59fa53ef762b1). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx, int scale); |
| 64 | static int lmder_iteratecxx . . $ lmder_iterate(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx); |
| 65 | static void lmder_freecxx . . $ lmder_free(5d22bdacc48458e8). (void *vstate); |
| 66 | static int iteratecxx . . $ iterate(75a59fa53ef762b1). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx, int scale); |
| 67 | |
| 68 | #include "gsl_multifit__lmutil.c"cxx . . $ `<file>/external/gsl/gsl_multifit__lmutil.c`/ |
| 69 | #include "gsl_multifit__lmpar.c"cxx . . $ `<file>/external/gsl/gsl_multifit__lmpar.c`/ |
| 70 | #include "gsl_multifit__lmset.c"cxx . . $ `<file>/external/gsl/gsl_multifit__lmset.c`/ |
| 71 | #include "gsl_multifit__lmiterate.c"cxx . . $ `<file>/external/gsl/gsl_multifit__lmiterate.c`/ |
| 72 | |
| 73 | |
| 74 | static int |
| 75 | lmder_alloccxx . . $ lmder_alloc(9a5c82343a5ae9bc). (void *vstate, size_t n, size_t p) |
| 76 | { |
| 77 | lmder_state_tcxx . . $ lmder_state_t# *state = (lmder_state_tcxx . . $ lmder_state_t# *) vstate; |
| 78 | gsl_matrixcxx . . $ gsl_matrix# *r; |
| 79 | gsl_vectorcxx . . $ gsl_vector# *tau, *diag, *qtf, *newton, *gradient, *x_trial, *f_trial, |
| 80 | *df, *sdiag, *rptdx, *w, *work1; |
| 81 | gsl_permutationcxx . . $ gsl_permutation# *perm; |
| 82 | |
| 83 | r = gsl_matrix_calloccxx . . $ gsl_matrix_calloc(5a4d020b4836594). (n, p); |
| 84 | |
| 85 | if (r == 0) |
| 86 | { |
| 87 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for r", GSL_ENOMEM); |
| 88 | } |
| 89 | |
| 90 | state->rcxx . . $ $anonymous_type_9e3e468d83e34f36_0#r. = r; |
| 91 | |
| 92 | tau = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(n, p)); |
| 93 | |
| 94 | if (tau == 0) |
| 95 | { |
| 96 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 97 | |
| 98 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for tau", GSL_ENOMEM); |
| 99 | } |
| 100 | |
| 101 | state->taucxx . . $ $anonymous_type_9e3e468d83e34f36_0#tau. = tau; |
| 102 | |
| 103 | diag = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 104 | |
| 105 | if (diag == 0) |
| 106 | { |
| 107 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 108 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 109 | |
| 110 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for diag", GSL_ENOMEM); |
| 111 | } |
| 112 | |
| 113 | state->diagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#diag. = diag; |
| 114 | |
| 115 | qtf = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (n); |
| 116 | |
| 117 | if (qtf == 0) |
| 118 | { |
| 119 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 120 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 121 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 122 | |
| 123 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for qtf", GSL_ENOMEM); |
| 124 | } |
| 125 | |
| 126 | state->qtfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#qtf. = qtf; |
| 127 | |
| 128 | newton = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 129 | |
| 130 | if (newton == 0) |
| 131 | { |
| 132 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 133 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 134 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 135 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 136 | |
| 137 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for newton", GSL_ENOMEM); |
| 138 | } |
| 139 | |
| 140 | state->newtoncxx . . $ $anonymous_type_9e3e468d83e34f36_0#newton. = newton; |
| 141 | |
| 142 | gradient = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 143 | |
| 144 | if (gradient == 0) |
| 145 | { |
| 146 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 147 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 148 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 149 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 150 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 151 | |
| 152 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for gradient", GSL_ENOMEM); |
| 153 | } |
| 154 | |
| 155 | state->gradientcxx . . $ $anonymous_type_9e3e468d83e34f36_0#gradient. = gradient; |
| 156 | |
| 157 | x_trial = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 158 | |
| 159 | if (x_trial == 0) |
| 160 | { |
| 161 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 162 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 163 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 164 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 165 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 166 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 167 | |
| 168 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for x_trial", GSL_ENOMEM); |
| 169 | } |
| 170 | |
| 171 | state->x_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#x_trial. = x_trial; |
| 172 | |
| 173 | f_trial = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (n); |
| 174 | |
| 175 | if (f_trial == 0) |
| 176 | { |
| 177 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 178 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 179 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 180 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 181 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 182 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 183 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 184 | |
| 185 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for f_trial", GSL_ENOMEM); |
| 186 | } |
| 187 | |
| 188 | state->f_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#f_trial. = f_trial; |
| 189 | |
| 190 | df = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (n); |
| 191 | |
| 192 | if (df == 0) |
| 193 | { |
| 194 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 195 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 196 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 197 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 198 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 199 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 200 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 201 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 202 | |
| 203 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for df", GSL_ENOMEM); |
| 204 | } |
| 205 | |
| 206 | state->dfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#df. = df; |
| 207 | |
| 208 | sdiag = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 209 | |
| 210 | if (sdiag == 0) |
| 211 | { |
| 212 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 213 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 214 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 215 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 216 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 217 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 218 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 219 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 220 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (df); |
| 221 | |
| 222 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for sdiag", GSL_ENOMEM); |
| 223 | } |
| 224 | |
| 225 | state->sdiagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#sdiag. = sdiag; |
| 226 | |
| 227 | |
| 228 | rptdx = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (n); |
| 229 | |
| 230 | if (rptdx == 0) |
| 231 | { |
| 232 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 233 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 234 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 235 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 236 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 237 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 238 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 239 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 240 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (df); |
| 241 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (sdiag); |
| 242 | |
| 243 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for rptdx", GSL_ENOMEM); |
| 244 | } |
| 245 | |
| 246 | state->rptdxcxx . . $ $anonymous_type_9e3e468d83e34f36_0#rptdx. = rptdx; |
| 247 | |
| 248 | w = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (n); |
| 249 | |
| 250 | if (w == 0) |
| 251 | { |
| 252 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 253 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 254 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 255 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 256 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 257 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 258 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 259 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 260 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (df); |
| 261 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (sdiag); |
| 262 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (rptdx); |
| 263 | |
| 264 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for w", GSL_ENOMEM); |
| 265 | } |
| 266 | |
| 267 | state->wcxx . . $ $anonymous_type_9e3e468d83e34f36_0#w. = w; |
| 268 | |
| 269 | work1 = gsl_vector_calloccxx . . $ gsl_vector_calloc(71d9e095f27e8ea9). (p); |
| 270 | |
| 271 | if (work1 == 0) |
| 272 | { |
| 273 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 274 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 275 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 276 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 277 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 278 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 279 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 280 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 281 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (df); |
| 282 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (sdiag); |
| 283 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (rptdx); |
| 284 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (w); |
| 285 | |
| 286 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for work1", GSL_ENOMEM); |
| 287 | } |
| 288 | |
| 289 | state->work1cxx . . $ $anonymous_type_9e3e468d83e34f36_0#work1. = work1; |
| 290 | |
| 291 | perm = gsl_permutation_calloccxx . . $ gsl_permutation_calloc(311f4cfee96dd0e3). (p); |
| 292 | |
| 293 | if (perm == 0) |
| 294 | { |
| 295 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (r); |
| 296 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (tau); |
| 297 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (diag); |
| 298 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (qtf); |
| 299 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (newton); |
| 300 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (gradient); |
| 301 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (x_trial); |
| 302 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (f_trial); |
| 303 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (df); |
| 304 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (sdiag); |
| 305 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (rptdx); |
| 306 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (w); |
| 307 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (work1); |
| 308 | |
| 309 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("failed to allocate space for perm", GSL_ENOMEM); |
| 310 | } |
| 311 | |
| 312 | state->permcxx . . $ $anonymous_type_9e3e468d83e34f36_0#perm. = perm; |
| 313 | |
| 314 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 315 | } |
| 316 | |
| 317 | static int |
| 318 | lmder_setcxx . . $ lmder_set(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx) |
| 319 | { |
| 320 | int status = setcxx . . $ set(75a59fa53ef762b1). (vstate, fdf, x, f, J, dx, 0); |
| 321 | return status ; |
| 322 | } |
| 323 | |
| 324 | static int |
| 325 | lmsder_setcxx . . $ lmsder_set(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx) |
| 326 | { |
| 327 | int status = setcxx . . $ set(75a59fa53ef762b1). (vstate, fdf, x, f, J, dx, 1); |
| 328 | return status ; |
| 329 | } |
| 330 | |
| 331 | static int |
| 332 | lmder_iteratecxx . . $ lmder_iterate(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx) |
| 333 | { |
| 334 | int status = iteratecxx . . $ iterate(75a59fa53ef762b1). (vstate, fdf, x, f, J, dx, 0); |
| 335 | return status; |
| 336 | } |
| 337 | |
| 338 | static int |
| 339 | lmsder_iteratecxx . . $ lmsder_iterate(1d53496363c901fa). (void *vstate, gsl_multifit_function_fdfcxx . . $ gsl_multifit_function_fdf# * fdf, gsl_vectorcxx . . $ gsl_vector# * x, gsl_vectorcxx . . $ gsl_vector# * f, gsl_matrixcxx . . $ gsl_matrix# * J, gsl_vectorcxx . . $ gsl_vector# * dx) |
| 340 | { |
| 341 | int status = iteratecxx . . $ iterate(75a59fa53ef762b1). (vstate, fdf, x, f, J, dx, 1); |
| 342 | return status; |
| 343 | } |
| 344 | |
| 345 | static void |
| 346 | lmder_freecxx . . $ lmder_free(5d22bdacc48458e8). (void *vstate) |
| 347 | { |
| 348 | lmder_state_tcxx . . $ lmder_state_t# *state = (lmder_state_tcxx . . $ lmder_state_t# *) vstate; |
| 349 | |
| 350 | gsl_permutation_freecxx . . $ gsl_permutation_free(bfe6c130f63679fa). (state->permcxx . . $ $anonymous_type_9e3e468d83e34f36_0#perm.); |
| 351 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->work1cxx . . $ $anonymous_type_9e3e468d83e34f36_0#work1.); |
| 352 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->wcxx . . $ $anonymous_type_9e3e468d83e34f36_0#w.); |
| 353 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->rptdxcxx . . $ $anonymous_type_9e3e468d83e34f36_0#rptdx.); |
| 354 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->sdiagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#sdiag.); |
| 355 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->dfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#df.); |
| 356 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->f_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#f_trial.); |
| 357 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->x_trialcxx . . $ $anonymous_type_9e3e468d83e34f36_0#x_trial.); |
| 358 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->gradientcxx . . $ $anonymous_type_9e3e468d83e34f36_0#gradient.); |
| 359 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->newtoncxx . . $ $anonymous_type_9e3e468d83e34f36_0#newton.); |
| 360 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->qtfcxx . . $ $anonymous_type_9e3e468d83e34f36_0#qtf.); |
| 361 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->diagcxx . . $ $anonymous_type_9e3e468d83e34f36_0#diag.); |
| 362 | gsl_vector_freecxx . . $ gsl_vector_free(5d65852ca0326259). (state->taucxx . . $ $anonymous_type_9e3e468d83e34f36_0#tau.); |
| 363 | gsl_matrix_freecxx . . $ gsl_matrix_free(ab29a617cccd3636). (state->rcxx . . $ $anonymous_type_9e3e468d83e34f36_0#r.); |
| 364 | } |
| 365 | |
| 366 | static const gsl_multifit_fdfsolver_typecxx . . $ gsl_multifit_fdfsolver_type# lmder_typecxx . . $ lmder_type. = |
| 367 | { |
| 368 | "lmder", /* name */ |
| 369 | sizeof (lmder_state_tcxx . . $ lmder_state_t#), |
| 370 | &lmder_alloccxx . . $ lmder_alloc(9a5c82343a5ae9bc)., |
| 371 | &lmder_setcxx . . $ lmder_set(1d53496363c901fa)., |
| 372 | &lmder_iteratecxx . . $ lmder_iterate(1d53496363c901fa)., |
| 373 | &lmder_freecxx . . $ lmder_free(5d22bdacc48458e8). |
| 374 | }; |
| 375 | |
| 376 | static const gsl_multifit_fdfsolver_typecxx . . $ gsl_multifit_fdfsolver_type# lmsder_typecxx . . $ lmsder_type. = |
| 377 | { |
| 378 | "lmsder", /* name */ |
| 379 | sizeof (lmder_state_tcxx . . $ lmder_state_t#), |
| 380 | &lmder_alloccxx . . $ lmder_alloc(9a5c82343a5ae9bc)., |
| 381 | &lmsder_setcxx . . $ lmsder_set(1d53496363c901fa)., |
| 382 | &lmsder_iteratecxx . . $ lmsder_iterate(1d53496363c901fa)., |
| 383 | &lmder_freecxx . . $ lmder_free(5d22bdacc48458e8). |
| 384 | }; |
| 385 | |
| 386 | const gsl_multifit_fdfsolver_typecxx . . $ gsl_multifit_fdfsolver_type# *gsl_multifit_fdfsolver_lmdercxx . . $ gsl_multifit_fdfsolver_lmder. = &lmder_typecxx . . $ lmder_type.; |
| 387 | const gsl_multifit_fdfsolver_typecxx . . $ gsl_multifit_fdfsolver_type# *gsl_multifit_fdfsolver_lmsdercxx . . $ gsl_multifit_fdfsolver_lmsder. = &lmsder_typecxx . . $ lmsder_type.; |