TRIQS/nda
2.0.0
Multi-dimensional array library for C++
Toggle main menu visibility
Loading...
Searching...
No Matches
gtsv.hpp
Go to the documentation of this file.
1
// Copyright (c) 2021--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 "
./interface/cxx_interface.hpp
"
14
#include "
../blas/tools.hpp
"
15
#include "
../concepts.hpp
"
16
#include "
../declarations.hpp
"
17
#include "
../macros.hpp
"
18
#include "
../mem/address_space.hpp
"
19
#include "
../traits.hpp
"
20
21
namespace
nda::lapack {
22
55
template
<BlasArray<1> DL, BlasArrayFor<DL, 1> D, BlasArrayFor<DL, 1> DU, BlasArrayFor<DL> B>
56
requires
(
mem::have_host_compatible_addr_space<DL>
and (
get_rank<B>
== 1 or
get_rank<B>
== 2) and
has_F_layout
<B>)
57
int
gtsv
(DL &&dl, D &&d, DU &&du, B &&b) {
// NOLINT (temporary views are allowed here)
58
// check the dimensions of the input/output arrays/views
59
auto
const
n = d.size();
60
EXPECTS(dl.size() == n - 1);
61
EXPECTS(du.size() == n - 1);
62
EXPECTS(b.extent(0) == n);
63
64
// perform actual library call
65
int
info = 0;
66
f77::gtsv(n, (
get_rank<B>
== 2 ? b.extent(1) : 1), dl.data(), d.data(), du.data(), b.data(),
get_ld
(b), info);
67
68
return
info;
69
}
70
71
}
// namespace nda::lapack
address_space.hpp
Provides definitions and type traits involving the different memory address spaces supported by nda.
tools.hpp
Provides various traits and utilities for the BLAS interface.
concepts.hpp
Provides concepts for the nda library.
declarations.hpp
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
nda::get_rank
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
Definition
traits.hpp:147
nda::blas_lapack::get_ld
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:128
nda::blas_lapack::has_F_layout
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
Definition
tools.hpp:79
nda::lapack::gtsv
int gtsv(DL &&dl, D &&d, DU &&du, B &&b)
Interface to the LAPACK gtsv routine.
Definition
gtsv.hpp:57
nda::mem::have_host_compatible_addr_space
static constexpr bool have_host_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Host.
Definition
address_space.hpp:173
cxx_interface.hpp
Provides a C++ interface for various LAPACK routines.
macros.hpp
Macros used in the nda library.
traits.hpp
Provides type traits for the nda library.
nda
lapack
gtsv.hpp
Generated by
1.17.0