Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

priced.h File Reference

Functions for handling priced DBMs. More...

#include <cstdio>
#include <utility>
#include "base/inttypes.h"
#include "dbm/dbm.h"
#include "dbm/mingraph.h"

Go to the source code of this file.

Typedefs

typedef PDBM_sPDBM
 Data type for priced dbm.

Functions

size_t pdbm_size (cindex_t dim)
 Computes the size in number of bytes of a priced dbm of the given dimension.
PDBM pdbm_reserve (cindex_t dim, void *p)
 Reserves a memory area for use as a priced DBM.
PDBM pdbm_allocate (cindex_t dim)
 Allocates a new priced DBM.
void pdbm_deallocate (PDBM &pdbm)
 Deallocates a priced DBM.
static void pdbm_incRef (PDBM pdbm)
 Increases reference count on priced DBM.
static void pdbm_decRef (PDBM pdbm)
 Decreases reference count on priced DBM.
PDBM pdbm_copy (PDBM dst, const PDBM src, cindex_t dim)
 Copy a priced DBM.
void pdbm_init (PDBM &pdbm, cindex_t dim)
 Initialises a priced DBM to the DBM containing all valuations.
void pdbm_zero (PDBM &pdbm, cindex_t dim)
 Initialize a priced DBM to only contain the origin with a cost of 0.
bool pdbm_constrain1 (PDBM &pdbm, cindex_t dim, cindex_t i, cindex_t j, raw_t constraint)
 Constrain a priced DBM.
bool pdbm_constrainN (PDBM &pdbm, cindex_t dim, const constraint_t *constraints, size_t n)
 Constrain a priced DBM with multiple constraints.
bool pdbm_constrainToFacet (PDBM &pdbm, cindex_t dim, cindex_t i, cindex_t j)
 Constrain a priced DBM to a facet (i, j).
relation_t pdbm_relation (const PDBM pdbm1, const PDBM pdbm2, cindex_t dim)
 Relation between two priced DBMs.
relation_t pdbm_relationWithMinDBM (const PDBM pdbm, cindex_t dim, const mingraph_t minDBM, raw_t *buffer)
 Relation between 2 priced dbms where one is in compressed.
int32_t pdbm_getInfimum (const PDBM pdbm, cindex_t dim)
 Computes the infimum cost of the priced DBM.
int32_t pdbm_getInfimumValuation (const PDBM pdbm, cindex_t dim, int32_t *valuation, const bool *free)
 Generates a valuation which has the infimum cost of the priced DBM.
bool pdbm_satisfies (const PDBM pdbm, cindex_t dim, cindex_t i, cindex_t j, raw_t constraint)
 Check if a priced DBM satisfies a given constraint.
bool pdbm_isEmpty (const PDBM pdbm, cindex_t dim)
 Returns true if the priced DBM is empty.
bool pdbm_isUnbounded (const PDBM pdbm, cindex_t dim)
 Check if at least one point can delay infinitely.
uint32_t pdbm_hash (const PDBM pdbm, cindex_t dim, uint32_t seed)
 Compute a hash value for a priced DBM.
bool pdbm_containsInt (const PDBM pdbm, cindex_t dim, const int32_t *pt)
 Test if a point is included in the priced DBM.
bool pdbm_containsDouble (const PDBM pdbm, cindex_t dim, const double *pt)
 Test if a point is included in the priced DBM.
void pdbm_up (PDBM &pdbm, cindex_t dim)
 Delay with the current delay rate.
void pdbm_upZero (PDBM &pdbm, cindex_t dim, uint32_t rate, cindex_t zero)
 Delay with delay rate rate.
void pdbm_updateValue (PDBM &pdbm, cindex_t dim, cindex_t clock, uint32_t value)
 Updates clock to value.
void pdbm_updateValueZero (PDBM &pdbm, cindex_t dim, cindex_t clock, uint32_t value, cindex_t zero)
 Updates clock to value.
void pdbm_extrapolateMaxBounds (PDBM &pdbm, cindex_t dim, int32_t *max)
 Unfinished extrapolation function.
void pdbm_diagonalExtrapolateMaxBounds (PDBM &pdbm, cindex_t dim, int32_t *max)
 Unfinished extrapolation function.
