QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
quda::linalg::Cholesky< Mat, T, N, fast > Class Template Reference

Compute Cholesky decomposition of A. By default, we use a modified Cholesky which avoids the division and sqrt, and instead only needs rsqrt. In which case we must use a modified forward and backward difference substitution. More...

Public Member Functions

__device__ __host__ Cholesky (const Mat< T, N > &A)
 Constructor that computes the Cholesky decomposition. More...
 
__device__ __host__ const T D (int i) const
 Return the diagonal element of the Cholesky decomposition L(i,i) More...
 
template<class Vector >
__device__ __host__ Vector forward (const Vector &b)
 Forward substition to solve Lx = b. More...
 
template<class Vector >
__device__ __host__ Vector backward (const Vector &b)
 Backward substition to solve L^dagger x = b. More...
 
__device__ __host__ Mat< T, N > invert ()
 Compute the inverse of A (the matrix used to construct the Cholesky decomposition). More...
 

Private Attributes

Mat< T, N > L_
 The Cholesky factorization. More...
 

Detailed Description

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
class quda::linalg::Cholesky< Mat, T, N, fast >

Compute Cholesky decomposition of A. By default, we use a modified Cholesky which avoids the division and sqrt, and instead only needs rsqrt. In which case we must use a modified forward and backward difference substitution.

Template Parameters
MatThe Matrix container class type. This can either be a general Matrix (quda::Matrix) or a Hermitian matrix (quda::HMatrix).
TThe underlying type. For Hermitian matrices this should be real type and for general matrices this should be the complex type.
NThe size of the linear system we are solving
fastWhether to use the optimized Cholesky algorithm that stores the reciprocal sqrt on the diagonal of L, instead of the sqrt. This flag must be consistent with the equivalent flag used with the forward and backward substitutions.

Definition at line 38 of file linalg.cuh.

Constructor & Destructor Documentation

◆ Cholesky()

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
__device__ __host__ quda::linalg::Cholesky< Mat, T, N, fast >::Cholesky ( const Mat< T, N > &  A)
inline

Constructor that computes the Cholesky decomposition.

Parameters
[in]AInput matrix we are decomposing

Definition at line 48 of file linalg.cuh.

References quda::linalg::Cholesky< Mat, T, N, fast >::L_, quda::s, and quda::sqrt().

Here is the call graph for this function:

Member Function Documentation

◆ backward()

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
template<class Vector >
__device__ __host__ Vector quda::linalg::Cholesky< Mat, T, N, fast >::backward ( const Vector b)
inline

Backward substition to solve L^dagger x = b.

Template Parameters
VectorThe Vector container class, e.g., quda::colorspinor
Parameters
[in]bSource vector
Returns
solution vector

Definition at line 123 of file linalg.cuh.

References quda::linalg::Cholesky< Mat, T, N, fast >::L_.

Referenced by quda::computeAV(), and quda::computeTMCAV().

Here is the caller graph for this function:

◆ D()

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
__device__ __host__ const T quda::linalg::Cholesky< Mat, T, N, fast >::D ( int  i) const
inline

Return the diagonal element of the Cholesky decomposition L(i,i)

Parameters
[in]iIndex
Returns
Element at L(i,i)

Definition at line 84 of file linalg.cuh.

References quda::linalg::Cholesky< Mat, T, N, fast >::L_.

Referenced by quda::cloverInvertCompute().

Here is the caller graph for this function:

◆ forward()

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
template<class Vector >
__device__ __host__ Vector quda::linalg::Cholesky< Mat, T, N, fast >::forward ( const Vector b)
inline

Forward substition to solve Lx = b.

Template Parameters
VectorThe Vector container class, e.g., quda::colorspinor
Parameters
[in]bSource vector
Returns
solution vector

Definition at line 97 of file linalg.cuh.

References quda::linalg::Cholesky< Mat, T, N, fast >::L_.

Referenced by quda::computeAV(), and quda::computeTMCAV().

Here is the caller graph for this function:

◆ invert()

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
__device__ __host__ Mat<T,N> quda::linalg::Cholesky< Mat, T, N, fast >::invert ( )
inline

Compute the inverse of A (the matrix used to construct the Cholesky decomposition).

Returns
Matrix inverse

Definition at line 146 of file linalg.cuh.

References quda::linalg::Cholesky< Mat, T, N, fast >::L_.

Referenced by quda::cloverInvertCompute(), and quda::ComputeTMAVGPU().

Here is the caller graph for this function:

Member Data Documentation

◆ L_

template<template< typename, int > class Mat, typename T, int N, bool fast = true>
Mat<T,N> quda::linalg::Cholesky< Mat, T, N, fast >::L_
private

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