35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECINNEREXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECINNEREXPR_H_ 92 template<
typename VT1
112 if( (~lhs).
size() != (~rhs).
size() ) {
124 if( IsOpposedView_v<VT1> && IsOpposedView_v<VT2> )
126 if( left.size() == 0UL )
return sp;
128 sp = left[0UL] * right[0UL];
129 for(
size_t i=1UL; i<left.size(); ++i ) {
130 sp += left[i] * right[i];
133 else if( IsOpposedView_v<VT1> )
135 const auto rend( right.end() );
136 auto r( right.begin() );
138 if( r == rend )
return sp;
140 sp = left[r->index()] * r->value();
142 for( ; r!=rend; ++r ) {
143 sp += left[r->index()] * r->value();
146 else if( IsOpposedView_v<VT2> )
148 const auto lend( left.end() );
149 auto l( left.begin() );
151 if( l == lend )
return sp;
153 sp = l->value() * right[l->index()];
155 for( ; l!=lend; ++l ) {
156 sp += l->value() * right[l->index()];
161 const auto lend( left.end() );
162 const auto rend( right.end() );
163 auto l( left.begin() );
164 auto r( right.begin() );
166 if( l == lend || r == rend )
return sp;
169 if( l->index() < r->index() ) {
171 if( l == lend )
break;
173 else if( r->index() < l->index() ) {
175 if( r == rend )
break;
178 sp = l->value() * r->value();
185 if( l != lend && r != rend )
188 if( l->index() < r->index() ) {
190 if( l == lend )
break;
192 else if( r->index() < l->index() ) {
194 if( r == rend )
break;
197 sp += l->value() * r->value();
199 if( l == lend )
break;
201 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
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.The RemoveReference_t alias declaratio...
Definition: RemoveReference.h:95
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the transpose flag of vector types.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#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.
Header file for the exception macros of the math module.
Constraint on the data type.
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
#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
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Header file for the RemoveReference type trait.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
#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.