Public Types | |
enum | Type { LINE, RAY, POINT, CLOSURE_POINT } |
The generator type. More... | |
Public Member Functions | |
Generator (const Generator &g) | |
Ordinary copy-constructor. | |
~Generator () | |
Destructor. | |
Generator & | operator= (const Generator &g) |
Assignment operator. | |
dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . | |
Type | type () const |
Returns the generator type of *this . | |
bool | is_line () const |
Returns true if and only if *this is a line. | |
bool | is_ray () const |
Returns true if and only if *this is a ray. | |
bool | is_point () const |
Returns true if and only if *this is a point. | |
bool | is_closure_point () const |
Returns true if and only if *this is a closure point. | |
const Integer & | coefficient (Variable v) const |
Returns the coefficient of v in *this . | |
const Integer & | divisor () const |
If *this is either a point or a closure point, returns its divisor. | |
bool | OK () const |
Checks if all the invariants are satisfied. | |
Static Public Member Functions | |
Generator | line (const LinExpression &e) |
Shorthand for Generator Generator::line(const LinExpression& e). | |
Generator | ray (const LinExpression &e) |
Shorthand for Generator Generator::ray(const LinExpression& e). | |
Generator | point (const LinExpression &e=LinExpression::zero(), const Integer &d=Integer_one()) |
Shorthand for Generator Generator::point(const LinExpression& e, const Integer& d). | |
Generator | closure_point (const LinExpression &e=LinExpression::zero(), const Integer &d=Integer_one()) |
Shorthand for Generator Generator::closure_point(const LinExpression& e, const Integer& d). | |
const Generator & | zero_dim_point () |
Returns the origin of the zero-dimensional space ![]() | |
const Generator & | zero_dim_closure_point () |
Returns, as a closure point, the origin of the zero-dimensional space ![]() | |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &s, const Generator &g) |
Output operator. | |
void | swap (Parma_Polyhedra_Library::Generator &x, Parma_Polyhedra_Library::Generator &y) |
Specializes std::swap . |
An object of the class Generator is one of the following:
where is the dimension of the space and, for points and closure points,
is the divisor.
line
, ray
, point
or closure_point
) to a linear expression, representing a direction in the space; the space-dimension of the generator is defined as the space-dimension of the corresponding linear expression. Linear expressions used to define a generator should be homogeneous (any constant term will be simply ignored). When defining points and closure points, an optional Integer argument can be used as a common divisor for all the coefficients occurring in the provided linear expression; the default value for this argument is 1.x
, y
and z
are defined as follows: Variable x(0); Variable y(1); Variable z(2);
point
is optional. point
(the divisor): Obviously, the divisor can be usefully exploited to specify points having some non-integer (but rational) coordinates. For instance, the point Generator c = closure_point(1*x + 0*y + 2*z);
Generator closure_origin0 = Generator::zero_dim_closure_point(); Generator closure_origin0_alt = closure_point();
g1
is a point having coordinates g2
having coordinates if (g1.is_point()) { cout << "Point g1: " << g1 << endl; LinExpression e; for (int i = g1.space_dimension() - 1; i >= 0; i--) e += (i + 1) * g1.coefficient(Variable(i)) * Variable(i); Generator g2 = closure_point(e, g1.divisor()); cout << "Closure point g2: " << g2 << endl; } else cout << "Generator g1 is not a point." << endl;
Point g1: p((2*A - B + 3*C)/2) Closure point g2: cp((2*A - 2*B + 9*C)/2)
|
The generator type.
|
|
Shorthand for Generator Generator::line(const LinExpression& e).
|
|
Shorthand for Generator Generator::ray(const LinExpression& e).
|
|
Shorthand for Generator Generator::point(const LinExpression& e, const Integer& d).
Both
|
|
Shorthand for Generator Generator::closure_point(const LinExpression& e, const Integer& d).
Both
|
|
Returns the coefficient of
|
|
If
|