mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 19:29:02 +08:00
Improved docs of PlainObjectBase::conservativeResize methods.
This commit is contained in:
parent
bb9a465c5a
commit
2064c59878
@ -287,33 +287,47 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
else resize(other.rows(), other.cols());
|
else resize(other.rows(), other.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resizes \c *this to a \a rows x \a cols matrix while leaving old values of \c *this untouched.
|
/** Resizes the matrix to \a rows x \a cols while leaving old values untouched.
|
||||||
*
|
*
|
||||||
* This method is intended for dynamic-size matrices. If you only want to change the number
|
* 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),
|
* of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or
|
||||||
* conservativeResize(Index, NoChange_t).
|
* conservativeResize(Index, NoChange_t).
|
||||||
*
|
*
|
||||||
* The top-left part of the resized matrix will be the same as the overlapping top-left corner
|
* Matrices are resized relative to the top-left element. In case values need to be
|
||||||
* of \c *this. In case values need to be appended to the matrix they will be uninitialized.
|
* appended to the matrix they will be uninitialized.
|
||||||
*/
|
*/
|
||||||
EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols)
|
EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols)
|
||||||
{
|
{
|
||||||
internal::conservative_resize_like_impl<Derived>::run(*this, rows, cols);
|
internal::conservative_resize_like_impl<Derived>::run(*this, rows, cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the matrix to \a rows x \a 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.
|
||||||
|
*/
|
||||||
EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t)
|
EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t)
|
||||||
{
|
{
|
||||||
// Note: see the comment in conservativeResize(Index,Index)
|
// Note: see the comment in conservativeResize(Index,Index)
|
||||||
conservativeResize(rows, cols());
|
conservativeResize(rows, cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the matrix to \a rows x \a 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.
|
||||||
|
*/
|
||||||
EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols)
|
EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols)
|
||||||
{
|
{
|
||||||
// Note: see the comment in conservativeResize(Index,Index)
|
// Note: see the comment in conservativeResize(Index,Index)
|
||||||
conservativeResize(rows(), cols);
|
conservativeResize(rows(), cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resizes \c *this to a vector of length \a size while retaining old values of *this.
|
/** Resizes the vector to \a size while retaining old values.
|
||||||
*
|
*
|
||||||
* \only_for_vectors. This method does not work for
|
* \only_for_vectors. This method does not work for
|
||||||
* partially dynamic matrices when the static dimension is anything other
|
* partially dynamic matrices when the static dimension is anything other
|
||||||
@ -326,6 +340,15 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
internal::conservative_resize_like_impl<Derived>::run(*this, size);
|
internal::conservative_resize_like_impl<Derived>::run(*this, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the matrix to \a rows x \a cols of \c 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 \c other.
|
||||||
|
*/
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase<OtherDerived>& other)
|
EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user