linbox
PLUQMatrix< Field > Class Template Reference

PLUQ factorisation. More...

#include <factorized-matrix.h>

Public Types

typedef Field::Element Element
 
typedef BlasMatrix< Field, typename Vector< Field >::Dense > matrixType
 
typedef TriangularBlasMatrix< matrixTypeTriangularMatrix
 

Public Member Functions

template<class _Rep>
 PLUQMatrix (const BlasMatrix< Field, _Rep > &A)
 Contruction of PLUQ factorization of A (making a copy of A)
 
template<class _Rep>
 PLUQMatrix (BlasMatrix< Field, _Rep > &A)
 Contruction of PLUQ factorization of A (in-place in A)
 
template<class _Rep>
 PLUQMatrix (const BlasMatrix< Field, _Rep > &A, BlasPermutation< size_t > &P, BlasPermutation< size_t > &Q)
 Contruction of PLUQ factorization of A (making a copy of A).
 
template<class _Rep>
 PLUQMatrix (BlasMatrix< Field, _Rep > &A, BlasPermutation< size_t > &P, BlasPermutation< size_t > &Q)
 Contruction of PLUQ factorization of A (in-place in A).
 
 ~PLUQMatrix ()
 destructor.
 
Fieldfield ()
 get the field on which the factorization is done
 
size_t rowdim () const
 get row dimension
 
size_t coldim () const
 get column dimension
 
size_t getRank () const
 get the rank of matrix
 
const BlasPermutation< size_t > & getQ () const
 get the permutation Q.
 
BlasPermutation< size_t > & getQ (BlasPermutation< size_t > &Q) const
 get the permutation Q.
 
const BlasPermutation< size_t > & getP () const
 Get the transpose of the permutation P.
 
BlasPermutation< size_t > & getP (BlasPermutation< size_t > &PT) const
 get the permutation P^T.
 
TriangularMatrixgetL (TriangularMatrix &L, bool _QLUP=false) const
 get the Matrix L.
 
TriangularMatrixgetU (TriangularMatrix &U) const
 get the matrix U.
 
ElementgetPointer () const
 get the matrix S.
 
size_t getStride () const
 
template<class Operand>
Operand & left_solve (Operand &X, const Operand &B) const
 Solvers with matrices or vectors Operand can be a BlasMatrix<Field,_Rep> or a std::vector<Element>
 
template<class Operand>
Operand & left_solve (Operand &B) const
 
template<class Operand>
Operand & right_solve (Operand &X, const Operand &B) const
 
template<class Operand>
Operand & right_solve (Operand &B) const
 
template<class Operand>
Operand & left_Lsolve (Operand &X, const Operand &B) const
 
template<class Operand>
Operand & left_Lsolve (Operand &B) const
 
template<class Operand>
Operand & right_Lsolve (Operand &X, const Operand &B) const
 
template<class Operand>
Operand & right_Lsolve (Operand &B) const
 
template<class Operand>
Operand & left_Usolve (Operand &X, const Operand &B) const
 
template<class Operand>
Operand & rleft_Usolve (Operand &B) const
 
template<class Operand>
Operand & right_Usolve (Operand &X, const Operand &B) const
 
template<class Operand>
Operand & right_Usolve (Operand &B) const
 

Protected Attributes

Field _field
 
BlasMatrix< Field, typename Vector< Field >::Dense > & _factLU
 
BlasPermutation< size_t > & _permP
 
BlasPermutation< size_t > & _permQ
 
size_t _m
 
size_t _n
 
size_t _rank
 
bool _alloc
 
bool _plloc
 

Detailed Description

template<class Field>
class LinBox::PLUQMatrix< Field >

PLUQ factorisation.

