#include <ludecompositionbase.h>
Public Member Functions | |
| bool | computeBasisKer (MatrixType *result) const |
| bool | computeInverse (MatrixType *result) const |
| bool | computeSomeAntecedent (const VectorType &v, VectorType *result) const |
| T | determinant () const |
| int | dim () const |
| int | dimKer () const |
| MatrixType | inverse () const |
| bool | isInvertible () const |
| const MatrixType & | LU () const |
| MatrixType & | LU () |
| const IntVecType & | P () const |
| IntVecType & | P () |
| const IntVecType & | Q () const |
| IntVecType & | Q () |
| int | rank () const |
| ~LUDecompositionBase () | |
Protected Member Functions | |
| void | perform (const MatrixType &A) |
Protected Attributes | |
| T | m_biggestEigenValueU |
| int | m_detPQ |
| int | m_dim |
| int | m_dimKer |
| MatrixType | m_LU |
| IntVecType | m_P |
| IntVecType | m_Q |
This class template is only internally used in Eigen.
| ~LUDecompositionBase | ( | ) | [inline] |
| bool computeBasisKer | ( | MatrixType * | result | ) | const [inline] |
This method computes a basis of the kernel of the matrix A of which *this is the LU decomposition.
The result argument is a pointer to the matrix in which the result will be stored. After calling this method, the dimKer() first columns of result form a basis of the kernel of A. If A is invertible, then dimKer()==0 and this method does nothing.
| bool computeInverse | ( | MatrixType * | result | ) | const [inline] |
Computes the inverse matrix of A, where A is the matrix of which *this is the LU decomposition, and stores it in *result.
If A is non-invertible, this method does nothing.
| bool computeSomeAntecedent | ( | const VectorType & | v, | |
| VectorType * | result | |||
| ) | const [inline] |
Computes an antecedent of v by the matrix A of which *this is a LU decomposition. In other words, this method computes a vector u such that A u = v. If such an antecedent u doesn't exist, this method does nothing.
1. The returned vector u is only one solution of the equation Au=v, which can have more than one solution if A is non-invertible. To get a basis of the whole (affine) space of solutions, use computeBasisKer().
| T determinant | ( | ) | const [inline] |
This method returns the determinant of the square matrix A of which *this is the LU decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the LU decomposition has already been computed.
Warning: a determinant can be very big or small, so for matrices of large dimension (like a 50-by-50 matrix) there can be a risk of overflow/underflow.
| int dim | ( | ) | const [inline] |
Returns the dimension (size) of square matrix A of which *this is the LU decomposition -- just in case you forgot it!
| int dimKer | ( | ) | const [inline] |
Returns the dimension of the kernel of the square matrix A of which *this is the LU decomposition. It is very fast because the computation has already been done during the LU decomposition.
| MatrixType inverse | ( | ) | const [inline] |
This methods returns the inverse matrix of A, where A is the matrix of which *this is the LU decomposition. If A is non-invertible, the returned value is undefined.
This method calls computeInverse(), so the same remarks as for computeInverse() apply here.
This method returns an object by value, which is inefficient.
| bool isInvertible | ( | ) | const [inline] |
Returns true if the square matrix A, of which *this is the LU decomposition, is invertible. It returns false if it is singular. It is very fast because the computation has already been done during the LU decomposition.
| const MatrixType& LU | ( | ) | const [inline] |
| MatrixType& LU | ( | ) | [inline] |
Returns the member m_LU, which stores the matrices L and U. See member m_LU and the class's comment.
| const IntVecType& P | ( | ) | const [inline] |
| IntVecType& P | ( | ) | [inline] |
Returns the member m_P, which stores the permutation P. See member m_P and the class's comment.
| void perform | ( | const MatrixType & | A | ) | [inline, protected] |
The helper method actually computing the LU decomposition. Called by the constructor.
For internal reasons it is public, but you should never call it.
| const IntVecType& Q | ( | ) | const [inline] |
| IntVecType& Q | ( | ) | [inline] |
Returns the member m_Q, which stores the permutation Q. See member m_Q and the class's comment.
| int rank | ( | ) | const [inline] |
Returns the rank of the square matrix A of which *this is the LU decomposition. It is very fast because the computation has already been done during the LU decomposition.
T m_biggestEigenValueU [protected] |
The Eigenvalue of U that has biggest absolute value.
int m_detPQ [protected] |
This is equal to the determinant of the product matrix PQ, or equivalently, to the signature of the permutation pq. This is used by the determinant() method.
int m_dim [protected] |
The dimension of the matrix A of which *this is the LU decomposition
int m_dimKer [protected] |
The dimension of the kernel of the square matrix A of which *this is the LU decomposition.
MatrixType m_LU [protected] |
This matrix holds the data of the L and U matrices of the LU decomposition, as follows. The part above the diagonal (including the diagonal) is U. The part strictly below the diagonal is L. As U is upper triangular, L is lower triangular, and L has its diagonal entries all equal to 1, this holds all the data of the matrices L and U. Also note that the Eigenvalues of U are stored in decreasing order of absolute value.
IntVecType m_P [protected] |
The permutation matrices P and Q are stored in these permutations p, q. They are understood as follows: the permutation p maps k to p[k]. Same for q. So, in terms of matrices, P moves the k-th row to the p[k]-th row, and Q moves the k-th column to the q[k]-th column.
IntVecType m_Q [protected] |
1.5.9