M4RI  20140914
Data Structures | Functions
ple_russian.h File Reference

PLE and PLUQ factorization using Gray codes. More...

#include <m4ri/mzd.h>
#include <m4ri/mzp.h>

Go to the source code of this file.

Data Structures

struct  ple_table_t
 PLE Elimination Tables. More...
 

Functions

ple_table_tple_table_init (int k, rci_t ncols)
 
void ple_table_free (ple_table_t *T)
 Delete table T. More...
 
rci_t _mzd_ple_russian (mzd_t *A, mzp_t *P, mzp_t *Q, int k)
 PLE matrix decomposition of A using Gray codes. More...
 
rci_t _mzd_pluq_russian (mzd_t *A, mzp_t *P, mzp_t *Q, int k)
 PLUQ matrix decomposition of A using Gray codes. More...
 
int _mzd_ple_submatrix (mzd_t *A, rci_t const start_row, rci_t const stop_row, rci_t const start_col, int const k, mzp_t *P, mzp_t *Q, rci_t *pivots, rci_t *done, rci_t *done_row, wi_t const splitblock)
 PLE matrix decomposition of a submatrix for up to k columns starting at (r,c). More...
 
mzd_t_mzd_ple_to_e (mzd_t *E, mzd_t const *A, rci_t r, rci_t c, int k, rci_t *offsets)
 Extract the k x A::ncols echelon form submatrix of A starting at row r and column c. More...
 
void _mzd_process_rows_ple_2 (mzd_t *M, rci_t startrow, rci_t stoprow, rci_t startcol, int const *k, const ple_table_t **T)
 add rows T[0],T[1] to M between startrow and stoprow, starting at startcol. More...
 
void _mzd_process_rows_ple_3 (mzd_t *M, rci_t startrow, rci_t stoprow, rci_t startcol, int const *k, const ple_table_t **T)
 add rows T[0],T[1],T[2] to M between startrow and stoprow, starting at startcol. More...
 
void _mzd_process_rows_ple_4 (mzd_t *M, rci_t startrow, rci_t stoprow, rci_t startcol, int const *k, const ple_table_t **T)
 add rows T[0],T[1],T[2],T[3] to M between startrow and stoprow, starting at startcol. More...
 
void _mzd_process_rows_ple_5 (mzd_t *M, rci_t startrow, rci_t stoprow, rci_t startcol, int const *k, const ple_table_t **T)
 add rows T[0],T[1],T[2],T[3],T[4] to M between startrow and stoprow, starting at startcol. More...
 
void _mzd_process_rows_ple_6 (mzd_t *M, rci_t startrow, rci_t stoprow, rci_t startcol, int const *k, const ple_table_t **T)
 add rows T[0],T[1],T[2],T[3],T[4],T[5] to M between startrow and stoprow, starting at startcol. More...
 

Detailed Description

PLE and PLUQ factorization using Gray codes.

Author
Martin Albrecht marti.nosp@m.nral.nosp@m.brech.nosp@m.t@go.nosp@m.oglem.nosp@m.ail..nosp@m.com

Function Documentation

rci_t _mzd_ple_russian ( mzd_t A,
mzp_t P,
mzp_t Q,
int  k 
)

PLE matrix decomposition of A using Gray codes.

Returns (P,L,E,Q) satisfying PLE = A where P is a permutation matrix of dimension m x m, L is m x r unit lower triangular and S is an r x n matrix which is upper triangular except that its columns are permuted, that is E = UQ for U r x n upper triangular and Q is a n x n permutation matrix. The matrix L and E are stored in place over A.

Parameters
AMatrix.
PPreallocated row permutation.
QPreallocated column permutation.
kSize of Gray code tables.
Returns
Rank of A.

compute good k

initialise permutations as identity

The algorithm proceeds as follows

   1. compute PLE factorisation for the knar x knar submatrix A00
       m4ri_radix * splitblock
--------------------------------------
| A00  |  A10                        |
|      |                             |
-------------------------------------- knar
| A01  |  A11                        |
|      |                             |
-------------------------------------- done_row
| A02  |  A12                        |
|      |                             |
|      |                             |
|      |                             |
|      |                             |
|      |                             |
--------------------------------------
  1. update A10
  2. extract U from A0 = (A00 | A10)
  3. generate multiplication and inversion tables T amd E from U
  4. update A1 = (A01 | A11)
  5. update A2 = (A02 | A12)
Examples:
testsuite/test_ple.c.
int _mzd_ple_submatrix ( mzd_t A,
rci_t const  start_row,
rci_t const  stop_row,
rci_t const  start_col,
int const  k,
mzp_t P,
mzp_t Q,
rci_t pivots,
rci_t done,
rci_t done_row,
wi_t const  splitblock 
)

