Dense storage base class for matrices and arrays. More...
Classes | |
struct | StridedAlignedMapType |
struct | StridedConstAlignedMapType |
struct | StridedConstMapType |
struct | StridedMapType |
Public Types | |
enum | { Options } |
enum | { NeedsToAlign } |
typedef Eigen::Map< Derived, AlignedMax > | AlignedMapType |
typedef internal::dense_xpr_base< Derived >::type | Base |
typedef const Eigen::Map< const Derived, AlignedMax > | ConstAlignedMapType |
typedef const Eigen::Map< const Derived, Unaligned > | ConstMapType |
typedef Derived | DenseType |
typedef Eigen::Map< Derived, Unaligned > | MapType |
typedef internal::packet_traits< Scalar >::type | PacketScalar |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef internal::traits< Derived >::Scalar | Scalar |
typedef internal::traits< Derived >::StorageKind | StorageKind |
Public Member Functions | |
const Base & | base () const |
const Scalar & | coeff (Index index) const |
constexpr const Scalar & | coeff (Index rowId, Index colId) const |
constexpr Scalar & | coeffRef (Index index) |
constexpr const Scalar & | coeffRef (Index index) const |
constexpr Scalar & | coeffRef (Index rowId, Index colId) |
constexpr const Scalar & | coeffRef (Index rowId, Index colId) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
void | conservativeResize (Index rows, Index cols) |
void | conservativeResize (Index rows, NoChange_t) |
void | conservativeResize (Index size) |
void | conservativeResize (NoChange_t, Index cols) |
template<typename OtherDerived > | |
void | conservativeResizeLike (const DenseBase< OtherDerived > &other) |
Scalar * | data () |
const Scalar * | data () const |
EIGEN_STATIC_ASSERT (internal::check_implication(MaxRowsAtCompileTime==1 &&MaxColsAtCompileTime!=1,(int(Options)&RowMajor)==RowMajor), INVALID_MATRIX_TEMPLATE_PARAMETERS) EIGEN_STATIC_ASSERT(internal | |
template<typename OtherDerived > | |
Derived & | lazyAssign (const DenseBase< OtherDerived > &other) |
template<typename OtherDerived > | |
Derived & | operator= (const EigenBase< OtherDerived > &other) |
Copies the generic expression other into *this. More... | |
Derived & | operator= (const PlainObjectBase &other) |
template<typename OtherDerived > | |
Derived & | operator= (const ReturnByValue< OtherDerived > &func) |
template<int LoadMode> | |
PacketScalar | packet (Index index) const |
template<int LoadMode> | |
PacketScalar | packet (Index rowId, Index colId) const |
constexpr void | resize (Index rows, Index cols) |
constexpr void | resize (Index rows, NoChange_t) |
constexpr void | resize (Index size) |
constexpr void | resize (NoChange_t, Index cols) |
template<typename OtherDerived > | |
void | resizeLike (const EigenBase< OtherDerived > &_other) |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
Derived & | setConstant (Index rows, Index cols, const Scalar &val) |
Derived & | setConstant (Index rows, NoChange_t, const Scalar &val) |
Derived & | setConstant (Index size, const Scalar &val) |
Derived & | setConstant (NoChange_t, Index cols, const Scalar &val) |
Derived & | setOnes (Index rows, Index cols) |
Derived & | setOnes (Index rows, NoChange_t) |
Derived & | setOnes (Index size) |
Derived & | setOnes (NoChange_t, Index cols) |
Derived & | setRandom (Index rows, Index cols) |
Derived & | setRandom (Index rows, NoChange_t) |
Derived & | setRandom (Index size) |
Derived & | setRandom (NoChange_t, Index cols) |
Derived & | setZero (Index rows, Index cols) |
Derived & | setZero (Index rows, NoChange_t) |
Derived & | setZero (Index size) |
Derived & | setZero (NoChange_t, Index cols) |
template<int StoreMode> | |
void | writePacket (Index index, const PacketScalar &val) |
template<int StoreMode> | |
void | writePacket (Index rowId, Index colId, const PacketScalar &val) |
Static Public Member Functions | |
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. Here is an example using strides: A << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12,
13, 14, 15, 16;
std::cout << Matrix2i::Map(&A(1,1),Stride<8,2>()) << std::endl;
Output: 6 8 14 16
| |
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 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) |
template<int Outer, int Inner> | |
static StridedConstMapType< Stride< Outer, Inner > >::type | Map (const Scalar *data, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedMapType< Stride< Outer, Inner > >::type | Map (Scalar *data, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedConstMapType< Stride< Outer, Inner > >::type | Map (const Scalar *data, Index size, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedMapType< Stride< Outer, Inner > >::type | Map (Scalar *data, Index size, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedConstMapType< Stride< Outer, Inner > >::type | Map (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedMapType< Stride< Outer, Inner > >::type | Map (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (const Scalar *data, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (Scalar *data, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (const Scalar *data, Index size, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (Scalar *data, Index size, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride) |
template<int Outer, int Inner> | |
static StridedAlignedMapType< Stride< Outer, Inner > >::type | MapAligned (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride) |
Protected Member Functions | |
template<typename T , typename OtherDerived > | |
void | _init1 (const DenseBase< OtherDerived > &other) |
template<typename T > | |
void | _init1 (const Derived &other) |
template<typename T , typename OtherDerived > | |
void | _init1 (const EigenBase< OtherDerived > &other) |
template<typename T > | |
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< Derived >::XprKind, ArrayXpr >::value, T * > *=0) |
template<typename T > | |
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) |
template<typename T , typename OtherDerived > | |
void | _init1 (const ReturnByValue< OtherDerived > &other) |
template<typename T , typename OtherDerived , int ColsAtCompileTime> | |
void | _init1 (const RotationBase< OtherDerived, ColsAtCompileTime > &r) |
template<typename T > | |
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< Derived >::XprKind, ArrayXpr >::value, T > *=0) |
template<typename T > | |
void | _init1 (const Scalar &val0, std::enable_if_t< Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T > *=0) |
template<typename T > | |
void | _init1 (const Scalar *data) |
template<typename T > | |
void | _init1 (Index size, std::enable_if_t<(Base::SizeAtCompileTime!=1||!internal::is_convertible< T, Scalar >::value) &&((!internal::is_same< typename internal::traits< Derived >::XprKind, ArrayXpr >::value||Base::SizeAtCompileTime==Dynamic)), T > *=0) |
template<typename T0 , typename T1 > | |
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) |
template<typename T0 , typename T1 > | |
void | _init2 (const T0 &val0, const T1 &val1, std::enable_if_t< Base::SizeAtCompileTime==2, T0 > *=0) |
template<typename T0 , typename T1 > | |
void | _init2 (Index rows, Index cols, std::enable_if_t< Base::SizeAtCompileTime!=2, T0 > *=0) |
template<typename OtherDerived > | |
void | _resize_to_match (const EigenBase< OtherDerived > &other) |
template<typename OtherDerived > | |
Derived & | _set (const DenseBase< OtherDerived > &other) |
Copies the value of the expression other into *this with automatic resizing. More... | |
template<typename OtherDerived > | |
Derived & | _set_noalias (const DenseBase< OtherDerived > &other) |
PlainObjectBase & | operator= (PlainObjectBase &&other) EIGEN_NOEXCEPT |
PlainObjectBase () | |
template<typename OtherDerived > | |
PlainObjectBase (const DenseBase< OtherDerived > &other) | |
template<typename OtherDerived > | |
PlainObjectBase (const EigenBase< OtherDerived > &other) | |
PlainObjectBase (const PlainObjectBase &other) | |
template<typename OtherDerived > | |
PlainObjectBase (const ReturnByValue< OtherDerived > &other) | |
Copy constructor with in-place evaluation. More... | |
template<typename... ArgTypes> | |
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 | 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... | |
PlainObjectBase (Index size, Index rows, Index cols) | |
PlainObjectBase (PlainObjectBase &&other) EIGEN_NOEXCEPT | |
Protected Attributes | |
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > | m_storage |
Dense storage base class for matrices and arrays.
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_PLAINOBJECTBASE_PLUGIN
.
Definition at line 111 of file PlainObjectBase.h.
typedef Eigen::Map<Derived, AlignedMax> Eigen::PlainObjectBase< Derived >::AlignedMapType |
Definition at line 139 of file PlainObjectBase.h.
typedef internal::dense_xpr_base<Derived>::type Eigen::PlainObjectBase< Derived >::Base |
Definition at line 119 of file PlainObjectBase.h.
typedef const Eigen::Map<const Derived, AlignedMax> Eigen::PlainObjectBase< Derived >::ConstAlignedMapType |
Definition at line 140 of file PlainObjectBase.h.
typedef const Eigen::Map<const Derived, Unaligned> Eigen::PlainObjectBase< Derived >::ConstMapType |
Definition at line 138 of file PlainObjectBase.h.
typedef Derived Eigen::PlainObjectBase< Derived >::DenseType |
Definition at line 126 of file PlainObjectBase.h.
typedef Eigen::Map<Derived, Unaligned> Eigen::PlainObjectBase< Derived >::MapType |
Definition at line 137 of file PlainObjectBase.h.
typedef internal::packet_traits<Scalar>::type Eigen::PlainObjectBase< Derived >::PacketScalar |
Definition at line 124 of file PlainObjectBase.h.
typedef NumTraits<Scalar>::Real Eigen::PlainObjectBase< Derived >::RealScalar |
Definition at line 125 of file PlainObjectBase.h.
typedef internal::traits<Derived>::Scalar Eigen::PlainObjectBase< Derived >::Scalar |
Definition at line 122 of file PlainObjectBase.h.
typedef internal::traits<Derived>::StorageKind Eigen::PlainObjectBase< Derived >::StorageKind |
Definition at line 121 of file PlainObjectBase.h.
anonymous enum |
anonymous enum |
|
inlineprotected |
Definition at line 481 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 498 of file PlainObjectBase.h.
|
inlineprotected |
Copy constructor
Definition at line 512 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 515 of file PlainObjectBase.h.
|
inlineprotected |
Construct a row of column vector with fixed size from an arbitrary number of coefficients.
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.
This constructor is for 1D array or vectors with more than 4 coefficients.
*this
. Definition at line 532 of file PlainObjectBase.h.
|
inlineexplicitconstexprprotected |
Constructs a Matrix or Array and initializes it by elements given by an initializer list of initializer lists.
Definition at line 548 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 584 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 594 of file PlainObjectBase.h.
|
inlineprotected |
|
inlineprotected |
Definition at line 872 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 879 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 886 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 920 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 852 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 892 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 900 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 908 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 843 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 865 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 829 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 814 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 805 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 795 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 739 of file PlainObjectBase.h.
|
inlineprotected |
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.
Definition at line 769 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 782 of file PlainObjectBase.h.
|
inline |
Definition at line 166 of file PlainObjectBase.h.
|
inline |
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.
Definition at line 189 of file PlainObjectBase.h.
|
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.
Definition at line 177 of file PlainObjectBase.h.
|
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.
Definition at line 209 of file PlainObjectBase.h.
|
inlineconstexpr |
This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). It is provided for convenience.
Definition at line 222 of file PlainObjectBase.h.
|
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.
Definition at line 198 of file PlainObjectBase.h.
|
inlineconstexpr |
This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). It is provided for convenience.
Definition at line 213 of file PlainObjectBase.h.
|
inline |
Definition at line 171 of file PlainObjectBase.h.
|
inline |
Resizes the matrix to rows x cols while leaving old values untouched.
The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).
Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will be uninitialized.
Definition at line 387 of file PlainObjectBase.h.
|
inline |
Resizes the matrix to rows x cols while leaving old values untouched.
As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of columns unchanged.
In case the matrix is growing, new rows will be uninitialized.
Definition at line 400 of file PlainObjectBase.h.
|
inline |
Resizes the vector to size while retaining old values.
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.. 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.
Definition at line 429 of file PlainObjectBase.h.
|
inline |
Resizes the matrix to rows x cols while leaving old values untouched.
As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of rows unchanged.
In case the matrix is growing, new columns will be uninitialized.
Definition at line 414 of file PlainObjectBase.h.
|
inline |
Resizes the matrix to rows x cols of other
, while leaving old values untouched.
The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).
Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will copied from other
.
Definition at line 445 of file PlainObjectBase.h.
|
inline |
|
inline |
Definition at line 261 of file PlainObjectBase.h.
|
inline |
Definition at line 153 of file PlainObjectBase.h.
|
inline |
Definition at line 462 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 636 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 663 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 644 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 675 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 640 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 669 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 638 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 666 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 678 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 642 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 672 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 649 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 682 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 657 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 694 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 653 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 688 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 651 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 685 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 659 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 697 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 655 of file PlainObjectBase.h.
|
inlinestatic |
Definition at line 691 of file PlainObjectBase.h.
|
inline |
Copies the generic expression other into *this.
Implementation of matrix base methods
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
Definition at line 617 of file PlainObjectBase.h.
|
inline |
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
Definition at line 454 of file PlainObjectBase.h.
|
inline |
Definition at line 470 of file PlainObjectBase.h.
|
inlineprotected |
Definition at line 504 of file PlainObjectBase.h.
|
inline |
Definition at line 238 of file PlainObjectBase.h.
|
inline |
Definition at line 228 of file PlainObjectBase.h.
|
inlineconstexpr |
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:
here's the 2x3 matrix m: 1 2 3 4 5 6 let's resize m to 3x2. This is a conservative resizing because 2*3==3*2. here's the 3x2 matrix m: 1 5 4 3 2 6 now let's resize m to size 2x2. This is NOT a conservative resizing, so it becomes uninitialized: 0 0 0 0
Definition at line 284 of file PlainObjectBase.h.
|
inlineconstexpr |
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:
m: 5 rows, 4 cols
Definition at line 348 of file PlainObjectBase.h.
|
inlineconstexpr |
Resizes *this
to a vector of length size
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.. 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:
v: 3 rows, 1 cols w: 1 rows, 3 cols
Definition at line 312 of file PlainObjectBase.h.
|
inlineconstexpr |
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:
m: 3 rows, 5 cols
Definition at line 338 of file PlainObjectBase.h.
|
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.
Definition at line 359 of file PlainObjectBase.h.
|
inline |
Definition at line 169 of file PlainObjectBase.h.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to the given value val.
rows | the new number of rows |
cols | the new number of columns |
val | the value to which all coefficients are set |
Example:
Output:
5 5 5 5 5 5 5 5 5
Definition at line 396 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of rows, and sets all coefficients in this expression to the given value val. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 423 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to the given value val.
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.
Example:
Output:
5 5 5
Definition at line 377 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of columns, and sets all coefficients in this expression to the given value val. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 410 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to one.
rows | the new number of rows |
cols | the new number of columns |
Example:
Output:
1 1 1 1 1 1 1 1 1
Definition at line 761 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of rows, and sets all coefficients in this expression to one. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 775 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given newSize, and sets all coefficients in this expression to one.
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.
Example:
Output:
1 1 1
Definition at line 743 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of columns, and sets all coefficients in this expression to one. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 788 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to random values.
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
rows | the new number of rows |
cols | the new number of columns |
Example:
Output:
0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444
Definition at line 175 of file Random.h.
|
inline |
Resizes to the given size, changing only the number of rows, and sets all coefficients in this expression to random values. For the parameter of type NoChange_t, just pass the special value NoChange
.
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
|
inline |
Resizes to the given newSize, and sets all coefficients in this expression to random values.
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
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.
Example:
Output:
0.68 -0.211 0.566
|
inline |
Resizes to the given size, changing only the number of columns, and sets all coefficients in this expression to random values. For the parameter of type NoChange_t, just pass the special value NoChange
.
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to zero.
rows | the new number of rows |
cols | the new number of columns |
Example:
Output:
0 0 0 0 0 0 0 0 0
Definition at line 609 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of rows, and sets all coefficients in this expression to zero. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 636 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, and sets all coefficients in this expression to zero.
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.
Example:
Output:
0 0 0
Definition at line 591 of file CwiseNullaryOp.h.
|
inline |
Resizes to the given size, changing only the number of columns, and sets all coefficients in this expression to zero. For the parameter of type NoChange_t, just pass the special value NoChange
.
Definition at line 623 of file CwiseNullaryOp.h.
|
inline |
Definition at line 255 of file PlainObjectBase.h.
|
inline |
Definition at line 245 of file PlainObjectBase.h.
|
protected |
Definition at line 147 of file PlainObjectBase.h.