🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
Zeros.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "zeros.h"
25
26
AST_NAMESPACE_BEGIN
27
28
namespace
details{
29
template
<
typename
Func>
30
A_ALWAYS_INLINE
double
callback_func(
double
x,
void
* func)
31
{
32
return
(*(Func*)func)(x);
33
}
34
}
35
52
template
<
typename
Func>
53
double
bisect(Func f,
double
xa,
double
xb,
double
xtol,
double
rtol,
int
iter, scipy_zeros_info &solver_stats)
54
{
55
return ::bisect(details::callback_func<Func>, xa, xb, xtol, rtol, iter, &f, &solver_stats);
56
}
57
58
69
template
<
typename
Func>
70
double
ridder(Func f,
double
xa,
double
xb,
double
xtol,
double
rtol,
int
iter, scipy_zeros_info &solver_stats)
71
{
72
return ::ridder(details::callback_func<Func>, xa, xb, xtol, rtol, iter, &f, &solver_stats);
73
}
74
75
86
template
<
typename
Func>
87
double
brenth(Func f,
double
xa,
double
xb,
double
xtol,
double
rtol,
int
iter, scipy_zeros_info &solver_stats)
88
{
89
return ::brenth(details::callback_func<Func>, xa, xb, xtol, rtol, iter, &f, &solver_stats);
90
}
91
92
103
template
<
typename
Func>
104
double
brentq(Func f,
double
xa,
double
xb,
double
xtol,
double
rtol,
int
iter, scipy_zeros_info &solver_stats)
105
{
106
return ::brentq(details::callback_func<Func>, xa, xb, xtol, rtol, iter, &f, &solver_stats);
107
}
108
109
120
template
<
typename
Func>
121
double
secant(Func f,
double
xa,
double
xb,
double
xtol,
double
rtol,
int
iter, scipy_zeros_info &solver_stats)
122
{
123
return ::secant(details::callback_func<Func>, xa, xb, xtol, rtol, iter, &f, &solver_stats);
124
}
125
126
129
AST_NAMESPACE_END
src
AstMath
NLE
Impl
Zeros
Zeros.hpp
制作者
1.12.0