35 #ifndef _BLAZE_MATH_VIEWS_SPARSESUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_SPARSESUBVECTOR_H_
384 template<
typename VT
386 ,
bool TF = IsRowVector<VT>::value >
387 class SparseSubvector :
public SparseVector< SparseSubvector<VT,AF,TF>, TF >
427 ,
typename IteratorType >
443 typedef typename std::iterator_traits<IteratorType>::value_type
SET;
545 return pos_->value();
571 ,
typename IteratorType >
616 template<
typename VectorType2,
typename IteratorType2 >
672 template<
typename VectorType2,
typename IteratorType2 >
684 template<
typename VectorType2,
typename IteratorType2 >
686 return !( *
this == rhs );
706 inline IteratorType
base()
const {
739 enum { smpAssignable = VT::smpAssignable };
778 template<
typename Other >
780 operator*=( Other rhs );
782 template<
typename Other >
784 operator/=( Other rhs );
791 inline size_t size()
const;
797 inline void erase (
size_t index );
800 inline void reserve(
size_t n );
801 template<
typename Other >
inline SparseSubvector& scale (
const Other& scalar );
827 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
828 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
853 template<
bool AF1,
typename VT2,
bool AF2,
bool TF2 >
857 template<
typename VT2,
bool AF2,
bool TF2 >
860 template<
typename VT2,
bool AF2,
bool TF2 >
863 template<
typename VT2,
bool AF2,
bool TF2 >
901 template<
typename VT
909 if( index + n > vector.size() )
910 throw std::invalid_argument(
"Invalid subvector specification" );
929 template<
typename VT
936 return vector_[offset_+index];
947 template<
typename VT
954 return const_cast<const VT&
>( vector_ )[offset_+index];
966 template<
typename VT
972 return Iterator( vector_.begin(), offset_ );
974 return Iterator( vector_.lowerBound( offset_ ), offset_ );
986 template<
typename VT
994 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
1006 template<
typename VT
1011 if( offset_ == 0UL )
1014 return ConstIterator( vector_.lowerBound( offset_ ), offset_ );
1026 template<
typename VT
1031 if( offset_ + size_ == vector_.size() )
1032 return Iterator( vector_.end(), offset_ );
1034 return Iterator( vector_.lowerBound( offset_ + size_ ), offset_ );
1046 template<
typename VT
1051 if( offset_ + size_ == vector_.size() )
1054 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
1066 template<
typename VT
1071 if( offset_ + size_ == vector_.size() )
1074 return ConstIterator( vector_.lowerBound( offset_ + size_ ), offset_ );
1097 template<
typename VT
1108 if(
this == &rhs || ( &vector_ == &rhs.vector_ && offset_ == rhs.offset_ ) )
1111 if(
size() != rhs.size() )
1112 throw std::invalid_argument(
"Vector sizes do not match" );
1114 if( rhs.canAlias( &vector_ ) ) {
1139 template<
typename VT
1142 template<
typename VT2 >
1153 throw std::invalid_argument(
"Vector sizes do not match" );
1180 template<
typename VT
1183 template<
typename VT2 >
1194 throw std::invalid_argument(
"Vector sizes do not match" );
1221 template<
typename VT
1224 template<
typename VT2 >
1231 throw std::invalid_argument(
"Vector sizes do not match" );
1250 template<
typename VT
1253 template<
typename VT2 >
1260 throw std::invalid_argument(
"Vector sizes do not match" );
1280 template<
typename VT
1283 template<
typename VT2 >
1288 throw std::invalid_argument(
"Vector sizes do not match" );
1296 const MultType tmp( *
this * (~rhs) );
1316 template<
typename VT
1319 template<
typename Other >
1325 element->value() *= rhs;
1343 template<
typename VT
1346 template<
typename Other >
1360 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
1362 element->value() *= tmp;
1366 element->value() /= rhs;
1387 template<
typename VT
1402 template<
typename VT
1407 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1419 template<
typename VT
1434 template<
typename VT
1439 vector_.erase( vector_.lowerBound( offset_ ), vector_.lowerBound( offset_ + size_ ) );
1455 template<
typename VT
1461 return Iterator( vector_.set( offset_ + index, value ), offset_ );
1478 template<
typename VT
1484 return Iterator( vector_.insert( offset_ + index, value ), offset_ );
1497 template<
typename VT
1502 vector_.erase( offset_ + index );
1515 template<
typename VT
1520 return Iterator( vector_.erase( pos.base() ), offset_ );
1534 template<
typename VT
1540 return Iterator( vector_.erase( first.base(), last.base() ), offset_ );
1554 template<
typename VT
1559 const size_t current(
capacity() );
1562 vector_.reserve( vector_.capacity() + n - current );
1574 template<
typename VT
1577 template<
typename Other >
1581 element->value() *= scalar;
1608 template<
typename VT
1614 const typename VT::Iterator pos( vector_.find( offset_ + index ) );
1616 if( pos != vector_.end() )
1637 template<
typename VT
1645 if( pos != vector_.end() )
1665 template<
typename VT
1671 return Iterator( vector_.lowerBound( offset_ + index ), offset_ );
1688 template<
typename VT
1694 return ConstIterator( vector_.lowerBound( offset_ + index ), offset_ );
1711 template<
typename VT
1717 return Iterator( vector_.upperBound( offset_ + index ), offset_ );
1734 template<
typename VT
1740 return ConstIterator( vector_.upperBound( offset_ + index ), offset_ );
1777 template<
typename VT
1782 if( offset_ + size_ == vector_.size() )
1783 vector_.append( offset_ + index, value, check );
1784 else if( !check || !
isDefault( value ) )
1785 vector_.insert( offset_ + index, value );
1808 template<
typename VT
1811 template<
typename Other >
1814 return vector_.isAliased( alias );
1829 template<
typename VT
1832 template<
typename Other >
1835 return vector_.isAliased( alias );
1850 template<
typename VT
1871 template<
typename VT
1874 template<
typename VT2 >
1880 reserve( (~rhs).
size() );
1882 for(
size_t i=0UL; i<
size(); ++i ) {
1883 append( i, (~rhs)[i],
true );
1900 template<
typename VT
1903 template<
typename VT2 >
1912 append( element->index(), element->value(), true );
1929 template<
typename VT
1932 template<
typename VT2 >
1943 const AddType tmp(
serial( *
this + (~rhs) ) );
1961 template<
typename VT
1964 template<
typename VT2 >
1975 const AddType tmp(
serial( *
this + (~rhs) ) );
1993 template<
typename VT
1996 template<
typename VT2 >
2007 const SubType tmp(
serial( *
this - (~rhs) ) );
2025 template<
typename VT
2028 template<
typename VT2 >
2039 const SubType tmp(
serial( *
this - (~rhs) ) );
2061 template<
typename VT,
bool AF,
bool TF >
2064 template<
typename VT,
bool AF,
bool TF >
2067 template<
typename VT,
bool AF,
bool TF >
2070 template<
typename VT,
bool AF,
bool TF >
2073 template<
typename VT,
bool AF,
bool TF >
2076 template<
typename VT,
bool AF,
bool TF >
2089 template<
typename VT
2108 template<
typename VT
2136 template<
typename VT
2143 const ConstIterator
end( sv.end() );
2144 for( ConstIterator element=sv.begin(); element!=
end; ++element )
2145 if( !
isDefault( element->value() ) )
return false;
2163 template<
typename VT,
bool AF,
bool TF >
2166 return (
isSame( a.vector_, ~b ) && ( a.size() == (~b).
size() ) );
2183 template<
typename VT,
bool AF,
bool TF >
2186 return (
isSame( ~a, b.vector_ ) && ( (~a).size() == b.size() ) );
2203 template<
typename VT,
bool AF,
bool TF >
2206 return (
isSame( a.vector_, b.vector_ ) && ( a.offset_ == b.offset_ ) && ( a.size_ == b.size_ ) );
2236 inline const SparseSubvector<VT,AF1,TF>
2237 subvector(
const SparseSubvector<VT,AF2,TF>& sv,
size_t index,
size_t size )
2241 if( index + size > sv.size() )
2242 throw std::invalid_argument(
"Invalid subvector specification" );
2244 return SparseSubvector<VT,AF1,TF>( sv.vector_, sv.offset_ + index,
size );
2260 template<
typename VT,
bool AF,
bool TF >
2261 struct SubvectorTrait< SparseSubvector<VT,AF,TF> >
2279 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
2280 struct SubvectorExprTrait< SparseSubvector<VT,AF1,TF>, AF2 >
2282 typedef SparseSubvector<VT,AF2,TF> Type;
2290 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
2291 struct SubvectorExprTrait< const SparseSubvector<VT,AF1,TF>, AF2 >
2293 typedef SparseSubvector<VT,AF2,TF> Type;
2301 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
2302 struct SubvectorExprTrait< volatile SparseSubvector<VT,AF1,TF>, AF2 >
2304 typedef SparseSubvector<VT,AF2,TF> Type;
2312 template<
typename VT,
bool AF1,
bool TF,
bool AF2 >
2313 struct SubvectorExprTrait< const volatile SparseSubvector<VT,AF1,TF>, AF2 >
2315 typedef SparseSubvector<VT,AF2,TF> Type;
Constraint on the data type.
Pointer difference type of the Blaze library.
View on a specific subvector of a sparse vector.The SparseSubvector template represents a view on a s...
Definition: Forward.h:54
SparseSubvector< VT, AF, TF > This
Type of this SparseSubvector instance.
Definition: SparseSubvector.h:409
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
SelectType< IsExpression< VT >::value, VT, VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SparseSubvector.h:393
size_t offset_
Offset within the according sparse vector.
Definition: SparseSubvector.h:562
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the subvector/submatrix alignment flag values.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for the subtraction trait.
DifferenceType operator-(const SubvectorIterator &rhs) const
Calculating the number of elements between two subvector iterators.
Definition: SparseSubvector.h:696
ValueType PointerType
Pointer return type.
Definition: SparseSubvector.h:578
Header file for the SparseVector base class.
const size_t offset_
The offset of the subvector within the sparse vector.
Definition: SparseSubvector.h:846
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
std::iterator_traits< IteratorType >::value_type SET
Type of the underlying sparse elements.
Definition: SparseSubvector.h:443
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SparseSubvector.h:413
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
IteratorType base() const
Access to the current position of the subvector iterator.
Definition: SparseSubvector.h:706
Reference value() const
Access to the current value of the sparse subvector element.
Definition: SparseSubvector.h:544
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
bool operator==(const SubvectorIterator< VectorType2, IteratorType2 > &rhs) const
Equality comparison between two SubvectorIterator objects.
Definition: SparseSubvector.h:673
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:946
Iterator begin()
Returns an iterator to the first element of the subvector.
Definition: SparseSubvector.h:969
SubvectorElement< VectorType, IteratorType > ValueType
Type of the underlying elements.
Definition: SparseSubvector.h:577
ValueType value_type
Type of the underlying elements.
Definition: SparseSubvector.h:584
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
Header file for the IsRowVector type trait.
SparseSubvector(Operand vector, size_t index, size_t n)
The constructor for SparseSubvector.
Definition: SparseSubvector.h:904
VT::ConstReference ConstReference
Reference to a constant subvector value.
Definition: SparseSubvector.h:417
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:386
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:95
Iterator lowerBound(size_t index)
Returns an iterator to the first index not less then the given index.
Definition: SparseSubvector.h:1669
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
Header file for the RequiresEvaluation type trait.
bool operator!=(const SubvectorIterator< VectorType2, IteratorType2 > &rhs) const
Inequality comparison between two SubvectorIterator objects.
Definition: SparseSubvector.h:685
size_t size() const
Returns the size/dimension of the sparse subvector.
Definition: SparseSubvector.h:1390
size_t offset_
The offset of the subvector within the sparse vector.
Definition: SparseSubvector.h:724
void reserve(size_t n)
Setting the minimum capacity of the sparse subvector.
Definition: SparseSubvector.h:1557
IteratorCategory iterator_category
The iterator category.
Definition: SparseSubvector.h:583
PointerType operator->() const
Direct access to the current sparse subvector element.
Definition: SparseSubvector.h:661
SubvectorElement & operator*=(const T &v)
Multiplication assignment to the accessed sparse subvector element.
Definition: SparseSubvector.h:511
SubvectorElement & operator/=(const T &v)
Division assignment to the accessed sparse subvector element.
Definition: SparseSubvector.h:523
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:123
Constraint on the data type.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SparseSubvector.h:411
SubvectorElement & operator-=(const T &v)
Subtraction assignment to the accessed sparse subvector element.
Definition: SparseSubvector.h:499
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ReferenceType operator*() const
Direct access to the current sparse subvector element.
Definition: SparseSubvector.h:651
SubvectorElement & operator+=(const T &v)
Addition assignment to the accessed sparse subvector element.
Definition: SparseSubvector.h:487
Iterator end()
Returns an iterator just past the last element of the subvector.
Definition: SparseSubvector.h:1029
ReferenceType reference
Reference return type.
Definition: SparseSubvector.h:586
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
SelectType< useConst, ConstIterator, SubvectorIterator< VT, typename VT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: SparseSubvector.h:734
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SparseSubvector.h:576
SubvectorIterator< const VT, typename VT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: SparseSubvector.h:731
Header file for the multiplication trait.
void erase(size_t index)
Erasing an element from the sparse subvector.
Definition: SparseSubvector.h:1500
size_t capacity() const
Returns the maximum capacity of the sparse subvector.
Definition: SparseSubvector.h:1405
Header file for the If class template.
Header file for the Subvector base class.
Operand vector_
The sparse vector containing the subvector.
Definition: SparseSubvector.h:845
Header file for the IsFloatingPoint type trait.
bool canSMPAssign() const
Returns whether the subvector can be used in SMP assignments.
Definition: SparseSubvector.h:1853
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
SubvectorIterator & operator++()
Pre-increment operator.
Definition: SparseSubvector.h:628
Header file for the Or class template.
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
SubvectorIterator()
Default constructor for the SubvectorIterator class.
Definition: SparseSubvector.h:593
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
void assign(const DenseVector< VT2, TF > &rhs)
Default implementation of the assignment of a dense vector.
Definition: SparseSubvector.h:1875
PointerType pointer
Pointer return type.
Definition: SparseSubvector.h:585
Header file for the subvector trait.
const SubvectorElement * operator->() const
Direct access to the sparse subvector element at the current iterator position.
Definition: SparseSubvector.h:534
Access proxy for a specific element of the sparse subvector.
Definition: SparseSubvector.h:428
void append(size_t index, const ElementType &value, bool check=false)
Appending an element to the sparse subvector.
Definition: SparseSubvector.h:1780
SubvectorIterator(IteratorType iterator, size_t index)
Constructor for the SubvectorIterator class.
Definition: SparseSubvector.h:605
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#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
SET::ConstReference CRT
Reference-to-const type of the underlying sparse element.
Definition: SparseSubvector.h:446
Constraint on the data type.
Header file for the SparseElement base class.
Constraint on the data type.
void subAssign(const DenseVector< VT2, TF > &rhs)
Default implementation of the subtraction assignment of a dense vector.
Definition: SparseSubvector.h:1997
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SparseSubvector.h:580
SubvectorTrait< VT >::Type ResultType
Result type for expression template evaluations.
Definition: SparseSubvector.h:410
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:94
size_t offset() const
Access to the offset of the subvector iterator.
Definition: SparseSubvector.h:716
Iterator upperBound(size_t index)
Returns an iterator to the first index greater then the given index.
Definition: SparseSubvector.h:1715
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
IndexType index() const
Access to the current index of the sparse element.
Definition: SparseSubvector.h:554
Constraint on the data type.
Header file for the SelectType class template.
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
CRT ConstReference
Reference-to-const return type.
Definition: SparseSubvector.h:454
Header file for the EnableIf class template.
VT::ElementType ElementType
Type of the subvector elements.
Definition: SparseSubvector.h:412
SubvectorElement & operator=(const T &v)
Assignment to the accessed sparse subvector element.
Definition: SparseSubvector.h:475
Header file for the serial shim.
DifferenceType difference_type
Difference between two iterators.
Definition: SparseSubvector.h:587
const bool unaligned
Alignment flag for unaligned subvectors and submatrices.
Definition: AlignmentFlag.h:63
Header file for the IsNumeric type trait.
Reference operator[](size_t index)
Subscript operator for the direct access to the subvector elements.
Definition: SparseSubvector.h:933
SubvectorIterator(const SubvectorIterator< VectorType2, IteratorType2 > &it)
Conversion constructor from different SubvectorIterator instances.
Definition: SparseSubvector.h:617
ValueType ReferenceType
Reference return type.
Definition: SparseSubvector.h:579
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Header file for the IsConst type trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:142
Base template for the MultTrait class.
Definition: MultTrait.h:142
Header file for the addition trait.
SET::ValueType ValueType
The value type of the row element.
Definition: SparseSubvector.h:451
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 division trait.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const size_t size_
The size of the subvector.
Definition: SparseSubvector.h:847
SubvectorExprTrait< VT, unaligned >::Type subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:135
bool canAlias(const Other *alias) const
Returns whether the sparse subvector can alias with the given address alias.
Definition: SparseSubvector.h:1812
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
bool isAliased(const Other *alias) const
Returns whether the sparse subvector is aliased with the given address alias.
Definition: SparseSubvector.h:1833
size_t IndexType
The index type of the row element.
Definition: SparseSubvector.h:452
Iterator set(size_t index, const ElementType &value)
Setting an element of the sparse subvector.
Definition: SparseSubvector.h:1459
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
Base class for all sparse element types.The SparseElement class is the base class for all sparse elem...
Definition: SparseElement.h:57
#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
VT VectorType
Type of the vector.
Definition: Vector.h:80
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Iterator find(size_t index)
Searches for a specific subvector element.
Definition: SparseSubvector.h:1612
Base template for the DivTrait class.
Definition: DivTrait.h:142
size_t nonZeros() const
Returns the number of non-zero elements in the subvector.
Definition: SparseSubvector.h:1422
#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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBVECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is a subvector type (i.e. a dense or sparse subvector), a compilation error is created.
Definition: Subvector.h:118
const SparseSubvector & CompositeType
Data type for composite expression templates.
Definition: SparseSubvector.h:414
ConstIterator cbegin() const
Returns an iterator to the first element of the subvector.
Definition: SparseSubvector.h:1009
Iterator insert(size_t index, const ElementType &value)
Inserting an element into the sparse subvector.
Definition: SparseSubvector.h:1482
const SubvectorIterator operator++(int)
Post-increment operator.
Definition: SparseSubvector.h:639
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
IteratorType pos_
Iterator to the current sparse element.
Definition: SparseSubvector.h:723
Iterator over the elements of the sparse subvector.
Definition: SparseSubvector.h:572
SubvectorElement(IteratorType pos, size_t offset)
Constructor for the SubvectorElement class.
Definition: SparseSubvector.h:463
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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:2473
Header file for basic type definitions.
void reset()
Reset to the default initial values.
Definition: SparseSubvector.h:1437
Header file for the SubvectorExprTrait class template.
SparseSubvector & operator=(const SparseSubvector &rhs)
Copy assignment operator for SparseSubvector.
Definition: SparseSubvector.h:1101
ConstIterator cend() const
Returns an iterator just past the last element of the subvector.
Definition: SparseSubvector.h:1069
void addAssign(const DenseVector< VT2, TF > &rhs)
Default implementation of the addition assignment of a dense vector.
Definition: SparseSubvector.h:1933
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
Base template for the SubTrait class.
Definition: SubTrait.h:142
SelectType< useConst, ConstReference, typename VT::Reference >::Type Reference
Reference to a non-constant subvector value.
Definition: SparseSubvector.h:420
SelectType< returnConst, CRT, RT >::Type Reference
Reference return type.
Definition: SparseSubvector.h:453
Size type of the Blaze library.
#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:238
#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
IteratorType pos_
Iterator to the current position within the sparse subvector.
Definition: SparseSubvector.h:561
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
SET::Reference RT
Reference type of the underlying sparse element.
Definition: SparseSubvector.h:445