void pdbm_diagonalExtrapolateLUBounds (PDBM &pdbm, cindex_t dim, int32_t *lower, int32_t *upper)
 Extrapolate a priced zone.
void pdbm_incrementCost (PDBM &pdbm, cindex_t dim, int32_t value)
 Increments the cost of each point in a priced DBM by value.
void pdbm_close (PDBM &pdbm, cindex_t dim)
 Compute the closure of a priced DBM.
uint32_t pdbm_analyzeForMinDBM (const PDBM pdbm, cindex_t dim, uint32_t *bitMatrix)
 Analyze a priced DBM for its minimal graph representation.
int32_t * pdbm_writeToMinDBMWithOffset (const PDBM pdbm, cindex_t dim, bool minimizeGraph, bool tryConstraints16, allocator_t c_alloc, uint32_t offset)
 Convert the DBM to a more compact representation.
void pdbm_readFromMinDBM (PDBM &dst, cindex_t dim, mingraph_t src)
 Uncompresses a compressed priced DBM.
bool pdbm_findZeroCycle (const PDBM pdbm, cindex_t dim, cindex_t clock, cindex_t *out)
 Finds a clock that is on a zero cycle with clock.
bool pdbm_findNextZeroCycle (const PDBM pdbm, cindex_t dim, cindex_t x, cindex_t *out)
 Finds a clock that is on a zero cycle with clock.
int32_t pdbm_getSlopeOfDelayTrajectory (const PDBM pdbm, cindex_t dim)
 Returns the slope of the cost plane along the delay trajectory.
int32_t pdbm_getRate (const PDBM pdbm, cindex_t dim, cindex_t clock)
 Returns the rate (coefficient of the hyperplane) of clock.
const int32_t * pdbm_getRates (const PDBM pdbm, cindex_t dim)
uint32_t pdbm_getCostAtOffset (const PDBM pdbm, cindex_t dim)
 Returns the cost of the offset point.
void pdbm_setCostAtOffset (PDBM &pdbm, cindex_t dim, uint32_t value)
 Sets the cost at the offset point.
bool pdbm_isValid (const PDBM pdbm, cindex_t dim)
 Returns true if the DBM is valid.
uint32_t pdbm_getLowerRelativeFacets (PDBM &pdbm, cindex_t dim, cindex_t clock, cindex_t *facets)
 Computes the lower facets of a priced DBM relative to clock.
uint32_t pdbm_getUpperRelativeFacets (PDBM &pdbm, cindex_t dim, cindex_t clock, cindex_t *facets)
 Computes the upper facets of a priced DBM relative to clock.
uint32_t pdbm_getLowerFacets (PDBM &pdbm, cindex_t dim, cindex_t *facets)
 Computes the lower facets of a priced DBM.
uint32_t pdbm_getUpperFacets (PDBM &pdbm, cindex_t dim, cindex_t *facets)
 Computes the upper facets of a priced DBM.
int32_t pdbm_getCostOfValuation (const PDBM pdbm, cindex_t dim, const int32_t *valuation)
 Computes the cost of a valuation in a priced DBM.
void pdbm_relax (PDBM &pdbm, cindex_t dim)
 Makes all strong constraints of a priced DBM weak.
void pdbm_getOffset (const PDBM pdbm, cindex_t dim, int32_t *valuation)
 Computes the offset point of a priced DBM.
void pdbm_setRate (PDBM &pdbm, cindex_t dim, cindex_t clock, int32_t rate)
 Sets a coefficient of the hyperplane of a priced DBM.
raw_tpdbm_getMutableMatrix (PDBM &pdbm, cindex_t dim)
 Returns the inner matrix of a priced DBM.
const raw_tpdbm_getMatrix (const PDBM pdbm, cindex_t dim)
 Returns the inner matrix of a priced DBM.
void pdbm_freeClock (PDBM &pdbm, cindex_t dim, cindex_t clock)
 Frees a clock of a priced DBM.
void pdbm_print (FILE *f, const PDBM pdbm, cindex_t dim)
 Prints a priced DBM to a stream.
void pdbm_freeUp (PDBM &pdbm, cindex_t dim, cindex_t index)
 Implementation of the free up operation for priced DBMs.
