35#ifndef _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
36#define _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
111 inline size_t size()
const;
114 inline void reset()
const;
115 inline void clear()
const;
116 inline void resize(
size_t n,
bool preserve=
true )
const;
117 inline void reserve(
size_t n )
const;
126 inline void append(
size_t index,
const ElementType& value,
bool check=
false )
const;
133 inline void erase(
size_t index )
const;
137 template<
typename Pred,
typename = DisableIf_t< IsIntegral_v<Pred> > >
138 inline void erase( Pred predicate );
140 template<
typename Pred >
157 template<
typename Other >
inline void scale(
const Other& scalar )
const;
209 if( (**this).isRestricted() ) {
213 return (**this).get()[index];
236 if( (**this).isRestricted() ) {
240 return (**this).get().at( index );
254 return (**this).get().begin();
268 return (**this).get().cbegin();
282 return (**this).get().end();
296 return (**this).get().cend();
318 return (**this).get().size();
332 return (**this).get().capacity();
349 return (**this).get().nonZeros();
367 reset( (**this).get() );
385 clear( (**this).get() );
408 if( (**this).isRestricted() ) {
412 return (**this).get().set( index, value );
435 if( (**this).isRestricted() ) {
439 return (**this).get().insert( index, value );
473 if( (**this).isRestricted() ) {
477 (**this).get().append( index, value, check );
501 if( (**this).isRestricted() ) {
505 (**this).get().resize( n, preserve );
524 if( (**this).isRestricted() ) {
528 (**this).get().reserve( n );
546template<
typename Other >
549 if( (**this).isRestricted() ) {
553 (**this).get().scale( scalar );
579 if( (**this).isRestricted() ) {
583 (**this).get().erase( index );
601 if( (**this).isRestricted() ) {
605 return (**this).get().erase( pos );
625 if( (**this).isRestricted() ) {
629 return (**this).get().erase( first, last );
649template<
typename Pred
653 if( (**this).isRestricted() ) {
657 (**this).get().erase( predicate );
679template<
typename Pred >
682 if( (**this).isRestricted() ) {
686 (**this).get().erase( first, last, predicate );
717 return (**this).get().find( index );
739 return (**this).get().lowerBound( index );
761 return (**this).get().upperBound( index );
777template<
typename PT,
typename VT >
781template<
typename PT,
typename VT >
785template<
typename PT,
typename VT >
789template<
typename PT,
typename VT >
793template<
typename PT,
typename VT >
796template<
typename PT,
typename VT >
799template<
typename PT,
typename VT >
802template<
typename PT,
typename VT >
805template<
typename PT,
typename VT >
809template<
typename PT,
typename VT >
813template<
typename PT,
typename VT >
832 return proxy.
begin();
954 proxy.
resize( n, preserve );
972 return proxy.
find( index );
1003template<
typename PT
Header file for auxiliary alias declarations.
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.
Definition: Aliases.h:170
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::Iterator Iterator_t
Alias declaration for nested Iterator type definitions.
Definition: Aliases.h:210
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.
Definition: Aliases.h:390
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for the EnableIf class template.
Header file for the IsIntegral type trait.
Header file for the IsRowVector type trait.
Proxy backend for sparse vector types.
Definition: SparseVectorProxy.h:76
size_t size() const
Returns the current size/dimension of the represented vector.
Definition: SparseVectorProxy.h:316
Iterator_t< VT > Iterator
Iterator over non-constant elements.
Definition: SparseVectorProxy.h:86
void reserve(size_t n) const
Setting the minimum capacity of the represented vector.
Definition: SparseVectorProxy.h:522
Iterator end() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:280
Iterator insert(size_t index, const ElementType &value) const
Inserting an element into the represented sparse vector.
Definition: SparseVectorProxy.h:433
void scale(const Other &scalar) const
Scaling of the sparse vector by the scalar value scalar ( ).
Definition: SparseVectorProxy.h:547
Iterator find(size_t index) const
Searches for a specific vector element.
Definition: SparseVectorProxy.h:715
void clear() const
Clearing the represented vector.
Definition: SparseVectorProxy.h:381
size_t nonZeros() const
Returns the number of non-zero elements in the represented vector.
Definition: SparseVectorProxy.h:347
void resize(size_t n, bool preserve=true) const
Changing the size of the represented vector.
Definition: SparseVectorProxy.h:499
ConstIterator cend() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:294
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: SparseVectorProxy.h:92
ConstReference_t< VT > ConstReference
Reference to a constant vector value.
Definition: SparseVectorProxy.h:85
Iterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SparseVectorProxy.h:759
void erase(size_t index) const
Erasing an element from the sparse vector.
Definition: SparseVectorProxy.h:577
void reset() const
Reset to the default initial value.
Definition: SparseVectorProxy.h:363
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition: SparseVectorProxy.h:82
Iterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SparseVectorProxy.h:737
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition: SparseVectorProxy.h:79
Iterator begin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:252
void append(size_t index, const ElementType &value, bool check=false) const
Appending an element to the represented sparse vector.
Definition: SparseVectorProxy.h:471
ElementType_t< VT > ElementType
Type of the sparse vector elements.
Definition: SparseVectorProxy.h:81
size_t capacity() const
Returns the maximum capacity of the represented vector.
Definition: SparseVectorProxy.h:330
Reference at(size_t index) const
Checked access to the vector elements.
Definition: SparseVectorProxy.h:234
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition: SparseVectorProxy.h:80
ConstIterator_t< VT > ConstIterator
Iterator over constant elements.
Definition: SparseVectorProxy.h:87
Reference operator[](size_t index) const
Subscript operator for the direct access to vector elements.
Definition: SparseVectorProxy.h:207
CompositeType_t< VT > CompositeType
Data type for composite expression templates.
Definition: SparseVectorProxy.h:83
ConstIterator cbegin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:266
Reference_t< VT > Reference
Reference to a non-constant vector value.
Definition: SparseVectorProxy.h:84
Iterator set(size_t index, const ElementType &value) const
Setting an element of the represented sparse vector.
Definition: SparseVectorProxy.h:406
Base class for sparse vectors.
Definition: SparseVector.h:72
Constraint on the data type.
Header file for the SparseVector base class.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: SparseVector.h:61
BLAZE_ALWAYS_INLINE size_t capacity(const SparseVectorProxy< PT, VT > &proxy)
Returns the maximum capacity of the represented vector.
Definition: SparseVectorProxy.h:913
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::ConstIterator cend(const SparseVectorProxy< PT, VT > &proxy)
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:881
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::Iterator lowerBound(const SparseVectorProxy< PT, VT > &proxy, size_t index)
Returns an iterator to the first index not less then the given index.
Definition: SparseVectorProxy.h:988
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::Iterator end(const SparseVectorProxy< PT, VT > &proxy)
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:864
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::Iterator begin(const SparseVectorProxy< PT, VT > &proxy)
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:830
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::Iterator find(const SparseVectorProxy< PT, VT > &proxy, size_t index)
Searches for a specific sparse vector element.
Definition: SparseVectorProxy.h:970
BLAZE_ALWAYS_INLINE void resize(const SparseVectorProxy< PT, VT > &proxy, size_t n, bool preserve)
Changing the size of the represented vector.
Definition: SparseVectorProxy.h:952
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::ConstIterator cbegin(const SparseVectorProxy< PT, VT > &proxy)
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:847
BLAZE_ALWAYS_INLINE SparseVectorProxy< PT, VT >::Iterator upperBound(const SparseVectorProxy< PT, VT > &proxy, size_t index)
Returns an iterator to the first index greater then the given index.
Definition: SparseVectorProxy.h:1006
BLAZE_ALWAYS_INLINE size_t size(const SparseVectorProxy< PT, VT > &proxy)
Returns the current size/dimension of the represented vector.
Definition: SparseVectorProxy.h:897
BLAZE_ALWAYS_INLINE size_t nonZeros(const SparseVectorProxy< PT, VT > &proxy)
Returns the number of non-zero elements in the represented vector.
Definition: SparseVectorProxy.h:932
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the clear shim.
Header file for the reset shim.
System settings for the inline keywords.
Header file for basic type definitions.