Eigen  5.0.1
 
Loading...
Searching...
No Matches
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// SPDX-License-Identifier: MPL-2.0
11
12#ifndef EIGEN_FORWARDDECLARATIONS_H
13#define EIGEN_FORWARDDECLARATIONS_H
14
15// IWYU pragma: private
16#include "../InternalHeaderCheck.h"
17
18namespace Eigen {
19namespace internal {
20
21template <typename T>
22struct traits;
23
24// here we say once and for all that traits<const T> == traits<T>
25// When constness must affect traits, it has to be constness on template parameters on which T itself depends.
26// For example, traits<Map<const T> > != traits<Map<T> >, but
27// traits<const Map<T> > == traits<Map<T> >
28template <typename T>
29struct traits<const T> : traits<T> {};
30
31template <typename Derived>
32struct has_direct_access : bool_constant<(traits<Derived>::Flags & DirectAccessBit) != 0> {};
33
34template <typename Derived>
35struct accessors_level {
36 enum {
37 has_direct_access = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0,
38 has_write_access = (traits<Derived>::Flags & LvalueBit) ? 1 : 0,
39 value = has_direct_access ? (has_write_access ? DirectWriteAccessors : DirectAccessors)
40 : (has_write_access ? WriteAccessors : ReadOnlyAccessors)
41 };
42};
43
44template <typename T>
45struct evaluator_traits;
46
47template <typename T>
48struct evaluator;
49
50} // end namespace internal
51
52template <typename T>
53struct NumTraits;
54
55template <typename Derived>
56struct EigenBase;
57template <typename Derived>
58class DenseBase;
59template <typename Derived>
60class PlainObjectBase;
61template <typename Derived, int Level>
62class DenseCoeffsBase;
63
64template <typename Scalar_, int Rows_, int Cols_,
65 int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor
66 : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor
67 : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION),
68 int MaxRows_ = Rows_, int MaxCols_ = Cols_>
69class Matrix;
70
71template <typename Derived>
72class MatrixBase;
73template <typename Derived>
74class ArrayBase;
75
76template <typename ExpressionType, template <typename> class StorageBase>
77class NoAlias;
78template <typename ExpressionType>
79class NestByValue;
80template <typename ExpressionType>
81class SwapWrapper;
82
83template <typename XprType, int BlockRows = Dynamic, int BlockCols = Dynamic, bool InnerPanel = false>
84class Block;
85template <typename XprType, typename RowIndices, typename ColIndices>
86class IndexedView;
87template <typename XprType, int Rows = Dynamic, int Cols = Dynamic, int Order = 0>
88class Reshaped;
89template <typename FirstType, typename SizeType, typename IncrType>
90class ArithmeticSequence;
91
92template <typename MatrixType, int Size = Dynamic>
93class VectorBlock;
94template <typename MatrixType>
95class Transpose;
96template <typename MatrixType>
97class Conjugate;
98template <typename NullaryOp, typename MatrixType>
99class CwiseNullaryOp;
100template <typename UnaryOp, typename MatrixType>
101class CwiseUnaryOp;
102template <typename BinaryOp, typename Lhs, typename Rhs>
103class CwiseBinaryOp;
104template <typename TernaryOp, typename Arg1, typename Arg2, typename Arg3>
105class CwiseTernaryOp;
106template <typename Decomposition, typename Rhstype>
107class Solve;
108template <typename XprType>
109class Inverse;
110
111template <typename Lhs, typename Rhs, int Option = DefaultProduct>
112class Product;
113
114template <typename Derived>
115class DiagonalBase;
116template <typename DiagonalVectorType_>
117class DiagonalWrapper;
118template <typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime>
119class DiagonalMatrix;
120template <typename MatrixType, int Index = 0>
121class Diagonal;
122template <typename Derived>
123class SkewSymmetricBase;
124template <typename VectorType_>
125class SkewSymmetricWrapper;
126template <typename Scalar_>
127class SkewSymmetricMatrix3;
128template <int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType = int>
129class PermutationMatrix;
130template <typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime,
131 typename StorageIndex_ = int>
132class ScaledPermutationMatrix;
133template <typename Derived>
134class ScaledPermutationBase;
135template <int SizeAtCompileTime, int MaxSizeAtCompileTime = SizeAtCompileTime, typename IndexType = int>
136class Transpositions;
137template <typename Derived>
138class PermutationBase;
139template <typename Derived>
140class TranspositionsBase;
141template <typename IndicesType_>
142class PermutationWrapper;
143template <typename IndicesType_>
144class TranspositionsWrapper;
145
146template <typename Derived,
147 int Level = internal::accessors_level<Derived>::has_write_access ? WriteAccessors : ReadOnlyAccessors>
148class MapBase;
149template <int OuterStrideAtCompileTime, int InnerStrideAtCompileTime>
150class Stride;
151template <int Value = Dynamic>
152class InnerStride;
153template <int Value = Dynamic>
154class OuterStride;
155template <typename MatrixType, int MapOptions = Unaligned, typename StrideType = Stride<0, 0>>
156class Map;
157template <typename Derived>
158class RefBase;
159template <typename PlainObjectType, int Options = 0,
160 typename StrideType =
161 std::conditional_t<PlainObjectType::IsVectorAtCompileTime, InnerStride<1>, OuterStride<>>>
162class Ref;
163template <typename ViewOp, typename MatrixType, typename StrideType = Stride<0, 0>>
164class CwiseUnaryView;
165
166template <typename Derived>
167class TriangularBase;
168template <typename MatrixType, unsigned int Mode>
169class TriangularView;
170template <typename MatrixType, unsigned int Mode>
171class SelfAdjointView;
172template <typename Derived>
173class RealView;
174template <typename MatrixType>
175class SparseView;
176template <typename ExpressionType>
177class WithFormat;
178template <typename MatrixType>
179struct CommaInitializer;
180template <typename Derived>
181class ReturnByValue;
182template <typename ExpressionType>
183class ArrayWrapper;
184template <typename ExpressionType>
185class MatrixWrapper;
186template <typename Derived>
187class SolverBase;
188template <typename XprType>
189class InnerIterator;
190
191namespace internal {
192template <typename XprType>
193class generic_randaccess_stl_iterator;
194template <typename XprType>
195class pointer_based_stl_iterator;
196template <typename XprType, DirectionType Direction>
197class subvector_stl_iterator;
198template <typename XprType, DirectionType Direction>
199class subvector_stl_reverse_iterator;
200} // end namespace internal
201
202namespace internal {
203template <typename Scalar_, int Rows = Dynamic, int Cols = Dynamic, int Supers = Dynamic, int Subs = Dynamic,
204 int Options = 0>
205class BandMatrix;
206}
207
208namespace internal {
209template <typename Lhs, typename Rhs>
210struct product_type;
211
217template <typename T, int ProductTag = internal::product_type<typename T::Lhs, typename T::Rhs>::value,
218 typename LhsShape = typename evaluator_traits<typename T::Lhs>::Shape,
219 typename RhsShape = typename evaluator_traits<typename T::Rhs>::Shape,
220 typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
221 typename RhsScalar = typename traits<typename T::Rhs>::Scalar>
222struct product_evaluator;
223} // namespace internal
224
225namespace internal {
226
227// Provides scalar/packet-wise product and product with accumulation
228// with optional conjugation of the arguments.
229template <typename LhsScalar, typename RhsScalar, bool ConjLhs = false, bool ConjRhs = false>
230struct conj_helper;
231
232template <typename LhsScalar, typename RhsScalar = LhsScalar>
233struct scalar_sum_op;
234template <typename LhsScalar, typename RhsScalar = LhsScalar>
235struct scalar_difference_op;
236template <typename LhsScalar, typename RhsScalar = LhsScalar>
237struct scalar_conj_product_op;
238template <typename LhsScalar, typename RhsScalar = LhsScalar, int NaNPropagation = PropagateFast>
239struct scalar_min_op;
240template <typename LhsScalar, typename RhsScalar = LhsScalar, int NaNPropagation = PropagateFast>
241struct scalar_max_op;
242template <typename Scalar>
243struct scalar_opposite_op;
244template <typename Scalar>
245struct scalar_conjugate_op;
246template <typename Scalar>
247struct scalar_real_op;
248template <typename Scalar>
249struct scalar_imag_op;
250template <typename Scalar>
251struct scalar_abs_op;
252template <typename Scalar>
253struct scalar_abs2_op;
254template <typename LhsScalar, typename RhsScalar = LhsScalar>
255struct scalar_absolute_difference_op;
256template <typename Scalar>
257struct scalar_sqrt_op;
258template <typename Scalar>
259struct scalar_cbrt_op;
260template <typename Scalar>
261struct scalar_rsqrt_op;
262template <typename Scalar>
263struct scalar_exp_op;
264template <typename Scalar>
265struct scalar_log_op;
266template <typename Scalar>
267struct scalar_cos_op;
268template <typename Scalar>
269struct scalar_sin_op;
270template <typename Scalar>
271struct scalar_acos_op;
272template <typename Scalar>
273struct scalar_asin_op;
274template <typename Scalar>
275struct scalar_tan_op;
276template <typename Scalar>
277struct scalar_atan_op;
278template <typename LhsScalar, typename RhsScalar = LhsScalar>
279struct scalar_atan2_op;
280template <typename Scalar>
281struct scalar_inverse_op;
282template <typename Scalar>
283struct scalar_square_op;
284template <typename Scalar>
285struct scalar_cube_op;
286template <typename Scalar, typename NewType>
287struct scalar_cast_op;
288template <typename Scalar>
289struct scalar_random_op;
290template <typename Scalar>
291struct scalar_constant_op;
292template <typename Scalar>
293struct scalar_identity_op;
294template <typename Scalar>
295struct scalar_sign_op;
296template <typename Scalar, typename ScalarExponent>
297struct scalar_pow_op;
298template <typename Scalar, typename ScalarExponent, bool BaseIsInteger, bool ExponentIsInteger, bool BaseIsComplex,
299 bool ExponentIsComplex>
300struct scalar_unary_pow_op;
301template <typename LhsScalar, typename RhsScalar = LhsScalar>
302struct scalar_hypot_op;
303template <typename LhsScalar, typename RhsScalar = LhsScalar>
304struct scalar_product_op;
305template <typename LhsScalar, typename RhsScalar = LhsScalar>
306struct scalar_quotient_op;
307// logical and bitwise operations
308template <typename Scalar>
309struct scalar_boolean_and_op;
310template <typename Scalar>
311struct scalar_boolean_or_op;
312template <typename Scalar>
313struct scalar_boolean_xor_op;
314template <typename Scalar>
315struct scalar_boolean_not_op;
316template <typename Scalar>
317struct scalar_bitwise_and_op;
318template <typename Scalar>
319struct scalar_bitwise_or_op;
320template <typename Scalar>
321struct scalar_bitwise_xor_op;
322template <typename Scalar>
323struct scalar_bitwise_not_op;
324
325// SpecialFunctions module
326template <typename Scalar>
327struct scalar_lgamma_op;
328template <typename Scalar>
329struct scalar_digamma_op;
330template <typename Scalar>
331struct scalar_erf_op;
332template <typename Scalar>
333struct scalar_erfc_op;
334template <typename Scalar>
335struct scalar_ndtri_op;
336template <typename Scalar>
337struct scalar_igamma_op;
338template <typename Scalar>
339struct scalar_igammac_op;
340template <typename Scalar>
341struct scalar_zeta_op;
342template <typename Scalar>
343struct scalar_betainc_op;
344
345// Bessel functions in SpecialFunctions module
346template <typename Scalar>
347struct scalar_bessel_i0_op;
348template <typename Scalar>
349struct scalar_bessel_i0e_op;
350template <typename Scalar>
351struct scalar_bessel_i1_op;
352template <typename Scalar>
353struct scalar_bessel_i1e_op;
354template <typename Scalar>
355struct scalar_bessel_j0_op;
356template <typename Scalar>
357struct scalar_bessel_y0_op;
358template <typename Scalar>
359struct scalar_bessel_j1_op;
360template <typename Scalar>
361struct scalar_bessel_y1_op;
362template <typename Scalar>
363struct scalar_bessel_k0_op;
364template <typename Scalar>
365struct scalar_bessel_k0e_op;
366template <typename Scalar>
367struct scalar_bessel_k1_op;
368template <typename Scalar>
369struct scalar_bessel_k1e_op;
370
371} // end namespace internal
372
373struct IOFormat;
374
375// Array module
376template <typename Scalar_, int Rows_, int Cols_,
377 int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor
378 : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor
379 : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION),
380 int MaxRows_ = Rows_, int MaxCols_ = Cols_>
381class Array;
382template <typename MatrixType, typename BinaryOp, int Direction>
383class PartialReduxExpr;
384template <typename ExpressionType, int Direction>
385class VectorwiseOp;
386template <typename MatrixType, int RowFactor, int ColFactor>
387class Replicate;
388template <int Direction, typename LhsType, typename RhsType>
389class Concat;
390template <typename MatrixType, int Direction = BothDirections>
391class Reverse;
392
393/* EIGEN_HAS_LAPACK_INT: whether the lapack_int type from the LAPACKE headers is available. Most LAPACKE headers
394 * #define lapack_int (so defined(lapack_int) detects it), but some vendors instead expose lapack_int as a typedef
395 * and #define LAPACK_INT to advertise it. A user whose header does neither can predefine EIGEN_HAS_LAPACK_INT to
396 * 0 or 1 by hand.
397 */
398#ifndef EIGEN_HAS_LAPACK_INT
399#if defined(lapack_int) || defined(LAPACK_INT)
400#define EIGEN_HAS_LAPACK_INT 1
401#else
402#define EIGEN_HAS_LAPACK_INT 0
403#endif
404#endif
405
406#if defined(EIGEN_USE_LAPACKE) && EIGEN_HAS_LAPACK_INT
407// Lapacke interface requires StorageIndex to be lapack_int
408using DefaultPermutationIndex = lapack_int;
409#else
410using DefaultPermutationIndex = int;
411#endif
412
413// Plain static_assert (not EIGEN_STATIC_ASSERT): like the MKL_INT guard it must not be suppressible.
414#if defined(EIGEN_USE_LAPACKE) && defined(EIGEN_USE_BLAS) && EIGEN_HAS_LAPACK_INT
415static_assert(sizeof(lapack_int) == sizeof(BlasIndex),
416 "LAPACKE integer width (lapack_int) does not match the BLAS integer width (Eigen::BlasIndex). Build "
417 "both backends against the same integer interface: pair EIGEN_64BIT_BLAS with an ILP64 LAPACKE "
418 "(lapack_int = 64-bit), or use the 32-bit interface for both.");
419#endif
420
421template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
422class FullPivLU;
423template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
424class PartialPivLU;
425template <typename MatrixType>
426class HouseholderQR;
427template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
428class ColPivHouseholderQR;
429template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
430class FullPivHouseholderQR;
431template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
432class RandColPivHouseholderQR;
433template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
434class CompleteOrthogonalDecomposition;
435template <typename MatrixType, typename PermutationIndex = DefaultPermutationIndex>
436class RandCompleteOrthogonalDecomposition;
437namespace internal {
438template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR>
439class CompleteOrthogonalDecompositionImpl;
440}
441template <typename MatrixType>
442class SVDBase;
443template <typename MatrixType, int Options = 0>
444class JacobiSVD;
445template <typename MatrixType, int Options = 0>
446class BDCSVD;
447template <typename MatrixType, int UpLo = Lower>
448class LLT;
449template <typename MatrixType, int UpLo = Lower>
450class LDLT;
451template <typename MatrixType, int UpLo = Lower>
452class BunchKaufman;
453template <typename VectorsType, typename CoeffsType, int Side = OnTheLeft>
454class HouseholderSequence;
455template <typename Scalar>
456class JacobiRotation;
457
458// Geometry module:
459namespace internal {
460template <typename Derived, typename OtherDerived, int Size = MatrixBase<Derived>::SizeAtCompileTime>
461struct cross_impl;
462}
463template <typename Derived, int Dim_>
464class RotationBase;
465template <typename Derived>
466class QuaternionBase;
467template <typename Scalar>
468class Rotation2D;
469template <typename Scalar>
470class AngleAxis;
471template <typename Scalar, int Dim>
472class Translation;
473template <typename Scalar, int Dim>
474class AlignedBox;
475template <typename Scalar, int Options = AutoAlign>
476class Quaternion;
477template <typename Scalar, int Dim, int Mode, int Options_ = AutoAlign>
478class Transform;
479template <typename Scalar_, int AmbientDim_, int Options = AutoAlign>
480class ParametrizedLine;
481template <typename Scalar_, int AmbientDim_, int Options = AutoAlign>
482class Hyperplane;
483template <typename Scalar>
484class UniformScaling;
485template <typename MatrixType, int Direction>
486class Homogeneous;
487
488// Sparse module:
489template <typename Derived>
490class SparseMatrixBase;
491
492// MatrixFunctions module
493template <typename Derived>
494struct MatrixExponentialReturnValue;
495template <typename Derived>
496class MatrixFunctionReturnValue;
497template <typename Derived>
498class MatrixSquareRootReturnValue;
499template <typename Derived>
500class MatrixLogarithmReturnValue;
501template <typename Derived>
502class MatrixPowerReturnValue;
503template <typename Derived>
504class MatrixComplexPowerReturnValue;
505
506namespace internal {
507template <typename Scalar>
508struct stem_function {
509 using ComplexScalar = internal::make_complex_t<Scalar>;
510 using type = ComplexScalar(ComplexScalar, int);
511};
512} // namespace internal
513
514template <typename XprType, typename Device>
515struct DeviceWrapper;
516
517namespace internal {
518template <typename Xpr>
519struct eigen_fill_helper;
520template <typename Xpr, bool use_fill = eigen_fill_helper<Xpr>::value>
521struct eigen_fill_impl;
522template <typename Xpr>
523struct eigen_memset_helper;
524template <typename Xpr, bool use_memset = eigen_memset_helper<Xpr>::value>
525struct eigen_zero_impl;
526
527template <typename Packet>
528struct has_packet_segment : std::false_type {};
529
530template <typename T>
531struct complex_array_access;
532} // namespace internal
533
534} // end namespace Eigen
535
536#endif // EIGEN_FORWARDDECLARATIONS_H
@ DirectAccessors
Definition Constants.h:381
@ ReadOnlyAccessors
Definition Constants.h:377
@ WriteAccessors
Definition Constants.h:379
@ DirectWriteAccessors
Definition Constants.h:383
@ ColMajor
Definition Constants.h:319
@ RowMajor
Definition Constants.h:321
@ AutoAlign
Definition Constants.h:323
constexpr unsigned int DirectAccessBit
Definition Constants.h:160
constexpr unsigned int LvalueBit
Definition Constants.h:149