APRONXX
0.9.12
|
Level 0 linear constraint (ap_lincons0_t wrapper). More...
#include <apxx_lincons0.hh>
Inherits apron::use_malloc.
Public Member Functions | |
Construtors | |
lincons0 (ap_constyp_t constyp=AP_CONS_SUPEQ) | |
Creates a new (non-modulo) constraint from an empty linear expression. More... | |
lincons0 (ap_constyp_t constyp, const linexpr0 &lin) | |
Creates a new (non-modulo) constraint from a linear expression (copied). More... | |
lincons0 (ap_constyp_t constyp, const linexpr0 &lin, const scalar &modulo) | |
Creates a new constraint from a linear expression and a modulo scalar (both copied). More... | |
lincons0 (const lincons0 &x) | |
(Deep) copy of a constraint. More... | |
lincons0 (const lincons0 &x, const dimchange &d) | |
Makes a (deep) copy of a constraint, and applies a dimension change to the underlying linear expression. More... | |
lincons0 (const lincons0 &x, const dimperm &d) | |
Makes a (deep) copy of a constraint, and applies a permutation to the underlying linear expression. More... | |
lincons0 (unsat x) | |
Makes an unsatisfiable constraint (-1>=0). More... | |
Destructor | |
~lincons0 () | |
Frees the constraint, including the embedded linear expression and optional modulo scalar. More... | |
Assignments | |
lincons0 & | operator= (const lincons0 &x) |
(Deep) copy. More... | |
lincons0 & | operator= (unsat x) |
Assigns an unsatisfiable constraint to *this (-1>=0). More... | |
void | set_modulo (const scalar &c) |
Sets the auxiliary scalar modulo to c (copied). More... | |
void | set_linexpr (const linexpr0 &c) |
Sets the underlying linear expression to c (copied). More... | |
Dimension operations | |
void | resize (size_t size) |
Resizes the underlying linear expression. More... | |
void | add_dimensions (const dimchange &d) |
Changes the dimension of the underlying linear expression. More... | |
void | permute_dimensions (const dimperm &d) |
Applies a permutation to the underlying linear expression. More... | |
Accesses, size | |
size_t | size () const |
Returns the size of the underlying linear expression. More... | |
ap_constyp_t & | get_constyp () |
Returns a (modifiable) reference to the constraint type. More... | |
const ap_constyp_t & | get_constyp () const |
Returns a reference to the constraint type. More... | |
bool | has_modulo () const |
Whether the constraint has a valid auxiliary scalar (used in modulo constraints). More... | |
bool | has_linexpr () const |
Whether the constraint has a valid linear expression. More... | |
scalar & | get_modulo () |
Returns a (modifiable) reference to the auxiliary scalar. More... | |
const scalar & | get_modulo () const |
Returns a reference to the auxiliary scalar. More... | |
linexpr0 & | get_linexpr () |
Returns a (modifiable) reference to the underlying linear expression. More... | |
const linexpr0 & | get_linexpr () const |
Returns a reference to the underlying linear expression. More... | |
coeff & | get_cst () |
Returns a (modifiable) reference to the constant coefficient. More... | |
const coeff & | get_cst () const |
Returns a reference to the constant coefficient. More... | |
coeff & | operator[] (ap_dim_t dim) |
Returns a (modifiable) reference to the coefficient corresponding to the given dimension. More... | |
const coeff & | operator[] (ap_dim_t dim) const |
Returns a reference to the coefficient corresponding to the given dimension. More... | |
Tests | |
bool | is_unsat () const |
Whether the constraint is unsatisfiable. More... | |
bool | is_linear () const |
Whether the underlying linear expression has only scalar coefficients. More... | |
bool | is_quasilinear () const |
Whether the underlying linear expression has only scalar coefficients, except maybe for the constant one. More... | |
C API compatibility | |
const ap_lincons0_t * | get_ap_lincons0_t () const |
Returns a pointer to the internal APRON object stored in *this. More... | |
ap_lincons0_t * | get_ap_lincons0_t () |
Returns a pointer to the internal APRON object stored in *this. More... | |
![]() | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void | operator delete (void *p) |
void | operator delete[] (void *p) |
Protected Member Functions | |
lincons0 (ap_lincons0_t l) | |
Internal use only. Performs a shallow copy and takes ownership of the contents. More... | |
Protected Attributes | |
ap_lincons0_t | l |
Structure managed by APRON. More... | |
Printing | |
std::ostream & | operator<< (std::ostream &os, const lincons0 &s) |
Printing. More... | |
void | print (char **name_of_dim=NULL, FILE *stream=stdout) const |
Prints to a C stream. More... | |
Level 0 linear constraint (ap_lincons0_t wrapper).
A lincons0 object represents a linear constraint: expr==0, expr>=0, expr>0, expr!=0, or expr==0 mod c. It stores and manages a linexpr0 (linear expression with scalar or interval coefficients), a constraint type (==, >=, >, !=, mod), and (for modulo constraint) an auxiliary scalar (c).
|
inlineprotected |
Internal use only. Performs a shallow copy and takes ownership of the contents.
|
inline |
Creates a new (non-modulo) constraint from an empty linear expression.
The auxiliary scalar is not created (has_modulo returns false). The linear expression is created sparse and empty (has_linexpr returns true).
constyp
can be AP_CONS_EQ
, AP_CONS_SUPEQ
, AP_CONS_SUP
, or AP_CONS_DISEQ
(but not AP_CONS_EQMOD
).
|
inline |
Creates a new (non-modulo) constraint from a linear expression (copied).
The auxiliary scalar is not created (has_modulo returns false).
constyp
can be AP_CONS_EQ
, AP_CONS_SUPEQ
, AP_CONS_SUP
, or AP_CONS_DISEQ
(but not AP_CONS_EQMOD
). Creates a new constraint from a linear expression and a modulo scalar (both copied).
constyp
can be AP_CONS_EQ
, AP_CONS_SUPEQ
, AP_CONS_SUP
, AP_CONS_EQMOD
, or AP_CONS_DISEQ
.
|
inline |
(Deep) copy of a constraint.
Makes a (deep) copy of a constraint, and applies a dimension change to the underlying linear expression.
Makes a (deep) copy of a constraint, and applies a permutation to the underlying linear expression.
|
inline |
Makes an unsatisfiable constraint (-1>=0).
|
inline |
Frees the constraint, including the embedded linear expression and optional modulo scalar.
|
inline |
Changes the dimension of the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Returns a (modifiable) reference to the constraint type.
AP_CONS_EQ
, AP_CONS_SUPEQ
, AP_CONS_SUP
, AP_CONS_EQMOD
, or AP_CONS_DISEQ
.
|
inline |
Returns a reference to the constraint type.
AP_CONS_EQ
, AP_CONS_SUPEQ
, AP_CONS_SUP
, AP_CONS_EQMOD
, or AP_CONS_DISEQ
.
|
inline |
Returns a (modifiable) reference to the constant coefficient.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a reference to the constant coefficient.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a (modifiable) reference to the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a reference to the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a (modifiable) reference to the auxiliary scalar.
std::invalid_argument | if no valid auxiliary scalar has been defined. |
|
inline |
Returns a reference to the auxiliary scalar.
std::invalid_argument | if no valid auxiliary scalar has been defined. |
|
inline |
Whether the constraint has a valid linear expression.
|
inline |
Whether the constraint has a valid auxiliary scalar (used in modulo constraints).
|
inline |
Whether the underlying linear expression has only scalar coefficients.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Whether the underlying linear expression has only scalar coefficients, except maybe for the constant one.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Whether the constraint is unsatisfiable.
std::invalid_argument | if no valid linear expression has been defined. |
Assigns an unsatisfiable constraint to *this (-1>=0).
|
inline |
Returns a (modifiable) reference to the coefficient corresponding to the given dimension.
std::out_of_range | if the expression is dense and the dimension exceeds the size of the expression; if the expression is sparse, it will be extended and no exception is thrown |
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Returns a reference to the coefficient corresponding to the given dimension.
std::out_of_range | if the expression is dense and the dimension exceeds the size of the expression; if the expression is sparse, it will be extended and no exception is thrown |
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Applies a permutation to the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Prints to a C stream.
|
inline |
Resizes the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
inline |
Sets the underlying linear expression to c (copied).
Does not fail as get_linexpr can: if the constraint was created without an underlying expression, it is created.
|
inline |
Sets the auxiliary scalar modulo to c (copied).
Does not fail as get_modulo can: if the constraint was created without an auxiliary scalar, it is created.
|
inline |
Returns the size of the underlying linear expression.
std::invalid_argument | if no valid linear expression has been defined. |
|
friend |
Printing.
Variable naming can be configured through the varname stream modifier.
std::invalid_argument | if the underlying expression is missing, or the auxiliary scalar is missing (for modulo). |
|
protected |
Structure managed by APRON.