M4RI 1.0.1
Data Structures | Functions
permutation.h File Reference

Permutation matrices. More...

#include "misc.h"
#include "packedmatrix.h"

Go to the source code of this file.

Data Structures

struct  mzp_t
 Permutations. More...

Functions

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

Detailed Description

Permutation matrices.

Author:
Martin Albrecht <M.R.Albrecht@rhul.ac.uk>

Function Documentation

void mzd_apply_p_left ( mzd_t A,
mzp_t 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_pluq.c.
void mzd_apply_p_left_trans ( mzd_t A,
mzp_t 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 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 P,
size_t  start_row,
size_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.
Ignores offset atrtribute of packedmatrix.
void mzd_apply_p_right_trans ( mzd_t A,
mzp_t 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_pluq.c.
void mzd_apply_p_right_trans_even_capped ( mzd_t A,
mzp_t P,
size_t  start_row,
size_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.
Ignores offset atrtribute of packedmatrix.
void mzd_apply_p_right_trans_tri ( mzd_t A,
mzp_t Q 
)

Apply the permutation P to A from the right, but only on the lower triangular part of the matrix A.

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

Parameters:
AMatrix.
QPermutation.
void mzp_free ( mzp_t P)

Free a mzp_t.

Parameters:
PPermutation to free.
Examples:
testsuite/test_pluq.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 ( size_t  length)

Construct an identity permutation.

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

Create a window/view into the permutation P.

Use mzp_free_mzp_t_window() to free the window.

Parameters:
PPermutaiton matrix
beginStarting index (inclusive)
endEnding index (exclusive)
void mzp_print ( mzp_t 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().