COPASI API
4.40.278
|
#include <CRootFinder.h>
Classes | |
class | Eval |
class | EvalTemplate |
Public Types | |
enum | ReturnStatus { NotFound = 0 , RootFound = 1 , NotAdvanced = -1 , InvalidInterval = -2 } |
enum | RootMasking { NONE = 0 , DISCRETE = 1 , CONTINUOUS = 2 , ALL = 3 } |
Public Member Functions | |
C_FLOAT64 | brentRootValue (const C_FLOAT64 &time) |
ReturnStatus | checkRoots (const C_FLOAT64 &timeLeft, const C_FLOAT64 &timeRight, const RootMasking &rootMasking) |
CRootFinder () | |
CRootFinder (const CRootFinder &src) | |
const C_FLOAT64 & | getRootError () const |
const C_FLOAT64 & | getRootTime () const |
const CVectorCore< C_FLOAT64 > & | getRootValues () const |
const CVectorCore< C_INT > & | getToggledRoots () const |
void | initialize (Eval *pRootValueCalculator, const C_FLOAT64 &relativeTolerance, const CVectorCore< C_INT > &rootMask) |
void | restart () |
virtual | ~CRootFinder () |
Private Member Functions | |
void | calculateCurrentRoots (const C_FLOAT64 &time) |
bool | findToggledRoots (C_FLOAT64 &rootTime) |
CRootFinder::CRootFinder | ( | ) |
Default Constructor
References brentRootValue(), and mpBrentRootValueCalculator.
CRootFinder::CRootFinder | ( | const CRootFinder & | src | ) |
Copy Constructor
References brentRootValue(), CVectorCore< CType >::initialize(), mpBrentRootValueCalculator, and mRootMask.
|
virtual |
Destructor
References mpBrentRootValueCalculator, and pdelete.
Callback function for the one dimensional Brent method
const | C_FLOAT64 & time |
References CVectorCore< CType >::begin(), C_FLOAT64, C_INT, calculateCurrentRoots(), CVectorCore< CType >::end(), mRootMask, mRootMasking, mRootsCurrent, mRootsLeft, and mRootsRight.
Referenced by CRootFinder().
|
private |
References mRootsCurrent, and mTimeCurrent.
Referenced by brentRootValue(), and checkRoots().
CRootFinder::ReturnStatus CRootFinder::checkRoots | ( | const C_FLOAT64 & | timeLeft, |
const C_FLOAT64 & | timeRight, | ||
const RootMasking & | rootMasking | ||
) |
Check for roots in the interval [timeLeft, timeRight]. If a root is found true is returned and the time is returned in timeRoot, otherwise timeRoot is set to timeRight
const | C_FLOAT64 & timeLeft |
const | C_FLOAT64 & timeRight |
const | RootMasking & rootMasking |
References CVectorCore< CType >::begin(), C_FLOAT64, C_INT, calculateCurrentRoots(), CVectorCore< CType >::end(), CBrent::findRoot(), InvalidInterval, mpBrentRootValueCalculator, mRelativeTolerance, mRootError, mRootMask, mRootMasking, mRootsCurrent, mRootsLeft, mRootsRight, mTimeCurrent, mTimeLeft, mTimeRight, mToggledRootsCurrent, mToggledRootsLeft, mToggledRootsLeftValid, NotAdvanced, NotFound, CMath::NoToggle, RootFound, and CMath::ToggleBoth.
Referenced by CStochasticRungeKuttaRI5::internalStep().
|
private |
const C_FLOAT64 & CRootFinder::getRootError | ( | ) | const |
Retrieve the error of the last successful root calculation
References mRootError.
Referenced by CLsodaMethod2::destroyRootMask(), and CStochasticRungeKuttaRI5::destroyRootMask().
const C_FLOAT64 & CRootFinder::getRootTime | ( | ) | const |
Retrieve the time when the root was found
References mTimeCurrent.
Referenced by CStochasticRungeKuttaRI5::internalStep().
const CVectorCore< C_FLOAT64 > & CRootFinder::getRootValues | ( | ) | const |
Retrieve the values of the roots
References mRootsCurrent.
Referenced by CLsodaMethod2::start(), and CStochasticRungeKuttaRI5::start().
const CVectorCore< C_INT > & CRootFinder::getToggledRoots | ( | ) | const |
Retrieve the information on which roots have been found
References mToggledRootsCurrent.
Referenced by CLsodaMethod2::start(), and CStochasticRungeKuttaRI5::start().
void CRootFinder::initialize | ( | CRootFinder::Eval * | pRootValueCalculator, |
const C_FLOAT64 & | relativeTolerance, | ||
const CVectorCore< C_INT > & | rootMask | ||
) |
Set the function used to evaluate all root values for a given time
CRootFinder::Eval | * pRootValueCalculator |
const | C_FLOAT64 & relativeTolerance |
const | CVectorCore< bool > & rootMask |
References C_INT, CVectorCore< CType >::initialize(), mpRootValueCalculator, mRelativeTolerance, mRootError, mRootMask, mRootMasking, mRootsCurrent, mRootsLeft, mRootsRight, mToggledRootsCurrent, mToggledRootsLeft, mToggledRootsLeftValid, NONE, CMath::NoToggle, CVector< CType >::resize(), restart(), and CVectorCore< CType >::size().
Referenced by CLsodaMethod2::start(), and CStochasticRungeKuttaRI5::start().
void CRootFinder::restart | ( | ) |
Restart the root finder in case the systems state has changed
References mTimeLeft, and mTimeRight.
Referenced by initialize(), CStochasticRungeKuttaRI5::internalStep(), and CStochasticRungeKuttaRI5::stateChange().
|
private |
Pointer to method used for function evaluations for the Brent root finding method.
Referenced by checkRoots(), CRootFinder(), and ~CRootFinder().
|
private |
Referenced by initialize().
|
private |
Referenced by checkRoots(), and initialize().
|
private |
Referenced by checkRoots(), getRootError(), and initialize().
|
private |
Referenced by brentRootValue(), checkRoots(), CRootFinder(), and initialize().
|
private |
Referenced by brentRootValue(), checkRoots(), and initialize().
Referenced by brentRootValue(), calculateCurrentRoots(), checkRoots(), getRootValues(), and initialize().
Referenced by brentRootValue(), checkRoots(), and initialize().
Referenced by brentRootValue(), checkRoots(), and initialize().
|
private |
Referenced by calculateCurrentRoots(), checkRoots(), and getRootTime().
|
private |
Referenced by checkRoots(), and restart().
|
private |
Referenced by checkRoots(), and restart().
Referenced by checkRoots(), getToggledRoots(), and initialize().
Referenced by checkRoots(), and initialize().
|
private |
Referenced by checkRoots(), and initialize().