Dense storage base class for matrices and arrays. More...
#include <DenseStorageBase.h>
Public Types | |
enum | { Options = ei_traits<Derived>::Options } |
enum | { NeedsToAlign } |
typedef ei_dense_xpr_base < Derived >::type | Base |
typedef ei_traits< Derived > ::StorageKind | StorageKind |
typedef ei_traits< Derived >::Index | Index |
typedef ei_traits< Derived > ::Scalar | Scalar |
typedef ei_packet_traits < Scalar >::type | PacketScalar |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef class Eigen::Map < Derived, Unaligned > | UnalignedMapType |
typedef class Eigen::Map < Derived, Aligned > | AlignedMapType |
Public Member Functions | |
Base & | base () |
const Base & | base () const |
EIGEN_STRONG_INLINE Index | rows () const |
EIGEN_STRONG_INLINE Index | cols () const |
EIGEN_STRONG_INLINE const Scalar & | coeff (Index row, Index col) const |
EIGEN_STRONG_INLINE const Scalar & | coeff (Index index) const |
EIGEN_STRONG_INLINE Scalar & | coeffRef (Index row, Index col) |
EIGEN_STRONG_INLINE Scalar & | coeffRef (Index index) |
template<int LoadMode> | |
EIGEN_STRONG_INLINE PacketScalar | packet (Index row, Index col) const |
template<int LoadMode> | |
EIGEN_STRONG_INLINE PacketScalar | packet (Index index) const |
template<int StoreMode> | |
EIGEN_STRONG_INLINE void | writePacket (Index row, Index col, const PacketScalar &x) |
template<int StoreMode> | |
EIGEN_STRONG_INLINE void | writePacket (Index index, const PacketScalar &x) |
EIGEN_STRONG_INLINE const Scalar * | data () const |
EIGEN_STRONG_INLINE Scalar * | data () |
EIGEN_STRONG_INLINE void | resize (Index rows, Index cols) |
void | resize (Index size) |
void | resize (NoChange_t, Index cols) |
void | resize (Index rows, NoChange_t) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE void | resizeLike (const EigenBase< OtherDerived > &_other) |
EIGEN_STRONG_INLINE void | conservativeResize (Index rows, Index cols) |
EIGEN_STRONG_INLINE void | conservativeResize (Index rows, NoChange_t) |
EIGEN_STRONG_INLINE void | conservativeResize (NoChange_t, Index cols) |
EIGEN_STRONG_INLINE void | conservativeResize (Index size) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE void | conservativeResizeLike (const DenseBase< OtherDerived > &other) |
EIGEN_STRONG_INLINE Derived & | operator= (const DenseStorageBase &other) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | lazyAssign (const DenseBase< OtherDerived > &other) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | operator= (const ReturnByValue< OtherDerived > &func) |
EIGEN_STRONG_INLINE | DenseStorageBase () |
DenseStorageBase (ei_constructor_without_unaligned_array_assert) | |
EIGEN_STRONG_INLINE | DenseStorageBase (Index size, Index rows, Index cols) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | operator= (const EigenBase< OtherDerived > &other) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE | DenseStorageBase (const EigenBase< OtherDerived > &other) |
Derived & | setConstant (Index size, const Scalar &value) |
Derived & | setConstant (Index rows, Index cols, const Scalar &value) |
Derived & | setZero (Index size) |
Derived & | setZero (Index rows, Index cols) |
Derived & | setOnes (Index size) |
Derived & | setOnes (Index rows, Index cols) |
Derived & | setRandom (Index size) |
Derived & | setRandom (Index rows, Index cols) |
Static Public Member Functions | |
static EIGEN_STRONG_INLINE void | _check_template_params () |
Map | |
These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects, while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned data pointers. These methods do not allow to specify strides. If you need to specify strides, you have to use the Map class directly.
| |
static const UnalignedMapType | Map (const Scalar *data) |
static UnalignedMapType | Map (Scalar *data) |
static const UnalignedMapType | Map (const Scalar *data, Index size) |
static UnalignedMapType | Map (Scalar *data, Index size) |
static const UnalignedMapType | Map (const Scalar *data, Index rows, Index cols) |
static UnalignedMapType | Map (Scalar *data, Index rows, Index cols) |
static const AlignedMapType | MapAligned (const Scalar *data) |
static AlignedMapType | MapAligned (Scalar *data) |
static const AlignedMapType | MapAligned (const Scalar *data, Index size) |
static AlignedMapType | MapAligned (Scalar *data, Index size) |
static const AlignedMapType | MapAligned (const Scalar *data, Index rows, Index cols) |
static AlignedMapType | MapAligned (Scalar *data, Index rows, Index cols) |
Protected Member Functions | |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE void | _resize_to_match (const EigenBase< OtherDerived > &other) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | _set (const DenseBase< OtherDerived > &other) |
Copies the value of the expression other into *this with automatic resizing. | |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE void | _set_selector (const OtherDerived &other, const ei_meta_true &) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE void | _set_selector (const OtherDerived &other, const ei_meta_false &) |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | _set_noalias (const DenseBase< OtherDerived > &other) |
template<typename T0 , typename T1 > | |
EIGEN_STRONG_INLINE void | _init2 (Index rows, Index cols, typename ei_enable_if< Base::SizeAtCompileTime!=2, T0 >::type *=0) |
template<typename T0 , typename T1 > | |
EIGEN_STRONG_INLINE void | _init2 (const Scalar &x, const Scalar &y, typename ei_enable_if< Base::SizeAtCompileTime==2, T0 >::type *=0) |
template<typename OtherDerived > | |
void | _swap (DenseBase< OtherDerived > EIGEN_REF_TO_TEMPORARY other) |
Protected Attributes | |
ei_matrix_storage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > | m_storage |
Friends | |
class | Eigen::Map< Derived, Unaligned > |
class | Eigen::Map< Derived, Aligned > |
struct | ei_matrix_swap_impl |
Dense storage base class for matrices and arrays.
typedef class Eigen::Map< Derived, Aligned > DenseStorageBase< Derived >::AlignedMapType |
typedef ei_dense_xpr_base<Derived>::type DenseStorageBase< Derived >::Base |
typedef ei_traits<Derived>::Index DenseStorageBase< Derived >::Index |
typedef ei_packet_traits<Scalar>::type DenseStorageBase< Derived >::PacketScalar |
typedef NumTraits<Scalar>::Real DenseStorageBase< Derived >::RealScalar |
typedef ei_traits<Derived>::Scalar DenseStorageBase< Derived >::Scalar |
typedef ei_traits<Derived>::StorageKind DenseStorageBase< Derived >::StorageKind |
typedef class Eigen::Map< Derived, Unaligned > DenseStorageBase< Derived >::UnalignedMapType |
EIGEN_STRONG_INLINE DenseStorageBase< Derived >::DenseStorageBase | ( | ) | [inline, explicit] |
DenseStorageBase< Derived >::DenseStorageBase | ( | ei_constructor_without_unaligned_array_assert | ) | [inline] |
EIGEN_STRONG_INLINE DenseStorageBase< Derived >::DenseStorageBase | ( | Index | size, | |
Index | rows, | |||
Index | cols | |||
) | [inline] |
EIGEN_STRONG_INLINE DenseStorageBase< Derived >::DenseStorageBase | ( | const EigenBase< OtherDerived > & | other | ) | [inline] |
static EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_check_template_params | ( | ) | [inline, static] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_init2 | ( | Index | rows, | |
Index | cols, | |||
typename ei_enable_if< Base::SizeAtCompileTime!=2, T0 >::type * | = 0 | |||
) | [inline, protected] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_init2 | ( | const Scalar & | x, | |
const Scalar & | y, | |||
typename ei_enable_if< Base::SizeAtCompileTime==2, T0 >::type * | = 0 | |||
) | [inline, protected] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_resize_to_match | ( | const EigenBase< OtherDerived > & | other | ) | [inline, protected] |
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::_set | ( | const DenseBase< OtherDerived > & | other | ) | [inline, protected] |
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.
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::_set_noalias | ( | const DenseBase< OtherDerived > & | other | ) | [inline, protected] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_set_selector | ( | const OtherDerived & | other, | |
const ei_meta_false & | ||||
) | [inline, protected] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::_set_selector | ( | const OtherDerived & | other, | |
const ei_meta_true & | ||||
) | [inline, protected] |
void DenseStorageBase< Derived >::_swap | ( | DenseBase< OtherDerived > EIGEN_REF_TO_TEMPORARY | other | ) | [inline, protected] |
const Base& DenseStorageBase< Derived >::base | ( | ) | const [inline] |
Base& DenseStorageBase< Derived >::base | ( | ) | [inline] |
EIGEN_STRONG_INLINE const Scalar& DenseStorageBase< Derived >::coeff | ( | Index | row, | |
Index | col | |||
) | const [inline] |
EIGEN_STRONG_INLINE const Scalar& DenseStorageBase< Derived >::coeff | ( | Index | index | ) | const [inline] |
EIGEN_STRONG_INLINE Scalar& DenseStorageBase< Derived >::coeffRef | ( | Index | index | ) | [inline] |
EIGEN_STRONG_INLINE Scalar& DenseStorageBase< Derived >::coeffRef | ( | Index | row, | |
Index | col | |||
) | [inline] |
EIGEN_STRONG_INLINE Index DenseStorageBase< Derived >::cols | ( | void | ) | const [inline] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::conservativeResize | ( | Index | rows, | |
Index | cols | |||
) | [inline] |
Resizes *this
to a rows x cols matrix while leaving old values of *this
untouched.
This method is intended for dynamic-size matrices. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index), conservativeResize(Index, NoChange_t).
The top-left part of the resized matrix will be the same as the overlapping top-left corner of *this
. In case values need to be appended to the matrix they will be uninitialized.
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::conservativeResize | ( | Index | rows, | |
NoChange_t | ||||
) | [inline] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::conservativeResize | ( | NoChange_t | , | |
Index | cols | |||
) | [inline] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::conservativeResize | ( | Index | size | ) | [inline] |
Resizes *this
to a vector of length size while retaining old values of *this.
. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.
When values are appended, they will be uninitialized.
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::conservativeResizeLike | ( | const DenseBase< OtherDerived > & | other | ) | [inline] |
EIGEN_STRONG_INLINE const Scalar* DenseStorageBase< Derived >::data | ( | ) | const [inline] |
EIGEN_STRONG_INLINE Scalar* DenseStorageBase< Derived >::data | ( | ) | [inline] |
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::lazyAssign | ( | const DenseBase< OtherDerived > & | other | ) | [inline] |
static UnalignedMapType DenseStorageBase< Derived >::Map | ( | Scalar * | data, | |
Index | size | |||
) | [inline, static] |
static const UnalignedMapType DenseStorageBase< Derived >::Map | ( | const Scalar * | data, | |
Index | rows, | |||
Index | cols | |||
) | [inline, static] |
static UnalignedMapType DenseStorageBase< Derived >::Map | ( | Scalar * | data, | |
Index | rows, | |||
Index | cols | |||
) | [inline, static] |
static const UnalignedMapType DenseStorageBase< Derived >::Map | ( | const Scalar * | data | ) | [inline, static] |
static UnalignedMapType DenseStorageBase< Derived >::Map | ( | Scalar * | data | ) | [inline, static] |
static const UnalignedMapType DenseStorageBase< Derived >::Map | ( | const Scalar * | data, | |
Index | size | |||
) | [inline, static] |
static const AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | const Scalar * | data, | |
Index | rows, | |||
Index | cols | |||
) | [inline, static] |
static AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | Scalar * | data | ) | [inline, static] |
static const AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | const Scalar * | data, | |
Index | size | |||
) | [inline, static] |
static AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | Scalar * | data, | |
Index | size | |||
) | [inline, static] |
static AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | Scalar * | data, | |
Index | rows, | |||
Index | cols | |||
) | [inline, static] |
static const AlignedMapType DenseStorageBase< Derived >::MapAligned | ( | const Scalar * | data | ) | [inline, static] |
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::operator= | ( | const ReturnByValue< OtherDerived > & | func | ) | [inline] |
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::operator= | ( | const DenseStorageBase< Derived > & | other | ) | [inline] |
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
EIGEN_STRONG_INLINE Derived& DenseStorageBase< Derived >::operator= | ( | const EigenBase< OtherDerived > & | other | ) | [inline] |
Copies the generic expression other into *this.
The expression must provide a (templated) evalTo(Derived& dst) const function which does the actual job. In practice, this allows any user to write its own special matrix without having to modify MatrixBase
EIGEN_STRONG_INLINE PacketScalar DenseStorageBase< Derived >::packet | ( | Index | index | ) | const [inline] |
EIGEN_STRONG_INLINE PacketScalar DenseStorageBase< Derived >::packet | ( | Index | row, | |
Index | col | |||
) | const [inline] |
void DenseStorageBase< Derived >::resize | ( | Index | size | ) | [inline] |
Resizes *this
to a vector of length size
. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.
Example:
Output:
void DenseStorageBase< Derived >::resize | ( | NoChange_t | , | |
Index | cols | |||
) | [inline] |
Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value NoChange
as in the example below.
Example:
Output:
void DenseStorageBase< Derived >::resize | ( | Index | rows, | |
NoChange_t | ||||
) | [inline] |
Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value NoChange
as in the example below.
Example:
Output:
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::resize | ( | Index | rows, | |
Index | cols | |||
) | [inline] |
Resizes *this
to a rows x cols matrix.
This method is intended for dynamic-size matrices, although it is legal to call it on any matrix as long as fixed dimensions are left unchanged. If you only want to change the number of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).
If the current number of coefficients of *this
exactly matches the product rows * cols, then no memory allocation is performed and the current values are left unchanged. In all other cases, including shrinking, the data is reallocated and all previous values are lost.
Example:
Output:
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::resizeLike | ( | const EigenBase< OtherDerived > & | _other | ) | [inline] |
Resizes *this
to have the same dimensions as other. Takes care of doing all the checking that's needed.
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.
EIGEN_STRONG_INLINE Index DenseStorageBase< Derived >::rows | ( | void | ) | const [inline] |
Derived& DenseStorageBase< Derived >::setConstant | ( | Index | rows, | |
Index | cols, | |||
const Scalar & | value | |||
) |
Derived& DenseStorageBase< Derived >::setConstant | ( | Index | size, | |
const Scalar & | value | |||
) |
Derived& DenseStorageBase< Derived >::setOnes | ( | Index | rows, | |
Index | cols | |||
) |
Derived& DenseStorageBase< Derived >::setOnes | ( | Index | size | ) |
Derived& DenseStorageBase< Derived >::setRandom | ( | Index | size | ) |
Derived& DenseStorageBase< Derived >::setRandom | ( | Index | rows, | |
Index | cols | |||
) |
Derived& DenseStorageBase< Derived >::setZero | ( | Index | size | ) |
Derived& DenseStorageBase< Derived >::setZero | ( | Index | rows, | |
Index | cols | |||
) |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::writePacket | ( | Index | row, | |
Index | col, | |||
const PacketScalar & | x | |||
) | [inline] |
EIGEN_STRONG_INLINE void DenseStorageBase< Derived >::writePacket | ( | Index | index, | |
const PacketScalar & | x | |||
) | [inline] |
friend struct ei_matrix_swap_impl [friend] |
friend class Eigen::Map< Derived, Aligned > [friend] |
friend class Eigen::Map< Derived, Unaligned > [friend] |
ei_matrix_storage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> DenseStorageBase< Derived >::m_storage [protected] |