QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Functions
svd_quda.h File Reference
#include <float.h>
Include dependency graph for svd_quda.h:

Go to the source code of this file.

Macros

#define DEVICEHOST   __device__ __host__
 
#define SVDPREC   1e-11
 
#define LOG2   0.69314718055994530942
 
#define INVALID_DOUBLE   (-DBL_MAX)
 

Functions

template<class Cmplx >
DEVICEHOST std::remove_reference< decltype(Cmplx::x)>::type cabs (const Cmplx &z)
 
template<class T , class U >
DEVICEHOST PromoteTypeId< T, U >::Type quadSum (const T &a, const U &b)
 
DEVICEHOST float getNorm (const Array< complex< float >, 3 > &a)
 
DEVICEHOST double getNorm (const Array< complex< double >, 3 > &a)
 
template<class T >
DEVICEHOST void constructHHMat (const T &tau, const Array< T, 3 > &v, Matrix< T, 3 > &hh)
 
template<class Real >
DEVICEHOST void getLambdaMax (const Matrix< Real, 3 > &b, Real &lambda_max)
 
template<class Real >
DEVICEHOST void getGivensRotation (const Real &alpha, const Real &beta, Real &c, Real &s)
 
template<class Real >
DEVICEHOST void accumGivensRotation (int index, const Real &c, const Real &s, Matrix< Real, 3 > &m)
 
template<class Real >
DEVICEHOST void assignGivensRotation (const Real &c, const Real &s, Matrix< Real, 2 > &m)
 
template<class Real >
DEVICEHOST void swap (Real &a, Real &b)
 
template<class Real >
DEVICEHOST void smallSVD (Matrix< Real, 2 > &u, Matrix< Real, 2 > &v, Matrix< Real, 2 > &m)
 
template<class Float >
DEVICEHOST void getRealBidiagMatrix (const Matrix< complex< Float >, 3 > &mat, Matrix< complex< Float >, 3 > &u, Matrix< complex< Float >, 3 > &v)
 
template<class Real >
DEVICEHOST void bdSVD (Matrix< Real, 3 > &u, Matrix< Real, 3 > &v, Matrix< Real, 3 > &b, int max_it)
 
template<class Float >
DEVICEHOST void computeSVD (const Matrix< complex< Float >, 3 > &m, Matrix< complex< Float >, 3 > &u, Matrix< complex< Float >, 3 > &v, Float singular_values[3])
 

Macro Definition Documentation

◆ DEVICEHOST

#define DEVICEHOST   __device__ __host__

◆ INVALID_DOUBLE

#define INVALID_DOUBLE   (-DBL_MAX)

Definition at line 9 of file svd_quda.h.

Referenced by getRealBidiagMatrix().

◆ LOG2

#define LOG2   0.69314718055994530942

Definition at line 8 of file svd_quda.h.

Referenced by smallSVD().

◆ SVDPREC

#define SVDPREC   1e-11

Definition at line 7 of file svd_quda.h.

Referenced by bdSVD().

Function Documentation

◆ accumGivensRotation()

template<class Real >
DEVICEHOST void accumGivensRotation ( int  index,
const Real &  c,
const Real &  s,
Matrix< Real, 3 > &  m 
)
inline

Definition at line 115 of file svd_quda.h.

References DEVICEHOST, and quda::s.

Referenced by bdSVD().

Here is the caller graph for this function:

◆ assignGivensRotation()

template<class Real >
DEVICEHOST void assignGivensRotation ( const Real &  c,
const Real &  s,
Matrix< Real, 2 > &  m 
)
inline

Definition at line 129 of file svd_quda.h.

References DEVICEHOST, and quda::s.

Referenced by smallSVD().

Here is the caller graph for this function:

◆ bdSVD()

template<class Real >
DEVICEHOST void bdSVD ( Matrix< Real, 3 > &  u,
Matrix< Real, 3 > &  v,
Matrix< Real, 3 > &  b,
int  max_it 
)

Definition at line 392 of file svd_quda.h.

