Functions | |
| void | choleskyFactorization (const Array2D< Float64 > &inputArray, Array2D< Float64 > &kArray, bool isUpperTriangular=true) |
| This function computes the Cholesky factorization of a symmetric, positive definite matrix. | |
| Float64 | determinant (const Array2D< Float64 > &A) |
| This function computes the determinant of a square Array2D<Float64> instance. | |
| Array1D< Float64 > | eigenvaluesSymmetric (const Array2D< Float64 > &inputArray) |
| This function computes the eigenvalues of a symmetric real matrix. | |
| void | eigenvectorsSymmetric (const Array2D< Float64 > &inputArray, Array1D< Float64 > &eigenvalues, Array2D< Float64 > &eigenvectors) |
| This function computes the eigenvalues and eigenvectors of a symmetric real matrix. | |
| Array2D< Float64 > | inverse (const Array2D< Float64 > &A) |
| This function accepts a square Array2D<Float64> instance and returns an Array2D<Float64> instance such that the matrix product of the two is equal to the identity matrix. | |
| std::pair< Float64, Float64 > | linearFit (const Array1D< Float64 > &array0, const Array1D< Float64 > &array1) |
| This function computes the best linear fit between the two input arrays. | |
| Array1D< Float64 > | linearLeastSquares (const Array2D< Float64 > &A, const Array1D< Float64 > &b) |
| This function solves the system of equations A*x = b, where A and b are known Array2D<Float64> instances. | |
| void | linearSolveInPlace (Array2D< Float64 > &A, Array1D< Float64 > &b) |
| This function solves the system of equations A*x = b, where A is a known matrix, and b is a known vector. | |
| void | linearSolveInPlace (Array2D< Float64 > &A, Array2D< Float64 > &b) |
| This function is identical to linearSolveInPlace(Array2D<Float64>, Array1D<Float64>&), except that b (and therefore x) is not constrained to be a vector. | |
| Array1D< Float64 > | linearSolveTridiagonal (const Array1D< Float64 > &subDiagonal, const Array1D< Float64 > ¢erDiagonal, const Array1D< Float64 > &superDiagonal, const Array1D< Float64 > &bVector) |
| This function solves the system of equations A*x = b, where A is a known tridiagonal matrix and b is a known vector. | |
| Array2D< Float64 > | pseudoinverse (const Array2D< Float64 > &A) |
| This function accepts an Array2D<Float64> instance having at least as many rows as columns, and returns the Moore-Penrose pseudoinverse. | |
| void | singularValueDecomposition (const Array2D< Float64 > &inputArray, Array2D< Float64 > &uArray, Array1D< Float64 > &sigmaArray, Array2D< Float64 > &vTransposeArray) |
| This function computes the singular value decomposition of a matrix. | |
| void | singularValueDecompositionSimple (const Array2D< Float64 > &inputArray, Array2D< Float64 > &uArray, Array1D< Float64 > &sigmaArray, Array2D< Float64 > &vTransposeArray) |
| Array1D< Float64 > | singularValues (const Array2D< Float64 > &inputArray) |
| This function computes the singular values a matrix without computing the associated U and V matrices. | |
| void dlr::linearAlgebra::choleskyFactorization | ( | const Array2D< Float64 > & | inputArray, | |
| Array2D< Float64 > & | kArray, | |||
| bool | isUpperTriangular = true | |||
| ) |
This function computes the Cholesky factorization of a symmetric, positive definite matrix.
That is, for a symmetric, positive definite matrix E, it computes the upper triangular matrix K such that E == K^T * K (if argument isUpperTriangular is true), or the lower triangular matrix such that E = K * K^T (if argument isUpperTriangular is false).
| inputArray | This argument is the matrix to be factored. | |
| kArray | This argument will be filled in with the upper triangular matrix K. | |
| isUpperTriangular | This argument specifies whether the result should be returned as an upper triangular or lower triangular matrix. |
Definition at line 28 of file linearAlgebra.cpp.
References dpotrf_().
| Float64 dlr::linearAlgebra::determinant | ( | const Array2D< Float64 > & | A | ) |
This function computes the determinant of a square Array2D<Float64> instance.
| A | This argument represents the matrix from which to compute the determinant. |
Definition at line 107 of file linearAlgebra.cpp.
References dgetrf_().
| Array1D< Float64 > dlr::linearAlgebra::eigenvaluesSymmetric | ( | const Array2D< Float64 > & | inputArray | ) |
This function computes the eigenvalues of a symmetric real matrix.
| inputArray | This argument is and Array2D<Float64> instance representing a symmetric matrix. It must be square and have non-zero size. Only the data in the upper triangular portion of the array (including the diagonal) will be examined. The remaining elements are assumed to be symmetric. |
Definition at line 162 of file linearAlgebra.cpp.
References dsyev_().
| void dlr::linearAlgebra::eigenvectorsSymmetric | ( | const Array2D< Float64 > & | inputArray, | |
| Array1D< Float64 > & | eigenvalues, | |||
| Array2D< Float64 > & | eigenvectors | |||
| ) |
This function computes the eigenvalues and eigenvectors of a symmetric real matrix.
| inputArray | This argument is and Array2D<Float64> instance representing a symmetric matrix. It must be square and have non-zero size. Only the data in the upper triangular portion of the array (including the diagonal) will be examined. The remaining elements are assumed to be symmetric. | |
| eigenvalues | This argument is used to return an Array1D<Float64> instance containing the eigenvalues, sorted into descending order. | |
| eigenvectors | This argument is used to return the eigenvectors. On return, the first column contains the eigenvector corresponding to the first eigenvalue, the second column contains the eigenvector corresponding to the second eigenvalue, and so on. |
Definition at line 244 of file linearAlgebra.cpp.
References dsyev_().
| Array2D< Float64 > dlr::linearAlgebra::inverse | ( | const Array2D< Float64 > & | A | ) |
This function accepts a square Array2D<Float64> instance and returns an Array2D<Float64> instance such that the matrix product of the two is equal to the identity matrix.
It is an error if the argument is not invertible.
| A | This argument is the matrix to be inverted. |
Definition at line 360 of file linearAlgebra.cpp.
References linearSolveInPlace().
Referenced by linearFit(), and pseudoinverse().
| std::pair< Float64, Float64 > dlr::linearAlgebra::linearFit | ( | const Array1D< Float64 > & | array0, | |
| const Array1D< Float64 > & | array1 | |||
| ) |
This function computes the best linear fit between the two input arrays.
That is, it solves for scalars a and b which minimize the quantity
e = |(a * array0 + b) - array1|^2,
where array0 and array1 are the two input arrays. Put another way, this means we're solving (in the least squares sense) for the variables a and b which most nearly satisfy the following equation:
a * array0 + b = array1
| array0 | This argument is the first input array. | |
| array1 | This argument is the second input array. |
Definition at line 381 of file linearAlgebra.cpp.
References inverse().
| Array1D< Float64 > dlr::linearAlgebra::linearLeastSquares | ( | const Array2D< Float64 > & | A, | |
| const Array1D< Float64 > & | b | |||
| ) |
This function solves the system of equations A*x = b, where A and b are known Array2D<Float64> instances.
The contents of the arguments are not modified. If the solution fails, a ValueException will be generated.
| A | This argument specifies the A matrix in the system "Ax = b," and must either be square or have more rows than columns. | |
| b | This argument specifies the b vector in the system "Ax = b." It must have the same number of elements as argument A has rows. |
Definition at line 439 of file linearAlgebra.cpp.
References dgels_().
| void dlr::linearAlgebra::linearSolveInPlace | ( | Array2D< Float64 > & | A, | |
| Array2D< Float64 > & | b | |||
| ) |
This function is identical to linearSolveInPlace(Array2D<Float64>, Array1D<Float64>&), except that b (and therefore x) is not constrained to be a vector.
| A | This argument specifies the A matrix in the system "Ax = b," and must be square. In the current implementation, it will be replaced the LU decomposition of A, however this behavior may change in the future. | |
| b | This argument specifies the b matrix in the system "Ax = b." It must have the same size as x, and will be replaced with the recovered value of x. |
Definition at line 536 of file linearAlgebra.cpp.
References dgesv_().
| void dlr::linearAlgebra::linearSolveInPlace | ( | Array2D< Float64 > & | A, | |
| Array1D< Float64 > & | b | |||
| ) |
This function solves the system of equations A*x = b, where A is a known matrix, and b is a known vector.
The contents of both arguments are modified as part of the process. If the solution fails, a ValueException will be generated.
| A | This argument specifies the A matrix in the system "Ax = b," and must be square. | |
| b | This argument specifies the b vector in the system "Ax = b." It must have the same size as x, and will be replaced with the recovered value of x. |
Definition at line 525 of file linearAlgebra.cpp.
Referenced by inverse().
| Array1D< Float64 > dlr::linearAlgebra::linearSolveTridiagonal | ( | const Array1D< Float64 > & | subDiagonal, | |
| const Array1D< Float64 > & | centerDiagonal, | |||
| const Array1D< Float64 > & | superDiagonal, | |||
| const Array1D< Float64 > & | bVector | |||
| ) |
This function solves the system of equations A*x = b, where A is a known tridiagonal matrix and b is a known vector.
The contents of the arguments are not modified. If the solution fails, a ValueException will be generated.
| subDiagonal | This argument specifies the lower diagonal of the A matrix in the system "A*x = b." | |
| centerDiagonal | This argument specifies the center diagonal of the A matrix in the system "A*x = b." It's length must be 1 greater than the length of argument subDiagonal. | |
| superDiagonal | This argument specifies the upper diagonal of the A matrix in the system "A*x = b." It's length must be the same as the length of argument subDiagonal. | |
| b | This argument specifies the b vector in the system "Ax = b." It must have the same length as argument centerDiagonal. |
Definition at line 578 of file linearAlgebra.cpp.
References dgtsv_().
| Array2D< Float64 > dlr::linearAlgebra::pseudoinverse | ( | const Array2D< Float64 > & | A | ) |
This function accepts an Array2D<Float64> instance having at least as many rows as columns, and returns the Moore-Penrose pseudoinverse.
That is, for an input matrix A, it returns inverse(matrixMultiply(transpose(A), A)). It is an error if the rank of A is less than A.columns().
| A | This argument is the matrix to be psuedoinverted. |
Definition at line 635 of file linearAlgebra.cpp.
References inverse().
| void dlr::linearAlgebra::singularValueDecomposition | ( | const Array2D< Float64 > & | inputArray, | |
| Array2D< Float64 > & | uArray, | |||
| Array1D< Float64 > & | sigmaArray, | |||
| Array2D< Float64 > & | vTransposeArray | |||
| ) |
This function computes the singular value decomposition of a matrix.
After a successful call, matrixMultiply(matrixMultiply(uArray, sigmaArray), vTransposeArray) == inputArray.
| inputArray | This argument is the matrix to be decomposed. | |
| uArray | This argument will be filled in with an orthonormal basis spanning the range of the input matrix, one basis vector per column. If inputArray has M rows and N columns, then this array will have M rows and min(M, N) columns when the funtion returns. | |
| sigmaArray | This argument will be filled in with the singular values of the matrix, in descending order. If inputArray has M rows and N columns, then this array will have min(M, N) elements when the funtion returns. | |
| vTransposeArray | This argument will be filled in with an orthonormal basis spanning the domain of the input matrix, one basis vector per row. If inputArray has M rows and N columns, then this array will have min(M, N) rows and N columns when the funtion returns. |
Definition at line 646 of file linearAlgebra.cpp.
References dgesdd_().
| Array1D< Float64 > dlr::linearAlgebra::singularValues | ( | const Array2D< Float64 > & | inputArray | ) |
This function computes the singular values a matrix without computing the associated U and V matrices.
| inputArray | This argument is the matrix from which to compute the singular values. |
Definition at line 925 of file linearAlgebra.cpp.
References dgesdd_().
1.5.6