35 #ifndef _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
36 #define _BLAZE_MATH_PROXY_SPARSEVECTORPROXY_H_
85 inline Reference
operator[](
size_t index )
const;
87 inline Iterator
begin ()
const;
88 inline ConstIterator
cbegin()
const;
89 inline Iterator
end ()
const;
90 inline ConstIterator
cend ()
const;
97 inline size_t size()
const;
100 inline void reset()
const;
101 inline void clear()
const;
102 inline Iterator
set(
size_t index,
const ElementType& value )
const;
103 inline Iterator
insert(
size_t index,
const ElementType& value )
const;
104 inline void append(
size_t index,
const ElementType& value,
bool check=
false )
const;
105 inline void erase(
size_t index )
const;
106 inline Iterator
erase( Iterator pos )
const;
107 inline Iterator
erase( Iterator first, Iterator last )
const;
108 inline void resize(
size_t n,
bool preserve=
true )
const;
109 inline void reserve(
size_t n )
const;
111 template<
typename Other >
inline void scale(
const Other& scalar )
const;
118 inline Iterator
find (
size_t index )
const;
119 inline Iterator
find (
size_t i,
size_t j )
const;
120 inline Iterator
lowerBound(
size_t index )
const;
121 inline Iterator
lowerBound(
size_t i,
size_t j )
const;
122 inline Iterator
upperBound(
size_t index )
const;
123 inline Iterator
upperBound(
size_t i,
size_t j )
const;
156 template<
typename PT
161 if( (~*
this).isRestricted() )
162 throw std::invalid_argument(
"Invalid access to restricted element" );
164 return (~*
this).get()[index];
174 template<
typename PT
178 return (~*
this).get().begin();
188 template<
typename PT
192 return (~*
this).get().cbegin();
202 template<
typename PT
206 return (~*
this).get().end();
216 template<
typename PT
220 return (~*
this).get().cend();
238 template<
typename PT
242 return (~*
this).get().size();
252 template<
typename PT
256 return (~*
this).get().capacity();
269 template<
typename PT
273 return (~*
this).get().nonZeros();
285 template<
typename PT
291 reset( (~*
this).
get() );
303 template<
typename PT
309 clear( (~*
this).
get() );
326 template<
typename PT
331 if( (~*
this).isRestricted() )
332 throw std::invalid_argument(
"Invalid access to restricted element" );
334 return (~*
this).get().set( index, value );
351 template<
typename PT
356 if( (~*
this).isRestricted() )
357 throw std::invalid_argument(
"Invalid access to restricted element" );
359 return (~*
this).get().insert( index, value );
388 template<
typename PT
392 if( (~*
this).isRestricted() )
393 throw std::invalid_argument(
"Invalid access to restricted element" );
395 (~*
this).
get().append( index, value, check );
408 template<
typename PT
412 if( (~*
this).isRestricted() )
413 throw std::invalid_argument(
"Invalid access to restricted element" );
415 (~*
this).
get().erase( index );
428 template<
typename PT
432 if( (~*
this).isRestricted() )
433 throw std::invalid_argument(
"Invalid access to restricted element" );
435 return (~*
this).get().erase( pos );
449 template<
typename PT
454 if( (~*
this).isRestricted() )
455 throw std::invalid_argument(
"Invalid access to restricted element" );
457 return (~*
this).get().erase( first, last );
476 template<
typename PT
480 if( (~*
this).isRestricted() )
481 throw std::invalid_argument(
"Invalid access to restricted element" );
483 (~*
this).
get().resize( n, preserve );
497 template<
typename PT
501 if( (~*
this).isRestricted() )
502 throw std::invalid_argument(
"Invalid access to restricted element" );
504 (~*
this).
get().reserve( n );
515 template<
typename PT
517 template<
typename Other >
520 if( (~*
this).isRestricted() )
521 throw std::invalid_argument(
"Invalid access to restricted element" );
523 (~*
this).
get().scale( scalar );
549 template<
typename PT
554 return (~*
this).get().find( index );
571 template<
typename PT
576 return (~*
this).get().lowerBound( index );
593 template<
typename PT
598 return (~*
this).get().upperBound( index );
614 template<
typename PT,
typename VT >
618 template<
typename PT,
typename VT >
622 template<
typename PT,
typename VT >
626 template<
typename PT,
typename VT >
630 template<
typename PT,
typename VT >
633 template<
typename PT,
typename VT >
636 template<
typename PT,
typename VT >
639 template<
typename PT,
typename VT >
642 template<
typename PT,
typename VT >
655 template<
typename PT
660 return proxy.
begin();
672 template<
typename PT
689 template<
typename PT
706 template<
typename PT
723 template<
typename PT
739 template<
typename PT
758 template<
typename PT
776 template<
typename PT
794 template<
typename PT
Header file for basic type definitions.
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:264
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:390
VT::Iterator Iterator
Iterator over non-constant elements.
Definition: SparseVectorProxy.h:78
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
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:287
Iterator end() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:204
Iterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SparseVectorProxy.h:574
size_t capacity() const
Returns the maximum capacity of the represented vector.
Definition: SparseVectorProxy.h:254
Iterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SparseVectorProxy.h:596
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#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:2511
Iterator set(size_t index, const ElementType &value) const
Setting an element of the represented sparse vector.
Definition: SparseVectorProxy.h:329
void erase(size_t index) const
Erasing an element from the sparse vector.
Definition: SparseVectorProxy.h:410
VT::Reference Reference
Reference to a non-constant vector value.
Definition: SparseVectorProxy.h:76
ConstIterator cend() const
Returns an iterator just past the last element of the represented vector.
Definition: SparseVectorProxy.h:218
void resize(size_t n, bool preserve=true) const
Changing the size of the represented vector.
Definition: SparseVectorProxy.h:478
#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:159
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:2505
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
size_t nonZeros() const
Returns the number of non-zero elements in the represented vector.
Definition: SparseVectorProxy.h:271
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
Iterator begin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:176
void scale(const Other &scalar) const
Scaling of the sparse vector by the scalar value scalar ( ).
Definition: SparseVectorProxy.h:518
VT::ElementType ElementType
Type of the sparse vector elements.
Definition: SparseVectorProxy.h:75
Iterator find(size_t index) const
Searches for a specific vector element.
Definition: SparseVectorProxy.h:552
Iterator insert(size_t index, const ElementType &value) const
Inserting an element into the represented sparse vector.
Definition: SparseVectorProxy.h:354
void clear() const
Clearing the represented vector.
Definition: SparseVectorProxy.h:305
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Proxy backend for sparse vector types.The SparseVectorProxy class serves as a backend for the Proxy c...
Definition: SparseVectorProxy.h:71
VT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseVectorProxy.h:79
VT::ConstReference ConstReference
Reference to a constant vector value.
Definition: SparseVectorProxy.h:77
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
size_t size() const
Returns the current size/dimension of the represented vector.
Definition: SparseVectorProxy.h:240
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
System settings for the inline keywords.
ConstIterator cbegin() const
Returns an iterator to the first element of the represented vector.
Definition: SparseVectorProxy.h:190
void reserve(size_t n) const
Setting the minimum capacity of the represented vector.
Definition: SparseVectorProxy.h:499