DVecTSVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTSVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
56 #include <blaze/math/Intrinsics.h>
73 #include <blaze/util/Assert.h>
75 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/Exception.h>
78 #include <blaze/util/SelectType.h>
79 #include <blaze/util/Types.h>
82 #include <blaze/util/Unused.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS DVECTSVECMULTEXPR
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
100 template< typename VT1 // Type of the left-hand side dense vector
101  , typename VT2 > // Type of the right-hand side sparse vector
102 class DVecTSVecMultExpr : public SparseMatrix< DVecTSVecMultExpr<VT1,VT2>, false >
103  , private VecTVecMultExpr
104  , private Computation
105 {
106  private:
107  //**Type definitions****************************************************************************
108  typedef typename VT1::ResultType RT1;
109  typedef typename VT2::ResultType RT2;
110  typedef typename VT1::ReturnType RN1;
111  typedef typename VT2::ReturnType RN2;
112  typedef typename VT1::CompositeType CT1;
113  typedef typename VT2::CompositeType CT2;
114  typedef typename VT1::ElementType ET1;
115  typedef typename VT2::ElementType ET2;
116  //**********************************************************************************************
117 
118  //**Return type evaluation**********************************************************************
120 
125  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
126 
129  //**********************************************************************************************
130 
131  //**Evaluation strategy*************************************************************************
133 
140  enum { useAssign = ( IsComputation<VT1>::value || !IsNumeric<ET1>::value ||
142 
144  template< typename MT >
146  struct UseAssign {
147  enum { value = useAssign };
148  };
150  //**********************************************************************************************
151 
152  //**********************************************************************************************
154 
157  template< typename T1, typename T2, typename T3 >
158  struct UseVectorizedKernel {
159  enum { value = useOptimizedKernels &&
160  T1::vectorizable && T2::vectorizable &&
164  };
166  //**********************************************************************************************
167 
168  //**********************************************************************************************
170 
173  template< typename T1, typename T2, typename T3 >
174  struct UseDefaultKernel {
175  enum { value = !UseVectorizedKernel<T1,T2,T3>::value };
176  };
178  //**********************************************************************************************
179 
180  public:
181  //**Type definitions****************************************************************************
187 
190 
193 
195  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
196 
198  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
199 
201  typedef typename SelectType< IsComputation<VT1>::value, const RT1, CT1 >::Type LT;
202 
204  typedef typename SelectType< IsComputation<VT2>::value, const RT2, CT2 >::Type RT;
205  //**********************************************************************************************
206 
207  //**Compilation flags***************************************************************************
209  enum { smpAssignable = 0 };
210  //**********************************************************************************************
211 
212  //**ConstIterator class definition**************************************************************
216  {
217  public:
218  //**Type definitions*************************************************************************
221 
223  typedef ET1 LeftElement;
224 
227 
228  typedef std::forward_iterator_tag IteratorCategory;
229  typedef Element ValueType;
230  typedef ValueType* PointerType;
231  typedef ValueType& ReferenceType;
233 
234  // STL iterator requirements
235  typedef IteratorCategory iterator_category;
236  typedef ValueType value_type;
237  typedef PointerType pointer;
238  typedef ReferenceType reference;
239  typedef DifferenceType difference_type;
240  //*******************************************************************************************
241 
242  //**Constructor******************************************************************************
245  inline ConstIterator( LeftElement v, IteratorType it )
246  : v_ ( v ) // Element of the left-hand side dense vector expression.
247  , it_( it ) // Iterator over the elements of the right-hand side sparse vector expression
248  {}
249  //*******************************************************************************************
250 
251  //**Prefix increment operator****************************************************************
257  ++it_;
258  return *this;
259  }
260  //*******************************************************************************************
261 
262  //**Element access operator******************************************************************
267  inline const Element operator*() const {
268  return Element( v_ * it_->value(), it_->index() );
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline const ConstIterator* operator->() const {
278  return this;
279  }
280  //*******************************************************************************************
281 
282  //**Value function***************************************************************************
287  inline ReturnType value() const {
288  return v_ * it_->value();
289  }
290  //*******************************************************************************************
291 
292  //**Index function***************************************************************************
297  inline size_t index() const {
298  return it_->index();
299  }
300  //*******************************************************************************************
301 
302  //**Equality operator************************************************************************
308  inline bool operator==( const ConstIterator& rhs ) const {
309  return it_ == rhs.it_;
310  }
311  //*******************************************************************************************
312 
313  //**Inequality operator**********************************************************************
319  inline bool operator!=( const ConstIterator& rhs ) const {
320  return it_ != rhs.it_;
321  }
322  //*******************************************************************************************
323 
324  //**Subtraction operator*********************************************************************
330  inline DifferenceType operator-( const ConstIterator& rhs ) const {
331  return it_ - rhs.it_;
332  }
333  //*******************************************************************************************
334 
335  private:
336  //**Member variables*************************************************************************
337  LeftElement v_;
338  IteratorType it_;
339  //*******************************************************************************************
340  };
341  //**********************************************************************************************
342 
343  //**Constructor*********************************************************************************
349  explicit inline DVecTSVecMultExpr( const VT1& lhs, const VT2& rhs )
350  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
351  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
352  {}
353  //**********************************************************************************************
354 
355  //**Access operator*****************************************************************************
362  inline ReturnType operator()( size_t i, size_t j ) const {
363  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
364  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
365 
366  return lhs_[i] * rhs_[j];
367  }
368  //**********************************************************************************************
369 
370  //**At function*********************************************************************************
378  inline ReturnType at( size_t i, size_t j ) const {
379  if( i >= lhs_.size() ) {
380  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
381  }
382  if( j >= rhs_.size() ) {
383  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
384  }
385  return (*this)(i,j);
386  }
387  //**********************************************************************************************
388 
389  //**Begin function******************************************************************************
395  inline ConstIterator begin( size_t i ) const {
396  return ConstIterator( lhs_[i], rhs_.begin() );
397  }
398  //**********************************************************************************************
399 
400  //**End function********************************************************************************
406  inline ConstIterator end( size_t i ) const {
407  return ConstIterator( lhs_[i], rhs_.end() );
408  }
409  //**********************************************************************************************
410 
411  //**Rows function*******************************************************************************
416  inline size_t rows() const {
417  return lhs_.size();
418  }
419  //**********************************************************************************************
420 
421  //**Columns function****************************************************************************
426  inline size_t columns() const {
427  return rhs_.size();
428  }
429  //**********************************************************************************************
430 
431  //**NonZeros function***************************************************************************
436  inline size_t nonZeros() const {
437  return lhs_.size() * rhs_.nonZeros();
438  }
439  //**********************************************************************************************
440 
441  //**NonZeros function***************************************************************************
447  inline size_t nonZeros( size_t i ) const {
448  UNUSED_PARAMETER( i );
449  return rhs_.nonZeros();
450  }
451  //**********************************************************************************************
452 
453  //**Find function*******************************************************************************
460  inline ConstIterator find( size_t i, size_t j ) const {
462  return ConstIterator( lhs_[i], rhs_.find( j ) );
463  }
464  //**********************************************************************************************
465 
466  //**LowerBound function*************************************************************************
473  inline ConstIterator lowerBound( size_t i, size_t j ) const {
475  return ConstIterator( lhs_[i], rhs_.lowerBound( j ) );
476  }
477  //**********************************************************************************************
478 
479  //**UpperBound function*************************************************************************
486  inline ConstIterator upperBound( size_t i, size_t j ) const {
488  return ConstIterator( lhs_[i], rhs_.upperBound( j ) );
489  }
490  //**********************************************************************************************
491 
492  //**Left operand access*************************************************************************
497  inline LeftOperand leftOperand() const {
498  return lhs_;
499  }
500  //**********************************************************************************************
501 
502  //**Right operand access************************************************************************
507  inline RightOperand rightOperand() const {
508  return rhs_;
509  }
510  //**********************************************************************************************
511 
512  //**********************************************************************************************
518  template< typename T >
519  inline bool canAlias( const T* alias ) const {
520  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
521  }
522  //**********************************************************************************************
523 
524  //**********************************************************************************************
530  template< typename T >
531  inline bool isAliased( const T* alias ) const {
532  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
533  }
534  //**********************************************************************************************
535 
536  private:
537  //**Member variables****************************************************************************
538  LeftOperand lhs_;
539  RightOperand rhs_;
540  //**********************************************************************************************
541 
542  //**Assignment to row-major dense matrices******************************************************
557  template< typename MT > // Type of the target dense matrix
558  friend inline typename EnableIf< UseAssign<MT> >::Type
559  assign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
560  {
562 
563  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
564  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
565 
567 
568  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
569  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
570 
571  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
572  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
573  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
574  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
575 
576  const ConstIterator begin( y.begin() );
577  const ConstIterator end ( y.end() );
578 
579  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
580  for( ConstIterator element=begin; element!=end; ++element ) {
581  (~lhs)(i,element->index()) = x[i] * element->value();
582  }
583  }
584  }
586  //**********************************************************************************************
587 
588  //**Assignment to column-major dense matrices***************************************************
601  template< typename MT > // Type of the target dense matrix
602  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
603  {
605 
607 
608  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
609  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
610 
611  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
612  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
613 
614  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
615  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
616  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
617  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
618 
619  DVecTSVecMultExpr::selectAssignKernel( ~lhs, x, y );
620  }
622  //**********************************************************************************************
623 
624  //**Default assignment to column-major dense matrices*******************************************
638  template< typename MT // Type of the left-hand side target matrix
639  , typename VT3 // Type of the left-hand side vector operand
640  , typename VT4 > // Type of the right-hand side vector operand
641  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
642  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
643  {
645 
646  const ConstIterator begin( y.begin() );
647  const ConstIterator end ( y.end() );
648 
649  for( ConstIterator element=begin; element!=end; ++element ) {
650  for( size_t i=0UL; i<(~A).rows(); ++i ) {
651  (~A)(i,element->index()) = x[i] * element->value();
652  }
653  }
654  }
656  //**********************************************************************************************
657 
658  //**Vectorized assignment to column-major dense matrices****************************************
672  template< typename MT // Type of the left-hand side target matrix
673  , typename VT3 // Type of the left-hand side vector operand
674  , typename VT4 > // Type of the right-hand side vector operand
675  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
676  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
677  {
679 
680  typedef IntrinsicTrait<ElementType> IT;
681  typedef typename IT::Type IntrinsicType;
682 
683  const size_t M( (~A).rows() );
684 
685  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
686 
687  const size_t ipos( remainder ? ( M & size_t(-IT::size) ) : M );
688  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % IT::size ) ) == ipos, "Invalid end calculation" );
689 
690  const ConstIterator begin( y.begin() );
691  const ConstIterator end ( y.end() );
692 
693  for( ConstIterator element=begin; element!=end; ++element )
694  {
695  const IntrinsicType y1( set( element->value() ) );
696 
697  size_t i( 0UL );
698 
699  for( ; i<ipos; i+=IT::size ) {
700  (~A).store( i, element->index(), x.load(i) * y1 );
701  }
702  for( ; remainder && i<M; ++i ) {
703  (~A)(i,element->index()) = x[i] * element->value();
704  }
705  }
706  }
708  //**********************************************************************************************
709 
710  //**Assignment to row-major sparse matrices*****************************************************
725  template< typename MT > // Type of the target sparse matrix
726  friend inline typename EnableIf< UseAssign<MT> >::Type
727  assign( SparseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
728  {
730 
731  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
732  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
733  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
734 
736 
737  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
738  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
739 
740  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
741  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
742  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
743  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
744 
745  const ConstIterator begin( y.begin() );
746  const ConstIterator end ( y.end() );
747 
748  if( begin == end )
749  return;
750 
751  for( size_t i=0UL; i<x.size(); ++i ) {
752  if( !isDefault( x[i] ) ) {
753  for( ConstIterator element=begin; element!=end; ++element ) {
754  (~lhs).append( i, element->index(), x[i] * element->value() );
755  }
756  }
757  (~lhs).finalize( i );
758  }
759  }
761  //**********************************************************************************************
762 
763  //**Assignment to column-major sparse matrices*****************************************************
776  template< typename MT > // Type of the target sparse matrix
777  friend inline void assign( SparseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
778  {
780 
782 
783  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
784  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
785 
787 
788  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
789  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
790 
791  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
792  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
793  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
794  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
795 
796  const ConstIterator begin( y.begin() );
797  const ConstIterator end ( y.end() );
798 
799  if( begin == end )
800  return;
801 
802  (~lhs).reserve( begin->index(), rhs.nonZeros() );
803 
804  size_t index( 0UL );
805 
806  for( ConstIterator element=begin; element!=end; ++element ) {
807  if( !isDefault( element->value() ) ) {
808  for( ; index < element->index(); ++index ) {
809  (~lhs).finalize( index );
810  }
811  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
812  (~lhs).append( i, element->index(), x[i] * element->value() );
813  }
814  (~lhs).finalize( index++ );
815  }
816  }
817 
818  for( ; index < y.size(); ++index ) {
819  (~lhs).finalize( index );
820  }
821  }
823  //**********************************************************************************************
824 
825  //**Addition assignment to row-major dense matrices*********************************************
841  template< typename MT > // Type of the target dense matrix
842  friend inline typename EnableIf< UseAssign<MT> >::Type
843  addAssign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
844  {
846 
847  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
848  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
849 
851 
852  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
853  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
854 
855  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
856  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
857  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
858  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
859 
860  const ConstIterator begin( y.begin() );
861  const ConstIterator end ( y.end() );
862 
863  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
864  for( ConstIterator element=begin; element!=end; ++element ) {
865  (~lhs)(i,element->index()) += x[i] * element->value();
866  }
867  }
868  }
870  //**********************************************************************************************
871 
872  //**Addition assignment to column-major dense matrices******************************************
885  template< typename MT > // Type of the target dense matrix
886  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
887  {
889 
891 
892  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
893  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
894 
895  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
896  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
897 
898  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
899  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
900  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
901  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
902 
903  DVecTSVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
904  }
906  //**********************************************************************************************
907 
908  //**Default addition assignment to column dense matrices****************************************
922  template< typename MT // Type of the left-hand side target matrix
923  , typename VT3 // Type of the left-hand side vector operand
924  , typename VT4 > // Type of the right-hand side vector operand
925  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
926  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
927  {
929 
930  const ConstIterator begin( y.begin() );
931  const ConstIterator end ( y.end() );
932 
933  for( ConstIterator element=begin; element!=end; ++element ) {
934  for( size_t i=0UL; i<(~A).rows(); ++i ) {
935  (~A)(i,element->index()) += x[i] * element->value();
936  }
937  }
938  }
940  //**********************************************************************************************
941 
942  //**Vectorized addition assignment to column-major dense matrices*******************************
956  template< typename MT // Type of the left-hand side target matrix
957  , typename VT3 // Type of the left-hand side vector operand
958  , typename VT4 > // Type of the right-hand side vector operand
959  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
960  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
961  {
963 
964  typedef IntrinsicTrait<ElementType> IT;
965  typedef typename IT::Type IntrinsicType;
966 
967  const size_t M( (~A).rows() );
968 
969  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
970 
971  const size_t ipos( remainder ? ( M & size_t(-IT::size) ) : M );
972  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % IT::size ) ) == ipos, "Invalid end calculation" );
973 
974  const ConstIterator begin( y.begin() );
975  const ConstIterator end ( y.end() );
976 
977  for( ConstIterator element=begin; element!=end; ++element )
978  {
979  const IntrinsicType y1( set( element->value() ) );
980 
981  size_t i( 0UL );
982 
983  for( ; i<ipos; i+=IT::size ) {
984  (~A).store( i, element->index(), (~A).load(i,element->index()) + x.load(i) * y1 );
985  }
986  for( ; remainder && i<M; ++i ) {
987  (~A)(i,element->index()) += x[i] * element->value();
988  }
989  }
990  }
992  //**********************************************************************************************
993 
994  //**Addition assignment to sparse matrices******************************************************
995  // No special implementation for the addition assignment to sparse matrices.
996  //**********************************************************************************************
997 
998  //**Subtraction assignment to row-major dense matrices******************************************
1014  template< typename MT > // Type of the target dense matrix
1015  friend inline typename EnableIf< UseAssign<MT> >::Type
1016  subAssign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
1017  {
1019 
1020  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1021  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1022 
1024 
1025  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1026  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1027 
1028  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1029  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1030  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1031  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1032 
1033  const ConstIterator begin( y.begin() );
1034  const ConstIterator end ( y.end() );
1035 
1036  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
1037  for( ConstIterator element=begin; element!=end; ++element ) {
1038  (~lhs)(i,element->index()) -= x[i] * element->value();
1039  }
1040  }
1041  }
1043  //**********************************************************************************************
1044 
1045  //**Subtraction assignment to column-major dense matrices***************************************
1058  template< typename MT > // Type of the target dense matrix
1059  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
1060  {
1062 
1064 
1065  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1066  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1067 
1068  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1069  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1070 
1071  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1072  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1073  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1074  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1075 
1076  DVecTSVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1077  }
1079  //**********************************************************************************************
1080 
1081  //**Default subtraction assignment to column dense matrices*************************************
1095  template< typename MT // Type of the left-hand side target matrix
1096  , typename VT3 // Type of the left-hand side vector operand
1097  , typename VT4 > // Type of the right-hand side vector operand
1098  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1099  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1100  {
1102 
1103  const ConstIterator begin( y.begin() );
1104  const ConstIterator end ( y.end() );
1105 
1106  for( ConstIterator element=begin; element!=end; ++element ) {
1107  for( size_t i=0UL; i<(~A).rows(); ++i ) {
1108  (~A)(i,element->index()) -= x[i] * element->value();
1109  }
1110  }
1111  }
1113  //**********************************************************************************************
1114 
1115  //**Vectorized subtraction assignment to column-major dense matrices****************************
1129  template< typename MT // Type of the left-hand side target matrix
1130  , typename VT3 // Type of the left-hand side vector operand
1131  , typename VT4 > // Type of the right-hand side vector operand
1132  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1133  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1134  {
1136 
1137  typedef IntrinsicTrait<ElementType> IT;
1138  typedef typename IT::Type IntrinsicType;
1139 
1140  const size_t M( (~A).rows() );
1141 
1142  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1143 
1144  const size_t ipos( remainder ? ( M & size_t(-IT::size) ) : M );
1145  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % IT::size ) ) == ipos, "Invalid end calculation" );
1146 
1147  const ConstIterator begin( y.begin() );
1148  const ConstIterator end ( y.end() );
1149 
1150  for( ConstIterator element=begin; element!=end; ++element )
1151  {
1152  const IntrinsicType y1( set( element->value() ) );
1153 
1154  size_t i( 0UL );
1155 
1156  for( ; i<ipos; i+=IT::size ) {
1157  (~A).store( i, element->index(), (~A).load(i,element->index()) - x.load(i) * y1 );
1158  }
1159  for( ; remainder && i<M; ++i ) {
1160  (~A)(i,element->index()) -= x[i] * element->value();
1161  }
1162  }
1163  }
1165  //**********************************************************************************************
1166 
1167  //**Subtraction assignment to sparse matrices***************************************************
1168  // No special implementation for the subtraction assignment to sparse matrices.
1169  //**********************************************************************************************
1170 
1171  //**Multiplication assignment to dense matrices*************************************************
1172  // No special implementation for the multiplication assignment to dense matrices.
1173  //**********************************************************************************************
1174 
1175  //**Multiplication assignment to sparse matrices************************************************
1176  // No special implementation for the multiplication assignment to sparse matrices.
1177  //**********************************************************************************************
1178 
1179  //**Compile time checks*************************************************************************
1187  //**********************************************************************************************
1188 };
1189 //*************************************************************************************************
1190 
1191 
1192 
1193 
1194 //=================================================================================================
1195 //
1196 // GLOBAL BINARY ARITHMETIC OPERATORS
1197 //
1198 //=================================================================================================
1199 
1200 //*************************************************************************************************
1229 template< typename T1 // Type of the left-hand side dense vector
1230  , typename T2 > // Type of the right-hand side sparse vector
1231 inline const DVecTSVecMultExpr<T1,T2>
1233 {
1235 
1236  return DVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
1237 }
1238 //*************************************************************************************************
1239 
1240 
1241 
1242 
1243 //=================================================================================================
1244 //
1245 // ROWS SPECIALIZATIONS
1246 //
1247 //=================================================================================================
1248 
1249 //*************************************************************************************************
1251 template< typename VT1, typename VT2 >
1252 struct Rows< DVecTSVecMultExpr<VT1,VT2> > : public Size<VT1>
1253 {};
1255 //*************************************************************************************************
1256 
1257 
1258 
1259 
1260 //=================================================================================================
1261 //
1262 // COLUMNS SPECIALIZATIONS
1263 //
1264 //=================================================================================================
1265 
1266 //*************************************************************************************************
1268 template< typename VT1, typename VT2 >
1269 struct Columns< DVecTSVecMultExpr<VT1,VT2> > : public Size<VT2>
1270 {};
1272 //*************************************************************************************************
1273 
1274 
1275 
1276 
1277 //=================================================================================================
1278 //
1279 // EXPRESSION TRAIT SPECIALIZATIONS
1280 //
1281 //=================================================================================================
1282 
1283 //*************************************************************************************************
1285 template< typename VT1, typename VT2, bool AF >
1286 struct SubmatrixExprTrait< DVecTSVecMultExpr<VT1,VT2>, AF >
1287 {
1288  public:
1289  //**********************************************************************************************
1290  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1291  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1292  //**********************************************************************************************
1293 };
1295 //*************************************************************************************************
1296 
1297 
1298 //*************************************************************************************************
1300 template< typename VT1, typename VT2 >
1301 struct RowExprTrait< DVecTSVecMultExpr<VT1,VT2> >
1302 {
1303  public:
1304  //**********************************************************************************************
1305  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
1306  //**********************************************************************************************
1307 };
1309 //*************************************************************************************************
1310 
1311 
1312 //*************************************************************************************************
1314 template< typename VT1, typename VT2 >
1315 struct ColumnExprTrait< DVecTSVecMultExpr<VT1,VT2> >
1316 {
1317  public:
1318  //**********************************************************************************************
1319  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
1320  //**********************************************************************************************
1321 };
1323 //*************************************************************************************************
1324 
1325 } // namespace blaze
1326 
1327 #endif
ValueType * PointerType
Pointer return type.
Definition: DVecTSVecMultExpr.h:230
Pointer difference type of the Blaze library.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:110
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
PointerType pointer
Pointer return type.
Definition: DVecTSVecMultExpr.h:237
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
VT2::ElementType ET2
Element type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:115
Header file for the Rows type trait.
ValueType & ReferenceType
Reference return type.
Definition: DVecTSVecMultExpr.h:231
Header file for the UNUSED_PARAMETER function template.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecTSVecMultExpr.h:531
Header file for basic type definitions.
SelectType< IsComputation< VT1 >::value, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:201
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTSVecMultExpr.h:232
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DVecTSVecMultExpr.h:416
#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:79
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: DVecTSVecMultExpr.h:473
Header file for the ColumnExprTrait class template.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTSVecMultExpr.h:319
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecTSVecMultExpr.h:277
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:114
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:340
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
IteratorType it_
Iterator over the elements of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:338
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
size_t index() const
Access to the current index of the sparse element.
Definition: DVecTSVecMultExpr.h:297
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTSVecMultExpr.h:228
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:198
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecTSVecMultExpr.h:362
System settings for performance optimizations.
Element ValueType
Type of the underlying pointers.
Definition: DVecTSVecMultExpr.h:229
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecTSVecMultExpr.h:267
DVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecTSVecMultExpr class.
Definition: DVecTSVecMultExpr.h:349
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecTSVecMultExpr.h:128
Header file for the SparseMatrix base class.
Constraint on the transpose flag of vector types.
Constraint on the data type.
Header file for the MultExprTrait class template.
ValueType value_type
Type of the underlying pointers.
Definition: DVecTSVecMultExpr.h:236
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecTSVecMultExpr.h:395
Header file for the ValueIndexPair class.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTSVecMultExpr.h:256
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECTVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecTVecMultExpr.h:161
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecTSVecMultExpr.h:538
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecTSVecMultExpr.h:186
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the Columns type trait.
Expression object for dense vector-sparse vector outer products.The DVecTSVecMultExpr class represent...
Definition: DVecTSVecMultExpr.h:102
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecTSVecMultExpr.h:519
ConstIterator(LeftElement v, IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecTSVecMultExpr.h:245
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTSVecMultExpr.h:308
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
IteratorCategory iterator_category
The iterator category.
Definition: DVecTSVecMultExpr.h:235
#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:79
Constraint on the data type.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecTSVecMultExpr.h:239
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the VecTVecMultExpr base class.
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:112
Header file for the EnableIf class template.
Header file for the serial shim.
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: DVecTSVecMultExpr.h:460
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: DVecTSVecMultExpr.h:507
Header file for the IsNumeric type trait.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:497
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecTSVecMultExpr.h:406
Iterator over the elements of the dense vector-sparse vector outer product expression.
Definition: DVecTSVecMultExpr.h:215
#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:116
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:108
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DVecTSVecMultExpr.h:426
Header file for run time assertion macros.
Base template for the MultTrait class.
Definition: MultTrait.h:138
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: DVecTSVecMultExpr.h:539
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:185
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
DVecTSVecMultExpr< VT1, VT2 > This
Type of this DVecTSVecMultExpr instance.
Definition: DVecTSVecMultExpr.h:182
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: DVecTSVecMultExpr.h:220
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: DVecTSVecMultExpr.h:447
Header file for the isDefault shim.
ReferenceType reference
Reference return type.
Definition: DVecTSVecMultExpr.h:238
Constraint on the data type.
ReturnType value() const
Access to the current value of the sparse element.
Definition: DVecTSVecMultExpr.h:287
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DVecTSVecMultExpr.h:378
#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:118
Constraint on the data type.
Header file for the RemoveReference type trait.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecTSVecMultExpr.h:184
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:66
ET1 LeftElement
Element type of the dense vector expression.
Definition: DVecTSVecMultExpr.h:223
Header file for all intrinsic functionality.
#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:79
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:111
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:183
Header file for the IsComputation type trait class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:189
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
LeftElement v_
Element of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:337
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: DVecTSVecMultExpr.h:330
SelectType< useAssign, const ResultType, const DVecTSVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecTSVecMultExpr.h:192
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: RowVector.h:79
RemoveReference< RightOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: DVecTSVecMultExpr.h:226
Header file for the SubvectorExprTrait class template.
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:113
Header file for exception macros.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: DVecTSVecMultExpr.h:436
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:195
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:109
Header file for the Size type trait.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#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
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: DVecTSVecMultExpr.h:486
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
SelectType< IsComputation< VT2 >::value, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:204