Blaze  3.6
Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ROW_DENSE_H_
36 #define _BLAZE_MATH_VIEWS_ROW_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <algorithm>
44 #include <iterator>
45 #include <blaze/math/Aliases.h>
58 #include <blaze/math/Exception.h>
62 #include <blaze/math/shims/Clear.h>
64 #include <blaze/math/shims/Reset.h>
65 #include <blaze/math/SIMD.h>
85 #include <blaze/math/views/Check.h>
88 #include <blaze/system/CacheSize.h>
89 #include <blaze/system/Inline.h>
92 #include <blaze/util/Assert.h>
96 #include <blaze/util/DisableIf.h>
97 #include <blaze/util/EnableIf.h>
98 #include <blaze/util/mpl/If.h>
99 #include <blaze/util/TypeList.h>
100 #include <blaze/util/Types.h>
103 
104 
105 namespace blaze {
106 
107 //=================================================================================================
108 //
109 // CLASS TEMPLATE SPECIALIZATION FOR ROW-MAJOR DENSE MATRICES
110 //
111 //=================================================================================================
112 
113 //*************************************************************************************************
121 template< typename MT // Type of the dense matrix
122  , bool SF // Symmetry flag
123  , size_t... CRAs > // Compile time row arguments
124 class Row<MT,true,true,SF,CRAs...>
125  : public View< DenseVector< Row<MT,true,true,SF,CRAs...>, true > >
126  , private RowData<CRAs...>
127 {
128  private:
129  //**Type definitions****************************************************************************
130  using DataType = RowData<CRAs...>;
131  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
132  //**********************************************************************************************
133 
134  public:
135  //**Type definitions****************************************************************************
137  using This = Row<MT,true,true,SF,CRAs...>;
138 
139  using BaseType = DenseVector<This,true>;
140  using ViewedType = MT;
141  using ResultType = RowTrait_t<MT,CRAs...>;
142  using TransposeType = TransposeType_t<ResultType>;
143  using ElementType = ElementType_t<MT>;
144  using SIMDType = SIMDTrait_t<ElementType>;
145  using ReturnType = ReturnType_t<MT>;
146  using CompositeType = const Row&;
147 
149  using ConstReference = ConstReference_t<MT>;
150 
152  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
153 
155  using ConstPointer = ConstPointer_t<MT>;
156 
158  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
159 
161  using ConstIterator = ConstIterator_t<MT>;
162 
164  using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
165  //**********************************************************************************************
166 
167  //**Compilation flags***************************************************************************
169  static constexpr bool simdEnabled = MT::simdEnabled;
170 
172  static constexpr bool smpAssignable = MT::smpAssignable;
173 
175  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
176  //**********************************************************************************************
177 
178  //**Constructors********************************************************************************
181  template< typename... RRAs >
182  explicit inline Row( MT& matrix, RRAs... args );
183 
184  Row( const Row& ) = default;
186  //**********************************************************************************************
187 
188  //**Destructor**********************************************************************************
191  ~Row() = default;
193  //**********************************************************************************************
194 
195  //**Data access functions***********************************************************************
198  inline Reference operator[]( size_t index );
199  inline ConstReference operator[]( size_t index ) const;
200  inline Reference at( size_t index );
201  inline ConstReference at( size_t index ) const;
202  inline Pointer data () noexcept;
203  inline ConstPointer data () const noexcept;
204  inline Iterator begin ();
205  inline ConstIterator begin () const;
206  inline ConstIterator cbegin() const;
207  inline Iterator end ();
208  inline ConstIterator end () const;
209  inline ConstIterator cend () const;
211  //**********************************************************************************************
212 
213  //**Assignment operators************************************************************************
216  inline Row& operator=( const ElementType& rhs );
217  inline Row& operator=( initializer_list<ElementType> list );
218  inline Row& operator=( const Row& rhs );
219 
220  template< typename VT > inline Row& operator= ( const Vector<VT,true>& rhs );
221  template< typename VT > inline Row& operator+=( const Vector<VT,true>& rhs );
222  template< typename VT > inline Row& operator-=( const Vector<VT,true>& rhs );
223  template< typename VT > inline Row& operator*=( const Vector<VT,true>& rhs );
224  template< typename VT > inline Row& operator/=( const DenseVector<VT,true>& rhs );
225  template< typename VT > inline Row& operator%=( const Vector<VT,true>& rhs );
227  //**********************************************************************************************
228 
229  //**Utility functions***************************************************************************
232  using DataType::row;
233 
234  inline MT& operand() noexcept;
235  inline const MT& operand() const noexcept;
236 
237  inline size_t size() const noexcept;
238  inline size_t spacing() const noexcept;
239  inline size_t capacity() const noexcept;
240  inline size_t nonZeros() const;
241  inline void reset();
243  //**********************************************************************************************
244 
245  //**Numeric functions***************************************************************************
248  template< typename Other > inline Row& scale( const Other& scalar );
250  //**********************************************************************************************
251 
252  private:
253  //**********************************************************************************************
255  template< typename VT >
256  static constexpr bool VectorizedAssign_v =
257  ( useOptimizedKernels &&
258  simdEnabled && VT::simdEnabled &&
259  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > );
260  //**********************************************************************************************
261 
262  //**********************************************************************************************
264  template< typename VT >
265  static constexpr bool VectorizedAddAssign_v =
266  ( useOptimizedKernels &&
267  simdEnabled && VT::simdEnabled &&
268  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
269  HasSIMDAdd_v< ElementType, ElementType_t<VT> > );
270  //**********************************************************************************************
271 
272  //**********************************************************************************************
274  template< typename VT >
275  static constexpr bool VectorizedSubAssign_v =
276  ( useOptimizedKernels &&
277  simdEnabled && VT::simdEnabled &&
278  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
279  HasSIMDSub_v< ElementType, ElementType_t<VT> > );
280  //**********************************************************************************************
281 
282  //**********************************************************************************************
284  template< typename VT >
285  static constexpr bool VectorizedMultAssign_v =
286  ( useOptimizedKernels &&
287  simdEnabled && VT::simdEnabled &&
288  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
289  HasSIMDMult_v< ElementType, ElementType_t<VT> > );
290  //**********************************************************************************************
291 
292  //**********************************************************************************************
294  template< typename VT >
295  static constexpr bool VectorizedDivAssign_v =
296  ( useOptimizedKernels &&
297  simdEnabled && VT::simdEnabled &&
298  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
299  HasSIMDDiv_v< ElementType, ElementType_t<VT> > );
300  //**********************************************************************************************
301 
302  //**SIMD properties*****************************************************************************
304  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
305  //**********************************************************************************************
306 
307  public:
308  //**Expression template evaluation functions****************************************************
311  template< typename Other >
312  inline bool canAlias( const Other* alias ) const noexcept;
313 
314  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
315  inline bool canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
316 
317  template< typename Other >
318  inline bool isAliased( const Other* alias ) const noexcept;
319 
320  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
321  inline bool isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
322 
323  inline bool isAligned () const noexcept;
324  inline bool canSMPAssign() const noexcept;
325 
326  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
327  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
328  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
329 
330  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
331  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
332  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
333  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
334 
335  template< typename VT >
336  inline auto assign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedAssign_v<VT> >;
337 
338  template< typename VT >
339  inline auto assign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedAssign_v<VT> >;
340 
341  template< typename VT > inline void assign( const SparseVector<VT,true>& rhs );
342 
343  template< typename VT >
344  inline auto addAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedAddAssign_v<VT> >;
345 
346  template< typename VT >
347  inline auto addAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedAddAssign_v<VT> >;
348 
349  template< typename VT > inline void addAssign( const SparseVector<VT,true>& rhs );
350 
351  template< typename VT >
352  inline auto subAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedSubAssign_v<VT> >;
353 
354  template< typename VT >
355  inline auto subAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedSubAssign_v<VT> >;
356 
357  template< typename VT > inline void subAssign( const SparseVector<VT,true>& rhs );
358 
359  template< typename VT >
360  inline auto multAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedMultAssign_v<VT> >;
361 
362  template< typename VT >
363  inline auto multAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedMultAssign_v<VT> >;
364 
365  template< typename VT > inline void multAssign( const SparseVector<VT,true>& rhs );
366 
367  template< typename VT >
368  inline auto divAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedDivAssign_v<VT> >;
369 
370  template< typename VT >
371  inline auto divAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedDivAssign_v<VT> >;
373  //**********************************************************************************************
374 
375  private:
376  //**Member variables****************************************************************************
379  Operand matrix_;
380 
381  //**********************************************************************************************
382 
383  //**Friend declarations*************************************************************************
384  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CRAs2 > friend class Row;
385  //**********************************************************************************************
386 
387  //**Compile time checks*************************************************************************
395  //**********************************************************************************************
396 };
398 //*************************************************************************************************
399 
400 
401 
402 
403 //=================================================================================================
404 //
405 // CONSTRUCTORS
406 //
407 //=================================================================================================
408 
409 //*************************************************************************************************
422 template< typename MT // Type of the dense matrix
423  , bool SF // Symmetry flag
424  , size_t... CRAs > // Compile time row arguments
425 template< typename... RRAs > // Runtime row arguments
426 inline Row<MT,true,true,SF,CRAs...>::Row( MT& matrix, RRAs... args )
427  : DataType( args... ) // Base class initialization
428  , matrix_ ( matrix ) // The matrix containing the row
429 {
430  if( !Contains_v< TypeList<RRAs...>, Unchecked > ) {
431  if( matrix_.rows() <= row() ) {
432  BLAZE_THROW_INVALID_ARGUMENT( "Invalid row access index" );
433  }
434  }
435  else {
436  BLAZE_USER_ASSERT( row() < matrix_.rows(), "Invalid row access index" );
437  }
438 }
440 //*************************************************************************************************
441 
442 
443 
444 
445 //=================================================================================================
446 //
447 // DATA ACCESS FUNCTIONS
448 //
449 //=================================================================================================
450 
451 //*************************************************************************************************
461 template< typename MT // Type of the dense matrix
462  , bool SF // Symmetry flag
463  , size_t... CRAs > // Compile time row arguments
464 inline typename Row<MT,true,true,SF,CRAs...>::Reference
465  Row<MT,true,true,SF,CRAs...>::operator[]( size_t index )
466 {
467  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
468  return matrix_(row(),index);
469 }
471 //*************************************************************************************************
472 
473 
474 //*************************************************************************************************
484 template< typename MT // Type of the dense matrix
485  , bool SF // Symmetry flag
486  , size_t... CRAs > // Compile time row arguments
487 inline typename Row<MT,true,true,SF,CRAs...>::ConstReference
488  Row<MT,true,true,SF,CRAs...>::operator[]( size_t index ) const
489 {
490  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
491  return const_cast<const MT&>( matrix_ )(row(),index);
492 }
494 //*************************************************************************************************
495 
496 
497 //*************************************************************************************************
508 template< typename MT // Type of the dense matrix
509  , bool SF // Symmetry flag
510  , size_t... CRAs > // Compile time row arguments
511 inline typename Row<MT,true,true,SF,CRAs...>::Reference
512  Row<MT,true,true,SF,CRAs...>::at( size_t index )
513 {
514  if( index >= size() ) {
515  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
516  }
517  return (*this)[index];
518 }
520 //*************************************************************************************************
521 
522 
523 //*************************************************************************************************
534 template< typename MT // Type of the dense matrix
535  , bool SF // Symmetry flag
536  , size_t... CRAs > // Compile time row arguments
537 inline typename Row<MT,true,true,SF,CRAs...>::ConstReference
538  Row<MT,true,true,SF,CRAs...>::at( size_t index ) const
539 {
540  if( index >= size() ) {
541  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
542  }
543  return (*this)[index];
544 }
546 //*************************************************************************************************
547 
548 
549 //*************************************************************************************************
558 template< typename MT // Type of the dense matrix
559  , bool SF // Symmetry flag
560  , size_t... CRAs > // Compile time row arguments
561 inline typename Row<MT,true,true,SF,CRAs...>::Pointer
563 {
564  return matrix_.data( row() );
565 }
567 //*************************************************************************************************
568 
569 
570 //*************************************************************************************************
579 template< typename MT // Type of the dense matrix
580  , bool SF // Symmetry flag
581  , size_t... CRAs > // Compile time row arguments
582 inline typename Row<MT,true,true,SF,CRAs...>::ConstPointer
583  Row<MT,true,true,SF,CRAs...>::data() const noexcept
584 {
585  return matrix_.data( row() );
586 }
588 //*************************************************************************************************
589 
590 
591 //*************************************************************************************************
599 template< typename MT // Type of the dense matrix
600  , bool SF // Symmetry flag
601  , size_t... CRAs > // Compile time row arguments
602 inline typename Row<MT,true,true,SF,CRAs...>::Iterator
604 {
605  return matrix_.begin( row() );
606 }
608 //*************************************************************************************************
609 
610 
611 //*************************************************************************************************
619 template< typename MT // Type of the dense matrix
620  , bool SF // Symmetry flag
621  , size_t... CRAs > // Compile time row arguments
622 inline typename Row<MT,true,true,SF,CRAs...>::ConstIterator
624 {
625  return matrix_.cbegin( row() );
626 }
628 //*************************************************************************************************
629 
630 
631 //*************************************************************************************************
639 template< typename MT // Type of the dense matrix
640  , bool SF // Symmetry flag
641  , size_t... CRAs > // Compile time row arguments
642 inline typename Row<MT,true,true,SF,CRAs...>::ConstIterator
644 {
645  return matrix_.cbegin( row() );
646 }
648 //*************************************************************************************************
649 
650 
651 //*************************************************************************************************
659 template< typename MT // Type of the dense matrix
660  , bool SF // Symmetry flag
661  , size_t... CRAs > // Compile time row arguments
662 inline typename Row<MT,true,true,SF,CRAs...>::Iterator
664 {
665  return matrix_.end( row() );
666 }
668 //*************************************************************************************************
669 
670 
671 //*************************************************************************************************
679 template< typename MT // Type of the dense matrix
680  , bool SF // Symmetry flag
681  , size_t... CRAs > // Compile time row arguments
682 inline typename Row<MT,true,true,SF,CRAs...>::ConstIterator
684 {
685  return matrix_.cend( row() );
686 }
688 //*************************************************************************************************
689 
690 
691 //*************************************************************************************************
699 template< typename MT // Type of the dense matrix
700  , bool SF // Symmetry flag
701  , size_t... CRAs > // Compile time row arguments
702 inline typename Row<MT,true,true,SF,CRAs...>::ConstIterator
704 {
705  return matrix_.cend( row() );
706 }
708 //*************************************************************************************************
709 
710 
711 
712 
713 //=================================================================================================
714 //
715 // ASSIGNMENT OPERATORS
716 //
717 //=================================================================================================
718 
719 //*************************************************************************************************
730 template< typename MT // Type of the dense matrix
731  , bool SF // Symmetry flag
732  , size_t... CRAs > // Compile time row arguments
733 inline Row<MT,true,true,SF,CRAs...>&
734  Row<MT,true,true,SF,CRAs...>::operator=( const ElementType& rhs )
735 {
736  decltype(auto) left( derestrict( matrix_ ) );
737 
738  const size_t jbegin( ( IsUpper_v<MT> )
739  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
740  ?( row()+1UL )
741  :( row() ) )
742  :( 0UL ) );
743  const size_t jend ( ( IsLower_v<MT> )
744  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
745  ?( row() )
746  :( row()+1UL ) )
747  :( size() ) );
748 
749  for( size_t j=jbegin; j<jend; ++j ) {
750  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, row(), j, rhs ) )
751  left(row(),j) = rhs;
752  }
753 
754  return *this;
755 }
757 //*************************************************************************************************
758 
759 
760 //*************************************************************************************************
775 template< typename MT // Type of the dense matrix
776  , bool SF // Symmetry flag
777  , size_t... CRAs > // Compile time row arguments
778 inline Row<MT,true,true,SF,CRAs...>&
779  Row<MT,true,true,SF,CRAs...>::operator=( initializer_list<ElementType> list )
780 {
781  if( list.size() > size() ) {
782  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to row" );
783  }
784 
785  if( IsRestricted_v<MT> ) {
786  const InitializerVector<ElementType,true> tmp( list, size() );
787  if( !tryAssign( matrix_, tmp, row(), 0UL ) ) {
788  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
789  }
790  }
791 
792  decltype(auto) left( derestrict( *this ) );
793 
794  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
795 
796  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
797 
798  return *this;
799 }
801 //*************************************************************************************************
802 
803 
804 //*************************************************************************************************
818 template< typename MT // Type of the dense matrix
819  , bool SF // Symmetry flag
820  , size_t... CRAs > // Compile time row arguments
821 inline Row<MT,true,true,SF,CRAs...>&
822  Row<MT,true,true,SF,CRAs...>::operator=( const Row& rhs )
823 {
824  if( &rhs == this ) return *this;
825 
826  if( size() != rhs.size() ) {
827  BLAZE_THROW_INVALID_ARGUMENT( "Row sizes do not match" );
828  }
829 
830  if( !tryAssign( matrix_, rhs, row(), 0UL ) ) {
831  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
832  }
833 
834  decltype(auto) left( derestrict( *this ) );
835 
836  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
837  const ResultType tmp( rhs );
838  smpAssign( left, tmp );
839  }
840  else {
841  smpAssign( left, rhs );
842  }
843 
844  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
845 
846  return *this;
847 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
866 template< typename MT // Type of the dense matrix
867  , bool SF // Symmetry flag
868  , size_t... CRAs > // Compile time row arguments
869 template< typename VT > // Type of the right-hand side vector
870 inline Row<MT,true,true,SF,CRAs...>&
871  Row<MT,true,true,SF,CRAs...>::operator=( const Vector<VT,true>& rhs )
872 {
873  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
875 
876  if( size() != (~rhs).size() ) {
877  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
878  }
879 
880  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
881  Right right( ~rhs );
882 
883  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
884  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
885  }
886 
887  decltype(auto) left( derestrict( *this ) );
888 
889  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
890  const ResultType_t<VT> tmp( right );
891  smpAssign( left, tmp );
892  }
893  else {
894  if( IsSparseVector_v<VT> )
895  reset();
896  smpAssign( left, right );
897  }
898 
899  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
900 
901  return *this;
902 }
904 //*************************************************************************************************
905 
906 
907 //*************************************************************************************************
921 template< typename MT // Type of the dense matrix
922  , bool SF // Symmetry flag
923  , size_t... CRAs > // Compile time row arguments
924 template< typename VT > // Type of the right-hand side vector
925 inline Row<MT,true,true,SF,CRAs...>&
926  Row<MT,true,true,SF,CRAs...>::operator+=( const Vector<VT,true>& rhs )
927 {
928  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
930 
931  if( size() != (~rhs).size() ) {
932  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
933  }
934 
935  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
936  Right right( ~rhs );
937 
938  if( !tryAddAssign( matrix_, right, row(), 0UL ) ) {
939  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
940  }
941 
942  decltype(auto) left( derestrict( *this ) );
943 
944  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
945  const ResultType_t<VT> tmp( right );
946  smpAddAssign( left, tmp );
947  }
948  else {
949  smpAddAssign( left, right );
950  }
951 
952  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
953 
954  return *this;
955 }
957 //*************************************************************************************************
958 
959 
960 //*************************************************************************************************
974 template< typename MT // Type of the dense matrix
975  , bool SF // Symmetry flag
976  , size_t... CRAs > // Compile time row arguments
977 template< typename VT > // Type of the right-hand side vector
978 inline Row<MT,true,true,SF,CRAs...>&
979  Row<MT,true,true,SF,CRAs...>::operator-=( const Vector<VT,true>& rhs )
980 {
981  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
983 
984  if( size() != (~rhs).size() ) {
985  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
986  }
987 
988  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
989  Right right( ~rhs );
990 
991  if( !trySubAssign( matrix_, right, row(), 0UL ) ) {
992  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
993  }
994 
995  decltype(auto) left( derestrict( *this ) );
996 
997  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
998  const ResultType_t<VT> tmp( right );
999  smpSubAssign( left, tmp );
1000  }
1001  else {
1002  smpSubAssign( left, right );
1003  }
1004 
1005  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1006 
1007  return *this;
1008 }
1010 //*************************************************************************************************
1011 
1012 
1013 //*************************************************************************************************
1026 template< typename MT // Type of the dense matrix
1027  , bool SF // Symmetry flag
1028  , size_t... CRAs > // Compile time row arguments
1029 template< typename VT > // Type of the right-hand side vector
1030 inline Row<MT,true,true,SF,CRAs...>&
1031  Row<MT,true,true,SF,CRAs...>::operator*=( const Vector<VT,true>& rhs )
1032 {
1033  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
1035 
1036  if( size() != (~rhs).size() ) {
1037  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1038  }
1039 
1040  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
1041  Right right( ~rhs );
1042 
1043  if( !tryMultAssign( matrix_, right, row(), 0UL ) ) {
1044  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1045  }
1046 
1047  decltype(auto) left( derestrict( *this ) );
1048 
1049  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1050  const ResultType_t<VT> tmp( right );
1051  smpMultAssign( left, tmp );
1052  }
1053  else {
1054  smpMultAssign( left, right );
1055  }
1056 
1057  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1058 
1059  return *this;
1060 }
1062 //*************************************************************************************************
1063 
1064 
1065 //*************************************************************************************************
1077 template< typename MT // Type of the dense matrix
1078  , bool SF // Symmetry flag
1079  , size_t... CRAs > // Compile time row arguments
1080 template< typename VT > // Type of the right-hand side dense vector
1081 inline Row<MT,true,true,SF,CRAs...>&
1082  Row<MT,true,true,SF,CRAs...>::operator/=( const DenseVector<VT,true>& rhs )
1083 {
1084  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
1086 
1087  if( size() != (~rhs).size() ) {
1088  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1089  }
1090 
1091  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
1092  Right right( ~rhs );
1093 
1094  if( !tryDivAssign( matrix_, right, row(), 0UL ) ) {
1095  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1096  }
1097 
1098  decltype(auto) left( derestrict( *this ) );
1099 
1100  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1101  const ResultType_t<VT> tmp( right );
1102  smpDivAssign( left, tmp );
1103  }
1104  else {
1105  smpDivAssign( left, right );
1106  }
1107 
1108  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1109 
1110  return *this;
1111 }
1113 //*************************************************************************************************
1114 
1115 
1116 //*************************************************************************************************
1129 template< typename MT // Type of the dense matrix
1130  , bool SF // Symmetry flag
1131  , size_t... CRAs > // Compile time row arguments
1132 template< typename VT > // Type of the right-hand side vector
1133 inline Row<MT,true,true,SF,CRAs...>&
1134  Row<MT,true,true,SF,CRAs...>::operator%=( const Vector<VT,true>& rhs )
1135 {
1136  using blaze::assign;
1137 
1138  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
1140 
1141  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
1142 
1146 
1147  if( size() != 3UL || (~rhs).size() != 3UL ) {
1148  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1149  }
1150 
1151  const CrossType right( *this % (~rhs) );
1152 
1153  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
1154  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1155  }
1156 
1157  decltype(auto) left( derestrict( *this ) );
1158 
1159  assign( left, right );
1160 
1161  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1162 
1163  return *this;
1164 }
1166 //*************************************************************************************************
1167 
1168 
1169 
1170 
1171 //=================================================================================================
1172 //
1173 // UTILITY FUNCTIONS
1174 //
1175 //=================================================================================================
1176 
1177 //*************************************************************************************************
1183 template< typename MT // Type of the dense matrix
1184  , bool SF // Symmetry flag
1185  , size_t... CRAs > // Compile time row arguments
1186 inline MT& Row<MT,true,true,SF,CRAs...>::operand() noexcept
1187 {
1188  return matrix_;
1189 }
1191 //*************************************************************************************************
1192 
1193 
1194 //*************************************************************************************************
1200 template< typename MT // Type of the dense matrix
1201  , bool SF // Symmetry flag
1202  , size_t... CRAs > // Compile time row arguments
1203 inline const MT& Row<MT,true,true,SF,CRAs...>::operand() const noexcept
1204 {
1205  return matrix_;
1206 }
1208 //*************************************************************************************************
1209 
1210 
1211 //*************************************************************************************************
1217 template< typename MT // Type of the dense matrix
1218  , bool SF // Symmetry flag
1219  , size_t... CRAs > // Compile time row arguments
1220 inline size_t Row<MT,true,true,SF,CRAs...>::size() const noexcept
1221 {
1222  return matrix_.columns();
1223 }
1225 //*************************************************************************************************
1226 
1227 
1228 //*************************************************************************************************
1237 template< typename MT // Type of the dense matrix
1238  , bool SF // Symmetry flag
1239  , size_t... CRAs > // Compile time row arguments
1240 inline size_t Row<MT,true,true,SF,CRAs...>::spacing() const noexcept
1241 {
1242  return matrix_.spacing();
1243 }
1245 //*************************************************************************************************
1246 
1247 
1248 //*************************************************************************************************
1254 template< typename MT // Type of the dense matrix
1255  , bool SF // Symmetry flag
1256  , size_t... CRAs > // Compile time row arguments
1257 inline size_t Row<MT,true,true,SF,CRAs...>::capacity() const noexcept
1258 {
1259  return matrix_.capacity( row() );
1260 }
1262 //*************************************************************************************************
1263 
1264 
1265 //*************************************************************************************************
1274 template< typename MT // Type of the dense matrix
1275  , bool SF // Symmetry flag
1276  , size_t... CRAs > // Compile time row arguments
1277 inline size_t Row<MT,true,true,SF,CRAs...>::nonZeros() const
1278 {
1279  return matrix_.nonZeros( row() );
1280 }
1282 //*************************************************************************************************
1283 
1284 
1285 //*************************************************************************************************
1291 template< typename MT // Type of the dense matrix
1292  , bool SF // Symmetry flag
1293  , size_t... CRAs > // Compile time row arguments
1295 {
1296  matrix_.reset( row() );
1297 }
1299 //*************************************************************************************************
1300 
1301 
1302 
1303 
1304 //=================================================================================================
1305 //
1306 // NUMERIC FUNCTIONS
1307 //
1308 //=================================================================================================
1309 
1310 //*************************************************************************************************
1323 template< typename MT // Type of the dense matrix
1324  , bool SF // Symmetry flag
1325  , size_t... CRAs > // Compile time row arguments
1326 template< typename Other > // Data type of the scalar value
1327 inline Row<MT,true,true,SF,CRAs...>&
1328  Row<MT,true,true,SF,CRAs...>::scale( const Other& scalar )
1329 {
1331 
1332  const size_t jbegin( ( IsUpper_v<MT> )
1333  ?( ( IsStrictlyUpper_v<MT> )
1334  ?( row()+1UL )
1335  :( row() ) )
1336  :( 0UL ) );
1337  const size_t jend ( ( IsLower_v<MT> )
1338  ?( ( IsStrictlyLower_v<MT> )
1339  ?( row() )
1340  :( row()+1UL ) )
1341  :( size() ) );
1342 
1343  for( size_t j=jbegin; j<jend; ++j ) {
1344  matrix_(row(),j) *= scalar;
1345  }
1346 
1347  return *this;
1348 }
1350 //*************************************************************************************************
1351 
1352 
1353 
1354 
1355 //=================================================================================================
1356 //
1357 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1358 //
1359 //=================================================================================================
1360 
1361 //*************************************************************************************************
1372 template< typename MT // Type of the dense matrix
1373  , bool SF // Symmetry flag
1374  , size_t... CRAs > // Compile time row arguments
1375 template< typename Other > // Data type of the foreign expression
1376 inline bool Row<MT,true,true,SF,CRAs...>::canAlias( const Other* alias ) const noexcept
1377 {
1378  return matrix_.isAliased( alias );
1379 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1395 template< typename MT // Type of the dense matrix
1396  , bool SF // Symmetry flag
1397  , size_t... CRAs > // Compile time row arguments
1398 template< typename MT2 // Data type of the foreign dense row
1399  , bool SO2 // Storage order of the foreign dense row
1400  , bool SF2 // Symmetry flag of the foreign dense row
1401  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
1402 inline bool
1403  Row<MT,true,true,SF,CRAs...>::canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
1404 {
1405  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
1406 }
1408 //*************************************************************************************************
1409 
1410 
1411 //*************************************************************************************************
1422 template< typename MT // Type of the dense matrix
1423  , bool SF // Symmetry flag
1424  , size_t... CRAs > // Compile time row arguments
1425 template< typename Other > // Data type of the foreign expression
1426 inline bool Row<MT,true,true,SF,CRAs...>::isAliased( const Other* alias ) const noexcept
1427 {
1428  return matrix_.isAliased( alias );
1429 }
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1445 template< typename MT // Type of the dense matrix
1446  , bool SF // Symmetry flag
1447  , size_t... CRAs > // Compile time row arguments
1448 template< typename MT2 // Data type of the foreign dense row
1449  , bool SO2 // Storage order of the foreign dense row
1450  , bool SF2 // Symmetry flag of the foreign dense row
1451  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
1452 inline bool
1453  Row<MT,true,true,SF,CRAs...>::isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
1454 {
1455  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
1456 }
1458 //*************************************************************************************************
1459 
1460 
1461 //*************************************************************************************************
1471 template< typename MT // Type of the dense matrix
1472  , bool SF // Symmetry flag
1473  , size_t... CRAs > // Compile time row arguments
1474 inline bool Row<MT,true,true,SF,CRAs...>::isAligned() const noexcept
1475 {
1476  return matrix_.isAligned();
1477 }
1479 //*************************************************************************************************
1480 
1481 
1482 //*************************************************************************************************
1493 template< typename MT // Type of the dense matrix
1494  , bool SF // Symmetry flag
1495  , size_t... CRAs > // Compile time row arguments
1496 inline bool Row<MT,true,true,SF,CRAs...>::canSMPAssign() const noexcept
1497 {
1498  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1499 }
1501 //*************************************************************************************************
1502 
1503 
1504 //*************************************************************************************************
1517 template< typename MT // Type of the dense matrix
1518  , bool SF // Symmetry flag
1519  , size_t... CRAs > // Compile time row arguments
1520 BLAZE_ALWAYS_INLINE typename Row<MT,true,true,SF,CRAs...>::SIMDType
1521  Row<MT,true,true,SF,CRAs...>::load( size_t index ) const noexcept
1522 {
1523  return matrix_.load( row(), index );
1524 }
1526 //*************************************************************************************************
1527 
1528 
1529 //*************************************************************************************************
1542 template< typename MT // Type of the dense matrix
1543  , bool SF // Symmetry flag
1544  , size_t... CRAs > // Compile time row arguments
1545 BLAZE_ALWAYS_INLINE typename Row<MT,true,true,SF,CRAs...>::SIMDType
1546  Row<MT,true,true,SF,CRAs...>::loada( size_t index ) const noexcept
1547 {
1548  return matrix_.loada( row(), index );
1549 }
1551 //*************************************************************************************************
1552 
1553 
1554 //*************************************************************************************************
1567 template< typename MT // Type of the dense matrix
1568  , bool SF // Symmetry flag
1569  , size_t... CRAs > // Compile time row arguments
1570 BLAZE_ALWAYS_INLINE typename Row<MT,true,true,SF,CRAs...>::SIMDType
1571  Row<MT,true,true,SF,CRAs...>::loadu( size_t index ) const noexcept
1572 {
1573  return matrix_.loadu( row(), index );
1574 }
1576 //*************************************************************************************************
1577 
1578 
1579 //*************************************************************************************************
1593 template< typename MT // Type of the dense matrix
1594  , bool SF // Symmetry flag
1595  , size_t... CRAs > // Compile time row arguments
1597  Row<MT,true,true,SF,CRAs...>::store( size_t index, const SIMDType& value ) noexcept
1598 {
1599  matrix_.store( row(), index, value );
1600 }
1602 //*************************************************************************************************
1603 
1604 
1605 //*************************************************************************************************
1619 template< typename MT // Type of the dense matrix
1620  , bool SF // Symmetry flag
1621  , size_t... CRAs > // Compile time row arguments
1623  Row<MT,true,true,SF,CRAs...>::storea( size_t index, const SIMDType& value ) noexcept
1624 {
1625  matrix_.storea( row(), index, value );
1626 }
1628 //*************************************************************************************************
1629 
1630 
1631 //*************************************************************************************************
1645 template< typename MT // Type of the dense matrix
1646  , bool SF // Symmetry flag
1647  , size_t... CRAs > // Compile time row arguments
1649  Row<MT,true,true,SF,CRAs...>::storeu( size_t index, const SIMDType& value ) noexcept
1650 {
1651  matrix_.storeu( row(), index, value );
1652 }
1654 //*************************************************************************************************
1655 
1656 
1657 //*************************************************************************************************
1671 template< typename MT // Type of the dense matrix
1672  , bool SF // Symmetry flag
1673  , size_t... CRAs > // Compile time row arguments
1675  Row<MT,true,true,SF,CRAs...>::stream( size_t index, const SIMDType& value ) noexcept
1676 {
1677  matrix_.stream( row(), index, value );
1678 }
1680 //*************************************************************************************************
1681 
1682 
1683 //*************************************************************************************************
1695 template< typename MT // Type of the dense matrix
1696  , bool SF // Symmetry flag
1697  , size_t... CRAs > // Compile time row arguments
1698 template< typename VT > // Type of the right-hand side dense vector
1699 inline auto Row<MT,true,true,SF,CRAs...>::assign( const DenseVector<VT,true>& rhs )
1700  -> DisableIf_t< VectorizedAssign_v<VT> >
1701 {
1702  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1703 
1704  const size_t jpos( (~rhs).size() & size_t(-2) );
1705  for( size_t j=0UL; j<jpos; j+=2UL ) {
1706  matrix_(row(),j ) = (~rhs)[j ];
1707  matrix_(row(),j+1UL) = (~rhs)[j+1UL];
1708  }
1709  if( jpos < (~rhs).size() )
1710  matrix_(row(),jpos) = (~rhs)[jpos];
1711 }
1713 //*************************************************************************************************
1714 
1715 
1716 //*************************************************************************************************
1728 template< typename MT // Type of the dense matrix
1729  , bool SF // Symmetry flag
1730  , size_t... CRAs > // Compile time row arguments
1731 template< typename VT > // Type of the right-hand side dense vector
1732 inline auto Row<MT,true,true,SF,CRAs...>::assign( const DenseVector<VT,true>& rhs )
1733  -> EnableIf_t< VectorizedAssign_v<VT> >
1734 {
1736 
1737  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1738 
1739  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1740 
1741  const size_t columns( size() );
1742 
1743  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
1744  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
1745 
1746  size_t j( 0UL );
1747  Iterator left( begin() );
1748  ConstIterator_t<VT> right( (~rhs).begin() );
1749 
1750  if( useStreaming && columns > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( &matrix_ ) )
1751  {
1752  for( ; j<jpos; j+=SIMDSIZE ) {
1753  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1754  }
1755  for( ; remainder && j<columns; ++j ) {
1756  *left = *right; ++left; ++right;
1757  }
1758  }
1759  else
1760  {
1761  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
1762  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1763  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1764  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1765  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1766  }
1767  for( ; j<jpos; j+=SIMDSIZE ) {
1768  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1769  }
1770  for( ; remainder && j<columns; ++j ) {
1771  *left = *right; ++left; ++right;
1772  }
1773  }
1774 }
1776 //*************************************************************************************************
1777 
1778 
1779 //*************************************************************************************************
1791 template< typename MT // Type of the dense matrix
1792  , bool SF // Symmetry flag
1793  , size_t... CRAs > // Compile time row arguments
1794 template< typename VT > // Type of the right-hand side sparse vector
1795 inline void Row<MT,true,true,SF,CRAs...>::assign( const SparseVector<VT,true>& rhs )
1796 {
1797  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1798 
1799  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1800  matrix_(row(),element->index()) = element->value();
1801 }
1803 //*************************************************************************************************
1804 
1805 
1806 //*************************************************************************************************
1818 template< typename MT // Type of the dense matrix
1819  , bool SF // Symmetry flag
1820  , size_t... CRAs > // Compile time row arguments
1821 template< typename VT > // Type of the right-hand side dense vector
1822 inline auto Row<MT,true,true,SF,CRAs...>::addAssign( const DenseVector<VT,true>& rhs )
1823  -> DisableIf_t< VectorizedAddAssign_v<VT> >
1824 {
1825  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1826 
1827  const size_t jpos( (~rhs).size() & size_t(-2) );
1828  for( size_t j=0UL; j<jpos; j+=2UL ) {
1829  matrix_(row(),j ) += (~rhs)[j ];
1830  matrix_(row(),j+1UL) += (~rhs)[j+1UL];
1831  }
1832  if( jpos < (~rhs).size() )
1833  matrix_(row(),jpos) += (~rhs)[jpos];
1834 }
1836 //*************************************************************************************************
1837 
1838 
1839 //*************************************************************************************************
1851 template< typename MT // Type of the dense matrix
1852  , bool SF // Symmetry flag
1853  , size_t... CRAs > // Compile time row arguments
1854 template< typename VT > // Type of the right-hand side dense vector
1855 inline auto Row<MT,true,true,SF,CRAs...>::addAssign( const DenseVector<VT,true>& rhs )
1856  -> EnableIf_t< VectorizedAddAssign_v<VT> >
1857 {
1859 
1860  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1861 
1862  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1863 
1864  const size_t columns( size() );
1865 
1866  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
1867  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
1868 
1869  size_t j( 0UL );
1870  Iterator left( begin() );
1871  ConstIterator_t<VT> right( (~rhs).begin() );
1872 
1873  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
1874  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1875  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1876  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1877  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1878  }
1879  for( ; j<jpos; j+=SIMDSIZE ) {
1880  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1881  }
1882  for( ; remainder && j<columns; ++j ) {
1883  *left += *right; ++left; ++right;
1884  }
1885 }
1887 //*************************************************************************************************
1888 
1889 
1890 //*************************************************************************************************
1902 template< typename MT // Type of the dense matrix
1903  , bool SF // Symmetry flag
1904  , size_t... CRAs > // Compile time row arguments
1905 template< typename VT > // Type of the right-hand side sparse vector
1906 inline void Row<MT,true,true,SF,CRAs...>::addAssign( const SparseVector<VT,true>& rhs )
1907 {
1908  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1909 
1910  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1911  matrix_(row(),element->index()) += element->value();
1912 }
1914 //*************************************************************************************************
1915 
1916 
1917 //*************************************************************************************************
1929 template< typename MT // Type of the dense matrix
1930  , bool SF // Symmetry flag
1931  , size_t... CRAs > // Compile time row arguments
1932 template< typename VT > // Type of the right-hand side dense vector
1933 inline auto Row<MT,true,true,SF,CRAs...>::subAssign( const DenseVector<VT,true>& rhs )
1934  -> DisableIf_t< VectorizedSubAssign_v<VT> >
1935 {
1936  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1937 
1938  const size_t jpos( (~rhs).size() & size_t(-2) );
1939  for( size_t j=0UL; j<jpos; j+=2UL ) {
1940  matrix_(row(),j ) -= (~rhs)[j ];
1941  matrix_(row(),j+1UL) -= (~rhs)[j+1UL];
1942  }
1943  if( jpos < (~rhs).size() )
1944  matrix_(row(),jpos) -= (~rhs)[jpos];
1945 }
1947 //*************************************************************************************************
1948 
1949 
1950 //*************************************************************************************************
1962 template< typename MT // Type of the dense matrix
1963  , bool SF // Symmetry flag
1964  , size_t... CRAs > // Compile time row arguments
1965 template< typename VT > // Type of the right-hand side dense vector
1966 inline auto Row<MT,true,true,SF,CRAs...>::subAssign( const DenseVector<VT,true>& rhs )
1967  -> EnableIf_t< VectorizedSubAssign_v<VT> >
1968 {
1970 
1971  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1972 
1973  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1974 
1975  const size_t columns( size() );
1976 
1977  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
1978  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
1979 
1980  size_t j( 0UL );
1981  Iterator left( begin() );
1982  ConstIterator_t<VT> right( (~rhs).begin() );
1983 
1984  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
1985  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1986  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1987  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1988  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1989  }
1990  for( ; j<jpos; j+=SIMDSIZE ) {
1991  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1992  }
1993  for( ; remainder && j<columns; ++j ) {
1994  *left -= *right; ++left; ++right;
1995  }
1996 }
1998 //*************************************************************************************************
1999 
2000 
2001 //*************************************************************************************************
2013 template< typename MT // Type of the dense matrix
2014  , bool SF // Symmetry flag
2015  , size_t... CRAs > // Compile time row arguments
2016 template< typename VT > // Type of the right-hand side sparse vector
2017 inline void Row<MT,true,true,SF,CRAs...>::subAssign( const SparseVector<VT,true>& rhs )
2018 {
2019  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2020 
2021  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2022  matrix_(row(),element->index()) -= element->value();
2023 }
2025 //*************************************************************************************************
2026 
2027 
2028 //*************************************************************************************************
2040 template< typename MT // Type of the dense matrix
2041  , bool SF // Symmetry flag
2042  , size_t... CRAs > // Compile time row arguments
2043 template< typename VT > // Type of the right-hand side dense vector
2044 inline auto Row<MT,true,true,SF,CRAs...>::multAssign( const DenseVector<VT,true>& rhs )
2045  -> DisableIf_t< VectorizedMultAssign_v<VT> >
2046 {
2047  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2048 
2049  const size_t jpos( (~rhs).size() & size_t(-2) );
2050  for( size_t j=0UL; j<jpos; j+=2UL ) {
2051  matrix_(row(),j ) *= (~rhs)[j ];
2052  matrix_(row(),j+1UL) *= (~rhs)[j+1UL];
2053  }
2054  if( jpos < (~rhs).size() )
2055  matrix_(row(),jpos) *= (~rhs)[jpos];
2056 }
2058 //*************************************************************************************************
2059 
2060 
2061 //*************************************************************************************************
2073 template< typename MT // Type of the dense matrix
2074  , bool SF // Symmetry flag
2075  , size_t... CRAs > // Compile time row arguments
2076 template< typename VT > // Type of the right-hand side dense vector
2077 inline auto Row<MT,true,true,SF,CRAs...>::multAssign( const DenseVector<VT,true>& rhs )
2078  -> EnableIf_t< VectorizedMultAssign_v<VT> >
2079 {
2081 
2082  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2083 
2084  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
2085 
2086  const size_t columns( size() );
2087 
2088  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
2089  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
2090 
2091  size_t j( 0UL );
2092  Iterator left( begin() );
2093  ConstIterator_t<VT> right( (~rhs).begin() );
2094 
2095  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2096  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2097  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2098  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2099  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2100  }
2101  for( ; j<jpos; j+=SIMDSIZE ) {
2102  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2103  }
2104  for( ; remainder && j<columns; ++j ) {
2105  *left *= *right; ++left; ++right;
2106  }
2107 }
2109 //*************************************************************************************************
2110 
2111 
2112 //*************************************************************************************************
2124 template< typename MT // Type of the dense matrix
2125  , bool SF // Symmetry flag
2126  , size_t... CRAs > // Compile time row arguments
2127 template< typename VT > // Type of the right-hand side sparse vector
2128 inline void Row<MT,true,true,SF,CRAs...>::multAssign( const SparseVector<VT,true>& rhs )
2129 {
2130  using blaze::reset;
2131 
2132  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2133 
2134  size_t j( 0UL );
2135 
2136  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
2137  const size_t index( element->index() );
2138  for( ; j<index; ++j )
2139  reset( matrix_(row(),j) );
2140  matrix_(row(),j) *= element->value();
2141  ++j;
2142  }
2143 
2144  for( ; j<size(); ++j ) {
2145  reset( matrix_(row(),j) );
2146  }
2147 }
2149 //*************************************************************************************************
2150 
2151 
2152 //*************************************************************************************************
2164 template< typename MT // Type of the dense matrix
2165  , bool SF // Symmetry flag
2166  , size_t... CRAs > // Compile time row arguments
2167 template< typename VT > // Type of the right-hand side dense vector
2168 inline auto Row<MT,true,true,SF,CRAs...>::divAssign( const DenseVector<VT,true>& rhs )
2169  -> DisableIf_t< VectorizedDivAssign_v<VT> >
2170 {
2171  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2172 
2173  const size_t jpos( (~rhs).size() & size_t(-2) );
2174  for( size_t j=0UL; j<jpos; j+=2UL ) {
2175  matrix_(row(),j ) /= (~rhs)[j ];
2176  matrix_(row(),j+1UL) /= (~rhs)[j+1UL];
2177  }
2178  if( jpos < (~rhs).size() )
2179  matrix_(row(),jpos) /= (~rhs)[jpos];
2180 }
2182 //*************************************************************************************************
2183 
2184 
2185 //*************************************************************************************************
2197 template< typename MT // Type of the dense matrix
2198  , bool SF // Symmetry flag
2199  , size_t... CRAs > // Compile time row arguments
2200 template< typename VT > // Type of the right-hand side dense vector
2201 inline auto Row<MT,true,true,SF,CRAs...>::divAssign( const DenseVector<VT,true>& rhs )
2202  -> EnableIf_t< VectorizedDivAssign_v<VT> >
2203 {
2205 
2206  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2207 
2208  const size_t columns( size() );
2209 
2210  const size_t jpos( columns & size_t(-SIMDSIZE) );
2211  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
2212 
2213  size_t j( 0UL );
2214  Iterator left( begin() );
2215  ConstIterator_t<VT> right( (~rhs).begin() );
2216 
2217  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2218  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2219  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2220  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2221  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2222  }
2223  for( ; j<jpos; j+=SIMDSIZE ) {
2224  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2225  }
2226  for( ; j<columns; ++j ) {
2227  *left /= *right; ++left; ++right;
2228  }
2229 }
2231 //*************************************************************************************************
2232 
2233 
2234 
2235 
2236 
2237 
2238 
2239 
2240 //=================================================================================================
2241 //
2242 // CLASS TEMPLATE SPECIALIZATION FOR GENERAL COLUMN-MAJOR MATRICES
2243 //
2244 //=================================================================================================
2245 
2246 //*************************************************************************************************
2254 template< typename MT // Type of the dense matrix
2255  , size_t... CRAs > // Compile time row arguments
2256 class Row<MT,false,true,false,CRAs...>
2257  : public View< DenseVector< Row<MT,false,true,false,CRAs...>, true > >
2258  , private RowData<CRAs...>
2259 {
2260  private:
2261  //**Type definitions****************************************************************************
2262  using DataType = RowData<CRAs...>;
2263  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
2264  //**********************************************************************************************
2265 
2266  public:
2267  //**Type definitions****************************************************************************
2269  using This = Row<MT,false,true,false,CRAs...>;
2270 
2271  using BaseType = DenseVector<This,true>;
2272  using ViewedType = MT;
2273  using ResultType = RowTrait_t<MT,CRAs...>;
2274  using TransposeType = TransposeType_t<ResultType>;
2275  using ElementType = ElementType_t<MT>;
2276  using ReturnType = ElementType_t<MT>;
2277  using CompositeType = const Row&;
2278 
2280  using ConstReference = ConstReference_t<MT>;
2281 
2283  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
2284 
2286  using ConstPointer = ConstPointer_t<MT>;
2287 
2289  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
2290  //**********************************************************************************************
2291 
2292  //**RowIterator class definition****************************************************************
2295  template< typename MatrixType // Type of the dense matrix
2296  , typename IteratorType > // Type of the dense matrix iterator
2297  class RowIterator
2298  {
2299  public:
2300  //**Type definitions*************************************************************************
2302  using IteratorCategory = typename std::iterator_traits<IteratorType>::iterator_category;
2303 
2305  using ValueType = typename std::iterator_traits<IteratorType>::value_type;
2306 
2308  using PointerType = typename std::iterator_traits<IteratorType>::pointer;
2309 
2311  using ReferenceType = typename std::iterator_traits<IteratorType>::reference;
2312 
2314  using DifferenceType = typename std::iterator_traits<IteratorType>::difference_type;
2315 
2316  // STL iterator requirements
2317  using iterator_category = IteratorCategory;
2318  using value_type = ValueType;
2319  using pointer = PointerType;
2320  using reference = ReferenceType;
2321  using difference_type = DifferenceType;
2322  //*******************************************************************************************
2323 
2324  //**Constructor******************************************************************************
2327  inline RowIterator() noexcept
2328  : matrix_( nullptr ) // The dense matrix containing the row
2329  , row_ ( 0UL ) // The current row index
2330  , column_( 0UL ) // The current column index
2331  , pos_ ( ) // Iterator to the current dense element
2332  {}
2333  //*******************************************************************************************
2334 
2335  //**Constructor******************************************************************************
2342  inline RowIterator( MatrixType& matrix, size_t row, size_t column ) noexcept
2343  : matrix_( &matrix ) // The dense matrix containing the row
2344  , row_ ( row ) // The current row index
2345  , column_( column ) // The current column index
2346  , pos_ ( ) // Iterator to the current dense element
2347  {
2348  if( column_ != matrix_->columns() )
2349  pos_ = matrix_->begin( column_ ) + row_;
2350  }
2351  //*******************************************************************************************
2352 
2353  //**Constructor******************************************************************************
2358  template< typename MatrixType2, typename IteratorType2 >
2359  inline RowIterator( const RowIterator<MatrixType2,IteratorType2>& it ) noexcept
2360  : matrix_( it.matrix_ ) // The dense matrix containing the row
2361  , row_ ( it.row_ ) // The current row index
2362  , column_( it.column_ ) // The current column index
2363  , pos_ ( it.pos_ ) // Iterator to the current dense element
2364  {}
2365  //*******************************************************************************************
2366 
2367  //**Addition assignment operator*************************************************************
2373  inline RowIterator& operator+=( size_t inc ) noexcept {
2374  using blaze::reset;
2375  column_ += inc;
2376  if( column_ != matrix_->columns() )
2377  pos_ = matrix_->begin( column_ ) + row_;
2378  else reset( pos_ );
2379  return *this;
2380  }
2381  //*******************************************************************************************
2382 
2383  //**Subtraction assignment operator**********************************************************
2389  inline RowIterator& operator-=( size_t dec ) noexcept {
2390  using blaze::reset;
2391  column_ -= dec;
2392  if( column_ != matrix_->columns() )
2393  pos_ = matrix_->begin( column_ ) + row_;
2394  else reset( pos_ );
2395  return *this;
2396  }
2397  //*******************************************************************************************
2398 
2399  //**Prefix increment operator****************************************************************
2404  inline RowIterator& operator++() noexcept {
2405  using blaze::reset;
2406  ++column_;
2407  if( column_ != matrix_->columns() )
2408  pos_ = matrix_->begin( column_ ) + row_;
2409  else reset( pos_ );
2410  return *this;
2411  }
2412  //*******************************************************************************************
2413 
2414  //**Postfix increment operator***************************************************************
2419  inline const RowIterator operator++( int ) noexcept {
2420  const RowIterator tmp( *this );
2421  ++(*this);
2422  return tmp;
2423  }
2424  //*******************************************************************************************
2425 
2426  //**Prefix decrement operator****************************************************************
2431  inline RowIterator& operator--() noexcept {
2432  using blaze::reset;
2433  --column_;
2434  if( column_ != matrix_->columns() )
2435  pos_ = matrix_->begin( column_ ) + row_;
2436  else reset( pos_ );
2437  return *this;
2438  }
2439  //*******************************************************************************************
2440 
2441  //**Postfix decrement operator***************************************************************
2446  inline const RowIterator operator--( int ) noexcept {
2447  const RowIterator tmp( *this );
2448  --(*this);
2449  return tmp;
2450  }
2451  //*******************************************************************************************
2452 
2453  //**Subscript operator***********************************************************************
2459  inline ReferenceType operator[]( size_t index ) const {
2460  BLAZE_USER_ASSERT( column_+index < matrix_->columns(), "Invalid access index detected" );
2461  const IteratorType pos( matrix_->begin( column_+index ) + row_ );
2462  return *pos;
2463  }
2464  //*******************************************************************************************
2465 
2466  //**Element access operator******************************************************************
2471  inline ReferenceType operator*() const {
2472  return *pos_;
2473  }
2474  //*******************************************************************************************
2475 
2476  //**Element access operator******************************************************************
2481  inline PointerType operator->() const {
2482  return pos_;
2483  }
2484  //*******************************************************************************************
2485 
2486  //**Equality operator************************************************************************
2492  template< typename MatrixType2, typename IteratorType2 >
2493  inline bool operator==( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2494  return column_ == rhs.column_;
2495  }
2496  //*******************************************************************************************
2497 
2498  //**Inequality operator**********************************************************************
2504  template< typename MatrixType2, typename IteratorType2 >
2505  inline bool operator!=( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2506  return !( *this == rhs );
2507  }
2508  //*******************************************************************************************
2509 
2510  //**Less-than operator***********************************************************************
2516  template< typename MatrixType2, typename IteratorType2 >
2517  inline bool operator<( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2518  return column_ < rhs.column_;
2519  }
2520  //*******************************************************************************************
2521 
2522  //**Greater-than operator********************************************************************
2528  template< typename MatrixType2, typename IteratorType2 >
2529  inline bool operator>( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2530  return column_ > rhs.column_;
2531  }
2532  //*******************************************************************************************
2533 
2534  //**Less-or-equal-than operator**************************************************************
2540  template< typename MatrixType2, typename IteratorType2 >
2541  inline bool operator<=( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2542  return column_ <= rhs.column_;
2543  }
2544  //*******************************************************************************************
2545 
2546  //**Greater-or-equal-than operator***********************************************************
2552  template< typename MatrixType2, typename IteratorType2 >
2553  inline bool operator>=( const RowIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2554  return column_ >= rhs.column_;
2555  }
2556  //*******************************************************************************************
2557 
2558  //**Subtraction operator*********************************************************************
2564  inline DifferenceType operator-( const RowIterator& rhs ) const noexcept {
2565  return column_ - rhs.column_;
2566  }
2567  //*******************************************************************************************
2568 
2569  //**Addition operator************************************************************************
2576  friend inline const RowIterator operator+( const RowIterator& it, size_t inc ) noexcept {
2577  return RowIterator( *it.matrix_, it.row_, it.column_+inc );
2578  }
2579  //*******************************************************************************************
2580 
2581  //**Addition operator************************************************************************
2588  friend inline const RowIterator operator+( size_t inc, const RowIterator& it ) noexcept {
2589  return RowIterator( *it.matrix_, it.row_, it.column_+inc );
2590  }
2591  //*******************************************************************************************
2592 
2593  //**Subtraction operator*********************************************************************
2600  friend inline const RowIterator operator-( const RowIterator& it, size_t dec ) noexcept {
2601  return RowIterator( *it.matrix_, it.row_, it.column_-dec );
2602  }
2603  //*******************************************************************************************
2604 
2605  private:
2606  //**Member variables*************************************************************************
2607  MatrixType* matrix_;
2608  size_t row_;
2609  size_t column_;
2610  IteratorType pos_;
2611  //*******************************************************************************************
2612 
2613  //**Friend declarations**********************************************************************
2614  template< typename MatrixType2, typename IteratorType2 > friend class RowIterator;
2615  //*******************************************************************************************
2616  };
2617  //**********************************************************************************************
2618 
2619  //**Type definitions****************************************************************************
2621  using ConstIterator = RowIterator< const MT, ConstIterator_t<MT> >;
2622 
2624  using Iterator = If_t< IsConst_v<MT>, ConstIterator, RowIterator< MT, Iterator_t<MT> > >;
2625  //**********************************************************************************************
2626 
2627  //**Compilation flags***************************************************************************
2629  static constexpr bool simdEnabled = false;
2630 
2632  static constexpr bool smpAssignable = MT::smpAssignable;
2633 
2635  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
2636  //**********************************************************************************************
2637 
2638  //**Constructors********************************************************************************
2641  template< typename... RRAs >
2642  explicit inline Row( MT& matrix, RRAs... args );
2643 
2644  Row( const Row& ) = default;
2646  //**********************************************************************************************
2647 
2648  //**Destructor**********************************************************************************
2651  ~Row() = default;
2653  //**********************************************************************************************
2654 
2655  //**Data access functions***********************************************************************
2658  inline Reference operator[]( size_t index );
2659  inline ConstReference operator[]( size_t index ) const;
2660  inline Reference at( size_t index );
2661  inline ConstReference at( size_t index ) const;
2662  inline Pointer data () noexcept;
2663  inline ConstPointer data () const noexcept;
2664  inline Iterator begin ();
2665  inline ConstIterator begin () const;
2666  inline ConstIterator cbegin() const;
2667  inline Iterator end ();
2668  inline ConstIterator end () const;
2669  inline ConstIterator cend () const;
2671  //**********************************************************************************************
2672 
2673  //**Assignment operators************************************************************************
2676  inline Row& operator=( const ElementType& rhs );
2677  inline Row& operator=( initializer_list<ElementType> list );
2678  inline Row& operator=( const Row& rhs );
2679 
2680  template< typename VT > inline Row& operator= ( const Vector<VT,true>& rhs );
2681  template< typename VT > inline Row& operator+=( const Vector<VT,true>& rhs );
2682  template< typename VT > inline Row& operator-=( const Vector<VT,true>& rhs );
2683  template< typename VT > inline Row& operator*=( const Vector<VT,true>& rhs );
2684  template< typename VT > inline Row& operator/=( const DenseVector<VT,true>& rhs );
2685  template< typename VT > inline Row& operator%=( const Vector<VT,true>& rhs );
2687  //**********************************************************************************************
2688 
2689  //**Utility functions***************************************************************************
2692  using DataType::row;
2693 
2694  inline MT& operand() noexcept;
2695  inline const MT& operand() const noexcept;
2696 
2697  inline size_t size() const noexcept;
2698  inline size_t spacing() const noexcept;
2699  inline size_t capacity() const noexcept;
2700  inline size_t nonZeros() const;
2701  inline void reset();
2703  //**********************************************************************************************
2704 
2705  //**Numeric functions***************************************************************************
2708  template< typename Other > inline Row& scale( const Other& scalar );
2710  //**********************************************************************************************
2711 
2712  //**Expression template evaluation functions****************************************************
2715  template< typename Other >
2716  inline bool canAlias( const Other* alias ) const noexcept;
2717 
2718  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
2719  inline bool canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
2720 
2721  template< typename Other >
2722  inline bool isAliased( const Other* alias ) const noexcept;
2723 
2724  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
2725  inline bool isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
2726 
2727  inline bool isAligned () const noexcept;
2728  inline bool canSMPAssign() const noexcept;
2729 
2730  template< typename VT > inline void assign ( const DenseVector <VT,true>& rhs );
2731  template< typename VT > inline void assign ( const SparseVector<VT,true>& rhs );
2732  template< typename VT > inline void addAssign ( const DenseVector <VT,true>& rhs );
2733  template< typename VT > inline void addAssign ( const SparseVector<VT,true>& rhs );
2734  template< typename VT > inline void subAssign ( const DenseVector <VT,true>& rhs );
2735  template< typename VT > inline void subAssign ( const SparseVector<VT,true>& rhs );
2736  template< typename VT > inline void multAssign( const DenseVector <VT,true>& rhs );
2737  template< typename VT > inline void multAssign( const SparseVector<VT,true>& rhs );
2738  template< typename VT > inline void divAssign ( const DenseVector <VT,true>& rhs );
2740  //**********************************************************************************************
2741 
2742  private:
2743  //**Member variables****************************************************************************
2746  Operand matrix_;
2747 
2748  //**********************************************************************************************
2749 
2750  //**Friend declarations*************************************************************************
2751  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CRAs2 > friend class Row;
2752  //**********************************************************************************************
2753 
2754  //**Compile time checks*************************************************************************
2763  //**********************************************************************************************
2764 };
2766 //*************************************************************************************************
2767 
2768 
2769 
2770 
2771 //=================================================================================================
2772 //
2773 // CONSTRUCTORS
2774 //
2775 //=================================================================================================
2776 
2777 //*************************************************************************************************
2790 template< typename MT // Type of the dense matrix
2791  , size_t... CRAs > // Compile time row arguments
2792 template< typename... RRAs > // Runtime row arguments
2793 inline Row<MT,false,true,false,CRAs...>::Row( MT& matrix, RRAs... args )
2794  : DataType( args... ) // Base class initialization
2795  , matrix_ ( matrix ) // The matrix containing the row
2796 {
2797  if( !Contains_v< TypeList<RRAs...>, Unchecked > ) {
2798  if( matrix_.rows() <= row() ) {
2799  BLAZE_THROW_INVALID_ARGUMENT( "Invalid row access index" );
2800  }
2801  }
2802  else {
2803  BLAZE_USER_ASSERT( row() < matrix_.rows(), "Invalid row access index" );
2804  }
2805 }
2807 //*************************************************************************************************
2808 
2809 
2810 
2811 
2812 //=================================================================================================
2813 //
2814 // DATA ACCESS FUNCTIONS
2815 //
2816 //=================================================================================================
2817 
2818 //*************************************************************************************************
2828 template< typename MT // Type of the dense matrix
2829  , size_t... CRAs > // Compile time row arguments
2830 inline typename Row<MT,false,true,false,CRAs...>::Reference
2831  Row<MT,false,true,false,CRAs...>::operator[]( size_t index )
2832 {
2833  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
2834  return matrix_(row(),index);
2835 }
2837 //*************************************************************************************************
2838 
2839 
2840 //*************************************************************************************************
2850 template< typename MT // Type of the dense matrix
2851  , size_t... CRAs > // Compile time row arguments
2852 inline typename Row<MT,false,true,false,CRAs...>::ConstReference
2853  Row<MT,false,true,false,CRAs...>::operator[]( size_t index ) const
2854 {
2855  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
2856  return const_cast<const MT&>( matrix_ )(row(),index);
2857 }
2859 //*************************************************************************************************
2860 
2861 
2862 //*************************************************************************************************
2873 template< typename MT // Type of the dense matrix
2874  , size_t... CRAs > // Compile time row arguments
2875 inline typename Row<MT,false,true,false,CRAs...>::Reference
2876  Row<MT,false,true,false,CRAs...>::at( size_t index )
2877 {
2878  if( index >= size() ) {
2879  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
2880  }
2881  return (*this)[index];
2882 }
2884 //*************************************************************************************************
2885 
2886 
2887 //*************************************************************************************************
2898 template< typename MT // Type of the dense matrix
2899  , size_t... CRAs > // Compile time row arguments
2900 inline typename Row<MT,false,true,false,CRAs...>::ConstReference
2901  Row<MT,false,true,false,CRAs...>::at( size_t index ) const
2902 {
2903  if( index >= size() ) {
2904  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
2905  }
2906  return (*this)[index];
2907 }
2909 //*************************************************************************************************
2910 
2911 
2912 //*************************************************************************************************
2921 template< typename MT // Type of the dense matrix
2922  , size_t... CRAs > // Compile time row arguments
2923 inline typename Row<MT,false,true,false,CRAs...>::Pointer
2925 {
2926  return matrix_.data() + row();
2927 }
2929 //*************************************************************************************************
2930 
2931 
2932 //*************************************************************************************************
2941 template< typename MT // Type of the dense matrix
2942  , size_t... CRAs > // Compile time row arguments
2943 inline typename Row<MT,false,true,false,CRAs...>::ConstPointer
2945 {
2946  return matrix_.data() + row();
2947 }
2949 //*************************************************************************************************
2950 
2951 
2952 //*************************************************************************************************
2960 template< typename MT // Type of the dense matrix
2961  , size_t... CRAs > // Compile time row arguments
2962 inline typename Row<MT,false,true,false,CRAs...>::Iterator
2964 {
2965  return Iterator( matrix_, row(), 0UL );
2966 }
2968 //*************************************************************************************************
2969 
2970 
2971 //*************************************************************************************************
2979 template< typename MT // Type of the dense matrix
2980  , size_t... CRAs > // Compile time row arguments
2981 inline typename Row<MT,false,true,false,CRAs...>::ConstIterator
2983 {
2984  return ConstIterator( matrix_, row(), 0UL );
2985 }
2987 //*************************************************************************************************
2988 
2989 
2990 //*************************************************************************************************
2998 template< typename MT // Type of the dense matrix
2999  , size_t... CRAs > // Compile time row arguments
3000 inline typename Row<MT,false,true,false,CRAs...>::ConstIterator
3002 {
3003  return ConstIterator( matrix_, row(), 0UL );
3004 }
3006 //*************************************************************************************************
3007 
3008 
3009 //*************************************************************************************************
3017 template< typename MT // Type of the dense matrix
3018  , size_t... CRAs > // Compile time row arguments
3019 inline typename Row<MT,false,true,false,CRAs...>::Iterator
3021 {
3022  return Iterator( matrix_, row(), size() );
3023 }
3025 //*************************************************************************************************
3026 
3027 
3028 //*************************************************************************************************
3036 template< typename MT // Type of the dense matrix
3037  , size_t... CRAs > // Compile time row arguments
3038 inline typename Row<MT,false,true,false,CRAs...>::ConstIterator
3040 {
3041  return ConstIterator( matrix_, row(), size() );
3042 }
3044 //*************************************************************************************************
3045 
3046 
3047 //*************************************************************************************************
3055 template< typename MT // Type of the dense matrix
3056  , size_t... CRAs > // Compile time row arguments
3057 inline typename Row<MT,false,true,false,CRAs...>::ConstIterator
3059 {
3060  return ConstIterator( matrix_, row(), size() );
3061 }
3063 //*************************************************************************************************
3064 
3065 
3066 
3067 
3068 //=================================================================================================
3069 //
3070 // ASSIGNMENT OPERATORS
3071 //
3072 //=================================================================================================
3073 
3074 //*************************************************************************************************
3085 template< typename MT // Type of the dense matrix
3086  , size_t... CRAs > // Compile time row arguments
3087 inline Row<MT,false,true,false,CRAs...>&
3088  Row<MT,false,true,false,CRAs...>::operator=( const ElementType& rhs )
3089 {
3090  decltype(auto) left( derestrict( matrix_ ) );
3091 
3092  const size_t jbegin( ( IsUpper_v<MT> )
3093  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3094  ?( row()+1UL )
3095  :( row() ) )
3096  :( 0UL ) );
3097  const size_t jend ( ( IsLower_v<MT> )
3098  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3099  ?( row() )
3100  :( row()+1UL ) )
3101  :( size() ) );
3102 
3103  for( size_t j=jbegin; j<jend; ++j ) {
3104  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, row(), j, rhs ) )
3105  left(row(),j) = rhs;
3106  }
3107 
3108  return *this;
3109 }
3111 //*************************************************************************************************
3112 
3113 
3114 //*************************************************************************************************
3129 template< typename MT // Type of the dense matrix
3130  , size_t... CRAs > // Compile time row arguments
3131 inline Row<MT,false,true,false,CRAs...>&
3132  Row<MT,false,true,false,CRAs...>::operator=( initializer_list<ElementType> list )
3133 {
3134  if( list.size() > size() ) {
3135  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to row" );
3136  }
3137 
3138  if( IsRestricted_v<MT> ) {
3139  const InitializerVector<ElementType,true> tmp( list, size() );
3140  if( !tryAssign( matrix_, tmp, row(), 0UL ) ) {
3141  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3142  }
3143  }
3144 
3145  decltype(auto) left( derestrict( *this ) );
3146 
3147  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
3148 
3149  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3150 
3151  return *this;
3152 }
3154 //*************************************************************************************************
3155 
3156 
3157 //*************************************************************************************************
3171 template< typename MT // Type of the dense matrix
3172  , size_t... CRAs > // Compile time row arguments
3173 inline Row<MT,false,true,false,CRAs...>&
3174  Row<MT,false,true,false,CRAs...>::operator=( const Row& rhs )
3175 {
3176  if( &rhs == this ) return *this;
3177 
3178  if( size() != rhs.size() ) {
3179  BLAZE_THROW_INVALID_ARGUMENT( "Row sizes do not match" );
3180  }
3181 
3182  if( !tryAssign( matrix_, rhs, row(), 0UL ) ) {
3183  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3184  }
3185 
3186  decltype(auto) left( derestrict( *this ) );
3187 
3188  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
3189  const ResultType tmp( rhs );
3190  smpAssign( left, tmp );
3191  }
3192  else {
3193  smpAssign( left, rhs );
3194  }
3195 
3196  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3197 
3198  return *this;
3199 }
3201 //*************************************************************************************************
3202 
3203 
3204 //*************************************************************************************************
3218 template< typename MT // Type of the dense matrix
3219  , size_t... CRAs > // Compile time row arguments
3220 template< typename VT > // Type of the right-hand side vector
3221 inline Row<MT,false,true,false,CRAs...>&
3222  Row<MT,false,true,false,CRAs...>::operator=( const Vector<VT,true>& rhs )
3223 {
3227 
3228  if( size() != (~rhs).size() ) {
3229  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3230  }
3231 
3232  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3233  Right right( ~rhs );
3234 
3235  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
3236  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3237  }
3238 
3239  decltype(auto) left( derestrict( *this ) );
3240 
3241  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3242  const ResultType tmp( right );
3243  smpAssign( left, tmp );
3244  }
3245  else {
3246  if( IsSparseVector_v<VT> )
3247  reset();
3248  smpAssign( left, right );
3249  }
3250 
3251  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3252 
3253  return *this;
3254 }
3256 //*************************************************************************************************
3257 
3258 
3259 //*************************************************************************************************
3273 template< typename MT // Type of the dense matrix
3274  , size_t... CRAs > // Compile time row arguments
3275 template< typename VT > // Type of the right-hand side vector
3276 inline Row<MT,false,true,false,CRAs...>&
3277  Row<MT,false,true,false,CRAs...>::operator+=( const Vector<VT,true>& rhs )
3278 {
3279  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
3281 
3282  if( size() != (~rhs).size() ) {
3283  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3284  }
3285 
3286  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3287  Right right( ~rhs );
3288 
3289  if( !tryAddAssign( matrix_, right, row(), 0UL ) ) {
3290  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3291  }
3292 
3293  decltype(auto) left( derestrict( *this ) );
3294 
3295  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3296  const ResultType_t<VT> tmp( right );
3297  smpAddAssign( left, tmp );
3298  }
3299  else {
3300  smpAddAssign( left, right );
3301  }
3302 
3303  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3304 
3305  return *this;
3306 }
3308 //*************************************************************************************************
3309 
3310 
3311 //*************************************************************************************************
3325 template< typename MT // Type of the dense matrix
3326  , size_t... CRAs > // Compile time row arguments
3327 template< typename VT > // Type of the right-hand side vector
3328 inline Row<MT,false,true,false,CRAs...>&
3329  Row<MT,false,true,false,CRAs...>::operator-=( const Vector<VT,true>& rhs )
3330 {
3331  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
3333 
3334  if( size() != (~rhs).size() ) {
3335  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3336  }
3337 
3338  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3339  Right right( ~rhs );
3340 
3341  if( !trySubAssign( matrix_, right, row(), 0UL ) ) {
3342  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3343  }
3344 
3345  decltype(auto) left( derestrict( *this ) );
3346 
3347  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3348  const ResultType_t<VT> tmp( right );
3349  smpSubAssign( left, tmp );
3350  }
3351  else {
3352  smpSubAssign( left, right );
3353  }
3354 
3355  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3356 
3357  return *this;
3358 }
3360 //*************************************************************************************************
3361 
3362 
3363 //*************************************************************************************************
3376 template< typename MT // Type of the dense matrix
3377  , size_t... CRAs > // Compile time row arguments
3378 template< typename VT > // Type of the right-hand side vector
3379 inline Row<MT,false,true,false,CRAs...>&
3380  Row<MT,false,true,false,CRAs...>::operator*=( const Vector<VT,true>& rhs )
3381 {
3382  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
3384 
3385  if( size() != (~rhs).size() ) {
3386  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3387  }
3388 
3389  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3390  Right right( ~rhs );
3391 
3392  if( !tryMultAssign( matrix_, right, row(), 0UL ) ) {
3393  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3394  }
3395 
3396  decltype(auto) left( derestrict( *this ) );
3397 
3398  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3399  const ResultType_t<VT> tmp( right );
3400  smpMultAssign( left, tmp );
3401  }
3402  else {
3403  smpMultAssign( left, right );
3404  }
3405 
3406  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3407 
3408  return *this;
3409 }
3411 //*************************************************************************************************
3412 
3413 
3414 //*************************************************************************************************
3426 template< typename MT // Type of the dense matrix
3427  , size_t... CRAs > // Compile time row arguments
3428 template< typename VT > // Type of the right-hand side dense vector
3429 inline Row<MT,false,true,false,CRAs...>&
3430  Row<MT,false,true,false,CRAs...>::operator/=( const DenseVector<VT,true>& rhs )
3431 {
3432  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
3434 
3435  if( size() != (~rhs).size() ) {
3436  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3437  }
3438 
3439  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3440  Right right( ~rhs );
3441 
3442  if( !tryDivAssign( matrix_, right, row(), 0UL ) ) {
3443  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3444  }
3445 
3446  decltype(auto) left( derestrict( *this ) );
3447 
3448  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3449  const ResultType_t<VT> tmp( right );
3450  smpDivAssign( left, tmp );
3451  }
3452  else {
3453  smpDivAssign( left, right );
3454  }
3455 
3456  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3457 
3458  return *this;
3459 }
3461 //*************************************************************************************************
3462 
3463 
3464 //*************************************************************************************************
3477 template< typename MT // Type of the dense matrix
3478  , size_t... CRAs > // Compile time row arguments
3479 template< typename VT > // Type of the right-hand side vector
3480 inline Row<MT,false,true,false,CRAs...>&
3481  Row<MT,false,true,false,CRAs...>::operator%=( const Vector<VT,true>& rhs )
3482 {
3483  using blaze::assign;
3484 
3485  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
3487 
3488  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
3489 
3493 
3494  if( size() != 3UL || (~rhs).size() != 3UL ) {
3495  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
3496  }
3497 
3498  const CrossType right( *this % (~rhs) );
3499 
3500  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
3501  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3502  }
3503 
3504  decltype(auto) left( derestrict( *this ) );
3505 
3506  assign( left, right );
3507 
3508  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3509 
3510  return *this;
3511 }
3513 //*************************************************************************************************
3514 
3515 
3516 
3517 
3518 //=================================================================================================
3519 //
3520 // UTILITY FUNCTIONS
3521 //
3522 //=================================================================================================
3523 
3524 //*************************************************************************************************
3530 template< typename MT // Type of the dense matrix
3531  , size_t... CRAs > // Compile time row arguments
3532 inline MT& Row<MT,false,true,false,CRAs...>::operand() noexcept
3533 {
3534  return matrix_;
3535 }
3537 //*************************************************************************************************
3538 
3539 
3540 //*************************************************************************************************
3546 template< typename MT // Type of the dense matrix
3547  , size_t... CRAs > // Compile time row arguments
3548 inline const MT& Row<MT,false,true,false,CRAs...>::operand() const noexcept
3549 {
3550  return matrix_;
3551 }
3553 //*************************************************************************************************
3554 
3555 
3556 //*************************************************************************************************
3562 template< typename MT // Type of the dense matrix
3563  , size_t... CRAs > // Compile time row arguments
3564 inline size_t Row<MT,false,true,false,CRAs...>::size() const noexcept
3565 {
3566  return matrix_.columns();
3567 }
3569 //*************************************************************************************************
3570 
3571 
3572 //*************************************************************************************************
3581 template< typename MT // Type of the dense matrix
3582  , size_t... CRAs > // Compile time row arguments
3583 inline size_t Row<MT,false,true,false,CRAs...>::spacing() const noexcept
3584 {
3585  return matrix_.spacing();
3586 }
3588 //*************************************************************************************************
3589 
3590 
3591 //*************************************************************************************************
3597 template< typename MT // Type of the dense matrix
3598  , size_t... CRAs > // Compile time row arguments
3599 inline size_t Row<MT,false,true,false,CRAs...>::capacity() const noexcept
3600 {
3601  return matrix_.columns();
3602 }
3604 //*************************************************************************************************
3605 
3606 
3607 //*************************************************************************************************
3616 template< typename MT // Type of the dense matrix
3617  , size_t... CRAs > // Compile time row arguments
3618 inline size_t Row<MT,false,true,false,CRAs...>::nonZeros() const
3619 {
3620  const size_t columns( size() );
3621  size_t nonzeros( 0UL );
3622 
3623  for( size_t j=0UL; j<columns; ++j )
3624  if( !isDefault( matrix_(row(),j) ) )
3625  ++nonzeros;
3626 
3627  return nonzeros;
3628 }
3630 //*************************************************************************************************
3631 
3632 
3633 //*************************************************************************************************
3639 template< typename MT // Type of the dense matrix
3640  , size_t... CRAs > // Compile time row arguments
3642 {
3643  using blaze::clear;
3644 
3645  const size_t jbegin( ( IsUpper_v<MT> )
3646  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3647  ?( row()+1UL )
3648  :( row() ) )
3649  :( 0UL ) );
3650  const size_t jend ( ( IsLower_v<MT> )
3651  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3652  ?( row() )
3653  :( row()+1UL ) )
3654  :( size() ) );
3655 
3656  for( size_t j=jbegin; j<jend; ++j )
3657  clear( matrix_(row(),j) );
3658 }
3660 //*************************************************************************************************
3661 
3662 
3663 
3664 
3665 //=================================================================================================
3666 //
3667 // NUMERIC FUNCTIONS
3668 //
3669 //=================================================================================================
3670 
3671 //*************************************************************************************************
3684 template< typename MT // Type of the dense matrix
3685  , size_t... CRAs > // Compile time row arguments
3686 template< typename Other > // Data type of the scalar value
3687 inline Row<MT,false,true,false,CRAs...>&
3688  Row<MT,false,true,false,CRAs...>::scale( const Other& scalar )
3689 {
3691 
3692  const size_t jbegin( ( IsUpper_v<MT> )
3693  ?( ( IsStrictlyUpper_v<MT> )
3694  ?( row()+1UL )
3695  :( row() ) )
3696  :( 0UL ) );
3697  const size_t jend ( ( IsLower_v<MT> )
3698  ?( ( IsStrictlyLower_v<MT> )
3699  ?( row() )
3700  :( row()+1UL ) )
3701  :( size() ) );
3702 
3703  for( size_t j=jbegin; j<jend; ++j ) {
3704  matrix_(row(),j) *= scalar;
3705  }
3706 
3707  return *this;
3708 }
3710 //*************************************************************************************************
3711 
3712 
3713 
3714 
3715 //=================================================================================================
3716 //
3717 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
3718 //
3719 //=================================================================================================
3720 
3721 //*************************************************************************************************
3732 template< typename MT // Type of the dense matrix
3733  , size_t... CRAs > // Compile time row arguments
3734 template< typename Other > // Data type of the foreign expression
3735 inline bool Row<MT,false,true,false,CRAs...>::canAlias( const Other* alias ) const noexcept
3736 {
3737  return matrix_.isAliased( alias );
3738 }
3740 //*************************************************************************************************
3741 
3742 
3743 //*************************************************************************************************
3754 template< typename MT // Type of the dense matrix
3755  , size_t... CRAs > // Compile time row arguments
3756 template< typename MT2 // Data type of the foreign dense row
3757  , bool SO2 // Storage order of the foreign dense row
3758  , bool SF2 // Symmetry flag of the foreign dense row
3759  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
3760 inline bool
3761  Row<MT,false,true,false,CRAs...>::canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
3762 {
3763  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
3764 }
3766 //*************************************************************************************************
3767 
3768 
3769 //*************************************************************************************************
3780 template< typename MT // Type of the dense matrix
3781  , size_t... CRAs > // Compile time row arguments
3782 template< typename Other > // Data type of the foreign expression
3783 inline bool Row<MT,false,true,false,CRAs...>::isAliased( const Other* alias ) const noexcept
3784 {
3785  return matrix_.isAliased( alias );
3786 }
3788 //*************************************************************************************************
3789 
3790 
3791 //*************************************************************************************************
3802 template< typename MT // Type of the dense matrix
3803  , size_t... CRAs > // Compile time row arguments
3804 template< typename MT2 // Data type of the foreign dense row
3805  , bool SO2 // Storage order of the foreign dense row
3806  , bool SF2 // Symmetry flag of the foreign dense row
3807  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
3808 inline bool
3809  Row<MT,false,true,false,CRAs...>::isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
3810 {
3811  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
3812 }
3814 //*************************************************************************************************
3815 
3816 
3817 //*************************************************************************************************
3827 template< typename MT // Type of the dense matrix
3828  , size_t... CRAs > // Compile time row arguments
3829 inline bool Row<MT,false,true,false,CRAs...>::isAligned() const noexcept
3830 {
3831  return false;
3832 }
3834 //*************************************************************************************************
3835 
3836 
3837 //*************************************************************************************************
3848 template< typename MT // Type of the dense matrix
3849  , size_t... CRAs > // Compile time row arguments
3850 inline bool Row<MT,false,true,false,CRAs...>::canSMPAssign() const noexcept
3851 {
3852  return ( size() > SMP_DVECASSIGN_THRESHOLD );
3853 }
3855 //*************************************************************************************************
3856 
3857 
3858 //*************************************************************************************************
3870 template< typename MT // Type of the dense matrix
3871  , size_t... CRAs > // Compile time row arguments
3872 template< typename VT > // Type of the right-hand side dense vector
3873 inline void Row<MT,false,true,false,CRAs...>::assign( const DenseVector<VT,true>& rhs )
3874 {
3875  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3876 
3877  const size_t jpos( (~rhs).size() & size_t(-2) );
3878  for( size_t j=0UL; j<jpos; j+=2UL ) {
3879  matrix_(row(),j ) = (~rhs)[j ];
3880  matrix_(row(),j+1UL) = (~rhs)[j+1UL];
3881  }
3882  if( jpos < (~rhs).size() )
3883  matrix_(row(),jpos) = (~rhs)[jpos];
3884 }
3886 //*************************************************************************************************
3887 
3888 
3889 //*************************************************************************************************
3901 template< typename MT // Type of the dense matrix
3902  , size_t... CRAs > // Compile time row arguments
3903 template< typename VT > // Type of the right-hand side sparse vector
3904 inline void Row<MT,false,true,false,CRAs...>::assign( const SparseVector<VT,true>& rhs )
3905 {
3906  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3907 
3908  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3909  matrix_(row(),element->index()) = element->value();
3910 }
3912 //*************************************************************************************************
3913 
3914 
3915 //*************************************************************************************************
3927 template< typename MT // Type of the dense matrix
3928  , size_t... CRAs > // Compile time row arguments
3929 template< typename VT > // Type of the right-hand side dense vector
3930 inline void Row<MT,false,true,false,CRAs...>::addAssign( const DenseVector<VT,true>& rhs )
3931 {
3932  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3933 
3934  const size_t jpos( (~rhs).size() & size_t(-2) );
3935  for( size_t j=0UL; j<jpos; j+=2UL ) {
3936  matrix_(row(),j ) += (~rhs)[j ];
3937  matrix_(row(),j+1UL) += (~rhs)[j+1UL];
3938  }
3939  if( jpos < (~rhs).size() )
3940  matrix_(row(),jpos) += (~rhs)[jpos];
3941 }
3943 //*************************************************************************************************
3944 
3945 
3946 //*************************************************************************************************
3958 template< typename MT // Type of the dense matrix
3959  , size_t... CRAs > // Compile time row arguments
3960 template< typename VT > // Type of the right-hand side sparse vector
3961 inline void Row<MT,false,true,false,CRAs...>::addAssign( const SparseVector<VT,true>& rhs )
3962 {
3963  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3964 
3965  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3966  matrix_(row(),element->index()) += element->value();
3967 }
3969 //*************************************************************************************************
3970 
3971 
3972 //*************************************************************************************************
3984 template< typename MT // Type of the dense matrix
3985  , size_t... CRAs > // Compile time row arguments
3986 template< typename VT > // Type of the right-hand side dense vector
3987 inline void Row<MT,false,true,false,CRAs...>::subAssign( const DenseVector<VT,true>& rhs )
3988 {
3989  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3990 
3991  const size_t jpos( (~rhs).size() & size_t(-2) );
3992  for( size_t j=0UL; j<jpos; j+=2UL ) {
3993  matrix_(row(),j ) -= (~rhs)[j ];
3994  matrix_(row(),j+1UL) -= (~rhs)[j+1UL];
3995  }
3996  if( jpos < (~rhs).size() )
3997  matrix_(row(),jpos) -= (~rhs)[jpos];
3998 }
4000 //*************************************************************************************************
4001 
4002 
4003 //*************************************************************************************************
4015 template< typename MT // Type of the dense matrix
4016  , size_t... CRAs > // Compile time row arguments
4017 template< typename VT > // Type of the right-hand side sparse vector
4018 inline void Row<MT,false,true,false,CRAs...>::subAssign( const SparseVector<VT,true>& rhs )
4019 {
4020  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4021 
4022  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4023  matrix_(row(),element->index()) -= element->value();
4024 }
4026 //*************************************************************************************************
4027 
4028 
4029 //*************************************************************************************************
4041 template< typename MT // Type of the dense matrix
4042  , size_t... CRAs > // Compile time row arguments
4043 template< typename VT > // Type of the right-hand side dense vector
4044 inline void Row<MT,false,true,false,CRAs...>::multAssign( const DenseVector<VT,true>& rhs )
4045 {
4046  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4047 
4048  const size_t jpos( (~rhs).size() & size_t(-2) );
4049  for( size_t j=0UL; j<jpos; j+=2UL ) {
4050  matrix_(row(),j ) *= (~rhs)[j ];
4051  matrix_(row(),j+1UL) *= (~rhs)[j+1UL];
4052  }
4053  if( jpos < (~rhs).size() )
4054  matrix_(row(),jpos) *= (~rhs)[jpos];
4055 }
4057 //*************************************************************************************************
4058 
4059 
4060 //*************************************************************************************************
4072 template< typename MT // Type of the dense matrix
4073  , size_t... CRAs > // Compile time row arguments
4074 template< typename VT > // Type of the right-hand side sparse vector
4075 inline void Row<MT,false,true,false,CRAs...>::multAssign( const SparseVector<VT,true>& rhs )
4076 {
4077  using blaze::reset;
4078 
4079  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4080 
4081  size_t j( 0UL );
4082 
4083  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
4084  const size_t index( element->index() );
4085  for( ; j<index; ++j )
4086  reset( matrix_(row(),j) );
4087  matrix_(row(),j) *= element->value();
4088  ++j;
4089  }
4090 
4091  for( ; j<size(); ++j ) {
4092  reset( matrix_(row(),j) );
4093  }
4094 }
4096 //*************************************************************************************************
4097 
4098 
4099 //*************************************************************************************************
4111 template< typename MT // Type of the dense matrix
4112  , size_t... CRAs > // Compile time row arguments
4113 template< typename VT > // Type of the right-hand side dense vector
4114 inline void Row<MT,false,true,false,CRAs...>::divAssign( const DenseVector<VT,true>& rhs )
4115 {
4116  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4117 
4118  const size_t jpos( (~rhs).size() & size_t(-2) );
4119  for( size_t j=0UL; j<jpos; j+=2UL ) {
4120  matrix_(row(),j ) /= (~rhs)[j ];
4121  matrix_(row(),j+1UL) /= (~rhs)[j+1UL];
4122  }
4123  if( jpos < (~rhs).size() )
4124  matrix_(row(),jpos) /= (~rhs)[jpos];
4125 }
4127 //*************************************************************************************************
4128 
4129 
4130 
4131 
4132 
4133 
4134 
4135 
4136 //=================================================================================================
4137 //
4138 // CLASS TEMPLATE SPECIALIZATION FOR SYMMETRIC COLUMN-MAJOR DENSE MATRICES
4139 //
4140 //=================================================================================================
4141 
4142 //*************************************************************************************************
4150 template< typename MT // Type of the dense matrix
4151  , size_t... CRAs > // Compile time row arguments
4152 class Row<MT,false,true,true,CRAs...>
4153  : public View< DenseVector< Row<MT,false,true,true,CRAs...>, true > >
4154  , private RowData<CRAs...>
4155 {
4156  private:
4157  //**Type definitions****************************************************************************
4158  using DataType = RowData<CRAs...>;
4159  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
4160  //**********************************************************************************************
4161 
4162  public:
4163  //**Type definitions****************************************************************************
4165  using This = Row<MT,false,true,true,CRAs...>;
4166 
4167  using BaseType = DenseVector<This,true>;
4168  using ViewedType = MT;
4169  using ResultType = RowTrait_t<MT,CRAs...>;
4170  using TransposeType = TransposeType_t<ResultType>;
4171  using ElementType = ElementType_t<MT>;
4172  using SIMDType = SIMDTrait_t<ElementType>;
4173  using ReturnType = ElementType_t<MT>;
4174  using CompositeType = const Row&;
4175 
4177  using ConstReference = ConstReference_t<MT>;
4178 
4180  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
4181 
4183  using ConstPointer = ConstPointer_t<MT>;
4184 
4186  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
4187 
4189  using ConstIterator = ConstIterator_t<MT>;
4190 
4192  using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
4193  //**********************************************************************************************
4194 
4195  //**Compilation flags***************************************************************************
4197  static constexpr bool simdEnabled = MT::simdEnabled;
4198 
4200  static constexpr bool smpAssignable = MT::smpAssignable;
4201 
4203  static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
4204  //**********************************************************************************************
4205 
4206  //**Constructors********************************************************************************
4209  template< typename... RRAs >
4210  explicit inline Row( MT& matrix, RRAs... args );
4211 
4212  Row( const Row& ) = default;
4214  //**********************************************************************************************
4215 
4216  //**Destructor**********************************************************************************
4219  ~Row() = default;
4221  //**********************************************************************************************
4222 
4223  //**Data access functions***********************************************************************
4226  inline Reference operator[]( size_t index );
4227  inline ConstReference operator[]( size_t index ) const;
4228  inline Reference at( size_t index );
4229  inline ConstReference at( size_t index ) const;
4230  inline Pointer data () noexcept;
4231  inline ConstPointer data () const noexcept;
4232  inline Iterator begin ();
4233  inline ConstIterator begin () const;
4234  inline ConstIterator cbegin() const;
4235  inline Iterator end ();
4236  inline ConstIterator end () const;
4237  inline ConstIterator cend () const;
4239  //**********************************************************************************************
4240 
4241  //**Assignment operators************************************************************************
4244  inline Row& operator=( const ElementType& rhs );
4245  inline Row& operator=( initializer_list<ElementType> list );
4246  inline Row& operator=( const Row& rhs );
4247 
4248  template< typename VT > inline Row& operator= ( const Vector<VT,true>& rhs );
4249  template< typename VT > inline Row& operator+=( const Vector<VT,true>& rhs );
4250  template< typename VT > inline Row& operator-=( const Vector<VT,true>& rhs );
4251  template< typename VT > inline Row& operator*=( const Vector<VT,true>& rhs );
4252  template< typename VT > inline Row& operator/=( const DenseVector<VT,true>& rhs );
4253  template< typename VT > inline Row& operator%=( const Vector<VT,true>& rhs );
4255  //**********************************************************************************************
4256 
4257  //**Utility functions***************************************************************************
4260  using DataType::row;
4261 
4262  inline MT& operand() noexcept;
4263  inline const MT& operand() const noexcept;
4264 
4265  inline size_t size() const noexcept;
4266  inline size_t spacing() const noexcept;
4267  inline size_t capacity() const noexcept;
4268  inline size_t nonZeros() const;
4269  inline void reset();
4271  //**********************************************************************************************
4272 
4273  //**Numeric functions***************************************************************************
4276  template< typename Other > inline Row& scale( const Other& scalar );
4278  //**********************************************************************************************
4279 
4280  private:
4281  //**********************************************************************************************
4283  template< typename VT >
4284  static constexpr bool VectorizedAssign_v =
4285  ( useOptimizedKernels &&
4286  simdEnabled && VT::simdEnabled &&
4287  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > );
4288  //**********************************************************************************************
4289 
4290  //**********************************************************************************************
4292  template< typename VT >
4293  static constexpr bool VectorizedAddAssign_v =
4294  ( useOptimizedKernels &&
4295  simdEnabled && VT::simdEnabled &&
4296  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
4297  HasSIMDAdd_v< ElementType, ElementType_t<VT> > );
4298  //**********************************************************************************************
4299 
4300  //**********************************************************************************************
4302  template< typename VT >
4303  static constexpr bool VectorizedSubAssign_v =
4304  ( useOptimizedKernels &&
4305  simdEnabled && VT::simdEnabled &&
4306  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
4307  HasSIMDSub_v< ElementType, ElementType_t<VT> > );
4308  //**********************************************************************************************
4309 
4310  //**********************************************************************************************
4312  template< typename VT >
4313  static constexpr bool VectorizedMultAssign_v =
4314  ( useOptimizedKernels &&
4315  simdEnabled && VT::simdEnabled &&
4316  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
4317  HasSIMDMult_v< ElementType, ElementType_t<VT> > );
4318  //**********************************************************************************************
4319 
4320  //**********************************************************************************************
4322  template< typename VT >
4323  static constexpr bool VectorizedDivAssign_v =
4324  ( useOptimizedKernels &&
4325  simdEnabled && VT::simdEnabled &&
4326  IsSIMDCombinable_v< ElementType, ElementType_t<VT> > &&
4327  HasSIMDDiv_v< ElementType, ElementType_t<VT> > );
4328  //**********************************************************************************************
4329 
4330  //**SIMD properties*****************************************************************************
4332  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
4333  //**********************************************************************************************
4334 
4335  public:
4336  //**Expression template evaluation functions****************************************************
4339  template< typename Other >
4340  inline bool canAlias( const Other* alias ) const noexcept;
4341 
4342  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
4343  inline bool canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
4344 
4345  template< typename Other >
4346  inline bool isAliased( const Other* alias ) const noexcept;
4347 
4348  template< typename MT2, bool SO2, bool SF2, size_t... CRAs2 >
4349  inline bool isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
4350 
4351  inline bool isAligned () const noexcept;
4352  inline bool canSMPAssign() const noexcept;
4353 
4354  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
4355  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
4356  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
4357 
4358  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
4359  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
4360  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
4361  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
4362 
4363  template< typename VT >
4364  inline auto assign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedAssign_v<VT> >;
4365 
4366  template< typename VT >
4367  inline auto assign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedAssign_v<VT> >;
4368 
4369  template< typename VT > inline void assign( const SparseVector<VT,true>& rhs );
4370 
4371  template< typename VT >
4372  inline auto addAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedAddAssign_v<VT> >;
4373 
4374  template< typename VT >
4375  inline auto addAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedAddAssign_v<VT> >;
4376 
4377  template< typename VT > inline void addAssign( const SparseVector<VT,true>& rhs );
4378 
4379  template< typename VT >
4380  inline auto subAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedSubAssign_v<VT> >;
4381 
4382  template< typename VT >
4383  inline auto subAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedSubAssign_v<VT> >;
4384 
4385  template< typename VT > inline void subAssign( const SparseVector<VT,true>& rhs );
4386 
4387  template< typename VT >
4388  inline auto multAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedMultAssign_v<VT> >;
4389 
4390  template< typename VT >
4391  inline auto multAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedMultAssign_v<VT> >;
4392 
4393  template< typename VT > inline void multAssign( const SparseVector<VT,true>& rhs );
4394 
4395  template< typename VT >
4396  inline auto divAssign( const DenseVector<VT,true>& rhs ) -> DisableIf_t< VectorizedDivAssign_v<VT> >;
4397 
4398  template< typename VT >
4399  inline auto divAssign( const DenseVector<VT,true>& rhs ) -> EnableIf_t< VectorizedDivAssign_v<VT> >;
4401  //**********************************************************************************************
4402 
4403  private:
4404  //**Member variables****************************************************************************
4407  Operand matrix_;
4408 
4409  //**********************************************************************************************
4410 
4411  //**Friend declarations*************************************************************************
4412  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CRAs2 > friend class Row;
4413  //**********************************************************************************************
4414 
4415  //**Compile time checks*************************************************************************
4424  //**********************************************************************************************
4425 };
4427 //*************************************************************************************************
4428 
4429 
4430 
4431 
4432 //=================================================================================================
4433 //
4434 // CONSTRUCTORS
4435 //
4436 //=================================================================================================
4437 
4438 //*************************************************************************************************
4451 template< typename MT // Type of the dense matrix
4452  , size_t... CRAs > // Compile time row arguments
4453 template< typename... RRAs > // Runtime row arguments
4454 inline Row<MT,false,true,true,CRAs...>::Row( MT& matrix, RRAs... args )
4455  : DataType( args... ) // Base class initialization
4456  , matrix_ ( matrix ) // The matrix containing the row
4457 {
4458  if( !Contains_v< TypeList<RRAs...>, Unchecked > ) {
4459  if( matrix_.rows() <= row() ) {
4460  BLAZE_THROW_INVALID_ARGUMENT( "Invalid row access index" );
4461  }
4462  }
4463  else {
4464  BLAZE_USER_ASSERT( row() < matrix_.rows(), "Invalid row access index" );
4465  }
4466 }
4468 //*************************************************************************************************
4469 
4470 
4471 
4472 
4473 //=================================================================================================
4474 //
4475 // DATA ACCESS FUNCTIONS
4476 //
4477 //=================================================================================================
4478 
4479 //*************************************************************************************************
4489 template< typename MT // Type of the dense matrix
4490  , size_t... CRAs > // Compile time row arguments
4491 inline typename Row<MT,false,true,true,CRAs...>::Reference
4492  Row<MT,false,true,true,CRAs...>::operator[]( size_t index )
4493 {
4494  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
4495  return matrix_(index,row());
4496 }
4498 //*************************************************************************************************
4499 
4500 
4501 //*************************************************************************************************
4511 template< typename MT // Type of the dense matrix
4512  , size_t... CRAs > // Compile time row arguments
4513 inline typename Row<MT,false,true,true,CRAs...>::ConstReference
4514  Row<MT,false,true,true,CRAs...>::operator[]( size_t index ) const
4515 {
4516  BLAZE_USER_ASSERT( index < size(), "Invalid row access index" );
4517  return const_cast<const MT&>( matrix_ )(index,row());
4518 }
4520 //*************************************************************************************************
4521 
4522 
4523 //*************************************************************************************************
4534 template< typename MT // Type of the dense matrix
4535  , size_t... CRAs > // Compile time row arguments
4536 inline typename Row<MT,false,true,true,CRAs...>::Reference
4537  Row<MT,false,true,true,CRAs...>::at( size_t index )
4538 {
4539  if( index >= size() ) {
4540  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
4541  }
4542  return (*this)[index];
4543 }
4545 //*************************************************************************************************
4546 
4547 
4548 //*************************************************************************************************
4559 template< typename MT // Type of the dense matrix
4560  , size_t... CRAs > // Compile time row arguments
4561 inline typename Row<MT,false,true,true,CRAs...>::ConstReference
4562  Row<MT,false,true,true,CRAs...>::at( size_t index ) const
4563 {
4564  if( index >= size() ) {
4565  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
4566  }
4567  return (*this)[index];
4568 }
4570 //*************************************************************************************************
4571 
4572 
4573 //*************************************************************************************************
4582 template< typename MT // Type of the dense matrix
4583  , size_t... CRAs > // Compile time row arguments
4584 inline typename Row<MT,false,true,true,CRAs...>::Pointer
4586 {
4587  return matrix_.data( row() );
4588 }
4590 //*************************************************************************************************
4591 
4592 
4593 //*************************************************************************************************
4602 template< typename MT // Type of the dense matrix
4603  , size_t... CRAs > // Compile time row arguments
4604 inline typename Row<MT,false,true,true,CRAs...>::ConstPointer
4605  Row<MT,false,true,true,CRAs...>::data() const noexcept
4606 {
4607  return matrix_.data( row() );
4608 }
4610 //*************************************************************************************************
4611 
4612 
4613 //*************************************************************************************************
4621 template< typename MT // Type of the dense matrix
4622  , size_t... CRAs > // Compile time row arguments
4623 inline typename Row<MT,false,true,true,CRAs...>::Iterator
4625 {
4626  return matrix_.begin( row() );
4627 }
4629 //*************************************************************************************************
4630 
4631 
4632 //*************************************************************************************************
4640 template< typename MT // Type of the dense matrix
4641  , size_t... CRAs > // Compile time row arguments
4642 inline typename Row<MT,false,true,true,CRAs...>::ConstIterator
4644 {
4645  return matrix_.cbegin( row() );
4646 }
4648 //*************************************************************************************************
4649 
4650 
4651 //*************************************************************************************************
4659 template< typename MT // Type of the dense matrix
4660  , size_t... CRAs > // Compile time row arguments
4661 inline typename Row<MT,false,true,true,CRAs...>::ConstIterator
4663 {
4664  return matrix_.cbegin( row() );
4665 }
4667 //*************************************************************************************************
4668 
4669 
4670 //*************************************************************************************************
4678 template< typename MT // Type of the dense matrix
4679  , size_t... CRAs > // Compile time row arguments
4680 inline typename Row<MT,false,true,true,CRAs...>::Iterator
4682 {
4683  return matrix_.end( row() );
4684 }
4686 //*************************************************************************************************
4687 
4688 
4689 //*************************************************************************************************
4697 template< typename MT // Type of the dense matrix
4698  , size_t... CRAs > // Compile time row arguments
4699 inline typename Row<MT,false,true,true,CRAs...>::ConstIterator
4701 {
4702  return matrix_.cend( row() );
4703 }
4705 //*************************************************************************************************
4706 
4707 
4708 //*************************************************************************************************
4716 template< typename MT // Type of the dense matrix
4717  , size_t... CRAs > // Compile time row arguments
4718 inline typename Row<MT,false,true,true,CRAs...>::ConstIterator
4720 {
4721  return matrix_.cend( row() );
4722 }
4724 //*************************************************************************************************
4725 
4726 
4727 
4728 
4729 //=================================================================================================
4730 //
4731 // ASSIGNMENT OPERATORS
4732 //
4733 //=================================================================================================
4734 
4735 //*************************************************************************************************
4742 template< typename MT // Type of the dense matrix
4743  , size_t... CRAs > // Compile time row arguments
4744 inline Row<MT,false,true,true,CRAs...>&
4745  Row<MT,false,true,true,CRAs...>::operator=( const ElementType& rhs )
4746 {
4747  decltype(auto) left( derestrict( matrix_ ) );
4748 
4749  const size_t ibegin( ( IsLower_v<MT> )
4750  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
4751  ?( row()+1UL )
4752  :( row() ) )
4753  :( 0UL ) );
4754  const size_t iend ( ( IsUpper_v<MT> )
4755  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
4756  ?( row() )
4757  :( row()+1UL ) )
4758  :( size() ) );
4759 
4760  for( size_t i=ibegin; i<iend; ++i ) {
4761  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, i, row(), rhs ) )
4762  left(i,row()) = rhs;
4763  }
4764 
4765  return *this;
4766 }
4768 //*************************************************************************************************
4769 
4770 
4771 //*************************************************************************************************
4786 template< typename MT // Type of the dense matrix
4787  , size_t... CRAs > // Compile time row arguments
4788 inline Row<MT,false,true,true,CRAs...>&
4789  Row<MT,false,true,true,CRAs...>::operator=( initializer_list<ElementType> list )
4790 {
4791  if( list.size() > size() ) {
4792  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to row" );
4793  }
4794 
4795  if( IsRestricted_v<MT> ) {
4796  const InitializerVector<ElementType,true> tmp( list, size() );
4797  if( !tryAssign( matrix_, tmp, row(), 0UL ) ) {
4798  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4799  }
4800  }
4801 
4802  decltype(auto) left( derestrict( *this ) );
4803 
4804  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
4805 
4806  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4807 
4808  return *this;
4809 }
4811 //*************************************************************************************************
4812 
4813 
4814 //*************************************************************************************************
4828 template< typename MT // Type of the dense matrix
4829  , size_t... CRAs > // Compile time row arguments
4830 inline Row<MT,false,true,true,CRAs...>&
4831  Row<MT,false,true,true,CRAs...>::operator=( const Row& rhs )
4832 {
4833  if( &rhs == this ) return *this;
4834 
4835  if( size() != rhs.size() ) {
4836  BLAZE_THROW_INVALID_ARGUMENT( "Row sizes do not match" );
4837  }
4838 
4839  if( !tryAssign( matrix_, rhs, row(), 0UL ) ) {
4840  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4841  }
4842 
4843  decltype(auto) left( derestrict( *this ) );
4844 
4845  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
4846  const ResultType tmp( rhs );
4847  smpAssign( left, tmp );
4848  }
4849  else {
4850  smpAssign( left, rhs );
4851  }
4852 
4853  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4854 
4855  return *this;
4856 }
4858 //*************************************************************************************************
4859 
4860 
4861 //*************************************************************************************************
4875 template< typename MT // Type of the dense matrix
4876  , size_t... CRAs > // Compile time row arguments
4877 template< typename VT > // Type of the right-hand side vector
4878 inline Row<MT,false,true,true,CRAs...>&
4879  Row<MT,false,true,true,CRAs...>::operator=( const Vector<VT,true>& rhs )
4880 {
4881  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
4883 
4884  if( size() != (~rhs).size() ) {
4885  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4886  }
4887 
4888  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4889  Right right( ~rhs );
4890 
4891  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
4892  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4893  }
4894 
4895  decltype(auto) left( derestrict( *this ) );
4896 
4897  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4898  const ResultType_t<VT> tmp( right );
4899  smpAssign( left, tmp );
4900  }
4901  else {
4902  if( IsSparseVector_v<VT> )
4903  reset();
4904  smpAssign( left, right );
4905  }
4906 
4907  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4908 
4909  return *this;
4910 }
4912 //*************************************************************************************************
4913 
4914 
4915 //*************************************************************************************************
4929 template< typename MT // Type of the dense matrix
4930  , size_t... CRAs > // Compile time row arguments
4931 template< typename VT > // Type of the right-hand side vector
4932 inline Row<MT,false,true,true,CRAs...>&
4933  Row<MT,false,true,true,CRAs...>::operator+=( const Vector<VT,true>& rhs )
4934 {
4935  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
4937 
4938  if( size() != (~rhs).size() ) {
4939  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4940  }
4941 
4942  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4943  Right right( ~rhs );
4944 
4945  if( !tryAddAssign( matrix_, right, row(), 0UL ) ) {
4946  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4947  }
4948 
4949  decltype(auto) left( derestrict( *this ) );
4950 
4951  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4952  const ResultType_t<VT> tmp( right );
4953  smpAddAssign( left, tmp );
4954  }
4955  else {
4956  smpAddAssign( left, right );
4957  }
4958 
4959  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4960 
4961  return *this;
4962 }
4964 //*************************************************************************************************
4965 
4966 
4967 //*************************************************************************************************
4981 template< typename MT // Type of the dense matrix
4982  , size_t... CRAs > // Compile time row arguments
4983 template< typename VT > // Type of the right-hand side vector
4984 inline Row<MT,false,true,true,CRAs...>&
4985  Row<MT,false,true,true,CRAs...>::operator-=( const Vector<VT,true>& rhs )
4986 {
4987  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
4989 
4990  if( size() != (~rhs).size() ) {
4991  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4992  }
4993 
4994  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4995  Right right( ~rhs );
4996 
4997  if( !trySubAssign( matrix_, right, row(), 0UL ) ) {
4998  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4999  }
5000 
5001  decltype(auto) left( derestrict( *this ) );
5002 
5003  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
5004  const ResultType_t<VT> tmp( right );
5005  smpSubAssign( left, tmp );
5006  }
5007  else {
5008  smpSubAssign( left, right );
5009  }
5010 
5011  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5012 
5013  return *this;
5014 }
5016 //*************************************************************************************************
5017 
5018 
5019 //*************************************************************************************************
5032 template< typename MT // Type of the dense matrix
5033  , size_t... CRAs > // Compile time row arguments
5034 template< typename VT > // Type of the right-hand side vector
5035 inline Row<MT,false,true,true,CRAs...>&
5036  Row<MT,false,true,true,CRAs...>::operator*=( const Vector<VT,true>& rhs )
5037 {
5038  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
5040 
5041  if( size() != (~rhs).size() ) {
5042  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5043  }
5044 
5045  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
5046  Right right( ~rhs );
5047 
5048  if( !tryMultAssign( matrix_, right, row(), 0UL ) ) {
5049  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5050  }
5051 
5052  decltype(auto) left( derestrict( *this ) );
5053 
5054  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
5055  const ResultType_t<VT> tmp( right );
5056  smpMultAssign( left, tmp );
5057  }
5058  else {
5059  smpMultAssign( left, right );
5060  }
5061 
5062  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5063 
5064  return *this;
5065 }
5067 //*************************************************************************************************
5068 
5069 
5070 //*************************************************************************************************
5082 template< typename MT // Type of the dense matrix
5083  , size_t... CRAs > // Compile time row arguments
5084 template< typename VT > // Type of the right-hand side dense vector
5085 inline Row<MT,false,true,true,CRAs...>&
5086  Row<MT,false,true,true,CRAs...>::operator/=( const DenseVector<VT,true>& rhs )
5087 {
5088  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
5090 
5091  if( size() != (~rhs).size() ) {
5092  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5093  }
5094 
5095  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
5096  Right right( ~rhs );
5097 
5098  if( !tryDivAssign( matrix_, right, row(), 0UL ) ) {
5099  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5100  }
5101 
5102  decltype(auto) left( derestrict( *this ) );
5103 
5104  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
5105  const ResultType_t<VT> tmp( right );
5106  smpDivAssign( left, tmp );
5107  }
5108  else {
5109  smpDivAssign( left, right );
5110  }
5111 
5112  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5113 
5114  return *this;
5115 }
5117 //*************************************************************************************************
5118 
5119 
5120 //*************************************************************************************************
5133 template< typename MT // Type of the dense matrix
5134  , size_t... CRAs > // Compile time row arguments
5135 template< typename VT > // Type of the right-hand side vector
5136 inline Row<MT,false,true,true,CRAs...>&
5137  Row<MT,false,true,true,CRAs...>::operator%=( const Vector<VT,true>& rhs )
5138 {
5139  using blaze::assign;
5140 
5141  BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE ( ResultType_t<VT> );
5143 
5144  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
5145 
5149 
5150  if( size() != 3UL || (~rhs).size() != 3UL ) {
5151  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
5152  }
5153 
5154  const CrossType right( *this % (~rhs) );
5155 
5156  if( !tryAssign( matrix_, right, row(), 0UL ) ) {
5157  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5158  }
5159 
5160  decltype(auto) left( derestrict( *this ) );
5161 
5162  assign( left, right );
5163 
5164  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5165 
5166  return *this;
5167 }
5169 //*************************************************************************************************
5170 
5171 
5172 
5173 
5174 //=================================================================================================
5175 //
5176 // UTILITY FUNCTIONS
5177 //
5178 //=================================================================================================
5179 
5180 //*************************************************************************************************
5186 template< typename MT // Type of the dense matrix
5187  , size_t... CRAs > // Compile time row arguments
5188 inline MT& Row<MT,false,true,true,CRAs...>::operand() noexcept
5189 {
5190  return matrix_;
5191 }
5193 //*************************************************************************************************
5194 
5195 
5196 //*************************************************************************************************
5202 template< typename MT // Type of the dense matrix
5203  , size_t... CRAs > // Compile time row arguments
5204 inline const MT& Row<MT,false,true,true,CRAs...>::operand() const noexcept
5205 {
5206  return matrix_;
5207 }
5209 //*************************************************************************************************
5210 
5211 
5212 //*************************************************************************************************
5218 template< typename MT // Type of the dense matrix
5219  , size_t... CRAs > // Compile time row arguments
5220 inline size_t Row<MT,false,true,true,CRAs...>::size() const noexcept
5221 {
5222  return matrix_.columns();
5223 }
5225 //*************************************************************************************************
5226 
5227 
5228 //*************************************************************************************************
5237 template< typename MT // Type of the dense matrix
5238  , size_t... CRAs > // Compile time row arguments
5239 inline size_t Row<MT,false,true,true,CRAs...>::spacing() const noexcept
5240 {
5241  return matrix_.spacing();
5242 }
5244 //*************************************************************************************************
5245 
5246 
5247 //*************************************************************************************************
5253 template< typename MT // Type of the dense matrix
5254  , size_t... CRAs > // Compile time row arguments
5255 inline size_t Row<MT,false,true,true,CRAs...>::capacity() const noexcept
5256 {
5257  return matrix_.capacity( row() );
5258 }
5260 //*************************************************************************************************
5261 
5262 
5263 //*************************************************************************************************
5272 template< typename MT // Type of the dense matrix
5273  , size_t... CRAs > // Compile time row arguments
5274 inline size_t Row<MT,false,true,true,CRAs...>::nonZeros() const
5275 {
5276  return matrix_.nonZeros( row() );
5277 }
5279 //*************************************************************************************************
5280 
5281 
5282 //*************************************************************************************************
5288 template< typename MT // Type of the dense matrix
5289  , size_t... CRAs > // Compile time row arguments
5291 {
5292  matrix_.reset( row() );
5293 }
5295 //*************************************************************************************************
5296 
5297 
5298 
5299 
5300 //=================================================================================================
5301 //
5302 // NUMERIC FUNCTIONS
5303 //
5304 //=================================================================================================
5305 
5306 //*************************************************************************************************
5319 template< typename MT // Type of the dense matrix
5320  , size_t... CRAs > // Compile time row arguments
5321 template< typename Other > // Data type of the scalar value
5322 inline Row<MT,false,true,true,CRAs...>&
5323  Row<MT,false,true,true,CRAs...>::scale( const Other& scalar )
5324 {
5326 
5327  const size_t ibegin( ( IsLower_v<MT> )
5328  ?( ( IsStrictlyLower_v<MT> )
5329  ?( row()+1UL )
5330  :( row() ) )
5331  :( 0UL ) );
5332  const size_t iend ( ( IsUpper_v<MT> )
5333  ?( ( IsStrictlyUpper_v<MT> )
5334  ?( row() )
5335  :( row()+1UL ) )
5336  :( size() ) );
5337 
5338  for( size_t i=ibegin; i<iend; ++i ) {
5339  matrix_(i,row()) *= scalar;
5340  }
5341 
5342  return *this;
5343 }
5345 //*************************************************************************************************
5346 
5347 
5348 
5349 
5350 //=================================================================================================
5351 //
5352 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
5353 //
5354 //=================================================================================================
5355 
5356 //*************************************************************************************************
5367 template< typename MT // Type of the dense matrix
5368  , size_t... CRAs > // Compile time row arguments
5369 template< typename Other > // Data type of the foreign expression
5370 inline bool Row<MT,false,true,true,CRAs...>::canAlias( const Other* alias ) const noexcept
5371 {
5372  return matrix_.isAliased( alias );
5373 }
5375 //*************************************************************************************************
5376 
5377 
5378 //*************************************************************************************************
5389 template< typename MT // Type of the dense matrix
5390  , size_t... CRAs > // Compile time row arguments
5391 template< typename MT2 // Data type of the foreign dense row
5392  , bool SO2 // Storage order of the foreign dense row
5393  , bool SF2 // Symmetry flag of the foreign dense row
5394  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
5395 inline bool
5396  Row<MT,false,true,true,CRAs...>::canAlias( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
5397 {
5398  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
5399 }
5401 //*************************************************************************************************
5402 
5403 
5404 //*************************************************************************************************
5415 template< typename MT // Type of the dense matrix
5416  , size_t... CRAs > // Compile time row arguments
5417 template< typename Other > // Data type of the foreign expression
5418 inline bool Row<MT,false,true,true,CRAs...>::isAliased( const Other* alias ) const noexcept
5419 {
5420  return matrix_.isAliased( alias );
5421 }
5423 //*************************************************************************************************
5424 
5425 
5426 //*************************************************************************************************
5437 template< typename MT // Type of the dense matrix
5438  , size_t... CRAs > // Compile time row arguments
5439 template< typename MT2 // Data type of the foreign dense row
5440  , bool SO2 // Storage order of the foreign dense row
5441  , bool SF2 // Symmetry flag of the foreign dense row
5442  , size_t... CRAs2 > // Compile time row arguments of the foreign dense row
5443 inline bool
5444  Row<MT,false,true,true,CRAs...>::isAliased( const Row<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept
5445 {
5446  return matrix_.isAliased( &alias->matrix_ ) && ( row() == alias->row() );
5447 }
5449 //*************************************************************************************************
5450 
5451 
5452 //*************************************************************************************************
5462 template< typename MT // Type of the dense matrix
5463  , size_t... CRAs > // Compile time row arguments
5464 inline bool Row<MT,false,true,true,CRAs...>::isAligned() const noexcept
5465 {
5466  return matrix_.isAligned();
5467 }
5469 //*************************************************************************************************
5470 
5471 
5472 //*************************************************************************************************
5483 template< typename MT // Type of the dense matrix
5484  , size_t... CRAs > // Compile time row arguments
5485 inline bool Row<MT,false,true,true,CRAs...>::canSMPAssign() const noexcept
5486 {
5487  return ( size() > SMP_DVECASSIGN_THRESHOLD );
5488 }
5490 //*************************************************************************************************
5491 
5492 
5493 //*************************************************************************************************
5506 template< typename MT // Type of the dense matrix
5507  , size_t... CRAs > // Compile time row arguments
5508 BLAZE_ALWAYS_INLINE typename Row<MT,false,true,true,CRAs...>::SIMDType
5509  Row<MT,false,true,true,CRAs...>::load( size_t index ) const noexcept
5510 {
5511  return matrix_.load( index, row() );
5512 }
5514 //*************************************************************************************************
5515 
5516 
5517 //*************************************************************************************************
5530 template< typename MT // Type of the dense matrix
5531  , size_t... CRAs > // Compile time row arguments
5532 BLAZE_ALWAYS_INLINE typename Row<MT,false,true,true,CRAs...>::SIMDType
5533  Row<MT,false,true,true,CRAs...>::loada( size_t index ) const noexcept
5534 {
5535  return matrix_.loada( index, row() );
5536 }
5538 //*************************************************************************************************
5539 
5540 
5541 //*************************************************************************************************
5554 template< typename MT // Type of the dense matrix
5555  , size_t... CRAs > // Compile time row arguments
5556 BLAZE_ALWAYS_INLINE typename Row<MT,false,true,true,CRAs...>::SIMDType
5557  Row<MT,false,true,true,CRAs...>::loadu( size_t index ) const noexcept
5558 {
5559  return matrix_.loadu( index, row() );
5560 }
5562 //*************************************************************************************************
5563 
5564 
5565 //*************************************************************************************************
5579 template< typename MT // Type of the dense matrix
5580  , size_t... CRAs > // Compile time row arguments
5582  Row<MT,false,true,true,CRAs...>::store( size_t index, const SIMDType& value ) noexcept
5583 {
5584  matrix_.store( index, row(), value );
5585 }
5587 //*************************************************************************************************
5588 
5589 
5590 //*************************************************************************************************
5604 template< typename MT // Type of the dense matrix
5605  , size_t... CRAs > // Compile time row arguments
5607  Row<MT,false,true,true,CRAs...>::storea( size_t index, const SIMDType& value ) noexcept
5608 {
5609  matrix_.storea( index, row(), value );
5610 }
5612 //*************************************************************************************************
5613 
5614 
5615 //*************************************************************************************************
5629 template< typename MT // Type of the dense matrix
5630  , size_t... CRAs > // Compile time row arguments
5632  Row<MT,false,true,true,CRAs...>::storeu( size_t index, const SIMDType& value ) noexcept
5633 {
5634  matrix_.storeu( index, row(), value );
5635 }
5637 //*************************************************************************************************
5638 
5639 
5640 //*************************************************************************************************
5654 template< typename MT // Type of the dense matrix
5655  , size_t... CRAs > // Compile time row arguments
5657  Row<MT,false,true,true,CRAs...>::stream( size_t index, const SIMDType& value ) noexcept
5658 {
5659  matrix_.stream( index, row(), value );
5660 }
5662 //*************************************************************************************************
5663 
5664 
5665 //*************************************************************************************************
5677 template< typename MT // Type of the dense matrix
5678  , size_t... CRAs > // Compile time row arguments
5679 template< typename VT > // Type of the right-hand side dense vector
5680 inline auto Row<MT,false,true,true,CRAs...>::assign( const DenseVector<VT,true>& rhs )
5681  -> DisableIf_t< VectorizedAssign_v<VT> >
5682 {
5683  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5684 
5685  const size_t ipos( (~rhs).size() & size_t(-2) );
5686  for( size_t i=0UL; i<ipos; i+=2UL ) {
5687  matrix_(i ,row()) = (~rhs)[i ];
5688  matrix_(i+1UL,row()) = (~rhs)[i+1UL];
5689  }
5690  if( ipos < (~rhs).size() )
5691  matrix_(ipos,row()) = (~rhs)[ipos];
5692 }
5694 //*************************************************************************************************
5695 
5696 
5697 //*************************************************************************************************
5709 template< typename MT // Type of the dense matrix
5710  , size_t... CRAs > // Compile time row arguments
5711 template< typename VT > // Type of the right-hand side dense vector
5712 inline auto Row<MT,false,true,true,CRAs...>::assign( const DenseVector<VT,true>& rhs )
5713  -> EnableIf_t< VectorizedAssign_v<VT> >
5714 {
5716 
5717  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5718 
5719  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5720 
5721  const size_t rows( size() );
5722 
5723  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
5724  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
5725 
5726  size_t i( 0UL );
5727  Iterator left( begin() );
5728  ConstIterator_t<VT> right( (~rhs).begin() );
5729 
5730  if( useStreaming && rows > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( &matrix_ ) )
5731  {
5732  for( ; i<ipos; i+=SIMDSIZE ) {
5733  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5734  }
5735  for( ; remainder && i<rows; ++i ) {
5736  *left = *right; ++left; ++right;
5737  }
5738  }
5739  else
5740  {
5741  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5742  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5743  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5744  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5745  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5746  }
5747  for( ; i<ipos; i+=SIMDSIZE ) {
5748  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5749  }
5750  for( ; remainder && i<rows; ++i ) {
5751  *left = *right; ++left; ++right;
5752  }
5753  }
5754 }
5756 //*************************************************************************************************
5757 
5758 
5759 //*************************************************************************************************
5771 template< typename MT // Type of the dense matrix
5772  , size_t... CRAs > // Compile time row arguments
5773 template< typename VT > // Type of the right-hand side sparse vector
5774 inline void Row<MT,false,true,true,CRAs...>::assign( const SparseVector<VT,true>& rhs )
5775 {
5776  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5777 
5778  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5779  matrix_(element->index(),row()) = element->value();
5780 }
5782 //*************************************************************************************************
5783 
5784 
5785 //*************************************************************************************************
5797 template< typename MT // Type of the dense matrix
5798  , size_t... CRAs > // Compile time row arguments
5799 template< typename VT > // Type of the right-hand side dense vector
5800 inline auto Row<MT,false,true,true,CRAs...>::addAssign( const DenseVector<VT,true>& rhs )
5801  -> DisableIf_t< VectorizedAddAssign_v<VT> >
5802 {
5803  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5804 
5805  const size_t ipos( (~rhs).size() & size_t(-2) );
5806  for( size_t i=0UL; i<ipos; i+=2UL ) {
5807  matrix_(i ,row()) += (~rhs)[i ];
5808  matrix_(i+1UL,row()) += (~rhs)[i+1UL];
5809  }
5810  if( ipos < (~rhs).size() )
5811  matrix_(ipos,row()) += (~rhs)[ipos];
5812 }
5814 //*************************************************************************************************
5815 
5816 
5817 //*************************************************************************************************
5829 template< typename MT // Type of the dense matrix
5830  , size_t... CRAs > // Compile time row arguments
5831 template< typename VT > // Type of the right-hand side dense vector
5832 inline auto Row<MT,false,true,true,CRAs...>::addAssign( const DenseVector<VT,true>& rhs )
5833  -> EnableIf_t< VectorizedAddAssign_v<VT> >
5834 {
5836 
5837  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5838 
5839  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5840 
5841  const size_t rows( size() );
5842 
5843  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
5844  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
5845 
5846  size_t i( 0UL );
5847  Iterator left( begin() );
5848  ConstIterator_t<VT> right( (~rhs).begin() );
5849 
5850  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5851  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5852  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5853  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5854  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5855  }
5856  for( ; i<ipos; i+=SIMDSIZE ) {
5857  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5858  }
5859  for( ; remainder && i<rows; ++i ) {
5860  *left += *right; ++left; ++right;
5861  }
5862 }
5864 //*************************************************************************************************
5865 
5866 
5867 //*************************************************************************************************
5879 template< typename MT // Type of the dense matrix
5880  , size_t... CRAs > // Compile time row arguments
5881 template< typename VT > // Type of the right-hand side sparse vector
5882 inline void Row<MT,false,true,true,CRAs...>::addAssign( const SparseVector<VT,true>& rhs )
5883 {
5884  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5885 
5886  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5887  matrix_(element->index(),row()) += element->value();
5888 }
5890 //*************************************************************************************************
5891 
5892 
5893 //*************************************************************************************************
5905 template< typename MT // Type of the dense matrix
5906  , size_t... CRAs > // Compile time row arguments
5907 template< typename VT > // Type of the right-hand side dense vector
5908 inline auto Row<MT,false,true,true,CRAs...>::subAssign( const DenseVector<VT,true>& rhs )
5909  -> DisableIf_t< VectorizedSubAssign_v<VT> >
5910 {
5911  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5912 
5913  const size_t ipos( (~rhs).size() & size_t(-2) );
5914  for( size_t i=0UL; i<ipos; i+=2UL ) {
5915  matrix_(i ,row()) -= (~rhs)[i ];
5916  matrix_(i+1UL,row()) -= (~rhs)[i+1UL];
5917  }
5918  if( ipos < (~rhs).size() )
5919  matrix_(ipos,row()) -= (~rhs)[ipos];
5920 }
5922 //*************************************************************************************************
5923 
5924 
5925 //*************************************************************************************************
5937 template< typename MT // Type of the dense matrix
5938  , size_t... CRAs > // Compile time row arguments
5939 template< typename VT > // Type of the right-hand side dense vector
5940 inline auto Row<MT,false,true,true,CRAs...>::subAssign( const DenseVector<VT,true>& rhs )
5941  -> EnableIf_t< VectorizedSubAssign_v<VT> >
5942 {
5944 
5945  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5946 
5947  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5948 
5949  const size_t rows( size() );
5950 
5951  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
5952  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
5953 
5954  size_t i( 0UL );
5955  Iterator left( begin() );
5956  ConstIterator_t<VT> right( (~rhs).begin() );
5957 
5958  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5959  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5960  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5961  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5962  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5963  }
5964  for( ; i<ipos; i+=SIMDSIZE ) {
5965  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5966  }
5967  for( ; remainder && i<rows; ++i ) {
5968  *left -= *right; ++left; ++right;
5969  }
5970 }
5972 //*************************************************************************************************
5973 
5974 
5975 //*************************************************************************************************
5987 template< typename MT // Type of the dense matrix
5988  , size_t... CRAs > // Compile time row arguments
5989 template< typename VT > // Type of the right-hand side sparse vector
5990 inline void Row<MT,false,true,true,CRAs...>::subAssign( const SparseVector<VT,true>& rhs )
5991 {
5992  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5993 
5994  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5995  matrix_(element->index(),row()) -= element->value();
5996 }
5998 //*************************************************************************************************
5999 
6000 
6001 //*************************************************************************************************
6013 template< typename MT // Type of the dense matrix
6014  , size_t... CRAs > // Compile time row arguments
6015 template< typename VT > // Type of the right-hand side dense vector
6016 inline auto Row<MT,false,true,true,CRAs...>::multAssign( const DenseVector<VT,true>& rhs )
6017  -> DisableIf_t< VectorizedMultAssign_v<VT> >
6018 {
6019  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6020 
6021  const size_t ipos( (~rhs).size() & size_t(-2) );
6022  for( size_t i=0UL; i<ipos; i+=2UL ) {
6023  matrix_(i ,row()) *= (~rhs)[i ];
6024  matrix_(i+1UL,row()) *= (~rhs)[i+1UL];
6025  }
6026  if( ipos < (~rhs).size() )
6027  matrix_(ipos,row()) *= (~rhs)[ipos];
6028 }
6030 //*************************************************************************************************
6031 
6032 
6033 //*************************************************************************************************
6045 template< typename MT // Type of the dense matrix
6046  , size_t... CRAs > // Compile time row arguments
6047 template< typename VT > // Type of the right-hand side dense vector
6048 inline auto Row<MT,false,true,true,CRAs...>::multAssign( const DenseVector<VT,true>& rhs )
6049  -> EnableIf_t< VectorizedMultAssign_v<VT> >
6050 {
6052 
6053  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6054 
6055  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
6056 
6057  const size_t rows( size() );
6058 
6059  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
6060  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
6061 
6062  size_t i( 0UL );
6063  Iterator left( begin() );
6064  ConstIterator_t<VT> right( (~rhs).begin() );
6065 
6066  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6067  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6068  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6069  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6070  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6071  }
6072  for( ; i<ipos; i+=SIMDSIZE ) {
6073  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6074  }
6075  for( ; remainder && i<rows; ++i ) {
6076  *left *= *right; ++left; ++right;
6077  }
6078 }
6080 //*************************************************************************************************
6081 
6082 
6083 //*************************************************************************************************
6095 template< typename MT // Type of the dense matrix
6096  , size_t... CRAs > // Compile time row arguments
6097 template< typename VT > // Type of the right-hand side sparse vector
6098 inline void Row<MT,false,true,true,CRAs...>::multAssign( const SparseVector<VT,true>& rhs )
6099 {
6100  using blaze::reset;
6101 
6102  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6103 
6104  size_t i( 0UL );
6105 
6106  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
6107  const size_t index( element->index() );
6108  for( ; i<index; ++i )
6109  reset( matrix_(i,row()) );
6110  matrix_(i,row()) *= element->value();
6111  ++i;
6112  }
6113 
6114  for( ; i<size(); ++i ) {
6115  reset( matrix_(i,row()) );
6116  }
6117 }
6119 //*************************************************************************************************
6120 
6121 
6122 //*************************************************************************************************
6134 template< typename MT // Type of the dense matrix
6135  , size_t... CRAs > // Compile time row arguments
6136 template< typename VT > // Type of the right-hand side dense vector
6137 inline auto Row<MT,false,true,true,CRAs...>::divAssign( const DenseVector<VT,true>& rhs )
6138  -> DisableIf_t< VectorizedDivAssign_v<VT> >
6139 {
6140  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6141 
6142  const size_t ipos( (~rhs).size() & size_t(-2) );
6143  for( size_t i=0UL; i<ipos; i+=2UL ) {
6144  matrix_(i ,row()) /= (~rhs)[i ];
6145  matrix_(i+1UL,row()) /= (~rhs)[i+1UL];
6146  }
6147  if( ipos < (~rhs).size() )
6148  matrix_(ipos,row()) /= (~rhs)[ipos];
6149 }
6151 //*************************************************************************************************
6152 
6153 
6154 //*************************************************************************************************
6166 template< typename MT // Type of the dense matrix
6167  , size_t... CRAs > // Compile time row arguments
6168 template< typename VT > // Type of the right-hand side dense vector
6169 inline auto Row<MT,false,true,true,CRAs...>::divAssign( const DenseVector<VT,true>& rhs )
6170  -> EnableIf_t< VectorizedDivAssign_v<VT> >
6171 {
6173 
6174  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6175 
6176  const size_t rows( size() );
6177 
6178  const size_t ipos( rows & size_t(-SIMDSIZE) );
6179  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
6180 
6181  size_t i( 0UL );
6182  Iterator left( begin() );
6183  ConstIterator_t<VT> right( (~rhs).begin() );
6184 
6185  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6186  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6187  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6188  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6189  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6190  }
6191  for( ; i<ipos; i+=SIMDSIZE ) {
6192  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6193  }
6194  for( ; i<rows; ++i ) {
6195  *left /= *right; ++left; ++right;
6196  }
6197 }
6199 //*************************************************************************************************
6200 
6201 } // namespace blaze
6202 
6203 #endif
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
Header file for the implementation of the RowData class template.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the IsUniUpper type trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:170
Header file for the View base class.
Header file for the row trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type,...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:173
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a submatrix type (i.e....
Definition: Submatrix.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
constexpr bool IsReference_v
Auxiliary variable template for the IsReference type trait.The IsReference_v variable template provid...
Definition: IsReference.h:95
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type,...
Definition: Symmetric.h:60
Header file for the reset shim.
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:187
Constraints on the storage order of matrix types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i....
Definition: TransExpr.h:81
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.The IsLower_v variable template provides a con...
Definition: IsLower.h:175
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Header file for the IsUniLower type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.The IsStrictlyLower_v variable templat...
Definition: IsStrictlyLower.h:173
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
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:220
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the implementation of the Row base template.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.The IsStrictlyUpper_v variable templat...
Definition: IsStrictlyUpper.h:173
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
constexpr bool IsExpression_v
Auxiliary variable template for the IsExpression type trait.The IsExpression_v variable template prov...
Definition: IsExpression.h:130
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
decltype(auto) operator *(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9091
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:187
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
Header file for all SIMD functionality.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:138
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraint on the data type.
Header file for the IsTriangular type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type,...
Definition: Vectorizable.h:61
Constraint on the data type.
Header file for the exception macros of the math module.
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:171
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
Constraint on the data type.
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:558
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type,...
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for the HasSIMDMult type trait.
Header file for the IsConst type trait.
Header file for run time assertion macros.
Header file for the cross product trait.
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
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance,...
Definition: Check.h:96
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.The IsUniLower_v variable template provides...
Definition: IsUniLower.h:173
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type,...
Definition: Reference.h:79
typename RowTrait< MT, CRAs... >::Type RowTrait_t
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_t alias declaration provides a c...
Definition: RowTrait.h:170
Header file for the isDefault shim.
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.The IsUpper_v variable template provides a con...
Definition: IsUpper.h:175
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
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
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Constraints on the storage order of matrix types.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
Header file for the HasMutableDataAccess type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the IsReference type trait.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type,...
Definition: DenseVector.h:61
Header file for the HasSIMDDiv type trait.
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
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:188
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: RowVector.h:61
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsRestricted type trait.
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
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:191
Header file for the clear shim.
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Constraint on the data type.