Otawa
0.10
|
This class is used to represent constraints in an ILP system with the following form: More...
#include <otawa/ilp/Constraint.h>
Classes | |
class | TermIterator |
Public Types | |
enum | comparator_t { UNDEF = -3, LT = -2, LE = -1, EQ = 0, GE = 1, GT = 2 } |
typedef otawa::ilp::Term | Term |
typedef enum otawa::ilp::Constraint::comparator_t | comparator_t |
Public Member Functions | |
virtual | ~Constraint (void) |
virtual double | coefficient (Var *var=0) const =0 |
Get the coefficient for the given variable. More... | |
virtual double | constant (void) const =0 |
virtual comparator_t | comparator (void) const =0 |
Get the constraint comparator. More... | |
virtual const string & | label (void) const =0 |
virtual void | add (double coef, Var *var=0)=0 |
Add a term to the constraint to the left part of constraint. More... | |
virtual void | sub (double coef, Var *var=0)=0 |
Substact a factor from the constraint. More... | |
virtual elm::datastruct::IteratorInst < Term > * | terms (void)=0 |
void | addLeft (double coef, Var *var=0) |
Add a factor on the left side. More... | |
void | addRight (double coef, Var *var=0) |
Add a factor on the right side. More... | |
virtual void | setComparator (comparator_t comp)=0 |
virtual void | setLabel (const string &label)=0 |
void | add (const Term &t) |
void | sub (const Term &t) |
void | add (const Expression &e) |
void Constraint::setComparator(comparator_t comp); Change the comparator of the constraint. More... | |
void | sub (const Expression &e) |
Subtract an expression from the left part of the constraint. More... | |
This class is used to represent constraints in an ILP system with the following form:
|
inlinevirtual |
|
pure virtual |
Add a term to the constraint to the left part of constraint.
If var is null, sum the coefficient to the right part of the constraint.
coef | Coefficient of the factor. |
var | Variable of the factor. When null, modify the constant. |
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by add(), otawa::ipet::ConstraintLoader::addConstraint(), addLeft(), addRight(), otawa::ilp::cons::operator+(), otawa::ilp::cons::operator+=(), otawa::ilp::cons::operator-(), otawa::ilp::cons::operator-=(), otawa::cat::CATConstraintBuilder::processLBlockSet(), and otawa::ccg::ConstraintBuilder::processLBlockSet().
|
inline |
References add(), otawa::ilp::Term::fst, and otawa::ilp::Term::snd.
Referenced by add().
void otawa::ilp::Constraint::add | ( | const Expression & | e | ) |
void Constraint::setComparator(comparator_t comp); Change the comparator of the constraint.
comp | Comparator to set. |
label | Label to set. |
e | Added expression. |
References add().
|
inline |
Add a factor on the left side.
coef | Coefficient of the factor. |
var | Variable of the factor. |
References add().
Referenced by otawa::ccg::ConstraintBuilder::addConstraintHeader(), otawa::etime::EdgeTimeBuilder::contributeSplit(), otawa::etime::StandardEventBuilder::handleVariableBranchPred(), otawa::ipet::CachePenaltiesObjectFunctionBuilder::processBB(), otawa::branch::OnlyConsBuilder::processBB(), otawa::ipet::FlowFactConstraintBuilder::processBB(), otawa::tsim::Delta::processBBPath(), otawa::cat::CATConstraintBuilder::processLBlockSet(), otawa::ccg::ConstraintBuilder::processLBlockSet(), otawa::EdgeCAT2ConstraintBuilder::processWorkSpace(), otawa::CAT2OnlyConstraintBuilder::processWorkSpace(), and otawa::dcache::CatConstraintBuilder::processWorkSpace().
|
inline |
Add a factor on the right side.
coef | Coefficient of the factor. |
var | Variable of the factor. |
References add().
Referenced by otawa::ccg::ConstraintBuilder::addConstraintHeader(), otawa::etime::EdgeTimeBuilder::contributeSplit(), otawa::etime::StandardEventBuilder::handleVariableBranchPred(), otawa::etime::EventCollector::make(), otawa::ipet::CachePenaltiesObjectFunctionBuilder::processBB(), otawa::branch::OnlyConsBuilder::processBB(), otawa::ipet::FlowFactConstraintBuilder::processBB(), otawa::tsim::Delta::processBBPath(), otawa::cat::CATConstraintBuilder::processLBlockSet(), otawa::ccg::ConstraintBuilder::processLBlockSet(), otawa::EdgeCAT2ConstraintBuilder::processWorkSpace(), otawa::CAT2OnlyConstraintBuilder::processWorkSpace(), and otawa::dcache::CatConstraintBuilder::processWorkSpace().
|
pure virtual |
Get the coefficient for the given variable.
var | Variable to get the coefficent of. Null variable allows getting the constant part. |
Implemented in otawa::ilp::AbstractConstraint.
|
pure virtual |
Get the constraint comparator.
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by otawa::display::ILPSystemDisplayer::displayCons(), and otawa::ilp::System::dumpLPSolve().
|
pure virtual |
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by otawa::display::ILPSystemDisplayer::displayCons(), and otawa::ilp::System::dumpLPSolve().
|
pure virtual |
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by otawa::display::ILPSystemDisplayer::displayCons(), and otawa::ilp::System::dumpLPSolve().
|
pure virtual |
Referenced by otawa::ilp::cons::set().
|
pure virtual |
Implemented in otawa::ilp::AbstractConstraint.
Referenced by otawa::ilp::model::operator()().
|
pure virtual |
Substact a factor from the constraint.
coef | Coefficient of the factor. |
var | Variable of the factor. |
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by otawa::ilp::cons::operator+(), otawa::ilp::cons::operator+=(), otawa::ilp::cons::operator-(), otawa::ilp::cons::operator-=(), and sub().
|
inline |
References otawa::ilp::Term::fst, otawa::ilp::Term::snd, and sub().
Referenced by sub().
void otawa::ilp::Constraint::sub | ( | const Expression & | e | ) |
Subtract an expression from the left part of the constraint.
e | Subtracted expression. |
References sub().
|
pure virtual |
Implemented in otawa::ilp::ConstraintImpl, and otawa::ilp::AbstractConstraint.
Referenced by otawa::ilp::System::dumpLPSolve().