Two Functions used: gemm , solve
gemm: Performs generalized matrix multiplication.
gemm: Performs generalized matrix multiplication.
- C++: void gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double gamma, OutputArray dst, intflags=0 )
- The function performs generalized matrix multiplication similar to the gemm functions in BLAS level 3. For example, gemm(src1,src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T) corresponds to
solve: Solves one or more linear systems or least-squares problems.- C++: bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
-
- solution (matrix inversion) method.
- DECOMP_LU Gaussian elimination with optimal pivot element chosen.
- DECOMP_CHOLESKY Cholesky factorization; the matrix src1 must be symmetrical and positively defined.
- DECOMP_EIG eigenvalue decomposition; the matrix src1 must be symmetrical.
- DECOMP_SVD singular value decomposition (SVD) method; the system can be over-defined and/or the matrix src1 can be singular.
- DECOMP_QR QR factorization; the system can be over-defined and/or the matrix src1 can be singular.
- DECOMP_NORMAL while all the previous flags are mutually exclusive, this flag can be used together with any of the previous; it means that the normal equations are solved instead of the original system .
The function solve solves a linear system or least-squares problem (the latter is possible with SVD or QR methods, or by specifying the flag DECOMP_NORMAL ):
No comments:
Post a Comment