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));
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));
475 if(root<TA || root>
TB) {
502 dbgprnt((
"Newton-count: %lu\n",count));
AlgLoop(Input i, double eps, unsigned long max_it, double t_min, double t_max, double t0)
void Set(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
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock
virtual double Value() override
get block output value this method should be defined in classes derived from aContiBlock
virtual std::string Name() const
get object name
base for continuous blocks with single input and algebraic loop check
Internal header file for SIMLIB/C++.
Implementation of class CalendarList interface is static - using global functions in SQS namespace.
void SIMLIB_error(const enum _ErrEnum N)
print error message and abort program
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 ...
void SIMLIB_warning(const enum _ErrEnum N)
print warning message and continue
Main SIMLIB/C++ interface.