Blaze 3.9
DMatScalarDivExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARDIVEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATSCALARDIVEXPR_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>
74#include <blaze/util/Assert.h>
77#include <blaze/util/EnableIf.h>
79#include <blaze/util/mpl/If.h>
80#include <blaze/util/Types.h>
84
85
86namespace blaze {
87
88//=================================================================================================
89//
90// CLASS DMATSCALARDIVEXPR
91//
92//=================================================================================================
93
94//*************************************************************************************************
101template< typename MT // Type of the left-hand side dense matrix
102 , typename ST // Type of the right-hand side scalar value
103 , bool SO > // Storage order
105 : public MatScalarDivExpr< DenseMatrix< DMatScalarDivExpr<MT,ST,SO>, SO > >
106 , private Computation
107{
108 private:
109 //**Type definitions****************************************************************************
114 //**********************************************************************************************
115
116 //**Return type evaluation**********************************************************************
118
123 static constexpr bool returnExpr = !IsTemporary_v<RN>;
124
126 using ExprReturnType = decltype( std::declval<RN>() / std::declval<ST>() );
127 //**********************************************************************************************
128
129 //**Serial evaluation strategy******************************************************************
131
137 static constexpr bool useAssign = IsComputation_v<MT> && RequiresEvaluation_v<MT>;
138
141 template< typename MT2 >
142 static constexpr bool UseAssign_v = useAssign;
144 //**********************************************************************************************
145
146 //**Parallel evaluation strategy****************************************************************
148
154 template< typename MT2 >
155 static constexpr bool UseSMPAssign_v =
156 ( ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign );
158 //**********************************************************************************************
159
160 public:
161 //**Type definitions****************************************************************************
164
167
172
175
178
180 using LeftOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
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 multiplication 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 ( MT::simdEnabled && IsNumeric_v<ET> &&
433 ( HasSIMDDiv_v<ET,ST> || HasSIMDDiv_v<UnderlyingElement_t<ET>,ST> ) );
434
436 static constexpr bool smpAssignable = MT::smpAssignable;
437 //**********************************************************************************************
438
439 //**SIMD properties*****************************************************************************
441 static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
442 //**********************************************************************************************
443
444 //**Constructor*********************************************************************************
450 inline DMatScalarDivExpr( const MT& matrix, ST scalar ) noexcept
451 : matrix_( matrix ) // Left-hand side dense matrix of the division expression
452 , scalar_( scalar ) // Right-hand side scalar of the division expression
453 {}
454 //**********************************************************************************************
455
456 //**Access operator*****************************************************************************
463 inline ReturnType operator()( size_t i, size_t j ) const {
464 BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
465 BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
466 return matrix_(i,j) / scalar_;
467 }
468 //**********************************************************************************************
469
470 //**At function*********************************************************************************
478 inline ReturnType at( size_t i, size_t j ) const {
479 if( i >= matrix_.rows() ) {
480 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
481 }
482 if( j >= matrix_.columns() ) {
483 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
484 }
485 return (*this)(i,j);
486 }
487 //**********************************************************************************************
488
489 //**Load function*******************************************************************************
496 BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
497 BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
498 BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
499 BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
500 BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
501 return matrix_.load(i,j) / set( scalar_ );
502 }
503 //**********************************************************************************************
504
505 //**Begin function******************************************************************************
511 inline ConstIterator begin( size_t i ) const {
512 return ConstIterator( matrix_.begin(i), scalar_ );
513 }
514 //**********************************************************************************************
515
516 //**End function********************************************************************************
522 inline ConstIterator end( size_t i ) const {
523 return ConstIterator( matrix_.end(i), scalar_ );
524 }
525 //**********************************************************************************************
526
527 //**Rows function*******************************************************************************
532 inline size_t rows() const noexcept {
533 return matrix_.rows();
534 }
535 //**********************************************************************************************
536
537 //**Columns function****************************************************************************
542 inline size_t columns() const noexcept {
543 return matrix_.columns();
544 }
545 //**********************************************************************************************
546
547 //**Left operand access*************************************************************************
552 inline LeftOperand leftOperand() const noexcept {
553 return matrix_;
554 }
555 //**********************************************************************************************
556
557 //**Right operand access************************************************************************
562 inline RightOperand rightOperand() const noexcept {
563 return scalar_;
564 }
565 //**********************************************************************************************
566
567 //**********************************************************************************************
573 template< typename T >
574 inline bool canAlias( const T* alias ) const noexcept {
575 return IsExpression_v<MT> && matrix_.canAlias( alias );
576 }
577 //**********************************************************************************************
578
579 //**********************************************************************************************
585 template< typename T >
586 inline bool isAliased( const T* alias ) const noexcept {
587 return matrix_.isAliased( alias );
588 }
589 //**********************************************************************************************
590
591 //**********************************************************************************************
596 inline bool isAligned() const noexcept {
597 return matrix_.isAligned();
598 }
599 //**********************************************************************************************
600
601 //**********************************************************************************************
606 inline bool canSMPAssign() const noexcept {
607 return matrix_.canSMPAssign() ||
608 ( rows() * columns() >= SMP_DMATSCALARMULT_THRESHOLD );
609 }
610 //**********************************************************************************************
611
612 private:
613 //**Member variables****************************************************************************
616 //**********************************************************************************************
617
618 //**Assignment to dense matrices****************************************************************
632 template< typename MT2 // Type of the target dense matrix
633 , bool SO2 > // Storage order of the target dense matrix
634 friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
636 {
638
639 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
640 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
641
642 assign( *lhs, rhs.matrix_ );
643 assign( *lhs, (*lhs) / rhs.scalar_ );
644 }
646 //**********************************************************************************************
647
648 //**Assignment to sparse matrices***************************************************************
662 template< typename MT2 // Type of the target sparse matrix
663 , bool SO2 > // Storage order of the target sparse matrix
664 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
666 {
668
669 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
670 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
671
672 assign( *lhs, rhs.matrix_ );
673 (*lhs) /= rhs.scalar_;
674 }
676 //**********************************************************************************************
677
678 //**Addition assignment to dense matrices*******************************************************
692 template< typename MT2 // Type of the target dense matrix
693 , bool SO2 > // Storage order of the target dense matrix
694 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
695 -> EnableIf_t< UseAssign_v<MT2> >
696 {
698
702
703 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
704 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
705
706 const ResultType tmp( serial( rhs ) );
707 addAssign( *lhs, tmp );
708 }
710 //**********************************************************************************************
711
712 //**Addition assignment to sparse matrices******************************************************
713 // No special implementation for the addition assignment to sparse matrices.
714 //**********************************************************************************************
715
716 //**Subtraction assignment to dense matrices****************************************************
730 template< typename MT2 // Type of the target dense matrix
731 , bool SO2 > // Storage order of the target dense matrix
732 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
733 -> EnableIf_t< UseAssign_v<MT2> >
734 {
736
740
741 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
742 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
743
744 const ResultType tmp( serial( rhs ) );
745 subAssign( *lhs, tmp );
746 }
748 //**********************************************************************************************
749
750 //**Subtraction assignment to sparse matrices***************************************************
751 // No special implementation for the subtraction assignment to sparse matrices.
752 //**********************************************************************************************
753
754 //**Schur product assignment to dense matrices**************************************************
768 template< typename MT2 // Type of the target dense matrix
769 , bool SO2 > // Storage order of the target dense matrix
770 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
771 -> EnableIf_t< UseAssign_v<MT2> >
772 {
774
778
779 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
780 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
781
782 const ResultType tmp( serial( rhs ) );
783 schurAssign( *lhs, tmp );
784 }
786 //**********************************************************************************************
787
788 //**Schur product assignment to sparse matrices*************************************************
789 // No special implementation for the Schur product assignment to sparse matrices.
790 //**********************************************************************************************
791
792 //**Multiplication assignment to dense matrices*************************************************
793 // No special implementation for the multiplication assignment to dense matrices.
794 //**********************************************************************************************
795
796 //**Multiplication assignment to sparse matrices************************************************
797 // No special implementation for the multiplication assignment to sparse matrices.
798 //**********************************************************************************************
799
800 //**SMP assignment to dense matrices************************************************************
814 template< typename MT2 // Type of the target dense matrix
815 , bool SO2 > // Storage order of the target dense matrix
816 friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
817 -> EnableIf_t< UseSMPAssign_v<MT2> >
818 {
820
821 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
822 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
823
824 smpAssign( *lhs, rhs.matrix_ );
825 smpAssign( *lhs, (*lhs) / rhs.scalar_ );
826 }
828 //**********************************************************************************************
829
830 //**SMP assignment to sparse matrices***********************************************************
844 template< typename MT2 // Type of the target sparse matrix
845 , bool SO2 > // Storage order of the target sparse matrix
846 friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
847 -> EnableIf_t< UseSMPAssign_v<MT2> >
848 {
850
851 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
852 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
853
854 smpAssign( *lhs, rhs.matrix_ );
855 (*lhs) /= rhs.scalar_;
856 }
858 //**********************************************************************************************
859
860 //**SMP addition assignment to dense matrices***************************************************
874 template< typename MT2 // Type of the target dense matrix
875 , bool SO2 > // Storage order of the target dense matrix
876 friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
877 -> EnableIf_t< UseSMPAssign_v<MT2> >
878 {
880
884
885 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
886 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
887
888 const ResultType tmp( rhs );
889 smpAddAssign( *lhs, tmp );
890 }
892 //**********************************************************************************************
893
894 //**SMP addition assignment to sparse matrices**************************************************
895 // No special implementation for the SMP addition assignment to sparse matrices.
896 //**********************************************************************************************
897
898 //**SMP subtraction assignment to dense matrices************************************************
912 template< typename MT2 // Type of the target dense matrix
913 , bool SO2 > // Storage order of the target dense matrix
914 friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
915 -> EnableIf_t< UseSMPAssign_v<MT2> >
916 {
918
922
923 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
924 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
925
926 const ResultType tmp( rhs );
927 smpSubAssign( *lhs, tmp );
928 }
930 //**********************************************************************************************
931
932 //**SMP subtraction assignment to sparse matrices***********************************************
933 // No special implementation for the SMP subtraction assignment to sparse matrices.
934 //**********************************************************************************************
935
936 //**SMP Schur product assignment to dense matrices**********************************************
950 template< typename MT2 // Type of the target dense matrix
951 , bool SO2 > // Storage order of the target dense matrix
952 friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
953 -> EnableIf_t< UseSMPAssign_v<MT2> >
954 {
956
960
961 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
962 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
963
964 const ResultType tmp( rhs );
965 smpSchurAssign( *lhs, tmp );
966 }
968 //**********************************************************************************************
969
970 //**SMP Schur product assignment to sparse matrices*********************************************
971 // No special implementation for the SMP Schur product assignment to sparse matrices.
972 //**********************************************************************************************
973
974 //**SMP multiplication assignment to dense matrices*********************************************
975 // No special implementation for the SMP multiplication assignment to dense matrices.
976 //**********************************************************************************************
977
978 //**SMP multiplication assignment to sparse matrices********************************************
979 // No special implementation for the SMP multiplication assignment to sparse matrices.
980 //**********************************************************************************************
981
982 //**Compile time checks*************************************************************************
991 //**********************************************************************************************
992};
993//*************************************************************************************************
994
995
996
997
998//=================================================================================================
999//
1000// GLOBAL BINARY ARITHMETIC OPERATORS
1001//
1002//=================================================================================================
1003
1004//*************************************************************************************************
1009template< typename MT // Type of the left-hand side dense matrix
1010 , typename ST > // Type of the right-hand side scalar
1011using DMatScalarDivExprHelper_t =
1012 If_t< IsFloatingPoint_v< UnderlyingBuiltin_t<MT> > ||
1013 IsFloatingPoint_v< UnderlyingBuiltin_t<ST> >
1014 , If_t< IsBuiltin_v<ST>
1015 , DivTrait_t< UnderlyingBuiltin_t<MT>, ST >
1016 , decltype( inv( std::declval<ST>() ) ) >
1017 , ST >;
1019//*************************************************************************************************
1020
1021
1022//*************************************************************************************************
1034template< typename MT // Type of the left-hand side dense matrix
1035 , bool SO // Storage order of the left-hand side dense matrix
1036 , typename ST // Type of the right-hand side scalar
1037 , EnableIf_t< !IsInvertible_v< DMatScalarDivExprHelper_t<MT,ST> > >* = nullptr >
1038inline decltype(auto) dmatscalardiv( const DenseMatrix<MT,SO>& mat, ST scalar )
1039{
1041
1042 using ScalarType = DMatScalarDivExprHelper_t<MT,ST>;
1043 using ReturnType = const DMatScalarDivExpr<MT,ScalarType,SO>;
1044
1045 return ReturnType( *mat, scalar );
1046}
1048//*************************************************************************************************
1049
1050
1051//*************************************************************************************************
1063template< typename MT // Type of the left-hand side dense matrix
1064 , bool SO // Storage order of the left-hand side dense matrix
1065 , typename ST // Type of the right-hand side scalar
1066 , EnableIf_t< IsInvertible_v< DMatScalarDivExprHelper_t<MT,ST> > >* = nullptr >
1067inline decltype(auto) dmatscalardiv( const DenseMatrix<MT,SO>& mat, ST scalar )
1068{
1070
1071 using ScalarType = DMatScalarDivExprHelper_t<MT,ST>;
1072 using ReturnType = const DMatScalarMultExpr<MT,ScalarType,SO>;
1073
1074 return ReturnType( *mat, inv(scalar) );
1075}
1077//*************************************************************************************************
1078
1079
1080//*************************************************************************************************
1102template< typename MT // Type of the left-hand side dense matrix
1103 , bool SO // Storage order of the left-hand side dense matrix
1104 , typename ST // Type of the right-hand side scalar
1105 , EnableIf_t< IsScalar_v<ST> >* = nullptr >
1106inline decltype(auto) operator/( const DenseMatrix<MT,SO>& mat, ST scalar )
1107{
1109
1110 BLAZE_USER_ASSERT( scalar != ST{}, "Division by zero detected" );
1111
1112 return dmatscalardiv( *mat, scalar );
1113}
1114//*************************************************************************************************
1115
1116
1117
1118
1119//=================================================================================================
1120//
1121// ISALIGNED SPECIALIZATIONS
1122//
1123//=================================================================================================
1124
1125//*************************************************************************************************
1127template< typename MT, typename ST, bool SO >
1128struct IsAligned< DMatScalarDivExpr<MT,ST,SO> >
1129 : public IsAligned<MT>
1130{};
1132//*************************************************************************************************
1133
1134
1135
1136
1137//=================================================================================================
1138//
1139// ISPADDED SPECIALIZATIONS
1140//
1141//=================================================================================================
1142
1143//*************************************************************************************************
1145template< typename MT, typename ST, bool SO >
1146struct IsPadded< DMatScalarDivExpr<MT,ST,SO> >
1147 : public IsPadded<MT>
1148{};
1150//*************************************************************************************************
1151
1152} // namespace blaze
1153
1154#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::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
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.
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 matrix.
Definition: DMatScalarDivExpr.h:190
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:194
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarDivExpr.h:196
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarDivExpr.h:262
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarDivExpr.h:272
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarDivExpr.h:380
ReferenceType reference
Reference return type.
Definition: DMatScalarDivExpr.h:203
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarDivExpr.h:283
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarDivExpr.h:200
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:369
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:336
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarDivExpr.h:216
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarDivExpr.h:303
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarDivExpr.h:293
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarDivExpr.h:251
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarDivExpr.h:392
IteratorType iterator_
Iterator to the current element.
Definition: DMatScalarDivExpr.h:423
DifferenceType difference_type
Difference between two iterators.
Definition: DMatScalarDivExpr.h:204
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarDivExpr.h:416
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:325
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarDivExpr.h:240
ElementType * PointerType
Pointer return type.
Definition: DMatScalarDivExpr.h:195
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarDivExpr.h:424
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarDivExpr.h:404
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarDivExpr.h:228
ConstIterator_t< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:207
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:201
PointerType pointer
Pointer return type.
Definition: DMatScalarDivExpr.h:202
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:358
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarDivExpr.h:193
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatScalarDivExpr.h:197
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:314
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:347
Expression object for divisions of a dense matrix by a scalar.
Definition: DMatScalarDivExpr.h:107
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatScalarDivExpr.h:436
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatScalarDivExpr.h:522
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarDivExpr.h:606
ElementType_t< MT > ET
Element type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:112
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarDivExpr.h:596
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition: DMatScalarDivExpr.h:123
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarDivExpr.h:183
ReturnType_t< MT > RN
Return type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:111
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatScalarDivExpr.h:542
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DMatScalarDivExpr.h:562
LeftOperand matrix_
Left-hand side dense matrix of the division expression.
Definition: DMatScalarDivExpr.h:614
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatScalarDivExpr.h:511
If_t< IsExpression_v< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarDivExpr.h:180
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarDivExpr.h:574
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DMatScalarDivExpr.h:174
DivTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DMatScalarDivExpr.h:168
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatScalarDivExpr.h:496
CompositeType_t< MT > CT
Composite type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:113
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatScalarDivExpr.h:532
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarDivExpr.h:169
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DMatScalarDivExpr.h:615
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatScalarDivExpr.h:552
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatScalarDivExpr.h:478
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatScalarDivExpr.h:431
If_t< useAssign, const ResultType, const DMatScalarDivExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatScalarDivExpr.h:177
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarDivExpr.h:170
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:110
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatScalarDivExpr.h:463
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatScalarDivExpr.h:171
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the division expression.
Definition: DMatScalarDivExpr.h:137
DMatScalarDivExpr(const MT &matrix, ST scalar) noexcept
Constructor for the DMatScalarDivExpr class.
Definition: DMatScalarDivExpr.h:450
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatScalarDivExpr.h:441
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarDivExpr.h:586
decltype(std::declval< RN >()/std::declval< ST >()) ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarDivExpr.h:126
Base class for dense matrices.
Definition: DenseMatrix.h:82
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseMatrix base class.
Header file for the MatScalarDivExpr 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_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
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 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 smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
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.
Constraints on the storage order of matrix types.
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 matrix/scalar division expression templates.
Definition: MatScalarDivExpr.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.