35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
72 struct TDVecDVecMultExprHelper
76 typedef typename RemoveReference< typename T1::CompositeType >::Type CT1;
79 typedef typename RemoveReference< typename T2::CompositeType >::Type CT2;
86 IsSame< typename CT1::ElementType, typename CT2::ElementType>::value &&
87 IntrinsicTrait< typename CT1::ElementType >::addition &&
88 IntrinsicTrait< typename CT2::ElementType >::multiplication };
129 template<
typename T1
131 inline typename DisableIf< TDVecDVecMultExprHelper<T1,T2>,
132 const typename MultTrait<typename T1::ElementType,typename T2::ElementType>::Type >::Type
137 if( (~lhs).
size() != (~rhs).
size() ) {
147 if( (~lhs).
size() == 0UL )
return MultType();
152 MultType sp( left[0UL] * right[0UL] );
154 for(
size_t i=1UL; i<left.size(); ++i )
155 sp += left[i] * right[i];
190 template<
typename T1
192 inline typename EnableIf< TDVecDVecMultExprHelper<T1,T2>,
193 const typename MultTrait<typename T1::ElementType,typename T2::ElementType>::Type >::Type
198 if( (~lhs).
size() != (~rhs).
size() ) {
209 if( (~lhs).
size() == 0UL )
return MultType();
214 typename IT::Type xmm1, xmm2, xmm3, xmm4;
216 const size_t N ( left.size() );
217 const size_t iend( N - N % (
IT::size*4UL) );
220 for(
size_t i=0UL; i<iend; i+=
IT::size*4UL ) {
221 xmm1 = xmm1 + ( left.load(i ) * right.load(i ) );
227 MultType sp(
sum( xmm1 + xmm2 + xmm3 + xmm4 ) );
229 for(
size_t i=iend; i<N; ++i )
230 sp += left[i] * right[i];
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
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:7820
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:252
Header file for the IsSame and IsStrictlySame type traits.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the DenseVector base class.
System settings for performance optimizations.
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:2586
Header file for the EnableIf class template.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
Base template for the MultTrait class.
Definition: MultTrait.h:138
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the RemoveReference type trait.
BLAZE_ALWAYS_INLINE int16_t sum(const simd_int16_t &a)
Returns the sum of all elements in the 16-bit integral intrinsic vector.
Definition: Reduction.h:63
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 exception macros.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the FunctionTrace class.