APRONXX  0.9.12
Protected Attributes | List of all members
apron::dimperm Class Reference

Dimension permutation object (ap_dimperm_t wrapper). More...

#include <apxx_dimension.hh>

Inherits apron::use_malloc.

Public Member Functions

Constructors
 dimperm (size_t size=0)
 Makes an uninitialized dimperm of the given size. More...
 
 dimperm (size_t size, const ap_dim_t d[])
 Makes a dimperm initialized with the array d. More...
 
 dimperm (const std::vector< ap_dim_t > &d)
 Makes a dimperm initialized with the vector d. More...
 
 dimperm (id t)
 Makes an identity permutation. More...
 
 dimperm (const dimperm &x, bool inv=false)
 Makes a copy of a permutation, optionally inverting it. More...
 
 dimperm (const dimperm &x, const dimperm &y)
 Makes a new dimperm that is the composition of two permutations. More...
 
Destructor
 ~dimperm ()
 
Assignments
dimpermoperator= (const dimperm &x)
 Copies x. More...
 
dimpermoperator= (id t)
 Assigns the identity permutation to *this. More...
 
dimpermoperator= (const ap_dim_t d[])
 Assigns the permutation from the array d to *this. More...
 
dimpermoperator= (const std::vector< ap_dim_t > &d)
 Assigns the permutation from the vector d to *this (changing its size). More...
 
Accesses, size
size_t size () const
 Returns the size of the permutation. More...
 
ap_dim_t & operator[] (size_t dim)
 Returns a (modifiable) reference to the image of dim. More...
 
const ap_dim_t & operator[] (size_t dim) const
 Returns a reference to the image of dim. More...
 
ap_dim_t & get (size_t dim)
 Returns a (modifiable) reference to the image of dim (bound-checked). More...
 
const ap_dim_t & get (size_t dim) const
 Returns a reference to the image of dim (bound-checked). More...
 
C API compatibility
const ap_dimperm_t * get_ap_dimperm_t () const
 Returns a pointer to the internal APRON object stored in *this. More...
 
ap_dimperm_t * get_ap_dimperm_t ()
 Returns a pointer to the internal APRON object stored in *this. More...
 
- 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 Attributes

ap_dimperm_t c
 Structure managed by APRON. More...
 

Printing

void print (FILE *stream=stdout) const
 Prints to a C stream. More...
 
std::ostream & operator<< (std::ostream &os, const dimperm &s)
 Printing. More...
 

Operators

dimpermoperator *= (const dimperm &y)
 Composes *this with y. More...
 
void invert ()
 Inverts *this. More...
 
dimperm operator- () const
 Returns a new dimperm that is the inverse of *this. More...
 
dimperm operator * (const dimperm &x, const dimperm &y)
 Returns a new dimperm that is the composition of x and y. More...
 

Detailed Description

Dimension permutation object (ap_dimperm_t wrapper).

dimperm objects can be used to permute dimensions in expressions, constraints, and domains. They hold a map i->p[i]: [0,size-1]=>[0,size-1] using an array p of dimensions. All the p[i] must be distinct and in the range [0,size-1] where size is the size of p.

Constructor & Destructor Documentation

◆ dimperm() [1/6]

apron::dimperm::dimperm ( size_t  size = 0)
inline

Makes an uninitialized dimperm of the given size.

◆ dimperm() [2/6]

dimperm::dimperm ( size_t  size,
const ap_dim_t  d[] 
)
inline

Makes a dimperm initialized with the array d.

  • d should contain (at least) size dimensions.

◆ dimperm() [3/6]

dimperm::dimperm ( const std::vector< ap_dim_t > &  d)
inline

Makes a dimperm initialized with the vector d.

◆ dimperm() [4/6]

dimperm::dimperm ( id  t)
inline

Makes an identity permutation.

◆ dimperm() [5/6]

apron::dimperm::dimperm ( const dimperm x,
bool  inv = false 
)
inline

Makes a copy of a permutation, optionally inverting it.

  • inv if inv==true, then the constructed permutation is the inverse of x.

◆ dimperm() [6/6]

dimperm::dimperm ( const dimperm x,
const dimperm y 
)
inline

Makes a new dimperm that is the composition of two permutations.

◆ ~dimperm()

dimperm::~dimperm ( )
inline

Member Function Documentation

◆ get() [1/2]

ap_dim_t & dimperm::get ( size_t  dim)
inline

Returns a (modifiable) reference to the image of dim (bound-checked).

Exceptions
std::out_of_rangeis thrown if dim>=size.

◆ get() [2/2]

const ap_dim_t & dimperm::get ( size_t  dim) const
inline

Returns a reference to the image of dim (bound-checked).

Exceptions
std::out_of_rangeis thrown if dim>=size.

◆ get_ap_dimperm_t() [1/2]

const ap_dimperm_t * dimperm::get_ap_dimperm_t ( ) const
inline

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

◆ get_ap_dimperm_t() [2/2]

ap_dimperm_t * dimperm::get_ap_dimperm_t ( )
inline

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

◆ invert()

void dimperm::invert ( )
inline

Inverts *this.

◆ operator *=()

dimperm & dimperm::operator *= ( const dimperm y)
inline

Composes *this with y.

Exceptions
std::invalid_argumentif *this and y do not have the same size.

◆ operator-()

dimperm dimperm::operator- ( ) const
inline

Returns a new dimperm that is the inverse of *this.

◆ operator=() [1/4]

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

Copies x.

◆ operator=() [2/4]

dimperm & dimperm::operator= ( id  t)
inline

Assigns the identity permutation to *this.

◆ operator=() [3/4]

dimperm & dimperm::operator= ( const ap_dim_t  d[])
inline

Assigns the permutation from the array d to *this.

  • d should contain (at least) size dimensions.

◆ operator=() [4/4]

dimperm & dimperm::operator= ( const std::vector< ap_dim_t > &  d)
inline

Assigns the permutation from the vector d to *this (changing its size).

◆ operator[]() [1/2]

ap_dim_t & dimperm::operator[] ( size_t  dim)
inline

Returns a (modifiable) reference to the image of dim.

  • dim should be strictly smaller than size (not bound-checked).

◆ operator[]() [2/2]

const ap_dim_t & dimperm::operator[] ( size_t  dim) const
inline

Returns a reference to the image of dim.

  • dim should be strictly smaller than size (not bound-checked).

◆ print()

void dimperm::print ( FILE *  stream = stdout) const
inline

Prints to a C stream.

◆ size()

size_t dimperm::size ( ) const
inline

Returns the size of the permutation.

Friends And Related Function Documentation

◆ operator *

dimperm operator * ( const dimperm x,
const dimperm y 
)
friend

Returns a new dimperm that is the composition of x and y.

Exceptions
std::invalid_argumentif x and y do not have the same size.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const dimperm s 
)
friend

Printing.

Variable naming can be configured through the varname stream modifier.

Member Data Documentation

◆ c

ap_dimperm_t apron::dimperm::c
protected

Structure managed by APRON.


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