Public Types | |
typedef void | output_function_type (std::ostream &s, const Variable &v) |
Type of output functions. | |
Public Member Functions | |
Variable (dimension_type i) | |
Builds the variable corresponding to the Cartesian axis of index i . | |
dimension_type | id () const |
Returns the index of the Cartesian axis associated to the variable. | |
Static Public Member Functions | |
void | set_output_function (output_function_type *p) |
Sets the output function to be used for printing Variable objects. | |
output_function_type * | get_output_function () |
Returns the pointer to the current output function. | |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &s, const Variable &v) |
Output operator. | |
bool | less (Variable v, Variable w) |
Defines a total ordering on variables. |
An object of the class Variable represents a dimension of the space, that is one of the Cartesian axes. Variables are used as base blocks in order to build more complex linear expressions. Each variable is identified by a non-negative integer, representing the index of the corresponding Cartesian axis (the first axis has index 0).
Note that the ``meaning'' of an object of the class Variable is completely specified by the integer index provided to its constructor: be careful not to be mislead by C++ language variable names. For instance, in the following example the linear expressions e1
and e2
are equivalent, since the two variables x
and z
denote the same Cartesian axis.