svd.cpp File Reference

Used for singular value decomposition of rectangular and square matrices. More...

#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".


Detailed Description

Used for singular value decomposition of rectangular and square matrices.

Author:
M. Kreutz
Date:
1998
Copyright (c) 1998-2000:
Institut für Neuroinformatik
Ruhr-Universität Bochum
D-44780 Bochum, Germany
Phone: +49-234-32-25558
Fax: +49-234-32-14209
eMail: Shark-admin@neuroinformatik.ruhr-uni-bochum.de
www: http://www.neuroinformatik.ruhr-uni-bochum.de

Project:
LinAlg



This file is part of LinAlg. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

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.


Function Documentation

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 $ m \times n $ matrix amatA, this routine computes its singular value decomposition, defined as

$ A = UWV^T $

where W is an $ n \times n $ 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.

$ UU^T = VV^T = V^TV = 1 $

Parameters:
amatA The input matrix A, with size $ m \times n $ and $ m \geq n $.
umatA The $ m \times n $ column-orthogonal matrix U determined by the function.
vmatA The $ n \times n $ 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.
Exceptions:
convergence exception, if the solution has not converged after maxIterations iterations.
Returns:
none
Please follow the link to view the source code of the example. The example can be executed in the example directory of package LinAlg.

Author:
M. Kreutz
Date:
1995
Changes
none
Status
stable
Examples:
svd_test.cpp, svdrank_test.cpp, and svdsort_test.cpp.

Definition at line 110 of file svd.cpp.

References SIGN.

Referenced by g_inverse().