35#ifndef STK_INVERTUPPERTRIANGULAR_H
36#define STK_INVERTUPPERTRIANGULAR_H
47template<
class Matrix,
int Size_>
50 typedef typename Matrix::Type
Type;
164 inv.resize(
m.rows(),
m.cols());
166 for(
int j =
m.beginRows();
j <
m.endRows(); ++
j)
170 for(
int i =
j+1;
i <
m.endCols(); ++
i)
175 for (
int k =
j; k <
i; ++k)
176 {
sum -=
m(k,
i) * inv(
j, k);}
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 invertUpperTriangular22(Matrix const &m, Array2DUpperTriangular< Type > &inv)
compute the inverse of the 2x2 matrix m and store the result in inv.
static Type invertUpperTriangularXX(Matrix const &m, Array2DUpperTriangular< Type > &inv)
compute the inverse of the upper triangular matrix m and store the result in inv.
static Type invertUpperTriangular33(Matrix const &m, Array2DUpperTriangular< Type > &inv)
compute the inverse of the 3x3 matrix m and store the result in inv.
static Type invertUpperTriangular11(Matrix const &m, Array2DUpperTriangular< Type > &inv)
compute the inverse of the 1x1 matrix and store the result in inv.
static Type invertUpperTriangular44(Matrix const &m, Array2DUpperTriangular< 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, Array2DUpperTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DUpperTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DUpperTriangular< Type > &inv)
static Type run(Matrix const &m, Array2DUpperTriangular< Type > &inv)
computing the inverse of a matrix.
static Type run(Matrix const &m, Array2DUpperTriangular< Type > &inv)
Implementation of the inversion matrix method for upper triangular matrices.