APRONXX 0.9.15
apron::lincons0 Class Reference

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.
 
 lincons0 (ap_constyp_t constyp, const linexpr0 &lin)
 Creates a new (non-modulo) constraint from a linear expression (copied).
 
 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).
 
 lincons0 (const lincons0 &x)
 (Deep) copy of a constraint.
 
 lincons0 (const lincons0 &x, const dimchange &d)
 Makes a (deep) copy of a constraint, and applies a dimension change to the underlying linear expression.
 
 lincons0 (const lincons0 &x, const dimperm &d)
 Makes a (deep) copy of a constraint, and applies a permutation to the underlying linear expression.
 
 lincons0 (unsat x)
 Makes an unsatisfiable constraint (-1>=0).
 
Destructor
 ~lincons0 ()
 Frees the constraint, including the embedded linear expression and optional modulo scalar.
 
Assignments
lincons0operator= (const lincons0 &x)
 (Deep) copy.
 
lincons0operator= (unsat x)
 Assigns an unsatisfiable constraint to *this (-1>=0).
 
void set_modulo (const scalar &c)
 Sets the auxiliary scalar modulo to c (copied).
 
void set_linexpr (const linexpr0 &c)
 Sets the underlying linear expression to c (copied).
 
Dimension operations
void resize (size_t size)
 Resizes the underlying linear expression.
 
void add_dimensions (const dimchange &d)
 Changes the dimension of the underlying linear expression.
 
void permute_dimensions (const dimperm &d)
 Applies a permutation to the underlying linear expression.
 
Accesses, size
size_t size () const
 Returns the size of the underlying linear expression.
 
ap_constyp_t & get_constyp ()
 Returns a (modifiable) reference to the constraint type.
 
const ap_constyp_t & get_constyp () const
 Returns a reference to the constraint type.
 
bool has_modulo () const
 Whether the constraint has a valid auxiliary scalar (used in modulo constraints).
 
bool has_linexpr () const
 Whether the constraint has a valid linear expression.
 
scalarget_modulo ()
 Returns a (modifiable) reference to the auxiliary scalar.
 
const scalarget_modulo () const
 Returns a reference to the auxiliary scalar.
 
linexpr0get_linexpr ()
 Returns a (modifiable) reference to the underlying linear expression.
 
const linexpr0get_linexpr () const
 Returns a reference to the underlying linear expression.
 
coeffget_cst ()
 Returns a (modifiable) reference to the constant coefficient.
 
const coeffget_cst () const
 Returns a reference to the constant coefficient.
 
coeffoperator[] (ap_dim_t dim)
 Returns a (modifiable) reference to the coefficient corresponding to the given dimension.
 
const coeffoperator[] (ap_dim_t dim) const
 Returns a reference to the coefficient corresponding to the given dimension.
 
Tests
bool is_unsat () const
 Whether the constraint is unsatisfiable.
 
bool is_linear () const
 Whether the underlying linear expression has only scalar coefficients.
 
bool is_quasilinear () const
 Whether the underlying linear expression has only scalar coefficients, except maybe for the constant one.
 
C API compatibility
const ap_lincons0_t * get_ap_lincons0_t () const
 Returns a pointer to the internal APRON object stored in *this.
 
ap_lincons0_t * get_ap_lincons0_t ()
 Returns a pointer to the internal APRON object stored in *this.
 
- Public Member Functions inherited from apron::use_malloc
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.
 

Protected Attributes

ap_lincons0_t l
 Structure managed by APRON.
 

Printing

void print (char **name_of_dim=NULL, FILE *stream=stdout) const
 Prints to a C stream.
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ lincons0() [1/8]

lincons0::lincons0 ( ap_lincons0_t l)
inlineprotected

Internal use only. Performs a shallow copy and takes ownership of the contents.

◆ lincons0() [2/8]

lincons0::lincons0 ( ap_constyp_t constyp = AP_CONS_SUPEQ)
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).

◆ lincons0() [3/8]

lincons0::lincons0 ( ap_constyp_t constyp,
const linexpr0 & lin )
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).

◆ lincons0() [4/8]

lincons0::lincons0 ( ap_constyp_t constyp,
const linexpr0 & lin,
const scalar & modulo )
inline

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.

◆ lincons0() [5/8]

lincons0::lincons0 ( const lincons0 & x)
inline

(Deep) copy of a constraint.

◆ lincons0() [6/8]

lincons0::lincons0 ( const lincons0 & x,
const dimchange & d )
inline

Makes a (deep) copy of a constraint, and applies a dimension change to the underlying linear expression.

◆ lincons0() [7/8]

lincons0::lincons0 ( const lincons0 & x,
const dimperm & d )
inline

Makes a (deep) copy of a constraint, and applies a permutation to the underlying linear expression.

◆ lincons0() [8/8]

lincons0::lincons0 ( unsat x)
inline

