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 "
../concepts.hpp
"
15
#include "
../declarations.hpp
"
16
#include "
../macros.hpp
"
17
#include "
../mem/address_space.hpp
"
18
#include "
../traits.hpp
"
19
20
namespace
nda::lapack {
21
51
template
<MemoryVector DL, MemoryVector D, MemoryVector DU, MemoryArray B>
52
requires
(
have_same_value_type_v<DL, D, DU, B>
and
mem::have_host_compatible_addr_space<DL, D, DU, B>
and
is_blas_lapack_v<get_value_t<DL>
>)
53
int
gtsv
(DL &&dl, D &&d, DU &&du, B &&b) {
// NOLINT (temporary views are allowed here)
54
static_assert
((
get_rank<B>
== 1 or
get_rank<B>
== 2),
"Error in nda::lapack::gtsv: B must be a matrix/array/view of rank 1 or 2"
);
55
static_assert
(
has_F_layout<B>
,
"Error in nda::lapack::gtsv: B must have Fortran layout"
);
56
57
// check the dimensions of the input/output arrays/views
58
auto
const
n = d.size();
59
EXPECTS(dl.size() == n - 1);
60
EXPECTS(du.size() == n - 1);
61
EXPECTS(b.extent(0) == n);
62
63
// perform actual library call
64
int
info = 0;
65
f77::gtsv(n, (
get_rank<B>
== 2 ? b.extent(1) : 1), dl.data(), d.data(), du.data(), b.data(),
get_ld
(b), info);
66
67
return
info;
68
}
69
70
}
// namespace nda::lapack
address_space.hpp
Provides definitions and type traits involving the different memory address spaces supported by nda.
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::have_same_value_type_v
constexpr bool have_same_value_type_v
Constexpr variable that is true if all types in As have the same value type as A0.
Definition
traits.hpp:195
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:126
nda::lapack::gtsv
int gtsv(DL &&dl, D &&d, DU &&du, B &&b)
Interface to the LAPACK gtsv routine.
Definition
gtsv.hpp:53
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
nda::is_blas_lapack_v
constexpr bool is_blas_lapack_v
Alias for nda::is_double_or_complex_v.
Definition
traits.hpp:92
cxx_interface.hpp
Provides a C++ interface for various LAPACK routines.
nda::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:122
nda::lapack::has_F_layout
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
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