35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
70 struct TDVecDVecMultExprHelper
74 typedef typename RemoveReference< typename T1::CompositeType >::Type CT1;
77 typedef typename RemoveReference< typename T2::CompositeType >::Type CT2;
81 enum { value = CT1::vectorizable &&
83 IsSame< typename CT1::ElementType, typename CT2::ElementType>::value &&
84 IntrinsicTrait< typename CT1::ElementType >::addition &&
85 IntrinsicTrait< typename CT2::ElementType >::multiplication };
126 template<
typename T1
128 inline typename DisableIf< TDVecDVecMultExprHelper<T1,T2>,
129 const typename MultTrait<typename T1::ElementType,typename T2::ElementType>::Type >::Type
134 if( (~lhs).
size() != (~rhs).
size() )
135 throw std::invalid_argument(
"Vector sizes do not match" );
143 if( (~lhs).
size() == 0UL )
return MultType();
148 MultType sp( left[0UL] * right[0UL] );
150 for(
size_t i=1UL; i<left.size(); ++i )
151 sp += left[i] * right[i];
186 template<
typename T1
188 inline typename EnableIf< TDVecDVecMultExprHelper<T1,T2>,
189 const typename MultTrait<typename T1::ElementType,typename T2::ElementType>::Type >::Type
194 if( (~lhs).
size() != (~rhs).
size() )
195 throw std::invalid_argument(
"Vector sizes do not match" );
204 if( (~lhs).
size() == 0UL )
return MultType();
209 typename IT::Type xmm1, xmm2, xmm3, xmm4;
211 const size_t N ( left.size() );
215 xmm1 = xmm1 + ( left.load(i ) * right.load(i ) );
221 MultType sp(
sum( xmm1 + xmm2 + xmm3 + xmm4 ) );
223 for(
size_t i=end; i<N; ++i )
224 sp += left[i] * right[i];
BLAZE_ALWAYS_INLINE int16_t sum(const sse_int16_t &a)
Returns the sum of all elements in the 16-bit integral intrinsic vector.
Definition: Reduction.h:63
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8247
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
Header file for the IsSame and IsStrictlySame type traits.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Header file for the DenseVector base class.
Header file for the DisableIf class template.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Header file for the EnableIf class template.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Base template for the MultTrait class.
Definition: MultTrait.h:150
Header file for the RemoveReference type trait.
Header file for all intrinsic functionality.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the FunctionTrace class.