Easy3D 2.6.1
Loading...
Searching...
No Matches
EigenSolver< MAT, T > Class Template Reference

An easy-to-use eigen solver. More...

#include <easy3d/core/eigen_solver.h>

Public Types

enum  SortingMethod { NO_SORTING , INCREASING , DECREASING }
 Enumeration of sorting methods for eigenvalues and their corresponding eigenvectors. More...
 

Public Member Functions

 EigenSolver (int n)
 Constructs an EigenSolver with a specified matrix size.
 
 ~EigenSolver ()
 Destructor.
 
void solve (const MAT &mat, SortingMethod sm=NO_SORTING)
 Computes the eigenvalues and eigenvectors of the specified input matrix.
 
eigen_value (int i) const
 Retrieves the eigenvalue at the specified index.
 
eigen_vector (int comp, int i) const
 Retrieves the specified component of the eigenvector at the given index.
 
T * eigen_values ()
 Retrieves the array of eigenvalues.
 
const MAT & eigen_vectors ()
 Retrieves the matrix of eigenvectors, stored as columns.
 

Detailed Description

template<class MAT, typename T = double>
class easy3d::EigenSolver< MAT, T >

An easy-to-use eigen solver.

This class provides methods to compute the eigenvalues and eigenvectors of a given matrix.

Template Parameters
MATThe type of the matrix.
TThe type of the floating-point number (default is double).

Member Enumeration Documentation

◆ SortingMethod

template<class MAT, typename T = double>
enum SortingMethod

Enumeration of sorting methods for eigenvalues and their corresponding eigenvectors.

Enumerator
NO_SORTING 

No sorting.

INCREASING 

Sort in increasing order.

DECREASING 

Sort in decreasing order.

Constructor & Destructor Documentation

◆ EigenSolver()

template<class MAT, typename T>
EigenSolver ( int n)
explicit

Constructs an EigenSolver with a specified matrix size.

Parameters
nThe size of the input matrix.

Member Function Documentation

◆ eigen_value()

template<class MAT, typename T = double>
T eigen_value ( int i) const
inline

Retrieves the eigenvalue at the specified index.

Parameters
iThe index of the eigenvalue.
Returns
The eigenvalue at the specified index.

◆ eigen_values()

template<class MAT, typename T = double>
T * eigen_values ( )
inline

Retrieves the array of eigenvalues.

Returns
A pointer to the array of eigenvalues.

◆ eigen_vector()

template<class MAT, typename T = double>
T eigen_vector ( int comp,
int i ) const
inline

Retrieves the specified component of the eigenvector at the given index.

Parameters
compThe component index of the eigenvector.
iThe index of the eigenvector.
Returns
The specified component of the eigenvector at the given index.

◆ eigen_vectors()

template<class MAT, typename T = double>
const MAT & eigen_vectors ( )
inline

Retrieves the matrix of eigenvectors, stored as columns.

Returns
A reference to the matrix of eigenvectors.

◆ solve()

template<class MAT, typename T>
void solve ( const MAT & mat,
SortingMethod sm = NO_SORTING )

Computes the eigenvalues and eigenvectors of the specified input matrix.

Parameters
matThe input matrix.
smThe sorting method for the eigenvalues and eigenvectors (default is NO_SORTING).

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