void pdbm_freeDown (PDBM &pdbm, cindex_t dim, cindex_t index)
 Implementation of the free down operation for priced DBMs.
bool pdbm_hasNormalForm (PDBM pdbm, cindex_t dim)
 Checks whether a priced DBM is in normal form.
void pdbm_normalise (PDBM pdbm, cindex_t dim)
 Brings a priced DBM into normal form.


Detailed Description

Functions for handling priced DBMs.

A priced DBM is a data structure representing a zone with an affine hyperplane over the zone assigning a cost to each point in the zone.

A few facts about priced DBMs:

Allocation can be handled by the library by using pdbm_allocate() and pdbm_deallocate(). This can optionally be combined with reference counting using pdbm_incRef() and pdbm_decRef(), in which case pdbm_deallocate() is called automatically as soon as the reference count reaches zero. Reference counting is used to implement copy on write semantics. Thus whenever you modify a priced DBM with a reference count larger than 1, then that DBM is automatically copied. For this reason, all functions modifying priced DBMs take a reference parameter to the priced DBM to modify.

A NULL pointer is equivalent to an empty DBM with a reference count of 1. Functions that can cause the priced DBM to become empty can choose to deallocate the DBM rather than to copy it. All functions that do not require the input DBM to be closed will allocate a new DBM when given a NULL pointer as input.

Alternatively, memory can be allocated outside the library. In that case pdbm_size() bytes need to be allocated and preinitialized for the use by the library by calling pdbm_reserve(). Priced DBMs allocated in this manner must not be reference counted.


Typedef Documentation

typedef struct PDBM_s* PDBM
 

Data type for priced dbm.


Function Documentation

PDBM pdbm_allocate cindex_t  dim  ) 
 

Allocates a new priced DBM.

The reference count is initialised to 0. No other initialisation is performed.

Parameters:
dim is the dimension.
Returns:
A newly allocated priced DBM of dimension dim.
Precondition:
dim is larger than 0.

uint32_t pdbm_analyzeForMinDBM const PDBM  pdbm,
cindex_t  dim,
uint32_t *  bitMatrix
 

Analyze a priced DBM for its minimal graph representation.

Computes the smallest number of constraints needed to represent the same zone.

The result is returned as a bit matrix, where each bit indicates whether that entry of the DBM is relevant. I.e. if the bit $ i \cdot dim + j$ is set, then the constraint $(i,j)$ of dbm is needed.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
bitMatrix is bit matrix of size dim*dim
Returns:
The number of bits marked one in bitMatrix.

void pdbm_close PDBM pdbm,
cindex_t  dim
 

Compute the closure of a priced DBM.

This function is only relevant if the DBM has been modified with pdbm_setBound().

Parameters:
pdbm is a priced DBM of dimension dim.
dim is the dimension of pdbm.
Postcondition:
The priced DBM is closed or empty.
See also:
pdbm_setBound

bool pdbm_constrain1 PDBM pdbm,
cindex_t  dim,
cindex_t  i,
cindex_t  j,
raw_t  constraint
 

Constrain a priced DBM.

After the call, the DBM will be constrained such that the difference between clock i and clock j is smaller than constraint.

See also:
dbm_constrain1
Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
i is a clock index.
j is a clock index.
constraint is a raw_t bound.
Precondition:
i != j
Postcondition:
The DBM is empty or closed.
Returns:
True if and only if the result is not empty.

bool pdbm_constrainN PDBM pdbm,
cindex_t  dim,
const constraint_t constraints,
size_t  n
 

Constrain a priced DBM with multiple constraints.

See also:
dbm_constraint1
Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
constraints is an array of n constraints.
n is the length of constraints.
Precondition:
the constraints are valid
Postcondition:
The DBM is empty or closed.
Returns:
  • TRUE if the DBM is non empty + closed non empty DBM + updated consistent rates
  • or FALSE if the DBM is empty + empty DBM + inconsistent rates

bool pdbm_constrainToFacet PDBM pdbm,
cindex_t  dim,
cindex_t  i,
cindex_t  j
 

Constrain a priced DBM to a facet (i, j).

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
i is a clock index
j is a clock index
Postcondition:
The DBM is empty or closed.
Returns:
TRUE if and only if the result is non empty.

