35#ifndef STK_INVERTLOWERTRIANGULAR_H
36#define STK_INVERTLOWERTRIANGULAR_H
46template<
class Matrix,
int Size_>
49 typedef typename Matrix::Type
Type;
163 inv.resize(
m.rows(),
m.cols());
165 for(
int j =
m.beginCols();
j <
m.endCols(); ++
j)
169 for(
int i =
j+1;
i <
m.endRows(); ++
i)
174 for (
int k =
j; k <
i; ++k)
175 {
sum -=
m(
i, k) * inv(k,
j);}
188template<
class Matrix,
int Size_>
191 typedef typename Matrix::Type
Type;
194 switch (
m.sizeRows())
206template<
class Matrix>
209 typedef typename Matrix::Type
Type;
214template<
class Matrix>
217 typedef typename Matrix::Type
Type;
222template<
class Matrix>
225 typedef typename Matrix::Type
Type;
230template<
class Matrix>
233 typedef typename Matrix::Type
Type;
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
double Real
STK fundamental type of Real values.
static Type invertLowerTriangularXX(Matrix const &m, Array2DLowerTriangular< Type > &inv)
compute the inverse of the lower triangular matrix m and store the result in inv.
static Type invertLowerTriangular11(Matrix const &m, Array2DLowerTriangular< Type > &inv)
compute the inverse of the 1x1 matrix and store the result in inv.
static Type invertLowerTriangular33(Matrix const &m, Array2DLowerTriangular< Type > &inv)
compute the inverse of the 3x3 matrix m and store the result in inv.
static Type invertLowerTriangular22(Matrix const &m, Array2DLowerTriangular< Type > &inv)
compute the inverse of the 2x2 matrix m and store the result in inv.
static Type invertLowerTriangular44(Matrix const &m, Array2DLowerTriangular< Type > &inv)
compute the inverse of the 4x4 matrix m and store the result in inv.
The namespace STK is the main domain space of the Statistical ToolKit project.
static Type run(Matrix const &m, Array2DLowerTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DLowerTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DLowerTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DLowerTriangular< Type > &inv)
utility class allowing to call the correct static function computing the inverse of a matrix.
static Type run(Matrix const &m, Array2DLowerTriangular< Type > &inv)
Implementation of the computation of the inverse of a lower triangular matrix.