BlueSpice MediaWiki master

Cholesky decomposition class
For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L*L'.
If the matrix is not symmetric or positive definite, the constructor returns a partial decomposition and sets an internal flag that may be queried by the isSPD() method.
Class to obtain eigenvalues and eigenvectors of a real matrix.
If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector matrix V is orthogonal (i.e. A = V.times(D.times(V.transpose())) and V.times(V.transpose()) equals the identity matrix).
If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues in 1by1 blocks and any complex eigenvalues, lambda + i*mu, in 2by2 blocks, [lambda, mu; mu, lambda]. The columns of V represent the eigenvectors in the sense that A*V = V*D, i.e. A.times(V) equals V.times(D). The matrix V may be badly conditioned, or even singular, so the validity of the equation A = V*D*inverse(V) depends upon V.cond().
For an mbyn matrix A with m >= n, the LU decomposition is an mbyn unit lower triangular matrix L, an nbyn upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is mbym and U is mbyn.
The LU decompostion with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
For an mbyn matrix A with m >= n, the QR decomposition is an mbyn orthogonal matrix Q and an nbyn upper triangular matrix R so that A = Q*R.
The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns false.
For an mbyn matrix A with m >= n, the singular value decomposition is an mbyn orthogonal matrix U, an nbyn diagonal matrix S, and an nbyn orthogonal matrix V so that A = U*S*V'.
The singular values, sigma[$k] = S[$k][$k], are ordered so that sigma[0] >= sigma[1] >= ... >= sigma[n1].
The singular value decompostion always exists, so the constructor will never fail. The matrix condition number and the effective numerical rank can be computed from this decomposition.
Error handling
Pythagorean Theorem:
a = 3 b = 4 r = sqrt(square(a) + square(b)) r = 5
r = sqrt(a^2 + b^2) without under/overflow.