Eigen  3.3.90 (mercurial changeset d63bd3cb7378)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ForwardDeclarations.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
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_FORWARDDECLARATIONS_H
12 #define EIGEN_FORWARDDECLARATIONS_H
13 
14 namespace Eigen {
15 namespace internal {
16 
17 template<typename T> struct traits;
18 
19 // here we say once and for all that traits<const T> == traits<T>
20 // When constness must affect traits, it has to be constness on template parameters on which T itself depends.
21 // For example, traits<Map<const T> > != traits<Map<T> >, but
22 // traits<const Map<T> > == traits<Map<T> >
23 template<typename T> struct traits<const T> : traits<T> {};
24 
25 template<typename Derived> struct has_direct_access
26 {
27  enum { ret = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0 };
28 };
29 
30 template<typename Derived> struct accessors_level
31 {
32  enum { has_direct_access = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0,
33  has_write_access = (traits<Derived>::Flags & LvalueBit) ? 1 : 0,
34  value = has_direct_access ? (has_write_access ? DirectWriteAccessors : DirectAccessors)
35  : (has_write_access ? WriteAccessors : ReadOnlyAccessors)
36  };
37 };
38 
39 template<typename T> struct evaluator_traits;
40 
41 template< typename T> struct evaluator;
42 
43 } // end namespace internal
44 
45 template<typename T> struct NumTraits;
46 
47 template<typename Derived> struct EigenBase;
48 template<typename Derived> class DenseBase;
49 template<typename Derived> class PlainObjectBase;
50 
51 
52 template<typename Derived,
53  int Level = internal::accessors_level<Derived>::value >
54 class DenseCoeffsBase;
55 
56 template<typename _Scalar, int _Rows, int _Cols,
57  int _Options = AutoAlign |
58 #if EIGEN_GNUC_AT(3,4)
59  // workaround a bug in at least gcc 3.4.6
60  // the innermost ?: ternary operator is misparsed. We write it slightly
61  // differently and this makes gcc 3.4.6 happy, but it's ugly.
62  // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
63  // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
64  ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
65  : !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
66  : Eigen::ColMajor ),
67 #else
68  ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
69  : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
70  : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
71 #endif
72  int _MaxRows = _Rows,
73  int _MaxCols = _Cols
74 > class Matrix;
75 
76 template<typename Derived> class MatrixBase;
77 template<typename Derived> class ArrayBase;
78 
79 template<typename ExpressionType, unsigned int Added, unsigned int Removed> class Flagged;
80 template<typename ExpressionType, template <typename> class StorageBase > class NoAlias;
81 template<typename ExpressionType> class NestByValue;
82 template<typename ExpressionType> class ForceAlignedAccess;
83 template<typename ExpressionType> class SwapWrapper;
84 
85 template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false> class Block;
86 template<typename XprType, typename RowIndices, typename ColIndices> class IndexedView;
87 
88 template<typename MatrixType, int Size=Dynamic> class VectorBlock;
89 template<typename MatrixType> class Transpose;
90 template<typename MatrixType> class Conjugate;
91 template<typename NullaryOp, typename MatrixType> class CwiseNullaryOp;
92 template<typename UnaryOp, typename MatrixType> class CwiseUnaryOp;
93 template<typename ViewOp, typename MatrixType> class CwiseUnaryView;
94 template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
95 template<typename TernaryOp, typename Arg1, typename Arg2, typename Arg3> class CwiseTernaryOp;
96 template<typename Decomposition, typename Rhstype> class Solve;
97 template<typename XprType> class Inverse;
98 
99 template<typename Lhs, typename Rhs, int Option = DefaultProduct> class Product;
100 
101 template<typename Derived> class DiagonalBase;
102 template<typename _DiagonalVectorType> class DiagonalWrapper;
103 template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime=SizeAtCompileTime> class DiagonalMatrix;
104 template<typename MatrixType, typename DiagonalType, int ProductOrder> class DiagonalProduct;
105 template<typename MatrixType, int Index = 0> class Diagonal;
106 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class PermutationMatrix;
107 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class Transpositions;
108 template<typename Derived> class PermutationBase;
109 template<typename Derived> class TranspositionsBase;
110 template<typename _IndicesType> class PermutationWrapper;
111 template<typename _IndicesType> class TranspositionsWrapper;
112 
113 template<typename Derived,
114  int Level = internal::accessors_level<Derived>::has_write_access ? WriteAccessors : ReadOnlyAccessors
115 > class MapBase;
116 template<int InnerStrideAtCompileTime, int OuterStrideAtCompileTime> class Stride;
117 template<int Value = Dynamic> class InnerStride;
118 template<int Value = Dynamic> class OuterStride;
119 template<typename MatrixType, int MapOptions=Unaligned, typename StrideType = Stride<0,0> > class Map;
120 template<typename Derived> class RefBase;
121 template<typename PlainObjectType, int Options = 0,
122  typename StrideType = typename internal::conditional<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> >::type > class Ref;
123 
124 template<typename Derived> class TriangularBase;
125 template<typename MatrixType, unsigned int Mode> class TriangularView;
126 template<typename MatrixType, unsigned int Mode> class SelfAdjointView;
127 template<typename MatrixType> class SparseView;
128 template<typename ExpressionType> class WithFormat;
129 template<typename MatrixType> struct CommaInitializer;
130 template<typename Derived> class ReturnByValue;
131 template<typename ExpressionType> class ArrayWrapper;
132 template<typename ExpressionType> class MatrixWrapper;
133 template<typename Derived> class SolverBase;
134 template<typename XprType> class InnerIterator;
135 
136 namespace internal {
137 template<typename DecompositionType> struct kernel_retval_base;
138 template<typename DecompositionType> struct kernel_retval;
139 template<typename DecompositionType> struct image_retval_base;
140 template<typename DecompositionType> struct image_retval;
141 } // end namespace internal
142 
143 namespace internal {
144 template<typename _Scalar, int Rows=Dynamic, int Cols=Dynamic, int Supers=Dynamic, int Subs=Dynamic, int Options=0> class BandMatrix;
145 }
146 
147 namespace internal {
148 template<typename Lhs, typename Rhs> struct product_type;
149 
150 template<bool> struct EnableIf;
151 
157 template< typename T,
158  int ProductTag = internal::product_type<typename T::Lhs,typename T::Rhs>::ret,
159  typename LhsShape = typename evaluator_traits<typename T::Lhs>::Shape,
160  typename RhsShape = typename evaluator_traits<typename T::Rhs>::Shape,
161  typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
162  typename RhsScalar = typename traits<typename T::Rhs>::Scalar
163  > struct product_evaluator;
164 }
165 
166 template<typename Lhs, typename Rhs,
167  int ProductType = internal::product_type<Lhs,Rhs>::value>
168 struct ProductReturnType;
169 
170 // this is a workaround for sun CC
171 template<typename Lhs, typename Rhs> struct LazyProductReturnType;
172 
173 namespace internal {
174 
175 // Provides scalar/packet-wise product and product with accumulation
176 // with optional conjugation of the arguments.
177 template<typename LhsScalar, typename RhsScalar, bool ConjLhs=false, bool ConjRhs=false> struct conj_helper;
178 
179 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_sum_op;
180 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_difference_op;
181 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_conj_product_op;
182 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_min_op;
183 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_max_op;
184 template<typename Scalar> struct scalar_opposite_op;
185 template<typename Scalar> struct scalar_conjugate_op;
186 template<typename Scalar> struct scalar_real_op;
187 template<typename Scalar> struct scalar_imag_op;
188 template<typename Scalar> struct scalar_abs_op;
189 template<typename Scalar> struct scalar_abs2_op;
190 template<typename Scalar> struct scalar_sqrt_op;
191 template<typename Scalar> struct scalar_rsqrt_op;
192 template<typename Scalar> struct scalar_exp_op;
193 template<typename Scalar> struct scalar_log_op;
194 template<typename Scalar> struct scalar_cos_op;
195 template<typename Scalar> struct scalar_sin_op;
196 template<typename Scalar> struct scalar_acos_op;
197 template<typename Scalar> struct scalar_asin_op;
198 template<typename Scalar> struct scalar_tan_op;
199 template<typename Scalar> struct scalar_inverse_op;
200 template<typename Scalar> struct scalar_square_op;
201 template<typename Scalar> struct scalar_cube_op;
202 template<typename Scalar, typename NewType> struct scalar_cast_op;
203 template<typename Scalar> struct scalar_random_op;
204 template<typename Scalar> struct scalar_constant_op;
205 template<typename Scalar> struct scalar_identity_op;
206 template<typename Scalar,bool iscpx> struct scalar_sign_op;
207 template<typename Scalar,typename ScalarExponent> struct scalar_pow_op;
208 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_hypot_op;
209 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_product_op;
210 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_quotient_op;
211 
212 // SpecialFunctions module
213 template<typename Scalar> struct scalar_lgamma_op;
214 template<typename Scalar> struct scalar_digamma_op;
215 template<typename Scalar> struct scalar_erf_op;
216 template<typename Scalar> struct scalar_erfc_op;
217 template<typename Scalar> struct scalar_igamma_op;
218 template<typename Scalar> struct scalar_igammac_op;
219 template<typename Scalar> struct scalar_zeta_op;
220 template<typename Scalar> struct scalar_betainc_op;
221 
222 } // end namespace internal
223 
224 struct IOFormat;
225 
226 // Array module
227 template<typename _Scalar, int _Rows, int _Cols,
228  int _Options = AutoAlign |
229 #if EIGEN_GNUC_AT(3,4)
230  // workaround a bug in at least gcc 3.4.6
231  // the innermost ?: ternary operator is misparsed. We write it slightly
232  // differently and this makes gcc 3.4.6 happy, but it's ugly.
233  // The error would only show up with EIGEN_DEFAULT_TO_ROW_MAJOR is defined
234  // (when EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION is RowMajor)
235  ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
236  : !(_Cols==1 && _Rows!=1) ? EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
237  : Eigen::ColMajor ),
238 #else
239  ( (_Rows==1 && _Cols!=1) ? Eigen::RowMajor
240  : (_Cols==1 && _Rows!=1) ? Eigen::ColMajor
241  : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
242 #endif
243  int _MaxRows = _Rows, int _MaxCols = _Cols> class Array;
244 template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType> class Select;
245 template<typename MatrixType, typename BinaryOp, int Direction> class PartialReduxExpr;
246 template<typename ExpressionType, int Direction> class VectorwiseOp;
247 template<typename MatrixType,int RowFactor,int ColFactor> class Replicate;
248 template<typename MatrixType, int Direction = BothDirections> class Reverse;
249 
250 template<typename MatrixType> class FullPivLU;
251 template<typename MatrixType> class PartialPivLU;
252 namespace internal {
253 template<typename MatrixType> struct inverse_impl;
254 }
255 template<typename MatrixType> class HouseholderQR;
256 template<typename MatrixType> class ColPivHouseholderQR;
257 template<typename MatrixType> class FullPivHouseholderQR;
258 template<typename MatrixType> class CompleteOrthogonalDecomposition;
259 template<typename MatrixType, int QRPreconditioner = ColPivHouseholderQRPreconditioner> class JacobiSVD;
260 template<typename MatrixType> class BDCSVD;
261 template<typename MatrixType, int UpLo = Lower> class LLT;
262 template<typename MatrixType, int UpLo = Lower> class LDLT;
263 template<typename VectorsType, typename CoeffsType, int Side=OnTheLeft> class HouseholderSequence;
264 template<typename Scalar> class JacobiRotation;
265 
266 // Geometry module:
267 template<typename Derived, int _Dim> class RotationBase;
268 template<typename Lhs, typename Rhs> class Cross;
269 template<typename Derived> class QuaternionBase;
270 template<typename Scalar> class Rotation2D;
271 template<typename Scalar> class AngleAxis;
272 template<typename Scalar,int Dim> class Translation;
273 template<typename Scalar,int Dim> class AlignedBox;
274 template<typename Scalar, int Options = AutoAlign> class Quaternion;
275 template<typename Scalar,int Dim,int Mode,int _Options=AutoAlign> class Transform;
276 template <typename _Scalar, int _AmbientDim, int Options=AutoAlign> class ParametrizedLine;
277 template <typename _Scalar, int _AmbientDim, int Options=AutoAlign> class Hyperplane;
278 template<typename Scalar> class UniformScaling;
279 template<typename MatrixType,int Direction> class Homogeneous;
280 
281 // Sparse module:
282 template<typename Derived> class SparseMatrixBase;
283 
284 // MatrixFunctions module
285 template<typename Derived> struct MatrixExponentialReturnValue;
286 template<typename Derived> class MatrixFunctionReturnValue;
287 template<typename Derived> class MatrixSquareRootReturnValue;
288 template<typename Derived> class MatrixLogarithmReturnValue;
289 template<typename Derived> class MatrixPowerReturnValue;
290 template<typename Derived> class MatrixComplexPowerReturnValue;
291 
292 namespace internal {
293 template <typename Scalar>
294 struct stem_function
295 {
296  typedef std::complex<typename NumTraits<Scalar>::Real> ComplexScalar;
297  typedef ComplexScalar type(ComplexScalar, int);
298 };
299 }
300 
301 } // end namespace Eigen
302 
303 #endif // EIGEN_FORWARDDECLARATIONS_H
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:60
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:50
Definition: Constants.h:372
Definition: Constants.h:324
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:42
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Definition: ForwardDeclarations.h:257
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:94
Base class for triangular part in a matrix.
Definition: TriangularMatrix.h:27
Expression of the transpose of a matrix.
Definition: Transpose.h:52
const unsigned int DirectAccessBit
Definition: Constants.h:154
const unsigned int LvalueBit
Definition: Constants.h:143
Represents a diagonal matrix with its storage.
Definition: DiagonalMatrix.h:116
LU decomposition of a matrix with partial pivoting, and related features.
Definition: ForwardDeclarations.h:251
Holds strides information for Map.
Definition: Stride.h:44
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:264
Generic expression of a partially reduxed matrix.
Definition: ForwardDeclarations.h:245
Pseudo expression providing partial reduction operations.
Definition: ForwardDeclarations.h:246
Complete orthogonal decomposition (COD) of a matrix.
Definition: ForwardDeclarations.h:258
An axis aligned box.
Definition: ForwardDeclarations.h:273
Base class for permutations.
Definition: PermutationMatrix.h:46
Helper class used by the comma initializer operator.
Definition: CommaInitializer.h:28
Sequence of Householder reflections acting on subspaces with decreasing size.
Definition: ForwardDeclarations.h:263
Represents a translation transformation.
Definition: ForwardDeclarations.h:272
Expression of the inverse of another expression.
Definition: Inverse.h:43
Permutation matrix.
Definition: PermutationMatrix.h:308
Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector.
Definition: CwiseUnaryView.h:58
Expression of an array as a mathematical vector or matrix.
Definition: ArrayBase.h:15
Expression of a fixed-size or dynamic-size sub-vector.
Definition: ForwardDeclarations.h:88
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Definition: Constants.h:370
Definition: Constants.h:328
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:282
A hyperplane.
Definition: ForwardDeclarations.h:277
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Definition: ForwardDeclarations.h:256
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:56
Convenience specialization of Stride to specify only an inner stride See class Map for some examples...
Definition: Stride.h:90
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Definition: CwiseTernaryOp.h:84
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:61
Definition: Constants.h:374
Common base class for compact rotation representations.
Definition: ForwardDeclarations.h:267
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:49
Expression of a dense or sparse matrix with zero or too small values removed.
Definition: ForwardDeclarations.h:127
Class to view a vector of integers as a permutation matrix.
Definition: PermutationMatrix.h:514
Base class for quaternion expressions.
Definition: ForwardDeclarations.h:269
Definition: Constants.h:376
class Bidiagonal Divide and Conquer SVD
Definition: ForwardDeclarations.h:260
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:192
Represents a rotation/orientation in a 2 dimensional space.
Definition: ForwardDeclarations.h:270
The quaternion class used to represent 3D orientations and rotations.
Definition: ForwardDeclarations.h:274
LU decomposition of a matrix with complete pivoting, and related features.
Definition: ForwardDeclarations.h:250
Householder QR decomposition of a matrix.
Definition: ForwardDeclarations.h:255
Definition: Constants.h:326
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:259
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:186
Expression of a diagonal matrix.
Definition: DiagonalMatrix.h:245
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:63
Pseudo expression representing a solving operation.
Definition: Solve.h:62
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Pseudo expression providing matrix output with given format.
Definition: IO.h:94
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:101
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:41
A parametrized line.
Definition: ForwardDeclarations.h:276
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
Definition: ForwardDeclarations.h:271
Represents a sequence of transpositions (row/column interchange)
Definition: Transpositions.h:158
Represents an homogeneous transformation in a N dimensional space.
Definition: ForwardDeclarations.h:275
Expression of one (or a set of) homogeneous vector(s)
Definition: ForwardDeclarations.h:279