compbio
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 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_CONSTANTS_H
12 #define EIGEN_CONSTANTS_H
13 
14 namespace Eigen {
15 
21 const int Dynamic = -1;
22 
26 const int DynamicIndex = 0xffffff;
27 
31 const int Infinity = -1;
32 
39 const int HugeCost = 10000;
40 
61 const unsigned int RowMajorBit = 0x1;
62 
65 const unsigned int EvalBeforeNestingBit = 0x2;
66 
70 EIGEN_DEPRECATED
71 const unsigned int EvalBeforeAssigningBit = 0x4; // FIXME deprecated
72 
89 const unsigned int PacketAccessBit = 0x8;
90 
91 #ifdef EIGEN_VECTORIZE
92 
100 const unsigned int ActualPacketAccessBit = PacketAccessBit;
101 #else
102 const unsigned int ActualPacketAccessBit = 0x0;
103 #endif
104 
125 const unsigned int LinearAccessBit = 0x10;
126 
139 const unsigned int LvalueBit = 0x20;
140 
150 const unsigned int DirectAccessBit = 0x40;
151 
162 EIGEN_DEPRECATED const unsigned int AlignedBit = 0x80;
163 
164 const unsigned int NestByRefBit = 0x100;
165 
173 const unsigned int NoPreferredStorageOrderBit = 0x200;
174 
186 const unsigned int CompressedAccessBit = 0x400;
187 
188 
189 // list of flags that are inherited by default
190 const unsigned int HereditaryBits = RowMajorBit
192 
202 enum UpLoType {
204  Lower=0x1,
206  Upper=0x2,
208  UnitDiag=0x4,
210  ZeroDiag=0x8,
223 };
224 
234  AlignedMask=255,
235  Aligned=16,
236 #if EIGEN_MAX_ALIGN_BYTES==128
237  AlignedMax = Aligned128
238 #elif EIGEN_MAX_ALIGN_BYTES==64
239  AlignedMax = Aligned64
240 #elif EIGEN_MAX_ALIGN_BYTES==32
241  AlignedMax = Aligned32
242 #elif EIGEN_MAX_ALIGN_BYTES==16
243  AlignedMax = Aligned16
244 #elif EIGEN_MAX_ALIGN_BYTES==8
245  AlignedMax = Aligned8
246 #elif EIGEN_MAX_ALIGN_BYTES==0
247  AlignedMax = Unaligned
248 #else
249 #error Invalid value for EIGEN_MAX_ALIGN_BYTES
250 #endif
251 };
252 
255 // FIXME after the corner() API change, this was not needed anymore, except by AlignedBox
256 // TODO: find out what to do with that. Adapt the AlignedBox API ?
257 enum CornerType { TopLeft, TopRight, BottomLeft, BottomRight };
258 
272 };
273 
276 enum TraversalType {
278  DefaultTraversal,
280  LinearTraversal,
283  InnerVectorizedTraversal,
286  LinearVectorizedTraversal,
289  SliceVectorizedTraversal,
291  InvalidTraversal,
293  AllAtOnceTraversal
294 };
295 
298 enum UnrollingType {
300  NoUnrolling,
302  InnerUnrolling,
305  CompleteUnrolling
306 };
307 
310 enum SpecializedType {
311  Specialized,
312  BuiltIn
313 };
314 
320  ColMajor = 0,
322  RowMajor = 0x1, // it is only a coincidence that this is equal to RowMajorBit -- don't rely on that
324  AutoAlign = 0, // FIXME --- clarify the situation
326  DontAlign = 0x2
327 };
328 
331 enum SideType {
333  OnTheLeft = 1,
336 };
337 
338 /* the following used to be written as:
339  *
340  * struct NoChange_t {};
341  * namespace {
342  * EIGEN_UNUSED NoChange_t NoChange;
343  * }
344  *
345  * on the ground that it feels dangerous to disambiguate overloaded functions on enum/integer types.
346  * However, this leads to "variable declared but never referenced" warnings on Intel Composer XE,
347  * and we do not know how to get rid of them (bug 450).
348  */
349 
350 enum NoChange_t { NoChange };
351 enum Sequential_t { Sequential };
352 enum Default_t { Default };
353 
356 enum AmbiVectorMode {
357  IsDense = 0,
358  IsSparse
359 };
360 
373 };
374 
379  Pivoting = 0x01,
381  NoPivoting = 0x02,
383  ComputeFullU = 0x04,
385  ComputeThinU = 0x08,
387  ComputeFullV = 0x10,
389  ComputeThinV = 0x20,
397  EigVecMask = EigenvaluesOnly | ComputeEigenvectors,
400  Ax_lBx = 0x100,
403  ABx_lx = 0x200,
406  BAx_lx = 0x400,
408  GenEigMask = Ax_lBx | ABx_lx | BAx_lx
409 };
410 
422 };
423 
424 #ifdef Success
425 #error The preprocessor symbol 'Success' is defined, possibly by the X11 header file X.h
426 #endif
427 
432  Success = 0,
440 };
441 
447  Isometry = 0x1,
450  Affine = 0x2,
454  Projective = 0x20
455 };
456 
459 namespace Architecture
460 {
461  enum Type {
462  Generic = 0x0,
463  SSE = 0x1,
464  AltiVec = 0x2,
465  VSX = 0x3,
466  NEON = 0x4,
467 #if defined EIGEN_VECTORIZE_SSE
468  Target = SSE
469 #elif defined EIGEN_VECTORIZE_ALTIVEC
470  Target = AltiVec
471 #elif defined EIGEN_VECTORIZE_VSX
472  Target = VSX
473 #elif defined EIGEN_VECTORIZE_NEON
474  Target = NEON
475 #else
476  Target = Generic
477 #endif
478  };
479 }
480 
483 enum ProductImplType
484 { DefaultProduct=0, LazyProduct, AliasFreeProduct, CoeffBasedProductMode, LazyCoeffBasedProductMode, OuterProduct, InnerProduct, GemvProduct, GemmProduct };
485 
488 enum Action {GetAction, SetAction};
489 
491 struct Dense {};
492 
494 struct Sparse {};
495 
497 struct SolverStorage {};
498 
501 
504 
506 struct MatrixXpr {};
507 
509 struct ArrayXpr {};
510 
511 // An evaluator must define its shape. By default, it can be one of the following:
512 struct DenseShape { static std::string debugName() { return "DenseShape"; } };
513 struct SolverShape { static std::string debugName() { return "SolverShape"; } };
514 struct HomogeneousShape { static std::string debugName() { return "HomogeneousShape"; } };
515 struct DiagonalShape { static std::string debugName() { return "DiagonalShape"; } };
516 struct BandShape { static std::string debugName() { return "BandShape"; } };
517 struct TriangularShape { static std::string debugName() { return "TriangularShape"; } };
518 struct SelfAdjointShape { static std::string debugName() { return "SelfAdjointShape"; } };
519 struct PermutationShape { static std::string debugName() { return "PermutationShape"; } };
520 struct TranspositionsShape { static std::string debugName() { return "TranspositionsShape"; } };
521 struct SparseShape { static std::string debugName() { return "SparseShape"; } };
522 
523 namespace internal {
524 
525  // random access iterators based on coeff*() accessors.
526 struct IndexBased {};
527 
528 // evaluator based on iterators to access coefficients.
529 struct IteratorBased {};
530 
534 enum ComparisonName {
535  cmp_EQ = 0,
536  cmp_LT = 1,
537  cmp_LE = 2,
538  cmp_UNORD = 3,
539  cmp_NEQ = 4,
540  cmp_GT = 5,
541  cmp_GE = 6
542 };
543 } // end namespace internal
544 
545 } // end namespace Eigen
546 
547 #endif // EIGEN_CONSTANTS_H
Data pointer is aligned on a 128 bytes boundary.
Definition: Constants.h:233
Read/write access via member functions.
Definition: Constants.h:368
Used in JacobiSVD to indicate that the square matrix U is to be computed.
Definition: Constants.h:383
AccessorLevels
Used as template parameter in DenseCoeffBase and MapBase to indicate which accessors should be provid...
Definition: Constants.h:364
Storage order is column major (see TopicStorageOrders).
Definition: Constants.h:320
Definition: Constants.h:526
const unsigned int CompressedAccessBit
Means that the underlying coefficients can be accessed through pointers to the sparse (un)compressed ...
Definition: Constants.h:186
CornerType
Enum used by DenseBase::corner() in Eigen2 compatibility mode.
Definition: Constants.h:257
const int HugeCost
This value means that the cost to evaluate an expression coefficient is either very expensive or cann...
Definition: Constants.h:39
Used in SelfAdjointEigenSolver and GeneralizedSelfAdjointEigenSolver to specify that only the eigenva...
Definition: Constants.h:392
Apply transformation on the right.
Definition: Constants.h:335
Data pointer is aligned on a 16 bytes boundary.
Definition: Constants.h:230
Don&#39;t require alignment for the matrix itself (the array of coefficients, if dynamically allocated...
Definition: Constants.h:326
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns...
Definition: Constants.h:265
View matrix as a lower triangular matrix with zeros on the diagonal.
Definition: Constants.h:216
Do not specify what is to be done if the SVD of a non-square matrix is asked for. ...
Definition: Constants.h:415
EIGEN_DEPRECATED const unsigned int EvalBeforeAssigningBit
Definition: Constants.h:71
Used in JacobiSVD to indicate that the thin matrix V is to be computed.
Definition: Constants.h:389
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:150
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:139
The type used to identify a permutation storage.
Definition: Constants.h:500
DirectionType
Enum containing possible values for the Direction parameter of Reverse, PartialReduxExpr and Vectorwi...
Definition: Constants.h:262
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
const int DynamicIndex
This value means that a signed quantity (e.g., a signed index) is not known at compile-time, and that instead its value has to be specified at runtime.
Definition: Constants.h:26
Transformation is an isometry.
Definition: Constants.h:447
Used in GeneralizedSelfAdjointEigenSolver to indicate that it should solve the generalized eigenprobl...
Definition: Constants.h:403
Definition: Constants.h:521
Used in GeneralizedSelfAdjointEigenSolver to indicate that it should solve the generalized eigenprobl...
Definition: Constants.h:406
Use a QR decomposition without pivoting as the first step.
Definition: Constants.h:417
Data pointer has no specific alignment.
Definition: Constants.h:228
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
Definition: Constants.h:512
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition: Constants.h:89
Data pointer is aligned on a 32 bytes boundary.
Definition: Constants.h:231
Definition: Constants.h:529
Transformation is a general projective transformation stored as a (Dim+1)^2 matrix.
Definition: Constants.h:454
Used in GeneralizedSelfAdjointEigenSolver to indicate that it should solve the generalized eigenprobl...
Definition: Constants.h:400
The type used to identify a matrix expression.
Definition: Constants.h:506
Data pointer is aligned on a 8 bytes boundary.
Definition: Constants.h:229
Read-only access via a member function.
Definition: Constants.h:366
Transformation is an affine transformation stored as a (Dim) x (Dim+1) matrix.
Definition: Constants.h:452
Align the matrix itself if it is vectorizable fixed-size.
Definition: Constants.h:324
SideType
Enum for specifying whether to apply or solve on the left or right.
Definition: Constants.h:331
View matrix as a lower triangular matrix.
Definition: Constants.h:204
Use a QR decomposition with column pivoting as the first step.
Definition: Constants.h:419
Used in SelfAdjointEigenSolver and GeneralizedSelfAdjointEigenSolver to specify that both the eigenva...
Definition: Constants.h:395
Definition: Constants.h:518
TransformTraits
Enum used to specify how a particular transformation is stored in a matrix.
Definition: Constants.h:445
Used to support symmetric, non-selfadjoint, complex matrices.
Definition: Constants.h:222
Definition: Constants.h:515
StorageOptions
Enum containing possible values for the _Options template parameter of Matrix, Array and BandMatrix...
Definition: Constants.h:318
Matrix has ones on the diagonal; to be used in combination with Lower or Upper.
Definition: Constants.h:208
Data pointer is aligned on a 64 bytes boundary.
Definition: Constants.h:232
The provided data did not satisfy the prerequisites.
Definition: Constants.h:434
Direct read-only access to the coefficients.
Definition: Constants.h:370
Definition: Constants.h:235
Apply transformation on the left.
Definition: Constants.h:333
Use a QR decomposition with full pivoting as the first step.
Definition: Constants.h:421
View matrix as an upper triangular matrix with zeros on the diagonal.
Definition: Constants.h:218
The type used to identify a general sparse storage.
Definition: Constants.h:494
View matrix as an upper triangular matrix with ones on the diagonal.
Definition: Constants.h:214
The inputs are invalid, or the algorithm has been improperly called.
Definition: Constants.h:439
Direct read/write access to the coefficients.
Definition: Constants.h:372
View matrix as an upper triangular matrix.
Definition: Constants.h:206
Computation was successful.
Definition: Constants.h:432
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows...
Definition: Constants.h:268
EIGEN_DEPRECATED const unsigned int AlignedBit
Definition: Constants.h:162
For Reverse, both rows and columns are reversed; not used for PartialReduxExpr and VectorwiseOp...
Definition: Constants.h:271
Matrix has zeros on the diagonal; to be used in combination with Lower or Upper.
Definition: Constants.h:210
View matrix as a lower triangular matrix with ones on the diagonal.
Definition: Constants.h:212
Definition: BandTriangularSolver.h:13
AlignmentType
Enum for indicating whether a buffer is aligned or not.
Definition: Constants.h:227
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition: Constants.h:220
The type used to identify a general solver (factored) storage.
Definition: Constants.h:497
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:322
QRPreconditioners
Possible values for the QRPreconditioner template parameter of JacobiSVD.
Definition: Constants.h:413
The type used to identify a dense storage.
Definition: Constants.h:491
The type used to identify a permutation storage.
Definition: Constants.h:503
The type used to identify an array expression.
Definition: Constants.h:509
Definition: Constants.h:517
DecompositionOptions
Enum with options to give to various decompositions.
Definition: Constants.h:377
UpLoType
Enum containing possible values for the Mode or UpLo parameter of MatrixBase::selfadjointView() and M...
Definition: Constants.h:202
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
const unsigned int EvalBeforeNestingBit
means the expression should be evaluated by the calling expression
Definition: Constants.h:65
Definition: Constants.h:516
Used in JacobiSVD to indicate that the square matrix V is to be computed.
Definition: Constants.h:387
Used in JacobiSVD to indicate that the thin matrix U is to be computed.
Definition: Constants.h:385
Definition: Constants.h:514
ComputationInfo
Enum for reporting the status of a computation.
Definition: Constants.h:430
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition: Constants.h:450
Definition: Constants.h:513
Iterative procedure did not converge.
Definition: Constants.h:436
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:125
Definition: Constants.h:520
const int Infinity
This value means +Infinity; it is currently used only as the p parameter to MatrixBase::lpNorm<int>()...
Definition: Constants.h:31
const unsigned int NoPreferredStorageOrderBit
for an expression, this means that the storage order can be either row-major or column-major.
Definition: Constants.h:173
Definition: Constants.h:519