Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > Class Template Reference

General-purpose arrays with easy API for coefficient-wise operations. More...

#include <Array.h>

+ Inheritance diagram for Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >:

Classes

struct  PrivateType
 

Public Types

enum  { Options = Options_ }
 
typedef PlainObjectBase< ArrayBase
 
typedef Base::PlainObject PlainObject
 
- Public Types inherited from Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
enum  
 
enum  
 
enum  
 
typedef internal::dense_xpr_base< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::type Base
 
typedef internal::traits< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::StorageKind StorageKind
 
typedef internal::traits< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > DenseType
 
typedef Eigen::Map< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >, Unaligned > MapType
 
typedef const Eigen::Map< const Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >, Unaligned > ConstMapType
 
typedef Eigen::Map< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >, AlignedMax > AlignedMapType
 
typedef const Eigen::Map< const Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >, AlignedMax > ConstAlignedMapType
 

Public Member Functions

template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Arrayoperator= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Arrayoperator= (const Scalar &value)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Arrayoperator= (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Arrayoperator= (const Array &other)
 Assigns arrays to each other. More...
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array ()=default
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array (Array &&)=default
 Move constructor. More...
 
EIGEN_DEVICE_FUNC Arrayoperator= (Array &&other) EIGEN_NOEXCEPT_IF(std
 
template<typename... ArgTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array (const std::initializer_list< std::initializer_list< Scalar >> &list)
 Constructs an array and initializes it from the coefficients given as initializer-lists grouped by row. \cpp11. More...
 
template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const T &x)
 
template<typename T0 , typename T1 >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const T0 &val0, const T1 &val1)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const Scalar &val0, const Scalar &val1, const Scalar &val2)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const Scalar &val0, const Scalar &val1, const Scalar &val2, const Scalar &val3)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array (const Array &)=default
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array (const EigenBase< OtherDerived > &other, std::enable_if_t< internal::is_convertible< typename OtherDerived::Scalar, Scalar >::value, PrivateType >=PrivateType())
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC const Basebase () const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalarcoeff (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalarcoeff (Index index) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index rowId, Index colId)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ScalarcoeffRef (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ScalarcoeffRef (Index index) const
 
- Public Member Functions inherited from Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
 EIGEN_STATIC_ASSERT (internal::check_implication(MaxRowsAtCompileTime==1 &&MaxColsAtCompileTime !=1,(int(Options) &RowMajor)==RowMajor), INVALID_MATRIX_TEMPLATE_PARAMETERS) EIGEN_STATIC_ASSERT(internal
 
EIGEN_DEVICE_FUNC const Basebase () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalarcoeff (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalarcoeff (Index index) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index rowId, Index colId)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ScalarcoeffRef (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ScalarcoeffRef (Index index) const
 
EIGEN_STRONG_INLINE PacketScalar packet (Index rowId, Index colId) const
 
EIGEN_STRONG_INLINE PacketScalar packet (Index index) const
 
EIGEN_STRONG_INLINE void writePacket (Index rowId, Index colId, const PacketScalar &val)
 
EIGEN_STRONG_INLINE void writePacket (Index index, const PacketScalar &val)
 
constexpr EIGEN_DEVICE_FUNC const Scalardata () const
 
constexpr EIGEN_DEVICE_FUNC Scalardata ()
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize (Index rows, Index cols)
 
constexpr EIGEN_DEVICE_FUNC void resize (Index size)
 
constexpr EIGEN_DEVICE_FUNC void resize (NoChange_t, Index cols)
 
constexpr EIGEN_DEVICE_FUNC void resize (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike (const EigenBase< OtherDerived > &_other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (NoChange_t, Index cols)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index size)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResizeLike (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & operator= (const PlainObjectBase &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & operator= (const ReturnByValue< OtherDerived > &func)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & operator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this. More...
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & lazyAssign (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setConstant (Index size, const Scalar &val)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setConstant (Index rows, Index cols, const Scalar &val)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setConstant (NoChange_t, Index cols, const Scalar &val)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setConstant (Index rows, NoChange_t, const Scalar &val)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setZero (Index size)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setZero (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setZero (NoChange_t, Index cols)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setZero (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setOnes (Index size)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setOnes (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setOnes (NoChange_t, Index cols)
 
EIGEN_DEVICE_FUNC Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setOnes (Index rows, NoChange_t)
 
Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setRandom (Index size)
 
Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setRandom (Index rows, Index cols)
 
Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setRandom (NoChange_t, Index cols)
 
Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & setRandom (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap (DenseBase< OtherDerived > &other)
 Override DenseBase::swap() since for dynamic-sized matrices of same type it is enough to swap the data pointers. More...
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap (DenseBase< OtherDerived > const &other)
 const version forwarded to DenseBase::swap More...
 

Protected Attributes

DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Optionsm_storage
 
- Protected Attributes inherited from Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Optionsm_storage
 

Friends

template<typename Derived , typename OtherDerived , bool IsVector>
struct internal::conservative_resize_like_impl
 
template<typename MatrixType , typename OtherDerived , bool SwapPointers>
struct internal::matrix_swap_impl
 

Additional Inherited Members

- Static Public Member Functions inherited from Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
static ConstMapType Map (const Scalar *data)
 
static MapType Map (Scalar *data)
 
static ConstMapType Map (const Scalar *data, Index size)
 
static MapType Map (Scalar *data, Index size)
 
static ConstMapType Map (const Scalar *data, Index rows, Index cols)
 
static MapType Map (Scalar *data, Index rows, Index cols)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static ConstAlignedMapType MapAligned (const Scalar *data)
 
static AlignedMapType MapAligned (Scalar *data)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index size)
 
static AlignedMapType MapAligned (Scalar *data, Index size)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index rows, Index cols)
 
static AlignedMapType MapAligned (Scalar *data, Index rows, Index cols)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
- Protected Member Functions inherited from Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >
constexpr EIGEN_DEVICE_FUNC PlainObjectBaseoperator= (PlainObjectBase &&other) EIGEN_NOEXCEPT
 Move assignment operator. More...
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE PlainObjectBase ()=default
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE PlainObjectBase (PlainObjectBase &&)=default
 Move constructor. More...
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE PlainObjectBase (const PlainObjectBase &)=default
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (Index size, Index rows, Index cols)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
 Construct a row of column vector with fixed size from an arbitrary number of coefficients. More...
 
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (const std::initializer_list< std::initializer_list< Scalar >> &list)
 Constructs a Matrix or Array and initializes it by elements given by an initializer list of initializer lists. More...
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase (const ReturnByValue< OtherDerived > &other)
 Copy constructor with in-place evaluation. More...
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _resize_to_match (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & _set (const DenseBase< OtherDerived > &other)
 Copies the value of the expression other into *this with automatic resizing. More...
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & _set_noalias (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (Index rows, Index cols, std::enable_if_t< Base::SizeAtCompileTime !=2, T0 > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (const T0 &val0, const T1 &val1, std::enable_if_t< Base::SizeAtCompileTime==2, T0 > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (const Index &val0, const Index &val1, std::enable_if_t<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< T0, Index >::value) &&(internal::is_same< T1, Index >::value) &&Base::SizeAtCompileTime==2, T1 > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (Index size, std::enable_if_t<(Base::SizeAtCompileTime !=1||!internal::is_convertible< T, Scalar >::value) &&((!internal::is_same< typename internal::traits< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::XprKind, ArrayXpr >::value||Base::SizeAtCompileTime==Dynamic)), T > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar &val0, std::enable_if_t< Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Index &val0, std::enable_if_t<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T * > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar *data)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const ReturnByValue< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar &val0, std::enable_if_t< Base::SizeAtCompileTime !=Dynamic &&Base::SizeAtCompileTime !=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::XprKind, ArrayXpr >::value, T > *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Index &val0, std::enable_if_t<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime !=Dynamic &&Base::SizeAtCompileTime !=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::XprKind, ArrayXpr >::value, T * > *=0)
 

Detailed Description

template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
class Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >

General-purpose arrays with easy API for coefficient-wise operations.

The Array class is very similar to the Matrix class. It provides general-purpose one- and two-dimensional arrays. The difference between the Array and the Matrix class is primarily in the API: the API for the Array class provides easy access to coefficient-wise operations, while the API for the Matrix class provides easy access to linear-algebra operations.

See documentation of class Matrix for detailed information on the template parameters storage layout.

This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_ARRAY_PLUGIN.

See also
\blank TutorialArrayClass, The class hierarchy

Member Typedef Documentation

◆ Base

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
typedef PlainObjectBase<Array> Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Base

◆ PlainObject

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
typedef Base::PlainObject Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::PlainObject

Member Enumeration Documentation

◆ anonymous enum

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
anonymous enum
Enumerator
Options 
53 { Options = Options_ };
@ Options
Definition: Array.h:53

Constructor & Destructor Documentation

◆ Array() [1/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( )
constexprdefault

Default constructor.

For fixed-size matrices, does nothing.

For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix is called a null matrix. This constructor is the unique way to create null matrices: resizing a matrix to 0 is not supported.

See also
resize(Index,Index)

◆ Array() [2/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > &&  )
constexprdefault

Move constructor.

◆ Array() [3/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename... ArgTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const Scalar a0,
const Scalar a1,
const Scalar a2,
const Scalar a3,
const ArgTypes &...  args 
)
inline

Example:

Array<int, 1, 6> a(1, 2, 3, 4, 5, 6);
Array<int, 3, 1> b{1, 2, 3};
cout << a << "\n\n" << b << endl;
Scalar * b
Definition: benchVecAdd.cpp:17
const Scalar * a
Definition: level2_cplx_impl.h:32

Output:

See also
Array(const std::initializer_list<std::initializer_list<Scalar>>&)
Array(const Scalar&), Array(const Scalar&,const Scalar&)
149  : Base(a0, a1, a2, a3, args...) {}
PlainObjectBase< Array > Base
Definition: Array.h:50
args
Definition: compute_granudrum_aor.py:143

◆ Array() [4/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const std::initializer_list< std::initializer_list< Scalar >> &  list)
inlineconstexpr

Constructs an array and initializes it from the coefficients given as initializer-lists grouped by row. \cpp11.

In the general case, the constructor takes a list of rows, each row being represented as a list of coefficients:

Example:

ArrayXXi a{{1, 2, 3}, {3, 4, 5}};
cout << a << endl;

Output:

Each of the inner initializer lists must contain the exact same number of elements, otherwise an assertion is triggered.

In the case of a compile-time column 1D array, implicit transposition from a single row is allowed. Therefore Array<int,Dynamic,1>{{1,2,3,4,5}} is legal and the more verbose syntax Array<int,Dynamic,1>{{1},{2},{3},{4},{5}} can be avoided:

Example:

Array<int, Dynamic, 1> v{{1, 2, 3, 4, 5}};
cout << v << endl;
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1

Output:

In the case of fixed-sized arrays, the initializer list sizes must exactly match the array sizes, and implicit transposition is allowed for compile-time 1D arrays only.

See also
Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
176  : Base(list) {}

◆ Array() [5/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const T x)
inlineexplicit
180  {
181  Base::template _init1<T>(x);
182  }
list x
Definition: plotDoE.py:28

References plotDoE::x.

◆ Array() [6/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename T0 , typename T1 >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const T0 &  val0,
const T1 &  val1 
)
inline
185  {
186  this->template _init2<T0, T1>(val0, val1);
187  }

◆ Array() [7/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const Scalar val0,
const Scalar val1,
const Scalar val2 
)
inline

constructs an initialized 3D vector with given coefficients

See also
Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
216  {
218  m_storage.data()[0] = val0;
219  m_storage.data()[1] = val1;
220  m_storage.data()[2] = val2;
221  }
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Definition: StaticAssert.h:50
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > m_storage
Definition: PlainObjectBase.h:164
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Array()=default
constexpr EIGEN_DEVICE_FUNC const Scalar * data() const
Definition: PlainObjectBase.h:273

References Eigen::internal::DenseStorage_impl< T, Size, Rows, Cols, Options >::data(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::m_storage.

◆ Array() [8/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const Scalar val0,
const Scalar val1,
const Scalar val2,
const Scalar val3 
)
inline

constructs an initialized 4D vector with given coefficients

See also
Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
226  {
228  m_storage.data()[0] = val0;
229  m_storage.data()[1] = val1;
230  m_storage.data()[2] = val2;
231  m_storage.data()[3] = val3;
232  }

References Eigen::internal::DenseStorage_impl< T, Size, Rows, Cols, Options >::data(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::m_storage.

◆ Array() [9/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > &  )
constexprdefault

Copy constructor

◆ Array() [10/10]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Array ( const EigenBase< OtherDerived > &  other,
std::enable_if_t< internal::is_convertible< typename OtherDerived::Scalar, Scalar >::value, PrivateType = PrivateType() 
)
inline
See also
MatrixBase::operator=(const EigenBase<OtherDerived>&)
247  : Base(other.derived()) {}

Member Function Documentation

◆ base()

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC const Base& Eigen::PlainObjectBase< Derived >::base
inline
189 { return *static_cast<const Base*>(this); }

◆ coeff() [1/2]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Derived >::coeff
inlineconstexpr

This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details.

209  {
210  return m_storage.data()[index];
211  }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE T * data()
Definition: DenseStorage.h:122

◆ coeff() [2/2]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Derived >::coeff
inlineconstexpr

This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details.

198  {
199  if (Flags & RowMajorBit)
200  return m_storage.data()[colId + rowId * m_storage.cols()];
201  else // column-major
202  return m_storage.data()[rowId + colId * m_storage.rows()];
203  }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index cols() const
Definition: DenseStorage.h:120
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Index rows() const
Definition: DenseStorage.h:119
const unsigned int RowMajorBit
Definition: Constants.h:70
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56

◆ coeffRef() [1/4]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::PlainObjectBase< Derived >::coeffRef
inlineconstexpr

This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const for details.

228 { return m_storage.data()[index]; }

◆ coeffRef() [2/4]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Derived >::coeffRef
inlineconstexpr

This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). It is provided for convenience.

241  {
242  return m_storage.data()[index];
243  }

◆ coeffRef() [3/4]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::PlainObjectBase< Derived >::coeffRef
inlineconstexpr

This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const for details.

217  {
218  if (Flags & RowMajorBit)
219  return m_storage.data()[colId + rowId * m_storage.cols()];
220  else // column-major
221  return m_storage.data()[rowId + colId * m_storage.rows()];
222  }

◆ coeffRef() [4/4]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Derived >::coeffRef
inlineconstexpr

This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). It is provided for convenience.

232  {
233  if (Flags & RowMajorBit)
234  return m_storage.data()[colId + rowId * m_storage.cols()];
235  else // column-major
236  return m_storage.data()[rowId + colId * m_storage.rows()];
237  }

◆ innerStride()

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::innerStride ( ) const
inline
249 { return 1; }

◆ operator=() [1/5]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC Array& Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > &&  other)
inline
132  {
133  Base::operator=(std::move(other));
134  return *this;
135  }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived & operator=(const PlainObjectBase &other)
Definition: PlainObjectBase.h:455

References Eigen::PlainObjectBase< Derived >::operator=().

◆ operator=() [2/5]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( const Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > &  other)
inline

Assigns arrays to each other.

Note
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
113 { return Base::_set(other); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition: PlainObjectBase.h:743

References Eigen::PlainObjectBase< Derived >::_set().

◆ operator=() [3/5]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( const DenseBase< OtherDerived > &  other)
inline

Copies the value of the expression other into *this with automatic resizing.

*this might be resized to match the dimensions of other. If *this was a null matrix (not already initialized), it will be initialized.

Note that copying a row-vector into a vector (and conversely) is allowed. The resizing, if any, is then done in the appropriate way so that row-vectors remain row-vectors and vectors remain vectors.

101  {
102  return Base::_set(other);
103  }

References Eigen::PlainObjectBase< Derived >::_set().

◆ operator=() [4/5]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( const EigenBase< OtherDerived > &  other)
inline

The usage of using Base::operator=; fails on MSVC. Since the code below is working with GCC and MSVC, we skipped the usage of 'using'. This should be done only for operator=.

74  {
75  return Base::operator=(other);
76  }

References Eigen::PlainObjectBase< Derived >::operator=().

◆ operator=() [5/5]

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array& Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( const Scalar value)
inline

Set all the entries to value.

See also
DenseBase::setConstant(), DenseBase::fill()
86  {
88  return *this;
89  }
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Definition: CwiseNullaryOp.h:365
squared absolute value
Definition: GlobalFunctions.h:87

References Eigen::PlainObjectBase< Derived >::setConstant(), and Eigen::value.

◆ outerStride()

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::outerStride ( ) const
inline
250 { return this->innerSize(); }

Friends And Related Function Documentation

◆ internal::conservative_resize_like_impl

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename Derived , typename OtherDerived , bool IsVector>
friend struct internal::conservative_resize_like_impl
friend

◆ internal::matrix_swap_impl

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
template<typename MatrixType , typename OtherDerived , bool SwapPointers>
friend struct internal::matrix_swap_impl
friend

Member Data Documentation

◆ m_storage

template<typename Scalar_ , int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> Eigen::PlainObjectBase< Derived >::m_storage
protected

The documentation for this class was generated from the following file: