TRIQS/nda 2.0.0
Multi-dimensional array library for C++
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
14#include "../blas/tools.hpp"
15#include "../concepts.hpp"
16#include "../declarations.hpp"
17#include "../macros.hpp"
19#include "../traits.hpp"
20
21namespace nda::lapack {
22
55 template <BlasArray<1> DL, BlasArrayFor<DL, 1> D, BlasArrayFor<DL, 1> DU, BlasArrayFor<DL> 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
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides various traits and utilities for the BLAS interface.
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
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
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
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
int gtsv(DL &&dl, D &&d, DU &&du, B &&b)
Interface to the LAPACK gtsv routine.
Definition gtsv.hpp:57
static constexpr bool have_host_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Host.
Provides a C++ interface for various LAPACK routines.
Macros used in the nda library.
Provides type traits for the nda library.