Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_DENSE_H_
36 #define _BLAZE_MATH_VIEWS_COLUMN_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/SIMD.h>
84 #include <blaze/math/views/Check.h>
87 #include <blaze/system/CacheSize.h>
88 #include <blaze/system/Inline.h>
91 #include <blaze/util/Assert.h>
95 #include <blaze/util/DisableIf.h>
96 #include <blaze/util/EnableIf.h>
97 #include <blaze/util/mpl/If.h>
98 #include <blaze/util/TrueType.h>
99 #include <blaze/util/TypeList.h>
100 #include <blaze/util/Types.h>
104 
105 
106 namespace blaze {
107 
108 //=================================================================================================
109 //
110 // CLASS TEMPLATE SPECIALIZATION FOR COLUMN-MAJOR DENSE MATRICES
111 //
112 //=================================================================================================
113 
114 //*************************************************************************************************
122 template< typename MT // Type of the dense matrix
123  , bool SF // Symmetry flag
124  , size_t... CCAs > // Compile time column arguments
125 class Column<MT,true,true,SF,CCAs...>
126  : public View< DenseVector< Column<MT,true,true,SF,CCAs...>, false > >
127  , private ColumnData<CCAs...>
128 {
129  private:
130  //**Type definitions****************************************************************************
131  using DataType = ColumnData<CCAs...>;
132  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
133  //**********************************************************************************************
134 
135  public:
136  //**Type definitions****************************************************************************
138  using This = Column<MT,true,true,SF,CCAs...>;
139 
140  using BaseType = DenseVector<This,false>;
141  using ViewedType = MT;
142  using ResultType = ColumnTrait_t<MT,CCAs...>;
143  using TransposeType = TransposeType_t<ResultType>;
144  using ElementType = ElementType_t<MT>;
145  using SIMDType = SIMDTrait_t<ElementType>;
146  using ReturnType = ReturnType_t<MT>;
147  using CompositeType = const Column&;
148 
150  using ConstReference = ConstReference_t<MT>;
151 
153  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
154 
156  using ConstPointer = ConstPointer_t<MT>;
157 
159  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
160 
162  using ConstIterator = ConstIterator_t<MT>;
163 
165  using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
166  //**********************************************************************************************
167 
168  //**Compilation flags***************************************************************************
170  static constexpr bool simdEnabled = MT::simdEnabled;
171 
173  static constexpr bool smpAssignable = MT::smpAssignable;
174  //**********************************************************************************************
175 
176  //**Constructors********************************************************************************
179  template< typename... RCAs >
180  explicit inline Column( MT& matrix, RCAs... args );
181 
182  Column( const Column& ) = default;
184  //**********************************************************************************************
185 
186  //**Destructor**********************************************************************************
189  ~Column() = default;
191  //**********************************************************************************************
192 
193  //**Data access functions***********************************************************************
196  inline Reference operator[]( size_t index );
197  inline ConstReference operator[]( size_t index ) const;
198  inline Reference at( size_t index );
199  inline ConstReference at( size_t index ) const;
200  inline Pointer data () noexcept;
201  inline ConstPointer data () const noexcept;
202  inline Iterator begin ();
203  inline ConstIterator begin () const;
204  inline ConstIterator cbegin() const;
205  inline Iterator end ();
206  inline ConstIterator end () const;
207  inline ConstIterator cend () const;
209  //**********************************************************************************************
210 
211  //**Assignment operators************************************************************************
214  inline Column& operator=( const ElementType& rhs );
215  inline Column& operator=( initializer_list<ElementType> list );
216  inline Column& operator=( const Column& rhs );
217 
218  template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
219  template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
220  template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
221  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
222  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
223  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
225  //**********************************************************************************************
226 
227  //**Utility functions***************************************************************************
230  using DataType::column;
231 
232  inline MT& operand() noexcept;
233  inline const MT& operand() const noexcept;
234 
235  inline size_t size() const noexcept;
236  inline size_t spacing() const noexcept;
237  inline size_t capacity() const noexcept;
238  inline size_t nonZeros() const;
239  inline void reset();
241  //**********************************************************************************************
242 
243  //**Numeric functions***************************************************************************
246  template< typename Other > inline Column& scale( const Other& scalar );
248  //**********************************************************************************************
249 
250  private:
251  //**********************************************************************************************
253  template< typename VT >
254  static constexpr bool VectorizedAssign_v =
255  ( useOptimizedKernels &&
256  simdEnabled && VT::simdEnabled &&
258  //**********************************************************************************************
259 
260  //**********************************************************************************************
262  template< typename VT >
263  static constexpr bool VectorizedAddAssign_v =
264  ( useOptimizedKernels &&
265  simdEnabled && VT::simdEnabled &&
268  //**********************************************************************************************
269 
270  //**********************************************************************************************
272  template< typename VT >
273  static constexpr bool VectorizedSubAssign_v =
274  ( useOptimizedKernels &&
275  simdEnabled && VT::simdEnabled &&
278  //**********************************************************************************************
279 
280  //**********************************************************************************************
282  template< typename VT >
283  static constexpr bool VectorizedMultAssign_v =
284  ( useOptimizedKernels &&
285  simdEnabled && VT::simdEnabled &&
288  //**********************************************************************************************
289 
290  //**********************************************************************************************
292  template< typename VT >
293  static constexpr bool VectorizedDivAssign_v =
294  ( useOptimizedKernels &&
295  simdEnabled && VT::simdEnabled &&
298  //**********************************************************************************************
299 
300  //**SIMD properties*****************************************************************************
302  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
303  //**********************************************************************************************
304 
305  public:
306  //**Expression template evaluation functions****************************************************
309  template< typename Other >
310  inline bool canAlias( const Other* alias ) const noexcept;
311 
312  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
313  inline bool canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
314 
315  template< typename Other >
316  inline bool isAliased( const Other* alias ) const noexcept;
317 
318  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
319  inline bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
320 
321  inline bool isAligned () const noexcept;
322  inline bool canSMPAssign() const noexcept;
323 
324  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
325  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
326  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
327 
328  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
329  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
330  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
331  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
332 
333  template< typename VT >
334  inline auto assign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedAssign_v<VT> >;
335 
336  template< typename VT >
337  inline auto assign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedAssign_v<VT> >;
338 
339  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
340 
341  template< typename VT >
342  inline auto addAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedAddAssign_v<VT> >;
343 
344  template< typename VT >
345  inline auto addAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedAddAssign_v<VT> >;
346 
347  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
348 
349  template< typename VT >
350  inline auto subAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedSubAssign_v<VT> >;
351 
352  template< typename VT >
353  inline auto subAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedSubAssign_v<VT> >;
354 
355  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
356 
357  template< typename VT >
358  inline auto multAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedMultAssign_v<VT> >;
359 
360  template< typename VT >
361  inline auto multAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedMultAssign_v<VT> >;
362 
363  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
364 
365  template< typename VT >
366  inline auto divAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedDivAssign_v<VT> >;
367 
368  template< typename VT >
369  inline auto divAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedDivAssign_v<VT> >;
371  //**********************************************************************************************
372 
373  private:
374  //**Member variables****************************************************************************
377  Operand matrix_;
378 
379  //**********************************************************************************************
380 
381  //**Friend declarations*************************************************************************
382  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CCAs2 > friend class Column;
383  //**********************************************************************************************
384 
385  //**Compile time checks*************************************************************************
393  //**********************************************************************************************
394 };
396 //*************************************************************************************************
397 
398 
399 
400 
401 //=================================================================================================
402 //
403 // CONSTRUCTORS
404 //
405 //=================================================================================================
406 
407 //*************************************************************************************************
420 template< typename MT // Type of the dense matrix
421  , bool SF // Symmetry flag
422  , size_t... CCAs > // Compile time column arguments
423 template< typename... RCAs > // Runtime column arguments
424 inline Column<MT,true,true,SF,CCAs...>::Column( MT& matrix, RCAs... args )
425  : DataType( args... ) // Base class initialization
426  , matrix_ ( matrix ) // The matrix containing the column
427 {
428  if( !Contains_v< TypeList<RCAs...>, Unchecked > ) {
429  if( matrix_.columns() <= column() ) {
430  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
431  }
432  }
433  else {
434  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
435  }
436 }
438 //*************************************************************************************************
439 
440 
441 
442 
443 //=================================================================================================
444 //
445 // DATA ACCESS FUNCTIONS
446 //
447 //=================================================================================================
448 
449 //*************************************************************************************************
459 template< typename MT // Type of the dense matrix
460  , bool SF // Symmetry flag
461  , size_t... CCAs > // Compile time column arguments
462 inline typename Column<MT,true,true,SF,CCAs...>::Reference
463  Column<MT,true,true,SF,CCAs...>::operator[]( size_t index )
464 {
465  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
466  return matrix_(index,column());
467 }
469 //*************************************************************************************************
470 
471 
472 //*************************************************************************************************
482 template< typename MT // Type of the dense matrix
483  , bool SF // Symmetry flag
484  , size_t... CCAs > // Compile time column arguments
485 inline typename Column<MT,true,true,SF,CCAs...>::ConstReference
486  Column<MT,true,true,SF,CCAs...>::operator[]( size_t index ) const
487 {
488  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
489  return const_cast<const MT&>( matrix_ )(index,column());
490 }
492 //*************************************************************************************************
493 
494 
495 //*************************************************************************************************
506 template< typename MT // Type of the dense matrix
507  , bool SF // Symmetry flag
508  , size_t... CCAs > // Compile time column arguments
509 inline typename Column<MT,true,true,SF,CCAs...>::Reference
510  Column<MT,true,true,SF,CCAs...>::at( size_t index )
511 {
512  if( index >= size() ) {
513  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
514  }
515  return (*this)[index];
516 }
518 //*************************************************************************************************
519 
520 
521 //*************************************************************************************************
532 template< typename MT // Type of the dense matrix
533  , bool SF // Symmetry flag
534  , size_t... CCAs > // Compile time column arguments
535 inline typename Column<MT,true,true,SF,CCAs...>::ConstReference
536  Column<MT,true,true,SF,CCAs...>::at( size_t index ) const
537 {
538  if( index >= size() ) {
539  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
540  }
541  return (*this)[index];
542 }
544 //*************************************************************************************************
545 
546 
547 //*************************************************************************************************
556 template< typename MT // Type of the dense matrix
557  , bool SF // Symmetry flag
558  , size_t... CCAs > // Compile time column arguments
559 inline typename Column<MT,true,true,SF,CCAs...>::Pointer
561 {
562  return matrix_.data( column() );
563 }
565 //*************************************************************************************************
566 
567 
568 //*************************************************************************************************
577 template< typename MT // Type of the dense matrix
578  , bool SF // Symmetry flag
579  , size_t... CCAs > // Compile time column arguments
580 inline typename Column<MT,true,true,SF,CCAs...>::ConstPointer
582 {
583  return matrix_.data( column() );
584 }
586 //*************************************************************************************************
587 
588 
589 //*************************************************************************************************
597 template< typename MT // Type of the dense matrix
598  , bool SF // Symmetry flag
599  , size_t... CCAs > // Compile time column arguments
600 inline typename Column<MT,true,true,SF,CCAs...>::Iterator
602 {
603  return matrix_.begin( column() );
604 }
606 //*************************************************************************************************
607 
608 
609 //*************************************************************************************************
617 template< typename MT // Type of the dense matrix
618  , bool SF // Symmetry flag
619  , size_t... CCAs > // Compile time column arguments
620 inline typename Column<MT,true,true,SF,CCAs...>::ConstIterator
622 {
623  return matrix_.cbegin( column() );
624 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
637 template< typename MT // Type of the dense matrix
638  , bool SF // Symmetry flag
639  , size_t... CCAs > // Compile time column arguments
640 inline typename Column<MT,true,true,SF,CCAs...>::ConstIterator
642 {
643  return matrix_.cbegin( column() );
644 }
646 //*************************************************************************************************
647 
648 
649 //*************************************************************************************************
657 template< typename MT // Type of the dense matrix
658  , bool SF // Symmetry flag
659  , size_t... CCAs > // Compile time column arguments
660 inline typename Column<MT,true,true,SF,CCAs...>::Iterator
662 {
663  return matrix_.end( column() );
664 }
666 //*************************************************************************************************
667 
668 
669 //*************************************************************************************************
677 template< typename MT // Type of the dense matrix
678  , bool SF // Symmetry flag
679  , size_t... CCAs > // Compile time column arguments
680 inline typename Column<MT,true,true,SF,CCAs...>::ConstIterator
682 {
683  return matrix_.cend( column() );
684 }
686 //*************************************************************************************************
687 
688 
689 //*************************************************************************************************
697 template< typename MT // Type of the dense matrix
698  , bool SF // Symmetry flag
699  , size_t... CCAs > // Compile time column arguments
700 inline typename Column<MT,true,true,SF,CCAs...>::ConstIterator
702 {
703  return matrix_.cend( column() );
704 }
706 //*************************************************************************************************
707 
708 
709 
710 
711 //=================================================================================================
712 //
713 // ASSIGNMENT OPERATORS
714 //
715 //=================================================================================================
716 
717 //*************************************************************************************************
728 template< typename MT // Type of the dense matrix
729  , bool SF // Symmetry flag
730  , size_t... CCAs > // Compile time column arguments
731 inline Column<MT,true,true,SF,CCAs...>&
732  Column<MT,true,true,SF,CCAs...>::operator=( const ElementType& rhs )
733 {
734  decltype(auto) left( derestrict( matrix_ ) );
735 
736  const size_t ibegin( ( IsLower_v<MT> )
737  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
738  ?( column()+1UL )
739  :( column() ) )
740  :( 0UL ) );
741  const size_t iend ( ( IsUpper_v<MT> )
742  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
743  ?( column() )
744  :( column()+1UL ) )
745  :( size() ) );
746 
747  for( size_t i=ibegin; i<iend; ++i ) {
748  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, i, column(), rhs ) )
749  left(i,column()) = rhs;
750  }
751 
752  return *this;
753 }
755 //*************************************************************************************************
756 
757 
758 //*************************************************************************************************
773 template< typename MT // Type of the dense matrix
774  , bool SF // Symmetry flag
775  , size_t... CCAs > // Compile time column arguments
776 inline Column<MT,true,true,SF,CCAs...>&
777  Column<MT,true,true,SF,CCAs...>::operator=( initializer_list<ElementType> list )
778 {
779  if( list.size() > size() ) {
780  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
781  }
782 
783  if( IsRestricted_v<MT> ) {
784  const InitializerVector<ElementType,false> tmp( list, size() );
785  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
786  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
787  }
788  }
789 
790  decltype(auto) left( derestrict( *this ) );
791 
792  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
793 
794  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
795 
796  return *this;
797 }
799 //*************************************************************************************************
800 
801 
802 //*************************************************************************************************
816 template< typename MT // Type of the dense matrix
817  , bool SF // Symmetry flag
818  , size_t... CCAs > // Compile time column arguments
819 inline Column<MT,true,true,SF,CCAs...>&
820  Column<MT,true,true,SF,CCAs...>::operator=( const Column& rhs )
821 {
822  if( &rhs == this ) return *this;
823 
824  if( size() != rhs.size() ) {
825  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
826  }
827 
828  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
829  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
830  }
831 
832  decltype(auto) left( derestrict( *this ) );
833 
834  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
835  const ResultType tmp( rhs );
836  smpAssign( left, tmp );
837  }
838  else {
839  smpAssign( left, rhs );
840  }
841 
842  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
843 
844  return *this;
845 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
864 template< typename MT // Type of the dense matrix
865  , bool SF // Symmetry flag
866  , size_t... CCAs > // Compile time column arguments
867 template< typename VT > // Type of the right-hand side vector
868 inline Column<MT,true,true,SF,CCAs...>&
869  Column<MT,true,true,SF,CCAs...>::operator=( const Vector<VT,false>& rhs )
870 {
871  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
873 
874  if( size() != (~rhs).size() ) {
875  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
876  }
877 
878  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
879  Right right( ~rhs );
880 
881  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
882  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
883  }
884 
885  decltype(auto) left( derestrict( *this ) );
886 
887  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
888  const ResultType_t<VT> tmp( right );
889  smpAssign( left, tmp );
890  }
891  else {
892  if( IsSparseVector_v<VT> )
893  reset();
894  smpAssign( left, right );
895  }
896 
897  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
898 
899  return *this;
900 }
902 //*************************************************************************************************
903 
904 
905 //*************************************************************************************************
919 template< typename MT // Type of the dense matrix
920  , bool SF // Symmetry flag
921  , size_t... CCAs > // Compile time column arguments
922 template< typename VT > // Type of the right-hand side vector
923 inline Column<MT,true,true,SF,CCAs...>&
924  Column<MT,true,true,SF,CCAs...>::operator+=( const Vector<VT,false>& rhs )
925 {
926  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
928 
929  if( size() != (~rhs).size() ) {
930  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
931  }
932 
933  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
934  Right right( ~rhs );
935 
936  if( !tryAddAssign( matrix_, right, 0UL, column() ) ) {
937  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
938  }
939 
940  decltype(auto) left( derestrict( *this ) );
941 
942  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
943  const ResultType_t<VT> tmp( right );
944  smpAddAssign( left, tmp );
945  }
946  else {
947  smpAddAssign( left, right );
948  }
949 
950  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
951 
952  return *this;
953 }
955 //*************************************************************************************************
956 
957 
958 //*************************************************************************************************
972 template< typename MT // Type of the dense matrix
973  , bool SF // Symmetry flag
974  , size_t... CCAs > // Compile time column arguments
975 template< typename VT > // Type of the right-hand side vector
976 inline Column<MT,true,true,SF,CCAs...>&
977  Column<MT,true,true,SF,CCAs...>::operator-=( const Vector<VT,false>& rhs )
978 {
979  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
981 
982  if( size() != (~rhs).size() ) {
983  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
984  }
985 
986  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
987  Right right( ~rhs );
988 
989  if( !trySubAssign( matrix_, right, 0UL, column() ) ) {
990  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
991  }
992 
993  decltype(auto) left( derestrict( *this ) );
994 
995  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
996  const ResultType_t<VT> tmp( right );
997  smpSubAssign( left, tmp );
998  }
999  else {
1000  smpSubAssign( left, right );
1001  }
1002 
1003  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1004 
1005  return *this;
1006 }
1008 //*************************************************************************************************
1009 
1010 
1011 //*************************************************************************************************
1024 template< typename MT // Type of the dense matrix
1025  , bool SF // Symmetry flag
1026  , size_t... CCAs > // Compile time column arguments
1027 template< typename VT > // Type of the right-hand side vector
1028 inline Column<MT,true,true,SF,CCAs...>&
1029  Column<MT,true,true,SF,CCAs...>::operator*=( const Vector<VT,false>& rhs )
1030 {
1031  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
1033 
1034  if( size() != (~rhs).size() ) {
1035  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1036  }
1037 
1038  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
1039  Right right( ~rhs );
1040 
1041  if( !tryMultAssign( matrix_, right, 0UL, column() ) ) {
1042  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1043  }
1044 
1045  decltype(auto) left( derestrict( *this ) );
1046 
1047  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1048  const ResultType_t<VT> tmp( right );
1049  smpMultAssign( left, tmp );
1050  }
1051  else {
1052  smpMultAssign( left, right );
1053  }
1054 
1055  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1056 
1057  return *this;
1058 }
1060 //*************************************************************************************************
1061 
1062 
1063 //*************************************************************************************************
1075 template< typename MT // Type of the dense matrix
1076  , bool SF // Symmetry flag
1077  , size_t... CCAs > // Compile time column arguments
1078 template< typename VT > // Type of the right-hand side dense vector
1079 inline Column<MT,true,true,SF,CCAs...>&
1080  Column<MT,true,true,SF,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
1081 {
1082  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
1084 
1085  if( size() != (~rhs).size() ) {
1086  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1087  }
1088 
1089  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
1090  Right right( ~rhs );
1091 
1092  if( !tryDivAssign( matrix_, right, 0UL, column() ) ) {
1093  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1094  }
1095 
1096  decltype(auto) left( derestrict( *this ) );
1097 
1098  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1099  const ResultType_t<VT> tmp( right );
1100  smpDivAssign( left, tmp );
1101  }
1102  else {
1103  smpDivAssign( left, right );
1104  }
1105 
1106  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1107 
1108  return *this;
1109 }
1111 //*************************************************************************************************
1112 
1113 
1114 //*************************************************************************************************
1127 template< typename MT // Type of the dense matrix
1128  , bool SF // Symmetry flag
1129  , size_t... CCAs > // Compile time column arguments
1130 template< typename VT > // Type of the right-hand side vector
1131 inline Column<MT,true,true,SF,CCAs...>&
1132  Column<MT,true,true,SF,CCAs...>::operator%=( const Vector<VT,false>& rhs )
1133 {
1134  using blaze::assign;
1135 
1136  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
1138 
1139  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
1140 
1144 
1145  if( size() != 3UL || (~rhs).size() != 3UL ) {
1146  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1147  }
1148 
1149  const CrossType right( *this % (~rhs) );
1150 
1151  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
1152  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1153  }
1154 
1155  decltype(auto) left( derestrict( *this ) );
1156 
1157  assign( left, right );
1158 
1159  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1160 
1161  return *this;
1162 }
1164 //*************************************************************************************************
1165 
1166 
1167 
1168 
1169 //=================================================================================================
1170 //
1171 // UTILITY FUNCTIONS
1172 //
1173 //=================================================================================================
1174 
1175 //*************************************************************************************************
1181 template< typename MT // Type of the dense matrix
1182  , bool SF // Symmetry flag
1183  , size_t... CCAs > // Compile time column arguments
1184 inline MT& Column<MT,true,true,SF,CCAs...>::operand() noexcept
1185 {
1186  return matrix_;
1187 }
1189 //*************************************************************************************************
1190 
1191 
1192 //*************************************************************************************************
1198 template< typename MT // Type of the dense matrix
1199  , bool SF // Symmetry flag
1200  , size_t... CCAs > // Compile time column arguments
1201 inline const MT& Column<MT,true,true,SF,CCAs...>::operand() const noexcept
1202 {
1203  return matrix_;
1204 }
1206 //*************************************************************************************************
1207 
1208 
1209 //*************************************************************************************************
1215 template< typename MT // Type of the dense matrix
1216  , bool SF // Symmetry flag
1217  , size_t... CCAs > // Compile time column arguments
1218 inline size_t Column<MT,true,true,SF,CCAs...>::size() const noexcept
1219 {
1220  return matrix_.rows();
1221 }
1223 //*************************************************************************************************
1224 
1225 
1226 //*************************************************************************************************
1235 template< typename MT // Type of the dense matrix
1236  , bool SF // Symmetry flag
1237  , size_t... CCAs > // Compile time column arguments
1238 inline size_t Column<MT,true,true,SF,CCAs...>::spacing() const noexcept
1239 {
1240  return matrix_.spacing();
1241 }
1243 //*************************************************************************************************
1244 
1245 
1246 //*************************************************************************************************
1252 template< typename MT // Type of the dense matrix
1253  , bool SF // Symmetry flag
1254  , size_t... CCAs > // Compile time column arguments
1255 inline size_t Column<MT,true,true,SF,CCAs...>::capacity() const noexcept
1256 {
1257  return matrix_.capacity( column() );
1258 }
1260 //*************************************************************************************************
1261 
1262 
1263 //*************************************************************************************************
1272 template< typename MT // Type of the dense matrix
1273  , bool SF // Symmetry flag
1274  , size_t... CCAs > // Compile time column arguments
1275 inline size_t Column<MT,true,true,SF,CCAs...>::nonZeros() const
1276 {
1277  return matrix_.nonZeros( column() );
1278 }
1280 //*************************************************************************************************
1281 
1282 
1283 //*************************************************************************************************
1289 template< typename MT // Type of the dense matrix
1290  , bool SF // Symmetry flag
1291  , size_t... CCAs > // Compile time column arguments
1293 {
1294  matrix_.reset( column() );
1295 }
1297 //*************************************************************************************************
1298 
1299 
1300 
1301 
1302 //=================================================================================================
1303 //
1304 // NUMERIC FUNCTIONS
1305 //
1306 //=================================================================================================
1307 
1308 //*************************************************************************************************
1321 template< typename MT // Type of the dense matrix
1322  , bool SF // Symmetry flag
1323  , size_t... CCAs > // Compile time column arguments
1324 template< typename Other > // Data type of the scalar value
1325 inline Column<MT,true,true,SF,CCAs...>&
1326  Column<MT,true,true,SF,CCAs...>::scale( const Other& scalar )
1327 {
1329 
1330  const size_t ibegin( ( IsLower_v<MT> )
1331  ?( ( IsStrictlyLower_v<MT> )
1332  ?( column()+1UL )
1333  :( column() ) )
1334  :( 0UL ) );
1335  const size_t iend ( ( IsUpper_v<MT> )
1336  ?( ( IsStrictlyUpper_v<MT> )
1337  ?( column() )
1338  :( column()+1UL ) )
1339  :( size() ) );
1340 
1341  for( size_t i=ibegin; i<iend; ++i ) {
1342  matrix_(i,column()) *= scalar;
1343  }
1344 
1345  return *this;
1346 }
1348 //*************************************************************************************************
1349 
1350 
1351 
1352 
1353 //=================================================================================================
1354 //
1355 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1356 //
1357 //=================================================================================================
1358 
1359 //*************************************************************************************************
1370 template< typename MT // Type of the dense matrix
1371  , bool SF // Symmetry flag
1372  , size_t... CCAs > // Compile time column arguments
1373 template< typename Other > // Data type of the foreign expression
1374 inline bool Column<MT,true,true,SF,CCAs...>::canAlias( const Other* alias ) const noexcept
1375 {
1376  return matrix_.isAliased( alias );
1377 }
1379 //*************************************************************************************************
1380 
1381 
1382 //*************************************************************************************************
1393 template< typename MT // Type of the dense matrix
1394  , bool SF // Symmetry flag
1395  , size_t... CCAs > // Compile time column arguments
1396 template< typename MT2 // Data type of the foreign dense column
1397  , bool SO2 // Storage order of the foreign dense column
1398  , bool SF2 // Symmetry flag of the foreign dense column
1399  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
1400 inline bool
1401  Column<MT,true,true,SF,CCAs...>::canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
1402 {
1403  return matrix_.isAliased( alias->matrix_ ) && ( column() == alias->column() );
1404 }
1406 //*************************************************************************************************
1407 
1408 
1409 //*************************************************************************************************
1420 template< typename MT // Type of the dense matrix
1421  , bool SF // Symmetry flag
1422  , size_t... CCAs > // Compile time column arguments
1423 template< typename Other > // Data type of the foreign expression
1424 inline bool Column<MT,true,true,SF,CCAs...>::isAliased( const Other* alias ) const noexcept
1425 {
1426  return matrix_.isAliased( alias );
1427 }
1429 //*************************************************************************************************
1430 
1431 
1432 //*************************************************************************************************
1443 template< typename MT // Type of the dense matrix
1444  , bool SF // Symmetry flag
1445  , size_t... CCAs > // Compile time column arguments
1446 template< typename MT2 // Data type of the foreign dense column
1447  , bool SO2 // Storage order of the foreign dense column
1448  , bool SF2 // Symmetry flag of the foreign dense column
1449  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
1450 inline bool
1451  Column<MT,true,true,SF,CCAs...>::isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
1452 {
1453  return matrix_.isAliased( &alias->matrix_ ) && ( column() == alias->column() );
1454 }
1456 //*************************************************************************************************
1457 
1458 
1459 //*************************************************************************************************
1469 template< typename MT // Type of the dense matrix
1470  , bool SF // Symmetry flag
1471  , size_t... CCAs > // Compile time column arguments
1472 inline bool Column<MT,true,true,SF,CCAs...>::isAligned() const noexcept
1473 {
1474  return matrix_.isAligned();
1475 }
1477 //*************************************************************************************************
1478 
1479 
1480 //*************************************************************************************************
1491 template< typename MT // Type of the dense matrix
1492  , bool SF // Symmetry flag
1493  , size_t... CCAs > // Compile time column arguments
1494 inline bool Column<MT,true,true,SF,CCAs...>::canSMPAssign() const noexcept
1495 {
1496  return ( size() > SMP_DVECASSIGN_THRESHOLD );
1497 }
1499 //*************************************************************************************************
1500 
1501 
1502 //*************************************************************************************************
1514 template< typename MT // Type of the dense matrix
1515  , bool SF // Symmetry flag
1516  , size_t... CCAs > // Compile time column arguments
1517 BLAZE_ALWAYS_INLINE typename Column<MT,true,true,SF,CCAs...>::SIMDType
1518  Column<MT,true,true,SF,CCAs...>::load( size_t index ) const noexcept
1519 {
1520  return matrix_.load( index, column() );
1521 }
1523 //*************************************************************************************************
1524 
1525 
1526 //*************************************************************************************************
1539 template< typename MT // Type of the dense matrix
1540  , bool SF // Symmetry flag
1541  , size_t... CCAs > // Compile time column arguments
1542 BLAZE_ALWAYS_INLINE typename Column<MT,true,true,SF,CCAs...>::SIMDType
1543  Column<MT,true,true,SF,CCAs...>::loada( size_t index ) const noexcept
1544 {
1545  return matrix_.loada( index, column() );
1546 }
1548 //*************************************************************************************************
1549 
1550 
1551 //*************************************************************************************************
1564 template< typename MT // Type of the dense matrix
1565  , bool SF // Symmetry flag
1566  , size_t... CCAs > // Compile time column arguments
1567 BLAZE_ALWAYS_INLINE typename Column<MT,true,true,SF,CCAs...>::SIMDType
1568  Column<MT,true,true,SF,CCAs...>::loadu( size_t index ) const noexcept
1569 {
1570  return matrix_.loadu( index, column() );
1571 }
1573 //*************************************************************************************************
1574 
1575 
1576 //*************************************************************************************************
1589 template< typename MT // Type of the dense matrix
1590  , bool SF // Symmetry flag
1591  , size_t... CCAs > // Compile time column arguments
1593  Column<MT,true,true,SF,CCAs...>::store( size_t index, const SIMDType& value ) noexcept
1594 {
1595  matrix_.store( index, column(), value );
1596 }
1598 //*************************************************************************************************
1599 
1600 
1601 //*************************************************************************************************
1615 template< typename MT // Type of the dense matrix
1616  , bool SF // Symmetry flag
1617  , size_t... CCAs > // Compile time column arguments
1619  Column<MT,true,true,SF,CCAs...>::storea( size_t index, const SIMDType& value ) noexcept
1620 {
1621  matrix_.storea( index, column(), value );
1622 }
1624 //*************************************************************************************************
1625 
1626 
1627 //*************************************************************************************************
1641 template< typename MT // Type of the dense matrix
1642  , bool SF // Symmetry flag
1643  , size_t... CCAs > // Compile time column arguments
1645  Column<MT,true,true,SF,CCAs...>::storeu( size_t index, const SIMDType& value ) noexcept
1646 {
1647  matrix_.storeu( index, column(), value );
1648 }
1650 //*************************************************************************************************
1651 
1652 
1653 //*************************************************************************************************
1667 template< typename MT // Type of the dense matrix
1668  , bool SF // Symmetry flag
1669  , size_t... CCAs > // Compile time column arguments
1671  Column<MT,true,true,SF,CCAs...>::stream( size_t index, const SIMDType& value ) noexcept
1672 {
1673  matrix_.stream( index, column(), value );
1674 }
1676 //*************************************************************************************************
1677 
1678 
1679 //*************************************************************************************************
1691 template< typename MT // Type of the dense matrix
1692  , bool SF // Symmetry flag
1693  , size_t... CCAs > // Compile time column arguments
1694 template< typename VT > // Type of the right-hand side dense vector
1695 inline auto Column<MT,true,true,SF,CCAs...>::assign( const DenseVector<VT,false>& rhs )
1696  -> DisableIf_t< VectorizedAssign_v<VT> >
1697 {
1698  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1699 
1700  const size_t ipos( (~rhs).size() & size_t(-2) );
1701  for( size_t i=0UL; i<ipos; i+=2UL ) {
1702  matrix_(i ,column()) = (~rhs)[i ];
1703  matrix_(i+1UL,column()) = (~rhs)[i+1UL];
1704  }
1705  if( ipos < (~rhs).size() )
1706  matrix_(ipos,column()) = (~rhs)[ipos];
1707 }
1709 //*************************************************************************************************
1710 
1711 
1712 //*************************************************************************************************
1724 template< typename MT // Type of the dense matrix
1725  , bool SF // Symmetry flag
1726  , size_t... CCAs > // Compile time column arguments
1727 template< typename VT > // Type of the right-hand side dense vector
1728 inline auto Column<MT,true,true,SF,CCAs...>::assign( const DenseVector<VT,false>& rhs )
1729  -> EnableIf_t< VectorizedAssign_v<VT> >
1730 {
1732 
1733  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1734 
1735  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1736 
1737  const size_t rows( size() );
1738 
1739  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
1740  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
1741 
1742  size_t i( 0UL );
1743  Iterator left( begin() );
1744  ConstIterator_t<VT> right( (~rhs).begin() );
1745 
1746  if( useStreaming && rows > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
1747  {
1748  for( ; i<ipos; i+=SIMDSIZE ) {
1749  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1750  }
1751  for( ; remainder && i<rows; ++i ) {
1752  *left = *right; ++left; ++right;
1753  }
1754  }
1755  else
1756  {
1757  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1758  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1759  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1760  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1761  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1762  }
1763  for( ; i<ipos; i+=SIMDSIZE ) {
1764  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1765  }
1766  for( ; remainder && i<rows; ++i ) {
1767  *left = *right; ++left; ++right;
1768  }
1769  }
1770 }
1772 //*************************************************************************************************
1773 
1774 
1775 //*************************************************************************************************
1787 template< typename MT // Type of the dense matrix
1788  , bool SF // Symmetry flag
1789  , size_t... CCAs > // Compile time column arguments
1790 template< typename VT > // Type of the right-hand side sparse vector
1791 inline void Column<MT,true,true,SF,CCAs...>::assign( const SparseVector<VT,false>& rhs )
1792 {
1793  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1794 
1795  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1796  matrix_(element->index(),column()) = element->value();
1797 }
1799 //*************************************************************************************************
1800 
1801 
1802 //*************************************************************************************************
1814 template< typename MT // Type of the dense matrix
1815  , bool SF // Symmetry flag
1816  , size_t... CCAs > // Compile time column arguments
1817 template< typename VT > // Type of the right-hand side dense vector
1818 inline auto Column<MT,true,true,SF,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
1819  -> DisableIf_t< VectorizedAddAssign_v<VT> >
1820 {
1821  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1822 
1823  const size_t ipos( (~rhs).size() & size_t(-2) );
1824  for( size_t i=0UL; i<ipos; i+=2UL ) {
1825  matrix_(i ,column()) += (~rhs)[i ];
1826  matrix_(i+1UL,column()) += (~rhs)[i+1UL];
1827  }
1828  if( ipos < (~rhs).size() )
1829  matrix_(ipos,column()) += (~rhs)[ipos];
1830 }
1832 //*************************************************************************************************
1833 
1834 
1835 //*************************************************************************************************
1847 template< typename MT // Type of the dense matrix
1848  , bool SF // Symmetry flag
1849  , size_t... CCAs > // Compile time column arguments
1850 template< typename VT > // Type of the right-hand side dense vector
1851 inline auto Column<MT,true,true,SF,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
1852  -> EnableIf_t< VectorizedAddAssign_v<VT> >
1853 {
1855 
1856  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1857 
1858  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1859 
1860  const size_t rows( size() );
1861 
1862  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
1863  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
1864 
1865  size_t i( 0UL );
1866  Iterator left( begin() );
1867  ConstIterator_t<VT> right( (~rhs).begin() );
1868 
1869  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1870  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1871  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1872  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1873  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1874  }
1875  for( ; i<ipos; i+=SIMDSIZE ) {
1876  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1877  }
1878  for( ; remainder && i<rows; ++i ) {
1879  *left += *right; ++left; ++right;
1880  }
1881 }
1883 //*************************************************************************************************
1884 
1885 
1886 //*************************************************************************************************
1898 template< typename MT // Type of the dense matrix
1899  , bool SF // Symmetry flag
1900  , size_t... CCAs > // Compile time column arguments
1901 template< typename VT > // Type of the right-hand side sparse vector
1902 inline void Column<MT,true,true,SF,CCAs...>::addAssign( const SparseVector<VT,false>& rhs )
1903 {
1904  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1905 
1906  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1907  matrix_(element->index(),column()) += element->value();
1908 }
1910 //*************************************************************************************************
1911 
1912 
1913 //*************************************************************************************************
1925 template< typename MT // Type of the dense matrix
1926  , bool SF // Symmetry flag
1927  , size_t... CCAs > // Compile time column arguments
1928 template< typename VT > // Type of the right-hand side dense vector
1929 inline auto Column<MT,true,true,SF,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
1930  -> DisableIf_t< VectorizedSubAssign_v<VT> >
1931 {
1932  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1933 
1934  const size_t ipos( (~rhs).size() & size_t(-2) );
1935  for( size_t i=0UL; i<ipos; i+=2UL ) {
1936  matrix_(i ,column()) -= (~rhs)[i ];
1937  matrix_(i+1UL,column()) -= (~rhs)[i+1UL];
1938  }
1939  if( ipos < (~rhs).size() )
1940  matrix_(ipos,column()) -= (~rhs)[ipos];
1941 }
1943 //*************************************************************************************************
1944 
1945 
1946 //*************************************************************************************************
1958 template< typename MT // Type of the dense matrix
1959  , bool SF // Symmetry flag
1960  , size_t... CCAs > // Compile time column arguments
1961 template< typename VT > // Type of the right-hand side dense vector
1962 inline auto Column<MT,true,true,SF,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
1963  -> EnableIf_t< VectorizedSubAssign_v<VT> >
1964 {
1966 
1967  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1968 
1969  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1970 
1971  const size_t rows( size() );
1972 
1973  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
1974  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
1975 
1976  size_t i( 0UL );
1977  Iterator left( begin() );
1978  ConstIterator_t<VT> right( (~rhs).begin() );
1979 
1980  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1981  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1982  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1983  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1984  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1985  }
1986  for( ; i<ipos; i+=SIMDSIZE ) {
1987  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1988  }
1989  for( ; remainder && i<rows; ++i ) {
1990  *left -= *right; ++left; ++right;
1991  }
1992 }
1994 //*************************************************************************************************
1995 
1996 
1997 //*************************************************************************************************
2009 template< typename MT // Type of the dense matrix
2010  , bool SF // Symmetry flag
2011  , size_t... CCAs > // Compile time column arguments
2012 template< typename VT > // Type of the right-hand side sparse vector
2013 inline void Column<MT,true,true,SF,CCAs...>::subAssign( const SparseVector<VT,false>& rhs )
2014 {
2015  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2016 
2017  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2018  matrix_(element->index(),column()) -= element->value();
2019 }
2021 //*************************************************************************************************
2022 
2023 
2024 //*************************************************************************************************
2036 template< typename MT // Type of the dense matrix
2037  , bool SF // Symmetry flag
2038  , size_t... CCAs > // Compile time column arguments
2039 template< typename VT > // Type of the right-hand side dense vector
2040 inline auto Column<MT,true,true,SF,CCAs...>::multAssign( const DenseVector<VT,false>& rhs )
2041  -> DisableIf_t< VectorizedMultAssign_v<VT> >
2042 {
2043  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2044 
2045  const size_t ipos( (~rhs).size() & size_t(-2) );
2046  for( size_t i=0UL; i<ipos; i+=2UL ) {
2047  matrix_(i ,column()) *= (~rhs)[i ];
2048  matrix_(i+1UL,column()) *= (~rhs)[i+1UL];
2049  }
2050  if( ipos < (~rhs).size() )
2051  matrix_(ipos,column()) *= (~rhs)[ipos];
2052 }
2054 //*************************************************************************************************
2055 
2056 
2057 //*************************************************************************************************
2069 template< typename MT // Type of the dense matrix
2070  , bool SF // Symmetry flag
2071  , size_t... CCAs > // Compile time column arguments
2072 template< typename VT > // Type of the right-hand side dense vector
2073 inline auto Column<MT,true,true,SF,CCAs...>::multAssign( const DenseVector<VT,false>& rhs )
2074  -> EnableIf_t< VectorizedMultAssign_v<VT> >
2075 {
2077 
2078  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2079 
2080  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
2081 
2082  const size_t rows( size() );
2083 
2084  const size_t ipos( ( remainder )?( rows & size_t(-SIMDSIZE) ):( rows ) );
2085  BLAZE_INTERNAL_ASSERT( !remainder || ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2086 
2087  size_t i( 0UL );
2088  Iterator left( begin() );
2089  ConstIterator_t<VT> right( (~rhs).begin() );
2090 
2091  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2092  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2093  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2094  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2095  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2096  }
2097  for( ; i<ipos; i+=SIMDSIZE ) {
2098  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2099  }
2100  for( ; remainder && i<rows; ++i ) {
2101  *left *= *right; ++left, ++right;
2102  }
2103 }
2105 //*************************************************************************************************
2106 
2107 
2108 //*************************************************************************************************
2120 template< typename MT // Type of the dense matrix
2121  , bool SF // Symmetry flag
2122  , size_t... CCAs > // Compile time column arguments
2123 template< typename VT > // Type of the right-hand side sparse vector
2124 inline void Column<MT,true,true,SF,CCAs...>::multAssign( const SparseVector<VT,false>& rhs )
2125 {
2126  using blaze::reset;
2127 
2128  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2129 
2130  size_t i( 0UL );
2131 
2132  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
2133  const size_t index( element->index() );
2134  for( ; i<index; ++i )
2135  reset( matrix_(i,column()) );
2136  matrix_(i,column()) *= element->value();
2137  ++i;
2138  }
2139 
2140  for( ; i<size(); ++i ) {
2141  reset( matrix_(i,column()) );
2142  }
2143 }
2145 //*************************************************************************************************
2146 
2147 
2148 //*************************************************************************************************
2160 template< typename MT // Type of the dense matrix
2161  , bool SF // Symmetry flag
2162  , size_t... CCAs > // Compile time column arguments
2163 template< typename VT > // Type of the right-hand side dense vector
2164 inline auto Column<MT,true,true,SF,CCAs...>::divAssign( const DenseVector<VT,false>& rhs )
2165  -> DisableIf_t< VectorizedDivAssign_v<VT> >
2166 {
2167  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2168 
2169  const size_t ipos( (~rhs).size() & size_t(-2) );
2170  for( size_t i=0UL; i<ipos; i+=2UL ) {
2171  matrix_(i ,column()) /= (~rhs)[i ];
2172  matrix_(i+1UL,column()) /= (~rhs)[i+1UL];
2173  }
2174  if( ipos < (~rhs).size() )
2175  matrix_(ipos,column()) /= (~rhs)[ipos];
2176 }
2178 //*************************************************************************************************
2179 
2180 
2181 //*************************************************************************************************
2193 template< typename MT // Type of the dense matrix
2194  , bool SF // Symmetry flag
2195  , size_t... CCAs > // Compile time column arguments
2196 template< typename VT > // Type of the right-hand side dense vector
2197 inline auto Column<MT,true,true,SF,CCAs...>::divAssign( const DenseVector<VT,false>& rhs )
2198  -> EnableIf_t< VectorizedDivAssign_v<VT> >
2199 {
2201 
2202  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2203 
2204  const size_t rows( size() );
2205 
2206  const size_t ipos( rows & size_t(-SIMDSIZE) );
2207  BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (SIMDSIZE) ) ) == ipos, "Invalid end calculation" );
2208 
2209  size_t i( 0UL );
2210  Iterator left( begin() );
2211  ConstIterator_t<VT> right( (~rhs).begin() );
2212 
2213  for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2214  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2215  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2216  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2217  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2218  }
2219  for( ; i<ipos; i+=SIMDSIZE ) {
2220  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2221  }
2222  for( ; i<rows; ++i ) {
2223  *left /= *right; ++left; ++right;
2224  }
2225 }
2227 //*************************************************************************************************
2228 
2229 
2230 
2231 
2232 
2233 
2234 
2235 
2236 //=================================================================================================
2237 //
2238 // CLASS TEMPLATE SPECIALIZATION FOR GENERAL ROW-MAJOR DENSE MATRICES
2239 //
2240 //=================================================================================================
2241 
2242 //*************************************************************************************************
2250 template< typename MT // Type of the dense matrix
2251  , size_t... CCAs > // Compile time column arguments
2252 class Column<MT,false,true,false,CCAs...>
2253  : public View< DenseVector< Column<MT,false,true,false,CCAs...>, false > >
2254  , private ColumnData<CCAs...>
2255 {
2256  private:
2257  //**Type definitions****************************************************************************
2258  using DataType = ColumnData<CCAs...>;
2259  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
2260  //**********************************************************************************************
2261 
2262  public:
2263  //**Type definitions****************************************************************************
2265  using This = Column<MT,false,true,false,CCAs...>;
2266 
2267  using BaseType = DenseVector<This,false>;
2268  using ViewedType = MT;
2269  using ResultType = ColumnTrait_t<MT,CCAs...>;
2270  using TransposeType = TransposeType_t<ResultType>;
2271  using ElementType = ElementType_t<MT>;
2272  using ReturnType = ReturnType_t<MT>;
2273  using CompositeType = const Column&;
2274 
2276  using ConstReference = ConstReference_t<MT>;
2277 
2279  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
2280 
2282  using ConstPointer = ConstPointer_t<MT>;
2283 
2285  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
2286  //**********************************************************************************************
2287 
2288  //**ColumnIterator class definition*************************************************************
2291  template< typename MatrixType // Type of the dense matrix
2292  , typename IteratorType > // Type of the dense matrix iterator
2293  class ColumnIterator
2294  {
2295  public:
2296  //**Type definitions*************************************************************************
2298  using IteratorCategory = typename std::iterator_traits<IteratorType>::iterator_category;
2299 
2301  using ValueType = typename std::iterator_traits<IteratorType>::value_type;
2302 
2304  using PointerType = typename std::iterator_traits<IteratorType>::pointer;
2305 
2307  using ReferenceType = typename std::iterator_traits<IteratorType>::reference;
2308 
2310  using DifferenceType = typename std::iterator_traits<IteratorType>::difference_type;
2311 
2312  // STL iterator requirements
2313  using iterator_category = IteratorCategory;
2314  using value_type = ValueType;
2315  using pointer = PointerType;
2316  using reference = ReferenceType;
2317  using difference_type = DifferenceType;
2318  //*******************************************************************************************
2319 
2320  //**Constructor******************************************************************************
2323  inline ColumnIterator() noexcept
2324  : matrix_( nullptr ) // The dense matrix containing the column
2325  , row_ ( 0UL ) // The current row index
2326  , column_( 0UL ) // The current column index
2327  , pos_ ( ) // Iterator to the current dense element
2328  {}
2329  //*******************************************************************************************
2330 
2331  //**Constructor******************************************************************************
2338  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column ) noexcept
2339  : matrix_( &matrix ) // The dense matrix containing the column
2340  , row_ ( row ) // The current row index
2341  , column_( column ) // The current column index
2342  , pos_ ( ) // Iterator to the current dense element
2343  {
2344  if( row_ != matrix_->rows() )
2345  pos_ = matrix_->begin( row_ ) + column_;
2346  }
2347  //*******************************************************************************************
2348 
2349  //**Constructor******************************************************************************
2354  template< typename MatrixType2, typename IteratorType2 >
2355  inline ColumnIterator( const ColumnIterator<MatrixType2,IteratorType2>& it ) noexcept
2356  : matrix_( it.matrix_ ) // The dense matrix containing the column
2357  , row_ ( it.row_ ) // The current row index
2358  , column_( it.column_ ) // The current column index
2359  , pos_ ( it.pos_ ) // Iterator to the current dense element
2360  {}
2361  //*******************************************************************************************
2362 
2363  //**Addition assignment operator*************************************************************
2369  inline ColumnIterator& operator+=( size_t inc ) noexcept {
2370  using blaze::reset;
2371  row_ += inc;
2372  if( row_ != matrix_->rows() )
2373  pos_ = matrix_->begin( row_ ) + column_;
2374  else reset( pos_ );
2375  return *this;
2376  }
2377  //*******************************************************************************************
2378 
2379  //**Subtraction assignment operator**********************************************************
2385  inline ColumnIterator& operator-=( size_t dec ) noexcept {
2386  using blaze::reset;
2387  row_ -= dec;
2388  if( row_ != matrix_->rows() )
2389  pos_ = matrix_->begin( row_ ) + column_;
2390  else reset( pos_ );
2391  return *this;
2392  }
2393  //*******************************************************************************************
2394 
2395  //**Prefix increment operator****************************************************************
2400  inline ColumnIterator& operator++() noexcept {
2401  using blaze::reset;
2402  ++row_;
2403  if( row_ != matrix_->rows() )
2404  pos_ = matrix_->begin( row_ ) + column_;
2405  else reset( pos_ );
2406  return *this;
2407  }
2408  //*******************************************************************************************
2409 
2410  //**Postfix increment operator***************************************************************
2415  inline const ColumnIterator operator++( int ) noexcept {
2416  const ColumnIterator tmp( *this );
2417  ++(*this);
2418  return tmp;
2419  }
2420  //*******************************************************************************************
2421 
2422  //**Prefix decrement operator****************************************************************
2427  inline ColumnIterator& operator--() noexcept {
2428  using blaze::reset;
2429  --row_;
2430  if( row_ != matrix_->rows() )
2431  pos_ = matrix_->begin( row_ ) + column_;
2432  else reset( pos_ );
2433  return *this;
2434  }
2435  //*******************************************************************************************
2436 
2437  //**Postfix decrement operator***************************************************************
2442  inline const ColumnIterator operator--( int ) noexcept {
2443  const ColumnIterator tmp( *this );
2444  --(*this);
2445  return tmp;
2446  }
2447  //*******************************************************************************************
2448 
2449  //**Subscript operator***********************************************************************
2455  inline ReferenceType operator[]( size_t index ) const {
2456  BLAZE_USER_ASSERT( row_+index < matrix_->rows(), "Invalid access index detected" );
2457  const IteratorType pos( matrix_->begin( row_+index ) + column_ );
2458  return *pos;
2459  }
2460  //*******************************************************************************************
2461 
2462  //**Element access operator******************************************************************
2467  inline ReferenceType operator*() const {
2468  return *pos_;
2469  }
2470  //*******************************************************************************************
2471 
2472  //**Element access operator******************************************************************
2477  inline PointerType operator->() const {
2478  return pos_;
2479  }
2480  //*******************************************************************************************
2481 
2482  //**Equality operator************************************************************************
2488  template< typename MatrixType2, typename IteratorType2 >
2489  inline bool operator==( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2490  return row_ == rhs.row_;
2491  }
2492  //*******************************************************************************************
2493 
2494  //**Inequality operator**********************************************************************
2500  template< typename MatrixType2, typename IteratorType2 >
2501  inline bool operator!=( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2502  return !( *this == rhs );
2503  }
2504  //*******************************************************************************************
2505 
2506  //**Less-than operator***********************************************************************
2512  template< typename MatrixType2, typename IteratorType2 >
2513  inline bool operator<( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2514  return row_ < rhs.row_;
2515  }
2516  //*******************************************************************************************
2517 
2518  //**Greater-than operator********************************************************************
2524  template< typename MatrixType2, typename IteratorType2 >
2525  inline bool operator>( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2526  return row_ > rhs.row_;
2527  }
2528  //*******************************************************************************************
2529 
2530  //**Less-or-equal-than operator**************************************************************
2536  template< typename MatrixType2, typename IteratorType2 >
2537  inline bool operator<=( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2538  return row_ <= rhs.row_;
2539  }
2540  //*******************************************************************************************
2541 
2542  //**Greater-or-equal-than operator***********************************************************
2548  template< typename MatrixType2, typename IteratorType2 >
2549  inline bool operator>=( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const noexcept {
2550  return row_ >= rhs.row_;
2551  }
2552  //*******************************************************************************************
2553 
2554  //**Subtraction operator*********************************************************************
2560  inline DifferenceType operator-( const ColumnIterator& rhs ) const noexcept {
2561  return row_ - rhs.row_;
2562  }
2563  //*******************************************************************************************
2564 
2565  //**Addition operator************************************************************************
2572  friend inline const ColumnIterator operator+( const ColumnIterator& it, size_t inc ) noexcept {
2573  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2574  }
2575  //*******************************************************************************************
2576 
2577  //**Addition operator************************************************************************
2584  friend inline const ColumnIterator operator+( size_t inc, const ColumnIterator& it ) noexcept {
2585  return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2586  }
2587  //*******************************************************************************************
2588 
2589  //**Subtraction operator*********************************************************************
2596  friend inline const ColumnIterator operator-( const ColumnIterator& it, size_t dec ) noexcept {
2597  return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
2598  }
2599  //*******************************************************************************************
2600 
2601  private:
2602  //**Member variables*************************************************************************
2603  MatrixType* matrix_;
2604  size_t row_;
2605  size_t column_;
2606  IteratorType pos_;
2607  //*******************************************************************************************
2608 
2609  //**Friend declarations**********************************************************************
2610  template< typename MatrixType2, typename IteratorType2 > friend class ColumnIterator;
2611  //*******************************************************************************************
2612  };
2613  //**********************************************************************************************
2614 
2615  //**Type definitions****************************************************************************
2617  using ConstIterator = ColumnIterator< const MT, ConstIterator_t<MT> >;
2618 
2620  using Iterator = If_t< IsConst_v<MT>, ConstIterator, ColumnIterator< MT, Iterator_t<MT> > >;
2621  //**********************************************************************************************
2622 
2623  //**Compilation flags***************************************************************************
2625  static constexpr bool simdEnabled = false;
2626 
2628  static constexpr bool smpAssignable = MT::smpAssignable;
2629  //**********************************************************************************************
2630 
2631  //**Constructors********************************************************************************
2634  template< typename... RCAs >
2635  explicit inline Column( MT& matrix, RCAs... args );
2636 
2637  Column( const Column& ) = default;
2639  //**********************************************************************************************
2640 
2641  //**Destructor**********************************************************************************
2644  ~Column() = default;
2646  //**********************************************************************************************
2647 
2648  //**Data access functions***********************************************************************
2651  inline Reference operator[]( size_t index );
2652  inline ConstReference operator[]( size_t index ) const;
2653  inline Reference at( size_t index );
2654  inline ConstReference at( size_t index ) const;
2655  inline Pointer data () noexcept;
2656  inline ConstPointer data () const noexcept;
2657  inline Iterator begin ();
2658  inline ConstIterator begin () const;
2659  inline ConstIterator cbegin() const;
2660  inline Iterator end ();
2661  inline ConstIterator end () const;
2662  inline ConstIterator cend () const;
2664  //**********************************************************************************************
2665 
2666  //**Assignment operators************************************************************************
2669  inline Column& operator=( const ElementType& rhs );
2670  inline Column& operator=( initializer_list<ElementType> list );
2671  inline Column& operator=( const Column& rhs );
2672 
2673  template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
2674  template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
2675  template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
2676  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
2677  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
2678  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
2680  //**********************************************************************************************
2681 
2682  //**Utility functions***************************************************************************
2685  using DataType::column;
2686 
2687  inline MT& operand() noexcept;
2688  inline const MT& operand() const noexcept;
2689 
2690  inline size_t size() const noexcept;
2691  inline size_t spacing() const noexcept;
2692  inline size_t capacity() const noexcept;
2693  inline size_t nonZeros() const;
2694  inline void reset();
2696  //**********************************************************************************************
2697 
2698  //**Numeric functions***************************************************************************
2701  template< typename Other > inline Column& scale( const Other& scalar );
2703  //**********************************************************************************************
2704 
2705  //**Expression template evaluation functions****************************************************
2708  template< typename Other >
2709  inline bool canAlias ( const Other* alias ) const noexcept;
2710 
2711  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
2712  inline bool canAlias ( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
2713 
2714  template< typename Other >
2715  inline bool isAliased( const Other* alias ) const noexcept;
2716 
2717  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
2718  inline bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
2719 
2720  inline bool isAligned () const noexcept;
2721  inline bool canSMPAssign() const noexcept;
2722 
2723  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
2724  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
2725  template< typename VT > inline void addAssign ( const DenseVector <VT,false>& rhs );
2726  template< typename VT > inline void addAssign ( const SparseVector<VT,false>& rhs );
2727  template< typename VT > inline void subAssign ( const DenseVector <VT,false>& rhs );
2728  template< typename VT > inline void subAssign ( const SparseVector<VT,false>& rhs );
2729  template< typename VT > inline void multAssign( const DenseVector <VT,false>& rhs );
2730  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
2731  template< typename VT > inline void divAssign ( const DenseVector <VT,false>& rhs );
2733  //**********************************************************************************************
2734 
2735  private:
2736  //**Member variables****************************************************************************
2739  Operand matrix_;
2740 
2741  //**********************************************************************************************
2742 
2743  //**Friend declarations*************************************************************************
2744  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CCAs2 > friend class Column;
2745  //**********************************************************************************************
2746 
2747  //**Compile time checks*************************************************************************
2756  //**********************************************************************************************
2757 };
2759 //*************************************************************************************************
2760 
2761 
2762 
2763 
2764 //=================================================================================================
2765 //
2766 // CONSTRUCTORS
2767 //
2768 //=================================================================================================
2769 
2770 //*************************************************************************************************
2783 template< typename MT // Type of the dense matrix
2784  , size_t... CCAs > // Compile time column arguments
2785 template< typename... RCAs > // Runtime column arguments
2786 inline Column<MT,false,true,false,CCAs...>::Column( MT& matrix, RCAs... args )
2787  : DataType( args... ) // Base class initialization
2788  , matrix_ ( matrix ) // The matrix containing the column
2789 {
2790  if( !Contains_v< TypeList<RCAs...>, Unchecked > ) {
2791  if( matrix_.columns() <= column() ) {
2792  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
2793  }
2794  }
2795  else {
2796  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
2797  }
2798 }
2800 //*************************************************************************************************
2801 
2802 
2803 
2804 
2805 //=================================================================================================
2806 //
2807 // DATA ACCESS FUNCTIONS
2808 //
2809 //=================================================================================================
2810 
2811 //*************************************************************************************************
2821 template< typename MT // Type of the dense matrix
2822  , size_t... CCAs > // Compile time column arguments
2823 inline typename Column<MT,false,true,false,CCAs...>::Reference
2824  Column<MT,false,true,false,CCAs...>::operator[]( size_t index )
2825 {
2826  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2827  return matrix_(index,column());
2828 }
2830 //*************************************************************************************************
2831 
2832 
2833 //*************************************************************************************************
2843 template< typename MT // Type of the dense matrix
2844  , size_t... CCAs > // Compile time column arguments
2845 inline typename Column<MT,false,true,false,CCAs...>::ConstReference
2846  Column<MT,false,true,false,CCAs...>::operator[]( size_t index ) const
2847 {
2848  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2849  return const_cast<const MT&>( matrix_ )(index,column());
2850 }
2852 //*************************************************************************************************
2853 
2854 
2855 //*************************************************************************************************
2866 template< typename MT // Type of the dense matrix
2867  , size_t... CCAs > // Compile time column arguments
2868 inline typename Column<MT,false,true,false,CCAs...>::Reference
2869  Column<MT,false,true,false,CCAs...>::at( size_t index )
2870 {
2871  if( index >= size() ) {
2872  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
2873  }
2874  return (*this)[index];
2875 }
2877 //*************************************************************************************************
2878 
2879 
2880 //*************************************************************************************************
2891 template< typename MT // Type of the dense matrix
2892  , size_t... CCAs > // Compile time column arguments
2893 inline typename Column<MT,false,true,false,CCAs...>::ConstReference
2894  Column<MT,false,true,false,CCAs...>::at( size_t index ) const
2895 {
2896  if( index >= size() ) {
2897  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
2898  }
2899  return (*this)[index];
2900 }
2902 //*************************************************************************************************
2903 
2904 
2905 //*************************************************************************************************
2914 template< typename MT // Type of the dense matrix
2915  , size_t... CCAs > // Compile time column arguments
2916 inline typename Column<MT,false,true,false,CCAs...>::Pointer
2918 {
2919  return matrix_.data() + column();
2920 }
2922 //*************************************************************************************************
2923 
2924 
2925 //*************************************************************************************************
2934 template< typename MT // Type of the dense matrix
2935  , size_t... CCAs > // Compile time column arguments
2936 inline typename Column<MT,false,true,false,CCAs...>::ConstPointer
2938 {
2939  return matrix_.data() + column();
2940 }
2942 //*************************************************************************************************
2943 
2944 
2945 //*************************************************************************************************
2953 template< typename MT // Type of the dense matrix
2954  , size_t... CCAs > // Compile time column arguments
2955 inline typename Column<MT,false,true,false,CCAs...>::Iterator
2957 {
2958  return Iterator( matrix_, 0UL, column() );
2959 }
2961 //*************************************************************************************************
2962 
2963 
2964 //*************************************************************************************************
2972 template< typename MT // Type of the dense matrix
2973  , size_t... CCAs > // Compile time column arguments
2974 inline typename Column<MT,false,true,false,CCAs...>::ConstIterator
2976 {
2977  return ConstIterator( matrix_, 0UL, column() );
2978 }
2980 //*************************************************************************************************
2981 
2982 
2983 //*************************************************************************************************
2991 template< typename MT // Type of the dense matrix
2992  , size_t... CCAs > // Compile time column arguments
2993 inline typename Column<MT,false,true,false,CCAs...>::ConstIterator
2995 {
2996  return ConstIterator( matrix_, 0UL, column() );
2997 }
2999 //*************************************************************************************************
3000 
3001 
3002 //*************************************************************************************************
3010 template< typename MT // Type of the dense matrix
3011  , size_t... CCAs > // Compile time column arguments
3012 inline typename Column<MT,false,true,false,CCAs...>::Iterator
3014 {
3015  return Iterator( matrix_, size(), column() );
3016 }
3018 //*************************************************************************************************
3019 
3020 
3021 //*************************************************************************************************
3029 template< typename MT // Type of the dense matrix
3030  , size_t... CCAs > // Compile time column arguments
3031 inline typename Column<MT,false,true,false,CCAs...>::ConstIterator
3033 {
3034  return ConstIterator( matrix_, size(), column() );
3035 }
3037 //*************************************************************************************************
3038 
3039 
3040 //*************************************************************************************************
3048 template< typename MT // Type of the dense matrix
3049  , size_t... CCAs > // Compile time column arguments
3050 inline typename Column<MT,false,true,false,CCAs...>::ConstIterator
3052 {
3053  return ConstIterator( matrix_, size(), column() );
3054 }
3056 //*************************************************************************************************
3057 
3058 
3059 
3060 
3061 //=================================================================================================
3062 //
3063 // ASSIGNMENT OPERATORS
3064 //
3065 //=================================================================================================
3066 
3067 //*************************************************************************************************
3078 template< typename MT // Type of the dense matrix
3079  , size_t... CCAs > // Compile time column arguments
3080 inline Column<MT,false,true,false,CCAs...>&
3081  Column<MT,false,true,false,CCAs...>::operator=( const ElementType& rhs )
3082 {
3083  decltype(auto) left( derestrict( matrix_ ) );
3084 
3085  const size_t ibegin( ( IsLower_v<MT> )
3086  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3087  ?( column()+1UL )
3088  :( column() ) )
3089  :( 0UL ) );
3090  const size_t iend ( ( IsUpper_v<MT> )
3091  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3092  ?( column() )
3093  :( column()+1UL ) )
3094  :( size() ) );
3095 
3096  for( size_t i=ibegin; i<iend; ++i ) {
3097  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, i, column(), rhs ) )
3098  left(i,column()) = rhs;
3099  }
3100 
3101  return *this;
3102 }
3104 //*************************************************************************************************
3105 
3106 
3107 //*************************************************************************************************
3122 template< typename MT // Type of the dense matrix
3123  , size_t... CCAs > // Compile time column arguments
3124 inline Column<MT,false,true,false,CCAs...>&
3125  Column<MT,false,true,false,CCAs...>::operator=( initializer_list<ElementType> list )
3126 {
3127  if( list.size() > size() ) {
3128  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
3129  }
3130 
3131  if( IsRestricted_v<MT> ) {
3132  const InitializerVector<ElementType,false> tmp( list, size() );
3133  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3134  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3135  }
3136  }
3137 
3138  decltype(auto) left( derestrict( *this ) );
3139 
3140  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
3141 
3142  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3143 
3144  return *this;
3145 }
3147 //*************************************************************************************************
3148 
3149 
3150 //*************************************************************************************************
3164 template< typename MT // Type of the dense matrix
3165  , size_t... CCAs > // Compile time column arguments
3166 inline Column<MT,false,true,false,CCAs...>&
3167  Column<MT,false,true,false,CCAs...>::operator=( const Column& rhs )
3168 {
3169  if( &rhs == this ) return *this;
3170 
3171  if( size() != rhs.size() ) {
3172  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
3173  }
3174 
3175  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
3176  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3177  }
3178 
3179  decltype(auto) left( derestrict( *this ) );
3180 
3181  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
3182  const ResultType tmp( rhs );
3183  smpAssign( left, tmp );
3184  }
3185  else {
3186  smpAssign( left, rhs );
3187  }
3188 
3189  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3190 
3191  return *this;
3192 }
3194 //*************************************************************************************************
3195 
3196 
3197 //*************************************************************************************************
3211 template< typename MT // Type of the dense matrix
3212  , size_t... CCAs > // Compile time column arguments
3213 template< typename VT > // Type of the right-hand side vector
3214 inline Column<MT,false,true,false,CCAs...>&
3215  Column<MT,false,true,false,CCAs...>::operator=( const Vector<VT,false>& rhs )
3216 {
3220 
3221  if( size() != (~rhs).size() ) {
3222  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3223  }
3224 
3225  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3226  Right right( ~rhs );
3227 
3228  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
3229  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3230  }
3231 
3232  decltype(auto) left( derestrict( *this ) );
3233 
3234  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3235  const ResultType tmp( right );
3236  smpAssign( left, tmp );
3237  }
3238  else {
3239  if( IsSparseVector_v<VT> )
3240  reset();
3241  smpAssign( left, right );
3242  }
3243 
3244  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3245 
3246  return *this;
3247 }
3249 //*************************************************************************************************
3250 
3251 
3252 //*************************************************************************************************
3266 template< typename MT // Type of the dense matrix
3267  , size_t... CCAs > // Compile time column arguments
3268 template< typename VT > // Type of the right-hand side vector
3269 inline Column<MT,false,true,false,CCAs...>&
3270  Column<MT,false,true,false,CCAs...>::operator+=( const Vector<VT,false>& rhs )
3271 {
3272  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
3274 
3275  if( size() != (~rhs).size() ) {
3276  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3277  }
3278 
3279  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3280  Right right( ~rhs );
3281 
3282  if( !tryAddAssign( matrix_, right, 0UL, column() ) ) {
3283  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3284  }
3285 
3286  decltype(auto) left( derestrict( *this ) );
3287 
3288  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3289  const ResultType_t<VT> tmp( right );
3290  smpAddAssign( left, tmp );
3291  }
3292  else {
3293  smpAddAssign( left, right );
3294  }
3295 
3296  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3297 
3298  return *this;
3299 }
3301 //*************************************************************************************************
3302 
3303 
3304 //*************************************************************************************************
3318 template< typename MT // Type of the dense matrix
3319  , size_t... CCAs > // Compile time column arguments
3320 template< typename VT > // Type of the right-hand side vector
3321 inline Column<MT,false,true,false,CCAs...>&
3322  Column<MT,false,true,false,CCAs...>::operator-=( const Vector<VT,false>& rhs )
3323 {
3324  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
3326 
3327  if( size() != (~rhs).size() ) {
3328  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3329  }
3330 
3331  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3332  Right right( ~rhs );
3333 
3334  if( !trySubAssign( matrix_, right, 0UL, column() ) ) {
3335  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3336  }
3337 
3338  decltype(auto) left( derestrict( *this ) );
3339 
3340  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3341  const ResultType_t<VT> tmp( right );
3342  smpSubAssign( left, tmp );
3343  }
3344  else {
3345  smpSubAssign( left, right );
3346  }
3347 
3348  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3349 
3350  return *this;
3351 }
3353 //*************************************************************************************************
3354 
3355 
3356 //*************************************************************************************************
3369 template< typename MT // Type of the dense matrix
3370  , size_t... CCAs > // Compile time column arguments
3371 template< typename VT > // Type of the right-hand side vector
3372 inline Column<MT,false,true,false,CCAs...>&
3373  Column<MT,false,true,false,CCAs...>::operator*=( const Vector<VT,false>& rhs )
3374 {
3375  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
3377 
3378  if( size() != (~rhs).size() ) {
3379  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3380  }
3381 
3382  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3383  Right right( ~rhs );
3384 
3385  if( !tryMultAssign( matrix_, right, 0UL, column() ) ) {
3386  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3387  }
3388 
3389  decltype(auto) left( derestrict( *this ) );
3390 
3391  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3392  const ResultType_t<VT> tmp( right );
3393  smpMultAssign( left, tmp );
3394  }
3395  else {
3396  smpMultAssign( left, right );
3397  }
3398 
3399  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3400 
3401  return *this;
3402 }
3404 //*************************************************************************************************
3405 
3406 
3407 //*************************************************************************************************
3419 template< typename MT // Type of the dense matrix
3420  , size_t... CCAs > // Compile time column arguments
3421 template< typename VT > // Type of the right-hand side dense vector
3422 inline Column<MT,false,true,false,CCAs...>&
3423  Column<MT,false,true,false,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
3424 {
3425  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
3427 
3428  if( size() != (~rhs).size() ) {
3429  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3430  }
3431 
3432  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
3433  Right right( ~rhs );
3434 
3435  if( !tryDivAssign( matrix_, right, 0UL, column() ) ) {
3436  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3437  }
3438 
3439  decltype(auto) left( derestrict( *this ) );
3440 
3441  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
3442  const ResultType_t<VT> tmp( right );
3443  smpDivAssign( left, tmp );
3444  }
3445  else {
3446  smpDivAssign( left, right );
3447  }
3448 
3449  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3450 
3451  return *this;
3452 }
3454 //*************************************************************************************************
3455 
3456 
3457 //*************************************************************************************************
3470 template< typename MT // Type of the dense matrix
3471  , size_t... CCAs > // Compile time column arguments
3472 template< typename VT > // Type of the right-hand side vector
3473 inline Column<MT,false,true,false,CCAs...>&
3474  Column<MT,false,true,false,CCAs...>::operator%=( const Vector<VT,false>& rhs )
3475 {
3476  using blaze::assign;
3477 
3478  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
3480 
3481  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
3482 
3486 
3487  if( size() != 3UL || (~rhs).size() != 3UL ) {
3488  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
3489  }
3490 
3491  const CrossType right( *this % (~rhs) );
3492 
3493  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
3494  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3495  }
3496 
3497  decltype(auto) left( derestrict( *this ) );
3498 
3499  assign( left, right );
3500 
3501  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3502 
3503  return *this;
3504 }
3506 //*************************************************************************************************
3507 
3508 
3509 
3510 
3511 //=================================================================================================
3512 //
3513 // UTILITY FUNCTIONS
3514 //
3515 //=================================================================================================
3516 
3517 //*************************************************************************************************
3523 template< typename MT // Type of the dense matrix
3524  , size_t... CCAs > // Compile time column arguments
3525 inline MT& Column<MT,false,true,false,CCAs...>::operand() noexcept
3526 {
3527  return matrix_;
3528 }
3530 //*************************************************************************************************
3531 
3532 
3533 //*************************************************************************************************
3539 template< typename MT // Type of the dense matrix
3540  , size_t... CCAs > // Compile time column arguments
3541 inline const MT& Column<MT,false,true,false,CCAs...>::operand() const noexcept
3542 {
3543  return matrix_;
3544 }
3546 //*************************************************************************************************
3547 
3548 
3549 //*************************************************************************************************
3555 template< typename MT // Type of the dense matrix
3556  , size_t... CCAs > // Compile time column arguments
3557 inline size_t Column<MT,false,true,false,CCAs...>::size() const noexcept
3558 {
3559  return matrix_.rows();
3560 }
3562 //*************************************************************************************************
3563 
3564 
3565 //*************************************************************************************************
3574 template< typename MT // Type of the dense matrix
3575  , size_t... CCAs > // Compile time column arguments
3576 inline size_t Column<MT,false,true,false,CCAs...>::spacing() const noexcept
3577 {
3578  return matrix_.spacing();
3579 }
3581 //*************************************************************************************************
3582 
3583 
3584 //*************************************************************************************************
3590 template< typename MT // Type of the dense matrix
3591  , size_t... CCAs > // Compile time column arguments
3592 inline size_t Column<MT,false,true,false,CCAs...>::capacity() const noexcept
3593 {
3594  return matrix_.rows();
3595 }
3597 //*************************************************************************************************
3598 
3599 
3600 //*************************************************************************************************
3609 template< typename MT // Type of the dense matrix
3610  , size_t... CCAs > // Compile time column arguments
3612 {
3613  const size_t rows( size() );
3614  size_t nonzeros( 0UL );
3615 
3616  for( size_t i=0UL; i<rows; ++i )
3617  if( !isDefault( matrix_(i,column()) ) )
3618  ++nonzeros;
3619 
3620  return nonzeros;
3621 }
3623 //*************************************************************************************************
3624 
3625 
3626 //*************************************************************************************************
3632 template< typename MT // Type of the dense matrix
3633  , size_t... CCAs > // Compile time column arguments
3635 {
3636  using blaze::clear;
3637 
3638  const size_t ibegin( ( IsLower_v<MT> )
3639  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3640  ?( column()+1UL )
3641  :( column() ) )
3642  :( 0UL ) );
3643  const size_t iend ( ( IsUpper_v<MT> )
3644  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3645  ?( column() )
3646  :( column()+1UL ) )
3647  :( size() ) );
3648 
3649  for( size_t i=ibegin; i<iend; ++i )
3650  clear( matrix_(i,column()) );
3651 }
3653 //*************************************************************************************************
3654 
3655 
3656 
3657 
3658 //=================================================================================================
3659 //
3660 // NUMERIC FUNCTIONS
3661 //
3662 //=================================================================================================
3663 
3664 //*************************************************************************************************
3677 template< typename MT // Type of the dense matrix
3678  , size_t... CCAs > // Compile time column arguments
3679 template< typename Other > // Data type of the scalar value
3680 inline Column<MT,false,true,false,CCAs...>&
3681  Column<MT,false,true,false,CCAs...>::scale( const Other& scalar )
3682 {
3684 
3685  const size_t ibegin( ( IsLower_v<MT> )
3686  ?( ( IsStrictlyLower_v<MT> )
3687  ?( column()+1UL )
3688  :( column() ) )
3689  :( 0UL ) );
3690  const size_t iend ( ( IsUpper_v<MT> )
3691  ?( ( IsStrictlyUpper_v<MT> )
3692  ?( column() )
3693  :( column()+1UL ) )
3694  :( size() ) );
3695 
3696  for( size_t i=ibegin; i<iend; ++i ) {
3697  matrix_(i,column()) *= scalar;
3698  }
3699 
3700  return *this;
3701 }
3703 //*************************************************************************************************
3704 
3705 
3706 
3707 
3708 //=================================================================================================
3709 //
3710 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
3711 //
3712 //=================================================================================================
3713 
3714 //*************************************************************************************************
3725 template< typename MT // Type of the dense matrix
3726  , size_t... CCAs > // Compile time column arguments
3727 template< typename Other > // Data type of the foreign expression
3728 inline bool Column<MT,false,true,false,CCAs...>::canAlias( const Other* alias ) const noexcept
3729 {
3730  return matrix_.isAliased( alias );
3731 }
3733 //*************************************************************************************************
3734 
3735 
3736 //*************************************************************************************************
3747 template< typename MT // Type of the dense matrix
3748  , size_t... CCAs > // Compile time column arguments
3749 template< typename MT2 // Data type of the foreign dense column
3750  , bool SO2 // Storage order of the foreign dense column
3751  , bool SF2 // Symmetry flag of the foreign dense column
3752  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
3753 inline bool
3754  Column<MT,false,true,false,CCAs...>::canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
3755 {
3756  return matrix_.isAliased( &alias->matrix_ ) && ( column() == alias->column() );
3757 }
3759 //*************************************************************************************************
3760 
3761 
3762 //*************************************************************************************************
3773 template< typename MT // Type of the dense matrix
3774  , size_t... CCAs > // Compile time column arguments
3775 template< typename Other > // Data type of the foreign expression
3776 inline bool Column<MT,false,true,false,CCAs...>::isAliased( const Other* alias ) const noexcept
3777 {
3778  return matrix_.isAliased( alias );
3779 }
3781 //*************************************************************************************************
3782 
3783 
3784 //*************************************************************************************************
3795 template< typename MT // Type of the dense matrix
3796  , size_t... CCAs > // Compile time column arguments
3797 template< typename MT2 // Data type of the foreign dense column
3798  , bool SO2 // Storage order of the foreign dense column
3799  , bool SF2 // Symmetry flag of the foreign dense column
3800  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
3801 inline bool
3802  Column<MT,false,true,false,CCAs...>::isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
3803 {
3804  return matrix_.isAliased( &alias->matrix_ ) && ( column() == alias->column() );
3805 }
3807 //*************************************************************************************************
3808 
3809 
3810 //*************************************************************************************************
3820 template< typename MT // Type of the dense matrix
3821  , size_t... CCAs > // Compile time column arguments
3822 inline bool Column<MT,false,true,false,CCAs...>::isAligned() const noexcept
3823 {
3824  return false;
3825 }
3827 //*************************************************************************************************
3828 
3829 
3830 //*************************************************************************************************
3841 template< typename MT // Type of the dense matrix
3842  , size_t... CCAs > // Compile time column arguments
3843 inline bool Column<MT,false,true,false,CCAs...>::canSMPAssign() const noexcept
3844 {
3845  return ( size() > SMP_DVECASSIGN_THRESHOLD );
3846 }
3848 //*************************************************************************************************
3849 
3850 
3851 //*************************************************************************************************
3863 template< typename MT // Type of the dense matrix
3864  , size_t... CCAs > // Compile time column arguments
3865 template< typename VT > // Type of the right-hand side dense vector
3866 inline void Column<MT,false,true,false,CCAs...>::assign( const DenseVector<VT,false>& rhs )
3867 {
3868  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3869 
3870  const size_t ipos( (~rhs).size() & size_t(-2) );
3871  for( size_t i=0UL; i<ipos; i+=2UL ) {
3872  matrix_(i ,column()) = (~rhs)[i ];
3873  matrix_(i+1UL,column()) = (~rhs)[i+1UL];
3874  }
3875  if( ipos < (~rhs).size() )
3876  matrix_(ipos,column()) = (~rhs)[ipos];
3877 }
3879 //*************************************************************************************************
3880 
3881 
3882 //*************************************************************************************************
3894 template< typename MT // Type of the dense matrix
3895  , size_t... CCAs > // Compile time column arguments
3896 template< typename VT > // Type of the right-hand side sparse vector
3897 inline void Column<MT,false,true,false,CCAs...>::assign( const SparseVector<VT,false>& rhs )
3898 {
3899  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3900 
3901  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3902  matrix_(element->index(),column()) = element->value();
3903 }
3905 //*************************************************************************************************
3906 
3907 
3908 //*************************************************************************************************
3920 template< typename MT // Type of the dense matrix
3921  , size_t... CCAs > // Compile time column arguments
3922 template< typename VT > // Type of the right-hand side dense vector
3923 inline void Column<MT,false,true,false,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
3924 {
3925  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3926 
3927  const size_t ipos( (~rhs).size() & size_t(-2) );
3928  for( size_t i=0UL; i<ipos; i+=2UL ) {
3929  matrix_(i ,column()) += (~rhs)[i ];
3930  matrix_(i+1UL,column()) += (~rhs)[i+1UL];
3931  }
3932  if( ipos < (~rhs).size() )
3933  matrix_(ipos,column()) += (~rhs)[ipos];
3934 }
3936 //*************************************************************************************************
3937 
3938 
3939 //*************************************************************************************************
3951 template< typename MT // Type of the dense matrix
3952  , size_t... CCAs > // Compile time column arguments
3953 template< typename VT > // Type of the right-hand side sparse vector
3954 inline void Column<MT,false,true,false,CCAs...>::addAssign( const SparseVector<VT,false>& rhs )
3955 {
3956  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3957 
3958  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
3959  matrix_(element->index(),column()) += element->value();
3960 }
3962 //*************************************************************************************************
3963 
3964 
3965 //*************************************************************************************************
3977 template< typename MT // Type of the dense matrix
3978  , size_t... CCAs > // Compile time column arguments
3979 template< typename VT > // Type of the right-hand side dense vector
3980 inline void Column<MT,false,true,false,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
3981 {
3982  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3983 
3984  const size_t ipos( (~rhs).size() & size_t(-2) );
3985  for( size_t i=0UL; i<ipos; i+=2UL ) {
3986  matrix_(i ,column()) -= (~rhs)[i ];
3987  matrix_(i+1UL,column()) -= (~rhs)[i+1UL];
3988  }
3989  if( ipos < (~rhs).size() )
3990  matrix_(ipos,column()) -= (~rhs)[ipos];
3991 }
3993 //*************************************************************************************************
3994 
3995 
3996 //*************************************************************************************************
4008 template< typename MT // Type of the dense matrix
4009  , size_t... CCAs > // Compile time column arguments
4010 template< typename VT > // Type of the right-hand side sparse vector
4011 inline void Column<MT,false,true,false,CCAs...>::subAssign( const SparseVector<VT,false>& rhs )
4012 {
4013  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4014 
4015  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
4016  matrix_(element->index(),column()) -= element->value();
4017 }
4019 //*************************************************************************************************
4020 
4021 
4022 //*************************************************************************************************
4034 template< typename MT // Type of the dense matrix
4035  , size_t... CCAs > // Compile time column arguments
4036 template< typename VT > // Type of the right-hand side dense vector
4037 inline void Column<MT,false,true,false,CCAs...>::multAssign( const DenseVector<VT,false>& rhs )
4038 {
4039  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4040 
4041  const size_t ipos( (~rhs).size() & size_t(-2) );
4042  for( size_t i=0UL; i<ipos; i+=2UL ) {
4043  matrix_(i ,column()) *= (~rhs)[i ];
4044  matrix_(i+1UL,column()) *= (~rhs)[i+1UL];
4045  }
4046  if( ipos < (~rhs).size() )
4047  matrix_(ipos,column()) *= (~rhs)[ipos];
4048 }
4050 //*************************************************************************************************
4051 
4052 
4053 //*************************************************************************************************
4065 template< typename MT // Type of the dense matrix
4066  , size_t... CCAs > // Compile time column arguments
4067 template< typename VT > // Type of the right-hand side sparse vector
4068 inline void Column<MT,false,true,false,CCAs...>::multAssign( const SparseVector<VT,false>& rhs )
4069 {
4070  using blaze::reset;
4071 
4072  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4073 
4074  size_t i( 0UL );
4075 
4076  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
4077  const size_t index( element->index() );
4078  for( ; i<index; ++i )
4079  reset( matrix_(i,column()) );
4080  matrix_(i,column()) *= element->value();
4081  ++i;
4082  }
4083 
4084  for( ; i<size(); ++i ) {
4085  reset( matrix_(i,column()) );
4086  }
4087 }
4089 //*************************************************************************************************
4090 
4091 
4092 //*************************************************************************************************
4104 template< typename MT // Type of the dense matrix
4105  , size_t... CCAs > // Compile time column arguments
4106 template< typename VT > // Type of the right-hand side dense vector
4107 inline void Column<MT,false,true,false,CCAs...>::divAssign( const DenseVector<VT,false>& rhs )
4108 {
4109  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4110 
4111  const size_t ipos( (~rhs).size() & size_t(-2) );
4112  for( size_t i=0UL; i<ipos; i+=2UL ) {
4113  matrix_(i ,column()) /= (~rhs)[i ];
4114  matrix_(i+1UL,column()) /= (~rhs)[i+1UL];
4115  }
4116  if( ipos < (~rhs).size() )
4117  matrix_(ipos,column()) /= (~rhs)[ipos];
4118 }
4120 //*************************************************************************************************
4121 
4122 
4123 
4124 
4125 
4126 
4127 
4128 
4129 //=================================================================================================
4130 //
4131 // CLASS TEMPLATE SPECIALIZATION FOR SYMMETRIC ROW-MAJOR DENSE MATRICES
4132 //
4133 //=================================================================================================
4134 
4135 //*************************************************************************************************
4143 template< typename MT // Type of the dense matrix
4144  , size_t... CCAs > // Compile time column arguments
4145 class Column<MT,false,true,true,CCAs...>
4146  : public View< DenseVector< Column<MT,false,true,true,CCAs...>, false > >
4147  , private ColumnData<CCAs...>
4148 {
4149  private:
4150  //**Type definitions****************************************************************************
4151  using DataType = ColumnData<CCAs...>;
4152  using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
4153  //**********************************************************************************************
4154 
4155  public:
4156  //**Type definitions****************************************************************************
4158  using This = Column<MT,false,true,true,CCAs...>;
4159 
4160  using BaseType = DenseVector<This,false>;
4161  using ViewedType = MT;
4162  using ResultType = ColumnTrait_t<MT,CCAs...>;
4163  using TransposeType = TransposeType_t<ResultType>;
4164  using ElementType = ElementType_t<MT>;
4165  using SIMDType = SIMDTrait_t<ElementType>;
4166  using ReturnType = ReturnType_t<MT>;
4167  using CompositeType = const Column&;
4168 
4170  using ConstReference = ConstReference_t<MT>;
4171 
4173  using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
4174 
4176  using ConstPointer = ConstPointer_t<MT>;
4177 
4179  using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
4180 
4182  using ConstIterator = ConstIterator_t<MT>;
4183 
4185  using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
4186  //**********************************************************************************************
4187 
4188  //**Compilation flags***************************************************************************
4190  static constexpr bool simdEnabled = MT::simdEnabled;
4191 
4193  static constexpr bool smpAssignable = MT::smpAssignable;
4194  //**********************************************************************************************
4195 
4196  //**Constructors********************************************************************************
4199  template< typename... RCAs >
4200  explicit inline Column( MT& matrix, RCAs... args );
4201 
4202  Column( const Column& ) = default;
4204  //**********************************************************************************************
4205 
4206  //**Destructor**********************************************************************************
4209  ~Column() = default;
4211  //**********************************************************************************************
4212 
4213  //**Data access functions***********************************************************************
4216  inline Reference operator[]( size_t index );
4217  inline ConstReference operator[]( size_t index ) const;
4218  inline Reference at( size_t index );
4219  inline ConstReference at( size_t index ) const;
4220  inline Pointer data () noexcept;
4221  inline ConstPointer data () const noexcept;
4222  inline Iterator begin ();
4223  inline ConstIterator begin () const;
4224  inline ConstIterator cbegin() const;
4225  inline Iterator end ();
4226  inline ConstIterator end () const;
4227  inline ConstIterator cend () const;
4229  //**********************************************************************************************
4230 
4231  //**Assignment operators************************************************************************
4234  inline Column& operator=( const ElementType& rhs );
4235  inline Column& operator=( initializer_list<ElementType> list );
4236  inline Column& operator=( const Column& rhs );
4237 
4238  template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
4239  template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
4240  template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
4241  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
4242  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
4243  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
4245  //**********************************************************************************************
4246 
4247  //**Utility functions***************************************************************************
4250  using DataType::column;
4251 
4252  inline MT& operand() noexcept;
4253  inline const MT& operand() const noexcept;
4254 
4255  inline size_t size() const noexcept;
4256  inline size_t spacing() const noexcept;
4257  inline size_t capacity() const noexcept;
4258  inline size_t nonZeros() const;
4259  inline void reset();
4261  //**********************************************************************************************
4262 
4263  //**Numeric functions***************************************************************************
4266  template< typename Other > inline Column& scale( const Other& scalar );
4268  //**********************************************************************************************
4269 
4270  private:
4271  //**********************************************************************************************
4273  template< typename VT >
4274  static constexpr bool VectorizedAssign_v =
4275  ( useOptimizedKernels &&
4276  simdEnabled && VT::simdEnabled &&
4278  //**********************************************************************************************
4279 
4280  //**********************************************************************************************
4282  template< typename VT >
4283  static constexpr bool VectorizedAddAssign_v =
4284  ( useOptimizedKernels &&
4285  simdEnabled && VT::simdEnabled &&
4288  //**********************************************************************************************
4289 
4290  //**********************************************************************************************
4292  template< typename VT >
4293  static constexpr bool VectorizedSubAssign_v =
4294  ( useOptimizedKernels &&
4295  simdEnabled && VT::simdEnabled &&
4298  //**********************************************************************************************
4299 
4300  //**********************************************************************************************
4302  template< typename VT >
4303  static constexpr bool VectorizedMultAssign_v =
4304  ( useOptimizedKernels &&
4305  simdEnabled && VT::simdEnabled &&
4308  //**********************************************************************************************
4309 
4310  //**********************************************************************************************
4312  template< typename VT >
4313  static constexpr bool VectorizedDivAssign_v =
4314  ( useOptimizedKernels &&
4315  simdEnabled && VT::simdEnabled &&
4318  //**********************************************************************************************
4319 
4320  //**SIMD properties*****************************************************************************
4322  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
4323  //**********************************************************************************************
4324 
4325  public:
4326  //**Expression template evaluation functions****************************************************
4329  template< typename Other >
4330  inline bool canAlias( const Other* alias ) const noexcept;
4331 
4332  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
4333  inline bool canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
4334 
4335  template< typename Other >
4336  inline bool isAliased( const Other* alias ) const noexcept;
4337 
4338  template< typename MT2, bool SO2, bool SF2, size_t... CCAs2 >
4339  inline bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
4340 
4341  inline bool isAligned () const noexcept;
4342  inline bool canSMPAssign() const noexcept;
4343 
4344  BLAZE_ALWAYS_INLINE SIMDType load ( size_t index ) const noexcept;
4345  BLAZE_ALWAYS_INLINE SIMDType loada( size_t index ) const noexcept;
4346  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t index ) const noexcept;
4347 
4348  BLAZE_ALWAYS_INLINE void store ( size_t index, const SIMDType& value ) noexcept;
4349  BLAZE_ALWAYS_INLINE void storea( size_t index, const SIMDType& value ) noexcept;
4350  BLAZE_ALWAYS_INLINE void storeu( size_t index, const SIMDType& value ) noexcept;
4351  BLAZE_ALWAYS_INLINE void stream( size_t index, const SIMDType& value ) noexcept;
4352 
4353  template< typename VT >
4354  inline auto assign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedAssign_v<VT> >;
4355 
4356  template< typename VT >
4357  inline auto assign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedAssign_v<VT> >;
4358 
4359  template< typename VT > inline void assign( const SparseVector<VT,false>& rhs );
4360 
4361  template< typename VT >
4362  inline auto addAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedAddAssign_v<VT> >;
4363 
4364  template< typename VT >
4365  inline auto addAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedAddAssign_v<VT> >;
4366 
4367  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
4368 
4369  template< typename VT >
4370  inline auto subAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedSubAssign_v<VT> >;
4371 
4372  template< typename VT >
4373  inline auto subAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedSubAssign_v<VT> >;
4374 
4375  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
4376 
4377  template< typename VT >
4378  inline auto multAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedMultAssign_v<VT> >;
4379 
4380  template< typename VT >
4381  inline auto multAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedMultAssign_v<VT> >;
4382 
4383  template< typename VT > inline void multAssign( const SparseVector<VT,false>& rhs );
4384 
4385  template< typename VT >
4386  inline auto divAssign( const DenseVector<VT,false>& rhs ) -> DisableIf_t< VectorizedDivAssign_v<VT> >;
4387 
4388  template< typename VT >
4389  inline auto divAssign( const DenseVector<VT,false>& rhs ) -> EnableIf_t< VectorizedDivAssign_v<VT> >;
4391  //**********************************************************************************************
4392 
4393  private:
4394  //**Member variables****************************************************************************
4397  Operand matrix_;
4398 
4399  //**********************************************************************************************
4400 
4401  //**Friend declarations*************************************************************************
4402  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CCAs2 > friend class Column;
4403  //**********************************************************************************************
4404 
4405  //**Compile time checks*************************************************************************
4414  //**********************************************************************************************
4415 };
4417 //*************************************************************************************************
4418 
4419 
4420 
4421 
4422 //=================================================================================================
4423 //
4424 // CONSTRUCTORS
4425 //
4426 //=================================================================================================
4427 
4428 //*************************************************************************************************
4441 template< typename MT // Type of the dense matrix
4442  , size_t... CCAs > // Compile time column arguments
4443 template< typename... RCAs > // Runtime column arguments
4444 inline Column<MT,false,true,true,CCAs...>::Column( MT& matrix, RCAs... args )
4445  : DataType( args... ) // Base class initialization
4446  , matrix_ ( matrix ) // The matrix containing the column
4447 {
4448  if( !Contains_v< TypeList<RCAs...>, Unchecked > ) {
4449  if( matrix_.columns() <= column() ) {
4450  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
4451  }
4452  }
4453  else {
4454  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
4455  }
4456 }
4458 //*************************************************************************************************
4459 
4460 
4461 
4462 
4463 //=================================================================================================
4464 //
4465 // DATA ACCESS FUNCTIONS
4466 //
4467 //=================================================================================================
4468 
4469 //*************************************************************************************************
4479 template< typename MT // Type of the dense matrix
4480  , size_t... CCAs > // Compile time column arguments
4481 inline typename Column<MT,false,true,true,CCAs...>::Reference
4482  Column<MT,false,true,true,CCAs...>::operator[]( size_t index )
4483 {
4484  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
4485  return matrix_(column(),index);
4486 }
4488 //*************************************************************************************************
4489 
4490 
4491 //*************************************************************************************************
4501 template< typename MT // Type of the dense matrix
4502  , size_t... CCAs > // Compile time column arguments
4503 inline typename Column<MT,false,true,true,CCAs...>::ConstReference
4504  Column<MT,false,true,true,CCAs...>::operator[]( size_t index ) const
4505 {
4506  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
4507  return const_cast<const MT&>( matrix_ )(column(),index);
4508 }
4510 //*************************************************************************************************
4511 
4512 
4513 //*************************************************************************************************
4524 template< typename MT // Type of the dense matrix
4525  , size_t... CCAs > // Compile time column arguments
4526 inline typename Column<MT,false,true,true,CCAs...>::Reference
4527  Column<MT,false,true,true,CCAs...>::at( size_t index )
4528 {
4529  if( index >= size() ) {
4530  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
4531  }
4532  return (*this)[index];
4533 }
4535 //*************************************************************************************************
4536 
4537 
4538 //*************************************************************************************************
4549 template< typename MT // Type of the dense matrix
4550  , size_t... CCAs > // Compile time column arguments
4551 inline typename Column<MT,false,true,true,CCAs...>::ConstReference
4552  Column<MT,false,true,true,CCAs...>::at( size_t index ) const
4553 {
4554  if( index >= size() ) {
4555  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
4556  }
4557  return (*this)[index];
4558 }
4560 //*************************************************************************************************
4561 
4562 
4563 //*************************************************************************************************
4572 template< typename MT // Type of the dense matrix
4573  , size_t... CCAs > // Compile time column arguments
4574 inline typename Column<MT,false,true,true,CCAs...>::Pointer
4576 {
4577  return matrix_.data( column() );
4578 }
4580 //*************************************************************************************************
4581 
4582 
4583 //*************************************************************************************************
4592 template< typename MT // Type of the dense matrix
4593  , size_t... CCAs > // Compile time column arguments
4594 inline typename Column<MT,false,true,true,CCAs...>::ConstPointer
4596 {
4597  return matrix_.data( column() );
4598 }
4600 //*************************************************************************************************
4601 
4602 
4603 //*************************************************************************************************
4611 template< typename MT // Type of the dense matrix
4612  , size_t... CCAs > // Compile time column arguments
4613 inline typename Column<MT,false,true,true,CCAs...>::Iterator
4615 {
4616  return matrix_.begin( column() );
4617 }
4619 //*************************************************************************************************
4620 
4621 
4622 //*************************************************************************************************
4630 template< typename MT // Type of the dense matrix
4631  , size_t... CCAs > // Compile time column arguments
4632 inline typename Column<MT,false,true,true,CCAs...>::ConstIterator
4634 {
4635  return matrix_.cbegin( column() );
4636 }
4638 //*************************************************************************************************
4639 
4640 
4641 //*************************************************************************************************
4649 template< typename MT // Type of the dense matrix
4650  , size_t... CCAs > // Compile time column arguments
4651 inline typename Column<MT,false,true,true,CCAs...>::ConstIterator
4653 {
4654  return matrix_.cbegin( column() );
4655 }
4657 //*************************************************************************************************
4658 
4659 
4660 //*************************************************************************************************
4668 template< typename MT // Type of the dense matrix
4669  , size_t... CCAs > // Compile time column arguments
4670 inline typename Column<MT,false,true,true,CCAs...>::Iterator
4672 {
4673  return matrix_.end( column() );
4674 }
4676 //*************************************************************************************************
4677 
4678 
4679 //*************************************************************************************************
4687 template< typename MT // Type of the dense matrix
4688  , size_t... CCAs > // Compile time column arguments
4689 inline typename Column<MT,false,true,true,CCAs...>::ConstIterator
4691 {
4692  return matrix_.cend( column() );
4693 }
4695 //*************************************************************************************************
4696 
4697 
4698 //*************************************************************************************************
4706 template< typename MT // Type of the dense matrix
4707  , size_t... CCAs > // Compile time column arguments
4708 inline typename Column<MT,false,true,true,CCAs...>::ConstIterator
4710 {
4711  return matrix_.cend( column() );
4712 }
4714 //*************************************************************************************************
4715 
4716 
4717 
4718 
4719 //=================================================================================================
4720 //
4721 // ASSIGNMENT OPERATORS
4722 //
4723 //=================================================================================================
4724 
4725 //*************************************************************************************************
4732 template< typename MT // Type of the dense matrix
4733  , size_t... CCAs > // Compile time column arguments
4734 inline Column<MT,false,true,true,CCAs...>&
4735  Column<MT,false,true,true,CCAs...>::operator=( const ElementType& rhs )
4736 {
4737  decltype(auto) left( derestrict( matrix_ ) );
4738 
4739  const size_t jbegin( ( IsUpper_v<MT> )
4740  ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
4741  ?( column()+1UL )
4742  :( column() ) )
4743  :( 0UL ) );
4744  const size_t jend ( ( IsLower_v<MT> )
4745  ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
4746  ?( column() )
4747  :( column()+1UL ) )
4748  :( size() ) );
4749 
4750  for( size_t j=jbegin; j<jend; ++j ) {
4751  if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, column(), j, rhs ) )
4752  left(column(),j) = rhs;
4753  }
4754 
4755  return *this;
4756 }
4758 //*************************************************************************************************
4759 
4760 
4761 //*************************************************************************************************
4776 template< typename MT // Type of the dense matrix
4777  , size_t... CCAs > // Compile time column arguments
4778 inline Column<MT,false,true,true,CCAs...>&
4779  Column<MT,false,true,true,CCAs...>::operator=( initializer_list<ElementType> list )
4780 {
4781  if( list.size() > size() ) {
4782  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
4783  }
4784 
4785  if( IsRestricted_v<MT> ) {
4786  const InitializerVector<ElementType,false> tmp( list, size() );
4787  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4788  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4789  }
4790  }
4791 
4792  decltype(auto) left( derestrict( *this ) );
4793 
4794  std::fill( std::copy( list.begin(), list.end(), left.begin() ), left.end(), ElementType() );
4795 
4796  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4797 
4798  return *this;
4799 }
4801 //*************************************************************************************************
4802 
4803 
4804 //*************************************************************************************************
4818 template< typename MT // Type of the dense matrix
4819  , size_t... CCAs > // Compile time column arguments
4820 inline Column<MT,false,true,true,CCAs...>&
4821  Column<MT,false,true,true,CCAs...>::operator=( const Column& rhs )
4822 {
4823  if( &rhs == this ) return *this;
4824 
4825  if( size() != rhs.size() ) {
4826  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
4827  }
4828 
4829  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
4830  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4831  }
4832 
4833  decltype(auto) left( derestrict( *this ) );
4834 
4835  if( IsExpression_v<MT> && rhs.canAlias( &matrix_ ) ) {
4836  const ResultType tmp( rhs );
4837  smpAssign( left, tmp );
4838  }
4839  else {
4840  smpAssign( left, rhs );
4841  }
4842 
4843  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4844 
4845  return *this;
4846 }
4848 //*************************************************************************************************
4849 
4850 
4851 //*************************************************************************************************
4865 template< typename MT // Type of the dense matrix
4866  , size_t... CCAs > // Compile time column arguments
4867 template< typename VT > // Type of the right-hand side vector
4868 inline Column<MT,false,true,true,CCAs...>&
4869  Column<MT,false,true,true,CCAs...>::operator=( const Vector<VT,false>& rhs )
4870 {
4871  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
4873 
4874  if( size() != (~rhs).size() ) {
4875  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4876  }
4877 
4878  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4879  Right right( ~rhs );
4880 
4881  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
4882  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4883  }
4884 
4885  decltype(auto) left( derestrict( *this ) );
4886 
4887  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4888  const ResultType_t<VT> tmp( right );
4889  smpAssign( left, tmp );
4890  }
4891  else {
4892  if( IsSparseVector_v<VT> )
4893  reset();
4894  smpAssign( left, right );
4895  }
4896 
4897  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4898 
4899  return *this;
4900 }
4902 //*************************************************************************************************
4903 
4904 
4905 //*************************************************************************************************
4919 template< typename MT // Type of the dense matrix
4920  , size_t... CCAs > // Compile time column arguments
4921 template< typename VT > // Type of the right-hand side vector
4922 inline Column<MT,false,true,true,CCAs...>&
4923  Column<MT,false,true,true,CCAs...>::operator+=( const Vector<VT,false>& rhs )
4924 {
4925  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
4927 
4928  if( size() != (~rhs).size() ) {
4929  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4930  }
4931 
4932  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4933  Right right( ~rhs );
4934 
4935  if( !tryAddAssign( matrix_, right, 0UL, column() ) ) {
4936  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4937  }
4938 
4939  decltype(auto) left( derestrict( *this ) );
4940 
4941  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4942  const ResultType_t<VT> tmp( right );
4943  smpAddAssign( left, tmp );
4944  }
4945  else {
4946  smpAddAssign( left, right );
4947  }
4948 
4949  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4950 
4951  return *this;
4952 }
4954 //*************************************************************************************************
4955 
4956 
4957 //*************************************************************************************************
4971 template< typename MT // Type of the dense matrix
4972  , size_t... CCAs > // Compile time column arguments
4973 template< typename VT > // Type of the right-hand side vector
4974 inline Column<MT,false,true,true,CCAs...>&
4975  Column<MT,false,true,true,CCAs...>::operator-=( const Vector<VT,false>& rhs )
4976 {
4977  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
4979 
4980  if( size() != (~rhs).size() ) {
4981  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4982  }
4983 
4984  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
4985  Right right( ~rhs );
4986 
4987  if( !trySubAssign( matrix_, right, 0UL, column() ) ) {
4988  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4989  }
4990 
4991  decltype(auto) left( derestrict( *this ) );
4992 
4993  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4994  const ResultType_t<VT> tmp( right );
4995  smpSubAssign( left, tmp );
4996  }
4997  else {
4998  smpSubAssign( left, right );
4999  }
5000 
5001  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5002 
5003  return *this;
5004 }
5006 //*************************************************************************************************
5007 
5008 
5009 //*************************************************************************************************
5022 template< typename MT // Type of the dense matrix
5023  , size_t... CCAs > // Compile time column arguments
5024 template< typename VT > // Type of the right-hand side vector
5025 inline Column<MT,false,true,true,CCAs...>&
5026  Column<MT,false,true,true,CCAs...>::operator*=( const Vector<VT,false>& rhs )
5027 {
5028  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
5030 
5031  if( size() != (~rhs).size() ) {
5032  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5033  }
5034 
5035  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
5036  Right right( ~rhs );
5037 
5038  if( !tryMultAssign( matrix_, right, 0UL, column() ) ) {
5039  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5040  }
5041 
5042  decltype(auto) left( derestrict( *this ) );
5043 
5044  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
5045  const ResultType_t<VT> tmp( right );
5046  smpMultAssign( left, tmp );
5047  }
5048  else {
5049  smpMultAssign( left, right );
5050  }
5051 
5052  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5053 
5054  return *this;
5055 }
5057 //*************************************************************************************************
5058 
5059 
5060 //*************************************************************************************************
5072 template< typename MT // Type of the dense matrix
5073  , size_t... CCAs > // Compile time column arguments
5074 template< typename VT > // Type of the right-hand side dense vector
5075 inline Column<MT,false,true,true,CCAs...>&
5076  Column<MT,false,true,true,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
5077 {
5078  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
5080 
5081  if( size() != (~rhs).size() ) {
5082  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5083  }
5084 
5085  using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>, const VT& >;
5086  Right right( ~rhs );
5087 
5088  if( !tryDivAssign( matrix_, right, 0UL, column() ) ) {
5089  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5090  }
5091 
5092  decltype(auto) left( derestrict( *this ) );
5093 
5094  if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
5095  const ResultType_t<VT> tmp( right );
5096  smpDivAssign( left, tmp );
5097  }
5098  else {
5099  smpDivAssign( left, right );
5100  }
5101 
5102  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5103 
5104  return *this;
5105 }
5107 //*************************************************************************************************
5108 
5109 
5110 //*************************************************************************************************
5123 template< typename MT // Type of the dense matrix
5124  , size_t... CCAs > // Compile time column arguments
5125 template< typename VT > // Type of the right-hand side vector
5126 inline Column<MT,false,true,true,CCAs...>&
5127  Column<MT,false,true,true,CCAs...>::operator%=( const Vector<VT,false>& rhs )
5128 {
5129  using blaze::assign;
5130 
5131  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_t<VT> );
5133 
5134  using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
5135 
5139 
5140  if( size() != 3UL || (~rhs).size() != 3UL ) {
5141  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
5142  }
5143 
5144  const CrossType right( *this % (~rhs) );
5145 
5146  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
5147  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5148  }
5149 
5150  decltype(auto) left( derestrict( *this ) );
5151 
5152  assign( left, right );
5153 
5154  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5155 
5156  return *this;
5157 }
5159 //*************************************************************************************************
5160 
5161 
5162 
5163 
5164 //=================================================================================================
5165 //
5166 // UTILITY FUNCTIONS
5167 //
5168 //=================================================================================================
5169 
5170 //*************************************************************************************************
5176 template< typename MT // Type of the dense matrix
5177  , size_t... CCAs > // Compile time column arguments
5178 inline MT& Column<MT,false,true,true,CCAs...>::operand() noexcept
5179 {
5180  return matrix_;
5181 }
5183 //*************************************************************************************************
5184 
5185 
5186 //*************************************************************************************************
5192 template< typename MT // Type of the dense matrix
5193  , size_t... CCAs > // Compile time column arguments
5194 inline const MT& Column<MT,false,true,true,CCAs...>::operand() const noexcept
5195 {
5196  return matrix_;
5197 }
5199 //*************************************************************************************************
5200 
5201 
5202 //*************************************************************************************************
5208 template< typename MT // Type of the dense matrix
5209  , size_t... CCAs > // Compile time column arguments
5210 inline size_t Column<MT,false,true,true,CCAs...>::size() const noexcept
5211 {
5212  return matrix_.rows();
5213 }
5215 //*************************************************************************************************
5216 
5217 
5218 //*************************************************************************************************
5227 template< typename MT // Type of the dense matrix
5228  , size_t... CCAs > // Compile time column arguments
5229 inline size_t Column<MT,false,true,true,CCAs...>::spacing() const noexcept
5230 {
5231  return matrix_.spacing();
5232 }
5234 //*************************************************************************************************
5235 
5236 
5237 //*************************************************************************************************
5243 template< typename MT // Type of the dense matrix
5244  , size_t... CCAs > // Compile time column arguments
5245 inline size_t Column<MT,false,true,true,CCAs...>::capacity() const noexcept
5246 {
5247  return matrix_.capacity( column() );
5248 }
5250 //*************************************************************************************************
5251 
5252 
5253 //*************************************************************************************************
5262 template< typename MT // Type of the dense matrix
5263  , size_t... CCAs > // Compile time column arguments
5265 {
5266  return matrix_.nonZeros( column() );
5267 }
5269 //*************************************************************************************************
5270 
5271 
5272 //*************************************************************************************************
5278 template< typename MT // Type of the dense matrix
5279  , size_t... CCAs > // Compile time column arguments
5281 {
5282  matrix_.reset( column() );
5283 }
5285 //*************************************************************************************************
5286 
5287 
5288 
5289 
5290 //=================================================================================================
5291 //
5292 // NUMERIC FUNCTIONS
5293 //
5294 //=================================================================================================
5295 
5296 //*************************************************************************************************
5309 template< typename MT // Type of the dense matrix
5310  , size_t... CCAs > // Compile time column arguments
5311 template< typename Other > // Data type of the scalar value
5312 inline Column<MT,false,true,true,CCAs...>&
5313  Column<MT,false,true,true,CCAs...>::scale( const Other& scalar )
5314 {
5316 
5317  const size_t jbegin( ( IsUpper_v<MT> )
5318  ?( ( IsStrictlyUpper_v<MT> )
5319  ?( column()+1UL )
5320  :( column() ) )
5321  :( 0UL ) );
5322  const size_t jend ( ( IsLower_v<MT> )
5323  ?( ( IsStrictlyLower_v<MT> )
5324  ?( column() )
5325  :( column()+1UL ) )
5326  :( size() ) );
5327 
5328  for( size_t j=jbegin; j<jend; ++j ) {
5329  matrix_(column(),j) *= scalar;
5330  }
5331 
5332  return *this;
5333 }
5335 //*************************************************************************************************
5336 
5337 
5338 
5339 
5340 //=================================================================================================
5341 //
5342 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
5343 //
5344 //=================================================================================================
5345 
5346 //*************************************************************************************************
5357 template< typename MT // Type of the dense matrix
5358  , size_t... CCAs > // Compile time column arguments
5359 template< typename Other > // Data type of the foreign expression
5360 inline bool Column<MT,false,true,true,CCAs...>::canAlias( const Other* alias ) const noexcept
5361 {
5362  return matrix_.isAliased( alias );
5363 }
5365 //*************************************************************************************************
5366 
5367 
5368 //*************************************************************************************************
5379 template< typename MT // Type of the dense matrix
5380  , size_t... CCAs > // Compile time column arguments
5381 template< typename MT2 // Data type of the foreign dense column
5382  , bool SO2 // Storage order of the foreign dense column
5383  , bool SF2 // Symmetry flag of the foreign dense column
5384  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
5385 inline bool
5386  Column<MT,false,true,true,CCAs...>::canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
5387 {
5388  return matrix_.isAliased( alias->matrix_ ) && ( column() == alias->column() );
5389 }
5391 //*************************************************************************************************
5392 
5393 
5394 //*************************************************************************************************
5405 template< typename MT // Type of the dense matrix
5406  , size_t... CCAs > // Compile time column arguments
5407 template< typename Other > // Data type of the foreign expression
5408 inline bool Column<MT,false,true,true,CCAs...>::isAliased( const Other* alias ) const noexcept
5409 {
5410  return matrix_.isAliased( alias );
5411 }
5413 //*************************************************************************************************
5414 
5415 
5416 //*************************************************************************************************
5427 template< typename MT // Type of the dense matrix
5428  , size_t... CCAs > // Compile time column arguments
5429 template< typename MT2 // Data type of the foreign dense column
5430  , bool SO2 // Storage order of the foreign dense column
5431  , bool SF2 // Symmetry flag of the foreign dense column
5432  , size_t... CCAs2 > // Compile time column arguments of the foreign dense column
5433 inline bool
5434  Column<MT,false,true,true,CCAs...>::isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept
5435 {
5436  return matrix_.isAliased( &alias->matrix_ ) && ( column() == alias->column() );
5437 }
5439 //*************************************************************************************************
5440 
5441 
5442 //*************************************************************************************************
5452 template< typename MT // Type of the dense matrix
5453  , size_t... CCAs > // Compile time column arguments
5454 inline bool Column<MT,false,true,true,CCAs...>::isAligned() const noexcept
5455 {
5456  return matrix_.isAligned();
5457 }
5459 //*************************************************************************************************
5460 
5461 
5462 //*************************************************************************************************
5473 template< typename MT // Type of the dense matrix
5474  , size_t... CCAs > // Compile time column arguments
5475 inline bool Column<MT,false,true,true,CCAs...>::canSMPAssign() const noexcept
5476 {
5477  return ( size() > SMP_DVECASSIGN_THRESHOLD );
5478 }
5480 //*************************************************************************************************
5481 
5482 
5483 //*************************************************************************************************
5495 template< typename MT // Type of the dense matrix
5496  , size_t... CCAs > // Compile time column arguments
5497 BLAZE_ALWAYS_INLINE typename Column<MT,false,true,true,CCAs...>::SIMDType
5498  Column<MT,false,true,true,CCAs...>::load( size_t index ) const noexcept
5499 {
5500  return matrix_.load( column(), index );
5501 }
5503 //*************************************************************************************************
5504 
5505 
5506 //*************************************************************************************************
5519 template< typename MT // Type of the dense matrix
5520  , size_t... CCAs > // Compile time column arguments
5521 BLAZE_ALWAYS_INLINE typename Column<MT,false,true,true,CCAs...>::SIMDType
5522  Column<MT,false,true,true,CCAs...>::loada( size_t index ) const noexcept
5523 {
5524  return matrix_.loada( column(), index );
5525 }
5527 //*************************************************************************************************
5528 
5529 
5530 //*************************************************************************************************
5543 template< typename MT // Type of the dense matrix
5544  , size_t... CCAs > // Compile time column arguments
5545 BLAZE_ALWAYS_INLINE typename Column<MT,false,true,true,CCAs...>::SIMDType
5546  Column<MT,false,true,true,CCAs...>::loadu( size_t index ) const noexcept
5547 {
5548  return matrix_.loadu( column(), index );
5549 }
5551 //*************************************************************************************************
5552 
5553 
5554 //*************************************************************************************************
5567 template< typename MT // Type of the dense matrix
5568  , size_t... CCAs > // Compile time column arguments
5570  Column<MT,false,true,true,CCAs...>::store( size_t index, const SIMDType& value ) noexcept
5571 {
5572  matrix_.store( column(), index, value );
5573 }
5575 //*************************************************************************************************
5576 
5577 
5578 //*************************************************************************************************
5592 template< typename MT // Type of the dense matrix
5593  , size_t... CCAs > // Compile time column arguments
5595  Column<MT,false,true,true,CCAs...>::storea( size_t index, const SIMDType& value ) noexcept
5596 {
5597  matrix_.storea( column(), index, value );
5598 }
5600 //*************************************************************************************************
5601 
5602 
5603 //*************************************************************************************************
5617 template< typename MT // Type of the dense matrix
5618  , size_t... CCAs > // Compile time column arguments
5620  Column<MT,false,true,true,CCAs...>::storeu( size_t index, const SIMDType& value ) noexcept
5621 {
5622  matrix_.storeu( column(), index, value );
5623 }
5625 //*************************************************************************************************
5626 
5627 
5628 //*************************************************************************************************
5642 template< typename MT // Type of the dense matrix
5643  , size_t... CCAs > // Compile time column arguments
5645  Column<MT,false,true,true,CCAs...>::stream( size_t index, const SIMDType& value ) noexcept
5646 {
5647  matrix_.stream( column(), index, value );
5648 }
5650 //*************************************************************************************************
5651 
5652 
5653 //*************************************************************************************************
5665 template< typename MT // Type of the dense matrix
5666  , size_t... CCAs > // Compile time column arguments
5667 template< typename VT > // Type of the right-hand side dense vector
5668 inline auto Column<MT,false,true,true,CCAs...>::assign( const DenseVector<VT,false>& rhs )
5669  -> DisableIf_t< VectorizedAssign_v<VT> >
5670 {
5671  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5672 
5673  const size_t jpos( (~rhs).size() & size_t(-2) );
5674  for( size_t j=0UL; j<jpos; j+=2UL ) {
5675  matrix_(column(),j ) = (~rhs)[j ];
5676  matrix_(column(),j+1UL) = (~rhs)[j+1UL];
5677  }
5678  if( jpos < (~rhs).size() )
5679  matrix_(column(),jpos) = (~rhs)[jpos];
5680 }
5682 //*************************************************************************************************
5683 
5684 
5685 //*************************************************************************************************
5697 template< typename MT // Type of the dense matrix
5698  , size_t... CCAs > // Compile time column arguments
5699 template< typename VT > // Type of the right-hand side dense vector
5700 inline auto Column<MT,false,true,true,CCAs...>::assign( const DenseVector<VT,false>& rhs )
5701  -> EnableIf_t< VectorizedAssign_v<VT> >
5702 {
5704 
5705  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5706 
5707  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5708 
5709  const size_t columns( size() );
5710 
5711  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
5712  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
5713 
5714  size_t j( 0UL );
5715  Iterator left( begin() );
5716  ConstIterator_t<VT> right( (~rhs).begin() );
5717 
5718  if( useStreaming && columns > ( cacheSize/( sizeof(ElementType) * 3UL ) ) && !(~rhs).isAliased( this ) )
5719  {
5720  for( ; j<jpos; j+=SIMDSIZE ) {
5721  left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5722  }
5723  for( ; remainder && j<columns; ++j ) {
5724  *left = *right; ++left; ++right;
5725  }
5726  }
5727  else
5728  {
5729  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5730  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5731  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5732  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5733  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5734  }
5735  for( ; j<jpos; j+=SIMDSIZE ) {
5736  left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5737  }
5738  for( ; remainder && j<columns; ++j ) {
5739  *left = *right; ++left; ++right;
5740  }
5741  }
5742 }
5744 //*************************************************************************************************
5745 
5746 
5747 //*************************************************************************************************
5759 template< typename MT // Type of the dense matrix
5760  , size_t... CCAs > // Compile time column arguments
5761 template< typename VT > // Type of the right-hand side sparse vector
5762 inline void Column<MT,false,true,true,CCAs...>::assign( const SparseVector<VT,false>& rhs )
5763 {
5764  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5765 
5766  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5767  matrix_(column(),element->index()) = element->value();
5768 }
5770 //*************************************************************************************************
5771 
5772 
5773 //*************************************************************************************************
5785 template< typename MT // Type of the dense matrix
5786  , size_t... CCAs > // Compile time column arguments
5787 template< typename VT > // Type of the right-hand side dense vector
5788 inline auto Column<MT,false,true,true,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
5789  -> DisableIf_t< VectorizedAddAssign_v<VT> >
5790 {
5791  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5792 
5793  const size_t jpos( (~rhs).size() & size_t(-2) );
5794  for( size_t j=0UL; j<jpos; j+=2UL ) {
5795  matrix_(column(),j ) += (~rhs)[j ];
5796  matrix_(column(),j+1UL) += (~rhs)[j+1UL];
5797  }
5798  if( jpos < (~rhs).size() )
5799  matrix_(column(),jpos) += (~rhs)[jpos];
5800 }
5802 //*************************************************************************************************
5803 
5804 
5805 //*************************************************************************************************
5817 template< typename MT // Type of the dense matrix
5818  , size_t... CCAs > // Compile time column arguments
5819 template< typename VT > // Type of the right-hand side dense vector
5820 inline auto Column<MT,false,true,true,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
5821  -> EnableIf_t< VectorizedAddAssign_v<VT> >
5822 {
5824 
5825  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5826 
5827  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5828 
5829  const size_t columns( size() );
5830 
5831  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
5832  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
5833 
5834  size_t j( 0UL );
5835  Iterator left( begin() );
5836  ConstIterator_t<VT> right( (~rhs).begin() );
5837 
5838  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5839  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5840  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5841  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5842  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5843  }
5844  for( ; j<jpos; j+=SIMDSIZE ) {
5845  left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5846  }
5847  for( ; remainder && j<columns; ++j ) {
5848  *left += *right; ++left; ++right;
5849  }
5850 }
5852 //*************************************************************************************************
5853 
5854 
5855 //*************************************************************************************************
5867 template< typename MT // Type of the dense matrix
5868  , size_t... CCAs > // Compile time column arguments
5869 template< typename VT > // Type of the right-hand side sparse vector
5870 inline void Column<MT,false,true,true,CCAs...>::addAssign( const SparseVector<VT,false>& rhs )
5871 {
5872  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5873 
5874  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5875  matrix_(column(),element->index()) += element->value();
5876 }
5878 //*************************************************************************************************
5879 
5880 
5881 //*************************************************************************************************
5893 template< typename MT // Type of the dense matrix
5894  , size_t... CCAs > // Compile time column arguments
5895 template< typename VT > // Type of the right-hand side dense vector
5896 inline auto Column<MT,false,true,true,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
5897  -> DisableIf_t< VectorizedSubAssign_v<VT> >
5898 {
5899  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5900 
5901  const size_t jpos( (~rhs).size() & size_t(-2) );
5902  for( size_t j=0UL; j<jpos; j+=2UL ) {
5903  matrix_(column(),j ) -= (~rhs)[j ];
5904  matrix_(column(),j+1UL) -= (~rhs)[j+1UL];
5905  }
5906  if( jpos < (~rhs).size() )
5907  matrix_(column(),jpos) -= (~rhs)[jpos];
5908 }
5910 //*************************************************************************************************
5911 
5912 
5913 //*************************************************************************************************
5925 template< typename MT // Type of the dense matrix
5926  , size_t... CCAs > // Compile time column arguments
5927 template< typename VT > // Type of the right-hand side dense vector
5928 inline auto Column<MT,false,true,true,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
5929  -> EnableIf_t< VectorizedSubAssign_v<VT> >
5930 {
5932 
5933  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5934 
5935  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5936 
5937  const size_t columns( size() );
5938 
5939  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
5940  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
5941 
5942  size_t j( 0UL );
5943  Iterator left( begin() );
5944  ConstIterator_t<VT> right( (~rhs).begin() );
5945 
5946  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5947  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5948  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5949  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5950  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5951  }
5952  for( ; j<jpos; j+=SIMDSIZE ) {
5953  left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5954  }
5955  for( ; remainder && j<columns; ++j ) {
5956  *left -= *right; ++left; ++right;
5957  }
5958 }
5960 //*************************************************************************************************
5961 
5962 
5963 //*************************************************************************************************
5975 template< typename MT // Type of the dense matrix
5976  , size_t... CCAs > // Compile time column arguments
5977 template< typename VT > // Type of the right-hand side sparse vector
5978 inline void Column<MT,false,true,true,CCAs...>::subAssign( const SparseVector<VT,false>& rhs )
5979 {
5980  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5981 
5982  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element )
5983  matrix_(column(),element->index()) -= element->value();
5984 }
5986 //*************************************************************************************************
5987 
5988 
5989 //*************************************************************************************************
6001 template< typename MT // Type of the dense matrix
6002  , size_t... CCAs > // Compile time column arguments
6003 template< typename VT > // Type of the right-hand side dense vector
6004 inline auto Column<MT,false,true,true,CCAs...>::multAssign( const DenseVector<VT,false>& rhs )
6005  -> DisableIf_t< VectorizedMultAssign_v<VT> >
6006 {
6007  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6008 
6009  const size_t jpos( (~rhs).size() & size_t(-2) );
6010  for( size_t j=0UL; j<jpos; j+=2UL ) {
6011  matrix_(column(),j ) *= (~rhs)[j ];
6012  matrix_(column(),j+1UL) *= (~rhs)[j+1UL];
6013  }
6014  if( jpos < (~rhs).size() )
6015  matrix_(column(),jpos) *= (~rhs)[jpos];
6016 }
6018 //*************************************************************************************************
6019 
6020 
6021 //*************************************************************************************************
6033 template< typename MT // Type of the dense matrix
6034  , size_t... CCAs > // Compile time column arguments
6035 template< typename VT > // Type of the right-hand side dense vector
6036 inline auto Column<MT,false,true,true,CCAs...>::multAssign( const DenseVector<VT,false>& rhs )
6037  -> EnableIf_t< VectorizedMultAssign_v<VT> >
6038 {
6040 
6041  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6042 
6043  constexpr bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
6044 
6045  const size_t columns( size() );
6046 
6047  const size_t jpos( ( remainder )?( columns & size_t(-SIMDSIZE) ):( columns ) );
6048  BLAZE_INTERNAL_ASSERT( !remainder || ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
6049 
6050  size_t j( 0UL );
6051  Iterator left( begin() );
6052  ConstIterator_t<VT> right( (~rhs).begin() );
6053 
6054  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
6055  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6056  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6057  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6058  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6059  }
6060  for( ; j<jpos; j+=SIMDSIZE ) {
6061  left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6062  }
6063  for( ; remainder && j<columns; ++j ) {
6064  *left *= *right; ++left; ++right;
6065  }
6066 }
6068 //*************************************************************************************************
6069 
6070 
6071 //*************************************************************************************************
6083 template< typename MT // Type of the dense matrix
6084  , size_t... CCAs > // Compile time column arguments
6085 template< typename VT > // Type of the right-hand side sparse vector
6086 inline void Column<MT,false,true,true,CCAs...>::multAssign( const SparseVector<VT,false>& rhs )
6087 {
6088  using blaze::reset;
6089 
6090  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6091 
6092  size_t j( 0UL );
6093 
6094  for( ConstIterator_t<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
6095  const size_t index( element->index() );
6096  for( ; j<index; ++j )
6097  reset( matrix_(column(),j) );
6098  matrix_(column(),j) *= element->value();
6099  ++j;
6100  }
6101 
6102  for( ; j<size(); ++j ) {
6103  reset( matrix_(column(),j) );
6104  }
6105 }
6107 //*************************************************************************************************
6108 
6109 
6110 //*************************************************************************************************
6122 template< typename MT // Type of the dense matrix
6123  , size_t... CCAs > // Compile time column arguments
6124 template< typename VT > // Type of the right-hand side dense vector
6125 inline auto Column<MT,false,true,true,CCAs...>::divAssign( const DenseVector<VT,false>& rhs )
6126  -> DisableIf_t< VectorizedDivAssign_v<VT> >
6127 {
6128  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6129 
6130  const size_t jpos( (~rhs).size() & size_t(-2) );
6131  for( size_t j=0UL; j<jpos; j+=2UL ) {
6132  matrix_(column(),j ) /= (~rhs)[j ];
6133  matrix_(column(),j+1UL) /= (~rhs)[j+1UL];
6134  }
6135  if( jpos < (~rhs).size() )
6136  matrix_(column(),jpos) /= (~rhs)[jpos];
6137 }
6139 //*************************************************************************************************
6140 
6141 
6142 //*************************************************************************************************
6154 template< typename MT // Type of the dense matrix
6155  , size_t... CCAs > // Compile time column arguments
6156 template< typename VT > // Type of the right-hand side dense vector
6157 inline auto Column<MT,false,true,true,CCAs...>::divAssign( const DenseVector<VT,false>& rhs )
6158  -> EnableIf_t< VectorizedDivAssign_v<VT> >
6159 {
6161 
6162  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
6163 
6164  const size_t columns( size() );
6165 
6166  const size_t jpos( columns & size_t(-SIMDSIZE) );
6167  BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (SIMDSIZE) ) ) == jpos, "Invalid end calculation" );
6168 
6169  size_t j( 0UL );
6170  Iterator left( begin() );
6171  ConstIterator_t<VT> right( (~rhs).begin() );
6172 
6173  for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
6174  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6175  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6176  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6177  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6178  }
6179  for( ; j<jpos; j+=SIMDSIZE ) {
6180  left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6181  }
6182  for( ; j<columns; ++j ) {
6183  *left /= *right; ++left; ++right;
6184  }
6185 }
6187 //*************************************************************************************************
6188 
6189 } // namespace blaze
6190 
6191 #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.
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:172
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
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:354
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:169
Header file for the View base class.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: ColumnVector.h:61
#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
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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Header file for the implementation of the Column base template.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
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. a dense or sparse submatrix), a compilation error is created.
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
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
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
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.The IsUpper_v variable template provides a con...
Definition: IsUpper.h:174
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
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
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
STL namespace.
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
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:252
Constraint on the transpose flag of vector types.
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
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_t
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_t alias declaration provid...
Definition: ColumnTrait.h:170
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
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
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
#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
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#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
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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 HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:172
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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:139
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.
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.The IsStrictlyLower_v variable templat...
Definition: IsStrictlyLower.h:172
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
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:8908
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:611
Header file for the IsPadded type trait.
Constraint on the data type.
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, a compilation error is created.
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.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.The IsUniLower_v variable template provides...
Definition: IsUniLower.h:172
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 IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.The IsStrictlyUpper_v variable templat...
Definition: IsStrictlyUpper.h:172
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.The IsLower_v variable template provides a con...
Definition: IsLower.h:174
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, a compilation error is created.
Definition: Reference.h:79
Header file for the column trait.
Header file for the isDefault shim.
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.
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
Header file for the RemoveReference type trait.
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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
constexpr bool IsExpression_v
Auxiliary variable template for the IsExpression type trait.The IsExpression_v variable template prov...
Definition: IsExpression.h:131
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
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
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:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
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 implementation of the ColumnData class template.
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, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
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 TrueType type/value trait base class.
Header file for the clear shim.
Header file for the IsExpression type trait class.
Constraint on the data type.