#include <cmath>
#include <SharkDefs.h>
#include <LinAlg/LinAlg.h>
Go to the source code of this file.
Functions | |
| unsigned | g_inverse (const Array2D< double > &amatA, Array2D< double > &bmatA, unsigned maxIterations, double tolerance, bool ignoreThreshold) |
| Calculates the generalized inverse matrix of input matrix "amatA". | |
| void | invertSymmPositiveDefinite (Array2D< double > &I, const Array2D< double > &ArrSymm) |
| Inverts a symmetric positive definite matrix. | |
| void | g_inverseCholesky (const Array2D< double > &A, Array2D< double > &outA, double thresholdFactor) |
| Returns the generalized inverse matrix of input matrix "A" according to the paper: Fast computation of Moore-Penrose inverse matrices. Neural Information Processing-Letters and Reviews 8(2), pp. 25-29, 2005. | |
| void | g_inverseMoorePenrose (const Array2D< double > &A, Array2D< double > &outA) |
Returns the generalized inverse matrix of input matrix "A" using Cholesky decomposition assuming that has full rank. | |
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Definition in file g_inverse.cpp.
| unsigned g_inverse | ( | const Array2D< double > & | amatA, | |
| Array2D< double > & | bmatA, | |||
| unsigned | maxIterations, | |||
| double | tolerance, | |||
| bool | ignoreThreshold | |||
| ) |
Calculates the generalized inverse matrix of input matrix "amatA".
Given an input matrix
this function uses singular value decomposition to determine the generalized inverse matrix
, so that

If
is singular, i.e.
or
is non-square then
is not unique.
| amatA | input matrix. | |
| bmatA | generalized inverse matrix. | |
| maxIterations | Number of iterations after which the SVD calculation algorithm gives up, if the solution has still not converged. Default ist 200 Iterations. | |
| tolerance | singular values less than this value will be considered zero. Default is 1e-10. | |
| ignoreThreshold | If set to false, the method throws an exception if the threshold maxIterations is exceeded. Otherwise it uses the approximate intermediate results in the further calculations. The default is true. |
Definition at line 91 of file g_inverse.cpp.
References svd(), svdrank(), and svdsort().
Referenced by Matrix::inverse(), and invert().
| void g_inverseCholesky | ( | const Array2D< double > & | A, | |
| Array2D< double > & | outA, | |||
| double | thresholdFactor | |||
| ) |
Returns the generalized inverse matrix of input matrix "A" according to the paper: Fast computation of Moore-Penrose inverse matrices. Neural Information Processing-Letters and Reviews 8(2), pp. 25-29, 2005.
Returns the generalized inverse matrix of input matrix using Cholesky decomposition.
| A | The input matrix. |
| check_exception | the type of the exception will be "size mismatch" and indicates that A is not a square matrix |
Definition at line 254 of file g_inverse.cpp.
References invertSymm(), invertSymmPositiveDefinite(), matMat(), and transpose().
Referenced by Matrix::inverseCholesky().
| void g_inverseMoorePenrose | ( | const Array2D< double > & | A, | |
| Array2D< double > & | outA | |||
| ) |
Returns the generalized inverse matrix of input matrix "A" using Cholesky decomposition assuming that
has full rank.
Returns the generalized inverse matrix of input matrix
using Cholesky decomposition assuming that
has full rank.
| A | The input matrix. |
| check_exception | the type of the exception will be "size mismatch" and indicates that A is not a square matrix |
Definition at line 364 of file g_inverse.cpp.
References invertSymmPositiveDefinite(), matMat(), and transpose().
Referenced by Matrix::inverseMoorePenrose().
| void invertSymmPositiveDefinite | ( | Array2D< double > & | I, | |
| const Array2D< double > & | ArrSymm | |||
| ) |
Inverts a symmetric positive definite matrix.
Definition at line 198 of file g_inverse.cpp.
References CholeskyDecomposition(), and matMat().
Referenced by g_inverseCholesky(), g_inverseMoorePenrose(), and Matrix::inverseSymmPositiveDefinite().