GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
svd< T > Class Template Reference

#include "svd.h"

Collaboration diagram for svd< T >:

Public Types

typedef T::real_diag_matrix_type DM_T
 
enum class  Driver { GESVD , GESDD , GEJSV }
 
enum class  Type { std , economy , sigma_only }
 

Public Member Functions

 svd (const svd &a)
 
 svd (const T &a, svd::Type type=svd::Type::std, svd::Driver driver=svd::Driver::GESVD)
 
 svd (void)
 
 ~svd (void)=default
 
left_singular_matrix (void) const
 
svdoperator= (const svd &a)
 
right_singular_matrix (void) const
 
DM_T singular_values (void) const
 

Private Types

typedef DM_T::element_type DM_P
 
typedef T::element_type P
 

Private Member Functions

void gejsv (char &joba, char &jobu, char &jobv, char &jobr, char &jobt, char &jobp, F77_INT m, F77_INT n, P *tmp_data, F77_INT m1, DM_P *s_vec, P *u, P *v, F77_INT nrow_v1, std::vector< P > &work, F77_INT &lwork, std::vector< F77_INT > &iwork, F77_INT &info)
 
void gejsv (char &joba, char &jobu, char &jobv, char &jobr, char &jobt, char &jobp, F77_INT m, F77_INT n, P *tmp_data, F77_INT m1, DM_P *s_vec, P *u, P *v, F77_INT nrow_v1, std::vector< P > &work, F77_INT &lwork, std::vector< F77_INT > &iwork, F77_INT &info)
 
void gejsv (char &joba, char &jobu, char &jobv, char &jobr, char &jobt, char &jobp, F77_INT m, F77_INT n, P *tmp_data, F77_INT m1, DM_P *s_vec, P *u, P *v, F77_INT nrow_v1, std::vector< P > &work, F77_INT &lwork, std::vector< F77_INT > &iwork, F77_INT &info)
 
void gejsv (char &joba, char &jobu, char &jobv, char &jobr, char &jobt, char &jobp, F77_INT m, F77_INT n, P *tmp_data, F77_INT m1, DM_P *s_vec, P *u, P *v, F77_INT nrow_v1, std::vector< P > &work, F77_INT &lwork, std::vector< F77_INT > &iwork, F77_INT &info)
 
void gejsv (char &joba, char &jobu, char &jobv, char &jobr, char &jobt, char &jobp, octave_f77_int_type m, octave_f77_int_type n, P *tmp_data, octave_f77_int_type m1, DM_P *s_vec, P *u, P *v, octave_f77_int_type nrow_v1, std::vector< P > &work, octave_f77_int_type &lwork, std::vector< octave_f77_int_type > &iwork, octave_f77_int_type &info)
 
OCTAVE_API void gesdd (char &jobz, F77_INT m, F77_INT n, Complex *tmp_data, F77_INT m1, double *s_vec, Complex *u, Complex *vt, F77_INT nrow_vt1, std::vector< Complex > &work, F77_INT &lwork, F77_INT *iwork, F77_INT &info)
 
OCTAVE_API void gesdd (char &jobz, F77_INT m, F77_INT n, double *tmp_data, F77_INT m1, double *s_vec, double *u, double *vt, F77_INT nrow_vt1, std::vector< double > &work, F77_INT &lwork, F77_INT *iwork, F77_INT &info)
 
OCTAVE_API void gesdd (char &jobz, F77_INT m, F77_INT n, float *tmp_data, F77_INT m1, float *s_vec, float *u, float *vt, F77_INT nrow_vt1, std::vector< float > &work, F77_INT &lwork, F77_INT *iwork, F77_INT &info)
 
OCTAVE_API void gesdd (char &jobz, F77_INT m, F77_INT n, FloatComplex *tmp_data, F77_INT m1, float *s_vec, FloatComplex *u, FloatComplex *vt, F77_INT nrow_vt1, std::vector< FloatComplex > &work, F77_INT &lwork, F77_INT *iwork, F77_INT &info)
 
void gesdd (char &jobz, octave_f77_int_type m, octave_f77_int_type n, P *tmp_data, octave_f77_int_type m1, DM_P *s_vec, P *u, P *vt, octave_f77_int_type nrow_vt1, std::vector< P > &work, octave_f77_int_type &lwork, octave_f77_int_type *iwork, octave_f77_int_type &info)
 
