polylib: matrix_permutations.c File Reference

# matrix_permutations.c File Reference

`#include <stdlib.h>`
`#include <polylib/matrix_permutations.h>`

Go to the source code of this file.

## Functions
unsigned int | nb_bits (unsigned long long int x)
| Id matrix_permutations.c,v 1.8 2006/10/01 02:10:46 meister Exp
unsigned int * | permutation_inverse (unsigned int *perm, unsigned int nb_elems)
| Gives the inverse permutation vector of a permutation vector.
Matrix * | mtransformation_permute (Matrix *transf, unsigned int *permutation)
| Given a linear tranformation on initial variables, and a variable permutation, computes the tranformation for the permuted variables.
Matrix * | mpolyhedron_permute (Matrix *polyh, unsigned int *permutation)
| permutes the variables of the constraints of a polyhedron
void | Constraints_permute (Matrix *C, unsigned int *perm, Matrix **Cp)
| permutes the variables of the constraints of a polyhedron
unsigned long long int | eliminable_vars (Matrix *Eqs, unsigned start, unsigned end)
| Given a set of equalities, find a set of variables that can be eliminated using these equalities.
unsigned int * | find_a_permutation (Matrix *Eqs, unsigned int nb_parms)
| finds a valid permutation : for a set of m equations, find m variables that will be put at the beginning (to be eliminated).
unsigned int * | permutation_for_full_dim2 (unsigned int *vars_to_keep, unsigned int nb_keep, unsigned int nb_vars_parms, unsigned int nb_parms)
| computes the permutation of variables and parameters, according to some variables to keep.

## Function Documentation

void Constraints_permute | ( | Matrix * | C,
|  | unsigned int * | perm,
|  | Matrix ** | Cp |
| ) |  |  |

permutes the variables of the constraints of a polyhedron

Parameters:

  | C | the original set of constraints
  | perm | a permutation vector
  | Cp | (returned) the set of constraints whose variables are permuted. Allocated if set to NULL, assumed to be already allocated if not.

Definition at line 104 of file matrix_permutations.c.

References assert, Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, and value_assign.

Referenced by Constraints_fullDimensionize().

unsigned long long int eliminable_vars | ( | Matrix * | Eqs,
|  | unsigned | start,
|  | unsigned | end |
| ) |  |  |

Given a set of equalities, find a set of variables that can be eliminated using these equalities.

The variables that we agree to eliminate are in a zone of contiguous variables (or parameters).

Notes:

- brute force, surely enhanceable algorithm
- limited number of variables in the zone: limit = bitwidth of long long

Parameters:

  | Eqs | the matrix of equalities.
  | start | the rank of the first variable (inclusive) of the zone in Eqs
  | end | the rank of the last variable (inclusive) of the zone return a bitfield where bits set to one define the variables to eliminate

Definition at line 134 of file matrix_permutations.c.

References assert, Constraints2Polyhedron(), emptyQ, Matrix_Alloc(), Matrix_Copy(), Matrix_Free(), nb_bits(), matrix::NbColumns, matrix::NbRows, matrix::p, Polyhedron_Free(), right_hermite(), value_assign, value_notzero_p, and Vector_IsZero().

Referenced by find_a_permutation().

unsigned int* find_a_permutation | ( | Matrix * | Eqs,
|  | unsigned int | nb_parms |
| ) |  |  |

finds a valid permutation : for a set of m equations, find m variables that will be put at the beginning (to be eliminated).

Note: inherits the limited the number of variables from eliminable_vars

Definition at line 213 of file matrix_permutations.c.

References eliminable_vars(), matrix::NbColumns, and matrix::NbRows.

Referenced by Constraints_fullDimensionize(), and full_dimensionize().

Matrix* mpolyhedron_permute | ( | Matrix * | polyh,
|  | unsigned int * | permutation |
| ) |  |  |

permutes the variables of the constraints of a polyhedron

Parameters:

  | polyh | the constraints of the polyhedron
  | permutation | a permutation vector

Definition at line 85 of file matrix_permutations.c.

References Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, and value_assign.

Referenced by full_dimensionize().

Matrix* mtransformation_permute | ( | Matrix * | transf,
|  | unsigned int * | permutation |
| ) |  |  |

Given a linear tranformation on initial variables, and a variable permutation, computes the tranformation for the permuted variables.

perm is a vector giving the new "position of the k^th variable, k \in [1..n] we can call it a "permutation vector if you wish transf[x][y] -> permuted[permutation(x)][permutation(y)]

Definition at line 66 of file matrix_permutations.c.

References assert, Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, and value_assign.

unsigned int nb_bits | ( | unsigned long long int | x | ) |

Id
  matrix_permutations.c,v 1.8 2006/10/01 02:10:46 meister Exp

Permutations on matrices Matrices are seen either as transformations (mtransformation) or as polyhedra (mpolyhedron or Constraints).

Permutations on matrices Matrices are seen either as transformations (mtransformation) or as polyhedra (mpolyhedron)

Author:
  B. Meister LSIIT -ICPS UMR 7005 CNRS Louis Pasteur University (ULP), Strasbourg, France

Permutations are just indirection vectors: the k^th element of a permutation vector is the position of the k^th variable in the permuted object. utility function : bit count (i know, there are faster methods)

Definition at line 36 of file matrix_permutations.c.

References n.

Referenced by eliminable_vars().

unsigned int* permutation_for_full_dim2 | ( | unsigned int * | vars_to_keep,
|  | unsigned int | nb_keep,
|  | unsigned int | nb_vars_parms,
|  | unsigned int | nb_parms |
| ) |  |  |

computes the permutation of variables and parameters, according to some variables to keep.

put the variables not to be kept at the beginning, then the parameters and finally the variables to be kept. strongly related to the function compress_to_full_dim2

Definition at line 256 of file matrix_permutations.c.

unsigned int* permutation_inverse | ( | unsigned int * | perm,
|  | unsigned int | nb_elems |
| ) |  |  |

Gives the inverse permutation vector of a permutation vector.

Parameters:

  | perm | the permutation vector

Definition at line 51 of file matrix_permutations.c.