11#ifndef TLAPACK_TYPES_HH
12#define TLAPACK_TYPES_HH
33inline std::ostream& operator<<(std::ostream& out,
const Layout v)
35 if (v == Layout::Unspecified)
return out <<
"Unspecified";
36 if (v == Layout::ColMajor)
return out <<
"ColMajor";
37 if (v == Layout::RowMajor)
return out <<
"RowMajor";
38 if (v == Layout::Strided)
return out <<
"Strided";
39 return out <<
"<Invalid>";
54inline std::ostream& operator<<(std::ostream& out,
const Uplo v)
56 if (v == Uplo::Upper)
return out <<
"Upper";
57 if (v == Uplo::Lower)
return out <<
"Lower";
58 if (v == Uplo::General)
return out <<
"General";
59 if (v == Uplo::UpperHessenberg)
return out <<
"UpperHessenberg";
60 if (v == Uplo::LowerHessenberg)
return out <<
"LowerHessenberg";
61 if (v == Uplo::StrictUpper)
return out <<
"StrictUpper";
62 if (v == Uplo::StrictLower)
return out <<
"StrictLower";
63 return out <<
"<Invalid>";
78 constexpr operator Uplo()
const noexcept {
return Uplo::General; }
92 constexpr operator Uplo()
const noexcept {
return Uplo::Upper; }
106 constexpr operator Uplo()
const noexcept {
return Uplo::Lower; }
120 constexpr operator Uplo()
const noexcept
122 return Uplo::UpperHessenberg;
137 constexpr operator Uplo()
const noexcept
139 return Uplo::LowerHessenberg;
154 constexpr operator Uplo()
const noexcept {
return Uplo::StrictUpper; }
168 constexpr operator Uplo()
const noexcept {
return Uplo::StrictLower; }
196inline std::ostream& operator<<(std::ostream& out,
const Diag v)
198 if (v == Diag::NonUnit)
return out <<
"NonUnit";
199 if (v == Diag::Unit)
return out <<
"Unit";
200 return out <<
"<Invalid>";
205 constexpr operator Diag()
const noexcept {
return Diag::NonUnit; }
208 constexpr operator Diag()
const noexcept {
return Diag::Unit; }
222enum class Op :
char {
228inline std::ostream& operator<<(std::ostream& out,
const Op v)
230 if (v == Op::NoTrans)
return out <<
"NoTrans";
231 if (v == Op::Trans)
return out <<
"Trans";
232 if (v == Op::ConjTrans)
return out <<
"ConjTrans";
233 if (v == Op::Conj)
return out <<
"Conj";
234 return out <<
"<Invalid>";
239 constexpr operator Op()
const noexcept {
return Op::NoTrans; }
242 constexpr operator Op()
const noexcept {
return Op::Trans; }
245 constexpr operator Op()
const noexcept {
return Op::ConjTrans; }
248 constexpr operator Op()
const noexcept {
return Op::Conj; }
270inline std::ostream& operator<<(std::ostream& out,
const Side v)
272 if (v == Side::Left)
return out <<
"Left";
273 if (v == Side::Right)
return out <<
"Right";
274 return out <<
"<Invalid>";
279 constexpr operator Side()
const noexcept {
return Side::Left; }
282 constexpr operator Side()
const noexcept {
return Side::Right; }
303inline std::ostream& operator<<(std::ostream& out,
const Norm v)
305 if (v == Norm::One)
return out <<
"One";
306 if (v == Norm::Two)
return out <<
"Two";
307 if (v == Norm::Inf)
return out <<
"Inf";
308 if (v == Norm::Fro)
return out <<
"Fro";
309 if (v == Norm::Max)
return out <<
"Max";
310 return out <<
"<Invalid>";
315 constexpr operator Norm()
const noexcept {
return Norm::Max; }
318 constexpr operator Norm()
const noexcept {
return Norm::One; }
321 constexpr operator Norm()
const noexcept {
return Norm::Two; }
324 constexpr operator Norm()
const noexcept {
return Norm::Inf; }
327 constexpr operator Norm()
const noexcept {
return Norm::Fro; }
351inline std::ostream& operator<<(std::ostream& out,
const Direction v)
353 if (v == Direction::Forward)
return out <<
"Forward";
354 if (v == Direction::Backward)
return out <<
"Backward";
355 return out <<
"<Invalid>";
360 constexpr operator Direction()
const noexcept
362 return Direction::Forward;
366 constexpr operator Direction()
const noexcept
368 return Direction::Backward;
387inline std::ostream& operator<<(std::ostream& out,
const StoreV v)
389 if (v == StoreV::Columnwise)
return out <<
"Columnwise";
390 if (v == StoreV::Rowwise)
return out <<
"Rowwise";
391 return out <<
"<Invalid>";
396 constexpr operator StoreV()
const noexcept
398 return StoreV::Columnwise;
402 constexpr operator StoreV()
const noexcept {
return StoreV::Rowwise; }
442 template <
class T,
class idx_t>
457 template <
class T,
class idx_t>
constexpr internal::MaxNorm MAX_NORM
max norm
Definition types.hpp:334
constexpr internal::UpperHessenberg UPPER_HESSENBERG
Upper Hessenberg access.
Definition types.hpp:177
constexpr internal::FrobNorm FROB_NORM
Frobenius norm of matrices.
Definition types.hpp:342
constexpr internal::LowerTriangle LOWER_TRIANGLE
Lower Triangle access.
Definition types.hpp:183
constexpr internal::UpperTriangle UPPER_TRIANGLE
Upper Triangle access.
Definition types.hpp:181
Diag
Definition types.hpp:192
@ Unit
The main diagonal is assumed to consist of 1's.
@ NonUnit
The main diagonal is not assumed to consist of 1's.
constexpr internal::OneNorm ONE_NORM
one norm
Definition types.hpp:336
Side
Definition types.hpp:266
constexpr internal::Backward BACKWARD
Backward direction.
Definition types.hpp:378
constexpr internal::RightSide RIGHT_SIDE
right side
Definition types.hpp:291
constexpr internal::TwoNorm TWO_NORM
two norm
Definition types.hpp:338
constexpr internal::RowwiseStorage ROWWISE_STORAGE
Rowwise storage.
Definition types.hpp:411
constexpr internal::StrictUpper STRICT_UPPER
Strict Upper Triangle access.
Definition types.hpp:185
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:376
constexpr internal::Transpose TRANSPOSE
transpose
Definition types.hpp:257
constexpr internal::UnitDiagonal UNIT_DIAG
The main diagonal is assumed to consist of 1's.
Definition types.hpp:217
constexpr internal::StrictLower STRICT_LOWER
Strict Lower Triangle access.
Definition types.hpp:187
constexpr internal::GeneralAccess GENERAL
General access.
Definition types.hpp:175
constexpr internal::NonUnitDiagonal NON_UNIT_DIAG
The main diagonal is not assumed to consist of 1's.
Definition types.hpp:215
constexpr internal::Conjugate CONJUGATE
non-transpose conjugate
Definition types.hpp:261
Direction
Definition types.hpp:347
@ Forward
Forward direction.
@ Backward
Backward direction.
Op
Definition types.hpp:222
@ Conj
non-transpose conjugate
@ ConjTrans
conjugate transpose
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:259
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:409
StoreV
Definition types.hpp:383
@ Rowwise
Rowwise storage.
@ Columnwise
Columnwise storage.
constexpr internal::LowerHessenberg LOWER_HESSENBERG
Lower Hessenberg access.
Definition types.hpp:179
Uplo
Definition types.hpp:45
@ General
0 <= i <= m, 0 <= j <= n.
@ Upper
0 <= i <= j, 0 <= j <= n.
@ StrictLower
0 <= i <= m, 0 <= j <= i-1.
@ Lower
0 <= i <= m, 0 <= j <= i.
@ StrictUpper
0 <= i <= j-1, 0 <= j <= n.
@ UpperHessenberg
0 <= i <= j+1, 0 <= j <= n.
@ LowerHessenberg
0 <= i <= m, 0 <= j <= i+1.
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:255
constexpr internal::InfNorm INF_NORM
infinity norm of matrices
Definition types.hpp:340
Norm
Definition types.hpp:296
@ Inf
infinity norm of matrices
@ Fro
Frobenius norm of matrices.
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:289
Layout
Definition types.hpp:24
@ Unspecified
Used on all other data structures.
@ ColMajor
Column-major layout.
@ RowMajor
Row-major layout.
Concept for types that represent tlapack::Diag.
Concept for types that represent tlapack::Direction.
Concept for types that represent tlapack::Norm.
Concept for types that represent tlapack::Op.
Concept for types that represent tlapack::Side.
Concept for types that represent tlapack::StoreV.
Concept for types that represent tlapack::Uplo.
Band access.
Definition types.hpp:427
std::size_t lower_bandwidth
Number of subdiagonals.
Definition types.hpp:428
std::size_t upper_bandwidth
Number of superdiagonals.
Definition types.hpp:429
General access.
Definition types.hpp:77
Lower Hessenberg access.
Definition types.hpp:136
Lower Triangle access.
Definition types.hpp:105
Strict Lower Triangle access.
Definition types.hpp:167
Strict Upper Triangle access.
Definition types.hpp:153
Upper Hessenberg access.
Definition types.hpp:119
Upper Triangle access.
Definition types.hpp:91
Describes a row- or column-major matrix.
Definition types.hpp:443
Describes a strided vector.
Definition types.hpp:458