All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SMatEvalExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATEVALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATEVALEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/InvalidType.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS SMATEVALEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename MT // Type of the sparse matrix
90  , bool SO > // Storage order
91 class SMatEvalExpr : public SparseMatrix< SMatEvalExpr<MT,SO>, SO >
92  , private MatEvalExpr
93  , private Computation
94 {
95  public:
96  //**Type definitions****************************************************************************
98  typedef typename MT::ResultType ResultType;
99  typedef typename MT::OppositeType OppositeType;
100  typedef typename MT::TransposeType TransposeType;
101  typedef typename MT::ElementType ElementType;
102  typedef typename MT::ReturnType ReturnType;
103 
105  typedef const ResultType CompositeType;
106 
108  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
109  //**********************************************************************************************
110 
111  //**Compilation flags***************************************************************************
113  enum { smpAssignable = MT::smpAssignable };
114  //**********************************************************************************************
115 
116  //**Constructor*********************************************************************************
121  explicit inline SMatEvalExpr( const MT& sm )
122  : sm_( sm ) // Sparse matrix of the evaluation expression
123  {}
124  //**********************************************************************************************
125 
126  //**Access operator*****************************************************************************
133  inline ReturnType operator()( size_t i, size_t j ) const {
134  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
135  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
136  return sm_(i,j);
137  }
138  //**********************************************************************************************
139 
140  //**Rows function*******************************************************************************
145  inline size_t rows() const {
146  return sm_.rows();
147  }
148  //**********************************************************************************************
149 
150  //**Columns function****************************************************************************
155  inline size_t columns() const {
156  return sm_.columns();
157  }
158  //**********************************************************************************************
159 
160  //**NonZeros function***************************************************************************
165  inline size_t nonZeros() const {
166  return sm_.nonZeros();
167  }
168  //**********************************************************************************************
169 
170  //**NonZeros function***************************************************************************
176  inline size_t nonZeros( size_t i ) const {
177  return sm_.nonZeros(i);
178  }
179  //**********************************************************************************************
180 
181  //**Operand access******************************************************************************
186  inline Operand operand() const {
187  return sm_;
188  }
189  //**********************************************************************************************
190 
191  //**********************************************************************************************
197  template< typename T >
198  inline bool canAlias( const T* alias ) const {
199  return sm_.canAlias( alias );
200  }
201  //**********************************************************************************************
202 
203  //**********************************************************************************************
209  template< typename T >
210  inline bool isAliased( const T* alias ) const {
211  return sm_.isAliased( alias );
212  }
213  //**********************************************************************************************
214 
215  //**********************************************************************************************
220  inline bool canSMPAssign() const {
221  return sm_.canSMPAssign();
222  }
223  //**********************************************************************************************
224 
225  private:
226  //**Member variables****************************************************************************
228  //**********************************************************************************************
229 
230  //**Assignment to dense matrices****************************************************************
242  template< typename MT2 // Type of the target dense matrix
243  , bool SO2 > // Storage order of the target dense matrix
244  friend inline void assign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
245  {
247 
248  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
249  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
250 
251  assign( ~lhs, rhs.sm_ );
252  }
254  //**********************************************************************************************
255 
256  //**Assignment to sparse matrices***************************************************************
268  template< typename MT2 // Type of the target sparse matrix
269  , bool SO2 > // Storage order of the target sparse matrix
270  friend inline void assign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
271  {
273 
274  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
275  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
276 
277  assign( ~lhs, rhs.sm_ );
278  }
280  //**********************************************************************************************
281 
282  //**Addition assignment to dense matrices*******************************************************
294  template< typename MT2 // Type of the target dense matrix
295  , bool SO2 > // Storage order of the target dense matrix
296  friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
297  {
299 
300  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
301  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
302 
303  addAssign( ~lhs, rhs.sm_ );
304  }
306  //**********************************************************************************************
307 
308  //**Addition assignment to sparse matrices******************************************************
320  template< typename MT2 // Type of the target sparse matrix
321  , bool SO2 > // Storage order of the target sparse matrix
322  friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
323  {
325 
326  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
327  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
328 
329  addAssign( ~lhs, rhs.sm_ );
330  }
332  //**********************************************************************************************
333 
334  //**Subtraction assignment to dense matrices****************************************************
346  template< typename MT2 // Type of the target dense matrix
347  , bool SO2 > // Storage order of the target dense matrix
348  friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
349  {
351 
352  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
353  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
354 
355  subAssign( ~lhs, rhs.sm_ );
356  }
358  //**********************************************************************************************
359 
360  //**Subtraction assignment to sparse matrices***************************************************
372  template< typename MT2 // Type of the target sparse matrix
373  , bool SO2 > // Storage order of the target sparse matrix
374  friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
375  {
377 
378  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
379  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
380 
381  subAssign( ~lhs, rhs.sm_ );
382  }
384  //**********************************************************************************************
385 
386  //**Multiplication assignment to dense matrices*************************************************
398  template< typename MT2 // Type of the target dense matrix
399  , bool SO2 > // Storage order of the target dense matrix
400  friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
401  {
403 
404  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
405  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
406 
407  multAssign( ~lhs, rhs.sm_ );
408  }
410  //**********************************************************************************************
411 
412  //**Multiplication assignment to sparse matrices************************************************
424  template< typename MT2 // Type of the target sparse matrix
425  , bool SO2 > // Storage order of the target sparse matrix
426  friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
427  {
429 
430  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
431  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
432 
433  multAssign( ~lhs, rhs.sm_ );
434  }
436  //**********************************************************************************************
437 
438  //**SMP assignment to dense matrices************************************************************
450  template< typename MT2 // Type of the target dense matrix
451  , bool SO2 > // Storage order of the target dense matrix
452  friend inline void smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
453  {
455 
456  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
457  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
458 
459  smpAssign( ~lhs, rhs.sm_ );
460  }
462  //**********************************************************************************************
463 
464  //**SMP assignment to sparse matrices***********************************************************
476  template< typename MT2 // Type of the target sparse matrix
477  , bool SO2 > // Storage order of the target sparse matrix
478  friend inline void smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
479  {
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
483  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
484 
485  smpAssign( ~lhs, rhs.sm_ );
486  }
488  //**********************************************************************************************
489 
490  //**SMP addition assignment to dense matrices***************************************************
502  template< typename MT2 // Type of the target dense matrix
503  , bool SO2 > // Storage order of the target dense matrix
504  friend inline void smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
505  {
507 
508  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
509  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
510 
511  smpAddAssign( ~lhs, rhs.sm_ );
512  }
514  //**********************************************************************************************
515 
516  //**SMP addition assignment to sparse matrices**************************************************
528  template< typename MT2 // Type of the target sparse matrix
529  , bool SO2 > // Storage order of the target sparse matrix
530  friend inline void smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
531  {
533 
534  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
535  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
536 
537  smpAddAssign( ~lhs, rhs.sm_ );
538  }
540  //**********************************************************************************************
541 
542  //**SMP subtraction assignment to dense matrices************************************************
554  template< typename MT2 // Type of the target dense matrix
555  , bool SO2 > // Storage order of the target dense matrix
556  friend inline void smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
557  {
559 
560  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
561  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
562 
563  smpSubAssign( ~lhs, rhs.sm_ );
564  }
566  //**********************************************************************************************
567 
568  //**SMP subtraction assignment to sparse matrices***********************************************
580  template< typename MT2 // Type of the target sparse matrix
581  , bool SO2 > // Storage order of the target sparse matrix
582  friend inline void smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
583  {
585 
586  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
587  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
588 
589  smpSubAssign( ~lhs, rhs.sm_ );
590  }
592  //**********************************************************************************************
593 
594  //**SMP multiplication assignment to dense matrices*********************************************
607  template< typename MT2 // Type of the target dense matrix
608  , bool SO2 > // Storage order of the target dense matrix
609  friend inline void smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
610  {
612 
613  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
614  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
615 
616  smpMultAssign( ~lhs, rhs.sm_ );
617  }
619  //**********************************************************************************************
620 
621  //**SMP multiplication assignment to sparse matrices********************************************
634  template< typename MT2 // Type of the target sparse matrix
635  , bool SO2 > // Storage order of the target sparse matrix
636  friend inline void smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatEvalExpr& rhs )
637  {
639 
640  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
641  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
642 
643  smpMultAssign( ~lhs, rhs.sm_ );
644  }
646  //**********************************************************************************************
647 
648  //**Compile time checks*************************************************************************
653  //**********************************************************************************************
654 };
655 //*************************************************************************************************
656 
657 
658 
659 
660 //=================================================================================================
661 //
662 // GLOBAL FUNCTIONS
663 //
664 //=================================================================================================
665 
666 //*************************************************************************************************
683 template< typename MT // Type of the sparse matrix
684  , bool SO > // Storage order
686 {
688 
689  return SMatEvalExpr<MT,SO>( ~sm );
690 }
691 //*************************************************************************************************
692 
693 
694 
695 
696 //=================================================================================================
697 //
698 // GLOBAL RESTRUCTURING FUNCTIONS
699 //
700 //=================================================================================================
701 
702 //*************************************************************************************************
713 template< typename MT // Type of the sparse matrix
714  , bool SO > // Storage order
715 inline const SMatEvalExpr<MT,SO> eval( const SMatEvalExpr<MT,SO>& sm )
716 {
717  return sm;
718 }
720 //*************************************************************************************************
721 
722 
723 
724 
725 //=================================================================================================
726 //
727 // ROWS SPECIALIZATIONS
728 //
729 //=================================================================================================
730 
731 //*************************************************************************************************
733 template< typename MT, bool SO >
734 struct Rows< SMatEvalExpr<MT,SO> > : public Rows<MT>
735 {};
737 //*************************************************************************************************
738 
739 
740 
741 
742 //=================================================================================================
743 //
744 // COLUMNS SPECIALIZATIONS
745 //
746 //=================================================================================================
747 
748 //*************************************************************************************************
750 template< typename MT, bool SO >
751 struct Columns< SMatEvalExpr<MT,SO> > : public Columns<MT>
752 {};
754 //*************************************************************************************************
755 
756 
757 
758 
759 //=================================================================================================
760 //
761 // ISSYMMETRIC SPECIALIZATIONS
762 //
763 //=================================================================================================
764 
765 //*************************************************************************************************
767 template< typename MT, bool SO >
768 struct IsSymmetric< SMatEvalExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
769 {};
771 //*************************************************************************************************
772 
773 
774 
775 
776 //=================================================================================================
777 //
778 // ISLOWER SPECIALIZATIONS
779 //
780 //=================================================================================================
781 
782 //*************************************************************************************************
784 template< typename MT, bool SO >
785 struct IsLower< SMatEvalExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
786 {};
788 //*************************************************************************************************
789 
790 
791 
792 
793 //=================================================================================================
794 //
795 // ISUPPER SPECIALIZATIONS
796 //
797 //=================================================================================================
798 
799 //*************************************************************************************************
801 template< typename MT, bool SO >
802 struct IsUpper< SMatEvalExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
803 {};
805 //*************************************************************************************************
806 
807 
808 
809 
810 //=================================================================================================
811 //
812 // EXPRESSION TRAIT SPECIALIZATIONS
813 //
814 //=================================================================================================
815 
816 //*************************************************************************************************
818 template< typename MT >
819 struct SMatEvalExprTrait< SMatEvalExpr<MT,false> >
820 {
821  public:
822  //**********************************************************************************************
823  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
824  , SMatEvalExpr<MT,false>
825  , INVALID_TYPE >::Type Type;
826  //**********************************************************************************************
827 };
829 //*************************************************************************************************
830 
831 
832 //*************************************************************************************************
834 template< typename MT >
835 struct TSMatEvalExprTrait< SMatEvalExpr<MT,true> >
836 {
837  public:
838  //**********************************************************************************************
839  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
840  , SMatEvalExpr<MT,true>
841  , INVALID_TYPE >::Type Type;
842  //**********************************************************************************************
843 };
845 //*************************************************************************************************
846 
847 
848 //*************************************************************************************************
850 template< typename MT, bool SO, bool AF >
851 struct SubmatrixExprTrait< SMatEvalExpr<MT,SO>, AF >
852 {
853  public:
854  //**********************************************************************************************
855  typedef typename EvalExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
856  //**********************************************************************************************
857 };
859 //*************************************************************************************************
860 
861 
862 //*************************************************************************************************
864 template< typename MT, bool SO >
865 struct RowExprTrait< SMatEvalExpr<MT,SO> >
866 {
867  public:
868  //**********************************************************************************************
869  typedef typename EvalExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
870  //**********************************************************************************************
871 };
873 //*************************************************************************************************
874 
875 
876 //*************************************************************************************************
878 template< typename MT, bool SO >
879 struct ColumnExprTrait< SMatEvalExpr<MT,SO> >
880 {
881  public:
882  //**********************************************************************************************
883  typedef typename EvalExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
884  //**********************************************************************************************
885 };
887 //*************************************************************************************************
888 
889 } // namespace blaze
890 
891 #endif
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatEvalExpr.h:99
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
Header file for the Rows type trait.
SMatEvalExpr< MT, SO > This
Type of this SMatEvalExpr instance.
Definition: SMatEvalExpr.h:97
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatEvalExpr.h:155
Header file for the IsSparseMatrix type trait.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:242
Header file for the ColumnExprTrait class template.
Header file for the TSMatEvalExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatEvalExpr.h:186
Header file for the MatEvalExpr base class.
MT::ElementType ElementType
Resulting element type.
Definition: SMatEvalExpr.h:101
Header file for the Computation base class.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2474
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:107
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatEvalExpr.h:108
Constraint on the data type.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatEvalExpr.h:105
Header file for the SparseMatrix base class.
Constraint on the data type.
Operand sm_
Sparse matrix of the evaluation expression.
Definition: SMatEvalExpr.h:227
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatEvalExpr.h:220
Header file for the SMatEvalExprTrait class template.
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 IsSymmetric type trait.
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
Header file for the IsLower type trait.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatEvalExpr.h:176
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: SMatEvalExpr.h:98
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatEvalExpr.h:210
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatEvalExpr.h:198
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
SMatEvalExpr(const MT &sm)
Constructor for the SMatEvalExpr class.
Definition: SMatEvalExpr.h:121
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the EvalExprTrait class template.
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:677
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatEvalExpr.h:165
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatEvalExpr.h:133
Header file for the IsRowMajorMatrix type trait.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#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
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SMatEvalExpr.h:102
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for the IsTrue value trait.
Header file for basic type definitions.
Expression object for the forced evaluation of sparse matrices.The SMatEvalExpr class represents the ...
Definition: Forward.h:92
Header file for the IsUpper type trait.
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatEvalExpr.h:100
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatEvalExpr.h:145
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
#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:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849