ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Jacobi< Scalar > Class Template Reference

Jacobi eigen vectors/values decomposition. More...

#include <Jacobi.h>

Public Types

using SquareMatrix = cloudViewer::SquareMatrixTpl< Scalar >
 
using EigenValues = std::vector< Scalar >
 

Static Public Member Functions

static bool ComputeEigenValuesAndVectors2 (const SquareMatrix &matrix, SquareMatrix &eigenVectors, EigenValues &eigenValues, unsigned maxIterationCount=50)
 Computes the eigenvalues and eigenvectors of a given square matrix. More...
 
static bool ComputeEigenValuesAndVectors (const SquareMatrix &matrix, SquareMatrix &eigenVectors, EigenValues &eigenValues, bool absoluteValues=true, unsigned maxIterationCount=50)
 Computes eigen vectors (and values) with the Jacobian method. More...
 
static bool SortEigenValuesAndVectors (SquareMatrix &eigenVectors, EigenValues &eigenValues)
 
static bool GetEigenVector (const SquareMatrix &eigenVectors, unsigned index, Scalar eigenVector[])
 Returns the given eigenvector. More...
 
static bool GetMaxEigenValueAndVector (const SquareMatrix &eigenVectors, const EigenValues &eigenValues, Scalar &maxEigenValue, Scalar maxEigenVector[])
 Returns the biggest eigenvalue and its associated eigenvector. More...
 
static bool GetMinEigenValueAndVector (const SquareMatrix &eigenVectors, const EigenValues &eigenValues, Scalar &minEigenValue, Scalar minEigenVector[])
 Returns the smallest eigenvalue and its associated eigenvector. More...
 

Detailed Description

template<typename Scalar>
class Jacobi< Scalar >

Jacobi eigen vectors/values decomposition.

Definition at line 23 of file Jacobi.h.

Member Typedef Documentation

◆ EigenValues

template<typename Scalar >
using Jacobi< Scalar >::EigenValues = std::vector<Scalar>

Definition at line 26 of file Jacobi.h.

◆ SquareMatrix

template<typename Scalar >
using Jacobi< Scalar >::SquareMatrix = cloudViewer::SquareMatrixTpl<Scalar>

Definition at line 25 of file Jacobi.h.

Member Function Documentation

◆ ComputeEigenValuesAndVectors()

template<typename Scalar >
static bool Jacobi< Scalar >::ComputeEigenValuesAndVectors ( const SquareMatrix matrix,
SquareMatrix eigenVectors,
EigenValues eigenValues,
bool  absoluteValues = true,
unsigned  maxIterationCount = 50 
)
inlinestatic

◆ ComputeEigenValuesAndVectors2()

template<typename Scalar >
static bool Jacobi< Scalar >::ComputeEigenValuesAndVectors2 ( const SquareMatrix matrix,
SquareMatrix eigenVectors,
EigenValues eigenValues,
unsigned  maxIterationCount = 50 
)
inlinestatic

Computes the eigenvalues and eigenvectors of a given square matrix.

It uses Rutishauser's modfications of the classical Jacobi rotation method with threshold pivoting.

 Note: this code is inspired from John Burkardt's 'jacobi_eigenvalue'

code See https://people.sc.fsu.edu/~jburkardt/cpp_src/jacobi_eigenvalue/jacobi_eigenvalue.cpp

 \warning DGM: this method gives strange results in some particular

cases!!!

 \param[in] matrix input square matrix
 \param[out] eigenVectors eigenvectors (as a square matrix)
 \param[out] eigenValues eigenvalues
 \param[in] maxIterationCount max number of iteration (optional)
 \return success

Definition at line 45 of file Jacobi.h.

References cloudViewer::SquareMatrixTpl< Scalar >::isValid(), cloudViewer::SquareMatrixTpl< Scalar >::m_values, cloudViewer::SquareMatrixTpl< Scalar >::size(), and cloudViewer::SquareMatrixTpl< Scalar >::toIdentity().