This is a class to ease the use LU factorisation (see FFPACK::PLUQ

The factorisation is \( A = P L U P \) with L lower unit triangular, U upper non-unit triangular, P and Q permutations.

There are two kind of contructors (with and without permutations) and they build a PLUQ factorisation of a BlasMatrix/BlasBlackbox on a finite field. There are methods for retrieving P L,U and Q matrices and methods for solving systems.

Bug
Should really be tempalted by Matrix and be a (sub)domain

Member Typedef Documentation

◆ Element

template<class Field>
typedef Field::Element Element

◆ matrixType

template<class Field>
typedef BlasMatrix<Field,typename Vector<Field>::Dense > matrixType

◆ TriangularMatrix

Constructor & Destructor Documentation

◆ PLUQMatrix() [1/4]

template<class Field>
template<class _Rep>
PLUQMatrix ( const BlasMatrix< Field, _Rep > & A)

Contruction of PLUQ factorization of A (making a copy of A)

◆ PLUQMatrix() [2/4]

template<class Field>
template<class _Rep>
PLUQMatrix ( BlasMatrix< Field, _Rep > & A)

Contruction of PLUQ factorization of A (in-place in A)

◆ PLUQMatrix() [3/4]

template<class Field>
template<class _Rep>
PLUQMatrix ( const BlasMatrix< Field, _Rep > & A,
BlasPermutation< size_t > & P,
BlasPermutation< size_t > & Q )

Contruction of PLUQ factorization of A (making a copy of A).

P and Q are arguments !

◆ PLUQMatrix() [4/4]

template<class Field>
template<class _Rep>
PLUQMatrix ( BlasMatrix< Field, _Rep > & A,
BlasPermutation< size_t > & P,
BlasPermutation< size_t > & Q )

Contruction of PLUQ factorization of A (in-place in A).

P and Q are arguments !

Bug
in place ?

◆ ~PLUQMatrix()

template<class Field>
~PLUQMatrix ( )

destructor.

Member Function Documentation

◆ field()

template<class Field>
Field & field ( )

get the field on which the factorization is done

◆ rowdim()

template<class Field>
size_t rowdim ( ) const

get row dimension

◆ coldim()

template<class Field>
size_t coldim ( ) const

get column dimension

◆ getRank()

template<class Field>
size_t getRank ( ) const

get the rank of matrix

◆ getQ() [1/2]

template<class Field>
const BlasPermutation< size_t > & getQ ( ) const

get the permutation Q.

(no copy)

◆ getQ() [2/2]

template<class Field>
BlasPermutation< size_t > & getQ ( BlasPermutation< size_t > & Q) const

get the permutation Q.

(copy)

◆ getP() [1/2]

template<class Field>
const BlasPermutation< size_t > & getP ( ) const

Get the transpose of the permutation P.

Warning
This does not return P itself! (because it is more difficult to compute) If needed, P can be obtained as a TransposedBlasMatrix from the return value. One reason this confusion exists is that left-multiplying by a permuation matrix corresponds to a row permuation \(\pi \in S_n\), while right-multiplying by the same matrix corresponds to the inverse column permutation \(\pi^{-1}\)! Usually this is handled intelligently (eg by applyP) but you must be careful with getP().

◆ getP() [2/2]

template<class Field>
BlasPermutation< size_t > & getP ( BlasPermutation< size_t > & PT) const

get the permutation P^T.

(copy)

Warning
see PLUQMatrix::getP()

◆ getL()

template<class Field>
PLUQMatrix< Field >::TriangularMatrix & getL ( TriangularMatrix & L,
bool _QLUP = false ) const
inline

get the Matrix L.

Parameters
[out]L
_QLUPif true then L form QLUP decomposition, else L is form PLUQ decomposition.
Precondition
L has unit diagonal

◆ getU()

template<class Field>
PLUQMatrix< Field >::TriangularMatrix & getU ( TriangularMatrix & U) const
inline

get the matrix U.

Precondition
U has non-unit diagonal

◆ getPointer()

template<class Field>
Field::Element * getPointer ( ) const

get the matrix S.

from the LSP factorization of A deduced from PLUQ)

get a pointer to the begin of storage.

◆ getStride()

template<class Field>
size_t getStride ( ) const

get the stride in _factLU

◆ left_solve() [1/2]

template<class Field>
template<class Operand>
Operand & left_solve ( Operand & X,
const Operand & B ) const

Solvers with matrices or vectors Operand can be a BlasMatrix<Field,_Rep> or a std::vector<Element>

◆ left_solve() [2/2]

template<class Field>
template<class Operand>
Operand & left_solve ( Operand & B) const

◆ right_solve() [1/2]

template<class Field>
template<class Operand>
Operand & right_solve ( Operand & X,
const Operand & B ) const

◆ right_solve() [2/2]

template<class Field>
template<class Operand>
Operand & right_solve ( Operand & B) const

◆ left_Lsolve() [1/2]

template<class Field>
template<class Operand>
Operand & left_Lsolve ( Operand & X,
const Operand & B ) const

◆ left_Lsolve() [2/2]

template<class Field>
template<class Operand>
Operand & left_Lsolve ( Operand & B) const

◆ right_Lsolve() [1/2]

template<class Field>
template<class Operand>
Operand & right_Lsolve ( Operand & X,
const Operand & B ) const

◆ right_Lsolve() [2/2]

template<class Field>
template<class Operand>
Operand & right_Lsolve ( Operand & B) const

◆ left_Usolve()

template<class Field>
template<class Operand>
Operand & left_Usolve ( Operand & X,
const Operand & B ) const

◆ rleft_Usolve()

template<class Field>
template<class Operand>
Operand & rleft_Usolve ( Operand & B) const

◆ right_Usolve() [1/2]

template<class Field>
template<class Operand>
Operand & right_Usolve ( Operand & X,
const Operand & B ) const

◆ right_Usolve() [2/2]

template<class Field>
template<class Operand>
Operand & right_Usolve ( Operand & B) const

Field Documentation

◆ _field

template<class Field>
Field _field
protected

◆ _factLU

template<class Field>
BlasMatrix<Field,typename Vector<Field>::Dense >& _factLU
protected

◆ _permP

template<class Field>
BlasPermutation<size_t>& _permP
protected

◆ _permQ

template<class Field>
BlasPermutation<size_t>& _permQ
protected

◆ _m

template<class Field>
size_t _m
protected

◆ _n

template<class Field>
size_t _n
protected

◆ _rank

template<class Field>
size_t _rank
protected

◆ _alloc

template<class Field>
bool _alloc
protected

◆ _plloc

template<class Field>
bool _plloc
protected

The documentation for this class was generated from the following files: