TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
cxx_interface.hpp
Go to the documentation of this file.
1// Copyright (c) 2019--present, The Simons Foundation
2// This file is part of TRIQS/nda and is licensed under the Apache License, Version 2.0.
3// SPDX-License-Identifier: Apache-2.0
4// See LICENSE in the root of this distribution for details.
5
10
11#pragma once
12
13#include "../../blas/tools.hpp"
14
15#include <complex>
16
17#if defined(NDA_HAVE_CUDA)
19#endif
20
21namespace nda::lapack::f77 {
22
23 void gelss(int M, int N, int NRHS, double *A, int LDA, double *B, int LDB, double *S, double RCOND, int &RANK, double *WORK, int LWORK,
24 double *RWORK, int &INFO);
25 void gelss(int M, int N, int NRHS, std::complex<double> *A, int LDA, std::complex<double> *B, int LDB, double *S, double RCOND, int &RANK,
26 std::complex<double> *WORK, int LWORK, double *RWORK, int &INFO);
27
28 void gesvd(char JOBU, char JOBVT, int M, int N, double *A, int LDA, double *S, double *U, int LDU, double *VT, int LDVT, double *WORK, int LWORK,
29 double *RWORK, int &INFO);
30 void gesvd(char JOBU, char JOBVT, int M, int N, std::complex<double> *A, int LDA, double *S, std::complex<double> *U, int LDU,
31 std::complex<double> *VT, int LDVT, std::complex<double> *WORK, int LWORK, double *RWORK, int &INFO);
32
33 void geqp3(int M, int N, double *A, int LDA, int *JPVT, double *TAU, double *WORK, int LWORK, double *RWORK, int &INFO);
34 void geqp3(int M, int N, std::complex<double> *A, int LDA, int *JPVT, std::complex<double> *TAU, std::complex<double> *WORK, int LWORK,
35 double *RWORK, int &INFO);
36
37 void orgqr(int M, int N, int K, double *A, int LDA, double const *TAU, double *WORK, int LWORK, int &INFO);
38
39 void ungqr(int M, int N, int K, std::complex<double> *A, int LDA, std::complex<double> const *TAU, std::complex<double> *WORK, int LWORK,
40 int &INFO);
41
42 void getrf(int M, int N, double *A, int LDA, int *ipiv, int &info);
43 void getrf(int M, int N, std::complex<double> *A, int LDA, int *ipiv, int &info);
44
45 void getri(int N, double *A, int LDA, int const *ipiv, double *work, int lwork, int &info);
46 void getri(int N, std::complex<double> *A, int LDA, int const *ipiv, std::complex<double> *work, int lwork, int &info);
47
48 void gtsv(int N, int NRHS, double *DL, double *D, double *DU, double *B, int LDB, int &info);
49 void gtsv(int N, int NRHS, std::complex<double> *DL, std::complex<double> *D, std::complex<double> *DU, std::complex<double> *B, int LDB,
50 int &info);
51
52 void stev(char J, int N, double *D, double *E, double *Z, int ldz, double *work, int &info);
53
54 void syev(char JOBZ, char UPLO, int N, double *A, int LDA, double *W, double *work, int lwork, int &info);
55
56 void heev(char JOBZ, char UPLO, int N, std::complex<double> *A, int LDA, double *W, std::complex<double> *work, int lwork, double *rwork,
57 int &info);
58
59 void sygv(int ITYPE, char JOBZ, char UPLO, int N, double *A, int LDA, double *B, int LDB, double *W, double *work, int lwork, int &info);
60
61 void hegv(int ITYPE, char JOBZ, char UPLO, int N, std::complex<double> *A, int LDA, std::complex<double> *B, int LDB, double *W,
62 std::complex<double> *work, int lwork, double *rwork, int &info);
63
64 void getrs(char op, int N, int NRHS, double const *A, int LDA, int const *ipiv, double *B, int LDB, int &info);
65 void getrs(char op, int N, int NRHS, std::complex<double> const *A, int LDA, int const *ipiv, std::complex<double> *B, int LDB, int &info);
66
67} // namespace nda::lapack::f77
68
69// Useful routines from the BLAS interface
70namespace nda::lapack {
71
72 // See nda::blas::get_ld.
73 using blas::get_ld;
74
75 // See nda::blas::get_ncols.
76 using blas::get_ncols;
77
78 // See nda::blas::get_op.
79 using blas::get_op;
80
81 // See nda::blas::has_C_layout.
83
84 // See nda::blas::has_F_layout.
86
87 // See nda::blas::is_conj_array_expr.
89
90 // See nda::blas::get_array.
91 using blas::get_array;
92
93} // namespace nda::lapack
Provides a C++ interface for the GPU versions of various LAPACK routines.
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has nda::C_layout.
Definition tools.hpp:83
int get_ncols(A const &a)
Get the number of columns of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
Definition tools.hpp:142
int get_ld(A const &a)
Get the leading dimension of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
Definition tools.hpp:122
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
Definition tools.hpp:41
static constexpr char get_op
Variable template that determines the BLAS matrix operation tag ('N','T','C') based on the given bool...
Definition tools.hpp:98
static constexpr bool has_F_layout
Constexpr variable that is true if the given nda::Array type has nda::F_layout.
Definition tools.hpp:73
MemoryArray decltype(auto) get_array(A &&a)
Get the underlying array of a conjugate lazy expression or return the array itself in case it is an n...
Definition tools.hpp:62
Provides various traits and utilities for the BLAS interface.