rank-local.cpp File Reference
Include dependency graph for rank-local.cpp:

Namespaces

 TiledArray
 
 TiledArray::math
 
 TiledArray::math::linalg
 
 TiledArray::math::linalg::rank_local
 

Macros

#define TA_LAPACK_ERROR(F)   throw std::runtime_error("lapack::" #F " failed")
 
#define TA_LAPACK_FORTRAN_CALL(F, ARGS...)    ((ta_lapack_fortran_call(F, ARGS) == 0) || (TA_LAPACK_ERROR(F), 0))
 
#define TA_LAPACK_FORTRAN(name, args...)
 Invokes the Fortran LAPACK API. More...
 
#define TA_LAPACK(name, args...)    ((::lapack::name(args) == 0) || (TA_LAPACK_ERROR(name), 0))
 TA_LAPACK(fn,args) invoked lapack::fn directly and checks the return value. More...
 
#define TA_LAPACK_EXPLICIT(MATRIX, VECTOR)
 

Typedefs

using TiledArray::math::linalg::rank_local::integer = math::blas::integer
 

Functions

template<class F , typename... Args>
int ta_lapack_fortran_call (F f, Args... args)
 
template<typename T >
void TiledArray::math::linalg::rank_local::cholesky (Matrix< T > &A)
 
template<typename T >
void TiledArray::math::linalg::rank_local::cholesky_linv (Matrix< T > &A)
 
template<typename T >
void TiledArray::math::linalg::rank_local::cholesky_solve (Matrix< T > &A, Matrix< T > &X)
 
template<typename T >
void TiledArray::math::linalg::rank_local::cholesky_lsolve (Op transpose, Matrix< T > &A, Matrix< T > &X)
 
template<typename T >
void TiledArray::math::linalg::rank_local::heig (Matrix< T > &A, std::vector< T > &W)
 
template<typename T >
void TiledArray::math::linalg::rank_local::heig (Matrix< T > &A, Matrix< T > &B, std::vector< T > &W)
 
template<typename T >
void TiledArray::math::linalg::rank_local::svd (Job jobu, Job jobvt, Matrix< T > &A, std::vector< T > &S, Matrix< T > *U, Matrix< T > *VT)
 
template<typename T >
void TiledArray::math::linalg::rank_local::lu_solve (Matrix< T > &A, Matrix< T > &B)
 
template<typename T >
void TiledArray::math::linalg::rank_local::lu_inv (Matrix< T > &A)
 
 TiledArray::math::linalg::rank_local::TA_LAPACK_EXPLICIT (Matrix< double >, std::vector< double >)
 
 TiledArray::math::linalg::rank_local::TA_LAPACK_EXPLICIT (Matrix< float >, std::vector< float >)
 

Macro Definition Documentation

◆ TA_LAPACK

#define TA_LAPACK (   name,
  args... 
)     ((::lapack::name(args) == 0) || (TA_LAPACK_ERROR(name), 0))

TA_LAPACK(fn,args) invoked lapack::fn directly and checks the return value.

Definition at line 64 of file rank-local.cpp.

◆ TA_LAPACK_ERROR

#define TA_LAPACK_ERROR (   F)    throw std::runtime_error("lapack::" #F " failed")

Definition at line 43 of file rank-local.cpp.

◆ TA_LAPACK_EXPLICIT

#define TA_LAPACK_EXPLICIT (   MATRIX,
  VECTOR 
)
Value:
template void cholesky(MATRIX&); \
template void cholesky_linv(MATRIX&); \
template void cholesky_solve(MATRIX&, MATRIX&); \
template void cholesky_lsolve(Op, MATRIX&, MATRIX&); \
template void heig(MATRIX&, VECTOR&); \
template void heig(MATRIX&, MATRIX&, VECTOR&); \
template void svd(Job,Job,MATRIX&, VECTOR&, MATRIX*, MATRIX*); \
template void lu_solve(MATRIX&, MATRIX&); \
template void lu_inv(MATRIX&);

Definition at line 210 of file rank-local.cpp.

◆ TA_LAPACK_FORTRAN

#define TA_LAPACK_FORTRAN (   name,
  args... 
)
Value:
{ \
using numeric_type = T; \
if constexpr (std::is_same_v<numeric_type, double>) \
TA_LAPACK_FORTRAN_CALL(d##name, args); \
else if constexpr (std::is_same_v<numeric_type, float>) \
TA_LAPACK_FORTRAN_CALL(s##name, args); \
else \
std::abort(); \
}

Invokes the Fortran LAPACK API.

Warning
TA_LAPACK_FORTRAN(fn,args) can be called only from template context, with T defining the element type

Definition at line 52 of file rank-local.cpp.

◆ TA_LAPACK_FORTRAN_CALL

#define TA_LAPACK_FORTRAN_CALL (   F,
  ARGS... 
)     ((ta_lapack_fortran_call(F, ARGS) == 0) || (TA_LAPACK_ERROR(F), 0))

Definition at line 45 of file rank-local.cpp.

Function Documentation

◆ ta_lapack_fortran_call()

template<class F , typename... Args>
int ta_lapack_fortran_call ( f,
Args...  args 
)
inline

Definition at line 30 of file rank-local.cpp.

::blas::Op Op
Definition: blas.h:46
void cholesky_solve(Matrix< T > &A, Matrix< T > &X)
Definition: rank-local.cpp:91
void cholesky_linv(Matrix< T > &A)
Definition: rank-local.cpp:81
void heig(Matrix< T > &A, Matrix< T > &B, std::vector< T > &W)
Definition: rank-local.cpp:128
void lu_solve(Matrix< T > &A, Matrix< T > &B)
Definition: rank-local.cpp:189
void svd(Job jobu, Job jobvt, Matrix< T > &A, std::vector< T > &S, Matrix< T > *U, Matrix< T > *VT)
Definition: rank-local.cpp:143
void cholesky_lsolve(Op transpose, Matrix< T > &A, Matrix< T > &X)
Definition: rank-local.cpp:103