Constants.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 // Copyright (C) 2007-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
00006 //
00007 // Eigen is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public
00009 // License as published by the Free Software Foundation; either
00010 // version 3 of the License, or (at your option) any later version.
00011 //
00012 // Alternatively, you can redistribute it and/or
00013 // modify it under the terms of the GNU General Public License as
00014 // published by the Free Software Foundation; either version 2 of
00015 // the License, or (at your option) any later version.
00016 //
00017 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00018 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00019 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00020 // GNU General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License and a copy of the GNU General Public License along with
00024 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00025 
00026 #ifndef EIGEN_CONSTANTS_H
00027 #define EIGEN_CONSTANTS_H
00028 
00029 namespace Eigen {
00030 
00036 const int Dynamic = -1;
00037 
00041 const int Infinity = -1;
00042 
00063 const unsigned int RowMajorBit = 0x1;
00064 
00068 const unsigned int EvalBeforeNestingBit = 0x2;
00069 
00073 const unsigned int EvalBeforeAssigningBit = 0x4;
00074 
00091 const unsigned int PacketAccessBit = 0x8;
00092 
00093 #ifdef EIGEN_VECTORIZE
00094 
00102 const unsigned int ActualPacketAccessBit = PacketAccessBit;
00103 #else
00104 const unsigned int ActualPacketAccessBit = 0x0;
00105 #endif
00106 
00127 const unsigned int LinearAccessBit = 0x10;
00128 
00141 const unsigned int LvalueBit = 0x20;
00142 
00152 const unsigned int DirectAccessBit = 0x40;
00153 
00157 const unsigned int AlignedBit = 0x80;
00158 
00159 const unsigned int NestByRefBit = 0x100;
00160 
00161 // list of flags that are inherited by default
00162 const unsigned int HereditaryBits = RowMajorBit
00163                                   | EvalBeforeNestingBit
00164                                   | EvalBeforeAssigningBit;
00165 
00175 enum {
00177   Lower=0x1,                      
00179   Upper=0x2,                      
00181   UnitDiag=0x4, 
00183   ZeroDiag=0x8,
00185   UnitLower=UnitDiag|Lower, 
00187   UnitUpper=UnitDiag|Upper,
00189   StrictlyLower=ZeroDiag|Lower, 
00191   StrictlyUpper=ZeroDiag|Upper,
00193   SelfAdjoint=0x10,
00195   Symmetric=0x20
00196 };
00197 
00200 enum { 
00202   Unaligned=0, 
00204   Aligned=1 
00205 };
00206 
00209 // FIXME after the corner() API change, this was not needed anymore, except by AlignedBox
00210 // TODO: find out what to do with that. Adapt the AlignedBox API ?
00211 enum CornerType { TopLeft, TopRight, BottomLeft, BottomRight };
00212 
00216 enum DirectionType { 
00219   Vertical, 
00222   Horizontal, 
00225   BothDirections 
00226 };
00227 
00230 enum {
00232   DefaultTraversal,
00234   LinearTraversal,
00237   InnerVectorizedTraversal,
00240   LinearVectorizedTraversal,
00243   SliceVectorizedTraversal,
00245   InvalidTraversal
00246 };
00247 
00250 enum {
00252   NoUnrolling,
00254   InnerUnrolling,
00257   CompleteUnrolling
00258 };
00259 
00262 enum {
00263   Specialized,
00264   BuiltIn
00265 };
00266 
00270 enum {
00272   ColMajor = 0,
00274   RowMajor = 0x1,  // it is only a coincidence that this is equal to RowMajorBit -- don't rely on that
00276   AutoAlign = 0, // FIXME --- clarify the situation
00278   DontAlign = 0x2
00279 };
00280 
00283 enum {
00285   OnTheLeft = 1,  
00287   OnTheRight = 2  
00288 };
00289 
00290 /* the following used to be written as:
00291  *
00292  *   struct NoChange_t {};
00293  *   namespace {
00294  *     EIGEN_UNUSED NoChange_t NoChange;
00295  *   }
00296  *
00297  * on the ground that it feels dangerous to disambiguate overloaded functions on enum/integer types.  
00298  * However, this leads to "variable declared but never referenced" warnings on Intel Composer XE,
00299  * and we do not know how to get rid of them (bug 450).
00300  */
00301 
00302 enum NoChange_t   { NoChange };
00303 enum Sequential_t { Sequential };
00304 enum Default_t    { Default };
00305 
00308 enum {
00309   IsDense         = 0,
00310   IsSparse
00311 };
00312 
00316 enum AccessorLevels {
00318   ReadOnlyAccessors, 
00320   WriteAccessors, 
00322   DirectAccessors, 
00324   DirectWriteAccessors
00325 };
00326 
00329 enum DecompositionOptions {
00331   Pivoting            = 0x01, 
00333   NoPivoting          = 0x02, 
00335   ComputeFullU        = 0x04,
00337   ComputeThinU        = 0x08,
00339   ComputeFullV        = 0x10,
00341   ComputeThinV        = 0x20,
00344   EigenvaluesOnly     = 0x40,
00347   ComputeEigenvectors = 0x80,
00349   EigVecMask = EigenvaluesOnly | ComputeEigenvectors,
00352   Ax_lBx              = 0x100,
00355   ABx_lx              = 0x200,
00358   BAx_lx              = 0x400,
00360   GenEigMask = Ax_lBx | ABx_lx | BAx_lx
00361 };
00362 
00365 enum QRPreconditioners {
00367   NoQRPreconditioner,
00369   HouseholderQRPreconditioner,
00371   ColPivHouseholderQRPreconditioner,
00373   FullPivHouseholderQRPreconditioner
00374 };
00375 
00376 #ifdef Success
00377 #error The preprocessor symbol 'Success' is defined, possibly by the X11 header file X.h
00378 #endif
00379 
00382 enum ComputationInfo {
00384   Success = 0,        
00386   NumericalIssue = 1, 
00388   NoConvergence = 2,
00391   InvalidInput = 3
00392 };
00393 
00397 enum TransformTraits {
00399   Isometry      = 0x1,
00402   Affine        = 0x2,
00404   AffineCompact = 0x10 | Affine,
00406   Projective    = 0x20
00407 };
00408 
00411 namespace Architecture
00412 {
00413   enum Type {
00414     Generic = 0x0,
00415     SSE = 0x1,
00416     AltiVec = 0x2,
00417 #if defined EIGEN_VECTORIZE_SSE
00418     Target = SSE
00419 #elif defined EIGEN_VECTORIZE_ALTIVEC
00420     Target = AltiVec
00421 #else
00422     Target = Generic
00423 #endif
00424   };
00425 }
00426 
00429 enum { CoeffBasedProductMode, LazyCoeffBasedProductMode, OuterProduct, InnerProduct, GemvProduct, GemmProduct };
00430 
00433 enum Action {GetAction, SetAction};
00434 
00436 struct Dense {};
00437 
00439 struct MatrixXpr {};
00440 
00442 struct ArrayXpr {};
00443 
00444 } // end namespace Eigen
00445 
00446 #endif // EIGEN_CONSTANTS_H