Used to construct instances of the singular value decomposition class, RWSVDecomp. More...
#include <rw/lapack/sv.h>
Inherits SVDCalc.
Public Types | |
typedef rw_numeric_traits< TypeT >::norm_type | norm_type |
Public Member Functions | |
RWSVServer () | |
void | computeAllLeftVectors () |
void | computeAllRightVectors () |
void | computeAllVectors () |
void | computeDefaultLeftVectors () |
void | computeDefaultRightVectors () |
void | computeDefaultVectors () |
void | computeLeftVectors (unsigned n) |
void | computeRightVectors (unsigned n) |
void | computeVectors (unsigned n) |
virtual RWSVDecomp< TypeT, SVDCalc > | operator() (const RWGenMat< TypeT > &) const |
void | setTolerance (norm_type) |
The singular value decomposition server class, RWSVServer, is used to construct instances of the singular value decomposition class, RWSVDecomp. Using a server rather than the standard singular value decomposition constructor gives you control over what is computed.
The template parameter <SVDCalc>
determines the algorithm used by the RWSVDecomp class to compute the singular value decomposition and must implement the following method:
where norm_type is a typedef for rw_numeric_traits<T>::norm_type.
Parameters:
A - The input matrix for which the singular value decomposition is being computed.
U - The output matrix of left singular victors (the columns of U are the left singular vectors).
VT - The output matrix of right singular victors (the rows of VT are the right singular victors).
sigma - The output vector of singular values in descending order.
tolerance - The input singular values with magnitude less than tolerance will be set to zero.
numLeftVectors - The input number of left vectors to compute. If the number is less than zero, the default number of vectors will be computed (it is up to the developer to determine what the default is).
numRightVectors - The input number of right vectors to compute. If the number is less than zero, the default number of vectors will be computed (it is up to the developer to determine what the default is).
The return value is true
if the decomposition was successfully computed.
typedef rw_numeric_traits<TypeT>::norm_type RWSVServer< TypeT, SVDCalc >::norm_type |
Typedef for the usual return type of numerical norm
-like functions. For more information, see rw_numeric_traits<T>::norm_type.
RWSVServer< TypeT, SVDCalc >::RWSVServer | ( | ) |
Default constructor. Builds a new server, which computes all singular vectors by default.
void RWSVServer< TypeT, SVDCalc >::computeAllLeftVectors | ( | ) |
Configures the server to compute all left singular vectors.
void RWSVServer< TypeT, SVDCalc >::computeAllRightVectors | ( | ) |
Configures the server to compute all right singular vectors.
void RWSVServer< TypeT, SVDCalc >::computeAllVectors | ( | ) |
Configures the server to compute the first min(m,n)
singular vectors, where m
x n
is the size of the input matrix.
void RWSVServer< TypeT, SVDCalc >::computeDefaultLeftVectors | ( | ) |
Configures the server to compute the first min(m,n)
left singular vectors, where m
x n
is the size of the input matrix.
void RWSVServer< TypeT, SVDCalc >::computeDefaultRightVectors | ( | ) |
Configures the server to compute the first min(m,n)
right singular vectors, where m
x n
is the size of the input matrix.
void RWSVServer< TypeT, SVDCalc >::computeDefaultVectors | ( | ) |
Configures the server to compute all singular vectors.
void RWSVServer< TypeT, SVDCalc >::computeLeftVectors | ( | unsigned | n | ) |
Configures the server to compute the first n left singular vectors.
void RWSVServer< TypeT, SVDCalc >::computeRightVectors | ( | unsigned | n | ) |
Configures the server to compute the first n right singular vectors.
void RWSVServer< TypeT, SVDCalc >::computeVectors | ( | unsigned | n | ) |
Configures the server to compute the first n singular vectors.
|
virtual |
Computes a singular value decomposition.
void RWSVServer< TypeT, SVDCalc >::setTolerance | ( | norm_type | ) |
Specifies an accuracy to which the singular values should be computed.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |