aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Ref.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-02-26 15:10:00 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-02-26 15:10:00 +0100
commitbb94f0ebc642b67d96966cbd31e6e7df03463923 (patch)
tree6c1ca8ded14c2c94b1dae6ac889dd514111e2a27 /Eigen/src/Core/Ref.h
parent63135a735069aec658ccfb2424670b6ed585db5e (diff)
Add a unit test for Ref.h and fix an extra copy.
Diffstat (limited to 'Eigen/src/Core/Ref.h')
-rw-r--r--Eigen/src/Core/Ref.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/Eigen/src/Core/Ref.h b/Eigen/src/Core/Ref.h
index 51890a7a5..09b7e2b70 100644
--- a/Eigen/src/Core/Ref.h
+++ b/Eigen/src/Core/Ref.h
@@ -172,7 +172,7 @@ protected:
else
::new (static_cast<Base*>(this)) Base(expr.data(), expr.rows(), expr.cols());
::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(),
- StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
+ StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
}
StrideBase m_stride;
@@ -242,8 +242,7 @@ template<typename PlainObjectType, int Options, typename StrideType> class Ref<c
template<typename Expression>
void construct(const Expression& expr, internal::false_type)
{
-// std::cout << "Ref: copy\n";
- m_object = expr;
+ m_object.lazyAssign(expr);
Base::construct(m_object);
}