bool pdbm_containsDouble const PDBM  pdbm,
cindex_t  dim,
const double *  pt
 

Test if a point is included in the priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
pt is a clock valuation.
Returns:
TRUE if pt satisfies the constraints of dbm.

bool pdbm_containsInt const PDBM  pdbm,
cindex_t  dim,
const int32_t *  pt
 

Test if a point is included in the priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
pt is a clock valuation.
Returns:
TRUE if pt satisfies the constraints of dbm.

PDBM pdbm_copy PDBM  dst,
const PDBM  src,
cindex_t  dim
 

Copy a priced DBM.

This function copies the data of the DBM. Hence, it is only permissible if the reference count of dst is zero. If dst is NULL, a new DBM is allocate with pdbm_allocate().

Parameters:
dst The destination.
src The source.
dim The dimension of dst and src.
Precondition:
The reference count of dst is zero or dst is NULL.
Postcondition:
The reference count of the return value is zero.
Returns:
The destination.

void pdbm_deallocate PDBM pdbm  ) 
 

Deallocates a priced DBM.

Precondition:
  • pdbm was allocated with pdbm_allocate().
  • The reference count of pdbm is zero.

static void pdbm_decRef PDBM  pdbm  )  [inline, static]
 

Decreases reference count on priced DBM.

The DBM is deallocated when the reference count reaches zero.

Parameters:
pdbm is a priced DBM.
Precondition:
pdbm has been allocated with pdbm_allocate().

void pdbm_diagonalExtrapolateLUBounds PDBM pdbm,
cindex_t  dim,
int32_t *  lower,
int32_t *  upper
 

Extrapolate a priced zone.

The extrapolation is based on a lower and an upper bound for each clock. The output zone simulates the input zone.

The implementation is not finished.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
lower is an array of lower bounds for each clock.
upper is an array of upper bounds for each clock.
Precondition:
lower[0] = upper[0] = 0
Postcondition:
The priced DBM is closed.
See also:
dbm_diagonalExtrapolateLUBounds

void pdbm_diagonalExtrapolateMaxBounds PDBM pdbm,
cindex_t  dim,
int32_t *  max
 

Unfinished extrapolation function.

See also:
dbm_diagonalExtrapolateMaxBounds

void pdbm_extrapolateMaxBounds PDBM pdbm,
cindex_t  dim,
int32_t *  max
 

Unfinished extrapolation function.

See also:
dbm_extrapolateMaxBounds

bool pdbm_findNextZeroCycle const PDBM  pdbm,
cindex_t  dim,
cindex_t  x,
cindex_t out
 

Finds a clock that is on a zero cycle with clock.

Returns TRUE if and only if such a clock is found. Only clocks with a value equal to or greater than the existing value of output are considered. If multiple clocks are on a zero cycle with clock, then the clock with the smallest index is returned.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the index of a clock.
out is where the clock found is written.
Returns:
TRUE if and only if a clock is found.

bool pdbm_findZeroCycle const PDBM  pdbm,
cindex_t  dim,
cindex_t  clock,
cindex_t out
 

Finds a clock that is on a zero cycle with clock.

Returns TRUE if and only if such a clock is found. If multiple clocks are on a zero cycle with clock, then the clock with the smallest index is returned.

This function is equivalent to calling pdbm_findNextZeroCyle with output initialised to zero.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the index of a clock.
out is where the clock found is written.
Returns:
TRUE if and only if a clock is found.

void pdbm_freeClock PDBM pdbm,
cindex_t  dim,
cindex_t  clock
 

Frees a clock of a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the index of the clock to free.

void pdbm_freeDown PDBM pdbm,
cindex_t  dim,
cindex_t  index
 

Implementation of the free down operation for priced DBMs.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
index is an index of a clock. *
See also:
dbm_freeDown

void pdbm_freeUp PDBM pdbm,
cindex_t  dim,
cindex_t  index
 

Implementation of the free up operation for priced DBMs.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
index is an index of a clock.
See also:
dbm_freeUp

uint32_t pdbm_getCostAtOffset const PDBM  pdbm,
cindex_t  dim
 

Returns the cost of the offset point.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.

int32_t pdbm_getCostOfValuation const PDBM  pdbm,
cindex_t  dim,
const int32_t *  valuation
 

