Blaze 3.9
DVecScalarDivExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARDIVEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DVECSCALARDIVEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
44#include <utility>
45#include <blaze/math/Aliases.h>
57#include <blaze/math/SIMD.h>
72#include <blaze/system/Inline.h>
75#include <blaze/util/Assert.h>
78#include <blaze/util/EnableIf.h>
80#include <blaze/util/mpl/If.h>
81#include <blaze/util/Types.h>
85
86
87namespace blaze {
88
89//=================================================================================================
90//
91// CLASS DVECSCALARDIVEXPR
92//
93//=================================================================================================
94
95//*************************************************************************************************
102template< typename VT // Type of the left-hand side dense vector
103 , typename ST // Type of the right-hand side scalar value
104 , bool TF > // Transpose flag
106 : public VecScalarDivExpr< DenseVector< DVecScalarDivExpr<VT,ST,TF>, TF > >
107 , private Computation
108{
109 private:
110 //**Type definitions****************************************************************************
115 //**********************************************************************************************
116
117 //**Return type evaluation**********************************************************************
119
124 static constexpr bool returnExpr = !IsTemporary_v<RN>;
125
127 using ExprReturnType = decltype( std::declval<RN>() / std::declval<ST>() );
128 //**********************************************************************************************
129
130 //**Serial evaluation strategy******************************************************************
132
138 static constexpr bool useAssign = IsComputation_v<VT> && RequiresEvaluation_v<VT>;
139
142 template< typename VT2 >
143 static constexpr bool UseAssign_v = useAssign;
145 //**********************************************************************************************
146
147 //**Parallel evaluation strategy****************************************************************
149
155 template< typename VT2 >
156 static constexpr bool UseSMPAssign_v =
157 ( ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign );
159 //**********************************************************************************************
160
161 public:
162 //**Type definitions****************************************************************************
165
168
172
175
178
180 using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
181
183 using RightOperand = ST;
184 //**********************************************************************************************
185
186 //**ConstIterator class definition**************************************************************
190 {
191 public:
192 //**Type definitions*************************************************************************
193 using IteratorCategory = std::random_access_iterator_tag;
197 using DifferenceType = ptrdiff_t;
198
199 // STL iterator requirements
205
208 //*******************************************************************************************
209
210 //**Constructor******************************************************************************
216 inline ConstIterator( IteratorType iterator, RightOperand scalar )
217 : iterator_( iterator ) // Iterator to the current element
218 , scalar_ ( scalar ) // Scalar of the division expression
219 {}
220 //*******************************************************************************************
221
222 //**Addition assignment operator*************************************************************
229 iterator_ += inc;
230 return *this;
231 }
232 //*******************************************************************************************
233
234 //**Subtraction assignment operator**********************************************************
241 iterator_ -= dec;
242 return *this;
243 }
244 //*******************************************************************************************
245
246 //**Prefix increment operator****************************************************************
252 ++iterator_;
253 return *this;
254 }
255 //*******************************************************************************************
256
257 //**Postfix increment operator***************************************************************
263 return ConstIterator( iterator_++, scalar_ );
264 }
265 //*******************************************************************************************
266
267 //**Prefix decrement operator****************************************************************
273 --iterator_;
274 return *this;
275 }
276 //*******************************************************************************************
277
278 //**Postfix decrement operator***************************************************************
284 return ConstIterator( iterator_--, scalar_ );
285 }
286 //*******************************************************************************************
287
288 //**Element access operator******************************************************************
293 inline ReturnType operator*() const {
294 return *iterator_ / scalar_;
295 }
296 //*******************************************************************************************
297
298 //**Load function****************************************************************************
303 inline auto load() const noexcept {
304 return iterator_.load() / set( scalar_ );
305 }
306 //*******************************************************************************************
307
308 //**Equality operator************************************************************************
314 inline bool operator==( const ConstIterator& rhs ) const {
315 return iterator_ == rhs.iterator_;
316 }
317 //*******************************************************************************************
318
319 //**Inequality operator**********************************************************************
325 inline bool operator!=( const ConstIterator& rhs ) const {
326 return iterator_ != rhs.iterator_;
327 }
328 //*******************************************************************************************
329
330 //**Less-than operator***********************************************************************
336 inline bool operator<( const ConstIterator& rhs ) const {
337 return iterator_ < rhs.iterator_;
338 }
339 //*******************************************************************************************
340
341 //**Greater-than operator********************************************************************
347 inline bool operator>( const ConstIterator& rhs ) const {
348 return iterator_ > rhs.iterator_;
349 }
350 //*******************************************************************************************
351
352 //**Less-or-equal-than operator**************************************************************
358 inline bool operator<=( const ConstIterator& rhs ) const {
359 return iterator_ <= rhs.iterator_;
360 }
361 //*******************************************************************************************
362
363 //**Greater-or-equal-than operator***********************************************************
369 inline bool operator>=( const ConstIterator& rhs ) const {
370 return iterator_ >= rhs.iterator_;
371 }
372 //*******************************************************************************************
373
374 //**Subtraction operator*********************************************************************
380 inline DifferenceType operator-( const ConstIterator& rhs ) const {
381 return iterator_ - rhs.iterator_;
382 }
383 //*******************************************************************************************
384
385 //**Addition operator************************************************************************
392 friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
393 return ConstIterator( it.iterator_ + inc, it.scalar_ );
394 }
395 //*******************************************************************************************
396
397 //**Addition operator************************************************************************
404 friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
405 return ConstIterator( it.iterator_ + inc, it.scalar_ );
406 }
407 //*******************************************************************************************
408
409 //**Subtraction operator*********************************************************************
416 friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
417 return ConstIterator( it.iterator_ - dec, it.scalar_ );
418 }
419 //*******************************************************************************************
420
421 private:
422 //**Member variables*************************************************************************
425 //*******************************************************************************************
426 };
427 //**********************************************************************************************
428
429 //**Compilation flags***************************************************************************
431 static constexpr bool simdEnabled =
432 ( VT::simdEnabled && IsNumeric_v<ET> &&
433 ( HasSIMDDiv_v<ET,ST> || HasSIMDDiv_v<UnderlyingElement_t<ET>,ST> ) );
434
436 static constexpr bool smpAssignable = VT::smpAssignable;
437 //**********************************************************************************************
438
439 //**SIMD properties*****************************************************************************
441 static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
442 //**********************************************************************************************
443
444 //**Constructor*********************************************************************************
450 inline DVecScalarDivExpr( const VT& vector, ST scalar ) noexcept
451 : vector_( vector ) // Left-hand side dense vector of the division expression
452 , scalar_( scalar ) // Right-hand side scalar of the division expression
453 {}
454 //**********************************************************************************************
455
456 //**Subscript operator**************************************************************************
462 inline ReturnType operator[]( size_t index ) const {
463 BLAZE_INTERNAL_ASSERT( index < vector_.size(), "Invalid vector access index" );
464 return vector_[index] / scalar_;
465 }
466 //**********************************************************************************************
467
468 //**At function*********************************************************************************
475 inline ReturnType at( size_t index ) const {
476 if( index >= vector_.size() ) {
477 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
478 }
479 return (*this)[index];
480 }
481 //**********************************************************************************************
482
483 //**Load function*******************************************************************************
489 BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
490 BLAZE_INTERNAL_ASSERT( index < vector_.size() , "Invalid vector access index" );
491 BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL, "Invalid vector access index" );
492 return vector_.load( index ) / set( scalar_ );
493 }
494 //**********************************************************************************************
495
496 //**Begin function******************************************************************************
501 inline ConstIterator begin() const {
502 return ConstIterator( vector_.begin(), scalar_ );
503 }
504 //**********************************************************************************************
505
506 //**End function********************************************************************************
511 inline ConstIterator end() const {
512 return ConstIterator( vector_.end(), scalar_ );
513 }
514 //**********************************************************************************************
515
516 //**Size function*******************************************************************************
521 inline size_t size() const noexcept {
522 return vector_.size();
523 }
524 //**********************************************************************************************
525
526 //**Left operand access*************************************************************************
531 inline LeftOperand leftOperand() const noexcept {
532 return vector_;
533 }
534 //**********************************************************************************************
535
536 //**Right operand access************************************************************************
541 inline RightOperand rightOperand() const noexcept {
542 return scalar_;
543 }
544 //**********************************************************************************************
545
546 //**********************************************************************************************
552 template< typename T >
553 inline bool canAlias( const T* alias ) const noexcept {
554 return IsExpression_v<VT> && vector_.canAlias( alias );
555 }
556 //**********************************************************************************************
557
558 //**********************************************************************************************
564 template< typename T >
565 inline bool isAliased( const T* alias ) const noexcept {
566 return vector_.isAliased( alias );
567 }
568 //**********************************************************************************************
569
570 //**********************************************************************************************
575 inline bool isAligned() const noexcept {
576 return vector_.isAligned();
577 }
578 //**********************************************************************************************
579
580 //**********************************************************************************************
585 inline bool canSMPAssign() const noexcept {
586 return vector_.canSMPAssign() || ( size() > SMP_DVECSCALARMULT_THRESHOLD );
587 }
588 //**********************************************************************************************
589
590 private:
591 //**Member variables****************************************************************************
594 //**********************************************************************************************
595
596 //**Assignment to dense vectors*****************************************************************
610 template< typename VT2 > // Type of the target dense vector
611 friend inline auto assign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
613 {
615
616 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
617
618 assign( *lhs, rhs.vector_ );
619 assign( *lhs, (*lhs) / rhs.scalar_ );
620 }
622 //**********************************************************************************************
623
624 //**Assignment to sparse vectors****************************************************************
638 template< typename VT2 > // Type of the target sparse vector
639 friend inline auto assign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
641 {
643
644 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
645
646 assign( *lhs, rhs.vector_ );
647 (*lhs) /= rhs.scalar_;
648 }
650 //**********************************************************************************************
651
652 //**Addition assignment to dense vectors********************************************************
666 template< typename VT2 > // Type of the target dense vector
667 friend inline auto addAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
668 -> EnableIf_t< UseAssign_v<VT2> >
669 {
671
675
676 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
677
678 const ResultType tmp( serial( rhs ) );
679 addAssign( *lhs, tmp );
680 }
682 //**********************************************************************************************
683
684 //**Addition assignment to sparse vectors*******************************************************
685 // No special implementation for the addition assignment to sparse vectors.
686 //**********************************************************************************************
687
688 //**Subtraction assignment to dense vectors*****************************************************
702 template< typename VT2 > // Type of the target dense vector
703 friend inline auto subAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
704 -> EnableIf_t< UseAssign_v<VT2> >
705 {
707
711
712 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
713
714 const ResultType tmp( serial( rhs ) );
715 subAssign( *lhs, tmp );
716 }
718 //**********************************************************************************************
719
720 //**Subtraction assignment to sparse vectors****************************************************
721 // No special implementation for the subtraction assignment to sparse vectors.
722 //**********************************************************************************************
723
724 //**Multiplication assignment to dense vectors**************************************************
738 template< typename VT2 > // Type of the target dense vector
739 friend inline auto multAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
740 -> EnableIf_t< UseAssign_v<VT2> >
741 {
743
747
748 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
749
750 const ResultType tmp( serial( rhs ) );
751 multAssign( *lhs, tmp );
752 }
754 //**********************************************************************************************
755
756 //**Multiplication assignment to sparse vectors*************************************************
757 // No special implementation for the multiplication assignment to sparse vectors.
758 //**********************************************************************************************
759
760 //**Division assignment to dense vectors********************************************************
774 template< typename VT2 > // Type of the target dense vector
775 friend inline auto divAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
776 -> EnableIf_t< UseAssign_v<VT2> >
777 {
779
783
784 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
785
786 const ResultType tmp( serial( rhs ) );
787 divAssign( *lhs, tmp );
788 }
790 //**********************************************************************************************
791
792 //**Division assignment to sparse vectors*******************************************************
793 // No special implementation for the division assignment to sparse vectors.
794 //**********************************************************************************************
795
796 //**SMP assignment to dense vectors*************************************************************
810 template< typename VT2 > // Type of the target dense vector
811 friend inline auto smpAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
812 -> EnableIf_t< UseSMPAssign_v<VT2> >
813 {
815
816 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
817
818 smpAssign( *lhs, rhs.vector_ );
819 smpAssign( *lhs, (*lhs) / rhs.scalar_ );
820 }
822 //**********************************************************************************************
823
824 //**SMP assignment to sparse vectors************************************************************
838 template< typename VT2 > // Type of the target sparse vector
839 friend inline auto smpAssign( SparseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
840 -> EnableIf_t< UseSMPAssign_v<VT2> >
841 {
843
844 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
845
846 smpAssign( *lhs, rhs.vector_ );
847 (*lhs) /= rhs.scalar_;
848 }
850 //**********************************************************************************************
851
852 //**SMP addition assignment to dense vectors****************************************************
866 template< typename VT2 > // Type of the target dense vector
867 friend inline auto smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
868 -> EnableIf_t< UseSMPAssign_v<VT2> >
869 {
871
875
876 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
877
878 const ResultType tmp( rhs );
879 smpAddAssign( *lhs, tmp );
880 }
882 //**********************************************************************************************
883
884 //**SMP addition assignment to sparse vectors***************************************************
885 // No special implementation for the SMP addition assignment to sparse vectors.
886 //**********************************************************************************************
887
888 //**SMP subtraction assignment to dense vectors*************************************************
902 template< typename VT2 > // Type of the target dense vector
903 friend inline auto smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
904 -> EnableIf_t< UseSMPAssign_v<VT2> >
905 {
907
911
912 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
913
914 const ResultType tmp( rhs );
915 smpSubAssign( *lhs, tmp );
916 }
918 //**********************************************************************************************
919
920 //**SMP subtraction assignment to sparse vectors************************************************
921 // No special implementation for the SMP subtraction assignment to sparse vectors.
922 //**********************************************************************************************
923
924 //**SMP multiplication assignment to dense vectors**********************************************
938 template< typename VT2 > // Type of the target dense vector
939 friend inline auto smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
940 -> EnableIf_t< UseSMPAssign_v<VT2> >
941 {
943
947
948 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
949
950 const ResultType tmp( rhs );
951 smpMultAssign( *lhs, tmp );
952 }
954 //**********************************************************************************************
955
956 //**SMP multiplication assignment to sparse vectors*********************************************
957 // No special implementation for the SMP multiplication assignment to sparse vectors.
958 //**********************************************************************************************
959
960 //**SMP division assignment to dense vectors****************************************************
974 template< typename VT2 > // Type of the target dense vector
975 friend inline auto smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecScalarDivExpr& rhs )
976 -> EnableIf_t< UseSMPAssign_v<VT2> >
977 {
979
983
984 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
985
986 const ResultType tmp( rhs );
987 smpDivAssign( *lhs, tmp );
988 }
990 //**********************************************************************************************
991
992 //**SMP division assignment to sparse vectors***************************************************
993 // No special implementation for the SMP division assignment to sparse vectors.
994 //**********************************************************************************************
995
996 //**Compile time checks*************************************************************************
1005 //**********************************************************************************************
1006};
1007//*************************************************************************************************
1008
1009
1010
1011
1012//=================================================================================================
1013//
1014// GLOBAL BINARY ARITHMETIC OPERATORS
1015//
1016//=================================================================================================
1017
1018//*************************************************************************************************
1023template< typename VT // Type of the left-hand side dense vector
1024 , typename ST > // Type of the right-hand side scalar
1025using DVecScalarDivExprHelper_t =
1026 If_t< IsFloatingPoint_v< UnderlyingBuiltin_t<VT> > ||
1027 IsFloatingPoint_v< UnderlyingBuiltin_t<ST> >
1028 , If_t< IsBuiltin_v<ST>
1029 , DivTrait_t< UnderlyingBuiltin_t<VT>, ST >
1030 , decltype( inv( std::declval<ST>() ) ) >
1031 , ST >;
1033//*************************************************************************************************
1034
1035
1036//*************************************************************************************************
1048template< typename VT // Type of the left-hand side sparse vector
1049 , bool TF // Transpose flag of the left-hand side sparse vector
1050 , typename ST // Type of the right-hand side scalar
1051 , EnableIf_t< !IsInvertible_v< DVecScalarDivExprHelper_t<VT,ST> > >* = nullptr >
1052inline decltype(auto) dvecscalardiv( const DenseVector<VT,TF>& vec, ST scalar )
1053{
1055
1056 using ScalarType = DVecScalarDivExprHelper_t<VT,ST>;
1057 using ReturnType = const DVecScalarDivExpr<VT,ScalarType,TF>;
1058
1059 return ReturnType( *vec, scalar );
1060}
1062//*************************************************************************************************
1063
1064
1065//*************************************************************************************************
1077template< typename VT // Type of the left-hand side sparse vector
1078 , bool TF // Transpose flag of the left-hand side sparse vector
1079 , typename ST // Type of the right-hand side scalar
1080 , EnableIf_t< IsInvertible_v< DVecScalarDivExprHelper_t<VT,ST> > >* = nullptr >
1081inline decltype(auto) dvecscalardiv( const DenseVector<VT,TF>& vec, ST scalar )
1082{
1084
1085 using ScalarType = DVecScalarDivExprHelper_t<VT,ST>;
1086 using ReturnType = const DVecScalarMultExpr<VT,ScalarType,TF>;
1087
1088 return ReturnType( *vec, inv(scalar) );
1089}
1091//*************************************************************************************************
1092
1093
1094//*************************************************************************************************
1118template< typename VT // Type of the left-hand side dense vector
1119 , typename ST // Type of the right-hand side scalar
1120 , bool TF // Transpose flag
1121 , EnableIf_t< IsScalar_v<ST> >* = nullptr >
1122inline decltype(auto) operator/( const DenseVector<VT,TF>& vec, ST scalar )
1123{
1125
1126 BLAZE_USER_ASSERT( scalar != ST{}, "Division by zero detected" );
1127
1128 return dvecscalardiv( *vec, scalar );
1129}
1130//*************************************************************************************************
1131
1132
1133
1134
1135//=================================================================================================
1136//
1137// ISALIGNED SPECIALIZATIONS
1138//
1139//=================================================================================================
1140
1141//*************************************************************************************************
1143template< typename VT, typename ST, bool TF >
1144struct IsAligned< DVecScalarDivExpr<VT,ST,TF> >
1145 : public IsAligned<VT>
1146{};
1148//*************************************************************************************************
1149
1150
1151
1152
1153//=================================================================================================
1154//
1155// ISPADDED SPECIALIZATIONS
1156//
1157//=================================================================================================
1158
1159//*************************************************************************************************
1161template< typename VT, typename ST, bool TF >
1162struct IsPadded< DVecScalarDivExpr<VT,ST,TF> >
1163 : public IsPadded<VT>
1164{};
1166//*************************************************************************************************
1167
1168} // namespace blaze
1169
1170#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.
Header file for the division trait.
Header file for the EnableIf class template.
Constraint on the data type.
Header file for the function trace functionality.
Header file for the HasSIMDDiv type trait.
Macro for CUDA compatibility.
Header file for the If class template.
Header file for the invert shim.
Header file for the IsAligned type trait.
Header file for the IsBuiltin type trait.
Header file for the IsComputation type trait class.
Header file for the IsExpression type trait class.
Header file for the IsFloatingPoint type trait.
Header file for the IsInvertible type trait.
Header file for the IsNumeric type trait.
Header file for the IsPadded type trait.
Header file for the IsScalar type trait.
Header file for the IsTemporary type trait class.
Deactivation of problematic macros.
Header file for the multiplication trait.
Header file for all SIMD functionality.
Data type constraint.
Constraint on the data type.
Header file for the UnderlyingBuiltin type trait.
Header file for the UnderlyingElement type trait.
Iterator over the elements of the dense vector.
Definition: DVecScalarDivExpr.h:190
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:369
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarDivExpr.h:240
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarDivExpr.h:204
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:194
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:314
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:325
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarDivExpr.h:293
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:336
ConstIterator_t< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarDivExpr.h:207
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarDivExpr.h:197
PointerType pointer
Pointer return type.
Definition: DVecScalarDivExpr.h:202
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarDivExpr.h:303
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarDivExpr.h:262
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:392
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarDivExpr.h:228
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarDivExpr.h:423
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarDivExpr.h:200
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarDivExpr.h:416
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarDivExpr.h:251
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarDivExpr.h:272
ReferenceType reference
Reference return type.
Definition: DVecScalarDivExpr.h:203
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarDivExpr.h:404
ElementType * PointerType
Pointer return type.
Definition: DVecScalarDivExpr.h:195
RightOperand scalar_
Scalar of the division expression.
Definition: DVecScalarDivExpr.h:424
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarDivExpr.h:380
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarDivExpr.h:283
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:347
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarDivExpr.h:193
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarDivExpr.h:196
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarDivExpr.h:201
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarDivExpr.h:216
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarDivExpr.h:358
Expression object for divisions of a dense vector by a scalar.
Definition: DVecScalarDivExpr.h:108
CompositeType_t< VT > CT
Composite type of the dense vector expression.
Definition: DVecScalarDivExpr.h:114
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarDivExpr.h:565
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecScalarDivExpr.h:431
DVecScalarDivExpr(const VT &vector, ST scalar) noexcept
Constructor for the DVecScalarDivExpr class.
Definition: DVecScalarDivExpr.h:450
ReturnType_t< VT > RN
Return type of the dense vector expression.
Definition: DVecScalarDivExpr.h:112
LeftOperand vector_
Left-hand side dense vector of the division expression.
Definition: DVecScalarDivExpr.h:592
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarDivExpr.h:541
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the division expression.
Definition: DVecScalarDivExpr.h:138
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecScalarDivExpr.h:436
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecScalarDivExpr.h:521
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarDivExpr.h:531
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DVecScalarDivExpr.h:171
ElementType_t< VT > ET
Element type of the dense vector expression.
Definition: DVecScalarDivExpr.h:113
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarDivExpr.h:489
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarDivExpr.h:462
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarDivExpr.h:575
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DVecScalarDivExpr.h:593
decltype(std::declval< RN >()/std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarDivExpr.h:127
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarDivExpr.h:511
ResultType_t< VT > RT
Result type of the dense vector expression.
Definition: DVecScalarDivExpr.h:111
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarDivExpr.h:183
DivTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DVecScalarDivExpr.h:169
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DVecScalarDivExpr.h:441
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecScalarDivExpr.h:174
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarDivExpr.h:501
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarDivExpr.h:475
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarDivExpr.h:170
If_t< useAssign, const ResultType, const DVecScalarDivExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecScalarDivExpr.h:177
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarDivExpr.h:585
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DVecScalarDivExpr.h:124
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarDivExpr.h:553
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarDivExpr.h:180
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse vectors.
Definition: SparseVector.h:72
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseVector base class.
Header file for the VecScalarDivExpr base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.
Definition: FloatingPoint.h:81
#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
#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_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: DenseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
typename DivTrait< T1, T2 >::Type DivTrait_t
Auxiliary alias declaration for the DivTrait class template.
Definition: DivTrait.h:164
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:221
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 smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
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
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
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 serial shim.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all vector/scalar division expression templates.
Definition: VecScalarDivExpr.h:75
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.