References accumGivensRotation(), DEVICEHOST, getGivensRotation(), getLambdaMax(), quda::dslash::it, quda::s, quda::setIdentity(), smallSVD(), and SVDPREC.

Referenced by computeSVD().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cabs()

template<class Cmplx >
DEVICEHOST std::remove_reference<decltype(Cmplx::x)>::type cabs ( const Cmplx &  z)
inline

Definition at line 17 of file svd_quda.h.

References quda::sqrt().

Referenced by getNorm(), and getRealBidiagMatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeSVD()

template<class Float >
DEVICEHOST void computeSVD ( const Matrix< complex< Float >, 3 > &  m,
Matrix< complex< Float >, 3 > &  u,
Matrix< complex< Float >, 3 > &  v,
Float  singular_values[3] 
)

Definition at line 620 of file svd_quda.h.

References bdSVD(), and conj().

Here is the call graph for this function:

◆ constructHHMat()

template<class T >
DEVICEHOST void constructHHMat ( const T &  tau,
const Array< T, 3 > &  v,
Matrix< T, 3 > &  hh 
)
inline

Definition at line 61 of file svd_quda.h.

References conj(), DEVICEHOST, quda::outerProd(), and quda::setIdentity().

Referenced by getRealBidiagMatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGivensRotation()

template<class Real >
DEVICEHOST void getGivensRotation ( const Real &  alpha,
const Real &  beta,
Real &  c,
Real &  s 
)
inline

Definition at line 96 of file svd_quda.h.

References DEVICEHOST, and quda::s.

Referenced by bdSVD(), and smallSVD().

Here is the caller graph for this function:

◆ getLambdaMax()

template<class Real >
DEVICEHOST void getLambdaMax ( const Matrix< Real, 3 > &  b,
Real &  lambda_max 
)
inline

Definition at line 77 of file svd_quda.h.

References DEVICEHOST, quda::blas::norm1(), and quadSum().

Referenced by bdSVD().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNorm() [1/2]

DEVICEHOST float getNorm ( const Array< complex< float >, 3 > &  a)
inline

Definition at line 38 of file svd_quda.h.

References cabs(), DEVICEHOST, and quadSum().

Referenced by getRealBidiagMatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNorm() [2/2]

DEVICEHOST double getNorm ( const Array< complex< double >, 3 > &  a)
inline

Definition at line 49 of file svd_quda.h.

References cabs(), DEVICEHOST, and quadSum().

Here is the call graph for this function:

◆ getRealBidiagMatrix()

template<class Float >
DEVICEHOST void getRealBidiagMatrix ( const Matrix< complex< Float >, 3 > &  mat,
Matrix< complex< Float >, 3 > &  u,
Matrix< complex< Float >, 3 > &  v 
)

Definition at line 260 of file svd_quda.h.

References cabs(), conj(), constructHHMat(), quda::copyColumn(), DEVICEHOST, getNorm(), INVALID_DOUBLE, mat(), quda::blas::norm1(), norm2(), quadSum(), and quda::setIdentity().

Here is the call graph for this function:

◆ quadSum()

template<class T , class U >
DEVICEHOST PromoteTypeId<T,U>::Type quadSum ( const T &  a,
const U &  b 
)
inline

Definition at line 28 of file svd_quda.h.

References DEVICEHOST, and quda::sqrt().

Referenced by getLambdaMax(), getNorm(), getRealBidiagMatrix(), and smallSVD().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ smallSVD()

template<class Real >
DEVICEHOST void smallSVD ( Matrix< Real, 2 > &  u,
Matrix< Real, 2 > &  v,
Matrix< Real, 2 > &  m 
)
inline

Definition at line 148 of file svd_quda.h.

References assignGivensRotation(), DEVICEHOST, quda::exp(), getGivensRotation(), quda::log(), LOG2, quadSum(), quda::s, quda::setIdentity(), and swap().

Referenced by bdSVD().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap()

template<class Real >
DEVICEHOST void swap ( Real &  a,
Real &  b 
)
inline