NumCpp  2.16.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
nc::linalg::SVD< dtype > Class Template Reference

Performs the singular value decomposition of a general matrix. More...

#include <SVD.hpp>

Public Member Functions

 SVD (const NdArray< dtype > &inMatrix)
 
NdArray< doublelstsq (const NdArray< double > &inInput)
 
NdArray< doublepinv ()
 
const NdArray< double > & s () const noexcept
 
 STATIC_ASSERT_ARITHMETIC (dtype)
 
const NdArray< double > & u () const noexcept
 
const NdArray< double > & v () const noexcept
 

Static Public Attributes

static constexpr auto TOLERANCE = 1e-12
 

Detailed Description

template<typename dtype>
class nc::linalg::SVD< dtype >

Performs the singular value decomposition of a general matrix.

Constructor & Destructor Documentation

◆ SVD()

template<typename dtype >
nc::linalg::SVD< dtype >::SVD ( const NdArray< dtype > &  inMatrix)
inlineexplicit

Constructor

Parameters
inMatrixmatrix to perform SVD on

Member Function Documentation

◆ lstsq()

template<typename dtype >
NdArray< double > nc::linalg::SVD< dtype >::lstsq ( const NdArray< double > &  inInput)
inline

solves the linear least squares problem

Parameters
inInput
Returns
NdArray

◆ pinv()

template<typename dtype >
NdArray< double > nc::linalg::SVD< dtype >::pinv ( )
inline

Returns the pseudo-inverse of the input matrix

Returns
NdArray

◆ s()

template<typename dtype >
const NdArray< double > & nc::linalg::SVD< dtype >::s ( ) const
inlinenoexcept

the resultant w matrix

Returns
s matrix

◆ STATIC_ASSERT_ARITHMETIC()

template<typename dtype >
nc::linalg::SVD< dtype >::STATIC_ASSERT_ARITHMETIC ( dtype  )

◆ u()

template<typename dtype >
const NdArray< double > & nc::linalg::SVD< dtype >::u ( ) const
inlinenoexcept

the resultant u matrix

Returns
u matrix

◆ v()

template<typename dtype >
const NdArray< double > & nc::linalg::SVD< dtype >::v ( ) const
inlinenoexcept

the resultant v transpose matrix

Returns
v matrix

Field Documentation

◆ TOLERANCE

template<typename dtype >
constexpr auto nc::linalg::SVD< dtype >::TOLERANCE = 1e-12
staticconstexpr

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