23 #define dbgprnt(x) { printf x; } 40 double t_min,
double t_max,
double t0) :
54 if(t0>t_max || t0<t_min) {
64 double t_min,
double t_max,
double t0)
69 if(t0>t_max || t0<t_min) {
84 double t_min,
double t_max)
116 unsigned long count=0;
147 if(root<TA || root>
TB) {
152 }
while(fabs(
root-prev_root)>
Eps);
156 dbgprnt((
"Iterations-count: %lu\n",count));
181 unsigned long count=0;
257 }
while(fabs(ft)>
Eps && 0.5*(tb-ta)>
Eps);
262 dbgprnt((
"Bisect-count: %lu\n",count));
287 unsigned long count=0;
290 double prev_root = 0;
343 root=(ta*fb-tb*fa)/(fb-fa);
372 dbgprnt((
"feps: %12.9g\n",feps));
375 dbgprnt((
"eps_root: %12.9g\n",eps_root));
382 }
while((fabs(ft)>
Eps && fabs(
root-prev_root)>
Eps) || feps*ft>0);
387 dbgprnt((
"RegulaFalsi-count: %lu\n",count));
404 unsigned long count=0;
405 double trat=1.0+(
TB-
TA)*1.0e-3;
439 dbgprnt((
"f[-1]: %g\n",prev_ft));
442 dbgprnt((
"root[-1]: %g\n",prev_root));
459 root=(prev_root*ft -
root*prev_ft) / (ft - prev_ft);
475 if(root<TA || root>
TB) {
490 dbgprnt((
"eps_root: %g\n",eps_root));
497 }
while((fabs(ft)>
Eps && fabs(
root-prev_root)>
Eps) || feps*ft>0);
502 dbgprnt((
"Newton-count: %lu\n",count));
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock ...
void Set(double eps, unsigned long max_it, double t_min, double t_max, double t0)
void SIMLIB_error(const enum _ErrEnum N)
print error message and abort program
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock ...
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
void SIMLIB_warning(const enum _ErrEnum N)
print warning message and continue
std::string SIMLIB_create_tmp_name(const char *fmt,...)
printf-like function to create temporary name (the length of temporary names is limited) used only ...
AlgLoop(Input i, double eps, unsigned long max_it, double t_min, double t_max, double t0)
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock ...
Internal header file for SIMLIB/C++.
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock ...
Main SIMLIB/C++ interface.
virtual std::string Name() const
get object name
base for continuous blocks with single input and algebraic loop check