Computes the cost of a valuation in a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
valuation is a valuation in pdbm.
Precondition:
pdbm_containsInt(pdbm, dim, valuation)
Returns:
The cost of valuation in pdbm.

int32_t pdbm_getInfimum const PDBM  pdbm,
cindex_t  dim
 

Computes the infimum cost of the priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim
dim is the dimension of pdbm.
Returns:
The infimum cost of pdbm.

int32_t pdbm_getInfimumValuation const PDBM  pdbm,
cindex_t  dim,
int32_t *  valuation,
const bool *  free
 

Generates a valuation which has the infimum cost of the priced DBM.

There is no guarantee that the valuation will be contained in the priced DBM, but if it is not it is arbitrarily close to a valuation that is contained in the priced DBM.

A false entry in free indicates that the value of this clock has already been set in valuation and that this clock must not be modified. The function will only modify free clocks.

Parameters:
pdbm is a closed priced DBM of dimension dim
dim is the dimension of pdbm.
valuation is an array of at least dim elements to which the the valuation will be written.
free is an array of at least dim elements.
Returns:
The cost of valuation.
Exceptions:
out_of_range if no valuation with the given constraints can be found.

uint32_t pdbm_getLowerFacets PDBM pdbm,
cindex_t  dim,
cindex_t facets
 

Computes the lower facets of a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
facets is an array of at least dim elements to which the lower facets will be written.
Returns:
The number of facets written to facets.

uint32_t pdbm_getLowerRelativeFacets PDBM pdbm,
cindex_t  dim,
cindex_t  clock,
cindex_t facets
 

Computes the lower facets of a priced DBM relative to clock.

As a side-effect, all lower facets relative to clock are converted to weak facets.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the clock for which to return the lower facets
facets is an array of at least dim elements to which the lower facets will be written.
Returns:
The number of facets written to facets.

const raw_t* pdbm_getMatrix const PDBM  pdbm,
cindex_t  dim
 

Returns the inner matrix of a priced DBM.

The matrix is read-only.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.

raw_t* pdbm_getMutableMatrix PDBM pdbm,
cindex_t  dim
 

Returns the inner matrix of a priced DBM.

The matrix can be modified as long as pdbm_close() is called before any other operations are performed on the priced DBM.

Parameters:
pdbm is a priced DBM of dimension dim.
dim is the dimension of pdbm.

void pdbm_getOffset const PDBM  pdbm,
cindex_t  dim,
int32_t *  valuation
 

Computes the offset point of a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
valuation is an array of at least dim elements to which the offset point is written.

int32_t pdbm_getRate const PDBM  pdbm,
cindex_t  dim,
cindex_t  clock
 

Returns the rate (coefficient of the hyperplane) of clock.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the clock for which to return the coefficient.
Returns:
the rate of clock.

const int32_t* pdbm_getRates const PDBM  pdbm,
cindex_t  dim
 

int32_t pdbm_getSlopeOfDelayTrajectory const PDBM  pdbm,
cindex_t  dim
 

Returns the slope of the cost plane along the delay trajectory.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.

uint32_t pdbm_getUpperFacets PDBM pdbm,
cindex_t  dim,
cindex_t facets
 

Computes the upper facets of a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
facets is an array of at least dim elements to which the upper facets will be written.
Returns:
The number of facets written to facets.

uint32_t pdbm_getUpperRelativeFacets PDBM pdbm,
cindex_t  dim,
cindex_t  clock,
cindex_t facets
 

Computes the upper facets of a priced DBM relative to clock.

As a side-effect, all upper facets relative to clock are converted to weak facets.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the clock for which to return the upper facets
facets is an array of at least dim elements to which the upper facets will be written.
Returns:
The number of facets written to facets.

uint32_t pdbm_hash const PDBM  pdbm,
cindex_t  dim,
uint32_t  seed
 

Compute a hash value for a priced DBM.

ISSUE: canonical form needed.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
seed is a seed for the hash function.
Returns:
hash value.

bool pdbm_hasNormalForm PDBM  pdbm,
cindex_t  dim
 

Checks whether a priced DBM is in normal form.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.

static void pdbm_incRef PDBM  pdbm  )  [inline, static]
 

Increases reference count on priced DBM.

