M4RI  20140914
Functions
solve.h File Reference

System solving with matrix routines. More...

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

Go to the source code of this file.

Functions

int mzd_solve_left (mzd_t *A, mzd_t *B, int const cutoff, int const inconsistency_check)
 Solves A X = B with A and B matrices. More...
 
int mzd_pluq_solve_left (mzd_t const *A, rci_t rank, mzp_t const *P, mzp_t const *Q, mzd_t *B, int const cutoff, int const inconsistency_check)
 Solves (P L U Q) X = B. More...
 
int _mzd_pluq_solve_left (mzd_t const *A, rci_t rank, mzp_t const *P, mzp_t const *Q, mzd_t *B, int const cutoff, int const inconsistency_check)
 Solves (P L U Q) X = B. More...
 
int _mzd_solve_left (mzd_t *A, mzd_t *B, int const cutoff, int const inconsistency_check)
 Solves A X = B with A and B matrices. More...
 
mzd_tmzd_kernel_left_pluq (mzd_t *A, int const cutoff)
 Solve X for A X = 0. More...
 

Detailed Description

System solving with matrix routines.

Author
Jean-Guillaume Dumas Jean-.nosp@m.Guil.nosp@m.laume.nosp@m..Dum.nosp@m.as@im.nosp@m.ag.f.nosp@m.r

Function Documentation

int _mzd_pluq_solve_left ( mzd_t const *  A,
rci_t  rank,
mzp_t const *  P,
mzp_t const *  Q,
mzd_t B,
int const  cutoff,
int const  inconsistency_check 
)

Solves (P L U Q) X = B.

A is an input matrix supposed to store both:

  • an upper right triangular matrix U
  • a lower left unitary triangular matrix L.

The solution X is stored inplace on B.

This version assumes that the matrices are at an even position on the m4ri_radix grid and that their dimension is a multiple of m4ri_radix.

Parameters
AInput upper/lower triangular matrices.
rankis rank of A.
PInput row permutation matrix.
QInput column permutation matrix.
BInput matrix, being overwritten by the solution matrix X.
cutoffMinimal dimension for Strassen recursion (default: 0).
inconsistency_checkdecide whether or not to perform a check for incosistency (faster without but output not defined if system is not consistent).
Returns
0 if a solution was found, -1 otherwise
0 if a solution was found, -1 otherwise

A is supposed to store L lower triangular and U upper triangular B is modified in place (Bi's in the comments are just modified versions of B) PLUQ = A 1) P B2 = B1 2) L B3 = B2 3) U B4 = B3 4) Q B5 = B4

FASTER without this check; update with the lower part of L

Default is to set the undefined bits to zero if inconsistency has been checked then Y2 bits are already all zeroes thus this clearing is not needed

int _mzd_solve_left ( mzd_t A,
mzd_t B,
int const  cutoff,
int const  inconsistency_check 
)

Solves A X = B with A and B matrices.

The solution X is stored inplace on B.

This version assumes that the matrices are at an even position on the m4ri_radix grid and that their dimension is a multiple of m4ri_radix.

Parameters
AInput matrix (overwritten).
BInput matrix, being overwritten by the solution matrix X.
cutoffMinimal dimension for Strassen recursion (default: 0).
inconsistency_checkdecide whether or not to perform a check for incosistency (faster without but output not defined if system is not consistent).
Returns
0 if a solution was found, -1 otherwise
0 if a solution was found, -1 otherwise

B is modified in place (Bi's in the comments are just modified versions of B) 1) PLUQ = A 2) P B2 = B1 3) L B3 = B2 4) U B4 = B3 5) Q B5 = B4

mzd_t* mzd_kernel_left_pluq ( mzd_t A,
int const  cutoff 
)

Solve X for A X = 0.

If r is the rank of the nr x nc matrix A, return the nc x (nc-r) matrix X such that A*X == 0 and that the columns of X are linearly independent.

Parameters
AInput matrix (overwritten).
cutoffMinimal dimension for Strassen recursion (default: 0).
See also
mzd_pluq()
Returns
X, NULL if kernel is empty
int mzd_pluq_solve_left ( mzd_t const *  A,
rci_t  rank,
mzp_t const *  P,
mzp_t const *  Q,
mzd_t B,
int const  cutoff,
int const  inconsistency_check 
)

Solves (P L U Q) X = B.

A is an input matrix supposed to store both:

  • an upper right triangular matrix U
  • a lower left unitary triangular matrix L.

The solution X is stored inplace on B

This version assumes that the matrices are at an even position on the m4ri_radix grid and that their dimension is a multiple of m4ri_radix.

Parameters
AInput upper/lower triangular matrices.
rankis rank of A.
PInput row permutation matrix.
QInput column permutation matrix.
BInput matrix, being overwritten by the solution matrix X.
cutoffMinimal dimension for Strassen recursion (default: 0).
inconsistency_checkdecide whether or not to perform a check for incosistency (faster without but output not defined if system is not consistent).
Returns
0 if a solution was found, -1 otherwise
0 if a solution was found, -1 otherwise
int mzd_solve_left ( mzd_t A,
mzd_t B,
int const  cutoff,
int const  inconsistency_check 
)

Solves A X = B with A and B matrices.

The solution X is stored inplace on B.

Parameters
AInput matrix (overwritten).
BInput matrix, being overwritten by the solution matrix X
cutoffMinimal dimension for Strassen recursion (default: 0).
inconsistency_checkdecide wether or not to perform a check for incosistency (faster without but output not defined if system is not consistent).
Returns
0 if a solution was found, -1 otherwise