35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECINNEREXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECINNEREXPR_H_ 92 template<
typename VT1
114 if( (~lhs).
size() != (~rhs).
size() ) {
128 if( left.size() == 0UL )
return sp;
130 sp = left[0UL] * right[0UL];
131 for(
size_t i=1UL; i<left.size(); ++i ) {
132 sp += left[i] * right[i];
137 const RightIterator rend( right.end() );
138 RightIterator r( right.begin() );
140 if( r == rend )
return sp;
142 sp = left[r->index()] * r->value();
144 for( ; r!=rend; ++r ) {
145 sp += left[r->index()] * r->value();
150 const LeftIterator lend( left.end() );
151 LeftIterator l( left.begin() );
153 if( l == lend )
return sp;
155 sp = l->value() * right[l->index()];
157 for( ; l!=lend; ++l ) {
158 sp += l->value() * right[l->index()];
163 const LeftIterator lend( left.end() );
164 const RightIterator rend( right.end() );
165 LeftIterator l( left.begin() );
166 RightIterator r( right.begin() );
168 if( l == lend || r == rend )
return sp;
171 if( l->index() < r->index() ) {
173 if( l == lend )
break;
175 else if( r->index() < l->index() ) {
177 if( r == rend )
break;
180 sp = l->value() * r->value();
187 if( l != lend && r != rend )
190 if( l->index() < r->index() ) {
192 if( l == lend )
break;
194 else if( r->index() < l->index() ) {
196 if( r == rend )
break;
199 sp += l->value() * r->value();
201 if( l == lend )
break;
203 if( r == rend )
break;
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Header file for basic type definitions.
Header file for the SparseVector base class.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: ColumnVector.h:61
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Compile time check for resizable data types.This type trait tests whether the given data type is an o...
Definition: IsOpposedView.h:81
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Constraint on the transpose flag of vector types.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Header file for the IsOpposedView type trait.
typename RemoveReference< T >::Type RemoveReference_
Auxiliary alias declaration for the RemoveReference type trait.The RemoveReference_ alias declaration...
Definition: RemoveReference.h:95
Header file for the exception macros of the math module.
Constraint on the data type.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for the RemoveReference type trait.
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: RowVector.h:61
#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
Constraint on the transpose flag of vector types.
Header file for the function trace functionality.