TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Functions associated with LU Decomposition of a square matrix. More...
#include <iostream>
#include <valarray>
#include <vector>
Go to the source code of this file.
Typedefs | |
template<typename T > | |
using | matrix = std::vector<std::valarray<T>> |
Functions | |
template<typename T > | |
int | lu_decomposition (const matrix< T > &A, matrix< double > *L, matrix< double > *U) |
template<typename T > | |
double | determinant_lu (const matrix< T > &A) |
Functions associated with LU Decomposition of a square matrix.
Definition in file lu_decomposition.h.
using matrix = std::vector<std::valarray<T>> |
Define matrix type as a std::vector
of std::valarray
Definition at line 19 of file lu_decomposition.h.
double determinant_lu | ( | const matrix< T > & | A | ) |
Compute determinant of an NxN square matrix using LU decomposition. Using LU decomposition, the determinant is given by the product of diagonal elements of matrices L and U.
T | datatype of input matrix - int, unsigned int, double, etc |
A | input square matrix |
Definition at line 90 of file lu_decomposition.h.
int lu_decomposition | ( | const matrix< T > & | A, |
matrix< double > * | L, | ||
matrix< double > * | U ) |
Perform LU decomposition on matrix
[in] | A | matrix to decompose |
[out] | L | output L matrix |
[out] | U | output U matrix |
Definition at line 29 of file lu_decomposition.h.