Parameters:
pdbm is a priced DBM.
Precondition:
pdbm has been allocated with pdbm_allocate() and is not NULL.

void pdbm_incrementCost PDBM pdbm,
cindex_t  dim,
int32_t  value
 

Increments the cost of each point in a priced DBM by value.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
value is the amount with which to increase the cost.
Postcondition:
The priced DBM is closed.
Precondition:
value >= 0

void pdbm_init PDBM pdbm,
cindex_t  dim
 

Initialises a priced DBM to the DBM containing all valuations.

The cost of all valuations will be zero. If pdbm is NULL, a new DBM is allocated with pdbm_allocate().

Parameters:
pdbm is the priced DBM to initialize.
dim is the dimension of pdbm.

bool pdbm_isEmpty const PDBM  pdbm,
cindex_t  dim
 

Returns true if the priced DBM is empty.

Parameters:
pdbm is a closed or empty priced DBM of dimension dim.
dim is the dimension of pdbm.
Returns:
TRUE if and only if the priced dbm is empty.

bool pdbm_isUnbounded const PDBM  pdbm,
cindex_t  dim
 

Check if at least one point can delay infinitely.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
Returns:
TRUE if unbounded, FALSE otherwise.

bool pdbm_isValid const PDBM  pdbm,
cindex_t  dim
 

Returns true if the DBM is valid.

Useful for debugging.

Parameters:
pdbm is a priced DBM of dimension dim.
dim is the dimension of pdbm.

void pdbm_normalise PDBM  pdbm,
cindex_t  dim
 

Brings a priced DBM into normal form.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.

void pdbm_print FILE *  f,
const PDBM  pdbm,
cindex_t  dim
 

Prints a priced DBM to a stream.

Parameters:
f is the stream to print to.
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
See also:
dbm_print

void pdbm_readFromMinDBM PDBM dst,
cindex_t  dim,
mingraph_t  src
 

Uncompresses a compressed priced DBM.

The compressed priced DBM src is written to dst. The destination does not need to initialised beforehand. The dimension dim must match the dimension of the compressed priced DBM.

Parameters:
dst is a memory area of size pdbm_size(dim).
dim is the dimension of the priced DBM.
src is the compressed priced DBM.
Postcondition:
dst is a closed priced DBM.

relation_t pdbm_relation const PDBM  pdbm1,
const PDBM  pdbm2,
cindex_t  dim
 

Relation between two priced DBMs.

See also:
relation_t
Parameters:
pdbm1 is a closed priced DBMs of dimension dim.
pdbm2 is a closed priced DBMs of dimension dim.
dim is the dimension of pdbm1 and pdbm2.
Returns:
The relation between pdbm1 and pdbm2

relation_t pdbm_relationWithMinDBM const PDBM  pdbm,
cindex_t  dim,
const mingraph_t  minDBM,
raw_t buffer
 

Relation between 2 priced dbms where one is in compressed.

Notice that in constract to dbm_relationWithMinDBM, buffer may not be NULL.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
minDBM is the compressed priced dbm.
buffer is a buffer of size dim*dim.
Returns:
The relation between pdbm1 and pdbm2
See also:
dbm_relationWithMinDBM

relation_t

void pdbm_relax PDBM pdbm,
cindex_t  dim
 

Makes all strong constraints of a priced DBM weak.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
Postcondition:
The priced DBM is closed.

PDBM pdbm_reserve cindex_t  dim,
void *  p
 

Reserves a memory area for use as a priced DBM.

The priced DBM will be unitialised, hence further initialised with e.g. pdbm_init() or pdbm_zero() is required.

Parameters:
dim is the dimension of the priced DBM to reserve.
p is a memory area of size pdbm_size(dim).
Returns:
An unitialised priced DBM of dimension dim.

bool pdbm_satisfies const PDBM  pdbm,
cindex_t  dim,
cindex_t  i,
cindex_t  j,
raw_t  constraint
 

Check if a priced DBM satisfies a given constraint.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
i,j are theindices of clocks for the clock constraint.
constraint is the raw_t bound.
Returns:
TRUE if the DBM satisfies the constraint.

void pdbm_setCostAtOffset PDBM pdbm,
cindex_t  dim,
uint32_t  value
 

