SVecSVecSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
48 #include <blaze/math/Exception.h>
63 #include <blaze/util/Assert.h>
64 #include <blaze/util/DisableIf.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/mpl/If.h>
68 #include <blaze/util/mpl/Maximum.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS SVECSVECSUBEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT1 // Type of the left-hand side sparse vector
89  , typename VT2 // Type of the right-hand side sparse vector
90  , bool TF > // Transpose flag
91 class SVecSVecSubExpr
92  : public VecVecSubExpr< SparseVector< SVecSVecSubExpr<VT1,VT2,TF>, TF > >
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
103  //**********************************************************************************************
104 
105  //**Return type evaluation**********************************************************************
107 
112  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
113 
116  //**********************************************************************************************
117 
118  //**Parallel evaluation strategy****************************************************************
120 
125  template< typename VT >
126  struct UseSMPAssign {
127  enum : bool { value = VT::smpAssignable };
128  };
130  //**********************************************************************************************
131 
132  public:
133  //**Type definitions****************************************************************************
138 
141 
143  using CompositeType = const ResultType;
144 
146  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
147 
149  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
150  //**********************************************************************************************
151 
152  //**Compilation flags***************************************************************************
154  enum : bool { smpAssignable = false };
155  //**********************************************************************************************
156 
157  //**Constructor*********************************************************************************
160  explicit inline SVecSVecSubExpr( const VT1& lhs, const VT2& rhs ) noexcept
161  : lhs_( lhs ) // Left-hand side sparse vector of the subtraction expression
162  , rhs_( rhs ) // Right-hand side sparse vector of the subtraction expression
163  {
164  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
165  }
166  //**********************************************************************************************
167 
168  //**Subscript operator**************************************************************************
174  inline ReturnType operator[]( size_t index ) const {
175  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
176  return lhs_[index] - rhs_[index];
177  }
178  //**********************************************************************************************
179 
180  //**At function*********************************************************************************
187  inline ReturnType at( size_t index ) const {
188  if( index >= lhs_.size() ) {
189  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
190  }
191  return (*this)[index];
192  }
193  //**********************************************************************************************
194 
195  //**Size function*******************************************************************************
200  inline size_t size() const noexcept {
201  return lhs_.size();
202  }
203  //**********************************************************************************************
204 
205  //**NonZeros function***************************************************************************
210  inline size_t nonZeros() const {
211  return min( lhs_.size(), lhs_.nonZeros() + rhs_.nonZeros() );
212  }
213  //**********************************************************************************************
214 
215  //**Left operand access*************************************************************************
220  inline LeftOperand leftOperand() const noexcept {
221  return lhs_;
222  }
223  //**********************************************************************************************
224 
225  //**Right operand access************************************************************************
230  inline RightOperand rightOperand() const noexcept {
231  return rhs_;
232  }
233  //**********************************************************************************************
234 
235  //**********************************************************************************************
241  template< typename T >
242  inline bool canAlias( const T* alias ) const noexcept {
243  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
244  }
245  //**********************************************************************************************
246 
247  //**********************************************************************************************
253  template< typename T >
254  inline bool isAliased( const T* alias ) const noexcept {
255  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
256  }
257  //**********************************************************************************************
258 
259  private:
260  //**Member variables****************************************************************************
263  //**********************************************************************************************
264 
265  //**Default assignment to dense vectors*********************************************************
278  template< typename VT > // Type of the target dense vector
280  assign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
281  {
283 
284  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
285 
286  using LeftIterator = ConstIterator_< RemoveReference_<CT1> >;
287  using RightIterator = ConstIterator_< RemoveReference_<CT2> >;
288 
289  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
290  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
291 
292  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
293  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
294  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
295 
296  const LeftIterator lend( x.end() );
297  const RightIterator rend( y.end() );
298 
299  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
300  (~lhs)[l->index()] = l->value();
301  }
302 
303  for( RightIterator r=y.begin(); r!=rend; ++r ) {
304  if( isDefault( (~lhs)[r->index()] ) )
305  (~lhs)[r->index()] = -r->value();
306  else
307  (~lhs)[r->index()] -= r->value();
308  }
309  }
311  //**********************************************************************************************
312 
313  //**Optimized assignment to dense vectors*******************************************************
326  template< typename VT > // Type of the target dense vector
328  assign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
329  {
331 
332  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
333 
334  using LeftIterator = ConstIterator_< RemoveReference_<CT1> >;
335  using RightIterator = ConstIterator_< RemoveReference_<CT2> >;
336 
337  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
338  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
339 
340  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
341  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
342  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
343 
344  const LeftIterator lend( x.end() );
345  const RightIterator rend( y.end() );
346 
347  for( LeftIterator l=x.begin(); l!=lend; ++l ) {
348  (~lhs)[l->index()] = l->value();
349  }
350 
351  for( RightIterator r=y.begin(); r!=rend; ++r ) {
352  (~lhs)[r->index()] -= r->value();
353  }
354  }
356  //**********************************************************************************************
357 
358  //**Assignment to sparse vectors****************************************************************
370  template< typename VT > // Type of the target sparse vector
371  friend inline void assign( SparseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
372  {
374 
375  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
376 
377  using LeftIterator = ConstIterator_< RemoveReference_<CT1> >;
378  using RightIterator = ConstIterator_< RemoveReference_<CT2> >;
379 
380  CT1 x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
381  CT2 y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
382 
383  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size(), "Invalid vector size" );
384  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size(), "Invalid vector size" );
385  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).size() , "Invalid vector size" );
386 
387  // Final memory allocation (based on the evaluated operands)
388  (~lhs).reserve( min( x.size(), x.nonZeros() + y.nonZeros() ) );
389 
390  // Performing the vector subtraction
391  const LeftIterator lend( x.end() );
392  const RightIterator rend( y.end() );
393 
394  LeftIterator l( x.begin() );
395  RightIterator r( y.begin() );
396 
397  while( l != lend && r != rend )
398  {
399  if( l->index() < r->index() ) {
400  (~lhs).append( l->index(), l->value() );
401  ++l;
402  }
403  else if( l->index() > r->index() ) {
404  (~lhs).append( r->index(), -r->value() );
405  ++r;
406  }
407  else {
408  (~lhs).append( l->index(), l->value() - r->value() );
409  ++l;
410  ++r;
411  }
412  }
413 
414  while( l != lend ) {
415  (~lhs).append( l->index(), l->value() );
416  ++l;
417  }
418 
419  while( r != rend ) {
420  (~lhs).append( r->index(), -r->value() );
421  ++r;
422  }
423  }
425  //**********************************************************************************************
426 
427  //**Addition assignment to dense vectors********************************************************
439  template< typename VT > // Type of the target dense vector
440  friend inline void addAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
441  {
443 
444  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
445 
446  addAssign( ~lhs, rhs.lhs_ );
447  subAssign( ~lhs, rhs.rhs_ );
448  }
450  //**********************************************************************************************
451 
452  //**Addition assignment to sparse vectors*******************************************************
453  // No special implementation for the addition assignment to sparse vectors.
454  //**********************************************************************************************
455 
456  //**Subtraction assignment to dense vectors*****************************************************
468  template< typename VT > // Type of the target dense vector
469  friend inline void subAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
470  {
472 
473  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
474 
475  subAssign( ~lhs, rhs.lhs_ );
476  addAssign( ~lhs, rhs.rhs_ );
477  }
479  //**********************************************************************************************
480 
481  //**Subtraction assignment to sparse vectors****************************************************
482  // No special implementation for the subtraction assignment to sparse vectors.
483  //**********************************************************************************************
484 
485  //**Multiplication assignment to dense vectors**************************************************
497  template< typename VT > // Type of the target dense vector
498  friend inline void multAssign( DenseVector<VT,TF>& lhs, const SVecSVecSubExpr& rhs )
499  {
501 
505 
506  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
507 
508  const ResultType tmp( serial( rhs ) );
509  multAssign( ~lhs, tmp );
510  }
512  //**********************************************************************************************
513 
514  //**Multiplication assignment to sparse vectors*************************************************
515  // No special implementation for the multiplication assignment to sparse vectors.
516  //**********************************************************************************************
517 
518  //**SMP assignment to dense vectors*************************************************************
519  // No special implementation for the SMP assignment to dense vectors.
520  //**********************************************************************************************
521 
522  //**SMP assignment to sparse vectors************************************************************
523  // No special implementation for the SMP assignment to sparse vectors.
524  //**********************************************************************************************
525 
526  //**SMP addition assignment to dense vectors****************************************************
540  template< typename VT > // Type of the target dense vector
541  friend inline EnableIf_< UseSMPAssign<VT> >
543  {
545 
546  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
547 
548  smpAddAssign( ~lhs, rhs.lhs_ );
549  smpSubAssign( ~lhs, rhs.rhs_ );
550  }
552  //**********************************************************************************************
553 
554  //**SMP addition assignment to sparse vectors***************************************************
555  // No special implementation for the SMP addition assignment to sparse vectors.
556  //**********************************************************************************************
557 
558  //**SMP subtraction assignment to dense vectors*************************************************
573  template< typename VT > // Type of the target dense vector
574  friend inline EnableIf_< UseSMPAssign<VT> >
576  {
578 
579  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
580 
581  smpSubAssign( ~lhs, rhs.lhs_ );
582  smpAddAssign( ~lhs, rhs.rhs_ );
583  }
585  //**********************************************************************************************
586 
587  //**SMP subtraction assignment to sparse vectors************************************************
588  // No special implementation for the SMP subtraction assignment to sparse vectors.
589  //**********************************************************************************************
590 
591  //**SMP multiplication assignment to dense vectors**********************************************
606  template< typename VT > // Type of the target dense vector
607  friend inline EnableIf_< UseSMPAssign<VT> >
609  {
611 
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
617 
618  const ResultType tmp( rhs );
619  smpMultAssign( ~lhs, tmp );
620  }
622  //**********************************************************************************************
623 
624  //**SMP multiplication assignment to sparse vectors*********************************************
625  // No special implementation for the SMP multiplication assignment to sparse vectors.
626  //**********************************************************************************************
627 
628  //**Compile time checks*************************************************************************
636  //**********************************************************************************************
637 };
638 //*************************************************************************************************
639 
640 
641 
642 
643 //=================================================================================================
644 //
645 // GLOBAL BINARY ARITHMETIC OPERATORS
646 //
647 //=================================================================================================
648 
649 //*************************************************************************************************
673 template< typename VT1 // Type of the left-hand side sparse vector
674  , typename VT2 // Type of the right-hand side sparse vector
675  , bool TF > // Transpose flag
676 inline decltype(auto)
677  operator-( const SparseVector<VT1,TF>& lhs, const SparseVector<VT2,TF>& rhs )
678 {
680 
681  if( (~lhs).size() != (~rhs).size() ) {
682  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
683  }
684 
686  return ReturnType( ~lhs, ~rhs );
687 }
688 //*************************************************************************************************
689 
690 
691 
692 
693 //=================================================================================================
694 //
695 // SIZE SPECIALIZATIONS
696 //
697 //=================================================================================================
698 
699 //*************************************************************************************************
701 template< typename VT1, typename VT2, bool TF >
702 struct Size< SVecSVecSubExpr<VT1,VT2,TF>, 0UL >
703  : public Maximum< Size<VT1,0UL>, Size<VT2,0UL> >
704 {};
706 //*************************************************************************************************
707 
708 } // namespace blaze
709 
710 #endif
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecSVecSubExpr.h:137
#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
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the SparseVector base class.
SubTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecSVecSubExpr.h:135
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:101
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecSVecSubExpr.h:210
SVecSVecSubExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecSVecSubExpr class.
Definition: SVecSVecSubExpr.h:160
EnableIf_< IsDenseMatrix< MT1 > > 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:164
Header file for the serial shim.
LeftOperand lhs_
Left-hand side sparse vector of the subtraction expression.
Definition: SVecSVecSubExpr.h:261
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecSVecSubExpr.h:220
EnableIf_< IsDenseVector< VT1 > > 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:193
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecSVecSubExpr.h:242
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecSVecSubExpr.h:136
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:99
Header file for the Computation base class.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecSVecSubExpr.h:143
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > 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:133
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecSVecSubExpr.h:254
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:149
typename SubExprTrait< T1, T2 >::Type SubExprTrait_
Auxiliary alias declaration for the SubExprTrait class template.The SubExprTrait_ alias declaration p...
Definition: SubExprTrait.h:112
Header file for the Maximum class template.
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:98
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecSVecSubExpr.h:174
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:97
Header file for the DisableIf class template.
Header file for the IsTemporary type trait class.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecSVecSubExpr.h:200
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Expression object for sparse vector-sparse vector subtractions.The SVecSVecSubExpr class represents t...
Definition: Forward.h:145
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:102
#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
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
SubExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecSVecSubExpr.h:115
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
#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
Constraint on the data type.
Header file for the exception macros of the math module.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecSVecSubExpr.h:140
Header file for the VecVecSubExpr base class.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for run time assertion macros.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: SVecSVecSubExpr.h:230
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for the isDefault shim.
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:100
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 RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecSubExpr.h:146
Constraint on the data type.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECSUBEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecSubExpr.h:108
Header file for the IsComputation type trait class.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:291
RightOperand rhs_
Right-hand side sparse vector of the subtraction expression.
Definition: SVecSVecSubExpr.h:262
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecSVecSubExpr.h:187
Header file for the IsResizable type trait.
Header file for the SubExprTrait class template.
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.