Makes an unsatisfiable constraint (-1>=0).

◆ ~lincons0()

lincons0::~lincons0 ( )
inline

Frees the constraint, including the embedded linear expression and optional modulo scalar.

Member Function Documentation

◆ add_dimensions()

void lincons0::add_dimensions ( const dimchange & d)
inline

Changes the dimension of the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ get_ap_lincons0_t() [1/2]

ap_lincons0_t * lincons0::get_ap_lincons0_t ( )
inline

Returns a pointer to the internal APRON object stored in *this.

◆ get_ap_lincons0_t() [2/2]

const ap_lincons0_t * lincons0::get_ap_lincons0_t ( ) const
inline

Returns a pointer to the internal APRON object stored in *this.

◆ get_constyp() [1/2]

ap_constyp_t & lincons0::get_constyp ( )
inline

Returns a (modifiable) reference to the constraint type.

Returns
either AP_CONS_EQ, AP_CONS_SUPEQ, AP_CONS_SUP, AP_CONS_EQMOD, or AP_CONS_DISEQ.

◆ get_constyp() [2/2]

const ap_constyp_t & lincons0::get_constyp ( ) const
inline

Returns a reference to the constraint type.

Returns
either AP_CONS_EQ, AP_CONS_SUPEQ, AP_CONS_SUP, AP_CONS_EQMOD, or AP_CONS_DISEQ.

◆ get_cst() [1/2]

coeff & lincons0::get_cst ( )
inline

Returns a (modifiable) reference to the constant coefficient.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ get_cst() [2/2]

const coeff & lincons0::get_cst ( ) const
inline

Returns a reference to the constant coefficient.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ get_linexpr() [1/2]

linexpr0 & lincons0::get_linexpr ( )
inline

Returns a (modifiable) reference to the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ get_linexpr() [2/2]

const linexpr0 & lincons0::get_linexpr ( ) const
inline

Returns a reference to the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ get_modulo() [1/2]

scalar & lincons0::get_modulo ( )
inline

Returns a (modifiable) reference to the auxiliary scalar.

Exceptions
std::invalid_argumentif no valid auxiliary scalar has been defined.

◆ get_modulo() [2/2]

const scalar & lincons0::get_modulo ( ) const
inline

Returns a reference to the auxiliary scalar.

Exceptions
std::invalid_argumentif no valid auxiliary scalar has been defined.

◆ has_linexpr()

bool lincons0::has_linexpr ( ) const
inline

Whether the constraint has a valid linear expression.

Note
The only way the linear expression may be invalid is when accessing fields of uninitialised (or enlarged) lincons0_array.

◆ has_modulo()

bool lincons0::has_modulo ( ) const
inline

Whether the constraint has a valid auxiliary scalar (used in modulo constraints).

◆ is_linear()

bool lincons0::is_linear ( ) const
inline

Whether the underlying linear expression has only scalar coefficients.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ is_quasilinear()

bool lincons0::is_quasilinear ( ) const
inline

Whether the underlying linear expression has only scalar coefficients, except maybe for the constant one.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ is_unsat()

bool lincons0::is_unsat ( ) const
inline

Whether the constraint is unsatisfiable.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ operator=() [1/2]

lincons0 & lincons0::operator= ( const lincons0 & x)
inline

(Deep) copy.

◆ operator=() [2/2]

lincons0 & lincons0::operator= ( unsat x)
inline

Assigns an unsatisfiable constraint to *this (-1>=0).

◆ operator[]() [1/2]

coeff & lincons0::operator[] ( ap_dim_t dim)
inline

Returns a (modifiable) reference to the coefficient corresponding to the given dimension.

Exceptions
std::out_of_rangeif 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_argumentif no valid linear expression has been defined.

◆ operator[]() [2/2]

const coeff & lincons0::operator[] ( ap_dim_t dim) const
inline

Returns a reference to the coefficient corresponding to the given dimension.

Exceptions
std::out_of_rangeif 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_argumentif no valid linear expression has been defined.

◆ permute_dimensions()

void lincons0::permute_dimensions ( const dimperm & d)
inline

Applies a permutation to the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ print()

void lincons0::print ( char ** name_of_dim = NULL,
FILE * stream = stdout ) const
inline

Prints to a C stream.

◆ resize()

void lincons0::resize ( size_t size)
inline

Resizes the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

◆ set_linexpr()

void lincons0::set_linexpr ( const linexpr0 & c)
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.

◆ set_modulo()

void lincons0::set_modulo ( const scalar & c)
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.

◆ size()

size_t lincons0::size ( ) const
inline

Returns the size of the underlying linear expression.

Exceptions
std::invalid_argumentif no valid linear expression has been defined.

Member Data Documentation

◆ l

ap_lincons0_t apron::lincons0::l
protected

Structure managed by APRON.


The documentation for this class was generated from the following files: