#include <BisectSolver.h>
Inheritance diagram for mcBisectSolver:
Definition at line 55 of file BisectSolver.h.
Public Member Functions | |
mcBisectSolver () | |
virtual | ~mcBisectSolver () |
bool | math_SolveLine (mcMathLine &, const mcSymbolProperties *unk, mcSystemStepArray &) |
Solves the given mcMathLine for the given unknown with the bisection algorithm. | |
bool | math_WorksOn (const mcMathOrSystem &m) const |
Returns TRUE if the given system does not contain more than one type of unknown and if it does not contain parameters. | |
bool | math_isReady () const |
Returns TRUE if this solver is ready to work. | |
wxPanel * | gui_GetOptionsPanel () const |
Returns the panel containing the options for this algorithm. | |
void | math_SetDelta (const mcRealValue &d) |
Changes the delta which defines the approximation error which is accepted by the program. | |
bool | math_SetStartRange (const mcRange &r, const mcMathLine &p, const mcSymbolProperties *) |
Sets the start range for the algorithm. | |
Protected Member Functions | |
mcRealValue | math_Bisect (mcMathLine &tosolve, const mcSymbolProperties *unk, const mcRealValue &a, const mcRealValue &b, const mcRealValue &fa, const mcRealValue &fb) |
The recursive bisect function. | |
mcRealValue | math_Bisect (mcMathLine &tosolve, const mcSymbolProperties *unk, const mcRealValue &a, const mcRealValue &b) |
Starts the bisection algorithm in the given range, calculating the values of the function in the two given points and then calls the #Bisect function. | |
Protected Attributes | |
mcRealValue | m_fDelta |
The precision to which the algorithm searches the solution: is m_fDelta is 0.01 and the exact solution of #m_pCurrLine is 1.567, then mcBisectSolver will return a value comprised between 1.567-0.01 and 1.567+0.01. | |
mcExtRange | m_rStart |
The range where the bisection algorithm is applied at the beginning. |
|
Definition at line 88 of file BisectSolver.h. References m_fDelta, mcBISECTSOLVER_DEFAULT_DELTA, and mcST_BISECTION. |
|
Definition at line 96 of file BisectSolver.h. |
|
Returns the panel containing the options for this algorithm. The returned pointer must be deleted by the caller, when it is not required anymore... If the returned value is NULL, no options are available for this solver. Implements mcSolver. Definition at line 112 of file BisectSolver.h. |
|
Starts the bisection algorithm in the given range, calculating the values of the function in the two given points and then calls the #Bisect function.
Definition at line 78 of file BisectSolver.cpp. References math_Bisect(). |
|
The recursive bisect function.
Definition at line 88 of file BisectSolver.cpp. References mcRealValue::abs(), m_fDelta, mcASSERT, mcSOLVERLOG, and mcTXTV. Referenced by math_Bisect(), and math_SolveLine(). |
|
Returns TRUE if this solver is ready to work. This function can be used to check if all the options/settings for this solver have been correctly set and the #Solve() function will correctly work (on a system where #WorksOn returns TRUE). Implements mcSolver. Definition at line 150 of file BisectSolver.cpp. References m_rStart, and mcExtRange::math_isFinite(). |
|
Changes the delta which defines the approximation error which is accepted by the program.
Definition at line 117 of file BisectSolver.h. References m_fDelta. |
|
Sets the start range for the algorithm. If the given range (for the given system) is wrong, then FALSE is returned and mcSolver::GetLastErr() can be used to retrieve the error description; returns TRUE on success. Definition at line 157 of file BisectSolver.cpp. References mcExtRange::data_DeepCopy(), mcSymbolArray::data_GetSymbol(), and m_rStart. |
|
Solves the given mcMathLine for the given unknown with the bisection algorithm. You can find good docs about this algorithm on the web: it is based over the theorem of zero existence. Implements mcSolver. Definition at line 119 of file BisectSolver.cpp. References mcExtRange::data_GetRange(), m_rStart, math_Bisect(), mcRange::math_GetLowerLimitValue(), mcRange::math_GetUpperLimitValue(), mcASSERT, mcMMT_EQUATION, mcSOLVERLOG, mcTXTP, and mcTXTV. |
|
Returns TRUE if the given system does not contain more than one type of unknown and if it does not contain parameters.
Implements mcSolver. Definition at line 62 of file BisectSolver.cpp. References mcMSTL1_EQUATIONS. |
|
The precision to which the algorithm searches the solution: is m_fDelta is 0.01 and the exact solution of #m_pCurrLine is 1.567, then mcBisectSolver will return a value comprised between 1.567-0.01 and 1.567+0.01.
Definition at line 64 of file BisectSolver.h. Referenced by math_Bisect(), math_SetDelta(), and mcBisectSolver(). |
|
The range where the bisection algorithm is applied at the beginning.
Definition at line 67 of file BisectSolver.h. Referenced by math_isReady(), math_SetStartRange(), and math_SolveLine(). |
[ Top ] |