ArrayBase.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) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_ARRAYBASE_H
11 #define EIGEN_ARRAYBASE_H
12 
13 namespace Eigen {
14 
15 template<typename ExpressionType> class MatrixWrapper;
16 
39 template<typename Derived> class ArrayBase
40  : public DenseBase<Derived>
41 {
42  public:
43 #ifndef EIGEN_PARSED_BY_DOXYGEN
44 
46 
48 
53 
62  using Base::Flags;
63 
64  using Base::derived;
65  using Base::const_cast_derived;
66  using Base::rows;
67  using Base::cols;
68  using Base::size;
69  using Base::coeff;
70  using Base::coeffRef;
71  using Base::lazyAssign;
72  using Base::operator-;
73  using Base::operator=;
74  using Base::operator+=;
75  using Base::operator-=;
76  using Base::operator*=;
77  using Base::operator/=;
78 
80 
81 #endif // not EIGEN_PARSED_BY_DOXYGEN
82 
83 #ifndef EIGEN_PARSED_BY_DOXYGEN
84  typedef typename Base::PlainObject PlainObject;
85 
88 #endif // not EIGEN_PARSED_BY_DOXYGEN
89 
90 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase
91 #define EIGEN_DOC_UNARY_ADDONS(X,Y)
92 # include "../plugins/MatrixCwiseUnaryOps.h"
93 # include "../plugins/ArrayCwiseUnaryOps.h"
94 # include "../plugins/CommonCwiseBinaryOps.h"
95 # include "../plugins/MatrixCwiseBinaryOps.h"
96 # include "../plugins/ArrayCwiseBinaryOps.h"
97 # ifdef EIGEN_ARRAYBASE_PLUGIN
98 # include EIGEN_ARRAYBASE_PLUGIN
99 # endif
100 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
101 #undef EIGEN_DOC_UNARY_ADDONS
102 
107  Derived& operator=(const ArrayBase& other)
108  {
109  internal::call_assignment(derived(), other.derived());
110  return derived();
111  }
112 
116  Derived& operator=(const Scalar &value)
117  { Base::setConstant(value); return derived(); }
118 
120  Derived& operator+=(const Scalar& scalar);
122  Derived& operator-=(const Scalar& scalar);
123 
124  template<typename OtherDerived>
126  Derived& operator+=(const ArrayBase<OtherDerived>& other);
127  template<typename OtherDerived>
129  Derived& operator-=(const ArrayBase<OtherDerived>& other);
130 
131  template<typename OtherDerived>
133  Derived& operator*=(const ArrayBase<OtherDerived>& other);
134 
135  template<typename OtherDerived>
137  Derived& operator/=(const ArrayBase<OtherDerived>& other);
138 
139  public:
141  ArrayBase<Derived>& array() { return *this; }
143  const ArrayBase<Derived>& array() const { return *this; }
144 
151 
152 // template<typename Dest>
153 // inline void evalTo(Dest& dst) const { dst = matrix(); }
154 
155  protected:
158 
159  private:
160  explicit ArrayBase(Index);
162  template<typename OtherDerived> explicit ArrayBase(const ArrayBase<OtherDerived>&);
163  protected:
164  // mixing arrays and matrices is not legal
165  template<typename OtherDerived> Derived& operator+=(const MatrixBase<OtherDerived>& )
166  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
167  // mixing arrays and matrices is not legal
168  template<typename OtherDerived> Derived& operator-=(const MatrixBase<OtherDerived>& )
169  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
170 };
171 
176 template<typename Derived>
177 template<typename OtherDerived>
180 {
182  return derived();
183 }
184 
189 template<typename Derived>
190 template<typename OtherDerived>
193 {
195  return derived();
196 }
197 
202 template<typename Derived>
203 template<typename OtherDerived>
206 {
208  return derived();
209 }
210 
215 template<typename Derived>
216 template<typename OtherDerived>
219 {
221  return derived();
222 }
223 
224 } // end namespace Eigen
225 
226 #endif // EIGEN_ARRAYBASE_H
Eigen::ArrayBase::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl
ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl
Definition: ArrayBase.h:47
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::ArrayBase::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: ArrayBase.h:52
Eigen::ArrayBase::PacketScalar
internal::packet_traits< Scalar >::type PacketScalar
Definition: ArrayBase.h:51
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::ArrayBase::operator+=
Derived & operator+=(const MatrixBase< OtherDerived > &)
Definition: ArrayBase.h:165
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)
Definition: Macros.h:1247
Eigen::ArrayBase::array
const EIGEN_DEVICE_FUNC ArrayBase< Derived > & array() const
Definition: ArrayBase.h:143
Eigen::ArrayBase::operator=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const ArrayBase &other)
Definition: ArrayBase.h:107
Eigen::DenseBase::setConstant
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Definition: CwiseNullaryOp.h:345
Eigen::ArrayBase::ConstantReturnType
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > ConstantReturnType
Definition: ArrayBase.h:87
Eigen::ArrayBase::operator+=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator+=(const Scalar &scalar)
Definition: SelfCwiseBinaryOp.h:25
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
Eigen::ArrayBase::operator-=
Derived & operator-=(const MatrixBase< OtherDerived > &)
Definition: ArrayBase.h:168
Eigen::CwiseNullaryOp
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:60
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Eigen::DenseBase::IsVectorAtCompileTime
@ IsVectorAtCompileTime
Definition: DenseBase.h:153
Eigen::ArrayBase::array
EIGEN_DEVICE_FUNC ArrayBase< Derived > & array()
Definition: ArrayBase.h:141
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::ArrayBase::matrix
const EIGEN_DEVICE_FUNC MatrixWrapper< const Derived > matrix() const
Definition: ArrayBase.h:150
Eigen::DenseBase::lazyAssign
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Eigen::DenseBase< ArrayWrapper< ExpressionType > >::CoeffReturnType
Base::CoeffReturnType CoeffReturnType
Definition: DenseBase.h:96
Eigen::DenseBase::SizeAtCompileTime
@ SizeAtCompileTime
Definition: DenseBase.h:113
Eigen::ArrayBase::CoeffReturnType
Base::CoeffReturnType CoeffReturnType
Definition: ArrayBase.h:79
Eigen::DenseBase::MaxSizeAtCompileTime
@ MaxSizeAtCompileTime
Definition: DenseBase.h:141
scalar
mxArray * scalar(mxClassID classid)
Definition: matlab.h:82
Eigen::ArrayBase::operator/=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator/=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:218
Eigen::internal::mul_assign_op
Definition: AssignmentFunctors.h:89
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::Triplet< double >
Eigen::ArrayBase::Scalar
internal::traits< Derived >::Scalar Scalar
Definition: ArrayBase.h:50
Eigen::ArrayBase::StorageKind
internal::traits< Derived >::StorageKind StorageKind
Definition: ArrayBase.h:49
Eigen::ArrayBase::operator*=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator*=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:205
Eigen::DenseBase::Flags
@ Flags
Definition: DenseBase.h:165
EIGEN_DEFAULT_COPY_CONSTRUCTOR
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
Definition: Macros.h:1221
Eigen::ArrayBase
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:39
Eigen::internal::div_assign_op
Definition: AssignmentFunctors.h:110
Eigen::DenseBase::MaxRowsAtCompileTime
@ MaxRowsAtCompileTime
Definition: DenseBase.h:119
Eigen::ArrayBase::PlainObject
Base::PlainObject PlainObject
Definition: ArrayBase.h:84
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::DenseBase
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Eigen::ArrayBase::ArrayBase
ArrayBase(Index)
Eigen::ArrayBase::StorageBaseType
ArrayBase StorageBaseType
Definition: ArrayBase.h:45
Eigen::internal::sub_assign_op
Definition: AssignmentFunctors.h:67
Eigen::DenseBase::RowsAtCompileTime
@ RowsAtCompileTime
Definition: DenseBase.h:100
Eigen::internal::add_assign_op
Definition: AssignmentFunctors.h:46
Eigen::DenseBase::ColsAtCompileTime
@ ColsAtCompileTime
Definition: DenseBase.h:106
Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Eigen::ArrayBase::matrix
EIGEN_DEVICE_FUNC MatrixWrapper< Derived > matrix()
Definition: ArrayBase.h:148
Eigen::DenseBase::MaxColsAtCompileTime
@ MaxColsAtCompileTime
Definition: DenseBase.h:130
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
Eigen::MatrixWrapper
Expression of an array as a mathematical vector or matrix.
Definition: ArrayBase.h:15
Eigen::ArrayBase::operator=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const Scalar &value)
Definition: ArrayBase.h:116
Eigen::ArrayBase::Base
DenseBase< Derived > Base
Definition: ArrayBase.h:54
Eigen::ArrayBase::operator-=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator-=(const Scalar &scalar)
Definition: SelfCwiseBinaryOp.h:32
Eigen::internal::call_assignment
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:834
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::DenseBase::value
EIGEN_DEVICE_FUNC CoeffReturnType value() const
Definition: DenseBase.h:526
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:01:42