COPASI API
4.16.103
|
#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 (Status status) | |
CValue (const double &d) | |
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) |
Protected Member Functions | |
void | Or (int s) |
void | Or (const CValue &v) |
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).
Definition at line 55 of file CFunctionAnalyzer.h.
Enumerator | |
---|---|
novalue | |
negative | |
zero | |
positive | |
invalid | |
known | |
unknown |
Definition at line 58 of file CFunctionAnalyzer.h.
|
inline |
|
inline |
Definition at line 72 of file CFunctionAnalyzer.h.
|
inline |
Definition at line 75 of file CFunctionAnalyzer.h.
bool CFunctionAnalyzer::CValue::containsInvalid | ( | ) | const |
Definition at line 385 of file CFunctionAnalyzer.cpp.
bool CFunctionAnalyzer::CValue::containsNegative | ( | ) | const |
Definition at line 369 of file CFunctionAnalyzer.cpp.
bool CFunctionAnalyzer::CValue::containsPositive | ( | ) | const |
Definition at line 333 of file CFunctionAnalyzer.cpp.
bool CFunctionAnalyzer::CValue::containsZero | ( | ) | const |
Definition at line 351 of file CFunctionAnalyzer.cpp.
|
staticprotected |
convert a CValue with status "known" to a more general status.
Definition at line 300 of file CFunctionAnalyzer.cpp.
Referenced by operator*().
|
inline |
Definition at line 85 of file CFunctionAnalyzer.h.
References mStatus.
Referenced by operator*(), operator+(), operator/(), and operator^().
|
inline |
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::invert | ( | ) | const |
Definition at line 187 of file CFunctionAnalyzer.cpp.
References mDouble, mStatus, and Or().
Referenced by operator-().
bool CFunctionAnalyzer::CValue::isInvalid | ( | ) | const |
Definition at line 378 of file CFunctionAnalyzer.cpp.
bool CFunctionAnalyzer::CValue::isNegative | ( | ) | const |
Definition at line 360 of file CFunctionAnalyzer.cpp.
bool CFunctionAnalyzer::CValue::isPositive | ( | ) | const |
Definition at line 324 of file CFunctionAnalyzer.cpp.
Referenced by CEvaluationNode::findTopMinus().
bool CFunctionAnalyzer::CValue::isZero | ( | ) | const |
Definition at line 342 of file CFunctionAnalyzer.cpp.
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator* | ( | const CValue & | rhs | ) | const |
Definition at line 57 of file CFunctionAnalyzer.cpp.
References generalize(), getStatus(), invalid, known, mDouble, mStatus, negative, Or(), orValue(), positive, and zero.
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator+ | ( | const CValue & | rhs | ) | const |
Definition at line 142 of file CFunctionAnalyzer.cpp.
References getStatus(), mDouble, mStatus, Or(), and orValue().
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator- | ( | const CValue & | rhs | ) | const |
Definition at line 201 of file CFunctionAnalyzer.cpp.
References invert().
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator/ | ( | const CValue & | rhs | ) | const |
Definition at line 101 of file CFunctionAnalyzer.cpp.
References getStatus(), mDouble, mStatus, Or(), and orValue().
bool CFunctionAnalyzer::CValue::operator== | ( | const CValue & | rhs | ) | const |
CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator^ | ( | const CValue & | rhs | ) | const |
Definition at line 206 of file CFunctionAnalyzer.cpp.
References getStatus(), mDouble, mStatus, Or(), and orValue().
|
inlineprotected |
Definition at line 116 of file CFunctionAnalyzer.h.
References mStatus.
Referenced by invert(), operator*(), operator+(), operator/(), operator^(), Or(), and orValue().
Definition at line 308 of file CFunctionAnalyzer.cpp.
References mDouble, mStatus, and Or().
|
inlineprotected |
add the value to the set off possible values
Definition at line 125 of file CFunctionAnalyzer.h.
References CValue(), and Or().
Referenced by operator*(), operator+(), operator/(), and operator^().
|
inline |
set value to be the only possible value
Definition at line 83 of file CFunctionAnalyzer.h.
References known, mDouble, and mStatus.
|
friend |
|
private |
Definition at line 130 of file CFunctionAnalyzer.h.
Referenced by getValue(), invert(), operator*(), operator+(), operator/(), operator<<(), operator==(), operator^(), Or(), and setValue().
|
private |
Definition at line 125 of file CFunctionAnalyzer.h.
Referenced by getStatus(), invert(), operator*(), operator+(), operator/(), operator<<(), operator==(), operator^(), Or(), setStatus(), and setValue().