PCL
pcl::GenericSVD< T > Class Template Reference

Generic singular value decomposition algorithm. More...

#include <Algebra.h>

+ Inheritance diagram for pcl::GenericSVD< T >:

Public Types

using algorithm_implementation = GenericInPlaceSVD< T >
 
using matrix = typename algorithm_implementation::matrix
 
using matrix_element = typename matrix::element
 
using vector = typename algorithm_implementation::vector
 
using vector_component = typename vector::component
 

Public Member Functions

 GenericSVD (const matrix &A)
 
int IndexOfLargestSingularValue () const
 
int IndexOfSmallestSingularValue () const
 

Public Attributes

matrix U
 
matrix V
 
vector W
 

Detailed Description

template<typename T>
class pcl::GenericSVD< T >

Definition at line 440 of file Algebra.h.

Member Typedef Documentation

◆ algorithm_implementation

template<typename T >
using pcl::GenericSVD< T >::algorithm_implementation = GenericInPlaceSVD<T>

Identifies the parent template class, which implements the underlying algorithm for this class.

Definition at line 448 of file Algebra.h.

◆ matrix

template<typename T >
using pcl::GenericSVD< T >::matrix = typename algorithm_implementation::matrix

Represents a matrix involved in a singular value decomposition.

Definition at line 458 of file Algebra.h.

◆ matrix_element

template<typename T >
using pcl::GenericSVD< T >::matrix_element = typename matrix::element

Represents a matrix element.

Definition at line 468 of file Algebra.h.

◆ vector

template<typename T >
using pcl::GenericSVD< T >::vector = typename algorithm_implementation::vector

Represents a vector involved in a singular value decomposition.

Definition at line 453 of file Algebra.h.

◆ vector_component

template<typename T >
using pcl::GenericSVD< T >::vector_component = typename vector::component

Represents a vector component.

Definition at line 463 of file Algebra.h.

Constructor & Destructor Documentation

◆ GenericSVD()

template<typename T >
pcl::GenericSVD< T >::GenericSVD ( const matrix A)
inline

Singular Value Decomposition: A = U*W*Vt

The dimensions of A are n rows and m columns. U is an n x m matrix. The m components of W are the positive diagonal elements of W, and each column of V (m x m) is the eigenvector for the corresponding element of W.

On output, this constructor stores U, W and V in the corresponding members of this object.

Definition at line 500 of file Algebra.h.

Member Function Documentation

◆ IndexOfLargestSingularValue()

template<typename T >
int pcl::GenericSVD< T >::IndexOfLargestSingularValue ( ) const
inline

Returns the column index of the largest eigenvector in matrix V. This is the index of the largest component of vector W.

Definition at line 512 of file Algebra.h.

◆ IndexOfSmallestSingularValue()

template<typename T >
int pcl::GenericSVD< T >::IndexOfSmallestSingularValue ( ) const
inline

Returns the column index of the smallest eigenvector in matrix V. This is the index of the smallest nonzero component of vector W.

Before calling this function, you should edit the components of vector W to set to zero all singular values below a suitable tolerance. For example, using the machine epsilon:

...
SVD svd( A );
for ( int i = 0; i < svd.W.Length(); ++i )
if ( 1 + svd.W[i] == 1 )
svd.W[i] = 0;
int i = svd.IndexOfSmallestSingularValue();
...
64-bit floating point real matrix.

Definition at line 536 of file Algebra.h.

Member Data Documentation

◆ U

template<typename T >
matrix pcl::GenericSVD< T >::U

This is the n x m matrix resulting from the singular value decomposition A = U*W*Vt. n and m are the rows and columns of the decomposed matrix A.

Definition at line 474 of file Algebra.h.

◆ V

template<typename T >
matrix pcl::GenericSVD< T >::V

Each column of this m x m matrix is the eigenvector for the corresponding element of W in a singular value decomposition A = U*W*Vt. m is the number of columns in the decomposed matrix A.

Definition at line 488 of file Algebra.h.

◆ W

template<typename T >
vector pcl::GenericSVD< T >::W

The components of this vector are the m (positive) diagonal elements of the matrix W in a singular value decomposition A = U*W*Vt. m is the number of columns in the decomposed matrix A.

Definition at line 481 of file Algebra.h.


The documentation for this class was generated from the following file: