aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-01-24 10:52:18 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-01-24 10:52:18 +0000
commit81b0ab53cfcbe9569c3bc67e1c42a9075997da4c (patch)
treec6fa992d4f83ffc23279c9dd0cf987ceb4811da8 /Eigen/src
parent9849931500ebbc17296e7598dc923b6f73f01bc2 (diff)
add fill() function as an alias for setConstant
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/CwiseNullaryOp.h12
-rw-r--r--Eigen/src/Core/MatrixBase.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h
index 0f914e7ca..691bc3663 100644
--- a/Eigen/src/Core/CwiseNullaryOp.h
+++ b/Eigen/src/Core/CwiseNullaryOp.h
@@ -238,9 +238,19 @@ bool MatrixBase<Derived>::isApproxToConstant
return true;
}
+/** Alias for setConstant(): sets all coefficients in this expression to \a value.
+ *
+ * \sa setConstant(), Constant(), class CwiseNullaryOp
+ */
+template<typename Derived>
+EIGEN_STRONG_INLINE void MatrixBase<Derived>::fill(const Scalar& value)
+{
+ setConstant(value);
+}
+
/** Sets all coefficients in this expression to \a value.
*
- * \sa class CwiseNullaryOp, Zero(), Ones()
+ * \sa fill(), Constant(), class CwiseNullaryOp, setZero(), setOnes()
*/
template<typename Derived>
EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setConstant(const Scalar& value)
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 41dd894d7..5281e34fa 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -446,6 +446,7 @@ template<typename Derived> class MatrixBase
const DiagonalMatrix<Derived> asDiagonal() const;
+ void fill(const Scalar& value);
Derived& setConstant(const Scalar& value);
Derived& setZero();
Derived& setOnes();