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 void geev(char jobvl, char jobvr, int n, double *a, int lda, double *wr, double *wi, double *vl, int ldvl, double *vr, int ldvr, double *work,
68 int lwork, int &info);
69 void geev(char jobvl, char jobvr, int n, std::complex<double> *a, int lda, std::complex<double> *w, std::complex<double> *vl, int ldvl,
70 std::complex<double> *vr, int ldvr, std::complex<double> *work, int lwork, double *rwork, int &info);
71
72} // namespace nda::lapack::f77
73
74// Useful routines from the BLAS interface
75namespace nda::lapack {
76
77 // See nda::blas::get_ld.
78 using blas::get_ld;
79
80 // See nda::blas::get_ncols.
81 using blas::get_ncols;
82
83 // See nda::blas::get_op.
84 using blas::get_op;
85
86 // See nda::blas::has_C_layout.
88
89 // See nda::blas::has_F_layout.
91
92 // See nda::blas::is_conj_array_expr.
94
95 // See nda::blas::get_array.
96 using blas::get_array;
97
98} // 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.