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 *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> *TAU, std::complex<double> *WORK, int LWORK, int &INFO);
40
41 void getrf(int M, int N, double *A, int LDA, int *ipiv, int &info);
42 void getrf(int M, int N, std::complex<double> *A, int LDA, int *ipiv, int &info);
43
44 void getri(int N, double *A, int LDA, int const *ipiv, double *work, int lwork, int &info);
45 void getri(int N, std::complex<double> *A, int LDA, int const *ipiv, std::complex<double> *work, int lwork, int &info);
46
47 void gtsv(int N, int NRHS, double *DL, double *D, double *DU, double *B, int LDB, int &info);
48 void gtsv(int N, int NRHS, std::complex<double> *DL, std::complex<double> *D, std::complex<double> *DU, std::complex<double> *B, int LDB,
49 int &info);
50
51 void stev(char J, int N, double *D, double *E, double *Z, int ldz, double *work, int &info);
52
53 void syev(char JOBZ, char UPLO, int N, double *A, int LDA, double *W, double *work, int &lwork, int &info);
54
55 void heev(char JOBZ, char UPLO, int N, std::complex<double> *A, int LDA, double *W, std::complex<double> *work, int &lwork, double *work2,
56 int &info);
57
58 void getrs(char op, int N, int NRHS, double const *A, int LDA, int const *ipiv, double *B, int LDB, int &info);
59 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);
60
61} // namespace nda::lapack::f77
62
63// Useful routines from the BLAS interface
64namespace nda::lapack {
65
66 // See nda::blas::get_ld.
67 using blas::get_ld;
68
69 // See nda::blas::get_ncols.
70 using blas::get_ncols;
71
72 // See nda::blas::get_op.
73 using blas::get_op;
74
75 // See nda::blas::has_C_layout.
77
78 // See nda::blas::has_F_layout.
80
81 // See nda::blas::is_conj_array_expr.
83
84} // namespace nda::lapack
Provides a C++ interface for the GPU versions of various LAPACK routines.
int get_ld(A const &a)
Get the leading dimension in LAPACK jargon of an nda::MemoryMatrix.
Definition tools.hpp:98
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has a C memory layout.
Definition tools.hpp:65
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
int get_ncols(A const &a)
Get the number of columns in LAPACK jargon of an nda::MemoryMatrix.
Definition tools.hpp:110
static constexpr bool has_F_layout
Constexpr variable that is true if the given nda::Array type has a Fortran memory layout.
Definition tools.hpp:55
const char get_op
Variable template that determines the BLAS matrix operation tag ('N','T','C') based on the given bool...
Definition tools.hpp:80
Provides various traits and utilities for the BLAS interface.