IVSparse  v1.0
A sparse matrix compression library.
CSC_Iterator.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 
11 namespace IVSparse {
12 
19 template <typename T, typename indexT, bool columnMajor>
20 class SparseMatrix<T, indexT, 1, columnMajor>::InnerIterator {
21  private:
22  //* Private Class Variables *//
23 
24  T *val; // Current value
25  indexT index; // Current index
26  indexT outer; // Outer dimension
27 
28  T *vals;
29  indexT *indices;
30  indexT *endPtr;
31 
32  public:
33  //* Constructors & Destructor *//
36 
43 
50  InnerIterator(SparseMatrix<T, indexT, 1, columnMajor> &mat, uint32_t vec);
51 
58 
60 
61  //* Getters *//
64 
69  indexT getIndex();
70 
74  indexT outerDim();
75 
79  indexT row();
80 
84  indexT col();
85 
89  T value();
90 
99  void coeff(T newValue);
100 
102 
103  //* Operator Overloads *//
104 
105  // Prefix Increment Operator
106  void __attribute__((hot)) operator++();
107 
108  // Equality Operator
109  bool operator==(const InnerIterator &other);
110 
111  // Inequality Operator
112  bool operator!=(const InnerIterator &other);
113 
114  // Less Than Operator
115  bool operator<(const InnerIterator &other);
116 
117  // Greater Than Operator
118  bool operator>(const InnerIterator &other);
119 
120  // Dereference Operator
121  T &operator*();
122 
123  // Bool Operator
124  inline __attribute__((hot)) operator bool() { return indices < endPtr; };
125 
126 }; // class InnerIterator
127 
128 } // namespace IVSparse
Definition: IVCSC_Vector.hpp:25
Definition: CSC_SparseMatrix.hpp:24
Definition: IVCSC_SparseMatrix.hpp:29
T coeff(uint32_t row, uint32_t col)
Definition: IVCSC_Methods.hpp:17