mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 04:09:10 +08:00
Fix scalar * product optimization when 'product' includes a selfadjoint matrix
This commit is contained in:
parent
d595fd31f5
commit
873401032b
@ -133,6 +133,13 @@ template<typename _MatrixType, unsigned int UpLo> class SelfAdjointView
|
|||||||
return Product<OtherDerived,SelfAdjointView>(lhs.derived(),rhs);
|
return Product<OtherDerived,SelfAdjointView>(lhs.derived(),rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend EIGEN_DEVICE_FUNC
|
||||||
|
const SelfAdjointView<const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>,MatrixType>,UpLo>
|
||||||
|
operator*(const Scalar& s, const SelfAdjointView& mat)
|
||||||
|
{
|
||||||
|
return (s*mat.nestedExpression()).template selfadjointView<UpLo>();
|
||||||
|
}
|
||||||
|
|
||||||
#else // EIGEN_TEST_EVALUATORS
|
#else // EIGEN_TEST_EVALUATORS
|
||||||
|
|
||||||
/** Efficient self-adjoint matrix times vector/matrix product */
|
/** Efficient self-adjoint matrix times vector/matrix product */
|
||||||
|
@ -63,6 +63,14 @@ template<typename Derived> class TriangularBase : public EigenBase<Derived>
|
|||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
inline Index innerStride() const { return derived().innerStride(); }
|
inline Index innerStride() const { return derived().innerStride(); }
|
||||||
|
|
||||||
|
// dummy resize function
|
||||||
|
void resize(Index nbRows, Index nbCols)
|
||||||
|
{
|
||||||
|
EIGEN_UNUSED_VARIABLE(nbRows);
|
||||||
|
EIGEN_UNUSED_VARIABLE(nbCols);
|
||||||
|
eigen_assert(nbRows==rows() && nbCols==nbCols);
|
||||||
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
inline Scalar coeff(Index row, Index col) const { return derived().coeff(row,col); }
|
inline Scalar coeff(Index row, Index col) const { return derived().coeff(row,col); }
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user