Sets the cost at the offset point.

Notice that the value must be large enough such that the infimum cost of the priced DBM is not negative. Temporary inconsistencies are allowed as long as no operations are performed on the priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
value is the new cost of the offset point.

void pdbm_setRate PDBM pdbm,
cindex_t  dim,
cindex_t  clock,
int32_t  rate
 

Sets a coefficient of the hyperplane of a priced DBM.

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
clock is the index of a clock for which to set the coefficient.
rate is the coefficient.

size_t pdbm_size cindex_t  dim  ) 
 

Computes the size in number of bytes of a priced dbm of the given dimension.

Parameters:
dim is a dimension.
Precondition:
dim > 0
Returns:
Amount of memory in bytes.

void pdbm_up PDBM pdbm,
cindex_t  dim
 

Delay with the current delay rate.

Parameters:
pdbm is a closed priced dbm of dimension dim.
dim is the dimension of pdbm.
See also:
pdbm_delayRate()
Postcondition:
The priced DBM is closed.

void pdbm_updateValue PDBM pdbm,
cindex_t  dim,
cindex_t  clock,
uint32_t  value
 

Updates clock to value.

This is only legitimate if the current rate of clock is zero.

Parameters:
pdbm is a closed priced dbm of dimension dim.
dim is the dimension of pdbm.
clock is the index of the clock to reset.
value is the value to which to set clock.
Precondition:
pdbm_getRate(pdbm, dim, clock) == 0
Postcondition:
The priced DBM is closed.

void pdbm_updateValueZero PDBM pdbm,
cindex_t  dim,
cindex_t  clock,
uint32_t  value,
cindex_t  zero
 

Updates clock to value.

This is only legitimate if the clock forms a zero cycle with another clock (possibly the reference clock).

Parameters:
pdbm is a closed priced dbm of dimension dim.
dim is the dimension of pdbm.
clock is the index of the clock to reset.
value is the value to which to set clock.
zero is a clock (possibly zero) forming a zero cycle with clock.
Postcondition:
The priced DBM is closed.

pdbm_getRate(pdbm, dim, clock) == 0

void pdbm_upZero PDBM pdbm,
cindex_t  dim,
uint32_t  rate,
cindex_t  zero
 

Delay with delay rate rate.

There must be at least one clock forming a zero cycle with the reference clock.

Parameters:
pdbm is a closed priced dbm of dimension dim.
dim is the dimension of pdbm.
rate is the cost of delaying.
zero is the index of a clock forming a zero cycle with the reference clock.
Postcondition:
The priced DBM is closed.

int32_t* pdbm_writeToMinDBMWithOffset const PDBM  pdbm,
cindex_t  dim,
bool  minimizeGraph,
bool  tryConstraints16,
allocator_t  c_alloc,
uint32_t  offset
 

Convert the DBM to a more compact representation.

The API supports allocation of larger data structures than needed for the actual zone representation. When the offset argument is bigger than zero, offset extra integers are allocated and the zone is written with the given offset. Thus when int32_t[data_size] is needed to represent the reduced zone, an int32_t array of size offset+data_size is allocated. The first offset elements can be used by the caller. It is important to notice that the other functions typically expect a pointer to the actual zone data and not to the beginning of the allocated block. Thus in the following piece of code, most functions expect mg and not memory:

 int32_t *memory = dbm_writeToMinDBMWithOffset(...);
 mingraph_t mg = &memory[offset]; 

Parameters:
pdbm is a closed priced DBM of dimension dim.
dim is the dimension of pdbm.
minimizeGraph when true, try to use minimal constraint form.
tryConstraints16 when true, try to save constraints on 16 bits.
c_alloc is a C allocator wrapper.
offset is the offset for allocation.
Returns:
The converted priced DBM. The first offset integers are unused.
Precondition:
allocFunction allocates memory in integer units

void pdbm_zero PDBM pdbm,
cindex_t  dim
 

Initialize a priced DBM to only contain the origin with a cost of 0.

If pdbm is NULL, a new DBM is allocated with pdbm_allocate().

Parameters:
pdbm is the priced DBM to initialise.
dim is the dimension of pdbm.


Generated on Fri Jun 30 00:02:46 2006 for Module dbm by  doxygen 1.4.2