mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-03 11:45:12 +08:00
Add the following functions
DenseBase::setConstant(NoChange_t, Index, const Scalar&) DenseBase::setConstant(Index, NoChange_t, const Scalar&) to close #663.
This commit is contained in:
parent
598e1b6e54
commit
170a504c2f
@ -383,6 +383,33 @@ PlainObjectBase<Derived>::setConstant(Index rows, Index cols, const Scalar& val)
|
|||||||
return setConstant(val);
|
return setConstant(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes to the given size, changing only the number of columns, and sets all
|
||||||
|
* coefficients in this expression to the given value \a val. For the parameter
|
||||||
|
* of type NoChange_t, just pass the special value \c NoChange.
|
||||||
|
*
|
||||||
|
* \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
|
||||||
|
*/
|
||||||
|
template<typename Derived>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
|
||||||
|
PlainObjectBase<Derived>::setConstant(NoChange_t, Index cols, const Scalar& val)
|
||||||
|
{
|
||||||
|
return setConstant(rows(), cols, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Resizes to the given size, changing only the number of rows, and sets all
|
||||||
|
* coefficients in this expression to the given value \a val. For the parameter
|
||||||
|
* of type NoChange_t, just pass the special value \c NoChange.
|
||||||
|
*
|
||||||
|
* \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
|
||||||
|
*/
|
||||||
|
template<typename Derived>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
|
||||||
|
PlainObjectBase<Derived>::setConstant(Index rows, NoChange_t, const Scalar& val)
|
||||||
|
{
|
||||||
|
return setConstant(rows, cols(), val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets a linearly spaced vector.
|
* \brief Sets a linearly spaced vector.
|
||||||
*
|
*
|
||||||
|
@ -717,6 +717,8 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
using Base::setConstant;
|
using Base::setConstant;
|
||||||
EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val);
|
EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val);
|
||||||
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val);
|
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val);
|
||||||
|
EIGEN_DEVICE_FUNC Derived& setConstant(NoChange_t, Index cols, const Scalar& val);
|
||||||
|
EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, NoChange_t, const Scalar& val);
|
||||||
|
|
||||||
using Base::setZero;
|
using Base::setZero;
|
||||||
EIGEN_DEVICE_FUNC Derived& setZero(Index size);
|
EIGEN_DEVICE_FUNC Derived& setZero(Index size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user