COPASI API
4.16.103
|
#include <CNormalFraction.h>
Public Member Functions | |
bool | cancel () |
bool | checkDenominatorOne () const |
bool | checkForFractions () const |
bool | checkIsOne () const |
bool | checkIsZero () const |
bool | checkNumeratorOne () const |
CNormalFraction () | |
CNormalFraction (const CNormalFraction &src) | |
virtual CNormalBase * | copy () const |
bool | expand (const CNormalLcm &lcm) |
const CNormalLcm * | findLcm () const |
CNormalSum & | getDenominator () |
const CNormalSum & | getDenominator () const |
CNormalSum & | getNumerator () |
const CNormalSum & | getNumerator () const |
bool | multiply (const C_FLOAT64 &number) |
bool | multiply (const CNormalItemPower &itemPower) |
const CNormalSum * | multiply (CNormalLcm lcm) |
bool | operator< (const CNormalFraction &src) const |
CNormalFraction & | operator= (const CNormalFraction &src) |
bool | operator== (const CNormalFraction &rhs) const |
bool | setDenominator (const CNormalSum &denominator) |
bool | setDenominatorOne () |
bool | setNumerator (const CNormalSum &numerator) |
virtual bool | simplify () |
virtual std::string | toString () const |
virtual | ~CNormalFraction () |
![]() | |
virtual bool | areEqual (const CNormalBase &rhs) const |
virtual | ~CNormalBase () |
Static Public Member Functions | |
static CNormalFraction * | createUnitFraction () |
Private Attributes | |
CNormalSum * | mpDenominator |
CNormalSum * | mpNumerator |
Definition at line 32 of file CNormalFraction.h.
CNormalFraction::CNormalFraction | ( | ) |
Default constructor
Definition at line 47 of file CNormalFraction.cpp.
Referenced by copy(), and createUnitFraction().
CNormalFraction::CNormalFraction | ( | const CNormalFraction & | src | ) |
Copy contructor
Definition at line 52 of file CNormalFraction.cpp.
|
virtual |
bool CNormalFraction::cancel | ( | ) |
Cancel common items of mpNumerator and mpDenominator.
Definition at line 211 of file CNormalFraction.cpp.
References C_FLOAT64, CNormalSum::checkFactor(), checkForFractions(), CNormalSum::divide(), CNormalSum::getFractions(), CNormalSum::getProducts(), mpDenominator, mpNumerator, CNormalSum::multiply(), setDenominatorOne(), and setNumerator().
Referenced by createFraction(), and simplify().
bool CNormalFraction::checkDenominatorOne | ( | ) | const |
Check if the denominator of this fraction equals 1.
Definition at line 124 of file CNormalFraction.cpp.
References CNormalSum::checkIsOne(), and mpDenominator.
Referenced by convertToCEvaluationNode(), CNormalProduct::getDenominator(), is_mass_action(), normalize_variable_names(), CNormalGeneralPower::toString(), and toString().
bool CNormalFraction::checkForFractions | ( | ) | const |
Check if this fraction contains further fractions.
Definition at line 184 of file CNormalFraction.cpp.
References CNormalSum::getFractions(), mpDenominator, and mpNumerator.
Referenced by cancel().
bool CNormalFraction::checkIsOne | ( | ) | const |
Definition at line 518 of file CNormalFraction.cpp.
References mpDenominator, and mpNumerator.
Referenced by CNormalGeneralPower::checkIsOne(), convertToCEvaluationNode(), and CNormalSum::simplify().
bool CNormalFraction::checkIsZero | ( | ) | const |
Definition at line 524 of file CNormalFraction.cpp.
References CNormalSum::checkIsZero(), and mpNumerator.
Referenced by CNormalGeneralPower::checkIsOne().
bool CNormalFraction::checkNumeratorOne | ( | ) | const |
Check if the numerator of this fraction equals 1.
Check if the denominator of this fraction equals 1.
Definition at line 115 of file CNormalFraction.cpp.
References CNormalSum::checkIsOne(), and mpNumerator.
|
virtual |
Implements CNormalBase.
Definition at line 434 of file CNormalFraction.cpp.
References CNormalFraction().
|
static |
Returns a fraction that is 1/1. It creates a new fraction and sets the numerator and the denominator to a unit sum.
Definition at line 530 of file CNormalFraction.cpp.
References CNormalFraction(), CNormalSum::createUnitSum(), mpDenominator, and mpNumerator.
Referenced by CNormalGeneralPower::createUnitGeneralPower(), CNormalGeneralPower::multiply(), CNormalSum::simplify(), and test_simplify::test_simplify_1().
bool CNormalFraction::expand | ( | const CNormalLcm & | lcm | ) |
Expand this fraction by a lcm.
Definition at line 196 of file CNormalFraction.cpp.
References CNormalSum::getSize(), mpDenominator, mpNumerator, and CNormalSum::multiply().
Referenced by simplify().
const CNormalLcm * CNormalFraction::findLcm | ( | ) | const |
Find lcm of denominators of respective fractions contained in this fraction.
Definition at line 329 of file CNormalFraction.cpp.
References CNormalLcm::add(), CNormalSum::getFractions(), mpDenominator, and mpNumerator.
Referenced by simplify().
CNormalSum & CNormalFraction::getDenominator | ( | ) |
Retrieve the denominator of this fraction.
Definition at line 157 of file CNormalFraction.cpp.
References mpDenominator.
Referenced by convertToCEvaluationNode(), CNormalGeneralPower::multiply(), normalize_variable_names(), CNormalSum::simplify(), test_simplify::test_simplify_1(), and CNormalGeneralPower::toString().
const CNormalSum & CNormalFraction::getDenominator | ( | ) | const |
Retrieve the denominator of this fraction.
Definition at line 175 of file CNormalFraction.cpp.
References mpDenominator.
CNormalSum & CNormalFraction::getNumerator | ( | ) |
Retrieve the numerator of this fraction.
Definition at line 148 of file CNormalFraction.cpp.
References mpNumerator.
Referenced by CNormalSum::add(), convertToCEvaluationNode(), is_mass_action(), CNormalGeneralPower::multiply(), normalize_variable_names(), test_simplify::test_simplify_1(), and CNormalGeneralPower::toString().
const CNormalSum & CNormalFraction::getNumerator | ( | ) | const |
Retrieve the numerator of this fraction.
Definition at line 166 of file CNormalFraction.cpp.
References mpNumerator.
bool CNormalFraction::multiply | ( | const C_FLOAT64 & | number | ) |
Multiply this fraction with a number.
Definition at line 282 of file CNormalFraction.cpp.
References CNormalSum::getSize(), mpNumerator, CNormalSum::multiply(), and setDenominatorOne().
bool CNormalFraction::multiply | ( | const CNormalItemPower & | itemPower | ) |
Multiply a fraction with an itempower.
Definition at line 296 of file CNormalFraction.cpp.
References C_FLOAT64, CNormalSum::checkFactor(), CNormalSum::divide(), CNormalItemPower::getExp(), CNormalItemPower::getItem(), mpDenominator, mpNumerator, and CNormalSum::multiply().
const CNormalSum * CNormalFraction::multiply | ( | CNormalLcm | lcm | ) |
Multiply this fraction by a lcm.
Definition at line 357 of file CNormalFraction.cpp.
References CNormalSum::getFractions(), mpDenominator, mpNumerator, CNormalSum::multiply(), and CNormalLcm::remove().
bool CNormalFraction::operator< | ( | const CNormalFraction & | src | ) | const |
smaller operator
Definition at line 439 of file CNormalFraction.cpp.
References mpDenominator, and mpNumerator.
CNormalFraction & CNormalFraction::operator= | ( | const CNormalFraction & | src | ) |
Assignment operator
Definition at line 59 of file CNormalFraction.cpp.
References mpDenominator, and mpNumerator.
bool CNormalFraction::operator== | ( | const CNormalFraction & | rhs | ) | const |
bool CNormalFraction::setDenominator | ( | const CNormalSum & | denominator | ) |
Set denominator of this fraction.
Definition at line 96 of file CNormalFraction.cpp.
References CNormalSum::getSize(), and mpDenominator.
Referenced by createFraction(), CNormalProduct::getDenominator(), setDenominatorOne(), CNormalProduct::setDenominatorsOne(), and CNormalSum::simplify().
bool CNormalFraction::setDenominatorOne | ( | ) |
Set the denominator of this fraction equal 1.
Definition at line 133 of file CNormalFraction.cpp.
References CNormalSum::add(), and setDenominator().
Referenced by cancel(), and multiply().
bool CNormalFraction::setNumerator | ( | const CNormalSum & | numerator | ) |
Set numerator of this fraction
Definition at line 81 of file CNormalFraction.cpp.
References mpNumerator.
Referenced by cancel(), createFraction(), CNormalProduct::getDenominator(), CNormalGeneralPower::multiply(), and CNormalSum::simplify().
|
virtual |
Check if numerator and denominator contain fractions, find lcm of respective denominators, expand this fraction by lcm and cancel.
Implements CNormalBase.
Definition at line 379 of file CNormalFraction.cpp.
References cancel(), expand(), findLcm(), CNormalSum::getFractions(), mpDenominator, mpNumerator, and CNormalSum::simplify().
Referenced by CNormalTranslation::normAndSimplify(), CNormalLogicalItem::simplify(), CNormalGeneralPower::simplify(), CNormalChoice::simplify(), CNormalFunction::simplify(), CNormalSum::simplify(), and test_simplify::test_simplify_1().
|
virtual |
Implements CNormalBase.
Definition at line 418 of file CNormalFraction.cpp.
References checkDenominatorOne(), mpDenominator, and mpNumerator.
Referenced by CNormalTranslation::elementaryEliminationDivide(), CNormalTranslation::elementaryEliminationMinus(), CNormalTranslation::elementaryEliminationModulus(), CNormalTranslation::matchPowerBases(), CNormalTranslation::matchSummands(), CNormalTranslation::normAndSimplifyReptdly(), operator<<(), test_biomodels217_expression::test_term_num1(), and CNormalChoice::toString().
|
private |
Definition at line 39 of file CNormalFraction.h.
Referenced by cancel(), checkDenominatorOne(), checkForFractions(), checkIsOne(), createUnitFraction(), expand(), findLcm(), getDenominator(), multiply(), operator<(), operator=(), operator==(), setDenominator(), simplify(), toString(), and ~CNormalFraction().
|
private |
Enumeration of members
Definition at line 38 of file CNormalFraction.h.
Referenced by cancel(), checkForFractions(), checkIsOne(), checkIsZero(), checkNumeratorOne(), createUnitFraction(), expand(), findLcm(), getNumerator(), multiply(), operator<(), operator=(), operator==(), setNumerator(), simplify(), toString(), and ~CNormalFraction().