22 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDVECMULTEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_SMATDVECMULTEXPR_H_
31 #include <boost/type_traits/remove_reference.hpp>
73 class SMatDVecMultExpr :
public DenseVector< SMatDVecMultExpr<MT,VT>, false >
79 typedef typename MT::ResultType
MRT;
80 typedef typename VT::ResultType
VRT;
81 typedef typename MT::CompositeType
MCT;
82 typedef typename VT::CompositeType
VCT;
99 template<
typename VT2 >
101 enum { value = useAssign };
132 enum { vectorizable = 0 };
158 typedef typename boost::remove_reference<MCT>::type::ConstIterator ConstIterator;
163 if(
mat_.columns() == 0UL )
171 const ConstIterator end( A.end(index) );
172 ConstIterator element( A.begin(index) );
181 const size_t last( A.nonZeros(index) &
size_t(-2) );
184 for(
size_t i=0UL; i<last; i+=2UL )
186 const ElementType value1( element->value() );
187 const size_t index1( element->index() );
189 const ElementType value2( element->value() );
190 const size_t index2( element->index() );
193 tmp += value1 *
vec_[index1];
194 tmp2 += value2 * vec_[index2];
197 tmp += element->value() *
vec_[element->index()];
205 tmp = element->value() *
vec_[element->index()];
207 for( ; element!=end; ++element )
208 tmp += element->value() *
vec_[element->index()];
215 for(
size_t k=1UL; k<
mat_.columns(); ++k ) {
260 template<
typename T >
262 return (
mat_.isAliased( alias ) ||
vec_.isAliased( alias ) );
272 template<
typename T >
274 return (
mat_.isAliased( alias ) ||
vec_.isAliased( alias ) );
299 template<
typename VT1 >
307 typedef typename boost::remove_reference<LT>::type::ConstIterator ConstIterator;
309 if( rhs.mat_.columns() == 0UL ) {
342 template<
typename VT1 >
354 const ResultType tmp( rhs );
375 template<
typename VT1 >
376 friend inline typename EnableIf< UseAssign<VT1> >::Type
383 typedef typename boost::remove_reference<LT>::type::ConstIterator ConstIterator;
385 if( rhs.mat_.columns() == 0UL ) {
421 template<
typename VT1 >
422 friend inline typename EnableIf< UseAssign<VT1> >::Type
429 typedef typename boost::remove_reference<LT>::type::ConstIterator ConstIterator;
431 if( rhs.mat_.columns() == 0UL ) {
467 template<
typename VT1 >
468 friend inline typename EnableIf< UseAssign<VT1> >::Type
479 const ResultType tmp( rhs );
540 template<
typename T1
542 inline const typename DisableIf< IsMatMatMultExpr<T1>, SMatDVecMultExpr<T1,T2> >::Type
548 throw std::invalid_argument(
"Matrix and vector sizes do not match" );
576 template<
typename T1
579 inline const typename EnableIf< IsMatMatMultExpr<T1>, MultExprTrait<T1,T2> >::Type::Type
584 return (~mat).leftOperand() * ( (~mat).
rightOperand() * vec );