🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
zeros.h
1/* Written by Charles Harris charles.harris@sdl.usu.edu */
2
3/* Modified to not depend on Python everywhere by Travis Oliphant.
4 */
5
6/*
7 * Modified to be used in ast project.
8 */
9
10#include "AstGlobal.h"
11#include "AstMath/SolverStats.h"
12
13#ifndef ZEROS_H
14#define ZEROS_H
15
16// typedef struct {
17// int funcalls;
18// int iterations;
19// int error_num;
20// } scipy_zeros_info;
21
22typedef struct _AST SolverStats scipy_zeros_info;
23
24
25/* Must agree with _ECONVERGED, _ESIGNERR, _ECONVERR in zeros.py */
26#define CONVERGED 0
27#define SIGNERR -1
28#define CONVERR -2
29#define EVALUEERR -3
30#define INPROGRESS 1
31
32typedef double (*callback_type)(double, void*);
33typedef double (*solver_type)(callback_type, double, double, double, double,
34 int, void *, scipy_zeros_info*);
35
36AST_MATH_CAPI double bisect(callback_type f, double xa, double xb, double xtol,
37 double rtol, int iter, void *func_data_param,
38 scipy_zeros_info *solver_stats);
39AST_MATH_CAPI double ridder(callback_type f, double xa, double xb, double xtol,
40 double rtol, int iter, void *func_data_param,
41 scipy_zeros_info *solver_stats);
42AST_MATH_CAPI double brenth(callback_type f, double xa, double xb, double xtol,
43 double rtol, int iter, void *func_data_param,
44 scipy_zeros_info *solver_stats);
45AST_MATH_CAPI double brentq(callback_type f, double xa, double xb, double xtol,
46 double rtol, int iter, void *func_data_param,
47 scipy_zeros_info *solver_stats);
48AST_MATH_CAPI double secant(double(*func)(double, void*), double xa, double xb, double xtol,
49 double rtol, int iter, void *func_data_param,
50 scipy_zeros_info *solver_stats);
51
52#endif
struct ast::SolverStats SolverStats
求解器统计信息