#include <cmath>
#include <cstdlib>
#include <SharkDefs.h>
#include <LinAlg/LinAlg.h>
Go to the source code of this file.
Functions | |
| void | svd (const Array2D< double > &amatA, Array2D< double > &umatA, Array2D< double > &vmatA, Array< double > &w, unsigned maxIterations, bool ignoreThreshold) |
| Determines the singular value decomposition of a rectangular matrix "amatA". | |
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 svd.cpp.
| void svd | ( | const Array2D< double > & | amatA, | |
| Array2D< double > & | umatA, | |||
| Array2D< double > & | vmatA, | |||
| Array< double > & | w, | |||
| unsigned | maxIterations, | |||
| bool | ignoreThreshold | |||
| ) |
Determines the singular value decomposition of a rectangular matrix "amatA".
Given a
matrix amatA, this routine computes its singular value decomposition, defined as

where W is an
diagonal matrix with positive or zero elements, the so-called singular values. The matrices U and V are each orthogonal in the sense that their columns are orthonormal, i.e.

| amatA | The input matrix A, with size and . | |
| umatA | The column-orthogonal matrix U determined by the function. | |
| vmatA | The orthogonal matrix V determined by the function. | |
| w | n-dimensional vector with the calculated singular values. | |
| maxIterations | Number of iterations after which the algorithm gives up, if the solution has still not converged. Default is 200 Iterations. | |
| 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. |
| convergence | exception, if the solution has not converged after maxIterations iterations. |
Definition at line 110 of file svd.cpp.
References SIGN.
Referenced by g_inverse().