◆ GetEigenVector()

template<typename Scalar >
static bool Jacobi< Scalar >::GetEigenVector ( const SquareMatrix eigenVectors,
unsigned  index,
Scalar  eigenVector[] 
)
inlinestatic

Returns the given eigenvector.

Parameters
eigenVectorseigenvectors (as a square matrix)
indexrequested eigenvector index (< eigenvectors matrix size)
eigenVectoroutput vector (size = matrix size)
Returns
success

Definition at line 364 of file Jacobi.h.

References cloudViewer::SquareMatrixTpl< Scalar >::m_values, and cloudViewer::SquareMatrixTpl< Scalar >::size().

Referenced by cloudViewer::Neighbourhood::computeMomentOrder1(), Jacobi< Scalar >::GetMaxEigenValueAndVector(), and Jacobi< Scalar >::GetMinEigenValueAndVector().

◆ GetMaxEigenValueAndVector()

template<typename Scalar >
static bool Jacobi< Scalar >::GetMaxEigenValueAndVector ( const SquareMatrix eigenVectors,
const EigenValues eigenValues,
Scalar &  maxEigenValue,
Scalar  maxEigenVector[] 
)
inlinestatic

Returns the biggest eigenvalue and its associated eigenvector.

Parameters
eigenVectorseigenvectors (as a square matrix)
eigenValueseigenvalues
maxEigenValuebiggest eigenvalue
maxEigenVectoreigenvector vector corresponding to the biggest eigenvalue
Returns
success

Definition at line 385 of file Jacobi.h.

References Jacobi< Scalar >::GetEigenVector(), cloudViewer::SquareMatrixTpl< Scalar >::isValid(), and cloudViewer::SquareMatrixTpl< Scalar >::size().

Referenced by cloudViewer::Neighbourhood::computeLeastSquareBestFittingPlane(), and cloudViewer::RegistrationTools::RegistrationProcedure().

◆ GetMinEigenValueAndVector()

template<typename Scalar >
static bool Jacobi< Scalar >::GetMinEigenValueAndVector ( const SquareMatrix eigenVectors,
const EigenValues eigenValues,
Scalar &  minEigenValue,
Scalar  minEigenVector[] 
)
inlinestatic

Returns the smallest eigenvalue and its associated eigenvector.

Parameters
eigenVectorseigenvectors (as a square matrix)
eigenValueseigenvalues
minEigenValuesmallest eigenvalue
minEigenVectoreigenvector vector corresponding to the smallest eigenvalue
Returns
success

Definition at line 410 of file Jacobi.h.

References Jacobi< Scalar >::GetEigenVector(), cloudViewer::SquareMatrixTpl< Scalar >::isValid(), and cloudViewer::SquareMatrixTpl< Scalar >::size().

Referenced by ComputeCorePointNormal(), and cloudViewer::Neighbourhood::computeLeastSquareBestFittingPlane().

◆ SortEigenValuesAndVectors()

template<typename Scalar >
static bool Jacobi< Scalar >::SortEigenValuesAndVectors ( SquareMatrix eigenVectors,
EigenValues eigenValues 
)
inlinestatic

Sorts the eigenvectors in the decreasing order of their associated eigenvalues

Parameters
eigenVectorseigenvectors (as a square matrix)
eigenValueseigenvalues
Returns
success

Definition at line 333 of file Jacobi.h.

References cloudViewer::SquareMatrixTpl< Scalar >::isValid(), cloudViewer::SquareMatrixTpl< Scalar >::m_values, cloudViewer::SquareMatrixTpl< Scalar >::size(), and std::swap().

Referenced by cloudViewer::Neighbourhood::computeFeature(), cloudViewer::Neighbourhood::computeMomentOrder1(), DimensionalityScaleParamsComputer::computeScaleParams(), ccCompass::estimateStrain(), and ccCompass::estimateStructureNormals().


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