aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/CwiseNullaryOp.h
diff options
context:
space:
mode:
authorGravatar David Tellenbach <david.tellenbach@me.com>2021-01-28 15:13:07 +0100
committerGravatar David Tellenbach <david.tellenbach@me.com>2021-01-28 15:13:07 +0100
commit170a504c2f65e1c224d6359eecd849025becfc2d (patch)
tree8b5024b61804bd725edeb724c48cecd439b5fe30 /Eigen/src/Core/CwiseNullaryOp.h
parent598e1b6e54ec51c2448b1a10d4354f165f0b083e (diff)
Add the following functions
DenseBase::setConstant(NoChange_t, Index, const Scalar&) DenseBase::setConstant(Index, NoChange_t, const Scalar&) to close #663.
Diffstat (limited to 'Eigen/src/Core/CwiseNullaryOp.h')
-rw-r--r--Eigen/src/Core/CwiseNullaryOp.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h
index 638aa2f31..8f3496fa0 100644
--- a/Eigen/src/Core/CwiseNullaryOp.h
+++ b/Eigen/src/Core/CwiseNullaryOp.h
@@ -383,6 +383,33 @@ PlainObjectBase<Derived>::setConstant(Index rows, Index cols, const Scalar& 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.
*