Main Page | Class List | File List | Class Members | File Members

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.h,v 1.3 2006/08/11 02:03:53 meister Exp
Permutations on matrices Matrices are seen either as transformations (mtransformation) or as polyhedra (mpolyhedron or Constraints).

unsigned int * permutation_inverse (unsigned int *perm, unsigned int nb_elems)
 Gives the inverse permutation vector of a permutation vector.

Matrixmtransformation_permute (Matrix *transf, unsigned int *permutation)
 Given a linear tranformation on initial variables, and a variable permutation, computes the tranformation for the permuted variables.

Matrixmpolyhedron_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 87 of file matrix_permutations.c.

References assert, Matrix, 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 117 of file matrix_permutations.c.

References assert, Constraints2Polyhedron(), emptyQ, Matrix, Matrix_Alloc(), Matrix_Copy(), Matrix_Free(), nb_bits(), matrix::NbColumns, matrix::NbRows, matrix::p, Polyhedron, 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 196 of file matrix_permutations.c.

References eliminable_vars(), Matrix, 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 68 of file matrix_permutations.c.

References Matrix, 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 [1..n] we can call it a "permutation vector" if you wish transf[x][y] -> permuted[permutation(x)][permutation(y)]

Definition at line 49 of file matrix_permutations.c.

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

unsigned int nb_bits unsigned long long int  x  ) 
 

Id
matrix_permutations.h,v 1.3 2006/08/11 02:03:53 meister Exp
Permutations on matrices Matrices are seen either as transformations (mtransformation) or as polyhedra (mpolyhedron or Constraints).

Author:
B. Meister

Definition at line 19 of file matrix_permutations.c.

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 239 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 34 of file matrix_permutations.c.


Generated on Mon Apr 23 19:23:54 2007 for polylib by doxygen 1.3.5