COPASI API  4.40.278
CFunctionAnalyzer::CValue Class Reference

#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 StatusgetStatus () 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)
 

Detailed Description

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).

Member Enumeration Documentation

◆ Status

Enumerator
novalue 
negative 
zero 
positive 
invalid 
known 
unknown 

Constructor & Destructor Documentation

◆ CValue() [1/3]

CFunctionAnalyzer::CValue::CValue ( )

◆ CValue() [2/3]

CFunctionAnalyzer::CValue::CValue ( Status  status)

◆ CValue() [3/3]

CFunctionAnalyzer::CValue::CValue ( const double &  d)

◆ ~CValue()

CFunctionAnalyzer::CValue::~CValue ( )
virtual

Member Function Documentation

◆ containsInvalid()

bool CFunctionAnalyzer::CValue::containsInvalid ( ) const

◆ containsNegative()

bool CFunctionAnalyzer::CValue::containsNegative ( ) const

◆ containsPositive()

bool CFunctionAnalyzer::CValue::containsPositive ( ) const

◆ containsZero()

bool CFunctionAnalyzer::CValue::containsZero ( ) const

◆ generalize()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::generalize ( const double &  d)
staticprotected

convert a CValue with status "known" to a more general status.

◆ getStatus()

const CFunctionAnalyzer::CFunctionAnalyzer::CValue::Status & CFunctionAnalyzer::CValue::getStatus ( ) const

◆ getValue()

const double & CFunctionAnalyzer::CValue::getValue ( ) const

◆ invert()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::invert ( ) const

References mDouble, mStatus, and Or().

Referenced by operator-().

◆ isInvalid()

bool CFunctionAnalyzer::CValue::isInvalid ( ) const

◆ isNegative()

bool CFunctionAnalyzer::CValue::isNegative ( ) const

◆ isPositive()

bool CFunctionAnalyzer::CValue::isPositive ( ) const

◆ isZero()

bool CFunctionAnalyzer::CValue::isZero ( ) const

◆ operator*()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator* ( const CValue rhs) const

References getStatus(), mDouble, mStatus, Or(), and orValue().

◆ operator+()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator+ ( const CValue rhs) const

References getStatus(), mDouble, mStatus, Or(), and orValue().

◆ operator-()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator- ( const CValue rhs) const

References invert().

◆ operator/()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator/ ( const CValue rhs) const

References getStatus(), mDouble, mStatus, Or(), and orValue().

◆ operator==()

bool CFunctionAnalyzer::CValue::operator== ( const CValue rhs) const

References mDouble, and mStatus.

◆ operator^()

CFunctionAnalyzer::CValue CFunctionAnalyzer::CValue::operator^ ( const CValue rhs) const

References getStatus(), mDouble, mStatus, Or(), and orValue().

◆ Or() [1/2]

void CFunctionAnalyzer::CValue::Or ( const CValue v)
protected

References mDouble, mStatus, and Or().

◆ Or() [2/2]

void CFunctionAnalyzer::CValue::Or ( int  s)
protected

◆ orValue()

void CFunctionAnalyzer::CValue::orValue ( const double &  value)
protected

add the value to the set off possible values

Referenced by operator*(), operator+(), operator/(), and operator^().

◆ setStatus()

void CFunctionAnalyzer::CValue::setStatus ( const Status status)

◆ setValue()

void CFunctionAnalyzer::CValue::setValue ( const double &  value)

set value to be the only possible value

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CValue v 
)
friend

insert operator

Member Data Documentation

◆ mDouble

double CFunctionAnalyzer::CValue::mDouble
private

◆ mStatus

Status CFunctionAnalyzer::CValue::mStatus
private

The documentation for this class was generated from the following files: