35 #ifndef _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_
36 #define _BLAZE_MATH_PROXY_SPARSEMATRIXPROXY_H_
85 inline Reference
operator()(
size_t i,
size_t j )
const;
87 inline Iterator
begin (
size_t i )
const;
88 inline ConstIterator
cbegin(
size_t i )
const;
89 inline Iterator
end (
size_t i )
const;
90 inline ConstIterator
cend (
size_t i )
const;
97 inline size_t rows()
const;
100 inline size_t capacity(
size_t i )
const;
102 inline size_t nonZeros(
size_t i )
const;
103 inline void reset()
const;
104 inline void reset(
size_t i )
const;
105 inline void clear()
const;
106 inline Iterator
set(
size_t i,
size_t j,
const ElementType& value )
const;
107 inline Iterator
insert(
size_t i,
size_t j,
const ElementType& value )
const;
108 inline void append(
size_t i,
size_t j,
const ElementType& value,
bool check=
false )
const;
109 inline void finalize(
size_t i )
const;
110 inline void erase(
size_t i,
size_t j )
const;
111 inline Iterator
erase(
size_t i, Iterator pos )
const;
112 inline Iterator
erase(
size_t i, Iterator first, Iterator last )
const;
113 inline void resize(
size_t m,
size_t n,
bool preserve=
true )
const;
114 inline void reserve(
size_t n )
const;
115 inline void reserve(
size_t i,
size_t n )
const;
116 inline void trim()
const;
117 inline void trim(
size_t i )
const;
120 template<
typename Other >
inline void scale(
const Other& scalar )
const;
127 inline Iterator
find (
size_t i,
size_t j )
const;
128 inline Iterator
lowerBound(
size_t i,
size_t j )
const;
129 inline Iterator
upperBound(
size_t i,
size_t j )
const;
158 template<
typename PT
163 if( (~*
this).isRestricted() )
164 throw std::invalid_argument(
"Invalid access to restricted element" );
166 return (~*
this).get()(i,j);
182 template<
typename PT
187 return (~*
this).get().begin(i);
203 template<
typename PT
208 return (~*
this).get().cbegin(i);
224 template<
typename PT
229 return (~*
this).get().end(i);
245 template<
typename PT
250 return (~*
this).get().cend(i);
268 template<
typename PT
272 return (~*
this).get().rows();
282 template<
typename PT
286 return (~*
this).get().columns();
296 template<
typename PT
300 return (~*
this).get().capacity();
316 template<
typename PT
320 return (~*
this).get().capacity(i);
330 template<
typename PT
334 return (~*
this).get().nonZeros();
350 template<
typename PT
354 return (~*
this).get().nonZeros(i);
366 template<
typename PT
372 reset( (~*
this).
get() );
388 template<
typename PT
394 reset( (~*
this).
get(), i );
406 template<
typename PT
412 clear( (~*
this).
get() );
430 template<
typename PT
435 if( (~*
this).isRestricted() )
436 throw std::invalid_argument(
"Invalid access to restricted element" );
438 return (~*
this).get().set( i, j, value );
456 template<
typename PT
461 if( (~*
this).isRestricted() )
462 throw std::invalid_argument(
"Invalid access to restricted element" );
464 return (~*
this).get().insert( i, j, value );
495 template<
typename PT
499 if( (~*
this).isRestricted() )
500 throw std::invalid_argument(
"Invalid access to restricted element" );
502 (~*
this).
get().append( i, j, value, check );
520 template<
typename PT
524 if( (~*
this).isRestricted() )
525 throw std::invalid_argument(
"Invalid access to restricted element" );
527 (~*
this).
get().finalize( i );
541 template<
typename PT
545 if( (~*
this).isRestricted() )
546 throw std::invalid_argument(
"Invalid access to restricted element" );
548 (~*
this).
get().erase( i, j );
564 template<
typename PT
569 if( (~*
this).isRestricted() )
570 throw std::invalid_argument(
"Invalid access to restricted element" );
572 return (~*
this).get().erase( i, pos );
589 template<
typename PT
594 if( (~*
this).isRestricted() )
595 throw std::invalid_argument(
"Invalid access to restricted element" );
597 return (~*
this).get().erase( i, first, last );
617 template<
typename PT
621 if( (~*
this).isRestricted() )
622 throw std::invalid_argument(
"Invalid access to restricted element" );
624 (~*
this).
get().resize( m, n, preserve );
639 template<
typename PT
643 if( (~*
this).isRestricted() )
644 throw std::invalid_argument(
"Invalid access to restricted element" );
646 (~*
this).
get().reserve( n );
665 template<
typename PT
669 if( (~*
this).isRestricted() )
670 throw std::invalid_argument(
"Invalid access to restricted element" );
672 (~*
this).
get().reserve( i, n );
687 template<
typename PT
691 if( (~*
this).isRestricted() )
692 throw std::invalid_argument(
"Invalid access to restricted element" );
694 (~*
this).
get().trim();
710 template<
typename PT
714 if( (~*
this).isRestricted() )
715 throw std::invalid_argument(
"Invalid access to restricted element" );
717 (~*
this).
get().trim( i );
727 template<
typename PT
731 if( (~*
this).isRestricted() )
732 throw std::invalid_argument(
"Invalid access to restricted element" );
734 (~*
this).
get().transpose();
745 template<
typename PT
747 template<
typename Other >
750 if( (~*
this).isRestricted() )
751 throw std::invalid_argument(
"Invalid access to restricted element" );
753 (~*
this).
get().scale( scalar );
781 template<
typename PT
786 return (~*
this).get().find( i, j );
806 template<
typename PT
811 return (~*
this).get().lowerBound( i, j );
831 template<
typename PT
836 return (~*
this).get().upperBound( i, j );
852 template<
typename PT,
typename MT >
856 template<
typename PT,
typename MT >
860 template<
typename PT,
typename MT >
864 template<
typename PT,
typename MT >
868 template<
typename PT,
typename MT >
871 template<
typename PT,
typename MT >
874 template<
typename PT,
typename MT >
877 template<
typename PT,
typename MT >
880 template<
typename PT,
typename MT >
883 template<
typename PT,
typename MT >
886 template<
typename PT,
typename MT >
889 template<
typename PT,
typename MT >
892 template<
typename PT,
typename MT >
911 template<
typename PT
916 return proxy.
begin(i);
934 template<
typename PT
958 template<
typename PT
982 template<
typename PT
987 return proxy.
cend(i);
999 template<
typename PT
1003 return proxy.
rows();
1015 template<
typename PT
1031 template<
typename PT
1053 template<
typename PT
1069 template<
typename PT
1091 template<
typename PT
1109 template<
typename PT
1131 template<
typename PT
1149 template<
typename PT
Iterator set(size_t i, size_t j, const ElementType &value) const
Setting an element of the represented sparse matrix.
Definition: SparseMatrixProxy.h:433
void append(size_t i, size_t j, const ElementType &value, bool check=false) const
Appending an element to the specified row/column of the sparse matrix.
Definition: SparseMatrixProxy.h:497
Header file for basic type definitions.
Iterator insert(size_t i, size_t j, const ElementType &value) const
Inserting an element into the represented sparse matrix.
Definition: SparseMatrixProxy.h:459
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: SparseMatrixProxy.h:332
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 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
MT::Iterator Iterator
Iterator over non-constant elements.
Definition: SparseMatrixProxy.h:78
void reset() const
Reset to the default initial value.
Definition: SparseMatrixProxy.h:368
void erase(size_t i, size_t j) const
Erasing an element from the sparse matrix.
Definition: SparseMatrixProxy.h:543
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
Iterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SparseMatrixProxy.h:834
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:298
void transpose() const
Transposing the represented matrix.
Definition: SparseMatrixProxy.h:729
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: SparseMatrixProxy.h:248
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 finalize(size_t i) const
Finalizing the element insertion of a row/column.
Definition: SparseMatrixProxy.h:522
Iterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SparseMatrixProxy.h:809
MT::Reference Reference
Reference to a non-constant matrix value.
Definition: SparseMatrixProxy.h:76
Iterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SparseMatrixProxy.h:784
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Header file for the SparseMatrix base class.
Constraint on the data type.
void trim() const
Removing all excessive capacity from all rows/columns.
Definition: SparseMatrixProxy.h:689
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:185
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: SparseMatrixProxy.h:641
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
MT::ConstReference ConstReference
Reference to a constant matrix value.
Definition: SparseMatrixProxy.h:77
MT::ElementType ElementType
Type of the sparse matrix elements.
Definition: SparseMatrixProxy.h:75
void scale(const Other &scalar) const
Scaling of the sparse matrix by the scalar value scalar ( ).
Definition: SparseMatrixProxy.h:748
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
Proxy backend for sparse matrix types.The SparseMatrixProxy class serves as a backend for the Proxy c...
Definition: SparseMatrixProxy.h:71
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: SparseMatrixProxy.h:206
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
void clear() const
Clearing the represented vector.
Definition: SparseMatrixProxy.h:408
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: SparseMatrixProxy.h:284
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseMatrixProxy.h:79
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: SparseMatrixProxy.h:161
Iterator end(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: SparseMatrixProxy.h:227
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: SparseMatrixProxy.h:270
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
System settings for the inline keywords.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: SparseMatrixProxy.h:619