COPASI API
4.40.278
|
#include <CFunctionAnalyzer.h>
Public Types | |
enum | Status { novalue = 0 , negative = 1 , zero = 2 , positive = 4 , invalid = 8 , known = 16 , unknown = 7 } |
Public Member Functions | |
bool | containsInvalid () const |
bool | containsNegative () const |
bool | containsPositive () const |
bool | containsZero () const |
CValue () | |
CValue (const double &d) | |
CValue (Status status) | |
const Status & | getStatus () const |
const double & | getValue () const |
CValue | invert () const |
bool | isInvalid () const |
bool | isNegative () const |
bool | isPositive () const |
bool | isZero () const |
CValue | operator* (const CValue &rhs) const |
CValue | operator+ (const CValue &rhs) const |
CValue | operator- (const CValue &rhs) const |
CValue | operator/ (const CValue &rhs) const |
bool | operator== (const CValue &rhs) const |
CValue | operator^ (const CValue &rhs) const |
void | setStatus (const Status &status) |
void | setValue (const double &value) |
virtual | ~CValue () |
Protected Member Functions | |
void | Or (const CValue &v) |
void | Or (int s) |
void | orValue (const double &value) |
Static Protected Member Functions | |
static CValue | generalize (const double &d) |
Private Attributes | |
double | mDouble |
Status | mStatus |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CValue &v) |
This is the base class of the arithmetics of the function analyzer. It describes possibilities for values. It basically consists of some flags that tell whether the value can be positive, can be negative, can be zero, or invalid, or if an actual exact numerical value is known. The usual arithmetic operators are defined for this class, the most important functions need to be implemented still. The missing functions are not critical since there is a save fallback: If you do not know how to perform a specific operation on CValues, the result should be (unknown|invalid).
CFunctionAnalyzer::CValue::CValue | ( | ) |
CFunctionAnalyzer::CValue::CValue | ( | Status | status | ) |
CFunctionAnalyzer::CValue::CValue | ( | const double & | d | ) |
|
virtual |
bool CFunctionAnalyzer::CValue::containsInvalid | ( | ) | const |
bool CFunctionAnalyzer::CValue::containsNegative | ( | ) | const |
bool CFunctionAnalyzer::CValue::containsPositive | ( | ) | const |
bool CFunctionAnalyzer::CValue::containsZero | ( | ) | const |
|
staticprotected |
convert a CValue with status "known" to a more general status.
const CFunctionAnalyzer::CFunctionAnalyzer::CValue::Status & CFunctionAnalyzer::CValue::getStatus | ( | ) | const |
Referenced by operator*(), operator+(), operator/(), and operator^().
const double & CFunctionAnalyzer::CValue::getValue | ( | ) | const |
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::invert | ( | ) | const |
References mDouble, mStatus, and Or().
Referenced by operator-().
bool CFunctionAnalyzer::CValue::isInvalid | ( | ) | const |
bool CFunctionAnalyzer::CValue::isNegative | ( | ) | const |
bool CFunctionAnalyzer::CValue::isPositive | ( | ) | const |
Referenced by CEvaluationNode::findTopMinus().
bool CFunctionAnalyzer::CValue::isZero | ( | ) | const |
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator* | ( | const CValue & | rhs | ) | const |
References getStatus(), mDouble, mStatus, Or(), and orValue().
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator+ | ( | const CValue & | rhs | ) | const |
References getStatus(), mDouble, mStatus, Or(), and orValue().
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator- | ( | const CValue & | rhs | ) | const |
References invert().
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator/ | ( | const CValue & | rhs | ) | const |
References getStatus(), mDouble, mStatus, Or(), and orValue().
bool CFunctionAnalyzer::CValue::operator== | ( | const CValue & | rhs | ) | const |
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator^ | ( | const CValue & | rhs | ) | const |
References getStatus(), mDouble, mStatus, Or(), and orValue().
|
protected |
|
protected |
Referenced by invert(), operator*(), operator+(), operator/(), operator^(), and Or().
|
protected |
add the value to the set off possible values
Referenced by operator*(), operator+(), operator/(), and operator^().
void CFunctionAnalyzer::CValue::setStatus | ( | const Status & | status | ) |
void CFunctionAnalyzer::CValue::setValue | ( | const double & | value | ) |
set value to be the only possible value
|
friend |
insert operator
|
private |
Referenced by invert(), operator*(), operator+(), operator/(), operator==(), operator^(), and Or().
|
private |
Referenced by invert(), operator*(), operator+(), operator/(), operator==(), operator^(), and Or().