M4RI  20140914
Data Structures | Typedefs | Functions
mzp.h File Reference

Permutation matrices. More...

#include <m4ri/mzd.h>

Go to the source code of this file.

Data Structures

struct  mzp_t
 Permutations. More...
 

Typedefs

typedef struct mzp_t mzp_t
 Permutations.
 

Functions

mzp_tmzp_init (rci_t length)
 
void mzp_free (mzp_t *P)
 
mzp_tmzp_init_window (mzp_t *P, rci_t begin, rci_t end)
 Create a window/view into the permutation P. More...
 
void mzp_free_window (mzp_t *condemned)
 Free a permutation window created with mzp_init_mzp_t_window(). More...
 
mzp_tmzp_copy (mzp_t *P, const mzp_t *Q)
 copy permutation Q to P More...
 
void mzp_set_ui (mzp_t *P, unsigned int value)
 Set the permutation P to the identity permutation. The only allowed value is 1. More...
 
void mzd_apply_p_left (mzd_t *A, mzp_t const *P)
 
void mzd_apply_p_left_trans (mzd_t *A, mzp_t const *P)
 
void mzd_apply_p_right (mzd_t *A, mzp_t const *P)
 
void mzd_apply_p_right_trans (mzd_t *A, mzp_t const *P)
 
void mzd_apply_p_right_even_capped (mzd_t *A, mzp_t const *P, rci_t start_row, rci_t start_col)
 
void mzd_apply_p_right_trans_even_capped (mzd_t *A, mzp_t const *P, rci_t start_row, rci_t start_col)
 
void mzd_apply_p_right_trans_tri (mzd_t *A, mzp_t const *Q)
 
void mzp_print (mzp_t const *P)
 
void _mzd_compress_l (mzd_t *A, rci_t r1, rci_t n1, rci_t r2)
 

Detailed Description

Permutation matrices.

Author
Martin Albrecht M.R.A.nosp@m.lbre.nosp@m.cht@r.nosp@m.hul..nosp@m.ac.uk

Function Documentation

void _mzd_compress_l ( mzd_t A,
rci_t  r1,
rci_t  n1,
rci_t  r2 
)

Compresses the matrix L in a step in blockwise-recursive PLE decomposition.

Parameters
AMatrix.
r1Rank of left matrix.
n1Column cut which separates left and right matrix.
r2Rank of right matrix.
 We are compressing this matrix
           r1           n1
   ------------------------------------------
   | \ \____|___        | A01               |
   |  \     |   \       |                   |
 r1------------------------------------------ 
   |   |    |           | \  \_____         |
   | L1|    |           |  \       \________|
   |   |    |           | L2|               |
   ------------------------------------------
to this matrix
           r1           n1
   ------------------------------------------
   | \ \____|___        | A01               |
   |  \     |   \       |                   |
 r1------------------------------------------ 
   |    \   |           |    \_____         |
   |     \  |           |          \________|
   |      | |           |                   |
   ------------------------------------------
void mzd_apply_p_left ( mzd_t A,
mzp_t const *  P 
)

Apply the permutation P to A from the left.

This is equivalent to row swaps walking from 0 to length-1.

Parameters
AMatrix.
PPermutation.
Examples:
testsuite/test_ple.c.
void mzd_apply_p_left_trans ( mzd_t A,
mzp_t const *  P 
)

Apply the permutation P to A from the left but transpose P before.

This is equivalent to row swaps walking from length-1 to 0.

Parameters
AMatrix.
PPermutation.
void mzd_apply_p_right ( mzd_t A,
mzp_t const *  P 
)

Apply the permutation P to A from the right.

This is equivalent to column swaps walking from length-1 to 0.

Parameters
AMatrix.
PPermutation.
void mzd_apply_p_right_even_capped ( mzd_t A,
mzp_t const *  P,
rci_t  start_row,
rci_t  start_col 
)

Apply the permutation P to A from the right starting at start_row.

This is equivalent to column swaps walking from length-1 to 0.

Parameters
AMatrix.
PPermutation.
start_rowStart swapping at this row.
start_colStart swapping at this column.
void mzd_apply_p_right_trans ( mzd_t A,
mzp_t const *  P 
)

Apply the permutation P to A from the right but transpose P before.

This is equivalent to column swaps walking from 0 to length-1.

Parameters
AMatrix.
PPermutation.

Apply the mzp_t P to A from the right but transpose P before.

This is equivalent to column swaps walking from 0 to length-1.

Parameters
AMatrix.
PPermutation.
Examples:
testsuite/test_ple.c.
void mzd_apply_p_right_trans_even_capped ( mzd_t A,
mzp_t const *  P,
rci_t  start_row,
rci_t  start_col 
)

Apply the permutation P^T to A from the right starting at start_row.

This is equivalent to column swaps walking from 0 to length-1.

Parameters
AMatrix.
PPermutation.
start_rowStart swapping at this row.
start_colStart swapping at this column.
void mzd_apply_p_right_trans_tri ( mzd_t A,
mzp_t const *  Q 
)

Apply the permutation P to A from the right, but only on the upper the matrix A above the main diagonal.

This is equivalent to column swaps walking from length-1 to 0.

Parameters
AMatrix.
QPermutation.
mzp_t* mzp_copy ( mzp_t P,
const mzp_t Q 
)

copy permutation Q to P

Parameters
PTarget permutation matrix (may be NULL)
QSource permutation matrix (must not be NULL)
void mzp_free ( mzp_t P)

Free a mzp_t.

Parameters
PPermutation to free.
Examples:
testsuite/test_ple.c.
void mzp_free_window ( mzp_t condemned)

Free a permutation window created with mzp_init_mzp_t_window().

Parameters
condemnedPermutation Matrix
mzp_t* mzp_init ( rci_t  length)

Construct an identity permutation.

Parameters
lengthLength of the permutation.
Examples:
testsuite/bench_elimination.c, and testsuite/test_ple.c.
mzp_t* mzp_init_window ( mzp_t P,
rci_t  begin,
rci_t  end 
)

Create a window/view into the permutation P.

Use mzp_free_mzp_t_window() to free the window.

Parameters
PPermutation matrix
beginStarting index (inclusive)
endEnding index (exclusive)
void mzp_print ( mzp_t const *  P)

Print the mzp_t P

Parameters
PPermutation.
void mzp_set_ui ( mzp_t P,
unsigned int  value 
)

Set the permutation P to the identity permutation. The only allowed value is 1.

Parameters
PPermutation
value1
Note
This interface was chosen to be similar to mzd_set_ui().