Functions | |
| 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. | |
| 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 31 of file linearAlgebra.cpp.
References dgetrf_(), and DLR_THROW3.
Referenced by dlr::computerVision::OpticalFlow< Format >::getFlow().
| 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 86 of file linearAlgebra.cpp.
References DLR_THROW3, and 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 168 of file linearAlgebra.cpp.
References DLR_THROW3, and dsyev_().
Referenced by dlr::computerVision::registerPoints3D().
| 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 284 of file linearAlgebra.cpp.
References DLR_THROW3, dlr::numeric::identity(), and 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 305 of file linearAlgebra.cpp.
References DLR_THROW3, dlr::numeric::dot(), inverse(), dlr::numeric::matrixMultiply(), and dlr::numeric::sum().
| 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 363 of file linearAlgebra.cpp.
References dgels_(), and DLR_THROW3.
| 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 460 of file linearAlgebra.cpp.
References dgesv_(), and DLR_THROW3.
Referenced by dlr::geometry::findIntersect(), and dlr::optimization::OptimizerLM< Functor >::run().
| 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 449 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 502 of file linearAlgebra.cpp.
References dgtsv_(), and DLR_THROW3.
| 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 559 of file linearAlgebra.cpp.
References inverse(), and dlr::numeric::matrixMultiply().
| 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.
| 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. | |
| sigmaArray | This argument will be filled in with the singular values of the matrix, in descending order. | |
| vTransposeArray | This argument will be filled in with an orthonormal basis spanning the domain of the input matrix, one basis vector per row. |
Definition at line 570 of file linearAlgebra.cpp.
References dgesdd_(), and DLR_THROW3.
| 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 849 of file linearAlgebra.cpp.
References dgesdd_(), and DLR_THROW3.
1.5.2