Eigen  3.3.3
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > Class Template Reference

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:
The Array class and coefficient-wise operations, The class hierarchy
+ Inheritance diagram for Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >:

List of all members.

Public Types

typedef Base::PlainObject PlainObject
 The plain matrix or array type corresponding to this expression.

Public Member Functions

 Array ()
 Array (const Scalar *data)
 Constructs a fixed-sized array initialized with coefficients starting at data.
 Array (Index dim)
 Array (const Scalar &value)
 Array (Index rows, Index cols)
 Array (const Scalar &val0, const Scalar &val1)
 Array (const Scalar &val0, const Scalar &val1, const Scalar &val2)
 Array (const Scalar &val0, const Scalar &val1, const Scalar &val2, const Scalar &val3)
 Array (const Array &other)
template<typename OtherDerived >
 Array (const EigenBase< OtherDerived > &other)
Index innerStride () const
template<typename OtherDerived >
Arrayoperator= (const EigenBase< OtherDerived > &other)
Arrayoperator= (const Scalar &value)
template<typename OtherDerived >
Arrayoperator= (const DenseBase< OtherDerived > &other)
Arrayoperator= (const Array &other)
Index outerStride () const

Member Typedef Documentation

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

The plain matrix or array type corresponding to this expression.

This is not necessarily exactly the return type of eval(). In the case of plain matrices, the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either PlainObject or const PlainObject&.

Reimplemented from Eigen::DenseBase< Derived >.


Constructor & Destructor Documentation

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( ) [inline]

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)
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( Index  dim) [inline, explicit]

Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.

Note that this is only useful for dynamic-size vectors. For fixed-size vectors, it is redundant to pass the dimension here, so it makes more sense to use the default constructor Array() instead.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( const Scalar value)

constructs an initialized 1x1 Array with the given coefficient

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( Index  rows,
Index  cols 
)

constructs an uninitialized array with rows rows and cols columns.

This is useful for dynamic-size arrays. For fixed-size arrays, it is redundant to pass these parameters, so one should use the default constructor Array() instead.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( const Scalar val0,
const Scalar val1 
)

constructs an initialized 2D vector with given coefficients

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
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

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
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

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( const Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  other) [inline]

Copy constructor

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Array ( const EigenBase< OtherDerived > &  other) [inline]

Member Function Documentation

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Index Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::innerStride ( ) const [inline]
Returns:
the pointer increment between two consecutive elements within a slice in the inner direction.
See also:
outerStride(), rowStride(), colStride()

Reimplemented from Eigen::DenseCoeffsBase< Derived, DirectWriteAccessors >.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
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=.

Reimplemented from Eigen::PlainObjectBase< Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
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()

Reimplemented from Eigen::ArrayBase< Derived >.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
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.

Reimplemented from Eigen::DenseBase< Derived >.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Array& Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  other) [inline]

This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
Index Eigen::Array< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::outerStride ( ) const [inline]
Returns:
the pointer increment between two consecutive inner slices (for example, between two consecutive columns in a column-major matrix).
See also:
innerStride(), rowStride(), colStride()

Reimplemented from Eigen::DenseCoeffsBase< Derived, DirectWriteAccessors >.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends