Public Member Functions | |
LinExpression () | |
Default constructor: returns a copy of LinExpression::zero(). | |
LinExpression (const LinExpression &e) | |
Ordinary copy-constructor. | |
~LinExpression () | |
Destructor. | |
LinExpression (const Integer &n) | |
Builds the linear expression corresponding to the inhomogeneous term n . | |
LinExpression (const Variable v) | |
Builds the linear expression corresponding to the variable v . | |
LinExpression (const Constraint &c) | |
Builds the linear expression corresponding to constraint c . | |
LinExpression (const Generator &g) | |
Builds the linear expression corresponding to generator g (for points and closure points, the divisor is not copied). | |
dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . | |
const Integer & | coefficient (Variable v) const |
Returns the coefficient of v in *this . | |
const Integer & | inhomogeneous_term () const |
Returns the inhomogeneous term of *this . | |
Static Public Member Functions | |
const LinExpression & | zero () |
Returns the (zero-dimension space) constant 0. | |
Related Functions | |
(Note that these are not member functions.) | |
LinExpression | operator+ (const LinExpression &e1, const LinExpression &e2) |
Returns the linear expression e1 + e2 . | |
LinExpression | operator+ (const Integer &n, const LinExpression &e) |
Returns the linear expression n + e . | |
LinExpression | operator+ (const LinExpression &e, const Integer &n) |
Returns the linear expression e + n . | |
LinExpression | operator+ (const LinExpression &e) |
Returns the linear expression e . | |
LinExpression | operator- (const LinExpression &e) |
Returns the linear expression - e . | |
LinExpression | operator- (const LinExpression &e1, const LinExpression &e2) |
Returns the linear expression e1 - e2 . | |
LinExpression | operator- (const Integer &n, const LinExpression &e) |
Returns the linear expression n - e . | |
LinExpression | operator- (const LinExpression &e, const Integer &n) |
Returns the linear expression e - n . | |
LinExpression | operator * (const Integer &n, const LinExpression &e) |
Returns the linear expression n * e . | |
LinExpression | operator * (const LinExpression &e, const Integer &n) |
Returns the linear expression e * n . | |
LinExpression & | operator+= (LinExpression &e1, const LinExpression &e2) |
Returns the linear expression e1 + e2 and assigns it to e1 . | |
LinExpression & | operator+= (LinExpression &e, const Variable v) |
Returns the linear expression e + v and assigns it to e . | |
LinExpression & | operator+= (LinExpression &e, const Integer &n) |
Returns the linear expression e + n and assigns it to e . | |
LinExpression & | operator-= (LinExpression &e1, const LinExpression &e2) |
Returns the linear expression e1 - e2 and assigns it to e1 . | |
LinExpression & | operator-= (LinExpression &e, const Variable v) |
Returns the linear expression e - v and assigns it to e . | |
LinExpression & | operator-= (LinExpression &e, const Integer &n) |
Returns the linear expression e - n and assigns it to e . | |
LinExpression & | operator *= (LinExpression &e, const Integer &n) |
Returns the linear expression n * e and assigns it to e . | |
std::ostream & | operator<< (std::ostream &s, const LinExpression &e) |
Output operator. | |
void | swap (Parma_Polyhedra_Library::LinExpression &x, Parma_Polyhedra_Library::LinExpression &y) |
Specializes std::swap . |
An object of the class LinExpression represents the linear expression
where is the dimension of the space, each
is the integer coefficient of the
i
-th variable and
is the integer for the inhomogeneous term.
x
is defined as x.id()+1
, whereas all the objects of the class Integer have space-dimension zero.
LinExpression e = 4*x - 2*y - z + 14;
LinExpression e1 = 4*x; LinExpression e2 = 2*y; LinExpression e3 = z; LinExpression e = LinExpression(14); e += e1 - e2 - e3;
e1
, e2
and e3
have space-dimension 1, 2 and 3, respectively; also, in the fourth line of code, e
is created with space-dimension zero and then extended to space-dimension 3.
|
Builds the linear expression corresponding to constraint
Given the constraint |
|
Builds the linear expression corresponding to generator
Given the generator |