Eigen  5.0.1
 
Loading...
Searching...
No Matches
Constants.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5// Copyright (C) 2007-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
6// Copyright (C) 2020, Arm Limited and Contributors
7//
8// This Source Code Form is subject to the terms of the Mozilla
9// Public License v. 2.0. If a copy of the MPL was not distributed
10// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11// SPDX-License-Identifier: MPL-2.0
12
13#ifndef EIGEN_CONSTANTS_H
14#define EIGEN_CONSTANTS_H
15
16// IWYU pragma: private
17#include "../InternalHeaderCheck.h"
18
19namespace Eigen {
20
26constexpr int Dynamic = -1;
27
31constexpr int DynamicIndex = 0xffffff;
32
35constexpr int Undefined = 0xfffffe;
36
40constexpr int Infinity = -1;
41
49constexpr int HugeCost = 10000;
50
63
71constexpr unsigned int RowMajorBit = 0x1;
72
75constexpr unsigned int EvalBeforeNestingBit = 0x2;
76
80EIGEN_DEPRECATED constexpr unsigned int EvalBeforeAssigningBit = 0x4;
81
98constexpr unsigned int PacketAccessBit = 0x8;
99
100#ifdef EIGEN_VECTORIZE
109constexpr unsigned int ActualPacketAccessBit = PacketAccessBit;
110#else
111constexpr unsigned int ActualPacketAccessBit = 0x0;
112#endif
113
134constexpr unsigned int LinearAccessBit = 0x10;
135
149constexpr unsigned int LvalueBit = 0x20;
150
160constexpr unsigned int DirectAccessBit = 0x40;
161
172EIGEN_DEPRECATED constexpr unsigned int AlignedBit = 0x80;
173
174constexpr unsigned int NestByRefBit = 0x100;
175
183constexpr unsigned int NoPreferredStorageOrderBit = 0x200;
184
196constexpr unsigned int CompressedAccessBit = 0x400;
197
198// list of flags that are inherited by default
199constexpr unsigned int HereditaryBits = RowMajorBit | EvalBeforeNestingBit;
200
206
232
242 AlignedMask = 255,
243 Aligned = 16,
244#if EIGEN_MAX_ALIGN_BYTES == 128
245 AlignedMax = Aligned128
246#elif EIGEN_MAX_ALIGN_BYTES == 64
247 AlignedMax = Aligned64
248#elif EIGEN_MAX_ALIGN_BYTES == 32
249 AlignedMax = Aligned32
250#elif EIGEN_MAX_ALIGN_BYTES == 16
251 AlignedMax = Aligned16
252#elif EIGEN_MAX_ALIGN_BYTES == 8
253 AlignedMax = Aligned8
254#elif EIGEN_MAX_ALIGN_BYTES == 0
255 AlignedMax = Unaligned
256#else
257#error Invalid value for EIGEN_MAX_ALIGN_BYTES
258#endif
259};
260
275
278enum TraversalType {
280 DefaultTraversal,
282 LinearTraversal,
285 InnerVectorizedTraversal,
288 LinearVectorizedTraversal,
291 SliceVectorizedTraversal,
293 InvalidTraversal,
295 AllAtOnceTraversal
296};
297
300enum UnrollingType {
302 NoUnrolling,
304 InnerUnrolling,
307 CompleteUnrolling
308};
309
312enum SpecializedType { Specialized, BuiltIn };
313
321 RowMajor = 0x1, // it is only a coincidence that this is equal to RowMajorBit -- don't rely on that
323 AutoAlign = 0, // FIXME --- clarify the situation
326};
327
336
347
348/* the following used to be written as:
349 *
350 * struct NoChange_t {};
351 * namespace {
352 * EIGEN_UNUSED NoChange_t NoChange;
353 * }
354 *
355 * on the ground that it feels dangerous to disambiguate overloaded functions on enum/integer types.
356 * However, this leads to "variable declared but never referenced" warnings on Intel Composer XE,
357 * and we do not know how to get rid of them (bug 450).
358 */
359
360// NoChange is set to -1 (rather than 0) so that calls like resize(NoChange, n)
361// that land in a generic resize(Index, Index) overload — missing the NoChange_t
362// overload — trip the rows/cols >= 0 assertion instead of silently producing a
363// 0-sized dimension. See issue #656.
364enum NoChange_t { NoChange = -1 };
365enum Sequential_t { Sequential };
366enum Default_t { Default };
367
370enum AmbiVectorMode { IsDense = 0, IsSparse };
371
385
390 Pivoting = 0x01,
392 NoPivoting = 0x02,
411 Ax_lBx = 0x100,
414 ABx_lx = 0x200,
417 BAx_lx = 0x400,
419 GenEigMask = Ax_lBx | ABx_lx | BAx_lx
420};
421
439
440// JacobiSVD and BDCSVD combine QR preconditioner flags with decomposition flags in a single template bitmask.
441constexpr int operator|(QRPreconditioners qr_preconditioner, DecompositionOptions decomposition_option) {
442 return static_cast<int>(qr_preconditioner) | static_cast<int>(decomposition_option);
443}
444
445constexpr int operator|(DecompositionOptions decomposition_option, QRPreconditioners qr_preconditioner) {
446 return static_cast<int>(decomposition_option) | static_cast<int>(qr_preconditioner);
447}
448
449#ifdef Success
450#error The preprocessor symbol 'Success' is defined, possibly by the X11 header file X.h
451#endif
452
466
481
484namespace Architecture {
485enum Type {
486 Generic = 0x0,
487 SSE = 0x1,
488 AltiVec = 0x2,
489 VSX = 0x3,
490 NEON = 0x4,
491 MSA = 0x5,
492 SVE = 0x6,
493 HVX = 0x7,
494 LSX = 0x8,
495 RVV10 = 0x9,
496 SME = 0xa,
497#if defined EIGEN_VECTORIZE_SSE
498 Target = SSE
499#elif defined EIGEN_VECTORIZE_ALTIVEC
500 Target = AltiVec
501#elif defined EIGEN_VECTORIZE_VSX
502 Target = VSX
503#elif defined EIGEN_VECTORIZE_SME
504 Target = SME
505#elif defined EIGEN_VECTORIZE_NEON
506 Target = NEON
507#elif defined EIGEN_VECTORIZE_SVE
508 Target = SVE
509#elif defined EIGEN_VECTORIZE_MSA
510 Target = MSA
511#elif defined EIGEN_VECTORIZE_HVX
512 Target = HVX
513#elif defined EIGEN_VECTORIZE_LSX
514 Target = LSX
515#elif defined EIGEN_VECTORIZE_RVV10
516 Target = RVV10
517#else
518 Target = Generic
519#endif
520};
521} // namespace Architecture
522
525enum ProductImplType {
526 DefaultProduct = 0,
527 LazyProduct,
528 AliasFreeProduct,
529 CoeffBasedProductMode,
530 LazyCoeffBasedProductMode,
531 OuterProduct,
532 InnerProduct,
533 GemvProduct,
534 GemmProduct
535};
536
539enum Action { GetAction, SetAction };
540
542struct Dense {};
543
545struct Sparse {};
546
549
552
555
557struct MatrixXpr {};
558
560struct ArrayXpr {};
561
562// An evaluator must define its shape. By default, it can be one of the following:
563struct DenseShape {
564 static std::string debugName() { return "DenseShape"; }
565};
566struct SolverShape {
567 static std::string debugName() { return "SolverShape"; }
568};
569struct HomogeneousShape {
570 static std::string debugName() { return "HomogeneousShape"; }
571};
572struct DiagonalShape {
573 static std::string debugName() { return "DiagonalShape"; }
574};
575struct SkewSymmetricShape {
576 static std::string debugName() { return "SkewSymmetricShape"; }
577};
578struct BandShape {
579 static std::string debugName() { return "BandShape"; }
580};
581struct TriangularShape {
582 static std::string debugName() { return "TriangularShape"; }
583};
584struct SelfAdjointShape {
585 static std::string debugName() { return "SelfAdjointShape"; }
586};
587struct PermutationShape {
588 static std::string debugName() { return "PermutationShape"; }
589};
590struct ScaledPermutationShape {
591 static std::string debugName() { return "ScaledPermutationShape"; }
592};
593struct TranspositionsShape {
594 static std::string debugName() { return "TranspositionsShape"; }
595};
596struct SparseShape {
597 static std::string debugName() { return "SparseShape"; }
598};
599
600namespace internal {
601
602// random access iterators based on coeff*() accessors.
603struct IndexBased {};
604
605// evaluator based on iterators to access coefficients.
606struct IteratorBased {};
607
611enum ComparisonName : unsigned int {
612 cmp_EQ = 0,
613 cmp_LT = 1,
614 cmp_LE = 2,
615 cmp_UNORD = 3,
616 cmp_NEQ = 4,
617 cmp_GT = 5,
618 cmp_GE = 6
619};
620} // end namespace internal
621
622} // end namespace Eigen
623
624#endif // EIGEN_CONSTANTS_H
UpLoType
Definition Constants.h:210
AlignmentType
Definition Constants.h:235
QRPreconditioners
Definition Constants.h:424
NaNPropagationOptions
Definition Constants.h:339
ComputationInfo
Definition Constants.h:455
AccessorLevels
Definition Constants.h:375
StorageOptions
Definition Constants.h:317
SideType
Definition Constants.h:330
DirectionType
Definition Constants.h:264
DecompositionOptions
Definition Constants.h:388
TransformTraits
Definition Constants.h:470
@ StrictlyLower
Definition Constants.h:224
@ UnitDiag
Definition Constants.h:216
@ StrictlyUpper
Definition Constants.h:226
@ UnitLower
Definition Constants.h:220
@ ZeroDiag
Definition Constants.h:218
@ SelfAdjoint
Definition Constants.h:228
@ Symmetric
Definition Constants.h:230
@ UnitUpper
Definition Constants.h:222
@ Lower
Definition Constants.h:212
@ Upper
Definition Constants.h:214
@ Aligned64
Definition Constants.h:240
@ Unaligned
Definition Constants.h:236
@ Aligned128
Definition Constants.h:241
@ Aligned32
Definition Constants.h:239
@ Aligned8
Definition Constants.h:237
@ Aligned16
Definition Constants.h:238
@ Aligned
Definition Constants.h:243
@ NoQRPreconditioner
Definition Constants.h:428
@ DisableQRDecomposition
Definition Constants.h:434
@ HouseholderQRPreconditioner
Definition Constants.h:430
@ ColPivHouseholderQRPreconditioner
Definition Constants.h:426
@ FullPivHouseholderQRPreconditioner
Definition Constants.h:432
@ PreconditionSquareMatrix
Definition Constants.h:437
@ PropagateNaN
Definition Constants.h:343
@ PropagateNumbers
Definition Constants.h:345
@ PropagateFast
Definition Constants.h:341
@ NumericalIssue
Definition Constants.h:459
@ InvalidInput
Definition Constants.h:464
@ Success
Definition Constants.h:457
@ NoConvergence
Definition Constants.h:461
@ DirectAccessors
Definition Constants.h:381
@ ReadOnlyAccessors
Definition Constants.h:377
@ WriteAccessors
Definition Constants.h:379
@ DirectWriteAccessors
Definition Constants.h:383
@ ColMajor
Definition Constants.h:319
@ DontAlign
Definition Constants.h:325
@ RowMajor
Definition Constants.h:321
@ AutoAlign
Definition Constants.h:323
@ OnTheLeft
Definition Constants.h:332
@ OnTheRight
Definition Constants.h:334
@ BothDirections
Definition Constants.h:273
@ Horizontal
Definition Constants.h:270
@ Vertical
Definition Constants.h:267
@ ComputeFullV
Definition Constants.h:398
@ ComputeThinV
Definition Constants.h:400
@ Ax_lBx
Definition Constants.h:411
@ ComputeEigenvectors
Definition Constants.h:406
@ BAx_lx
Definition Constants.h:417
@ ABx_lx
Definition Constants.h:414
@ ComputeFullU
Definition Constants.h:394
@ ComputeThinU
Definition Constants.h:396
@ EigenvaluesOnly
Definition Constants.h:403
@ Affine
Definition Constants.h:475
@ Projective
Definition Constants.h:479
@ AffineCompact
Definition Constants.h:477
@ Isometry
Definition Constants.h:472
EIGEN_DEPRECATED constexpr unsigned int AlignedBit
Definition Constants.h:172
constexpr unsigned int ActualPacketAccessBit
Definition Constants.h:109
constexpr unsigned int NoPreferredStorageOrderBit
Definition Constants.h:183
constexpr unsigned int PacketAccessBit
Definition Constants.h:98
constexpr unsigned int DirectAccessBit
Definition Constants.h:160
constexpr unsigned int EvalBeforeNestingBit
Definition Constants.h:75
constexpr unsigned int LinearAccessBit
Definition Constants.h:134
EIGEN_DEPRECATED constexpr unsigned int EvalBeforeAssigningBit
Definition Constants.h:80
constexpr unsigned int LvalueBit
Definition Constants.h:149
constexpr unsigned int RowMajorBit
Definition Constants.h:71
constexpr unsigned int CompressedAccessBit
Definition Constants.h:196
Definition Constants.h:560
Definition Constants.h:542
Definition Constants.h:557
Definition Constants.h:551
Definition Constants.h:548
Definition Constants.h:545
Definition Constants.h:554