35 #ifndef _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
36 #define _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
96 inline size_t size()
const;
99 inline void reset()
const;
100 inline void clear()
const;
103 inline void append(
size_t index,
const ElementType& value,
bool check=
false )
const;
104 inline void erase(
size_t index )
const;
107 inline void resize(
size_t n,
bool preserve=
true )
const;
108 inline void reserve(
size_t n )
const;
110 template<
typename Other >
inline void scale(
const Other& scalar )
const;
155 template<
typename PT
160 return (~*
this).
get()[index];
170 template<
typename PT
174 return (~*
this).get().begin();
184 template<
typename PT
188 return (~*
this).get().cbegin();
198 template<
typename PT
202 return (~*
this).get().end();
212 template<
typename PT
216 return (~*
this).get().cend();
234 template<
typename PT
238 return (~*
this).get().size();
248 template<
typename PT
252 return (~*
this).get().capacity();
265 template<
typename PT
269 return (~*
this).get().nonZeros();
281 template<
typename PT
287 reset( (~*
this).
get() );
299 template<
typename PT
305 clear( (~*
this).
get() );
322 template<
typename PT
327 return (~*
this).get().set( index, value );
344 template<
typename PT
349 return (~*
this).get().insert( index, value );
378 template<
typename PT
382 (~*
this).
get().append( index, value, check );
395 template<
typename PT
399 (~*
this).
get().erase( index );
412 template<
typename PT
416 return (~*
this).get().erase( pos );
430 template<
typename PT
435 return (~*
this).get().erase( first, last );
454 template<
typename PT
458 (~*
this).
get().resize( n, preserve );
472 template<
typename PT
476 (~*
this).
get().reserve( n );
487 template<
typename PT
489 template<
typename Other >
492 (~*
this).
get().scale( scalar );
518 template<
typename PT
523 return (~*
this).get().find( index );
540 template<
typename PT
545 return (~*
this).get().lowerBound( index );
562 template<
typename PT
567 return (~*
this).get().upperBound( index );
583 template<
typename PT,
typename VT >
587 template<
typename PT,
typename VT >
591 template<
typename PT,
typename VT >
595 template<
typename PT,
typename VT >
599 template<
typename PT,
typename VT >
602 template<
typename PT,
typename VT >
605 template<
typename PT,
typename VT >
608 template<
typename PT,
typename VT >
611 template<
typename PT,
typename VT >
624 template<
typename PT
629 return proxy.
begin();
641 template<
typename PT
658 template<
typename PT
675 template<
typename PT
692 template<
typename PT
708 template<
typename PT
727 template<
typename PT
745 template<
typename PT
763 template<
typename PT
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:237
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:300
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
void append(size_t index, const ElementType &value, bool check=false) const
Appending an element to the represented sparse vector.
Definition: SparseVectorProxy.h:380
VT::Iterator Iterator
Iterator over non-constant elements.
Definition: SparseVectorProxy.h:77
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.
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
void reset() const
Reset to the default initial value.
Definition: SparseVectorProxy.h:283
Iterator end() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:200
Iterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SparseVectorProxy.h:543
size_t capacity() const
Returns the maximum capacity of the represented vector.
Definition: SparseVectorProxy.h:250
Iterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SparseVectorProxy.h:565
Header file for the clear shim.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Iterator set(size_t index, const ElementType &value) const
Setting an element of the represented sparse vector.
Definition: SparseVectorProxy.h:325
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
void erase(size_t index) const
Erasing an element from the sparse vector.
Definition: SparseVectorProxy.h:397
VT::Reference Reference
Reference to a non-constant vector value.
Definition: SparseVectorProxy.h:75
ConstIterator cend() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:214
void resize(size_t n, bool preserve=true) const
Changing the size of the represented vector.
Definition: SparseVectorProxy.h:456
#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
Reference operator[](size_t index) const
Subscript operator for the direct access to vector elements.
Definition: SparseVectorProxy.h:158
RawReference get() const
Returning the value of the accessed sparse matrix element.
Definition: MatrixAccessProxy.h:360
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
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
size_t nonZeros() const
Returns the number of non-zero elements in the represented vector.
Definition: SparseVectorProxy.h:267
Iterator begin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:172
void scale(const Other &scalar) const
Scaling of the sparse vector by the scalar value scalar ( ).
Definition: SparseVectorProxy.h:490
VT::ElementType ElementType
Type of the sparse vector elements.
Definition: SparseVectorProxy.h:74
Iterator find(size_t index) const
Searches for a specific vector element.
Definition: SparseVectorProxy.h:521
Iterator insert(size_t index, const ElementType &value) const
Inserting an element into the represented sparse vector.
Definition: SparseVectorProxy.h:347
void clear() const
Clearing the represented vector.
Definition: SparseVectorProxy.h:301
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2481
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
Proxy backend for sparse vector types.The SparseVectorProxy class serves as a backend for the Proxy c...
Definition: SparseVectorProxy.h:70
VT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseVectorProxy.h:78
VT::ConstReference ConstReference
Reference to a constant vector value.
Definition: SparseVectorProxy.h:76
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
Header file for basic type definitions.
size_t size() const
Returns the current size/dimension of the represented vector.
Definition: SparseVectorProxy.h:236
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
System settings for the inline keywords.
ConstIterator cbegin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:186
void reserve(size_t n) const
Setting the minimum capacity of the represented vector.
Definition: SparseVectorProxy.h:474