OCTAVE_API void gesvd (char &jobu, char &jobv, F77_INT m, F77_INT n, Complex *tmp_data, F77_INT m1, double *s_vec, Complex *u, Complex *vt, F77_INT nrow_vt1, std::vector< Complex > &work, F77_INT &lwork, F77_INT &info)
 
OCTAVE_API void gesvd (char &jobu, char &jobv, F77_INT m, F77_INT n, double *tmp_data, F77_INT m1, double *s_vec, double *u, double *vt, F77_INT nrow_vt1, std::vector< double > &work, F77_INT &lwork, F77_INT &info)
 
OCTAVE_API void gesvd (char &jobu, char &jobv, F77_INT m, F77_INT n, float *tmp_data, F77_INT m1, float *s_vec, float *u, float *vt, F77_INT nrow_vt1, std::vector< float > &work, F77_INT &lwork, F77_INT &info)
 
OCTAVE_API void gesvd (char &jobu, char &jobv, F77_INT m, F77_INT n, FloatComplex *tmp_data, F77_INT m1, float *s_vec, FloatComplex *u, FloatComplex *vt, F77_INT nrow_vt1, std::vector< FloatComplex > &work, F77_INT &lwork, F77_INT &info)
 
void gesvd (char &jobu, char &jobv, octave_f77_int_type m, octave_f77_int_type n, P *tmp_data, octave_f77_int_type m1, DM_P *s_vec, P *u, P *vt, octave_f77_int_type nrow_vt1, std::vector< P > &work, octave_f77_int_type &lwork, octave_f77_int_type &info)
 

Private Attributes

svd::Driver m_driver
 
m_left_sm
 
m_right_sm
 
DM_T m_sigma
 
svd::Type m_type
 

Detailed Description

template<typename T>
class svd< T >

Definition at line 38 of file svd.h.

Member Typedef Documentation

◆ DM_P

template<typename T >
typedef DM_T::element_type svd< T >::DM_P
private

Definition at line 97 of file svd.h.

◆ DM_T

template<typename T >
typedef T::real_diag_matrix_type svd< T >::DM_T

Definition at line 44 of file svd.h.

◆ P

template<typename T >
typedef T::element_type svd< T >::P
private

Definition at line 96 of file svd.h.

Member Enumeration Documentation

◆ Driver

template<typename T >
enum svd::Driver
strong
Enumerator
GESVD 
GESDD 
GEJSV 

Definition at line 53 of file svd.h.

◆ Type

template<typename T >
enum svd::Type
strong
Enumerator
std 
economy 
sigma_only 

Definition at line 46 of file svd.h.

Constructor & Destructor Documentation

◆ svd() [1/3]

template<typename T >
svd< T >::svd ( void  )
inline

Definition at line 60 of file svd.h.

◆ svd() [2/3]

◆ svd() [3/3]

template<typename T >
svd< T >::svd ( const svd< T > &  a)
inline

Definition at line 67 of file svd.h.

◆ ~svd()

template<typename T >
svd< T >::~svd ( void  )
default

Member Function Documentation

◆ gejsv() [1/5]

void svd< Matrix >::gejsv ( char &  joba,
char &  jobu,
char &  jobv,
char &  jobr,
char &  jobt,
char &  jobp,
F77_INT  m,
F77_INT  n,
P tmp_data,
F77_INT  m1,
DM_P s_vec,
P u,
P v,
F77_INT  nrow_v1,
std::vector< P > &  work,
F77_INT lwork,
std::vector< F77_INT > &  iwork,
F77_INT info 
)
private

Definition at line 577 of file svd.cc.

References GEJSV_REAL_STEP, m, n, and gejsv_lwork< T >::optimal().

◆ gejsv() [2/5]

void svd< FloatMatrix >::gejsv ( char &  joba,
char &  jobu,
char &  jobv,
char &  jobr,
char &  jobt,
char &  jobp,
F77_INT  m,
F77_INT  n,
P tmp_data,
F77_INT  m1,
DM_P s_vec,
P u,
P v,
F77_INT  nrow_v1,
std::vector< P > &  work,
F77_INT lwork,
std::vector< F77_INT > &  iwork,
F77_INT info 
)
private

Definition at line 594 of file svd.cc.

References GEJSV_REAL_STEP, m, n, and gejsv_lwork< T >::optimal().

◆ gejsv() [3/5]

