Sparse.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_SPARSE_H_
36 #define _BLAZE_MATH_VIEWS_COLUMN_SPARSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
58 #include <blaze/math/Exception.h>
63 #include <blaze/math/shims/Reset.h>
79 #include <blaze/math/views/Check.h>
84 #include <blaze/util/Assert.h>
87 #include <blaze/util/DisableIf.h>
88 #include <blaze/util/mpl/If.h>
89 #include <blaze/util/TypeList.h>
90 #include <blaze/util/Types.h>
94 #include <blaze/util/Unused.h>
95 
96 
97 namespace blaze {
98 
99 //=================================================================================================
100 //
101 // CLASS TEMPLATE SPECIALIZATION FOR COLUMN-MAJOR SPARSE MATRICES
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
113 template< typename MT // Type of the sparse matrix
114  , bool SF // Symmetry flag
115  , size_t... CCAs > // Compile time column arguments
116 class Column<MT,true,false,SF,CCAs...>
117  : public View< SparseVector< Column<MT,true,false,SF,CCAs...>, false > >
118  , private ColumnData<CCAs...>
119 {
120  private:
121  //**Type definitions****************************************************************************
122  using DataType = ColumnData<CCAs...>;
123  using Operand = If_< IsExpression<MT>, MT, MT& >;
124  //**********************************************************************************************
125 
126  public:
127  //**Type definitions****************************************************************************
129  using This = Column<MT,true,false,SF,CCAs...>;
130 
131  using BaseType = SparseVector<This,false>;
132  using ViewedType = MT;
133  using ResultType = ColumnTrait_<MT,CCAs...>;
134  using TransposeType = TransposeType_<ResultType>;
135  using ElementType = ElementType_<MT>;
136  using ReturnType = ReturnType_<MT>;
137  using CompositeType = const Column&;
138 
140  using ConstReference = ConstReference_<MT>;
141 
143  using Reference = If_< IsConst<MT>, ConstReference, Reference_<MT> >;
144 
146  using ConstIterator = ConstIterator_<MT>;
147 
149  using Iterator = If_< IsConst<MT>, ConstIterator, Iterator_<MT> >;
150  //**********************************************************************************************
151 
152  //**Compilation flags***************************************************************************
154  enum : bool { smpAssignable = false };
155  //**********************************************************************************************
156 
157  //**Constructors********************************************************************************
160  template< typename... RCAs >
161  explicit inline Column( MT& matrix, RCAs... args );
162  // No explicitly declared copy constructor.
164  //**********************************************************************************************
165 
166  //**Destructor**********************************************************************************
167  // No explicitly declared destructor.
168  //**********************************************************************************************
169 
170  //**Data access functions***********************************************************************
173  inline Reference operator[]( size_t index );
174  inline ConstReference operator[]( size_t index ) const;
175  inline Reference at( size_t index );
176  inline ConstReference at( size_t index ) const;
177  inline Iterator begin ();
178  inline ConstIterator begin () const;
179  inline ConstIterator cbegin() const;
180  inline Iterator end ();
181  inline ConstIterator end () const;
182  inline ConstIterator cend () const;
184  //**********************************************************************************************
185 
186  //**Assignment operators************************************************************************
189  inline Column& operator=( initializer_list<ElementType> list );
190  inline Column& operator=( const Column& rhs );
191 
192  template< typename VT > inline Column& operator= ( const DenseVector<VT,false>& rhs );
193  template< typename VT > inline Column& operator= ( const SparseVector<VT,false>& rhs );
194  template< typename VT > inline Column& operator+=( const DenseVector<VT,false>& rhs );
195  template< typename VT > inline Column& operator+=( const SparseVector<VT,false>& rhs );
196  template< typename VT > inline Column& operator-=( const DenseVector<VT,false>& rhs );
197  template< typename VT > inline Column& operator-=( const SparseVector<VT,false>& rhs );
198  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
199  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
200  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
202  //**********************************************************************************************
203 
204  //**Utility functions***************************************************************************
207  using DataType::column;
208 
209  inline MT& operand() noexcept;
210  inline const MT& operand() const noexcept;
211 
212  inline size_t size() const noexcept;
213  inline size_t capacity() const noexcept;
214  inline size_t nonZeros() const;
215  inline void reset();
216  inline void reserve( size_t n );
218  //**********************************************************************************************
219 
220  //**Insertion functions*************************************************************************
223  inline Iterator set ( size_t index, const ElementType& value );
224  inline Iterator insert( size_t index, const ElementType& value );
225  inline void append( size_t index, const ElementType& value, bool check=false );
227  //**********************************************************************************************
228 
229  //**Erase functions*****************************************************************************
232  inline void erase( size_t index );
233  inline Iterator erase( Iterator pos );
234  inline Iterator erase( Iterator first, Iterator last );
235 
236  template< typename Pred, typename = DisableIf_< IsIntegral<Pred> > >
237  inline void erase( Pred predicate );
238 
239  template< typename Pred >
240  inline void erase( Iterator first, Iterator last, Pred predicate );
242  //**********************************************************************************************
243 
244  //**Lookup functions****************************************************************************
247  inline Iterator find ( size_t index );
248  inline ConstIterator find ( size_t index ) const;
249  inline Iterator lowerBound( size_t index );
250  inline ConstIterator lowerBound( size_t index ) const;
251  inline Iterator upperBound( size_t index );
252  inline ConstIterator upperBound( size_t index ) const;
254  //**********************************************************************************************
255 
256  //**Numeric functions***************************************************************************
259  template< typename Other > inline Column& scale( const Other& scalar );
261  //**********************************************************************************************
262 
263  //**Expression template evaluation functions****************************************************
266  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
267  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
268 
269  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
270  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
271  template< typename VT > inline void addAssign( const DenseVector <VT,false>& rhs );
272  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
273  template< typename VT > inline void subAssign( const DenseVector <VT,false>& rhs );
274  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
276  //**********************************************************************************************
277 
278  private:
279  //**Utility functions***************************************************************************
282  inline size_t extendCapacity() const noexcept;
284  //**********************************************************************************************
285 
286  //**Member variables****************************************************************************
289  Operand matrix_;
290 
291  //**********************************************************************************************
292 
293  //**Compile time checks*************************************************************************
301  //**********************************************************************************************
302 };
304 //*************************************************************************************************
305 
306 
307 
308 
309 //=================================================================================================
310 //
311 // CONSTRUCTORS
312 //
313 //=================================================================================================
314 
315 //*************************************************************************************************
328 template< typename MT // Type of the sparse matrix
329  , bool SF // Symmetry flag
330  , size_t... CCAs > // Compile time column arguments
331 template< typename... RCAs > // Runtime column arguments
332 inline Column<MT,true,false,SF,CCAs...>::Column( MT& matrix, RCAs... args )
333  : DataType( args... ) // Base class initialization
334  , matrix_ ( matrix ) // The matrix containing the column
335 {
336  if( !Contains< TypeList<RCAs...>, Unchecked >::value ) {
337  if( matrix_.columns() <= column() ) {
338  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
339  }
340  }
341  else {
342  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
343  }
344 }
346 //*************************************************************************************************
347 
348 
349 
350 
351 //=================================================================================================
352 //
353 // DATA ACCESS FUNCTIONS
354 //
355 //=================================================================================================
356 
357 //*************************************************************************************************
367 template< typename MT // Type of the sparse matrix
368  , bool SF // Symmetry flag
369  , size_t... CCAs > // Compile time column arguments
370 inline typename Column<MT,true,false,SF,CCAs...>::Reference
371  Column<MT,true,false,SF,CCAs...>::operator[]( size_t index )
372 {
373  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
374  return matrix_(index,column());
375 }
377 //*************************************************************************************************
378 
379 
380 //*************************************************************************************************
390 template< typename MT // Type of the sparse matrix
391  , bool SF // Symmetry flag
392  , size_t... CCAs > // Compile time column arguments
393 inline typename Column<MT,true,false,SF,CCAs...>::ConstReference
394  Column<MT,true,false,SF,CCAs...>::operator[]( size_t index ) const
395 {
396  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
397  return const_cast<const MT&>( matrix_ )(index,column());
398 }
400 //*************************************************************************************************
401 
402 
403 //*************************************************************************************************
414 template< typename MT // Type of the sparse matrix
415  , bool SF // Symmetry flag
416  , size_t... CCAs > // Compile time column arguments
417 inline typename Column<MT,true,false,SF,CCAs...>::Reference
418  Column<MT,true,false,SF,CCAs...>::at( size_t index )
419 {
420  if( index >= size() ) {
421  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
422  }
423  return (*this)[index];
424 }
426 //*************************************************************************************************
427 
428 
429 //*************************************************************************************************
440 template< typename MT // Type of the sparse matrix
441  , bool SF // Symmetry flag
442  , size_t... CCAs > // Compile time column arguments
443 inline typename Column<MT,true,false,SF,CCAs...>::ConstReference
444  Column<MT,true,false,SF,CCAs...>::at( size_t index ) const
445 {
446  if( index >= size() ) {
447  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
448  }
449  return (*this)[index];
450 }
452 //*************************************************************************************************
453 
454 
455 //*************************************************************************************************
463 template< typename MT // Type of the sparse matrix
464  , bool SF // Symmetry flag
465  , size_t... CCAs > // Compile time column arguments
466 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
468 {
469  return matrix_.begin( column() );
470 }
472 //*************************************************************************************************
473 
474 
475 //*************************************************************************************************
483 template< typename MT // Type of the sparse matrix
484  , bool SF // Symmetry flag
485  , size_t... CCAs > // Compile time column arguments
486 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
488 {
489  return matrix_.cbegin( column() );
490 }
492 //*************************************************************************************************
493 
494 
495 //*************************************************************************************************
503 template< typename MT // Type of the sparse matrix
504  , bool SF // Symmetry flag
505  , size_t... CCAs > // Compile time column arguments
506 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
508 {
509  return matrix_.cbegin( column() );
510 }
512 //*************************************************************************************************
513 
514 
515 //*************************************************************************************************
523 template< typename MT // Type of the sparse matrix
524  , bool SF // Symmetry flag
525  , size_t... CCAs > // Compile time column arguments
526 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
528 {
529  return matrix_.end( column() );
530 }
532 //*************************************************************************************************
533 
534 
535 //*************************************************************************************************
543 template< typename MT // Type of the sparse matrix
544  , bool SF // Symmetry flag
545  , size_t... CCAs > // Compile time column arguments
546 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
548 {
549  return matrix_.cend( column() );
550 }
552 //*************************************************************************************************
553 
554 
555 //*************************************************************************************************
563 template< typename MT // Type of the sparse matrix
564  , bool SF // Symmetry flag
565  , size_t... CCAs > // Compile time column arguments
566 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
568 {
569  return matrix_.cend( column() );
570 }
572 //*************************************************************************************************
573 
574 
575 
576 
577 //=================================================================================================
578 //
579 // ASSIGNMENT OPERATORS
580 //
581 //=================================================================================================
582 
583 //*************************************************************************************************
598 template< typename MT // Type of the sparse matrix
599  , bool SF // Symmetry flag
600  , size_t... CCAs > // Compile time column arguments
601 inline Column<MT,true,false,SF,CCAs...>&
602  Column<MT,true,false,SF,CCAs...>::operator=( initializer_list<ElementType> list )
603 {
604  using blaze::assign;
605 
606  if( list.size() > size() ) {
607  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
608  }
609 
610  const InitializerVector<ElementType,false> tmp( list, size() );
611 
612  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
613  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
614  }
615 
616  decltype(auto) left( derestrict( *this ) );
617 
618  left.reset();
619  assign( left, tmp );
620 
621  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
622 
623  return *this;
624 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
643 template< typename MT // Type of the sparse matrix
644  , bool SF // Symmetry flag
645  , size_t... CCAs > // Compile time column arguments
646 inline Column<MT,true,false,SF,CCAs...>&
647  Column<MT,true,false,SF,CCAs...>::operator=( const Column& rhs )
648 {
649  using blaze::assign;
650 
654 
655  if( this == &rhs || ( &matrix_ == &rhs.matrix_ && column() == rhs.column() ) )
656  return *this;
657 
658  if( size() != rhs.size() ) {
659  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
660  }
661 
662  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
663  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
664  }
665 
666  decltype(auto) left( derestrict( *this ) );
667 
668  if( rhs.canAlias( &matrix_ ) ) {
669  const ResultType tmp( rhs );
670  left.reset();
671  left.reserve( tmp.nonZeros() );
672  assign( left, tmp );
673  }
674  else {
675  left.reset();
676  left.reserve( rhs.nonZeros() );
677  assign( left, rhs );
678  }
679 
680  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
681 
682  return *this;
683 }
685 //*************************************************************************************************
686 
687 
688 //*************************************************************************************************
702 template< typename MT // Type of the sparse matrix
703  , bool SF // Symmetry flag
704  , size_t... CCAs > // Compile time column arguments
705 template< typename VT > // Type of the right-hand side dense vector
706 inline Column<MT,true,false,SF,CCAs...>&
707  Column<MT,true,false,SF,CCAs...>::operator=( const DenseVector<VT,false>& rhs )
708 {
709  using blaze::assign;
710 
711  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
714 
715  if( size() != (~rhs).size() ) {
716  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
717  }
718 
719  using Right = If_< IsRestricted<MT>, CompositeType_<VT>, const VT& >;
720  Right right( ~rhs );
721 
722  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
723  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
724  }
725 
726  decltype(auto) left( derestrict( *this ) );
727 
728  if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
729  const ResultType_<VT> tmp( right );
730  left.reset();
731  assign( left, tmp );
732  }
733  else {
734  left.reset();
735  assign( left, right );
736  }
737 
738  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
739 
740  return *this;
741 }
743 //*************************************************************************************************
744 
745 
746 //*************************************************************************************************
760 template< typename MT // Type of the sparse matrix
761  , bool SF // Symmetry flag
762  , size_t... CCAs > // Compile time column arguments
763 template< typename VT > // Type of the right-hand side sparse vector
764 inline Column<MT,true,false,SF,CCAs...>&
765  Column<MT,true,false,SF,CCAs...>::operator=( const SparseVector<VT,false>& rhs )
766 {
767  using blaze::assign;
768 
772 
773  if( size() != (~rhs).size() ) {
774  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
775  }
776 
777  using Right = If_< IsRestricted<MT>, CompositeType_<VT>, const VT& >;
778  Right right( ~rhs );
779 
780  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
781  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
782  }
783 
784  decltype(auto) left( derestrict( *this ) );
785 
786  if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
787  const ResultType_<VT> tmp( right );
788  left.reset();
789  left.reserve( tmp.nonZeros() );
790  assign( left, tmp );
791  }
792  else {
793  left.reset();
794  left.reserve( right.nonZeros() );
795  assign( left, right );
796  }
797 
798  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
799 
800  return *this;
801 }
803 //*************************************************************************************************
804 
805 
806 //*************************************************************************************************
820 template< typename MT // Type of the sparse matrix
821  , bool SF // Symmetry flag
822  , size_t... CCAs > // Compile time column arguments
823 template< typename VT > // Type of the right-hand side dense vector
824 inline Column<MT,true,false,SF,CCAs...>&
825  Column<MT,true,false,SF,CCAs...>::operator+=( const DenseVector<VT,false>& rhs )
826 {
827  using blaze::assign;
828 
832  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
835 
836  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
837 
841 
842  if( size() != (~rhs).size() ) {
843  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
844  }
845 
846  const AddType tmp( *this + (~rhs) );
847 
848  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
849  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
850  }
851 
852  decltype(auto) left( derestrict( *this ) );
853 
854  left.reset();
855  assign( left, tmp );
856 
857  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
858 
859  return *this;
860 }
862 //*************************************************************************************************
863 
864 
865 //*************************************************************************************************
879 template< typename MT // Type of the sparse matrix
880  , bool SF // Symmetry flag
881  , size_t... CCAs > // Compile time column arguments
882 template< typename VT > // Type of the right-hand side sparse vector
883 inline Column<MT,true,false,SF,CCAs...>&
884  Column<MT,true,false,SF,CCAs...>::operator+=( const SparseVector<VT,false>& rhs )
885 {
886  using blaze::assign;
887 
894 
895  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
896 
900 
901  if( size() != (~rhs).size() ) {
902  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
903  }
904 
905  const AddType tmp( *this + (~rhs) );
906 
907  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
908  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
909  }
910 
911  decltype(auto) left( derestrict( *this ) );
912 
913  left.reset();
914  left.reserve( tmp.nonZeros() );
915  assign( left, tmp );
916 
917  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
918 
919  return *this;
920 }
922 //*************************************************************************************************
923 
924 
925 //*************************************************************************************************
940 template< typename MT // Type of the sparse matrix
941  , bool SF // Symmetry flag
942  , size_t... CCAs > // Compile time column arguments
943 template< typename VT > // Type of the right-hand side dense vector
944 inline Column<MT,true,false,SF,CCAs...>&
945  Column<MT,true,false,SF,CCAs...>::operator-=( const DenseVector<VT,false>& rhs )
946 {
947  using blaze::assign;
948 
952  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
955 
956  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
957 
961 
962  if( size() != (~rhs).size() ) {
963  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
964  }
965 
966  const SubType tmp( *this - (~rhs) );
967 
968  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
969  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
970  }
971 
972  decltype(auto) left( derestrict( *this ) );
973 
974  left.reset();
975  assign( left, tmp );
976 
977  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
978 
979  return *this;
980 }
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
1000 template< typename MT // Type of the sparse matrix
1001  , bool SF // Symmetry flag
1002  , size_t... CCAs > // Compile time column arguments
1003 template< typename VT > // Type of the right-hand side sparse vector
1004 inline Column<MT,true,false,SF,CCAs...>&
1005  Column<MT,true,false,SF,CCAs...>::operator-=( const SparseVector<VT,false>& rhs )
1006 {
1007  using blaze::assign;
1008 
1012  BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE ( ResultType_<VT> );
1013  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
1015 
1016  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
1017 
1021 
1022  if( size() != (~rhs).size() ) {
1023  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1024  }
1025 
1026  const SubType tmp( *this - (~rhs) );
1027 
1028  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
1029  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1030  }
1031 
1032  decltype(auto) left( derestrict( *this ) );
1033 
1034  left.reset();
1035  left.reserve( tmp.nonZeros() );
1036  assign( left, tmp );
1037 
1038  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1039 
1040  return *this;
1041 }
1043 //*************************************************************************************************
1044 
1045 
1046 //*************************************************************************************************
1059 template< typename MT // Type of the sparse matrix
1060  , bool SF // Symmetry flag
1061  , size_t... CCAs > // Compile time column arguments
1062 template< typename VT > // Type of the right-hand side vector
1063 inline Column<MT,true,false,SF,CCAs...>&
1064  Column<MT,true,false,SF,CCAs...>::operator*=( const Vector<VT,false>& rhs )
1065 {
1066  using blaze::assign;
1067 
1071  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
1073 
1074  using MultType = MultTrait_< ResultType, ResultType_<VT> >;
1075 
1078 
1079  if( size() != (~rhs).size() ) {
1080  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1081  }
1082 
1083  const MultType tmp( *this * (~rhs) );
1084 
1085  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
1086  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1087  }
1088 
1089  decltype(auto) left( derestrict( *this ) );
1090 
1091  left.reset();
1092  assign( left, tmp );
1093 
1094  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1095 
1096  return *this;
1097 }
1099 //*************************************************************************************************
1100 
1101 
1102 //*************************************************************************************************
1114 template< typename MT // Type of the sparse matrix
1115  , bool SF // Symmetry flag
1116  , size_t... CCAs > // Compile time column arguments
1117 template< typename VT > // Type of the right-hand side vector
1118 inline Column<MT,true,false,SF,CCAs...>&
1119  Column<MT,true,false,SF,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
1120 {
1121  using blaze::assign;
1122 
1126  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
1127  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
1129 
1130  using DivType = DivTrait_< ResultType, ResultType_<VT> >;
1131 
1135 
1136  if( size() != (~rhs).size() ) {
1137  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1138  }
1139 
1140  const DivType tmp( *this / (~rhs) );
1141 
1142  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
1143  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1144  }
1145 
1146  decltype(auto) left( derestrict( *this ) );
1147 
1148  left.reset();
1149  assign( left, tmp );
1150 
1151  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1152 
1153  return *this;
1154 }
1156 //*************************************************************************************************
1157 
1158 
1159 //*************************************************************************************************
1172 template< typename MT // Type of the sparse matrix
1173  , bool SF // Symmetry flag
1174  , size_t... CCAs > // Compile time column arguments
1175 template< typename VT > // Type of the right-hand side vector
1176 inline Column<MT,true,false,SF,CCAs...>&
1177  Column<MT,true,false,SF,CCAs...>::operator%=( const Vector<VT,false>& rhs )
1178 {
1179  using blaze::assign;
1180 
1181  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
1183 
1184  using CrossType = CrossTrait_< ResultType, ResultType_<VT> >;
1185 
1189 
1190  if( size() != 3UL || (~rhs).size() != 3UL ) {
1191  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
1192  }
1193 
1194  const CrossType tmp( *this % (~rhs) );
1195 
1196  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
1197  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
1198  }
1199 
1200  decltype(auto) left( derestrict( *this ) );
1201 
1202  left.reset();
1203  assign( left, tmp );
1204 
1205  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
1206 
1207  return *this;
1208 }
1210 //*************************************************************************************************
1211 
1212 
1213 
1214 
1215 //=================================================================================================
1216 //
1217 // UTILITY FUNCTIONS
1218 //
1219 //=================================================================================================
1220 
1221 //*************************************************************************************************
1227 template< typename MT // Type of the sparse matrix
1228  , bool SF // Symmetry flag
1229  , size_t... CCAs > // Compile time column arguments
1230 inline MT& Column<MT,true,false,SF,CCAs...>::operand() noexcept
1231 {
1232  return matrix_;
1233 }
1235 //*************************************************************************************************
1236 
1237 
1238 //*************************************************************************************************
1244 template< typename MT // Type of the sparse matrix
1245  , bool SF // Symmetry flag
1246  , size_t... CCAs > // Compile time column arguments
1247 inline const MT& Column<MT,true,false,SF,CCAs...>::operand() const noexcept
1248 {
1249  return matrix_;
1250 }
1252 //*************************************************************************************************
1253 
1254 
1255 //*************************************************************************************************
1261 template< typename MT // Type of the sparse matrix
1262  , bool SF // Symmetry flag
1263  , size_t... CCAs > // Compile time column arguments
1264 inline size_t Column<MT,true,false,SF,CCAs...>::size() const noexcept
1265 {
1266  return matrix_.rows();
1267 }
1269 //*************************************************************************************************
1270 
1271 
1272 //*************************************************************************************************
1278 template< typename MT // Type of the sparse matrix
1279  , bool SF // Symmetry flag
1280  , size_t... CCAs > // Compile time column arguments
1281 inline size_t Column<MT,true,false,SF,CCAs...>::capacity() const noexcept
1282 {
1283  return matrix_.capacity( column() );
1284 }
1286 //*************************************************************************************************
1287 
1288 
1289 //*************************************************************************************************
1298 template< typename MT // Type of the sparse matrix
1299  , bool SF // Symmetry flag
1300  , size_t... CCAs > // Compile time column arguments
1301 inline size_t Column<MT,true,false,SF,CCAs...>::nonZeros() const
1302 {
1303  return matrix_.nonZeros( column() );
1304 }
1306 //*************************************************************************************************
1307 
1308 
1309 //*************************************************************************************************
1315 template< typename MT // Type of the sparse matrix
1316  , bool SF // Symmetry flag
1317  , size_t... CCAs > // Compile time column arguments
1319 {
1320  matrix_.reset( column() );
1321 }
1323 //*************************************************************************************************
1324 
1325 
1326 //*************************************************************************************************
1336 template< typename MT // Type of the sparse matrix
1337  , bool SF // Symmetry flag
1338  , size_t... CCAs > // Compile time column arguments
1339 void Column<MT,true,false,SF,CCAs...>::reserve( size_t n )
1340 {
1341  matrix_.reserve( column(), n );
1342 }
1344 //*************************************************************************************************
1345 
1346 
1347 //*************************************************************************************************
1356 template< typename MT // Type of the sparse matrix
1357  , bool SF // Symmetry flag
1358  , size_t... CCAs > // Compile time column arguments
1359 inline size_t Column<MT,true,false,SF,CCAs...>::extendCapacity() const noexcept
1360 {
1361  using blaze::max;
1362  using blaze::min;
1363 
1364  size_t nonzeros( 2UL*capacity()+1UL );
1365  nonzeros = max( nonzeros, 7UL );
1366  nonzeros = min( nonzeros, size() );
1367 
1368  BLAZE_INTERNAL_ASSERT( nonzeros > capacity(), "Invalid capacity value" );
1369 
1370  return nonzeros;
1371 }
1373 //*************************************************************************************************
1374 
1375 
1376 
1377 
1378 //=================================================================================================
1379 //
1380 // INSERTION FUNCTIONS
1381 //
1382 //=================================================================================================
1383 
1384 //*************************************************************************************************
1396 template< typename MT // Type of the sparse matrix
1397  , bool SF // Symmetry flag
1398  , size_t... CCAs > // Compile time column arguments
1399 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1400  Column<MT,true,false,SF,CCAs...>::set( size_t index, const ElementType& value )
1401 {
1402  return matrix_.set( index, column(), value );
1403 }
1405 //*************************************************************************************************
1406 
1407 
1408 //*************************************************************************************************
1421 template< typename MT // Type of the sparse matrix
1422  , bool SF // Symmetry flag
1423  , size_t... CCAs > // Compile time column arguments
1424 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1425  Column<MT,true,false,SF,CCAs...>::insert( size_t index, const ElementType& value )
1426 {
1427  return matrix_.insert( index, column(), value );
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1458 template< typename MT // Type of the sparse matrix
1459  , bool SF // Symmetry flag
1460  , size_t... CCAs > // Compile time column arguments
1461 inline void Column<MT,true,false,SF,CCAs...>::append( size_t index, const ElementType& value, bool check )
1462 {
1463  matrix_.append( index, column(), value, check );
1464 }
1466 //*************************************************************************************************
1467 
1468 
1469 
1470 
1471 //=================================================================================================
1472 //
1473 // ERASE FUNCTIONS
1474 //
1475 //=================================================================================================
1476 
1477 //*************************************************************************************************
1486 template< typename MT // Type of the sparse matrix
1487  , bool SF // Symmetry flag
1488  , size_t... CCAs > // Compile time column arguments
1489 inline void Column<MT,true,false,SF,CCAs...>::erase( size_t index )
1490 {
1491  matrix_.erase( index, column() );
1492 }
1494 //*************************************************************************************************
1495 
1496 
1497 //*************************************************************************************************
1506 template< typename MT // Type of the sparse matrix
1507  , bool SF // Symmetry flag
1508  , size_t... CCAs > // Compile time column arguments
1509 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1510  Column<MT,true,false,SF,CCAs...>::erase( Iterator pos )
1511 {
1512  return matrix_.erase( column(), pos );
1513 }
1515 //*************************************************************************************************
1516 
1517 
1518 //*************************************************************************************************
1528 template< typename MT // Type of the sparse matrix
1529  , bool SF // Symmetry flag
1530  , size_t... CCAs > // Compile time column arguments
1531 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1532  Column<MT,true,false,SF,CCAs...>::erase( Iterator first, Iterator last )
1533 {
1534  return matrix_.erase( column(), first, last );
1535 }
1537 //*************************************************************************************************
1538 
1539 
1540 //*************************************************************************************************
1563 template< typename MT // Type of the sparse matrix
1564  , bool SF // Symmetry flag
1565  , size_t... CCAs > // Compile time column arguments
1566 template< typename Pred // Type of the unary predicate
1567  , typename > // Type restriction on the unary predicate
1568 inline void Column<MT,true,false,SF,CCAs...>::erase( Pred predicate )
1569 {
1570  matrix_.erase( column(), begin(), end(), predicate );
1571 }
1573 //*************************************************************************************************
1574 
1575 
1576 //*************************************************************************************************
1601 template< typename MT // Type of the sparse matrix
1602  , bool SF // Symmetry flag
1603  , size_t... CCAs > // Compile time column arguments
1604 template< typename Pred > // Type of the unary predicate
1605 inline void Column<MT,true,false,SF,CCAs...>::erase( Iterator first, Iterator last, Pred predicate )
1606 {
1607  matrix_.erase( column(), first, last, predicate );
1608 }
1610 //*************************************************************************************************
1611 
1612 
1613 
1614 
1615 //=================================================================================================
1616 //
1617 // LOOKUP FUNCTIONS
1618 //
1619 //=================================================================================================
1620 
1621 //*************************************************************************************************
1635 template< typename MT // Type of the sparse matrix
1636  , bool SF // Symmetry flag
1637  , size_t... CCAs > // Compile time column arguments
1638 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1639  Column<MT,true,false,SF,CCAs...>::find( size_t index )
1640 {
1641  return matrix_.find( index, column() );
1642 }
1644 //*************************************************************************************************
1645 
1646 
1647 //*************************************************************************************************
1661 template< typename MT // Type of the sparse matrix
1662  , bool SF // Symmetry flag
1663  , size_t... CCAs > // Compile time column arguments
1664 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
1665  Column<MT,true,false,SF,CCAs...>::find( size_t index ) const
1666 {
1667  return matrix_.find( index, column() );
1668 }
1670 //*************************************************************************************************
1671 
1672 
1673 //*************************************************************************************************
1686 template< typename MT // Type of the sparse matrix
1687  , bool SF // Symmetry flag
1688  , size_t... CCAs > // Compile time column arguments
1689 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1690  Column<MT,true,false,SF,CCAs...>::lowerBound( size_t index )
1691 {
1692  return matrix_.lowerBound( index, column() );
1693 }
1695 //*************************************************************************************************
1696 
1697 
1698 //*************************************************************************************************
1711 template< typename MT // Type of the sparse matrix
1712  , bool SF // Symmetry flag
1713  , size_t... CCAs > // Compile time column arguments
1714 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
1715  Column<MT,true,false,SF,CCAs...>::lowerBound( size_t index ) const
1716 {
1717  return matrix_.lowerBound( index, column() );
1718 }
1720 //*************************************************************************************************
1721 
1722 
1723 //*************************************************************************************************
1736 template< typename MT // Type of the sparse matrix
1737  , bool SF // Symmetry flag
1738  , size_t... CCAs > // Compile time column arguments
1739 inline typename Column<MT,true,false,SF,CCAs...>::Iterator
1740  Column<MT,true,false,SF,CCAs...>::upperBound( size_t index )
1741 {
1742  return matrix_.upperBound( index, column() );
1743 }
1745 //*************************************************************************************************
1746 
1747 
1748 //*************************************************************************************************
1761 template< typename MT // Type of the sparse matrix
1762  , bool SF // Symmetry flag
1763  , size_t... CCAs > // Compile time column arguments
1764 inline typename Column<MT,true,false,SF,CCAs...>::ConstIterator
1765  Column<MT,true,false,SF,CCAs...>::upperBound( size_t index ) const
1766 {
1767  return matrix_.upperBound( index, column() );
1768 }
1770 //*************************************************************************************************
1771 
1772 
1773 
1774 
1775 //=================================================================================================
1776 //
1777 // NUMERIC FUNCTIONS
1778 //
1779 //=================================================================================================
1780 
1781 //*************************************************************************************************
1794 template< typename MT // Type of the sparse matrix
1795  , bool SF // Symmetry flag
1796  , size_t... CCAs > // Compile time column arguments
1797 template< typename Other > // Data type of the scalar value
1798 inline Column<MT,true,false,SF,CCAs...>&
1799  Column<MT,true,false,SF,CCAs...>::scale( const Other& scalar )
1800 {
1802 
1803  for( Iterator element=begin(); element!=end(); ++element )
1804  element->value() *= scalar;
1805  return *this;
1806 }
1808 //*************************************************************************************************
1809 
1810 
1811 
1812 
1813 //=================================================================================================
1814 //
1815 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1816 //
1817 //=================================================================================================
1818 
1819 //*************************************************************************************************
1830 template< typename MT // Type of the sparse matrix
1831  , bool SF // Symmetry flag
1832  , size_t... CCAs > // Compile time column arguments
1833 template< typename Other > // Data type of the foreign expression
1834 inline bool Column<MT,true,false,SF,CCAs...>::canAlias( const Other* alias ) const noexcept
1835 {
1836  return matrix_.isAliased( alias );
1837 }
1839 //*************************************************************************************************
1840 
1841 
1842 //*************************************************************************************************
1853 template< typename MT // Type of the sparse matrix
1854  , bool SF // Symmetry flag
1855  , size_t... CCAs > // Compile time column arguments
1856 template< typename Other > // Data type of the foreign expression
1857 inline bool Column<MT,true,false,SF,CCAs...>::isAliased( const Other* alias ) const noexcept
1858 {
1859  return matrix_.isAliased( alias );
1860 }
1862 //*************************************************************************************************
1863 
1864 
1865 //*************************************************************************************************
1877 template< typename MT // Type of the sparse matrix
1878  , bool SF // Symmetry flag
1879  , size_t... CCAs > // Compile time column arguments
1880 template< typename VT > // Type of the right-hand side dense vector
1881 inline void Column<MT,true,false,SF,CCAs...>::assign( const DenseVector<VT,false>& rhs )
1882 {
1883  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1884  BLAZE_INTERNAL_ASSERT( nonZeros() == 0UL, "Invalid non-zero elements detected" );
1885 
1886  for( size_t i=0UL; i<size(); ++i )
1887  {
1888  if( matrix_.nonZeros( column() ) == matrix_.capacity( column() ) )
1889  matrix_.reserve( column(), extendCapacity() );
1890 
1891  matrix_.append( i, column(), (~rhs)[i], true );
1892  }
1893 }
1895 //*************************************************************************************************
1896 
1897 
1898 //*************************************************************************************************
1910 template< typename MT // Type of the sparse matrix
1911  , bool SF // Symmetry flag
1912  , size_t... CCAs > // Compile time column arguments
1913 template< typename VT > // Type of the right-hand side sparse vector
1914 inline void Column<MT,true,false,SF,CCAs...>::assign( const SparseVector<VT,false>& rhs )
1915 {
1916  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1917  BLAZE_INTERNAL_ASSERT( nonZeros() == 0UL, "Invalid non-zero elements detected" );
1918 
1919  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
1920  matrix_.append( element->index(), column(), element->value(), true );
1921  }
1922 }
1924 //*************************************************************************************************
1925 
1926 
1927 //*************************************************************************************************
1939 template< typename MT // Type of the sparse matrix
1940  , bool SF // Symmetry flag
1941  , size_t... CCAs > // Compile time column arguments
1942 template< typename VT > // Type of the right-hand side dense vector
1943 inline void Column<MT,true,false,SF,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
1944 {
1945  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
1946 
1950 
1951  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1952 
1953  const AddType tmp( serial( *this + (~rhs) ) );
1954  matrix_.reset( column() );
1955  assign( tmp );
1956 }
1958 //*************************************************************************************************
1959 
1960 
1961 //*************************************************************************************************
1973 template< typename MT // Type of the sparse matrix
1974  , bool SF // Symmetry flag
1975  , size_t... CCAs > // Compile time column arguments
1976 template< typename VT > // Type of the right-hand side sparse vector
1977 inline void Column<MT,true,false,SF,CCAs...>::addAssign( const SparseVector<VT,false>& rhs )
1978 {
1979  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
1980 
1984 
1985  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
1986 
1987  const AddType tmp( serial( *this + (~rhs) ) );
1988  matrix_.reset( column() );
1989  matrix_.reserve( column(), tmp.nonZeros() );
1990  assign( tmp );
1991 }
1993 //*************************************************************************************************
1994 
1995 
1996 //*************************************************************************************************
2008 template< typename MT // Type of the sparse matrix
2009  , bool SF // Symmetry flag
2010  , size_t... CCAs > // Compile time column arguments
2011 template< typename VT > // Type of the right-hand side dense vector
2012 inline void Column<MT,true,false,SF,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
2013 {
2014  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
2015 
2019 
2020  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2021 
2022  const SubType tmp( serial( *this - (~rhs) ) );
2023  matrix_.reset( column() );
2024  assign( tmp );
2025 }
2027 //*************************************************************************************************
2028 
2029 
2030 //*************************************************************************************************
2042 template< typename MT // Type of the sparse matrix
2043  , bool SF // Symmetry flag
2044  , size_t... CCAs > // Compile time column arguments
2045 template< typename VT > // Type of the right-hand side sparse vector
2046 inline void Column<MT,true,false,SF,CCAs...>::subAssign( const SparseVector<VT,false>& rhs )
2047 {
2048  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
2049 
2053 
2054  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
2055 
2056  const SubType tmp( serial( *this - (~rhs) ) );
2057  matrix_.reset( column() );
2058  matrix_.reserve( column(), tmp.nonZeros() );
2059  assign( tmp );
2060 }
2062 //*************************************************************************************************
2063 
2064 
2065 
2066 
2067 
2068 
2069 
2070 
2071 //=================================================================================================
2072 //
2073 // CLASS TEMPLATE SPECIALIZATION FOR GENERAL ROW-MAJOR SPARSE MATRICES
2074 //
2075 //=================================================================================================
2076 
2077 //*************************************************************************************************
2085 template< typename MT // Type of the sparse matrix
2086  , size_t... CCAs > // Compile time column arguments
2087 class Column<MT,false,false,false,CCAs...>
2088  : public View< SparseVector< Column<MT,false,false,false,CCAs...>, false > >
2089  , private ColumnData<CCAs...>
2090 {
2091  private:
2092  //**Type definitions****************************************************************************
2093  using DataType = ColumnData<CCAs...>;
2094  using Operand = If_< IsExpression<MT>, MT, MT& >;
2095  //**********************************************************************************************
2096 
2097  public:
2098  //**Type definitions****************************************************************************
2100  using This = Column<MT,false,false,false,CCAs...>;
2101 
2102  using BaseType = SparseVector<This,false>;
2103  using ViewedType = MT;
2104  using ResultType = ColumnTrait_<MT,CCAs...>;
2105  using TransposeType = TransposeType_<ResultType>;
2106  using ElementType = ElementType_<MT>;
2107  using ReturnType = ReturnType_<MT>;
2108  using CompositeType = const Column&;
2109 
2111  using ConstReference = ConstReference_<MT>;
2112 
2114  using Reference = If_< IsConst<MT>, ConstReference, Reference_<MT> >;
2115  //**********************************************************************************************
2116 
2117  //**ColumnElement class definition**************************************************************
2120  template< typename MatrixType // Type of the sparse matrix
2121  , typename IteratorType > // Type of the sparse matrix iterator
2122  class ColumnElement
2123  : private SparseElement
2124  {
2125  public:
2126  //**Constructor******************************************************************************
2132  inline ColumnElement( IteratorType pos, size_t row )
2133  : pos_( pos ) // Iterator to the current position within the sparse column
2134  , row_( row ) // Index of the according row
2135  {}
2136  //*******************************************************************************************
2137 
2138  //**Assignment operator**********************************************************************
2144  template< typename T > inline ColumnElement& operator=( const T& v ) {
2145  *pos_ = v;
2146  return *this;
2147  }
2148  //*******************************************************************************************
2149 
2150  //**Addition assignment operator*************************************************************
2156  template< typename T > inline ColumnElement& operator+=( const T& v ) {
2157  *pos_ += v;
2158  return *this;
2159  }
2160  //*******************************************************************************************
2161 
2162  //**Subtraction assignment operator**********************************************************
2168  template< typename T > inline ColumnElement& operator-=( const T& v ) {
2169  *pos_ -= v;
2170  return *this;
2171  }
2172  //*******************************************************************************************
2173 
2174  //**Multiplication assignment operator*******************************************************
2180  template< typename T > inline ColumnElement& operator*=( const T& v ) {
2181  *pos_ *= v;
2182  return *this;
2183  }
2184  //*******************************************************************************************
2185 
2186  //**Division assignment operator*************************************************************
2192  template< typename T > inline ColumnElement& operator/=( const T& v ) {
2193  *pos_ /= v;
2194  return *this;
2195  }
2196  //*******************************************************************************************
2197 
2198  //**Element access operator******************************************************************
2203  inline const ColumnElement* operator->() const {
2204  return this;
2205  }
2206  //*******************************************************************************************
2207 
2208  //**Value function***************************************************************************
2213  inline decltype(auto) value() const {
2214  return pos_->value();
2215  }
2216  //*******************************************************************************************
2217 
2218  //**Index function***************************************************************************
2223  inline size_t index() const {
2224  return row_;
2225  }
2226  //*******************************************************************************************
2227 
2228  private:
2229  //**Member variables*************************************************************************
2230  IteratorType pos_;
2231  size_t row_;
2232  //*******************************************************************************************
2233  };
2234  //**********************************************************************************************
2235 
2236  //**ColumnIterator class definition*************************************************************
2239  template< typename MatrixType // Type of the sparse matrix
2240  , typename IteratorType > // Type of the sparse matrix iterator
2241  class ColumnIterator
2242  {
2243  public:
2244  //**Type definitions*************************************************************************
2245  using IteratorCategory = std::forward_iterator_tag;
2246  using ValueType = ColumnElement<MatrixType,IteratorType>;
2247  using PointerType = ValueType;
2248  using ReferenceType = ValueType;
2249  using DifferenceType = ptrdiff_t;
2250 
2251  // STL iterator requirements
2252  using iterator_category = IteratorCategory;
2253  using value_type = ValueType;
2254  using pointer = PointerType;
2255  using reference = ReferenceType;
2256  using difference_type = DifferenceType;
2257  //*******************************************************************************************
2258 
2259  //**Constructor******************************************************************************
2262  inline ColumnIterator()
2263  : matrix_( nullptr ) // The sparse matrix containing the column
2264  , row_ ( 0UL ) // The current row index
2265  , column_( 0UL ) // The current column index
2266  , pos_ () // Iterator to the current sparse element
2267  {}
2268  //*******************************************************************************************
2269 
2270  //**Constructor******************************************************************************
2277  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column )
2278  : matrix_( &matrix ) // The sparse matrix containing the column
2279  , row_ ( row ) // The current row index
2280  , column_( column ) // The current column index
2281  , pos_ () // Iterator to the current sparse element
2282  {
2283  for( ; row_<matrix_->rows(); ++row_ ) {
2284  pos_ = matrix_->find( row_, column_ );
2285  if( pos_ != matrix_->end( row_ ) ) break;
2286  }
2287  }
2288  //*******************************************************************************************
2289 
2290  //**Constructor******************************************************************************
2298  inline ColumnIterator( MatrixType& matrix, size_t row, size_t column, IteratorType pos )
2299  : matrix_( &matrix ) // The sparse matrix containing the column
2300  , row_ ( row ) // The current row index
2301  , column_( column ) // The current column index
2302  , pos_ ( pos ) // Iterator to the current sparse element
2303  {
2304  BLAZE_INTERNAL_ASSERT( matrix.find( row, column ) == pos, "Invalid initial iterator position" );
2305  }
2306  //*******************************************************************************************
2307 
2308  //**Constructor******************************************************************************
2313  template< typename MatrixType2, typename IteratorType2 >
2314  inline ColumnIterator( const ColumnIterator<MatrixType2,IteratorType2>& it )
2315  : matrix_( it.matrix_ ) // The sparse matrix containing the column
2316  , row_ ( it.row_ ) // The current row index
2317  , column_( it.column_ ) // The current column index
2318  , pos_ ( it.pos_ ) // Iterator to the current sparse element
2319  {}
2320  //*******************************************************************************************
2321 
2322  //**Prefix increment operator****************************************************************
2327  inline ColumnIterator& operator++() {
2328  ++row_;
2329  for( ; row_<matrix_->rows(); ++row_ ) {
2330  pos_ = matrix_->find( row_, column_ );
2331  if( pos_ != matrix_->end( row_ ) ) break;
2332  }
2333 
2334  return *this;
2335  }
2336  //*******************************************************************************************
2337 
2338  //**Postfix increment operator***************************************************************
2343  inline const ColumnIterator operator++( int ) {
2344  const ColumnIterator tmp( *this );
2345  ++(*this);
2346  return tmp;
2347  }
2348  //*******************************************************************************************
2349 
2350  //**Element access operator******************************************************************
2355  inline ReferenceType operator*() const {
2356  return ReferenceType( pos_, row_ );
2357  }
2358  //*******************************************************************************************
2359 
2360  //**Element access operator******************************************************************
2365  inline PointerType operator->() const {
2366  return PointerType( pos_, row_ );
2367  }
2368  //*******************************************************************************************
2369 
2370  //**Equality operator************************************************************************
2376  template< typename MatrixType2, typename IteratorType2 >
2377  inline bool operator==( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const {
2378  return row_ == rhs.row_;
2379  }
2380  //*******************************************************************************************
2381 
2382  //**Inequality operator**********************************************************************
2388  template< typename MatrixType2, typename IteratorType2 >
2389  inline bool operator!=( const ColumnIterator<MatrixType2,IteratorType2>& rhs ) const {
2390  return !( *this == rhs );
2391  }
2392  //*******************************************************************************************
2393 
2394  //**Subtraction operator*********************************************************************
2400  inline DifferenceType operator-( const ColumnIterator& rhs ) const {
2401  size_t counter( 0UL );
2402  for( size_t i=rhs.row_; i<row_; ++i ) {
2403  if( matrix_->find( i, column_ ) != matrix_->end( i ) )
2404  ++counter;
2405  }
2406  return counter;
2407  }
2408  //*******************************************************************************************
2409 
2410  private:
2411  //**Member variables*************************************************************************
2412  MatrixType* matrix_;
2413  size_t row_;
2414  size_t column_;
2415  IteratorType pos_;
2416  //*******************************************************************************************
2417 
2418  //**Friend declarations**********************************************************************
2419  template< typename MatrixType2, typename IteratorType2 > friend class ColumnIterator;
2420  template< typename MT2, bool SO2, bool DF2, bool SF2, size_t... CCAs2 > friend class Column;
2421  //*******************************************************************************************
2422  };
2423  //**********************************************************************************************
2424 
2425  //**Type definitions****************************************************************************
2427  using ConstIterator = ColumnIterator< const MT, ConstIterator_<MT> >;
2428 
2430  using Iterator = If_< IsConst<MT>, ConstIterator, ColumnIterator< MT, Iterator_<MT> > >;
2431  //**********************************************************************************************
2432 
2433  //**Compilation flags***************************************************************************
2435  enum : bool { smpAssignable = false };
2436  //**********************************************************************************************
2437 
2438  //**Constructors********************************************************************************
2441  template< typename... RCAs >
2442  explicit inline Column( MT& matrix, RCAs... args );
2443  // No explicitly declared copy constructor.
2445  //**********************************************************************************************
2446 
2447  //**Destructor**********************************************************************************
2448  // No explicitly declared destructor.
2449  //**********************************************************************************************
2450 
2451  //**Data access functions***********************************************************************
2454  inline Reference operator[]( size_t index );
2455  inline ConstReference operator[]( size_t index ) const;
2456  inline Reference at( size_t index );
2457  inline ConstReference at( size_t index ) const;
2458  inline Iterator begin ();
2459  inline ConstIterator begin () const;
2460  inline ConstIterator cbegin() const;
2461  inline Iterator end ();
2462  inline ConstIterator end () const;
2463  inline ConstIterator cend () const;
2465  //**********************************************************************************************
2466 
2467  //**Assignment operators************************************************************************
2470  inline Column& operator=( initializer_list<ElementType> list );
2471  inline Column& operator=( const Column& rhs );
2472 
2473  template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
2474  template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
2475  template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
2476  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
2477  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
2478  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
2480  //**********************************************************************************************
2481 
2482  //**Utility functions***************************************************************************
2485  using DataType::column;
2486 
2487  inline MT& operand() noexcept;
2488  inline const MT& operand() const noexcept;
2489 
2490  inline size_t size() const;
2491  inline size_t capacity() const;
2492  inline size_t nonZeros() const;
2493  inline void reset();
2494  inline void reserve( size_t n );
2496  //**********************************************************************************************
2497 
2498  //**Insertion functions*************************************************************************
2501  inline Iterator set ( size_t index, const ElementType& value );
2502  inline Iterator insert( size_t index, const ElementType& value );
2503  inline void append( size_t index, const ElementType& value, bool check=false );
2505  //**********************************************************************************************
2506 
2507  //**Erase functions*****************************************************************************
2510  inline void erase( size_t index );
2511  inline Iterator erase( Iterator pos );
2512  inline Iterator erase( Iterator first, Iterator last );
2513 
2514  template< typename Pred, typename = DisableIf_< IsIntegral<Pred> > >
2515  inline void erase( Pred predicate );
2516 
2517  template< typename Pred >
2518  inline void erase( Iterator first, Iterator last, Pred predicate );
2520  //**********************************************************************************************
2521 
2522  //**Lookup functions****************************************************************************
2525  inline Iterator find ( size_t index );
2526  inline ConstIterator find ( size_t index ) const;
2527  inline Iterator lowerBound( size_t index );
2528  inline ConstIterator lowerBound( size_t index ) const;
2529  inline Iterator upperBound( size_t index );
2530  inline ConstIterator upperBound( size_t index ) const;
2532  //**********************************************************************************************
2533 
2534  //**Numeric functions***************************************************************************
2537  template< typename Other > inline Column& scale( const Other& scalar );
2539  //**********************************************************************************************
2540 
2541  //**Expression template evaluation functions****************************************************
2544  template< typename Other > inline bool canAlias ( const Other* alias ) const;
2545  template< typename Other > inline bool isAliased( const Other* alias ) const;
2546 
2547  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
2548  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
2549  template< typename VT > inline void addAssign( const Vector<VT,false>& rhs );
2550  template< typename VT > inline void subAssign( const Vector<VT,false>& rhs );
2552  //**********************************************************************************************
2553 
2554  private:
2555  //**Member variables****************************************************************************
2558  Operand matrix_;
2559 
2560  //**********************************************************************************************
2561 
2562  //**Compile time checks*************************************************************************
2571  //**********************************************************************************************
2572 };
2574 //*************************************************************************************************
2575 
2576 
2577 
2578 
2579 //=================================================================================================
2580 //
2581 // CONSTRUCTORS
2582 //
2583 //=================================================================================================
2584 
2585 //*************************************************************************************************
2598 template< typename MT // Type of the sparse matrix
2599  , size_t... CCAs > // Compile time column arguments
2600 template< typename... RCAs > // Runtime column arguments
2601 inline Column<MT,false,false,false,CCAs...>::Column( MT& matrix, RCAs... args )
2602  : DataType( args... ) // Base class initialization
2603  , matrix_ ( matrix ) // The matrix containing the column
2604 {
2605  if( !Contains< TypeList<RCAs...>, Unchecked >::value ) {
2606  if( matrix_.columns() <= column() ) {
2607  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
2608  }
2609  }
2610  else {
2611  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
2612  }
2613 }
2615 //*************************************************************************************************
2616 
2617 
2618 
2619 
2620 //=================================================================================================
2621 //
2622 // DATA ACCESS FUNCTIONS
2623 //
2624 //=================================================================================================
2625 
2626 //*************************************************************************************************
2636 template< typename MT // Type of the sparse matrix
2637  , size_t... CCAs > // Compile time column arguments
2638 inline typename Column<MT,false,false,false,CCAs...>::Reference
2639  Column<MT,false,false,false,CCAs...>::operator[]( size_t index )
2640 {
2641  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2642  return matrix_(index,column());
2643 }
2645 //*************************************************************************************************
2646 
2647 
2648 //*************************************************************************************************
2658 template< typename MT // Type of the sparse matrix
2659  , size_t... CCAs > // Compile time column arguments
2660 inline typename Column<MT,false,false,false,CCAs...>::ConstReference
2661  Column<MT,false,false,false,CCAs...>::operator[]( size_t index ) const
2662 {
2663  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
2664  return const_cast<const MT&>( matrix_ )(index,column());
2665 }
2667 //*************************************************************************************************
2668 
2669 
2670 //*************************************************************************************************
2681 template< typename MT // Type of the sparse matrix
2682  , size_t... CCAs > // Compile time column arguments
2683 inline typename Column<MT,false,false,false,CCAs...>::Reference
2684  Column<MT,false,false,false,CCAs...>::at( size_t index )
2685 {
2686  if( index >= size() ) {
2687  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
2688  }
2689  return (*this)[index];
2690 }
2692 //*************************************************************************************************
2693 
2694 
2695 //*************************************************************************************************
2706 template< typename MT // Type of the sparse matrix
2707  , size_t... CCAs > // Compile time column arguments
2708 inline typename Column<MT,false,false,false,CCAs...>::ConstReference
2709  Column<MT,false,false,false,CCAs...>::at( size_t index ) const
2710 {
2711  if( index >= size() ) {
2712  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
2713  }
2714  return (*this)[index];
2715 }
2717 //*************************************************************************************************
2718 
2719 
2720 //*************************************************************************************************
2728 template< typename MT // Type of the sparse matrix
2729  , size_t... CCAs > // Compile time column arguments
2730 inline typename Column<MT,false,false,false,CCAs...>::Iterator
2732 {
2733  return Iterator( matrix_, 0UL, column() );
2734 }
2736 //*************************************************************************************************
2737 
2738 
2739 //*************************************************************************************************
2747 template< typename MT // Type of the sparse matrix
2748  , size_t... CCAs > // Compile time column arguments
2749 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
2751 {
2752  return ConstIterator( matrix_, 0UL, column() );
2753 }
2755 //*************************************************************************************************
2756 
2757 
2758 //*************************************************************************************************
2766 template< typename MT // Type of the sparse matrix
2767  , size_t... CCAs > // Compile time column arguments
2768 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
2770 {
2771  return ConstIterator( matrix_, 0UL, column() );
2772 }
2774 //*************************************************************************************************
2775 
2776 
2777 //*************************************************************************************************
2785 template< typename MT // Type of the sparse matrix
2786  , size_t... CCAs > // Compile time column arguments
2787 inline typename Column<MT,false,false,false,CCAs...>::Iterator
2789 {
2790  return Iterator( matrix_, size(), column() );
2791 }
2793 //*************************************************************************************************
2794 
2795 
2796 //*************************************************************************************************
2804 template< typename MT // Type of the sparse matrix
2805  , size_t... CCAs > // Compile time column arguments
2806 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
2808 {
2809  return ConstIterator( matrix_, size(), column() );
2810 }
2812 //*************************************************************************************************
2813 
2814 
2815 //*************************************************************************************************
2823 template< typename MT // Type of the sparse matrix
2824  , size_t... CCAs > // Compile time column arguments
2825 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
2827 {
2828  return ConstIterator( matrix_, size(), column() );
2829 }
2831 //*************************************************************************************************
2832 
2833 
2834 
2835 
2836 //=================================================================================================
2837 //
2838 // ASSIGNMENT OPERATORS
2839 //
2840 //=================================================================================================
2841 
2842 //*************************************************************************************************
2857 template< typename MT // Type of the sparse matrix
2858  , size_t... CCAs > // Compile time column arguments
2859 inline Column<MT,false,false,false,CCAs...>&
2860  Column<MT,false,false,false,CCAs...>::operator=( initializer_list<ElementType> list )
2861 {
2862  using blaze::assign;
2863 
2864  if( list.size() > size() ) {
2865  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
2866  }
2867 
2868  const InitializerVector<ElementType,false> tmp( list, size() );
2869 
2870  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
2871  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
2872  }
2873 
2874  decltype(auto) left( derestrict( *this ) );
2875 
2876  assign( left, tmp );
2877 
2878  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
2879 
2880  return *this;
2881 }
2883 //*************************************************************************************************
2884 
2885 
2886 //*************************************************************************************************
2900 template< typename MT // Type of the sparse matrix
2901  , size_t... CCAs > // Compile time column arguments
2902 inline Column<MT,false,false,false,CCAs...>&
2903  Column<MT,false,false,false,CCAs...>::operator=( const Column& rhs )
2904 {
2905  using blaze::assign;
2906 
2910 
2911  if( this == &rhs || ( &matrix_ == &rhs.matrix_ && column() == rhs.column() ) )
2912  return *this;
2913 
2914  if( size() != rhs.size() ) {
2915  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
2916  }
2917 
2918  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
2919  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
2920  }
2921 
2922  decltype(auto) left( derestrict( *this ) );
2923 
2924  if( rhs.canAlias( &matrix_ ) ) {
2925  const ResultType tmp( rhs );
2926  assign( left, tmp );
2927  }
2928  else {
2929  assign( left, rhs );
2930  }
2931 
2932  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
2933 
2934  return *this;
2935 }
2937 //*************************************************************************************************
2938 
2939 
2940 //*************************************************************************************************
2954 template< typename MT // Type of the sparse matrix
2955  , size_t... CCAs > // Compile time column arguments
2956 template< typename VT > // Type of the right-hand side vector
2957 inline Column<MT,false,false,false,CCAs...>&
2958  Column<MT,false,false,false,CCAs...>::operator=( const Vector<VT,false>& rhs )
2959 {
2960  using blaze::assign;
2961 
2962  if( size() != (~rhs).size() ) {
2963  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
2964  }
2965 
2966  const CompositeType_<VT> tmp( ~rhs );
2967 
2968  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
2969  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
2970  }
2971 
2972  decltype(auto) left( derestrict( *this ) );
2973 
2974  assign( left, tmp );
2975 
2976  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
2977 
2978  return *this;
2979 }
2981 //*************************************************************************************************
2982 
2983 
2984 //*************************************************************************************************
2998 template< typename MT // Type of the sparse matrix
2999  , size_t... CCAs > // Compile time column arguments
3000 template< typename VT > // Type of the right-hand side vector
3001 inline Column<MT,false,false,false,CCAs...>&
3002  Column<MT,false,false,false,CCAs...>::operator+=( const Vector<VT,false>& rhs )
3003 {
3004  using blaze::assign;
3005 
3009  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
3011 
3012  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
3013 
3016 
3017  if( size() != (~rhs).size() ) {
3018  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3019  }
3020 
3021  const AddType tmp( *this + (~rhs) );
3022 
3023  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3024  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3025  }
3026 
3027  decltype(auto) left( derestrict( *this ) );
3028 
3029  assign( left, tmp );
3030 
3031  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3032 
3033  return *this;
3034 }
3036 //*************************************************************************************************
3037 
3038 
3039 //*************************************************************************************************
3053 template< typename MT // Type of the sparse matrix
3054  , size_t... CCAs > // Compile time column arguments
3055 template< typename VT > // Type of the right-hand side vector
3056 inline Column<MT,false,false,false,CCAs...>&
3057  Column<MT,false,false,false,CCAs...>::operator-=( const Vector<VT,false>& rhs )
3058 {
3059  using blaze::assign;
3060 
3064  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
3066 
3067  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
3068 
3071 
3072  if( size() != (~rhs).size() ) {
3073  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3074  }
3075 
3076  const SubType tmp( *this - (~rhs) );
3077 
3078  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3079  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3080  }
3081 
3082  decltype(auto) left( derestrict( *this ) );
3083 
3084  assign( left, tmp );
3085 
3086  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3087 
3088  return *this;
3089 }
3091 //*************************************************************************************************
3092 
3093 
3094 //*************************************************************************************************
3107 template< typename MT // Type of the sparse matrix
3108  , size_t... CCAs > // Compile time column arguments
3109 template< typename VT > // Type of the right-hand side vector
3110 inline Column<MT,false,false,false,CCAs...>&
3111  Column<MT,false,false,false,CCAs...>::operator*=( const Vector<VT,false>& rhs )
3112 {
3113  using blaze::assign;
3114 
3118  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
3120 
3121  using MultType = MultTrait_< ResultType, ResultType_<VT> >;
3122 
3125 
3126  if( size() != (~rhs).size() ) {
3127  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3128  }
3129 
3130  const MultType tmp( *this * (~rhs) );
3131 
3132  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3133  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3134  }
3135 
3136  decltype(auto) left( derestrict( *this ) );
3137 
3138  assign( left, tmp );
3139 
3140  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3141 
3142  return *this;
3143 }
3145 //*************************************************************************************************
3146 
3147 
3148 //*************************************************************************************************
3160 template< typename MT // Type of the sparse matrix
3161  , size_t... CCAs > // Compile time column arguments
3162 template< typename VT > // Type of the right-hand side vector
3163 inline Column<MT,false,false,false,CCAs...>&
3164  Column<MT,false,false,false,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
3165 {
3166  using blaze::assign;
3167 
3171  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
3172  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
3174 
3175  using DivType = DivTrait_< ResultType, ResultType_<VT> >;
3176 
3180 
3181  if( size() != (~rhs).size() ) {
3182  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
3183  }
3184 
3185  const DivType tmp( *this / (~rhs) );
3186 
3187  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3188  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3189  }
3190 
3191  decltype(auto) left( derestrict( *this ) );
3192 
3193  assign( left, tmp );
3194 
3195  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3196 
3197  return *this;
3198 }
3200 //*************************************************************************************************
3201 
3202 
3203 //*************************************************************************************************
3216 template< typename MT // Type of the sparse matrix
3217  , size_t... CCAs > // Compile time column arguments
3218 template< typename VT > // Type of the right-hand side vector
3219 inline Column<MT,false,false,false,CCAs...>&
3220  Column<MT,false,false,false,CCAs...>::operator%=( const Vector<VT,false>& rhs )
3221 {
3222  using blaze::assign;
3223 
3224  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
3226 
3227  using CrossType = CrossTrait_< ResultType, ResultType_<VT> >;
3228 
3232 
3233  if( size() != 3UL || (~rhs).size() != 3UL ) {
3234  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
3235  }
3236 
3237  const CrossType tmp( *this % (~rhs) );
3238 
3239  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
3240  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
3241  }
3242 
3243  decltype(auto) left( derestrict( *this ) );
3244 
3245  assign( left, tmp );
3246 
3247  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
3248 
3249  return *this;
3250 }
3252 //*************************************************************************************************
3253 
3254 
3255 
3256 
3257 //=================================================================================================
3258 //
3259 // UTILITY FUNCTIONS
3260 //
3261 //=================================================================================================
3262 
3263 //*************************************************************************************************
3269 template< typename MT // Type of the sparse matrix
3270  , size_t... CCAs > // Compile time column arguments
3271 inline MT& Column<MT,false,false,false,CCAs...>::operand() noexcept
3272 {
3273  return matrix_;
3274 }
3276 //*************************************************************************************************
3277 
3278 
3279 //*************************************************************************************************
3285 template< typename MT // Type of the sparse matrix
3286  , size_t... CCAs > // Compile time column arguments
3287 inline const MT& Column<MT,false,false,false,CCAs...>::operand() const noexcept
3288 {
3289  return matrix_;
3290 }
3292 //*************************************************************************************************
3293 
3294 
3295 //*************************************************************************************************
3301 template< typename MT // Type of the sparse matrix
3302  , size_t... CCAs > // Compile time column arguments
3303 inline size_t Column<MT,false,false,false,CCAs...>::size() const
3304 {
3305  return matrix_.rows();
3306 }
3308 //*************************************************************************************************
3309 
3310 
3311 //*************************************************************************************************
3317 template< typename MT // Type of the sparse matrix
3318  , size_t... CCAs > // Compile time column arguments
3320 {
3321  return matrix_.rows();
3322 }
3324 //*************************************************************************************************
3325 
3326 
3327 //*************************************************************************************************
3336 template< typename MT // Type of the sparse matrix
3337  , size_t... CCAs > // Compile time column arguments
3339 {
3340  size_t counter( 0UL );
3341  for( ConstIterator element=begin(); element!=end(); ++element ) {
3342  ++counter;
3343  }
3344  return counter;
3345 }
3347 //*************************************************************************************************
3348 
3349 
3350 //*************************************************************************************************
3356 template< typename MT // Type of the sparse matrix
3357  , size_t... CCAs > // Compile time column arguments
3359 {
3360  const size_t ibegin( ( IsLower<MT>::value )
3361  ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
3362  ?( column()+1UL )
3363  :( column() ) )
3364  :( 0UL ) );
3365  const size_t iend ( ( IsUpper<MT>::value )
3366  ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
3367  ?( column() )
3368  :( column()+1UL ) )
3369  :( size() ) );
3370 
3371  for( size_t i=ibegin; i<iend; ++i ) {
3372  matrix_.erase( i, column() );
3373  }
3374 }
3376 //*************************************************************************************************
3377 
3378 
3379 //*************************************************************************************************
3389 template< typename MT // Type of the sparse matrix
3390  , size_t... CCAs > // Compile time column arguments
3391 void Column<MT,false,false,false,CCAs...>::reserve( size_t n )
3392 {
3393  UNUSED_PARAMETER( n );
3394 
3395  return;
3396 }
3398 //*************************************************************************************************
3399 
3400 
3401 
3402 
3403 //=================================================================================================
3404 //
3405 // INSERTION FUNCTIONS
3406 //
3407 //=================================================================================================
3408 
3409 //*************************************************************************************************
3421 template< typename MT // Type of the sparse matrix
3422  , size_t... CCAs > // Compile time column arguments
3423 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3424  Column<MT,false,false,false,CCAs...>::set( size_t index, const ElementType& value )
3425 {
3426  return Iterator( matrix_, index, column(), matrix_.set( index, column(), value ) );
3427 }
3429 //*************************************************************************************************
3430 
3431 
3432 //*************************************************************************************************
3445 template< typename MT // Type of the sparse matrix
3446  , size_t... CCAs > // Compile time column arguments
3447 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3448  Column<MT,false,false,false,CCAs...>::insert( size_t index, const ElementType& value )
3449 {
3450  return Iterator( matrix_, index, column(), matrix_.insert( index, column(), value ) );
3451 }
3453 //*************************************************************************************************
3454 
3455 
3456 //*************************************************************************************************
3481 template< typename MT // Type of the sparse matrix
3482  , size_t... CCAs > // Compile time column arguments
3483 inline void Column<MT,false,false,false,CCAs...>::append( size_t index, const ElementType& value, bool check )
3484 {
3485  if( !check || !isDefault<strict>( value ) )
3486  matrix_.insert( index, column(), value );
3487 }
3489 //*************************************************************************************************
3490 
3491 
3492 
3493 
3494 //=================================================================================================
3495 //
3496 // ERASE FUNCTIONS
3497 //
3498 //=================================================================================================
3499 
3500 //*************************************************************************************************
3509 template< typename MT // Type of the sparse matrix
3510  , size_t... CCAs > // Compile time column arguments
3511 inline void Column<MT,false,false,false,CCAs...>::erase( size_t index )
3512 {
3513  matrix_.erase( index, column() );
3514 }
3516 //*************************************************************************************************
3517 
3518 
3519 //*************************************************************************************************
3528 template< typename MT // Type of the sparse matrix
3529  , size_t... CCAs > // Compile time column arguments
3530 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3531  Column<MT,false,false,false,CCAs...>::erase( Iterator pos )
3532 {
3533  const size_t row( pos.row_ );
3534 
3535  if( row == size() )
3536  return pos;
3537 
3538  matrix_.erase( row, pos.pos_ );
3539  return Iterator( matrix_, row+1UL, column() );
3540 }
3542 //*************************************************************************************************
3543 
3544 
3545 //*************************************************************************************************
3555 template< typename MT // Type of the sparse matrix
3556  , size_t... CCAs > // Compile time column arguments
3557 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3558  Column<MT,false,false,false,CCAs...>::erase( Iterator first, Iterator last )
3559 {
3560  for( ; first!=last; ++first ) {
3561  matrix_.erase( first.row_, first.pos_ );
3562  }
3563  return last;
3564 }
3566 //*************************************************************************************************
3567 
3568 
3569 //*************************************************************************************************
3592 template< typename MT // Type of the sparse matrix
3593  , size_t... CCAs > // Compile time column arguments
3594 template< typename Pred // Type of the unary predicate
3595  , typename > // Type restriction on the unary predicate
3596 inline void Column<MT,false,false,false,CCAs...>::erase( Pred predicate )
3597 {
3598  for( Iterator element=begin(); element!=end(); ++element ) {
3599  if( predicate( element->value() ) )
3600  matrix_.erase( element.row_, element.pos_ );
3601  }
3602 }
3604 //*************************************************************************************************
3605 
3606 
3607 //*************************************************************************************************
3633 template< typename MT // Type of the sparse matrix
3634  , size_t... CCAs > // Compile time column arguments
3635 template< typename Pred > // Type of the unary predicate
3636 inline void Column<MT,false,false,false,CCAs...>::erase( Iterator first, Iterator last, Pred predicate )
3637 {
3638  for( ; first!=last; ++first ) {
3639  if( predicate( first->value() ) )
3640  matrix_.erase( first.row_, first.pos_ );
3641  }
3642 }
3644 //*************************************************************************************************
3645 
3646 
3647 
3648 
3649 //=================================================================================================
3650 //
3651 // LOOKUP FUNCTIONS
3652 //
3653 //=================================================================================================
3654 
3655 //*************************************************************************************************
3669 template< typename MT // Type of the sparse matrix
3670  , size_t... CCAs > // Compile time column arguments
3671 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3672  Column<MT,false,false,false,CCAs...>::find( size_t index )
3673 {
3674  const Iterator_<MT> pos( matrix_.find( index, column() ) );
3675 
3676  if( pos != matrix_.end( index ) )
3677  return Iterator( matrix_, index, column(), pos );
3678  else
3679  return end();
3680 }
3682 //*************************************************************************************************
3683 
3684 
3685 //*************************************************************************************************
3699 template< typename MT // Type of the sparse matrix
3700  , size_t... CCAs > // Compile time column arguments
3701 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
3702  Column<MT,false,false,false,CCAs...>::find( size_t index ) const
3703 {
3704  const ConstIterator_<MT> pos( matrix_.find( index, column() ) );
3705 
3706  if( pos != matrix_.end( index ) )
3707  return ConstIterator( matrix_, index, column(), pos );
3708  else
3709  return end();
3710 }
3712 //*************************************************************************************************
3713 
3714 
3715 //*************************************************************************************************
3728 template< typename MT // Type of the sparse matrix
3729  , size_t... CCAs > // Compile time column arguments
3730 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3731  Column<MT,false,false,false,CCAs...>::lowerBound( size_t index )
3732 {
3733  for( size_t i=index; i<size(); ++i )
3734  {
3735  const Iterator_<MT> pos( matrix_.find( i, column() ) );
3736 
3737  if( pos != matrix_.end( i ) )
3738  return Iterator( matrix_, i, column(), pos );
3739  }
3740 
3741  return end();
3742 }
3744 //*************************************************************************************************
3745 
3746 
3747 //*************************************************************************************************
3760 template< typename MT // Type of the sparse matrix
3761  , size_t... CCAs > // Compile time column arguments
3762 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
3763  Column<MT,false,false,false,CCAs...>::lowerBound( size_t index ) const
3764 {
3765  for( size_t i=index; i<size(); ++i )
3766  {
3767  const ConstIterator_<MT> pos( matrix_.find( i, column() ) );
3768 
3769  if( pos != matrix_.end( i ) )
3770  return ConstIterator( matrix_, i, column(), pos );
3771  }
3772 
3773  return end();
3774 }
3776 //*************************************************************************************************
3777 
3778 
3779 //*************************************************************************************************
3792 template< typename MT // Type of the sparse matrix
3793  , size_t... CCAs > // Compile time column arguments
3794 inline typename Column<MT,false,false,false,CCAs...>::Iterator
3795  Column<MT,false,false,false,CCAs...>::upperBound( size_t index )
3796 {
3797  for( size_t i=index+1UL; i<size(); ++i )
3798  {
3799  const Iterator_<MT> pos( matrix_.find( i, column() ) );
3800 
3801  if( pos != matrix_.end( i ) )
3802  return Iterator( matrix_, i, column(), pos );
3803  }
3804 
3805  return end();
3806 }
3808 //*************************************************************************************************
3809 
3810 
3811 //*************************************************************************************************
3824 template< typename MT // Type of the sparse matrix
3825  , size_t... CCAs > // Compile time column arguments
3826 inline typename Column<MT,false,false,false,CCAs...>::ConstIterator
3827  Column<MT,false,false,false,CCAs...>::upperBound( size_t index ) const
3828 {
3829  for( size_t i=index+1UL; i<size(); ++i )
3830  {
3831  const ConstIterator_<MT> pos( matrix_.find( i, column() ) );
3832 
3833  if( pos != matrix_.end( i ) )
3834  return ConstIterator( matrix_, i, column(), pos );
3835  }
3836 
3837  return end();
3838 }
3840 //*************************************************************************************************
3841 
3842 
3843 
3844 
3845 //=================================================================================================
3846 //
3847 // NUMERIC FUNCTIONS
3848 //
3849 //=================================================================================================
3850 
3851 //*************************************************************************************************
3864 template< typename MT // Type of the sparse matrix
3865  , size_t... CCAs > // Compile time column arguments
3866 template< typename Other > // Data type of the scalar value
3867 inline Column<MT,false,false,false,CCAs...>&
3868  Column<MT,false,false,false,CCAs...>::scale( const Other& scalar )
3869 {
3871 
3872  for( Iterator element=begin(); element!=end(); ++element )
3873  element->value() *= scalar;
3874  return *this;
3875 }
3877 //*************************************************************************************************
3878 
3879 
3880 
3881 
3882 //=================================================================================================
3883 //
3884 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
3885 //
3886 //=================================================================================================
3887 
3888 //*************************************************************************************************
3899 template< typename MT // Type of the sparse matrix
3900  , size_t... CCAs > // Compile time column arguments
3901 template< typename Other > // Data type of the foreign expression
3902 inline bool Column<MT,false,false,false,CCAs...>::canAlias( const Other* alias ) const
3903 {
3904  return matrix_.isAliased( alias );
3905 }
3907 //*************************************************************************************************
3908 
3909 
3910 //*************************************************************************************************
3917 template< typename MT // Type of the sparse matrix
3918  , size_t... CCAs > // Compile time column arguments
3919 template< typename Other > // Data type of the foreign expression
3920 inline bool Column<MT,false,false,false,CCAs...>::isAliased( const Other* alias ) const
3921 {
3922  return matrix_.isAliased( alias );
3923 }
3925 //*************************************************************************************************
3926 
3927 
3928 //*************************************************************************************************
3940 template< typename MT // Type of the sparse matrix
3941  , size_t... CCAs > // Compile time column arguments
3942 template< typename VT > // Type of the right-hand side dense vector
3943 inline void Column<MT,false,false,false,CCAs...>::assign( const DenseVector<VT,false>& rhs )
3944 {
3945  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3946 
3947  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
3948  matrix_(i,column()) = (~rhs)[i];
3949  }
3950 }
3952 //*************************************************************************************************
3953 
3954 
3955 //*************************************************************************************************
3967 template< typename MT // Type of the sparse matrix
3968  , size_t... CCAs > // Compile time column arguments
3969 template< typename VT > // Type of the right-hand side sparse vector
3970 inline void Column<MT,false,false,false,CCAs...>::assign( const SparseVector<VT,false>& rhs )
3971 {
3972  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
3973 
3974  size_t i( 0UL );
3975 
3976  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
3977  for( ; i<element->index(); ++i )
3978  matrix_.erase( i, column() );
3979  matrix_(i++,column()) = element->value();
3980  }
3981  for( ; i<size(); ++i ) {
3982  matrix_.erase( i, column() );
3983  }
3984 }
3986 //*************************************************************************************************
3987 
3988 
3989 //*************************************************************************************************
4001 template< typename MT // Type of the sparse matrix
4002  , size_t... CCAs > // Compile time column arguments
4003 template< typename VT > // Type of the right-hand side vector
4004 inline void Column<MT,false,false,false,CCAs...>::addAssign( const Vector<VT,false>& rhs )
4005 {
4006  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
4007 
4010 
4011  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4012 
4013  const AddType tmp( serial( *this + (~rhs) ) );
4014  assign( tmp );
4015 }
4017 //*************************************************************************************************
4018 
4019 
4020 //*************************************************************************************************
4032 template< typename MT // Type of the sparse matrix
4033  , size_t... CCAs > // Compile time column arguments
4034 template< typename VT > // Type of the right-hand side vector
4035 inline void Column<MT,false,false,false,CCAs...>::subAssign( const Vector<VT,false>& rhs )
4036 {
4037  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
4038 
4041 
4042  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
4043 
4044  const SubType tmp( serial( *this - (~rhs) ) );
4045  assign( tmp );
4046 }
4048 //*************************************************************************************************
4049 
4050 
4051 
4052 
4053 
4054 
4055 
4056 
4057 //=================================================================================================
4058 //
4059 // CLASS TEMPLATE SPECIALIZATION FOR SYMMETRIC ROW-MAJOR SPARSE MATRICES
4060 //
4061 //=================================================================================================
4062 
4063 //*************************************************************************************************
4071 template< typename MT // Type of the sparse matrix
4072  , size_t... CCAs > // Compile time column arguments
4073 class Column<MT,false,false,true,CCAs...>
4074  : public View< SparseVector< Column<MT,false,false,true,CCAs...>, false > >
4075  , private ColumnData<CCAs...>
4076 {
4077  private:
4078  //**Type definitions****************************************************************************
4079  using DataType = ColumnData<CCAs...>;
4080  using Operand = If_< IsExpression<MT>, MT, MT& >;
4081  //**********************************************************************************************
4082 
4083  public:
4084  //**Type definitions****************************************************************************
4086  using This = Column<MT,false,false,true,CCAs...>;
4087 
4088  using BaseType = SparseVector<This,false>;
4089  using ViewedType = MT;
4090  using ResultType = ColumnTrait_<MT,CCAs...>;
4091  using TransposeType = TransposeType_<ResultType>;
4092  using ElementType = ElementType_<MT>;
4093  using ReturnType = ReturnType_<MT>;
4094  using CompositeType = const Column&;
4095 
4097  using ConstReference = ConstReference_<MT>;
4098 
4100  using Reference = If_< IsConst<MT>, ConstReference, Reference_<MT> >;
4101 
4103  using ConstIterator = ConstIterator_<MT>;
4104 
4106  using Iterator = If_< IsConst<MT>, ConstIterator, Iterator_<MT> >;
4107  //**********************************************************************************************
4108 
4109  //**Compilation flags***************************************************************************
4111  enum : bool { smpAssignable = false };
4112  //**********************************************************************************************
4113 
4114  //**Constructors********************************************************************************
4117  template< typename... RCAs >
4118  explicit inline Column( MT& matrix, RCAs... args );
4119  // No explicitly declared copy constructor.
4121  //**********************************************************************************************
4122 
4123  //**Destructor**********************************************************************************
4124  // No explicitly declared destructor.
4125  //**********************************************************************************************
4126 
4127  //**Data access functions***********************************************************************
4130  inline Reference operator[]( size_t index );
4131  inline ConstReference operator[]( size_t index ) const;
4132  inline Reference at( size_t index );
4133  inline ConstReference at( size_t index ) const;
4134  inline Iterator begin ();
4135  inline ConstIterator begin () const;
4136  inline ConstIterator cbegin() const;
4137  inline Iterator end ();
4138  inline ConstIterator end () const;
4139  inline ConstIterator cend () const;
4141  //**********************************************************************************************
4142 
4143  //**Assignment operators************************************************************************
4146  inline Column& operator=( initializer_list<ElementType> list );
4147  inline Column& operator=( const Column& rhs );
4148 
4149  template< typename VT > inline Column& operator= ( const DenseVector<VT,false>& rhs );
4150  template< typename VT > inline Column& operator= ( const SparseVector<VT,false>& rhs );
4151  template< typename VT > inline Column& operator+=( const DenseVector<VT,false>& rhs );
4152  template< typename VT > inline Column& operator+=( const SparseVector<VT,false>& rhs );
4153  template< typename VT > inline Column& operator-=( const DenseVector<VT,false>& rhs );
4154  template< typename VT > inline Column& operator-=( const SparseVector<VT,false>& rhs );
4155  template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
4156  template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
4157  template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
4159  //**********************************************************************************************
4160 
4161  //**Utility functions***************************************************************************
4164  using DataType::column;
4165 
4166  inline MT& operand() noexcept;
4167  inline const MT& operand() const noexcept;
4168 
4169  inline size_t size() const noexcept;
4170  inline size_t capacity() const noexcept;
4171  inline size_t nonZeros() const;
4172  inline void reset();
4173  inline void reserve( size_t n );
4175  //**********************************************************************************************
4176 
4177  //**Insertion functions*************************************************************************
4180  inline Iterator set ( size_t index, const ElementType& value );
4181  inline Iterator insert( size_t index, const ElementType& value );
4182  inline void append( size_t index, const ElementType& value, bool check=false );
4184  //**********************************************************************************************
4185 
4186  //**Erase functions*****************************************************************************
4189  inline void erase( size_t index );
4190  inline Iterator erase( Iterator pos );
4191  inline Iterator erase( Iterator first, Iterator last );
4192 
4193  template< typename Pred, typename = DisableIf_< IsIntegral<Pred> > >
4194  inline void erase( Pred predicate );
4195 
4196  template< typename Pred >
4197  inline void erase( Iterator first, Iterator last, Pred predicate );
4199  //**********************************************************************************************
4200 
4201  //**Lookup functions****************************************************************************
4204  inline Iterator find ( size_t index );
4205  inline ConstIterator find ( size_t index ) const;
4206  inline Iterator lowerBound( size_t index );
4207  inline ConstIterator lowerBound( size_t index ) const;
4208  inline Iterator upperBound( size_t index );
4209  inline ConstIterator upperBound( size_t index ) const;
4211  //**********************************************************************************************
4212 
4213  //**Numeric functions***************************************************************************
4216  template< typename Other > inline Column& scale( const Other& scalar );
4218  //**********************************************************************************************
4219 
4220  //**Expression template evaluation functions****************************************************
4223  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
4224  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
4225 
4226  template< typename VT > inline void assign ( const DenseVector <VT,false>& rhs );
4227  template< typename VT > inline void assign ( const SparseVector<VT,false>& rhs );
4228  template< typename VT > inline void addAssign( const DenseVector <VT,false>& rhs );
4229  template< typename VT > inline void addAssign( const SparseVector<VT,false>& rhs );
4230  template< typename VT > inline void subAssign( const DenseVector <VT,false>& rhs );
4231  template< typename VT > inline void subAssign( const SparseVector<VT,false>& rhs );
4233  //**********************************************************************************************
4234 
4235  private:
4236  //**Utility functions***************************************************************************
4239  inline size_t extendCapacity() const noexcept;
4241  //**********************************************************************************************
4242 
4243  //**Member variables****************************************************************************
4246  Operand matrix_;
4247 
4248  //**********************************************************************************************
4249 
4250  //**Compile time checks*************************************************************************
4259  //**********************************************************************************************
4260 };
4262 //*************************************************************************************************
4263 
4264 
4265 
4266 
4267 //=================================================================================================
4268 //
4269 // CONSTRUCTORS
4270 //
4271 //=================================================================================================
4272 
4273 //*************************************************************************************************
4286 template< typename MT // Type of the sparse matrix
4287  , size_t... CCAs > // Compile time column arguments
4288 template< typename... RCAs > // Runtime column arguments
4289 inline Column<MT,false,false,true,CCAs...>::Column( MT& matrix, RCAs... args )
4290  : DataType( args... ) // Base class initialization
4291  , matrix_ ( matrix ) // The matrix containing the column
4292 {
4293  if( !Contains< TypeList<RCAs...>, Unchecked >::value ) {
4294  if( matrix_.columns() <= column() ) {
4295  BLAZE_THROW_INVALID_ARGUMENT( "Invalid column access index" );
4296  }
4297  }
4298  else {
4299  BLAZE_USER_ASSERT( column() < matrix_.columns(), "Invalid column access index" );
4300  }
4301 }
4303 //*************************************************************************************************
4304 
4305 
4306 
4307 
4308 //=================================================================================================
4309 //
4310 // DATA ACCESS FUNCTIONS
4311 //
4312 //=================================================================================================
4313 
4314 //*************************************************************************************************
4324 template< typename MT // Type of the sparse matrix
4325  , size_t... CCAs > // Compile time column arguments
4326 inline typename Column<MT,false,false,true,CCAs...>::Reference
4327  Column<MT,false,false,true,CCAs...>::operator[]( size_t index )
4328 {
4329  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
4330  return matrix_(column(),index);
4331 }
4333 //*************************************************************************************************
4334 
4335 
4336 //*************************************************************************************************
4346 template< typename MT // Type of the sparse matrix
4347  , size_t... CCAs > // Compile time column arguments
4348 inline typename Column<MT,false,false,true,CCAs...>::ConstReference
4349  Column<MT,false,false,true,CCAs...>::operator[]( size_t index ) const
4350 {
4351  BLAZE_USER_ASSERT( index < size(), "Invalid column access index" );
4352  return const_cast<const MT&>( matrix_ )(column(),index);
4353 }
4355 //*************************************************************************************************
4356 
4357 
4358 //*************************************************************************************************
4369 template< typename MT // Type of the sparse matrix
4370  , size_t... CCAs > // Compile time column arguments
4371 inline typename Column<MT,false,false,true,CCAs...>::Reference
4372  Column<MT,false,false,true,CCAs...>::at( size_t index )
4373 {
4374  if( index >= size() ) {
4375  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
4376  }
4377  return (*this)[index];
4378 }
4380 //*************************************************************************************************
4381 
4382 
4383 //*************************************************************************************************
4394 template< typename MT // Type of the sparse matrix
4395  , size_t... CCAs > // Compile time column arguments
4396 inline typename Column<MT,false,false,true,CCAs...>::ConstReference
4397  Column<MT,false,false,true,CCAs...>::at( size_t index ) const
4398 {
4399  if( index >= size() ) {
4400  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
4401  }
4402  return (*this)[index];
4403 }
4405 //*************************************************************************************************
4406 
4407 
4408 //*************************************************************************************************
4416 template< typename MT // Type of the sparse matrix
4417  , size_t... CCAs > // Compile time column arguments
4418 inline typename Column<MT,false,false,true,CCAs...>::Iterator
4420 {
4421  return matrix_.begin( column() );
4422 }
4424 //*************************************************************************************************
4425 
4426 
4427 //*************************************************************************************************
4435 template< typename MT // Type of the sparse matrix
4436  , size_t... CCAs > // Compile time column arguments
4437 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
4439 {
4440  return matrix_.cbegin( column() );
4441 }
4443 //*************************************************************************************************
4444 
4445 
4446 //*************************************************************************************************
4454 template< typename MT // Type of the sparse matrix
4455  , size_t... CCAs > // Compile time column arguments
4456 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
4458 {
4459  return matrix_.cbegin( column() );
4460 }
4462 //*************************************************************************************************
4463 
4464 
4465 //*************************************************************************************************
4473 template< typename MT // Type of the sparse matrix
4474  , size_t... CCAs > // Compile time column arguments
4475 inline typename Column<MT,false,false,true,CCAs...>::Iterator
4477 {
4478  return matrix_.end( column() );
4479 }
4481 //*************************************************************************************************
4482 
4483 
4484 //*************************************************************************************************
4492 template< typename MT // Type of the sparse matrix
4493  , size_t... CCAs > // Compile time column arguments
4494 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
4496 {
4497  return matrix_.cend( column() );
4498 }
4500 //*************************************************************************************************
4501 
4502 
4503 //*************************************************************************************************
4511 template< typename MT // Type of the sparse matrix
4512  , size_t... CCAs > // Compile time column arguments
4513 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
4515 {
4516  return matrix_.cend( column() );
4517 }
4519 //*************************************************************************************************
4520 
4521 
4522 
4523 
4524 //=================================================================================================
4525 //
4526 // ASSIGNMENT OPERATORS
4527 //
4528 //=================================================================================================
4529 
4530 //*************************************************************************************************
4545 template< typename MT // Type of the sparse matrix
4546  , size_t... CCAs > // Compile time column arguments
4547 inline Column<MT,false,false,true,CCAs...>&
4548  Column<MT,false,false,true,CCAs...>::operator=( initializer_list<ElementType> list )
4549 {
4550  using blaze::assign;
4551 
4552  if( list.size() > size() ) {
4553  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to column" );
4554  }
4555 
4556  const InitializerVector<ElementType,false> tmp( list, size() );
4557 
4558  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4559  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4560  }
4561 
4562  decltype(auto) left( derestrict( *this ) );
4563 
4564  left.reset();
4565  assign( left, tmp );
4566 
4567  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4568 
4569  return *this;
4570 }
4572 //*************************************************************************************************
4573 
4574 
4575 //*************************************************************************************************
4589 template< typename MT // Type of the sparse matrix
4590  , size_t... CCAs > // Compile time column arguments
4591 inline Column<MT,false,false,true,CCAs...>&
4592  Column<MT,false,false,true,CCAs...>::operator=( const Column& rhs )
4593 {
4594  using blaze::assign;
4595 
4599 
4600  if( this == &rhs || ( &matrix_ == &rhs.matrix_ && column() == rhs.column() ) )
4601  return *this;
4602 
4603  if( size() != rhs.size() ) {
4604  BLAZE_THROW_INVALID_ARGUMENT( "Column sizes do not match" );
4605  }
4606 
4607  if( !tryAssign( matrix_, rhs, 0UL, column() ) ) {
4608  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4609  }
4610 
4611  decltype(auto) left( derestrict( *this ) );
4612 
4613  if( rhs.canAlias( &matrix_ ) ) {
4614  const ResultType tmp( rhs );
4615  left.reset();
4616  left.reserve( tmp.nonZeros() );
4617  assign( left, tmp );
4618  }
4619  else {
4620  left.reset();
4621  left.reserve( rhs.nonZeros() );
4622  assign( left, rhs );
4623  }
4624 
4625  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4626 
4627  return *this;
4628 }
4630 //*************************************************************************************************
4631 
4632 
4633 //*************************************************************************************************
4647 template< typename MT // Type of the sparse matrix
4648  , size_t... CCAs > // Compile time column arguments
4649 template< typename VT > // Type of the right-hand side dense vector
4650 inline Column<MT,false,false,true,CCAs...>&
4651  Column<MT,false,false,true,CCAs...>::operator=( const DenseVector<VT,false>& rhs )
4652 {
4653  using blaze::assign;
4654 
4655  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
4656  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4658 
4659  if( size() != (~rhs).size() ) {
4660  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4661  }
4662 
4663  using Right = If_< IsRestricted<MT>, CompositeType_<VT>, const VT& >;
4664  Right right( ~rhs );
4665 
4666  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
4667  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4668  }
4669 
4670  decltype(auto) left( derestrict( *this ) );
4671 
4672  if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4673  const ResultType_<VT> tmp( right );
4674  left.reset();
4675  assign( left, tmp );
4676  }
4677  else {
4678  left.reset();
4679  assign( left, right );
4680  }
4681 
4682  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4683 
4684  return *this;
4685 }
4687 //*************************************************************************************************
4688 
4689 
4690 //*************************************************************************************************
4704 template< typename MT // Type of the sparse matrix
4705  , size_t... CCAs > // Compile time column arguments
4706 template< typename VT > // Type of the right-hand side sparse vector
4707 inline Column<MT,false,false,true,CCAs...>&
4708  Column<MT,false,false,true,CCAs...>::operator=( const SparseVector<VT,false>& rhs )
4709 {
4710  using blaze::assign;
4711 
4712  BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE ( ResultType_<VT> );
4713  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4715 
4716  if( size() != (~rhs).size() ) {
4717  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4718  }
4719 
4720  using Right = If_< IsRestricted<MT>, CompositeType_<VT>, const VT& >;
4721  Right right( ~rhs );
4722 
4723  if( !tryAssign( matrix_, right, 0UL, column() ) ) {
4724  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4725  }
4726 
4727  decltype(auto) left( derestrict( *this ) );
4728 
4729  if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4730  const ResultType_<VT> tmp( right);
4731  left.reset();
4732  left.reserve( tmp.nonZeros() );
4733  assign( left, tmp );
4734  }
4735  else {
4736  left.reset();
4737  left.reserve( right.nonZeros() );
4738  assign( left, right );
4739  }
4740 
4741  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4742 
4743  return *this;
4744 }
4746 //*************************************************************************************************
4747 
4748 
4749 //*************************************************************************************************
4763 template< typename MT // Type of the sparse matrix
4764  , size_t... CCAs > // Compile time column arguments
4765 template< typename VT > // Type of the right-hand side dense vector
4766 inline Column<MT,false,false,true,CCAs...>&
4767  Column<MT,false,false,true,CCAs...>::operator+=( const DenseVector<VT,false>& rhs )
4768 {
4769  using blaze::assign;
4770 
4774  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
4775  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4777 
4778  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
4779 
4783 
4784  if( size() != (~rhs).size() ) {
4785  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4786  }
4787 
4788  const AddType tmp( *this + (~rhs) );
4789 
4790  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4791  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4792  }
4793 
4794  decltype(auto) left( derestrict( *this ) );
4795 
4796  left.reset();
4797  assign( left, tmp );
4798 
4799  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4800 
4801  return *this;
4802 }
4804 //*************************************************************************************************
4805 
4806 
4807 //*************************************************************************************************
4821 template< typename MT // Type of the sparse matrix
4822  , size_t... CCAs > // Compile time column arguments
4823 template< typename VT > // Type of the right-hand side sparse vector
4824 inline Column<MT,false,false,true,CCAs...>&
4825  Column<MT,false,false,true,CCAs...>::operator+=( const SparseVector<VT,false>& rhs )
4826 {
4827  using blaze::assign;
4828 
4832  BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE ( ResultType_<VT> );
4833  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4835 
4836  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
4837 
4841 
4842  if( size() != (~rhs).size() ) {
4843  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4844  }
4845 
4846  const AddType tmp( *this + (~rhs) );
4847 
4848  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4849  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4850  }
4851 
4852  decltype(auto) left( derestrict( *this ) );
4853 
4854  left.reset();
4855  left.reserve( tmp.nonZeros() );
4856  assign( left, tmp );
4857 
4858  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4859 
4860  return *this;
4861 }
4863 //*************************************************************************************************
4864 
4865 
4866 //*************************************************************************************************
4881 template< typename MT // Type of the sparse matrix
4882  , size_t... CCAs > // Compile time column arguments
4883 template< typename VT > // Type of the right-hand side dense vector
4884 inline Column<MT,false,false,true,CCAs...>&
4885  Column<MT,false,false,true,CCAs...>::operator-=( const DenseVector<VT,false>& rhs )
4886 {
4887  using blaze::assign;
4888 
4892  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
4893  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4895 
4896  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
4897 
4901 
4902  if( size() != (~rhs).size() ) {
4903  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4904  }
4905 
4906  const SubType tmp( *this - (~rhs) );
4907 
4908  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4909  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4910  }
4911 
4912  decltype(auto) left( derestrict( *this ) );
4913 
4914  left.reset();
4915  assign( left, tmp );
4916 
4917  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4918 
4919  return *this;
4920 }
4922 //*************************************************************************************************
4923 
4924 
4925 //*************************************************************************************************
4940 template< typename MT // Type of the sparse matrix
4941  , size_t... CCAs > // Compile time column arguments
4942 template< typename VT > // Type of the right-hand side sparse vector
4943 inline Column<MT,false,false,true,CCAs...>&
4944  Column<MT,false,false,true,CCAs...>::operator-=( const SparseVector<VT,false>& rhs )
4945 {
4946  using blaze::assign;
4947 
4951  BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE ( ResultType_<VT> );
4952  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
4954 
4955  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
4956 
4960 
4961  if( size() != (~rhs).size() ) {
4962  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
4963  }
4964 
4965  const SubType tmp( *this - (~rhs) );
4966 
4967  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
4968  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
4969  }
4970 
4971  decltype(auto) left( derestrict( *this ) );
4972 
4973  left.reset();
4974  left.reserve( tmp.nonZeros() );
4975  assign( left, tmp );
4976 
4977  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
4978 
4979  return *this;
4980 }
4982 //*************************************************************************************************
4983 
4984 
4985 //*************************************************************************************************
4998 template< typename MT // Type of the sparse matrix
4999  , size_t... CCAs > // Compile time column arguments
5000 template< typename VT > // Type of the right-hand side vector
5001 inline Column<MT,false,false,true,CCAs...>&
5002  Column<MT,false,false,true,CCAs...>::operator*=( const Vector<VT,false>& rhs )
5003 {
5004  using blaze::assign;
5005 
5009  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
5011 
5012  using MultType = MultTrait_< ResultType, ResultType_<VT> >;
5013 
5016 
5017  if( size() != (~rhs).size() ) {
5018  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5019  }
5020 
5021  const MultType tmp( *this * (~rhs) );
5022 
5023  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
5024  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5025  }
5026 
5027  decltype(auto) left( derestrict( *this ) );
5028 
5029  left.reset();
5030  assign( left, tmp );
5031 
5032  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5033 
5034  return *this;
5035 }
5037 //*************************************************************************************************
5038 
5039 
5040 //*************************************************************************************************
5052 template< typename MT // Type of the sparse matrix
5053  , size_t... CCAs > // Compile time column arguments
5054 template< typename VT > // Type of the right-hand side vector
5055 inline Column<MT,false,false,true,CCAs...>&
5056  Column<MT,false,false,true,CCAs...>::operator/=( const DenseVector<VT,false>& rhs )
5057 {
5058  using blaze::assign;
5059 
5063  BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE ( ResultType_<VT> );
5064  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
5066 
5067  using DivType = DivTrait_< ResultType, ResultType_<VT> >;
5068 
5072 
5073  if( size() != (~rhs).size() ) {
5074  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
5075  }
5076 
5077  const DivType tmp( *this / (~rhs) );
5078 
5079  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
5080  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5081  }
5082 
5083  decltype(auto) left( derestrict( *this ) );
5084 
5085  left.reset();
5086  assign( left, tmp );
5087 
5088  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5089 
5090  return *this;
5091 }
5093 //*************************************************************************************************
5094 
5095 
5096 //*************************************************************************************************
5109 template< typename MT // Type of the sparse matrix
5110  , size_t... CCAs > // Compile time column arguments
5111 template< typename VT > // Type of the right-hand side vector
5112 inline Column<MT,false,false,true,CCAs...>&
5113  Column<MT,false,false,true,CCAs...>::operator%=( const Vector<VT,false>& rhs )
5114 {
5115  using blaze::assign;
5116 
5117  BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE ( ResultType_<VT> );
5119 
5120  using CrossType = CrossTrait_< ResultType, ResultType_<VT> >;
5121 
5125 
5126  if( size() != 3UL || (~rhs).size() != 3UL ) {
5127  BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
5128  }
5129 
5130  const CrossType tmp( *this % (~rhs) );
5131 
5132  if( !tryAssign( matrix_, tmp, 0UL, column() ) ) {
5133  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to restricted matrix" );
5134  }
5135 
5136  decltype(auto) left( derestrict( *this ) );
5137 
5138  left.reset();
5139  assign( left, tmp );
5140 
5141  BLAZE_INTERNAL_ASSERT( isIntact( matrix_ ), "Invariant violation detected" );
5142 
5143  return *this;
5144 }
5146 //*************************************************************************************************
5147 
5148 
5149 
5150 
5151 //=================================================================================================
5152 //
5153 // UTILITY FUNCTIONS
5154 //
5155 //=================================================================================================
5156 
5157 //*************************************************************************************************
5163 template< typename MT // Type of the sparse matrix
5164  , size_t... CCAs > // Compile time column arguments
5165 inline MT& Column<MT,false,false,true,CCAs...>::operand() noexcept
5166 {
5167  return matrix_;
5168 }
5170 //*************************************************************************************************
5171 
5172 
5173 //*************************************************************************************************
5179 template< typename MT // Type of the sparse matrix
5180  , size_t... CCAs > // Compile time column arguments
5181 inline const MT& Column<MT,false,false,true,CCAs...>::operand() const noexcept
5182 {
5183  return matrix_;
5184 }
5186 //*************************************************************************************************
5187 
5188 
5189 //*************************************************************************************************
5195 template< typename MT // Type of the sparse matrix
5196  , size_t... CCAs > // Compile time column arguments
5197 inline size_t Column<MT,false,false,true,CCAs...>::size() const noexcept
5198 {
5199  return matrix_.rows();
5200 }
5202 //*************************************************************************************************
5203 
5204 
5205 //*************************************************************************************************
5211 template< typename MT // Type of the sparse matrix
5212  , size_t... CCAs > // Compile time column arguments
5213 inline size_t Column<MT,false,false,true,CCAs...>::capacity() const noexcept
5214 {
5215  return matrix_.capacity( column() );
5216 }
5218 //*************************************************************************************************
5219 
5220 
5221 //*************************************************************************************************
5230 template< typename MT // Type of the sparse matrix
5231  , size_t... CCAs > // Compile time column arguments
5233 {
5234  return matrix_.nonZeros( column() );
5235 }
5237 //*************************************************************************************************
5238 
5239 
5240 //*************************************************************************************************
5246 template< typename MT // Type of the sparse matrix
5247  , size_t... CCAs > // Compile time column arguments
5249 {
5250  matrix_.reset( column() );
5251 }
5253 //*************************************************************************************************
5254 
5255 
5256 //*************************************************************************************************
5266 template< typename MT // Type of the sparse matrix
5267  , size_t... CCAs > // Compile time column arguments
5268 void Column<MT,false,false,true,CCAs...>::reserve( size_t n )
5269 {
5270  matrix_.reserve( column(), n );
5271 }
5273 //*************************************************************************************************
5274 
5275 
5276 //*************************************************************************************************
5285 template< typename MT // Type of the sparse matrix
5286  , size_t... CCAs > // Compile time column arguments
5287 inline size_t Column<MT,false,false,true,CCAs...>::extendCapacity() const noexcept
5288 {
5289  using blaze::max;
5290  using blaze::min;
5291 
5292  size_t nonzeros( 2UL*capacity()+1UL );
5293  nonzeros = max( nonzeros, 7UL );
5294  nonzeros = min( nonzeros, size() );
5295 
5296  BLAZE_INTERNAL_ASSERT( nonzeros > capacity(), "Invalid capacity value" );
5297 
5298  return nonzeros;
5299 }
5301 //*************************************************************************************************
5302 
5303 
5304 
5305 
5306 //=================================================================================================
5307 //
5308 // INSERTION FUNCTIONS
5309 //
5310 //=================================================================================================
5311 
5312 //*************************************************************************************************
5324 template< typename MT // Type of the sparse matrix
5325  , size_t... CCAs > // Compile time column arguments
5326 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5327  Column<MT,false,false,true,CCAs...>::set( size_t index, const ElementType& value )
5328 {
5329  return matrix_.set( column(), index, value );
5330 }
5332 //*************************************************************************************************
5333 
5334 
5335 //*************************************************************************************************
5348 template< typename MT // Type of the sparse matrix
5349  , size_t... CCAs > // Compile time column arguments
5350 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5351  Column<MT,false,false,true,CCAs...>::insert( size_t index, const ElementType& value )
5352 {
5353  return matrix_.insert( column(), index, value );
5354 }
5356 //*************************************************************************************************
5357 
5358 
5359 //*************************************************************************************************
5384 template< typename MT // Type of the sparse matrix
5385  , size_t... CCAs > // Compile time column arguments
5386 inline void Column<MT,false,false,true,CCAs...>::append( size_t index, const ElementType& value, bool check )
5387 {
5388  matrix_.append( column(), index, value, check );
5389 }
5391 //*************************************************************************************************
5392 
5393 
5394 
5395 
5396 //=================================================================================================
5397 //
5398 // ERASE FUNCTIONS
5399 //
5400 //=================================================================================================
5401 
5402 //*************************************************************************************************
5411 template< typename MT // Type of the sparse matrix
5412  , size_t... CCAs > // Compile time column arguments
5413 inline void Column<MT,false,false,true,CCAs...>::erase( size_t index )
5414 {
5415  matrix_.erase( column(), index );
5416 }
5418 //*************************************************************************************************
5419 
5420 
5421 //*************************************************************************************************
5430 template< typename MT // Type of the sparse matrix
5431  , size_t... CCAs > // Compile time column arguments
5432 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5433  Column<MT,false,false,true,CCAs...>::erase( Iterator pos )
5434 {
5435  return matrix_.erase( column(), pos );
5436 }
5438 //*************************************************************************************************
5439 
5440 
5441 //*************************************************************************************************
5451 template< typename MT // Type of the sparse matrix
5452  , size_t... CCAs > // Compile time column arguments
5453 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5454  Column<MT,false,false,true,CCAs...>::erase( Iterator first, Iterator last )
5455 {
5456  return matrix_.erase( column(), first, last );
5457 }
5459 //*************************************************************************************************
5460 
5461 
5462 //*************************************************************************************************
5485 template< typename MT // Type of the sparse matrix
5486  , size_t... CCAs > // Compile time column arguments
5487 template< typename Pred // Type of the unary predicate
5488  , typename > // Type restriction on the unary predicate
5489 inline void Column<MT,false,false,true,CCAs...>::erase( Pred predicate )
5490 {
5491  matrix_.erase( column(), begin(), end(), predicate );
5492 }
5494 //*************************************************************************************************
5495 
5496 
5497 //*************************************************************************************************
5522 template< typename MT // Type of the sparse matrix
5523  , size_t... CCAs > // Compile time column arguments
5524 template< typename Pred > // Type of the unary predicate
5525 inline void Column<MT,false,false,true,CCAs...>::erase( Iterator first, Iterator last, Pred predicate )
5526 {
5527  matrix_.erase( column(), first, last, predicate );
5528 }
5530 //*************************************************************************************************
5531 
5532 
5533 
5534 
5535 //=================================================================================================
5536 //
5537 // LOOKUP FUNCTIONS
5538 //
5539 //=================================================================================================
5540 
5541 //*************************************************************************************************
5555 template< typename MT // Type of the sparse matrix
5556  , size_t... CCAs > // Compile time column arguments
5557 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5558  Column<MT,false,false,true,CCAs...>::find( size_t index )
5559 {
5560  return matrix_.find( column(), index );
5561 }
5563 //*************************************************************************************************
5564 
5565 
5566 //*************************************************************************************************
5580 template< typename MT // Type of the sparse matrix
5581  , size_t... CCAs > // Compile time column arguments
5582 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
5583  Column<MT,false,false,true,CCAs...>::find( size_t index ) const
5584 {
5585  return matrix_.find( column(), index );
5586 }
5588 //*************************************************************************************************
5589 
5590 
5591 //*************************************************************************************************
5604 template< typename MT // Type of the sparse matrix
5605  , size_t... CCAs > // Compile time column arguments
5606 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5607  Column<MT,false,false,true,CCAs...>::lowerBound( size_t index )
5608 {
5609  return matrix_.lowerBound( column(), index );
5610 }
5612 //*************************************************************************************************
5613 
5614 
5615 //*************************************************************************************************
5628 template< typename MT // Type of the sparse matrix
5629  , size_t... CCAs > // Compile time column arguments
5630 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
5631  Column<MT,false,false,true,CCAs...>::lowerBound( size_t index ) const
5632 {
5633  return matrix_.lowerBound( column(), index );
5634 }
5636 //*************************************************************************************************
5637 
5638 
5639 //*************************************************************************************************
5652 template< typename MT // Type of the sparse matrix
5653  , size_t... CCAs > // Compile time column arguments
5654 inline typename Column<MT,false,false,true,CCAs...>::Iterator
5655  Column<MT,false,false,true,CCAs...>::upperBound( size_t index )
5656 {
5657  return matrix_.upperBound( column(), index );
5658 }
5660 //*************************************************************************************************
5661 
5662 
5663 //*************************************************************************************************
5676 template< typename MT // Type of the sparse matrix
5677  , size_t... CCAs > // Compile time column arguments
5678 inline typename Column<MT,false,false,true,CCAs...>::ConstIterator
5679  Column<MT,false,false,true,CCAs...>::upperBound( size_t index ) const
5680 {
5681  return matrix_.upperBound( column(), index );
5682 }
5684 //*************************************************************************************************
5685 
5686 
5687 
5688 
5689 //=================================================================================================
5690 //
5691 // NUMERIC FUNCTIONS
5692 //
5693 //=================================================================================================
5694 
5695 //*************************************************************************************************
5708 template< typename MT // Type of the sparse matrix
5709  , size_t... CCAs > // Compile time column arguments
5710 template< typename Other > // Data type of the scalar value
5711 inline Column<MT,false,false,true,CCAs...>&
5712  Column<MT,false,false,true,CCAs...>::scale( const Other& scalar )
5713 {
5715 
5716  for( Iterator element=begin(); element!=end(); ++element )
5717  element->value() *= scalar;
5718  return *this;
5719 }
5721 //*************************************************************************************************
5722 
5723 
5724 
5725 
5726 //=================================================================================================
5727 //
5728 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
5729 //
5730 //=================================================================================================
5731 
5732 //*************************************************************************************************
5743 template< typename MT // Type of the sparse matrix
5744  , size_t... CCAs > // Compile time column arguments
5745 template< typename Other > // Data type of the foreign expression
5746 inline bool Column<MT,false,false,true,CCAs...>::canAlias( const Other* alias ) const noexcept
5747 {
5748  return matrix_.isAliased( alias );
5749 }
5751 //*************************************************************************************************
5752 
5753 
5754 //*************************************************************************************************
5765 template< typename MT // Type of the sparse matrix
5766  , size_t... CCAs > // Compile time column arguments
5767 template< typename Other > // Data type of the foreign expression
5768 inline bool Column<MT,false,false,true,CCAs...>::isAliased( const Other* alias ) const noexcept
5769 {
5770  return matrix_.isAliased( alias );
5771 }
5773 //*************************************************************************************************
5774 
5775 
5776 //*************************************************************************************************
5788 template< typename MT // Type of the sparse matrix
5789  , size_t... CCAs > // Compile time column arguments
5790 template< typename VT > // Type of the right-hand side dense vector
5791 inline void Column<MT,false,false,true,CCAs...>::assign( const DenseVector<VT,false>& rhs )
5792 {
5793  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5794  BLAZE_INTERNAL_ASSERT( nonZeros() == 0UL, "Invalid non-zero elements detected" );
5795 
5796  for( size_t i=0UL; i<size(); ++i )
5797  {
5798  if( matrix_.nonZeros( column() ) == matrix_.capacity( column() ) )
5799  matrix_.reserve( column(), extendCapacity() );
5800 
5801  matrix_.append( column(), i, (~rhs)[i], true );
5802  }
5803 }
5805 //*************************************************************************************************
5806 
5807 
5808 //*************************************************************************************************
5820 template< typename MT // Type of the sparse matrix
5821  , size_t... CCAs > // Compile time column arguments
5822 template< typename VT > // Type of the right-hand side sparse vector
5823 inline void Column<MT,false,false,true,CCAs...>::assign( const SparseVector<VT,false>& rhs )
5824 {
5825  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5826  BLAZE_INTERNAL_ASSERT( nonZeros() == 0UL, "Invalid non-zero elements detected" );
5827 
5828  for( ConstIterator_<VT> element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
5829  matrix_.append( column(), element->index(), element->value(), true );
5830  }
5831 }
5833 //*************************************************************************************************
5834 
5835 
5836 //*************************************************************************************************
5848 template< typename MT // Type of the sparse matrix
5849  , size_t... CCAs > // Compile time column arguments
5850 template< typename VT > // Type of the right-hand side dense vector
5851 inline void Column<MT,false,false,true,CCAs...>::addAssign( const DenseVector<VT,false>& rhs )
5852 {
5853  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
5854 
5858 
5859  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5860 
5861  const AddType tmp( serial( *this + (~rhs) ) );
5862  matrix_.reset( column() );
5863  assign( tmp );
5864 }
5866 //*************************************************************************************************
5867 
5868 
5869 //*************************************************************************************************
5881 template< typename MT // Type of the sparse matrix
5882  , size_t... CCAs > // Compile time column arguments
5883 template< typename VT > // Type of the right-hand side sparse vector
5884 inline void Column<MT,false,false,true,CCAs...>::addAssign( const SparseVector<VT,false>& rhs )
5885 {
5886  using AddType = AddTrait_< ResultType, ResultType_<VT> >;
5887 
5891 
5892  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5893 
5894  const AddType tmp( serial( *this + (~rhs) ) );
5895  matrix_.reset( column() );
5896  matrix_.reserve( column(), tmp.nonZeros() );
5897  assign( tmp );
5898 }
5900 //*************************************************************************************************
5901 
5902 
5903 //*************************************************************************************************
5915 template< typename MT // Type of the sparse matrix
5916  , size_t... CCAs > // Compile time column arguments
5917 template< typename VT > // Type of the right-hand side dense vector
5918 inline void Column<MT,false,false,true,CCAs...>::subAssign( const DenseVector<VT,false>& rhs )
5919 {
5920  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
5921 
5925 
5926  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5927 
5928  const SubType tmp( serial( *this - (~rhs) ) );
5929  matrix_.reset( column() );
5930  assign( tmp );
5931 }
5933 //*************************************************************************************************
5934 
5935 
5936 //*************************************************************************************************
5948 template< typename MT // Type of the sparse matrix
5949  , size_t... CCAs > // Compile time column arguments
5950 template< typename VT > // Type of the right-hand side sparse vector
5951 inline void Column<MT,false,false,true,CCAs...>::subAssign( const SparseVector<VT,false>& rhs )
5952 {
5953  using SubType = SubTrait_< ResultType, ResultType_<VT> >;
5954 
5958 
5959  BLAZE_INTERNAL_ASSERT( size() == (~rhs).size(), "Invalid vector sizes" );
5960 
5961  const SubType tmp( serial( *this - (~rhs) ) );
5962  matrix_.reset( column() );
5963  matrix_.reserve( column(), tmp.nonZeros() );
5964  assign( tmp );
5965 }
5967 //*************************************************************************************************
5968 
5969 } // namespace blaze
5970 
5971 #endif
#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:131
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
#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
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the SparseVector base class.
Header file for the View base class.
#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
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
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:588
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the IsIntegral type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
#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:3083
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
#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
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:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
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
Header file for the IsUniLower type trait.
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
BLAZE_ALWAYS_INLINE 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:474
BLAZE_ALWAYS_INLINE 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:408
Constraint on the data type.
Constraint on the transpose flag of vector types.
Constraint on the data type.
Headerfile for the generic max algorithm.
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:144
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#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:3079
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Header file for the IsLower type trait.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Header file for the SparseElement base class.
Constraint on the data type.
Constraint on the data type.
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE 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:430
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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Constraint on the data type.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
#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 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.
Header file for the relaxation flag types.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
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:131
Header file for the reset shim.
#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.
Constraint on the data type.
Constraint on the data type.
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
#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
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
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.
Header file for the implementation of the ColumnData class template.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
Header file for the IsRestricted type trait.
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Constraint on the data type.