Debian Codegraph @

external/gsl/gsl_multifit__convergence.c

raw symbols SCIP
1 /* multifit/convergence.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 #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/
22 #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/
23 #include "gsl_multifit_nlin.h"cxx . . $ `<file>/external/gsl/gsl_multifit_nlin.h`/
24
25 int
26 gsl_multifit_test_deltacxx . . $ gsl_multifit_test_delta(d3d503392c4d34fa). (const gsl_vectorcxx . . $ gsl_vector# * dx, const gsl_vectorcxx . . $ gsl_vector# * x,
27 double epsabs, double epsrel)
28 {
29 size_tcxx . . $ size_t# i;
30 int ok = 1;
31 const size_tcxx . . $ size_t# n = x->sizecxx . . $ $anonymous_type_a8c2e3e00d6867c2_0#size. ;
32
33 if (epsrel < 0.0)
34 {
35 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("relative tolerance is negative", GSL_EBADTOL);
36 }
37
38 for (i = 0 ; i < n ; i++)
39 {
40 double xi = gsl_vector_getcxx . . $ gsl_vector_get(bd1f20df78adc7a).(x,i);
41 double dxi = gsl_vector_getcxx . . $ gsl_vector_get(bd1f20df78adc7a).(dx,i);
42 double tolerance = epsabs + epsrel * fabscxx . . $ fabs(447c67c6676f75c3).(xi) ;
43
44 if (fabscxx . . $ fabs(447c67c6676f75c3).(dxi) < tolerance)
45 {
46 ok = 1;
47 }
48 else
49 {
50 ok = 0;
51 break;
52 }
53 }
54
55 if (ok)
56 return GSL_SUCCESScxx . . $ GSL_SUCCESS. ;
57
58 return GSL_CONTINUEcxx . . $ GSL_CONTINUE.;
59 }
60
61 int
62 gsl_multifit_test_gradientcxx . . $ gsl_multifit_test_gradient(bf7e908a2166a95b). (const gsl_vectorcxx . . $ gsl_vector# * g, double epsabs)
63 {
64 size_tcxx . . $ size_t# i;
65
66 double residual = 0;
67
68 const size_tcxx . . $ size_t# n = g->sizecxx . . $ $anonymous_type_a8c2e3e00d6867c2_0#size.;
69
70 if (epsabs < 0.0)
71 {
72 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("absolute tolerance is negative", GSL_EBADTOL);
73 }
74
75 for (i = 0 ; i < n ; i++)
76 {
77 double gi = gsl_vector_getcxx . . $ gsl_vector_get(bd1f20df78adc7a).(g, i);
78
79 residual += fabscxx . . $ fabs(447c67c6676f75c3).(gi);
80 }
81
82
83 if (residual < epsabs)
84 {
85 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
86 }
87
88 return GSL_CONTINUEcxx . . $ GSL_CONTINUE. ;
89 }