ForwardDeclarations.h
Go to the documentation of this file.
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 #include "../InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 namespace internal {
18 
19 template<typename T> struct traits;
20 
21 // here we say once and for all that traits<const T> == traits<T>
22 // When constness must affect traits, it has to be constness on template parameters on which T itself depends.
23 // For example, traits<Map<const T> > != traits<Map<T> >, but
24 // traits<const Map<T> > == traits<Map<T> >
25 template<typename T> struct traits<const T> : traits<T> {};
26 
27 template<typename Derived> struct has_direct_access
28 {
29  enum { ret = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0 };
30 };
31 
32 template<typename Derived> struct accessors_level
33 {
34  enum { has_direct_access = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0,
35  has_write_access = (traits<Derived>::Flags & LvalueBit) ? 1 : 0,
36  value = has_direct_access ? (has_write_access ? DirectWriteAccessors : DirectAccessors)
37  : (has_write_access ? WriteAccessors : ReadOnlyAccessors)
38  };
39 };
40 
41 template<typename T> struct evaluator_traits;
42 
43 template< typename T> struct evaluator;
44 
45 } // end namespace internal
46 
47 template<typename T> struct NumTraits;
48 
49 template<typename Derived> struct EigenBase;
50 template<typename Derived> class DenseBase;
51 template<typename Derived> class PlainObjectBase;
52 template<typename Derived, int Level> class DenseCoeffsBase;
53 
54 template<typename Scalar_, int Rows_, int Cols_,
55  int Options_ = AutoAlign |
56  ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
57  : (Cols_==1 && Rows_!=1) ? Eigen::ColMajor
59  int MaxRows_ = Rows_,
60  int MaxCols_ = Cols_
61 > class Matrix;
62 
63 template<typename Derived> class MatrixBase;
64 template<typename Derived> class ArrayBase;
65 
66 template<typename ExpressionType, unsigned int Added, unsigned int Removed> class Flagged;
67 template<typename ExpressionType, template <typename> class StorageBase > class NoAlias;
68 template<typename ExpressionType> class NestByValue;
69 template<typename ExpressionType> class ForceAlignedAccess;
70 template<typename ExpressionType> class SwapWrapper;
71 
72 template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false> class Block;
73 template<typename XprType, typename RowIndices, typename ColIndices> class IndexedView;
74 template<typename XprType, int Rows=Dynamic, int Cols=Dynamic, int Order=0> class Reshaped;
75 
76 template<typename MatrixType, int Size=Dynamic> class VectorBlock;
77 template<typename MatrixType> class Transpose;
78 template<typename MatrixType> class Conjugate;
79 template<typename NullaryOp, typename MatrixType> class CwiseNullaryOp;
80 template<typename UnaryOp, typename MatrixType> class CwiseUnaryOp;
81 template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
82 template<typename TernaryOp, typename Arg1, typename Arg2, typename Arg3> class CwiseTernaryOp;
83 template<typename Decomposition, typename Rhstype> class Solve;
84 template<typename XprType> class Inverse;
85 
86 template<typename Lhs, typename Rhs, int Option = DefaultProduct> class Product;
87 
88 template<typename Derived> class DiagonalBase;
89 template<typename DiagonalVectorType_> class DiagonalWrapper;
90 template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime=SizeAtCompileTime> class DiagonalMatrix;
91 template<typename MatrixType, typename DiagonalType, int ProductOrder> class DiagonalProduct;
92 template<typename MatrixType, int Index = 0> class Diagonal;
93 template<typename Derived> class SkewSymmetricBase;
94 template<typename VectorType_> class SkewSymmetricWrapper;
95 template<typename Scalar_> class SkewSymmetricMatrix3;
96 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class PermutationMatrix;
97 template<int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType=int> class Transpositions;
98 template<typename Derived> class PermutationBase;
99 template<typename Derived> class TranspositionsBase;
100 template<typename IndicesType_> class PermutationWrapper;
101 template<typename IndicesType_> class TranspositionsWrapper;
102 
103 template<typename Derived,
104  int Level = internal::accessors_level<Derived>::has_write_access ? WriteAccessors : ReadOnlyAccessors
105 > class MapBase;
106 template<int OuterStrideAtCompileTime, int InnerStrideAtCompileTime> class Stride;
107 template<int Value = Dynamic> class InnerStride;
108 template<int Value = Dynamic> class OuterStride;
109 template<typename MatrixType, int MapOptions=Unaligned, typename StrideType = Stride<0,0> > class Map;
110 template<typename Derived> class RefBase;
111 template<typename PlainObjectType, int Options = 0,
112  typename StrideType = typename std::conditional_t<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> > > class Ref;
113 template<typename ViewOp, typename MatrixType, typename StrideType = Stride<0,0>> class CwiseUnaryView;
114 
115 template<typename Derived> class TriangularBase;
116 template<typename MatrixType, unsigned int Mode> class TriangularView;
117 template<typename MatrixType, unsigned int Mode> class SelfAdjointView;
118 template<typename MatrixType> class SparseView;
119 template<typename ExpressionType> class WithFormat;
120 template<typename MatrixType> struct CommaInitializer;
121 template<typename Derived> class ReturnByValue;
122 template<typename ExpressionType> class ArrayWrapper;
123 template<typename ExpressionType> class MatrixWrapper;
124 template<typename Derived> class SolverBase;
125 template<typename XprType> class InnerIterator;
126 
127 namespace internal {
128 template<typename XprType> class generic_randaccess_stl_iterator;
129 template<typename XprType> class pointer_based_stl_iterator;
130 template<typename XprType, DirectionType Direction> class subvector_stl_iterator;
131 template<typename XprType, DirectionType Direction> class subvector_stl_reverse_iterator;
132 template<typename DecompositionType> struct kernel_retval_base;
133 template<typename DecompositionType> struct kernel_retval;
134 template<typename DecompositionType> struct image_retval_base;
135 template<typename DecompositionType> struct image_retval;
136 } // end namespace internal
137 
138 namespace internal {
139 template<typename Scalar_, int Rows=Dynamic, int Cols=Dynamic, int Supers=Dynamic, int Subs=Dynamic, int Options=0> class BandMatrix;
140 }
141 
142 namespace internal {
143 template<typename Lhs, typename Rhs> struct product_type;
144 
145 template<bool> struct EnableIf;
146 
152 template< typename T,
153  int ProductTag = internal::product_type<typename T::Lhs,typename T::Rhs>::ret,
154  typename LhsShape = typename evaluator_traits<typename T::Lhs>::Shape,
155  typename RhsShape = typename evaluator_traits<typename T::Rhs>::Shape,
156  typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
157  typename RhsScalar = typename traits<typename T::Rhs>::Scalar
158  > struct product_evaluator;
159 }
160 
161 template<typename Lhs, typename Rhs,
162  int ProductType = internal::product_type<Lhs,Rhs>::value>
164 
165 // this is a workaround for sun CC
166 template<typename Lhs, typename Rhs> struct LazyProductReturnType;
167 
168 namespace internal {
169 
170 // Provides scalar/packet-wise product and product with accumulation
171 // with optional conjugation of the arguments.
172 template<typename LhsScalar, typename RhsScalar, bool ConjLhs=false, bool ConjRhs=false> struct conj_helper;
173 
174 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_sum_op;
175 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_difference_op;
176 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_conj_product_op;
177 template<typename LhsScalar,typename RhsScalar=LhsScalar, int NaNPropagation=PropagateFast> struct scalar_min_op;
178 template<typename LhsScalar,typename RhsScalar=LhsScalar, int NaNPropagation=PropagateFast> struct scalar_max_op;
179 template<typename Scalar> struct scalar_opposite_op;
180 template<typename Scalar> struct scalar_conjugate_op;
181 template<typename Scalar> struct scalar_real_op;
182 template<typename Scalar> struct scalar_imag_op;
183 template<typename Scalar> struct scalar_abs_op;
184 template<typename Scalar> struct scalar_abs2_op;
185 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_absolute_difference_op;
186 template<typename Scalar> struct scalar_sqrt_op;
187 template<typename Scalar> struct scalar_rsqrt_op;
188 template<typename Scalar> struct scalar_exp_op;
189 template<typename Scalar> struct scalar_log_op;
190 template<typename Scalar> struct scalar_cos_op;
191 template<typename Scalar> struct scalar_sin_op;
192 template<typename Scalar> struct scalar_acos_op;
193 template<typename Scalar> struct scalar_asin_op;
194 template<typename Scalar> struct scalar_tan_op;
195 template<typename Scalar> struct scalar_atan_op;
196 template <typename LhsScalar, typename RhsScalar = LhsScalar> struct scalar_atan2_op;
197 template<typename Scalar> struct scalar_inverse_op;
198 template<typename Scalar> struct scalar_square_op;
199 template<typename Scalar> struct scalar_cube_op;
200 template<typename Scalar, typename NewType> struct scalar_cast_op;
201 template<typename Scalar> struct scalar_random_op;
202 template<typename Scalar> struct scalar_constant_op;
203 template<typename Scalar> struct scalar_identity_op;
204 template<typename Scalar> struct scalar_sign_op;
205 template <typename Scalar, typename ScalarExponent>
206 struct scalar_pow_op;
207 template <typename Scalar, typename ScalarExponent, bool BaseIsInteger, bool ExponentIsInteger, bool BaseIsComplex,
208  bool ExponentIsComplex>
209 struct scalar_unary_pow_op;
210 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_hypot_op;
211 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_product_op;
212 template<typename LhsScalar,typename RhsScalar=LhsScalar> struct scalar_quotient_op;
213 // logical and bitwise operations
214 template <typename Scalar> struct scalar_boolean_and_op;
215 template <typename Scalar> struct scalar_boolean_or_op;
216 template <typename Scalar> struct scalar_boolean_xor_op;
217 template <typename Scalar> struct scalar_boolean_not_op;
218 template <typename Scalar> struct scalar_bitwise_and_op;
219 template <typename Scalar> struct scalar_bitwise_or_op;
220 template <typename Scalar> struct scalar_bitwise_xor_op;
221 template <typename Scalar> struct scalar_bitwise_not_op;
222 
223 // SpecialFunctions module
224 template<typename Scalar> struct scalar_lgamma_op;
225 template<typename Scalar> struct scalar_digamma_op;
226 template<typename Scalar> struct scalar_erf_op;
227 template<typename Scalar> struct scalar_erfc_op;
228 template<typename Scalar> struct scalar_ndtri_op;
229 template<typename Scalar> struct scalar_igamma_op;
230 template<typename Scalar> struct scalar_igammac_op;
231 template<typename Scalar> struct scalar_zeta_op;
232 template<typename Scalar> struct scalar_betainc_op;
233 
234 // Bessel functions in SpecialFunctions module
235 template<typename Scalar> struct scalar_bessel_i0_op;
236 template<typename Scalar> struct scalar_bessel_i0e_op;
237 template<typename Scalar> struct scalar_bessel_i1_op;
238 template<typename Scalar> struct scalar_bessel_i1e_op;
239 template<typename Scalar> struct scalar_bessel_j0_op;
240 template<typename Scalar> struct scalar_bessel_y0_op;
241 template<typename Scalar> struct scalar_bessel_j1_op;
242 template<typename Scalar> struct scalar_bessel_y1_op;
243 template<typename Scalar> struct scalar_bessel_k0_op;
244 template<typename Scalar> struct scalar_bessel_k0e_op;
245 template<typename Scalar> struct scalar_bessel_k1_op;
246 template<typename Scalar> struct scalar_bessel_k1e_op;
247 
248 
249 } // end namespace internal
250 
251 struct IOFormat;
252 
253 // Array module
254 template<typename Scalar_, int Rows_, int Cols_,
255  int Options_ = AutoAlign |
256  ( (Rows_==1 && Cols_!=1) ? Eigen::RowMajor
257  : (Cols_==1 && Rows_!=1) ? Eigen::ColMajor
259  int MaxRows_ = Rows_, int MaxCols_ = Cols_> class Array;
260 template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType> class Select;
261 template<typename MatrixType, typename BinaryOp, int Direction> class PartialReduxExpr;
262 template<typename ExpressionType, int Direction> class VectorwiseOp;
263 template<typename MatrixType,int RowFactor,int ColFactor> class Replicate;
264 template<typename MatrixType, int Direction = BothDirections> class Reverse;
265 
266 #if defined(EIGEN_USE_LAPACKE) && defined(lapack_int)
267 // Lapacke interface requires StorageIndex to be lapack_int
269 #else
271 #endif
272 
273 template<typename MatrixType, typename PermutationIndex = DefaultPermutationIndex> class FullPivLU;
274 template<typename MatrixType, typename PermutationIndex = DefaultPermutationIndex> class PartialPivLU;
275 namespace internal {
276 template<typename MatrixType> struct inverse_impl;
277 }
278 template<typename MatrixType> class HouseholderQR;
279 template<typename MatrixType, typename PermutationIndex = DefaultPermutationIndex> class ColPivHouseholderQR;
280 template<typename MatrixType, typename PermutationIndex = DefaultPermutationIndex> class FullPivHouseholderQR;
281 template<typename MatrixType, typename PermutationIndex = DefaultPermutationIndex> class CompleteOrthogonalDecomposition;
282 template<typename MatrixType> class SVDBase;
283 template<typename MatrixType, int Options = 0> class JacobiSVD;
284 template<typename MatrixType, int Options = 0> class BDCSVD;
285 template<typename MatrixType, int UpLo = Lower> class LLT;
286 template<typename MatrixType, int UpLo = Lower> class LDLT;
287 template<typename VectorsType, typename CoeffsType, int Side=OnTheLeft> class HouseholderSequence;
288 template<typename Scalar> class JacobiRotation;
289 
290 // Geometry module:
291 namespace internal {
292 template<typename Derived, typename OtherDerived, int Size = MatrixBase<Derived>::SizeAtCompileTime> struct cross_impl;
293 }
294 template<typename Derived, int Dim_> class RotationBase;
295 template<typename Derived> class QuaternionBase;
296 template<typename Scalar> class Rotation2D;
297 template<typename Scalar> class AngleAxis;
298 template<typename Scalar,int Dim> class Translation;
299 template<typename Scalar,int Dim> class AlignedBox;
300 template<typename Scalar, int Options = AutoAlign> class Quaternion;
301 template<typename Scalar,int Dim,int Mode,int Options_=AutoAlign> class Transform;
302 template <typename Scalar_, int AmbientDim_, int Options=AutoAlign> class ParametrizedLine;
303 template <typename Scalar_, int AmbientDim_, int Options=AutoAlign> class Hyperplane;
304 template<typename Scalar> class UniformScaling;
305 template<typename MatrixType,int Direction> class Homogeneous;
306 
307 // Sparse module:
308 template<typename Derived> class SparseMatrixBase;
309 
310 // MatrixFunctions module
311 template<typename Derived> struct MatrixExponentialReturnValue;
312 template<typename Derived> class MatrixFunctionReturnValue;
313 template<typename Derived> class MatrixSquareRootReturnValue;
314 template<typename Derived> class MatrixLogarithmReturnValue;
315 template<typename Derived> class MatrixPowerReturnValue;
316 template<typename Derived> class MatrixComplexPowerReturnValue;
317 
318 namespace internal {
319 template <typename Scalar>
320 struct stem_function
321 {
322  typedef std::complex<typename NumTraits<Scalar>::Real> ComplexScalar;
323  typedef ComplexScalar type(ComplexScalar, int);
324 };
325 }
326 
327 } // end namespace Eigen
328 
329 #endif // EIGEN_FORWARDDECLARATIONS_H
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION
Definition: Macros.h:30
Eigen::Triplet< double > T
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:43
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:45
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:49
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:107
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:86
Generic expression of a matrix where all coefficients are defined by a functor.
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:58
Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector.
Base class for diagonal matrices and expressions.
Represents a diagonal matrix with its storage.
Expression of a diagonal matrix.
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:67
Enforce aligned packet loads and stores regardless of what is requested.
LU decomposition of a matrix with complete pivoting, and related features.
Definition: FullPivLU.h:64
Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices.
Definition: IndexedView.h:111
Convenience specialization of Stride to specify only an inner stride See class Map for some examples.
Definition: Stride.h:102
Expression of the inverse of another expression.
Definition: Inverse.h:46
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:98
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
Expression of an array as a mathematical vector or matrix.
Definition: ArrayWrapper.h:143
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Expression which must be nested by value.
Definition: NestByValue.h:42
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:34
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:113
LU decomposition of a matrix with partial pivoting, and related features.
Definition: PartialPivLU.h:80
Generic expression of a partially reduxed matrix.
Definition: VectorwiseOp.h:60
Base class for permutations.
Class to view a vector of integers as a permutation matrix.
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:77
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:285
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:65
Expression of a fixed-size or dynamic-size reshape.
Definition: Reshaped.h:99
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:67
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition: Select.h:56
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Base class for skew symmetric matrices and expressions.
Represents a 3x3 skew symmetric matrix with its storage.
Expression of a skew symmetric matrix.
Pseudo expression representing a solving operation.
Definition: Solve.h:65
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:71
Expression of a dense or sparse matrix with zero or too small values removed.
Definition: SparseView.h:48
Holds strides information for Map.
Definition: Stride.h:55
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Represents a sequence of transpositions (row/column interchange)
Base class for triangular part in a matrix.
Expression of a triangular part in a matrix.
Expression of a fixed-size or dynamic-size sub-vector.
Definition: VectorBlock.h:62
Pseudo expression providing broadcasting and partial reduction operations.
Definition: VectorwiseOp.h:188
Pseudo expression providing matrix output with given format.
Definition: IO.h:99
@ DirectAccessors
Definition: Constants.h:382
@ ReadOnlyAccessors
Definition: Constants.h:378
@ WriteAccessors
Definition: Constants.h:380
@ DirectWriteAccessors
Definition: Constants.h:384
@ ColMajor
Definition: Constants.h:321
@ RowMajor
Definition: Constants.h:323
@ AutoAlign
Definition: Constants.h:325
const unsigned int DirectAccessBit
Definition: Constants.h:157
const unsigned int LvalueBit
Definition: Constants.h:146
#define lapack_int
Definition: lapacke.h:52
: InteropHeaders
Definition: Core:139
int DefaultPermutationIndex
Helper class used by the comma initializer operator.
Stores a set of parameters controlling the way matrices are printed.
Definition: IO.h:54