PLE matrix decomposition of a submatrix for up to k columns starting at (r,c).

Updates P and Q and modifies A in place. The buffer done afterwards holds how far a particular row was already eliminated.

Parameters
AMatrix.
start_rowRow Offset.
stop_rowUp to which row the matrix should be processed (exclusive).
start_colColumn Offset.
kSize of Gray code tables.
PPreallocated row permutation.
QPreallocated column permutation.
pivotswhich column holds the i-th pivot
donePreallocated temporary buffer.
done_rowStores the last row which is already reduced processed after function execution.
splitblockFirst block which is not considered by this function.
Return values
knarrank of the considered submatrix
mzd_t* _mzd_ple_to_e ( mzd_t E,
mzd_t const *  A,
rci_t  r,
rci_t  c,
int  k,
rci_t offsets 
)

Extract the k x A::ncols echelon form submatrix of A starting at row r and column c.

Parameters
EStorage for k x A::ncols matrix.
ASource matrix.
rRow index.
cColumn index.
kRank of E.
kMap from i to column of i-th pivot.
offsetsEncodes which columns contain pivots
rci_t _mzd_pluq_russian ( mzd_t A,
mzp_t P,
mzp_t Q,
int  k 
)

PLUQ matrix decomposition of A using Gray codes.

Returns (P,L,U,Q) satisfying PLUQ = A where P and Q are two permutation matrices, of dimension respectively m x m and n x n, L is m x r unit lower triangular and U is r x n upper triangular.

Parameters
AMatrix.
PPreallocated row permutation.
QPreallocated column permutation.
kSize of Gray code tables.
Returns
Rank of A.
Examples:
testsuite/bench_elimination.c.
void _mzd_process_rows_ple_2 ( mzd_t M,
rci_t  startrow,
rci_t  stoprow,
rci_t  startcol,
int const *  k,
const ple_table_t **  T 
)

add rows T[0],T[1] to M between startrow and stoprow, starting at startcol.

Parameters
MMatrix
startrowStart processing in this row
stoprowStop processing in this row
startcolStart processing in this column
kNumber of bits to read in each table
TPLE Table with 2^k[i] rows
void _mzd_process_rows_ple_3 ( mzd_t M,
rci_t  startrow,
rci_t  stoprow,
rci_t  startcol,
int const *  k,
const ple_table_t **  T 
)

add rows T[0],T[1],T[2] to M between startrow and stoprow, starting at startcol.

Parameters
MMatrix
startrowStart processing in this row
stoprowStop processing in this row
startcolStart processing in this column
kNumber of bits to read in each table
TPLE Table with 2^k[i] rows
void _mzd_process_rows_ple_4 ( mzd_t M,
rci_t  startrow,
rci_t  stoprow,
rci_t  startcol,
int const *  k,
const ple_table_t **  T 
)

add rows T[0],T[1],T[2],T[3] to M between startrow and stoprow, starting at startcol.

Parameters
MMatrix
startrowStart processing in this row
stoprowStop processing in this row
startcolStart processing in this column
kNumber of bits to read in each table
TPLE Table with 2^k[i] rows
void _mzd_process_rows_ple_5 ( mzd_t M,
rci_t  startrow,
rci_t  stoprow,
rci_t  startcol,
int const *  k,
const ple_table_t **  T 
)

add rows T[0],T[1],T[2],T[3],T[4] to M between startrow and stoprow, starting at startcol.

Parameters
MMatrix
startrowStart processing in this row
stoprowStop processing in this row
startcolStart processing in this column
kNumber of bits to read in each table
TPLE Table with 2^k[i] rows
void _mzd_process_rows_ple_6 ( mzd_t M,
rci_t  startrow,
rci_t  stoprow,
rci_t  startcol,
int const *  k,
const ple_table_t **  T 
)

add rows T[0],T[1],T[2],T[3],T[4],T[5] to M between startrow and stoprow, starting at startcol.

Parameters
MMatrix
startrowStart processing in this row
stoprowStop processing in this row
startcolStart processing in this column
kNumber of bits to read in each table
TPLE Table with 2^k[i] rows
void ple_table_free ( ple_table_t T)

Delete table T.

Parameters
TPLE table.
ple_table_t* ple_table_init ( int  k,
rci_t  ncols 
)

Create new table with 2^k rows and ncols.

Parameters
klog2 of the number of rows (0 < k <= 8).
ncolsNumber of columns.