aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/CwiseUnaryOp.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/CwiseUnaryOp.h')
-rw-r--r--Eigen/src/Core/CwiseUnaryOp.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h
index b26b55be8..5c2ba1b07 100644
--- a/Eigen/src/Core/CwiseUnaryOp.h
+++ b/Eigen/src/Core/CwiseUnaryOp.h
@@ -50,7 +50,8 @@ struct ei_traits<CwiseUnaryOp<UnaryOp, MatrixType> >
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
- Flags = MatrixType::Flags,
+ Flags = (MatrixType::Flags & ~VectorizableBit)
+ | (ei_functor_traits<UnaryOp>::IsVectorizable ? MatrixType::Flags & VectorizableBit : 0),
CoeffReadCost = MatrixType::CoeffReadCost + ei_functor_traits<UnaryOp>::Cost
};
};
@@ -76,6 +77,11 @@ class CwiseUnaryOp : ei_no_assignment_operator,
return m_functor(m_matrix.coeff(row, col));
}
+ PacketScalar _packetCoeff(int row, int col) const
+ {
+ return m_functor.packetOp(m_matrix.packetCoeff(row, col));
+ }
+
protected:
const typename MatrixType::XprCopy m_matrix;
const UnaryOp m_functor;