void svd< ComplexMatrix >::gejsv ( char &  joba,
char &  jobu,
char &  jobv,
char &  jobr,
char &  jobt,
char &  jobp,
F77_INT  m,
F77_INT  n,
P tmp_data,
F77_INT  m1,
DM_P s_vec,
P u,
P v,
F77_INT  nrow_v1,
std::vector< P > &  work,
F77_INT lwork,
std::vector< F77_INT > &  iwork,
F77_INT info 
)
private

Definition at line 611 of file svd.cc.

References F77_DBLE_CMPLX_ARG, and GEJSV_COMPLEX_STEP.

◆ gejsv() [4/5]

void svd< FloatComplexMatrix >::gejsv ( char &  joba,
char &  jobu,
char &  jobv,
char &  jobr,
char &  jobt,
char &  jobp,
F77_INT  m,
F77_INT  n,
P tmp_data,
F77_INT  m1,
DM_P s_vec,
P u,
P v,
F77_INT  nrow_v1,
std::vector< P > &  work,
F77_INT lwork,
std::vector< F77_INT > &  iwork,
F77_INT info 
)
private

Definition at line 640 of file svd.cc.

References F77_CMPLX_ARG, and GEJSV_COMPLEX_STEP.

◆ gejsv() [5/5]

template<typename T >
void svd< T >::gejsv ( char &  joba,
char &  jobu,
char &  jobv,
char &  jobr,
char &  jobt,
char &  jobp,
octave_f77_int_type  m,
octave_f77_int_type  n,
P tmp_data,
octave_f77_int_type  m1,
DM_P s_vec,
P u,
P v,
octave_f77_int_type  nrow_v1,
std::vector< P > &  work,
octave_f77_int_type &  lwork,
std::vector< octave_f77_int_type > &  iwork,
octave_f77_int_type &  info 
)
private

Referenced by svd< T >::svd().

◆ gesdd() [1/5]

OCTAVE_API void svd< ComplexMatrix >::gesdd ( char &  jobz,
F77_INT  m,
F77_INT  n,
Complex tmp_data,
F77_INT  m1,
double *  s_vec,
Complex u,
Complex vt,
F77_INT  nrow_vt1,
std::vector< Complex > &  work,
F77_INT lwork,
F77_INT iwork,
F77_INT info 
)
private

Definition at line 479 of file svd.cc.

References F77_DBLE_CMPLX_ARG, GESDD_COMPLEX_STEP, m, max(), min(), and n.

◆ gesdd() [2/5]

OCTAVE_API void svd< Matrix >::gesdd ( char &  jobz,
F77_INT  m,
F77_INT  n,
double *  tmp_data,
F77_INT  m1,
double *  s_vec,
double *  u,
double *  vt,
F77_INT  nrow_vt1,
std::vector< double > &  work,
F77_INT lwork,
F77_INT iwork,
F77_INT info 
)
private

Definition at line 447 of file svd.cc.

References GESDD_REAL_STEP.

◆ gesdd() [3/5]

OCTAVE_API void svd< FloatMatrix >::gesdd ( char &  jobz,
F77_INT  m,
F77_INT  n,
float *  tmp_data,
F77_INT  m1,
float *  s_vec,
float *  u,
float *  vt,
F77_INT  nrow_vt1,
std::vector< float > &  work,
F77_INT lwork,
F77_INT iwork,
F77_INT info 
)
private

Definition at line 463 of file svd.cc.

References GESDD_REAL_STEP.

◆ gesdd() [4/5]

OCTAVE_API void svd< FloatComplexMatrix >::gesdd ( char &  jobz,
F77_INT  m,
F77_INT  n,
FloatComplex tmp_data,
F77_INT  m1,
float *  s_vec,
FloatComplex u,
FloatComplex vt,
F77_INT  nrow_vt1,
std::vector< FloatComplex > &  work,
F77_INT lwork,
F77_INT iwork,
F77_INT info 
)
private

Definition at line 508 of file svd.cc.

References F77_CMPLX_ARG, GESDD_COMPLEX_STEP, m, max(), min(), and n.

◆ gesdd() [5/5]

template<typename T >
void svd< T >::gesdd ( char &  jobz,
octave_f77_int_type  m,
octave_f77_int_type  n,
P tmp_data,
octave_f77_int_type  m1,
DM_P s_vec,
P u,
P vt,
octave_f77_int_type  nrow_vt1,
std::vector< P > &  work,
octave_f77_int_type &  lwork,
octave_f77_int_type *  iwork,
octave_f77_int_type &  info 
)
private

