Eigne Matrix Class Library
Dependents: MPC_current_control HydraulicControlBoard_SW AHRS Test_ekf ... more
src/Core/util/Constants.h@0:13a5d365ba16, 2016-10-13 (annotated)
- Committer:
- ykuroda
- Date:
- Thu Oct 13 04:07:23 2016 +0000
- Revision:
- 0:13a5d365ba16
First commint, Eigne Matrix Class Library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ykuroda | 0:13a5d365ba16 | 1 | // This file is part of Eigen, a lightweight C++ template library |
ykuroda | 0:13a5d365ba16 | 2 | // for linear algebra. |
ykuroda | 0:13a5d365ba16 | 3 | // |
ykuroda | 0:13a5d365ba16 | 4 | // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> |
ykuroda | 0:13a5d365ba16 | 5 | // Copyright (C) 2007-2009 Benoit Jacob <jacob.benoit.1@gmail.com> |
ykuroda | 0:13a5d365ba16 | 6 | // |
ykuroda | 0:13a5d365ba16 | 7 | // This Source Code Form is subject to the terms of the Mozilla |
ykuroda | 0:13a5d365ba16 | 8 | // Public License v. 2.0. If a copy of the MPL was not distributed |
ykuroda | 0:13a5d365ba16 | 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
ykuroda | 0:13a5d365ba16 | 10 | |
ykuroda | 0:13a5d365ba16 | 11 | #ifndef EIGEN_CONSTANTS_H |
ykuroda | 0:13a5d365ba16 | 12 | #define EIGEN_CONSTANTS_H |
ykuroda | 0:13a5d365ba16 | 13 | |
ykuroda | 0:13a5d365ba16 | 14 | namespace Eigen { |
ykuroda | 0:13a5d365ba16 | 15 | |
ykuroda | 0:13a5d365ba16 | 16 | /** This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is |
ykuroda | 0:13a5d365ba16 | 17 | * stored in some runtime variable. |
ykuroda | 0:13a5d365ba16 | 18 | * |
ykuroda | 0:13a5d365ba16 | 19 | * Changing the value of Dynamic breaks the ABI, as Dynamic is often used as a template parameter for Matrix. |
ykuroda | 0:13a5d365ba16 | 20 | */ |
ykuroda | 0:13a5d365ba16 | 21 | const int Dynamic = -1; |
ykuroda | 0:13a5d365ba16 | 22 | |
ykuroda | 0:13a5d365ba16 | 23 | /** This value means that a signed quantity (e.g., a signed index) is not known at compile-time, and that instead its value |
ykuroda | 0:13a5d365ba16 | 24 | * has to be specified at runtime. |
ykuroda | 0:13a5d365ba16 | 25 | */ |
ykuroda | 0:13a5d365ba16 | 26 | const int DynamicIndex = 0xffffff; |
ykuroda | 0:13a5d365ba16 | 27 | |
ykuroda | 0:13a5d365ba16 | 28 | /** This value means +Infinity; it is currently used only as the p parameter to MatrixBase::lpNorm<int>(). |
ykuroda | 0:13a5d365ba16 | 29 | * The value Infinity there means the L-infinity norm. |
ykuroda | 0:13a5d365ba16 | 30 | */ |
ykuroda | 0:13a5d365ba16 | 31 | const int Infinity = -1; |
ykuroda | 0:13a5d365ba16 | 32 | |
ykuroda | 0:13a5d365ba16 | 33 | /** \defgroup flags Flags |
ykuroda | 0:13a5d365ba16 | 34 | * \ingroup Core_Module |
ykuroda | 0:13a5d365ba16 | 35 | * |
ykuroda | 0:13a5d365ba16 | 36 | * These are the possible bits which can be OR'ed to constitute the flags of a matrix or |
ykuroda | 0:13a5d365ba16 | 37 | * expression. |
ykuroda | 0:13a5d365ba16 | 38 | * |
ykuroda | 0:13a5d365ba16 | 39 | * It is important to note that these flags are a purely compile-time notion. They are a compile-time property of |
ykuroda | 0:13a5d365ba16 | 40 | * an expression type, implemented as enum's. They are not stored in memory at runtime, and they do not incur any |
ykuroda | 0:13a5d365ba16 | 41 | * runtime overhead. |
ykuroda | 0:13a5d365ba16 | 42 | * |
ykuroda | 0:13a5d365ba16 | 43 | * \sa MatrixBase::Flags |
ykuroda | 0:13a5d365ba16 | 44 | */ |
ykuroda | 0:13a5d365ba16 | 45 | |
ykuroda | 0:13a5d365ba16 | 46 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 47 | * |
ykuroda | 0:13a5d365ba16 | 48 | * for a matrix, this means that the storage order is row-major. |
ykuroda | 0:13a5d365ba16 | 49 | * If this bit is not set, the storage order is column-major. |
ykuroda | 0:13a5d365ba16 | 50 | * For an expression, this determines the storage order of |
ykuroda | 0:13a5d365ba16 | 51 | * the matrix created by evaluation of that expression. |
ykuroda | 0:13a5d365ba16 | 52 | * \sa \ref TopicStorageOrders */ |
ykuroda | 0:13a5d365ba16 | 53 | const unsigned int RowMajorBit = 0x1; |
ykuroda | 0:13a5d365ba16 | 54 | |
ykuroda | 0:13a5d365ba16 | 55 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 56 | * |
ykuroda | 0:13a5d365ba16 | 57 | * means the expression should be evaluated by the calling expression */ |
ykuroda | 0:13a5d365ba16 | 58 | const unsigned int EvalBeforeNestingBit = 0x2; |
ykuroda | 0:13a5d365ba16 | 59 | |
ykuroda | 0:13a5d365ba16 | 60 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 61 | * |
ykuroda | 0:13a5d365ba16 | 62 | * means the expression should be evaluated before any assignment */ |
ykuroda | 0:13a5d365ba16 | 63 | const unsigned int EvalBeforeAssigningBit = 0x4; |
ykuroda | 0:13a5d365ba16 | 64 | |
ykuroda | 0:13a5d365ba16 | 65 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 66 | * |
ykuroda | 0:13a5d365ba16 | 67 | * Short version: means the expression might be vectorized |
ykuroda | 0:13a5d365ba16 | 68 | * |
ykuroda | 0:13a5d365ba16 | 69 | * Long version: means that the coefficients can be handled by packets |
ykuroda | 0:13a5d365ba16 | 70 | * and start at a memory location whose alignment meets the requirements |
ykuroda | 0:13a5d365ba16 | 71 | * of the present CPU architecture for optimized packet access. In the fixed-size |
ykuroda | 0:13a5d365ba16 | 72 | * case, there is the additional condition that it be possible to access all the |
ykuroda | 0:13a5d365ba16 | 73 | * coefficients by packets (this implies the requirement that the size be a multiple of 16 bytes, |
ykuroda | 0:13a5d365ba16 | 74 | * and that any nontrivial strides don't break the alignment). In the dynamic-size case, |
ykuroda | 0:13a5d365ba16 | 75 | * there is no such condition on the total size and strides, so it might not be possible to access |
ykuroda | 0:13a5d365ba16 | 76 | * all coeffs by packets. |
ykuroda | 0:13a5d365ba16 | 77 | * |
ykuroda | 0:13a5d365ba16 | 78 | * \note This bit can be set regardless of whether vectorization is actually enabled. |
ykuroda | 0:13a5d365ba16 | 79 | * To check for actual vectorizability, see \a ActualPacketAccessBit. |
ykuroda | 0:13a5d365ba16 | 80 | */ |
ykuroda | 0:13a5d365ba16 | 81 | const unsigned int PacketAccessBit = 0x8; |
ykuroda | 0:13a5d365ba16 | 82 | |
ykuroda | 0:13a5d365ba16 | 83 | #ifdef EIGEN_VECTORIZE |
ykuroda | 0:13a5d365ba16 | 84 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 85 | * |
ykuroda | 0:13a5d365ba16 | 86 | * If vectorization is enabled (EIGEN_VECTORIZE is defined) this constant |
ykuroda | 0:13a5d365ba16 | 87 | * is set to the value \a PacketAccessBit. |
ykuroda | 0:13a5d365ba16 | 88 | * |
ykuroda | 0:13a5d365ba16 | 89 | * If vectorization is not enabled (EIGEN_VECTORIZE is not defined) this constant |
ykuroda | 0:13a5d365ba16 | 90 | * is set to the value 0. |
ykuroda | 0:13a5d365ba16 | 91 | */ |
ykuroda | 0:13a5d365ba16 | 92 | const unsigned int ActualPacketAccessBit = PacketAccessBit; |
ykuroda | 0:13a5d365ba16 | 93 | #else |
ykuroda | 0:13a5d365ba16 | 94 | const unsigned int ActualPacketAccessBit = 0x0; |
ykuroda | 0:13a5d365ba16 | 95 | #endif |
ykuroda | 0:13a5d365ba16 | 96 | |
ykuroda | 0:13a5d365ba16 | 97 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 98 | * |
ykuroda | 0:13a5d365ba16 | 99 | * Short version: means the expression can be seen as 1D vector. |
ykuroda | 0:13a5d365ba16 | 100 | * |
ykuroda | 0:13a5d365ba16 | 101 | * Long version: means that one can access the coefficients |
ykuroda | 0:13a5d365ba16 | 102 | * of this expression by coeff(int), and coeffRef(int) in the case of a lvalue expression. These |
ykuroda | 0:13a5d365ba16 | 103 | * index-based access methods are guaranteed |
ykuroda | 0:13a5d365ba16 | 104 | * to not have to do any runtime computation of a (row, col)-pair from the index, so that it |
ykuroda | 0:13a5d365ba16 | 105 | * is guaranteed that whenever it is available, index-based access is at least as fast as |
ykuroda | 0:13a5d365ba16 | 106 | * (row,col)-based access. Expressions for which that isn't possible don't have the LinearAccessBit. |
ykuroda | 0:13a5d365ba16 | 107 | * |
ykuroda | 0:13a5d365ba16 | 108 | * If both PacketAccessBit and LinearAccessBit are set, then the |
ykuroda | 0:13a5d365ba16 | 109 | * packets of this expression can be accessed by packet(int), and writePacket(int) in the case of a |
ykuroda | 0:13a5d365ba16 | 110 | * lvalue expression. |
ykuroda | 0:13a5d365ba16 | 111 | * |
ykuroda | 0:13a5d365ba16 | 112 | * Typically, all vector expressions have the LinearAccessBit, but there is one exception: |
ykuroda | 0:13a5d365ba16 | 113 | * Product expressions don't have it, because it would be troublesome for vectorization, even when the |
ykuroda | 0:13a5d365ba16 | 114 | * Product is a vector expression. Thus, vector Product expressions allow index-based coefficient access but |
ykuroda | 0:13a5d365ba16 | 115 | * not index-based packet access, so they don't have the LinearAccessBit. |
ykuroda | 0:13a5d365ba16 | 116 | */ |
ykuroda | 0:13a5d365ba16 | 117 | const unsigned int LinearAccessBit = 0x10; |
ykuroda | 0:13a5d365ba16 | 118 | |
ykuroda | 0:13a5d365ba16 | 119 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 120 | * |
ykuroda | 0:13a5d365ba16 | 121 | * Means the expression has a coeffRef() method, i.e. is writable as its individual coefficients are directly addressable. |
ykuroda | 0:13a5d365ba16 | 122 | * This rules out read-only expressions. |
ykuroda | 0:13a5d365ba16 | 123 | * |
ykuroda | 0:13a5d365ba16 | 124 | * Note that DirectAccessBit and LvalueBit are mutually orthogonal, as there are examples of expression having one but note |
ykuroda | 0:13a5d365ba16 | 125 | * the other: |
ykuroda | 0:13a5d365ba16 | 126 | * \li writable expressions that don't have a very simple memory layout as a strided array, have LvalueBit but not DirectAccessBit |
ykuroda | 0:13a5d365ba16 | 127 | * \li Map-to-const expressions, for example Map<const Matrix>, have DirectAccessBit but not LvalueBit |
ykuroda | 0:13a5d365ba16 | 128 | * |
ykuroda | 0:13a5d365ba16 | 129 | * Expressions having LvalueBit also have their coeff() method returning a const reference instead of returning a new value. |
ykuroda | 0:13a5d365ba16 | 130 | */ |
ykuroda | 0:13a5d365ba16 | 131 | const unsigned int LvalueBit = 0x20; |
ykuroda | 0:13a5d365ba16 | 132 | |
ykuroda | 0:13a5d365ba16 | 133 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 134 | * |
ykuroda | 0:13a5d365ba16 | 135 | * Means that the underlying array of coefficients can be directly accessed as a plain strided array. The memory layout |
ykuroda | 0:13a5d365ba16 | 136 | * of the array of coefficients must be exactly the natural one suggested by rows(), cols(), |
ykuroda | 0:13a5d365ba16 | 137 | * outerStride(), innerStride(), and the RowMajorBit. This rules out expressions such as Diagonal, whose coefficients, |
ykuroda | 0:13a5d365ba16 | 138 | * though referencable, do not have such a regular memory layout. |
ykuroda | 0:13a5d365ba16 | 139 | * |
ykuroda | 0:13a5d365ba16 | 140 | * See the comment on LvalueBit for an explanation of how LvalueBit and DirectAccessBit are mutually orthogonal. |
ykuroda | 0:13a5d365ba16 | 141 | */ |
ykuroda | 0:13a5d365ba16 | 142 | const unsigned int DirectAccessBit = 0x40; |
ykuroda | 0:13a5d365ba16 | 143 | |
ykuroda | 0:13a5d365ba16 | 144 | /** \ingroup flags |
ykuroda | 0:13a5d365ba16 | 145 | * |
ykuroda | 0:13a5d365ba16 | 146 | * means the first coefficient packet is guaranteed to be aligned */ |
ykuroda | 0:13a5d365ba16 | 147 | const unsigned int AlignedBit = 0x80; |
ykuroda | 0:13a5d365ba16 | 148 | |
ykuroda | 0:13a5d365ba16 | 149 | const unsigned int NestByRefBit = 0x100; |
ykuroda | 0:13a5d365ba16 | 150 | |
ykuroda | 0:13a5d365ba16 | 151 | // list of flags that are inherited by default |
ykuroda | 0:13a5d365ba16 | 152 | const unsigned int HereditaryBits = RowMajorBit |
ykuroda | 0:13a5d365ba16 | 153 | | EvalBeforeNestingBit |
ykuroda | 0:13a5d365ba16 | 154 | | EvalBeforeAssigningBit; |
ykuroda | 0:13a5d365ba16 | 155 | |
ykuroda | 0:13a5d365ba16 | 156 | /** \defgroup enums Enumerations |
ykuroda | 0:13a5d365ba16 | 157 | * \ingroup Core_Module |
ykuroda | 0:13a5d365ba16 | 158 | * |
ykuroda | 0:13a5d365ba16 | 159 | * Various enumerations used in %Eigen. Many of these are used as template parameters. |
ykuroda | 0:13a5d365ba16 | 160 | */ |
ykuroda | 0:13a5d365ba16 | 161 | |
ykuroda | 0:13a5d365ba16 | 162 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 163 | * Enum containing possible values for the \p Mode parameter of |
ykuroda | 0:13a5d365ba16 | 164 | * MatrixBase::selfadjointView() and MatrixBase::triangularView(). */ |
ykuroda | 0:13a5d365ba16 | 165 | enum { |
ykuroda | 0:13a5d365ba16 | 166 | /** View matrix as a lower triangular matrix. */ |
ykuroda | 0:13a5d365ba16 | 167 | Lower=0x1, |
ykuroda | 0:13a5d365ba16 | 168 | /** View matrix as an upper triangular matrix. */ |
ykuroda | 0:13a5d365ba16 | 169 | Upper=0x2, |
ykuroda | 0:13a5d365ba16 | 170 | /** %Matrix has ones on the diagonal; to be used in combination with #Lower or #Upper. */ |
ykuroda | 0:13a5d365ba16 | 171 | UnitDiag=0x4, |
ykuroda | 0:13a5d365ba16 | 172 | /** %Matrix has zeros on the diagonal; to be used in combination with #Lower or #Upper. */ |
ykuroda | 0:13a5d365ba16 | 173 | ZeroDiag=0x8, |
ykuroda | 0:13a5d365ba16 | 174 | /** View matrix as a lower triangular matrix with ones on the diagonal. */ |
ykuroda | 0:13a5d365ba16 | 175 | UnitLower=UnitDiag|Lower, |
ykuroda | 0:13a5d365ba16 | 176 | /** View matrix as an upper triangular matrix with ones on the diagonal. */ |
ykuroda | 0:13a5d365ba16 | 177 | UnitUpper=UnitDiag|Upper, |
ykuroda | 0:13a5d365ba16 | 178 | /** View matrix as a lower triangular matrix with zeros on the diagonal. */ |
ykuroda | 0:13a5d365ba16 | 179 | StrictlyLower=ZeroDiag|Lower, |
ykuroda | 0:13a5d365ba16 | 180 | /** View matrix as an upper triangular matrix with zeros on the diagonal. */ |
ykuroda | 0:13a5d365ba16 | 181 | StrictlyUpper=ZeroDiag|Upper, |
ykuroda | 0:13a5d365ba16 | 182 | /** Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint. */ |
ykuroda | 0:13a5d365ba16 | 183 | SelfAdjoint=0x10, |
ykuroda | 0:13a5d365ba16 | 184 | /** Used to support symmetric, non-selfadjoint, complex matrices. */ |
ykuroda | 0:13a5d365ba16 | 185 | Symmetric=0x20 |
ykuroda | 0:13a5d365ba16 | 186 | }; |
ykuroda | 0:13a5d365ba16 | 187 | |
ykuroda | 0:13a5d365ba16 | 188 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 189 | * Enum for indicating whether an object is aligned or not. */ |
ykuroda | 0:13a5d365ba16 | 190 | enum { |
ykuroda | 0:13a5d365ba16 | 191 | /** Object is not correctly aligned for vectorization. */ |
ykuroda | 0:13a5d365ba16 | 192 | Unaligned=0, |
ykuroda | 0:13a5d365ba16 | 193 | /** Object is aligned for vectorization. */ |
ykuroda | 0:13a5d365ba16 | 194 | Aligned=1 |
ykuroda | 0:13a5d365ba16 | 195 | }; |
ykuroda | 0:13a5d365ba16 | 196 | |
ykuroda | 0:13a5d365ba16 | 197 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 198 | * Enum used by DenseBase::corner() in Eigen2 compatibility mode. */ |
ykuroda | 0:13a5d365ba16 | 199 | // FIXME after the corner() API change, this was not needed anymore, except by AlignedBox |
ykuroda | 0:13a5d365ba16 | 200 | // TODO: find out what to do with that. Adapt the AlignedBox API ? |
ykuroda | 0:13a5d365ba16 | 201 | enum CornerType { TopLeft, TopRight, BottomLeft, BottomRight }; |
ykuroda | 0:13a5d365ba16 | 202 | |
ykuroda | 0:13a5d365ba16 | 203 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 204 | * Enum containing possible values for the \p Direction parameter of |
ykuroda | 0:13a5d365ba16 | 205 | * Reverse, PartialReduxExpr and VectorwiseOp. */ |
ykuroda | 0:13a5d365ba16 | 206 | enum DirectionType { |
ykuroda | 0:13a5d365ba16 | 207 | /** For Reverse, all columns are reversed; |
ykuroda | 0:13a5d365ba16 | 208 | * for PartialReduxExpr and VectorwiseOp, act on columns. */ |
ykuroda | 0:13a5d365ba16 | 209 | Vertical, |
ykuroda | 0:13a5d365ba16 | 210 | /** For Reverse, all rows are reversed; |
ykuroda | 0:13a5d365ba16 | 211 | * for PartialReduxExpr and VectorwiseOp, act on rows. */ |
ykuroda | 0:13a5d365ba16 | 212 | Horizontal, |
ykuroda | 0:13a5d365ba16 | 213 | /** For Reverse, both rows and columns are reversed; |
ykuroda | 0:13a5d365ba16 | 214 | * not used for PartialReduxExpr and VectorwiseOp. */ |
ykuroda | 0:13a5d365ba16 | 215 | BothDirections |
ykuroda | 0:13a5d365ba16 | 216 | }; |
ykuroda | 0:13a5d365ba16 | 217 | |
ykuroda | 0:13a5d365ba16 | 218 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 219 | * Enum to specify how to traverse the entries of a matrix. */ |
ykuroda | 0:13a5d365ba16 | 220 | enum { |
ykuroda | 0:13a5d365ba16 | 221 | /** \internal Default traversal, no vectorization, no index-based access */ |
ykuroda | 0:13a5d365ba16 | 222 | DefaultTraversal, |
ykuroda | 0:13a5d365ba16 | 223 | /** \internal No vectorization, use index-based access to have only one for loop instead of 2 nested loops */ |
ykuroda | 0:13a5d365ba16 | 224 | LinearTraversal, |
ykuroda | 0:13a5d365ba16 | 225 | /** \internal Equivalent to a slice vectorization for fixed-size matrices having good alignment |
ykuroda | 0:13a5d365ba16 | 226 | * and good size */ |
ykuroda | 0:13a5d365ba16 | 227 | InnerVectorizedTraversal, |
ykuroda | 0:13a5d365ba16 | 228 | /** \internal Vectorization path using a single loop plus scalar loops for the |
ykuroda | 0:13a5d365ba16 | 229 | * unaligned boundaries */ |
ykuroda | 0:13a5d365ba16 | 230 | LinearVectorizedTraversal, |
ykuroda | 0:13a5d365ba16 | 231 | /** \internal Generic vectorization path using one vectorized loop per row/column with some |
ykuroda | 0:13a5d365ba16 | 232 | * scalar loops to handle the unaligned boundaries */ |
ykuroda | 0:13a5d365ba16 | 233 | SliceVectorizedTraversal, |
ykuroda | 0:13a5d365ba16 | 234 | /** \internal Special case to properly handle incompatible scalar types or other defecting cases*/ |
ykuroda | 0:13a5d365ba16 | 235 | InvalidTraversal, |
ykuroda | 0:13a5d365ba16 | 236 | /** \internal Evaluate all entries at once */ |
ykuroda | 0:13a5d365ba16 | 237 | AllAtOnceTraversal |
ykuroda | 0:13a5d365ba16 | 238 | }; |
ykuroda | 0:13a5d365ba16 | 239 | |
ykuroda | 0:13a5d365ba16 | 240 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 241 | * Enum to specify whether to unroll loops when traversing over the entries of a matrix. */ |
ykuroda | 0:13a5d365ba16 | 242 | enum { |
ykuroda | 0:13a5d365ba16 | 243 | /** \internal Do not unroll loops. */ |
ykuroda | 0:13a5d365ba16 | 244 | NoUnrolling, |
ykuroda | 0:13a5d365ba16 | 245 | /** \internal Unroll only the inner loop, but not the outer loop. */ |
ykuroda | 0:13a5d365ba16 | 246 | InnerUnrolling, |
ykuroda | 0:13a5d365ba16 | 247 | /** \internal Unroll both the inner and the outer loop. If there is only one loop, |
ykuroda | 0:13a5d365ba16 | 248 | * because linear traversal is used, then unroll that loop. */ |
ykuroda | 0:13a5d365ba16 | 249 | CompleteUnrolling |
ykuroda | 0:13a5d365ba16 | 250 | }; |
ykuroda | 0:13a5d365ba16 | 251 | |
ykuroda | 0:13a5d365ba16 | 252 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 253 | * Enum to specify whether to use the default (built-in) implementation or the specialization. */ |
ykuroda | 0:13a5d365ba16 | 254 | enum { |
ykuroda | 0:13a5d365ba16 | 255 | Specialized, |
ykuroda | 0:13a5d365ba16 | 256 | BuiltIn |
ykuroda | 0:13a5d365ba16 | 257 | }; |
ykuroda | 0:13a5d365ba16 | 258 | |
ykuroda | 0:13a5d365ba16 | 259 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 260 | * Enum containing possible values for the \p _Options template parameter of |
ykuroda | 0:13a5d365ba16 | 261 | * Matrix, Array and BandMatrix. */ |
ykuroda | 0:13a5d365ba16 | 262 | enum { |
ykuroda | 0:13a5d365ba16 | 263 | /** Storage order is column major (see \ref TopicStorageOrders). */ |
ykuroda | 0:13a5d365ba16 | 264 | ColMajor = 0, |
ykuroda | 0:13a5d365ba16 | 265 | /** Storage order is row major (see \ref TopicStorageOrders). */ |
ykuroda | 0:13a5d365ba16 | 266 | RowMajor = 0x1, // it is only a coincidence that this is equal to RowMajorBit -- don't rely on that |
ykuroda | 0:13a5d365ba16 | 267 | /** Align the matrix itself if it is vectorizable fixed-size */ |
ykuroda | 0:13a5d365ba16 | 268 | AutoAlign = 0, |
ykuroda | 0:13a5d365ba16 | 269 | /** Don't require alignment for the matrix itself (the array of coefficients, if dynamically allocated, may still be requested to be aligned) */ // FIXME --- clarify the situation |
ykuroda | 0:13a5d365ba16 | 270 | DontAlign = 0x2 |
ykuroda | 0:13a5d365ba16 | 271 | }; |
ykuroda | 0:13a5d365ba16 | 272 | |
ykuroda | 0:13a5d365ba16 | 273 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 274 | * Enum for specifying whether to apply or solve on the left or right. */ |
ykuroda | 0:13a5d365ba16 | 275 | enum { |
ykuroda | 0:13a5d365ba16 | 276 | /** Apply transformation on the left. */ |
ykuroda | 0:13a5d365ba16 | 277 | OnTheLeft = 1, |
ykuroda | 0:13a5d365ba16 | 278 | /** Apply transformation on the right. */ |
ykuroda | 0:13a5d365ba16 | 279 | OnTheRight = 2 |
ykuroda | 0:13a5d365ba16 | 280 | }; |
ykuroda | 0:13a5d365ba16 | 281 | |
ykuroda | 0:13a5d365ba16 | 282 | /* the following used to be written as: |
ykuroda | 0:13a5d365ba16 | 283 | * |
ykuroda | 0:13a5d365ba16 | 284 | * struct NoChange_t {}; |
ykuroda | 0:13a5d365ba16 | 285 | * namespace { |
ykuroda | 0:13a5d365ba16 | 286 | * EIGEN_UNUSED NoChange_t NoChange; |
ykuroda | 0:13a5d365ba16 | 287 | * } |
ykuroda | 0:13a5d365ba16 | 288 | * |
ykuroda | 0:13a5d365ba16 | 289 | * on the ground that it feels dangerous to disambiguate overloaded functions on enum/integer types. |
ykuroda | 0:13a5d365ba16 | 290 | * However, this leads to "variable declared but never referenced" warnings on Intel Composer XE, |
ykuroda | 0:13a5d365ba16 | 291 | * and we do not know how to get rid of them (bug 450). |
ykuroda | 0:13a5d365ba16 | 292 | */ |
ykuroda | 0:13a5d365ba16 | 293 | |
ykuroda | 0:13a5d365ba16 | 294 | enum NoChange_t { NoChange }; |
ykuroda | 0:13a5d365ba16 | 295 | enum Sequential_t { Sequential }; |
ykuroda | 0:13a5d365ba16 | 296 | enum Default_t { Default }; |
ykuroda | 0:13a5d365ba16 | 297 | |
ykuroda | 0:13a5d365ba16 | 298 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 299 | * Used in AmbiVector. */ |
ykuroda | 0:13a5d365ba16 | 300 | enum { |
ykuroda | 0:13a5d365ba16 | 301 | IsDense = 0, |
ykuroda | 0:13a5d365ba16 | 302 | IsSparse |
ykuroda | 0:13a5d365ba16 | 303 | }; |
ykuroda | 0:13a5d365ba16 | 304 | |
ykuroda | 0:13a5d365ba16 | 305 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 306 | * Used as template parameter in DenseCoeffBase and MapBase to indicate |
ykuroda | 0:13a5d365ba16 | 307 | * which accessors should be provided. */ |
ykuroda | 0:13a5d365ba16 | 308 | enum AccessorLevels { |
ykuroda | 0:13a5d365ba16 | 309 | /** Read-only access via a member function. */ |
ykuroda | 0:13a5d365ba16 | 310 | ReadOnlyAccessors, |
ykuroda | 0:13a5d365ba16 | 311 | /** Read/write access via member functions. */ |
ykuroda | 0:13a5d365ba16 | 312 | WriteAccessors, |
ykuroda | 0:13a5d365ba16 | 313 | /** Direct read-only access to the coefficients. */ |
ykuroda | 0:13a5d365ba16 | 314 | DirectAccessors, |
ykuroda | 0:13a5d365ba16 | 315 | /** Direct read/write access to the coefficients. */ |
ykuroda | 0:13a5d365ba16 | 316 | DirectWriteAccessors |
ykuroda | 0:13a5d365ba16 | 317 | }; |
ykuroda | 0:13a5d365ba16 | 318 | |
ykuroda | 0:13a5d365ba16 | 319 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 320 | * Enum with options to give to various decompositions. */ |
ykuroda | 0:13a5d365ba16 | 321 | enum DecompositionOptions { |
ykuroda | 0:13a5d365ba16 | 322 | /** \internal Not used (meant for LDLT?). */ |
ykuroda | 0:13a5d365ba16 | 323 | Pivoting = 0x01, |
ykuroda | 0:13a5d365ba16 | 324 | /** \internal Not used (meant for LDLT?). */ |
ykuroda | 0:13a5d365ba16 | 325 | NoPivoting = 0x02, |
ykuroda | 0:13a5d365ba16 | 326 | /** Used in JacobiSVD to indicate that the square matrix U is to be computed. */ |
ykuroda | 0:13a5d365ba16 | 327 | ComputeFullU = 0x04, |
ykuroda | 0:13a5d365ba16 | 328 | /** Used in JacobiSVD to indicate that the thin matrix U is to be computed. */ |
ykuroda | 0:13a5d365ba16 | 329 | ComputeThinU = 0x08, |
ykuroda | 0:13a5d365ba16 | 330 | /** Used in JacobiSVD to indicate that the square matrix V is to be computed. */ |
ykuroda | 0:13a5d365ba16 | 331 | ComputeFullV = 0x10, |
ykuroda | 0:13a5d365ba16 | 332 | /** Used in JacobiSVD to indicate that the thin matrix V is to be computed. */ |
ykuroda | 0:13a5d365ba16 | 333 | ComputeThinV = 0x20, |
ykuroda | 0:13a5d365ba16 | 334 | /** Used in SelfAdjointEigenSolver and GeneralizedSelfAdjointEigenSolver to specify |
ykuroda | 0:13a5d365ba16 | 335 | * that only the eigenvalues are to be computed and not the eigenvectors. */ |
ykuroda | 0:13a5d365ba16 | 336 | EigenvaluesOnly = 0x40, |
ykuroda | 0:13a5d365ba16 | 337 | /** Used in SelfAdjointEigenSolver and GeneralizedSelfAdjointEigenSolver to specify |
ykuroda | 0:13a5d365ba16 | 338 | * that both the eigenvalues and the eigenvectors are to be computed. */ |
ykuroda | 0:13a5d365ba16 | 339 | ComputeEigenvectors = 0x80, |
ykuroda | 0:13a5d365ba16 | 340 | /** \internal */ |
ykuroda | 0:13a5d365ba16 | 341 | EigVecMask = EigenvaluesOnly | ComputeEigenvectors, |
ykuroda | 0:13a5d365ba16 | 342 | /** Used in GeneralizedSelfAdjointEigenSolver to indicate that it should |
ykuroda | 0:13a5d365ba16 | 343 | * solve the generalized eigenproblem \f$ Ax = \lambda B x \f$. */ |
ykuroda | 0:13a5d365ba16 | 344 | Ax_lBx = 0x100, |
ykuroda | 0:13a5d365ba16 | 345 | /** Used in GeneralizedSelfAdjointEigenSolver to indicate that it should |
ykuroda | 0:13a5d365ba16 | 346 | * solve the generalized eigenproblem \f$ ABx = \lambda x \f$. */ |
ykuroda | 0:13a5d365ba16 | 347 | ABx_lx = 0x200, |
ykuroda | 0:13a5d365ba16 | 348 | /** Used in GeneralizedSelfAdjointEigenSolver to indicate that it should |
ykuroda | 0:13a5d365ba16 | 349 | * solve the generalized eigenproblem \f$ BAx = \lambda x \f$. */ |
ykuroda | 0:13a5d365ba16 | 350 | BAx_lx = 0x400, |
ykuroda | 0:13a5d365ba16 | 351 | /** \internal */ |
ykuroda | 0:13a5d365ba16 | 352 | GenEigMask = Ax_lBx | ABx_lx | BAx_lx |
ykuroda | 0:13a5d365ba16 | 353 | }; |
ykuroda | 0:13a5d365ba16 | 354 | |
ykuroda | 0:13a5d365ba16 | 355 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 356 | * Possible values for the \p QRPreconditioner template parameter of JacobiSVD. */ |
ykuroda | 0:13a5d365ba16 | 357 | enum QRPreconditioners { |
ykuroda | 0:13a5d365ba16 | 358 | /** Do not specify what is to be done if the SVD of a non-square matrix is asked for. */ |
ykuroda | 0:13a5d365ba16 | 359 | NoQRPreconditioner, |
ykuroda | 0:13a5d365ba16 | 360 | /** Use a QR decomposition without pivoting as the first step. */ |
ykuroda | 0:13a5d365ba16 | 361 | HouseholderQRPreconditioner, |
ykuroda | 0:13a5d365ba16 | 362 | /** Use a QR decomposition with column pivoting as the first step. */ |
ykuroda | 0:13a5d365ba16 | 363 | ColPivHouseholderQRPreconditioner, |
ykuroda | 0:13a5d365ba16 | 364 | /** Use a QR decomposition with full pivoting as the first step. */ |
ykuroda | 0:13a5d365ba16 | 365 | FullPivHouseholderQRPreconditioner |
ykuroda | 0:13a5d365ba16 | 366 | }; |
ykuroda | 0:13a5d365ba16 | 367 | |
ykuroda | 0:13a5d365ba16 | 368 | #ifdef Success |
ykuroda | 0:13a5d365ba16 | 369 | #error The preprocessor symbol 'Success' is defined, possibly by the X11 header file X.h |
ykuroda | 0:13a5d365ba16 | 370 | #endif |
ykuroda | 0:13a5d365ba16 | 371 | |
ykuroda | 0:13a5d365ba16 | 372 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 373 | * Enum for reporting the status of a computation. */ |
ykuroda | 0:13a5d365ba16 | 374 | enum ComputationInfo { |
ykuroda | 0:13a5d365ba16 | 375 | /** Computation was successful. */ |
ykuroda | 0:13a5d365ba16 | 376 | Success = 0, |
ykuroda | 0:13a5d365ba16 | 377 | /** The provided data did not satisfy the prerequisites. */ |
ykuroda | 0:13a5d365ba16 | 378 | NumericalIssue = 1, |
ykuroda | 0:13a5d365ba16 | 379 | /** Iterative procedure did not converge. */ |
ykuroda | 0:13a5d365ba16 | 380 | NoConvergence = 2, |
ykuroda | 0:13a5d365ba16 | 381 | /** The inputs are invalid, or the algorithm has been improperly called. |
ykuroda | 0:13a5d365ba16 | 382 | * When assertions are enabled, such errors trigger an assert. */ |
ykuroda | 0:13a5d365ba16 | 383 | InvalidInput = 3 |
ykuroda | 0:13a5d365ba16 | 384 | }; |
ykuroda | 0:13a5d365ba16 | 385 | |
ykuroda | 0:13a5d365ba16 | 386 | /** \ingroup enums |
ykuroda | 0:13a5d365ba16 | 387 | * Enum used to specify how a particular transformation is stored in a matrix. |
ykuroda | 0:13a5d365ba16 | 388 | * \sa Transform, Hyperplane::transform(). */ |
ykuroda | 0:13a5d365ba16 | 389 | enum TransformTraits { |
ykuroda | 0:13a5d365ba16 | 390 | /** Transformation is an isometry. */ |
ykuroda | 0:13a5d365ba16 | 391 | Isometry = 0x1, |
ykuroda | 0:13a5d365ba16 | 392 | /** Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is |
ykuroda | 0:13a5d365ba16 | 393 | * assumed to be [0 ... 0 1]. */ |
ykuroda | 0:13a5d365ba16 | 394 | Affine = 0x2, |
ykuroda | 0:13a5d365ba16 | 395 | /** Transformation is an affine transformation stored as a (Dim) x (Dim+1) matrix. */ |
ykuroda | 0:13a5d365ba16 | 396 | AffineCompact = 0x10 | Affine, |
ykuroda | 0:13a5d365ba16 | 397 | /** Transformation is a general projective transformation stored as a (Dim+1)^2 matrix. */ |
ykuroda | 0:13a5d365ba16 | 398 | Projective = 0x20 |
ykuroda | 0:13a5d365ba16 | 399 | }; |
ykuroda | 0:13a5d365ba16 | 400 | |
ykuroda | 0:13a5d365ba16 | 401 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 402 | * Enum used to choose between implementation depending on the computer architecture. */ |
ykuroda | 0:13a5d365ba16 | 403 | namespace Architecture |
ykuroda | 0:13a5d365ba16 | 404 | { |
ykuroda | 0:13a5d365ba16 | 405 | enum Type { |
ykuroda | 0:13a5d365ba16 | 406 | Generic = 0x0, |
ykuroda | 0:13a5d365ba16 | 407 | SSE = 0x1, |
ykuroda | 0:13a5d365ba16 | 408 | AltiVec = 0x2, |
ykuroda | 0:13a5d365ba16 | 409 | #if defined EIGEN_VECTORIZE_SSE |
ykuroda | 0:13a5d365ba16 | 410 | Target = SSE |
ykuroda | 0:13a5d365ba16 | 411 | #elif defined EIGEN_VECTORIZE_ALTIVEC |
ykuroda | 0:13a5d365ba16 | 412 | Target = AltiVec |
ykuroda | 0:13a5d365ba16 | 413 | #else |
ykuroda | 0:13a5d365ba16 | 414 | Target = Generic |
ykuroda | 0:13a5d365ba16 | 415 | #endif |
ykuroda | 0:13a5d365ba16 | 416 | }; |
ykuroda | 0:13a5d365ba16 | 417 | } |
ykuroda | 0:13a5d365ba16 | 418 | |
ykuroda | 0:13a5d365ba16 | 419 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 420 | * Enum used as template parameter in GeneralProduct. */ |
ykuroda | 0:13a5d365ba16 | 421 | enum { CoeffBasedProductMode, LazyCoeffBasedProductMode, OuterProduct, InnerProduct, GemvProduct, GemmProduct }; |
ykuroda | 0:13a5d365ba16 | 422 | |
ykuroda | 0:13a5d365ba16 | 423 | /** \internal \ingroup enums |
ykuroda | 0:13a5d365ba16 | 424 | * Enum used in experimental parallel implementation. */ |
ykuroda | 0:13a5d365ba16 | 425 | enum Action {GetAction, SetAction}; |
ykuroda | 0:13a5d365ba16 | 426 | |
ykuroda | 0:13a5d365ba16 | 427 | /** The type used to identify a dense storage. */ |
ykuroda | 0:13a5d365ba16 | 428 | struct Dense {}; |
ykuroda | 0:13a5d365ba16 | 429 | |
ykuroda | 0:13a5d365ba16 | 430 | /** The type used to identify a matrix expression */ |
ykuroda | 0:13a5d365ba16 | 431 | struct MatrixXpr {}; |
ykuroda | 0:13a5d365ba16 | 432 | |
ykuroda | 0:13a5d365ba16 | 433 | /** The type used to identify an array expression */ |
ykuroda | 0:13a5d365ba16 | 434 | struct ArrayXpr {}; |
ykuroda | 0:13a5d365ba16 | 435 | |
ykuroda | 0:13a5d365ba16 | 436 | namespace internal { |
ykuroda | 0:13a5d365ba16 | 437 | /** \internal |
ykuroda | 0:13a5d365ba16 | 438 | * Constants for comparison functors |
ykuroda | 0:13a5d365ba16 | 439 | */ |
ykuroda | 0:13a5d365ba16 | 440 | enum ComparisonName { |
ykuroda | 0:13a5d365ba16 | 441 | cmp_EQ = 0, |
ykuroda | 0:13a5d365ba16 | 442 | cmp_LT = 1, |
ykuroda | 0:13a5d365ba16 | 443 | cmp_LE = 2, |
ykuroda | 0:13a5d365ba16 | 444 | cmp_UNORD = 3, |
ykuroda | 0:13a5d365ba16 | 445 | cmp_NEQ = 4 |
ykuroda | 0:13a5d365ba16 | 446 | }; |
ykuroda | 0:13a5d365ba16 | 447 | } |
ykuroda | 0:13a5d365ba16 | 448 | |
ykuroda | 0:13a5d365ba16 | 449 | } // end namespace Eigen |
ykuroda | 0:13a5d365ba16 | 450 | |
ykuroda | 0:13a5d365ba16 | 451 | #endif // EIGEN_CONSTANTS_H |