aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2012-03-07 16:18:35 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2012-03-07 16:18:35 +0100
commitc08521ea6b1a5b239c22771f7735d7f4904b4854 (patch)
tree2dfa07935de5ca348e4f7601df807d6bd0eaa2cf /Eigen
parentef022da28e51632458f92baabb539bf13a221694 (diff)
Improved the unit tests for setLinSpaced.
Provide a default constructed step size as opposed to an int when the size is 1.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/Functors.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h
index 1d641b19f..440eeb8e3 100644
--- a/Eigen/src/Core/Functors.h
+++ b/Eigen/src/Core/Functors.h
@@ -628,7 +628,7 @@ template <typename Scalar, bool RandomAccess> struct functor_traits< linspaced_o
template <typename Scalar, bool RandomAccess> struct linspaced_op
{
typedef typename packet_traits<Scalar>::type Packet;
- linspaced_op(Scalar low, Scalar high, int num_steps) : impl((num_steps==1 ? high : low), (num_steps==1 ? 1 : (high-low)/(num_steps-1))) {}
+ linspaced_op(Scalar low, Scalar high, int num_steps) : impl((num_steps==1 ? high : low), (num_steps==1 ? Scalar() : (high-low)/(num_steps-1))) {}
template<typename Index>
EIGEN_STRONG_INLINE const Scalar operator() (Index i) const { return impl(i); }