Referenced by svd< T >::svd().

◆ gesvd() [1/5]

OCTAVE_API void svd< ComplexMatrix >::gesvd ( char &  jobu,
char &  jobv,
F77_INT  m,
F77_INT  n,
Complex tmp_data,
F77_INT  m1,
double *  s_vec,
Complex u,
Complex vt,
F77_INT  nrow_vt1,
std::vector< Complex > &  work,
F77_INT lwork,
F77_INT info 
)
private

Definition at line 388 of file svd.cc.

References F77_DBLE_CMPLX_ARG, GESVD_COMPLEX_STEP, m, max(), and n.

◆ gesvd() [2/5]

OCTAVE_API void svd< Matrix >::gesvd ( char &  jobu,
char &  jobv,
F77_INT  m,
F77_INT  n,
double *  tmp_data,
F77_INT  m1,
double *  s_vec,
double *  u,
double *  vt,
F77_INT  nrow_vt1,
std::vector< double > &  work,
F77_INT lwork,
F77_INT info 
)
private

Definition at line 354 of file svd.cc.

References GESVD_REAL_STEP.

◆ gesvd() [3/5]

OCTAVE_API void svd< FloatMatrix >::gesvd ( char &  jobu,
char &  jobv,
F77_INT  m,
F77_INT  n,
float *  tmp_data,
F77_INT  m1,
float *  s_vec,
float *  u,
float *  vt,
F77_INT  nrow_vt1,
std::vector< float > &  work,
F77_INT lwork,
F77_INT info 
)
private

Definition at line 371 of file svd.cc.

References GESVD_REAL_STEP.

◆ gesvd() [4/5]

OCTAVE_API void svd< FloatComplexMatrix >::gesvd ( char &  jobu,
char &  jobv,
F77_INT  m,
F77_INT  n,
FloatComplex tmp_data,
F77_INT  m1,
float *  s_vec,
FloatComplex u,
FloatComplex vt,
F77_INT  nrow_vt1,
std::vector< FloatComplex > &  work,
F77_INT lwork,
F77_INT info 
)
private

Definition at line 407 of file svd.cc.

References F77_CMPLX_ARG, GESVD_COMPLEX_STEP, m, max(), and n.

◆ gesvd() [5/5]

template<typename T >
void svd< T >::gesvd ( char &  jobu,
char &  jobv,
octave_f77_int_type  m,
octave_f77_int_type  n,
P tmp_data,
octave_f77_int_type  m1,
DM_P s_vec,
P u,
P vt,
octave_f77_int_type  nrow_vt1,
std::vector< P > &  work,
octave_f77_int_type &  lwork,
octave_f77_int_type &  info 
)
private

Referenced by svd< T >::svd().

◆ left_singular_matrix()

template<typename T >
T svd< T >::left_singular_matrix ( void  ) const

Definition at line 310 of file svd.cc.

References svd< T >::sigma_only.

◆ operator=()

template<typename T >
svd& svd< T >::operator= ( const svd< T > &  a)
inline

◆ right_singular_matrix()

template<typename T >
T svd< T >::right_singular_matrix ( void  ) const

Definition at line 321 of file svd.cc.

References svd< T >::sigma_only.

◆ singular_values()

template<typename T >
DM_T svd< T >::singular_values ( void  ) const
inline

Definition at line 90 of file svd.h.

Member Data Documentation

◆ m_driver

template<typename T >
svd::Driver svd< T >::m_driver
private

Definition at line 100 of file svd.h.

Referenced by svd< T >::svd(), and svd< T >::operator=().

◆ m_left_sm

template<typename T >
T svd< T >::m_left_sm
private

Definition at line 102 of file svd.h.

Referenced by svd< T >::svd(), and svd< T >::operator=().

◆ m_right_sm

template<typename T >
T svd< T >::m_right_sm
private

Definition at line 104 of file svd.h.

Referenced by svd< T >::svd(), and svd< T >::operator=().

◆ m_sigma

template<typename T >
DM_T svd< T >::m_sigma
private

Definition at line 103 of file svd.h.

Referenced by svd< T >::svd(), and svd< T >::operator=().

◆ m_type

template<typename T >
svd::Type svd< T >::m_type
private

Definition at line 99 of file svd.h.

Referenced by svd< T >::svd(), and svd< T >::operator=().


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