Program listing for file numerics/src/tools/SolverOptions_helpers.h

Program listing for file numerics/src/tools/SolverOptions_helpers.h#

 1#ifndef SolverOptions_helpers_H
 2#define SolverOptions_helpers_H
 3
 4
 5
 6#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
 7extern "C"
 8{
 9#endif
10
11
12  inline static void SN_set_tolerance(double* dparam, double tol) { dparam[0] = tol; }
13
14
15  inline static double SN_get_tolerance(double* dparam) { return dparam[0]; }
16
17
18  inline static void SN_set_residual(double* dparam, double res) { dparam[1] = res; }
19
20
21  inline static double SN_get_residual(double* dparam) { return dparam[1]; }
22
23
24  inline static void SN_set_max_iters(int* iparam, int max_iters) { iparam[0] = max_iters; }
25
26
27  inline static int SN_get_max_iters(int* iparam) { return iparam[1]; }
28
29
30  inline static void SN_set_nb_iters(int* iparam, int nb_iters) { iparam[1] = nb_iters; }
31
32
33  inline static int SN_get_nb_iters(int* iparam) { return iparam[1]; }
34
35#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
36}
37#endif
38
39
40#endif