Blaze 3.9
SVecScalarMultExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
44#include <utility>
45#include <blaze/math/Aliases.h>
68#include <blaze/util/Assert.h>
70#include <blaze/util/EnableIf.h>
73#include <blaze/util/mpl/If.h>
74#include <blaze/util/Types.h>
76
77
78namespace blaze {
79
80//=================================================================================================
81//
82// CLASS SVECSCALARMULTEXPR
83//
84//=================================================================================================
85
86//*************************************************************************************************
93template< typename VT // Type of the left-hand side sparse vector
94 , typename ST // Type of the right-hand side scalar value
95 , bool TF > // Transpose flag
97 : public VecScalarMultExpr< SparseVector< SVecScalarMultExpr<VT,ST,TF>, TF > >
98 , private Computation
99{
100 private:
101 //**Type definitions****************************************************************************
105 //**********************************************************************************************
106
107 //**Return type evaluation**********************************************************************
109
114 static constexpr bool returnExpr = !IsTemporary_v<RN>;
115
117 using ExprReturnType = decltype( std::declval<RN>() * std::declval<ST>() );
118 //**********************************************************************************************
119
120 //**Serial evaluation strategy******************************************************************
122
128 static constexpr bool useAssign = RequiresEvaluation_v<VT>;
129
132 template< typename VT2 >
133 static constexpr bool UseAssign_v = useAssign;
135 //**********************************************************************************************
136
137 //**Parallel evaluation strategy****************************************************************
139
145 template< typename VT2 >
146 static constexpr bool UseSMPAssign_v =
147 ( ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign );
149 //**********************************************************************************************
150
151 public:
152 //**Type definitions****************************************************************************
155
158
162
165
168
170 using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
171
173 using RightOperand = ST;
174 //**********************************************************************************************
175
176 //**Compilation flags***************************************************************************
178 static constexpr bool smpAssignable = false;
179 //**********************************************************************************************
180
181 //**ConstIterator class definition**************************************************************
185 {
186 public:
187 //**Type definitions*************************************************************************
190
193
194 using IteratorCategory = std::forward_iterator_tag;
198 using DifferenceType = ptrdiff_t;
199
200 // STL iterator requirements
206 //*******************************************************************************************
207
208 //**Constructor******************************************************************************
211 inline ConstIterator( IteratorType vector, RightOperand scalar )
212 : vector_( vector ) // Iterator over the elements of the left-hand side sparse vector expression
213 , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
214 {}
215 //*******************************************************************************************
216
217 //**Prefix increment operator****************************************************************
223 ++vector_;
224 return *this;
225 }
226 //*******************************************************************************************
227
228 //**Element access operator******************************************************************
233 inline const Element operator*() const {
234 return Element( vector_->value() * scalar_, vector_->index() );
235 }
236 //*******************************************************************************************
237
238 //**Element access operator******************************************************************
243 inline const ConstIterator* operator->() const {
244 return this;
245 }
246 //*******************************************************************************************
247
248 //**Value function***************************************************************************
253 inline ReturnType value() const {
254 return vector_->value() * scalar_;
255 }
256 //*******************************************************************************************
257
258 //**Index function***************************************************************************
263 inline size_t index() const {
264 return vector_->index();
265 }
266 //*******************************************************************************************
267
268 //**Equality operator************************************************************************
274 inline bool operator==( const ConstIterator& rhs ) const {
275 return vector_ == rhs.vector_;
276 }
277 //*******************************************************************************************
278
279 //**Inequality operator**********************************************************************
285 inline bool operator!=( const ConstIterator& rhs ) const {
286 return vector_ != rhs.vector_;
287 }
288 //*******************************************************************************************
289
290 //**Subtraction operator*********************************************************************
296 inline DifferenceType operator-( const ConstIterator& rhs ) const {
297 return vector_ - rhs.vector_;
298 }
299 //*******************************************************************************************
300
301 private:
302 //**Member variables*************************************************************************
305 //*******************************************************************************************
306 };
307 //**********************************************************************************************
308
309 //**Constructor*********************************************************************************
315 inline SVecScalarMultExpr( const VT& vector, ST scalar ) noexcept
316 : vector_( vector ) // Left-hand side sparse vector of the multiplication expression
317 , scalar_( scalar ) // Right-hand side scalar of the multiplication expression
318 {}
319 //**********************************************************************************************
320
321 //**Subscript operator**************************************************************************
327 inline ReturnType operator[]( size_t index ) const {
328 BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
329 return vector_[index] * scalar_;
330 }
331 //**********************************************************************************************
332
333 //**At function*********************************************************************************
340 inline ReturnType at( size_t index ) const {
341 if( index >= vector_.size() ) {
342 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
343 }
344 return (*this)[index];
345 }
346 //**********************************************************************************************
347
348 //**Begin function******************************************************************************
353 inline ConstIterator begin() const {
354 return ConstIterator( vector_.begin(), scalar_ );
355 }
356 //**********************************************************************************************
357
358 //**End function********************************************************************************
363 inline ConstIterator end() const {
364 return ConstIterator( vector_.end(), scalar_ );
365 }
366 //**********************************************************************************************
367
368 //**Size function*******************************************************************************
373 inline size_t size() const noexcept {
374 return vector_.size();
375 }
376 //**********************************************************************************************
377
378 //**NonZeros function***************************************************************************
383 inline size_t nonZeros() const {
384 return vector_.nonZeros();
385 }
386 //**********************************************************************************************
387
388 //**Find function*******************************************************************************
394 inline ConstIterator find( size_t index ) const {
396 return ConstIterator( vector_.find( index ), scalar_ );
397 }
398 //**********************************************************************************************
399
400 //**LowerBound function*************************************************************************
406 inline ConstIterator lowerBound( size_t index ) const {
408 return ConstIterator( vector_.lowerBound( index ), scalar_ );
409 }
410 //**********************************************************************************************
411
412 //**UpperBound function*************************************************************************
418 inline ConstIterator upperBound( size_t index ) const {
420 return ConstIterator( vector_.upperBound( index ), scalar_ );
421 }
422 //**********************************************************************************************
423
424 //**Left operand access*************************************************************************
429 inline LeftOperand leftOperand() const noexcept {
430 return vector_;
431 }
432 //**********************************************************************************************
433
434 //**Right operand access************************************************************************
439 inline RightOperand rightOperand() const noexcept {
440 return scalar_;
441 }
442 //**********************************************************************************************
443
444 //**********************************************************************************************
450 template< typename T >
451 inline bool canAlias( const T* alias ) const noexcept {
452 return vector_.canAlias( alias );
453 }
454 //**********************************************************************************************
455
456 //**********************************************************************************************
462 template< typename T >
463 inline bool isAliased( const T* alias ) const noexcept {
464 return vector_.isAliased( alias );
465 }
466 //**********************************************************************************************
467
468 private:
469 //**Member variables****************************************************************************
472 //**********************************************************************************************
473
474 //**Assignment to dense vectors*****************************************************************
488 template< typename VT2 > // Type of the target dense vector
489 friend inline auto assign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
491 {
493
494 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
495
496 assign( *lhs, rhs.vector_ );
497 (*lhs) *= rhs.scalar_;
498 }
500 //**********************************************************************************************
501
502 //**Assignment to sparse vectors****************************************************************
516 template< typename VT2 > // Type of the target sparse vector
517 friend inline auto assign( SparseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
519 {
521
522 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
523
524 assign( *lhs, rhs.vector_ );
525 (*lhs) *= rhs.scalar_;
526 }
528 //**********************************************************************************************
529
530 //**Addition assignment to dense vectors********************************************************
544 template< typename VT2 > // Type of the target dense vector
545 friend inline auto addAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
546 -> EnableIf_t< UseAssign_v<VT2> >
547 {
549
553
554 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
555
556 const ResultType tmp( serial( rhs ) );
557 addAssign( *lhs, tmp );
558 }
560 //**********************************************************************************************
561
562 //**Addition assignment to sparse vectors*******************************************************
563 // No special implementation for the addition assignment to sparse vectors.
564 //**********************************************************************************************
565
566 //**Subtraction assignment to dense vectors*****************************************************
580 template< typename VT2 > // Type of the target dense vector
581 friend inline auto subAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
582 -> EnableIf_t< UseAssign_v<VT2> >
583 {
585
589
590 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
591
592 const ResultType tmp( serial( rhs ) );
593 subAssign( *lhs, tmp );
594 }
596 //**********************************************************************************************
597
598 //**Subtraction assignment to sparse vectors****************************************************
599 // No special implementation for the subtraction assignment to sparse vectors.
600 //**********************************************************************************************
601
602 //**Multiplication assignment to dense vectors**************************************************
616 template< typename VT2 > // Type of the target dense vector
617 friend inline auto multAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
618 -> EnableIf_t< UseAssign_v<VT2> >
619 {
621
625
626 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
627
628 const ResultType tmp( serial( rhs ) );
629 multAssign( *lhs, tmp );
630 }
632 //**********************************************************************************************
633
634 //**Multiplication assignment to sparse vectors*************************************************
635 // No special implementation for the multiplication assignment to sparse vectors.
636 //**********************************************************************************************
637
638 //**SMP assignment to dense vectors*************************************************************
639 // No special implementation for the SMP assignment to dense vectors.
640 //**********************************************************************************************
641
642 //**SMP assignment to sparse vectors************************************************************
643 // No special implementation for the SMP assignment to sparse vectors.
644 //**********************************************************************************************
645
646 //**SMP addition assignment to dense vectors****************************************************
660 template< typename VT2 > // Type of the target dense vector
661 friend inline auto smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
662 -> EnableIf_t< UseSMPAssign_v<VT2> >
663 {
665
669
670 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
671
672 const ResultType tmp( rhs );
673 smpAddAssign( *lhs, tmp );
674 }
676 //**********************************************************************************************
677
678 //**SMP addition assignment to sparse vectors***************************************************
679 // No special implementation for the SMP addition assignment to sparse vectors.
680 //**********************************************************************************************
681
682 //**SMP subtraction assignment to dense vectors*************************************************
696 template< typename VT2 > // Type of the target dense vector
697 friend inline auto smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
698 -> EnableIf_t< UseSMPAssign_v<VT2> >
699 {
701
705
706 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
707
708 const ResultType tmp( rhs );
709 smpSubAssign( *lhs, tmp );
710 }
712 //**********************************************************************************************
713
714 //**SMP subtraction assignment to sparse vectors************************************************
715 // No special implementation for the SMP subtraction assignment to sparse vectors.
716 //**********************************************************************************************
717
718 //**SMP multiplication assignment to dense vectors**********************************************
732 template< typename VT2 > // Type of the target dense vector
733 friend inline auto smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecScalarMultExpr& rhs )
734 -> EnableIf_t< UseSMPAssign_v<VT2> >
735 {
737
741
742 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
743
744 const ResultType tmp( rhs );
745 smpMultAssign( *lhs, tmp );
746 }
748 //**********************************************************************************************
749
750 //**SMP multiplication assignment to sparse vectors*********************************************
751 // No special implementation for the SMP multiplication assignment to sparse vectors.
752 //**********************************************************************************************
753
754 //**Compile time checks*************************************************************************
762 //**********************************************************************************************
763};
764//*************************************************************************************************
765
766
767
768
769//=================================================================================================
770//
771// GLOBAL UNARY ARITHMETIC OPERATORS
772//
773//=================================================================================================
774
775//*************************************************************************************************
792template< typename VT // Type of the sparse vector
793 , bool TF > // Transpose flag
794inline decltype(auto) operator-( const SparseVector<VT,TF>& sv )
795{
797
798 using ScalarType = UnderlyingBuiltin_t<VT>;
799 using ReturnType = const SVecScalarMultExpr<VT,ScalarType,TF>;
800 return ReturnType( *sv, ScalarType(-1) );
801}
802//*************************************************************************************************
803
804
805
806
807//=================================================================================================
808//
809// GLOBAL BINARY ARITHMETIC OPERATORS
810//
811//=================================================================================================
812
813//*************************************************************************************************
826template< typename VT // Type of the left-hand side sparse vector
827 , bool TF // Transpose flag of the left-hand side sparse vector
828 , typename ST // Type of the right-hand side scalar
829 , DisableIf_t< IsZero_v<VT> >* = nullptr >
830inline const SVecScalarMultExpr< VT, MultTrait_t< UnderlyingBuiltin_t<VT>, ST >, TF >
831 svecscalarmult( const SparseVector<VT,TF>& vec, ST scalar )
832{
834
835 using ScalarType = MultTrait_t< UnderlyingBuiltin_t<VT>, ST >;
836 using ReturnType = const SVecScalarMultExpr<VT,ScalarType,TF>;
837 return ReturnType( *vec, scalar );
838}
840//*************************************************************************************************
841
842
843//*************************************************************************************************
856template< typename VT // Type of the left-hand side sparse vector
857 , bool TF // Transpose flag of the left-hand side sparse vector
858 , typename ST // Type of the right-hand side scalar
859 , EnableIf_t< IsZero_v<VT> >* = nullptr >
860inline decltype(auto)
861 svecscalarmult( const SparseVector<VT,TF>& vec, ST scalar )
862{
864
865 MAYBE_UNUSED( scalar );
866
867 using ReturnType = const MultTrait_t< ResultType_t<VT>, ST >;
868
871
872 return ReturnType( (*vec).size() );
873}
875//*************************************************************************************************
876
877
878//*************************************************************************************************
899template< typename VT // Type of the left-hand side sparse vector
900 , typename ST // Type of the right-hand side scalar
901 , bool TF // Transpose flag
902 , EnableIf_t< IsScalar_v<ST> >* = nullptr >
903inline decltype(auto) operator*( const SparseVector<VT,TF>& vec, ST scalar )
904{
906
907 return svecscalarmult( *vec, scalar );
908}
909//*************************************************************************************************
910
911
912//*************************************************************************************************
933template< typename ST // Type of the left-hand side scalar
934 , typename VT // Type of the right-hand side sparse vector
935 , bool TF // Transpose flag
936 , EnableIf_t< IsScalar_v<ST> >* = nullptr >
937inline decltype(auto) operator*( ST scalar, const SparseVector<VT,TF>& vec )
938{
940
941 return svecscalarmult( *vec, scalar );
942}
943//*************************************************************************************************
944
945
946
947
948//=================================================================================================
949//
950// GLOBAL FUNCTIONS
951//
952//=================================================================================================
953
954//*************************************************************************************************
972template< typename VT // Type of the sparse vector
973 , bool TF > // Transpose flag
974inline decltype(auto) normalize( const SparseVector<VT,TF>& vec )
975{
977
978 const auto len ( length( *vec ) );
979 auto ilen( !isZero(len) ? inv(len) : len );
980
981 using ReturnType = const SVecScalarMultExpr<VT,decltype(ilen),TF>;
982 return ReturnType( *vec, ilen );
983}
984//*************************************************************************************************
985
986} // namespace blaze
987
988#endif
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for run time assertion macros.
decltype(auto) normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1155
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the invert shim.
Header file for the IsExpression type trait class.
Header file for the IsScalar type trait.
Header file for the IsTemporary type trait class.
Deactivation of problematic macros.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Header file for the RemoveReference type trait.
Data type constraint.
Constraint on the data type.
Header file for the UnderlyingBuiltin type trait.
Header file for the ValueIndexPair class.
Constraint on the data type.
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Iterator over the elements of the sparse vector/scalar multiplication expression.
Definition: SVecScalarMultExpr.h:185
IteratorType vector_
Iterator over the elements of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:303
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarMultExpr.h:198
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:233
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarMultExpr.h:253
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarMultExpr.h:194
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:189
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarMultExpr.h:197
ValueType * PointerType
Pointer return type.
Definition: SVecScalarMultExpr.h:196
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarMultExpr.h:201
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SVecScalarMultExpr.h:304
ConstIterator(IteratorType vector, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SVecScalarMultExpr.h:211
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarMultExpr.h:205
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:285
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarMultExpr.h:195
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecScalarMultExpr.h:222
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:274
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:243
ConstIterator_t< RemoveReference_t< LeftOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:192
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarMultExpr.h:296
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarMultExpr.h:263
Expression object for sparse vector-scalar multiplications.
Definition: SVecScalarMultExpr.h:99
ResultType_t< VT > RT
Result type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:102
CompositeType_t< VT > CT
Composite type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:104
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SVecScalarMultExpr.h:471
decltype(std::declval< RN >() *std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarMultExpr.h:117
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarMultExpr.h:327
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarMultExpr.h:383
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SVecScalarMultExpr.h:173
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the multiplication expression.
Definition: SVecScalarMultExpr.h:128
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecScalarMultExpr.h:373
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:353
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecScalarMultExpr.h:340
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecScalarMultExpr.h:394
SVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the SVecScalarMultExpr class.
Definition: SVecScalarMultExpr.h:315
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecScalarMultExpr.h:164
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:429
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecScalarMultExpr.h:451
ReturnType_t< VT > RN
Return type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:103
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecScalarMultExpr.h:406
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SVecScalarMultExpr.h:161
LeftOperand vector_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecScalarMultExpr.h:470
MultTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: SVecScalarMultExpr.h:159
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarMultExpr.h:160
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:439
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:363
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarMultExpr.h:463
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SVecScalarMultExpr.h:178
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecScalarMultExpr.h:418
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: SVecScalarMultExpr.h:114
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:170
If_t< useAssign, const ResultType, const SVecScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SVecScalarMultExpr.h:167
Base class for sparse vectors.
Definition: SparseVector.h:72
Index-value-pair for sparse vectors and matrices.
Definition: ValueIndexPair.h:75
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the SparseVector base class.
Header file for the VecScalarMultExpr base class.
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.
Definition: SameType.h:71
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:405
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition: DenseMatrix.h:1819
decltype(auto) length(const DenseVector< VT, TF > &dv)
Calculation of the length (magnitude) of the dense vector .
Definition: DVecNormExpr.h:654
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.
Definition: TransposeFlag.h:63
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: SparseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:61
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition: MultTrait.h:165
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.
Definition: UnderlyingBuiltin.h:117
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:192
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Header file for the isZero shim.
Header file for the serial shim.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all vector/scalar multiplication expression templates.
Definition: VecScalarMultExpr.h:76
Header file for the IsZero type trait.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.