diff options
author | 2012-02-10 10:21:11 +0100 | |
---|---|---|
committer | 2012-02-10 10:21:11 +0100 | |
commit | 9ed6a267a336f0fff4a2183a622e311d05194aca (patch) | |
tree | cdd1e2a38c401da702d462315aeab4de242c8f37 /Eigen | |
parent | 2ea98594c4af1af8e3d15545b5091c368b2a5213 (diff) |
Modify the LinSpaced function to take only the two bounds
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/CwiseNullaryOp.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index 488bb6da3..0fb2c7bc1 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -399,6 +399,22 @@ EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(Index size, const return derived() = Derived::NullaryExpr(size, internal::linspaced_op<Scalar,false>(low,high,size)); } +/** + * \brief Sets a linearly space vector. + * + * The function fill *this with equally spaced values in the closed interval [low,high]. + * + * \only_for_vectors + * + * \sa setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp + */ +template<typename Derived> +EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return setLinSpaced(size(), low, high); +} + // zero: /** \returns an expression of a zero matrix. |