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 
22  private:
23  //* Private Class Variables *//
24 
25  T *val; // Current value
26  indexT index; // Current index
27  indexT outer; // Outer dimension
28 
29  T *vals;
30  indexT *indices;
31  indexT *endPtr;
32 
33  public:
34  //* Constructors & Destructor *//
37 
44 
51  InnerIterator(SparseMatrix<T, indexT, 1, columnMajor> &mat, uint32_t vec);
52 
59 
61 
62  //* Getters *//
65 
70  indexT getIndex();
71 
75  indexT outerDim();
76 
80  indexT row();
81 
85  indexT col();
86 
90  T value();
91 
100  void coeff(T newValue);
101 
103 
104  //* Operator Overloads *//
105 
106  // Prefix Increment Operator
107  void __attribute__((hot)) operator++();
108 
109  // Equality Operator
110  bool operator==(const InnerIterator &other);
111 
112  // Inequality Operator
113  bool operator!=(const InnerIterator &other);
114 
115  // Less Than Operator
116  bool operator<(const InnerIterator &other);
117 
118  // Greater Than Operator
119  bool operator>(const InnerIterator &other);
120 
121  // Dereference Operator
122  T &operator*();
123 
124  // Bool Operator
125  inline __attribute__((hot)) operator bool() { return indices < endPtr; };
126 
127  }; // class InnerIterator
128 
129 } // namespace IVSparse
Definition: IVCSC_Vector.hpp:27
Definition: CSC_SparseMatrix.hpp:24
Definition: IVCSC_SparseMatrix.hpp:27
T coeff(uint32_t row, uint32_t col)
Definition: IVCSC_Methods.hpp:17