16 template <
typename T,
typename indexT,
bool columnMajor>
20 assert(vec < matrix.outerDim && vec >= 0 &&
"The vector index is out of bounds!");
26 this->counts =
nullptr;
27 this->indices =
nullptr;
50 this->index = indices[0];
51 this->count = counts[0];
55 template <
typename T,
typename indexT,
bool columnMajor>
58 if (vector.nonZeros() == 0) {
60 this->counts =
nullptr;
61 this->indices =
nullptr;
75 this->vals = vector.getValues();
76 this->counts = vector.getCounts();
77 this->indices = vector.getIndices();
79 this->valsSize = vector.uniqueVals();
80 this->indexSize = vector.nonZeros();
84 this->index = indices[0];
85 this->count = counts[0];
91 template <
typename T,
typename indexT,
bool columnMajor>
97 template <
typename T,
typename indexT,
bool columnMajor>
103 template <
typename T,
typename indexT,
bool columnMajor>
109 template <
typename T,
typename indexT,
bool columnMajor>
116 template <
typename T,
typename indexT,
bool columnMajor>
118 if constexpr (!columnMajor) {
126 template <
typename T,
typename indexT,
bool columnMajor>
128 if constexpr (!columnMajor) {
138 template <
typename T,
typename indexT,
bool columnMajor>
139 T &SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator*() {
144 template <
typename T,
typename indexT,
bool columnMajor>
145 bool SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator==(
const InnerIterator &other) {
146 return values == other.values;
150 template <
typename T,
typename indexT,
bool columnMajor>
151 bool SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator!=(
const InnerIterator &other) {
152 return values != other.values;
156 template <
typename T,
typename indexT,
bool columnMajor>
157 bool SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator<(
const InnerIterator &other) {
158 return values < other.values;
162 template <
typename T,
typename indexT,
bool columnMajor>
163 bool SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator>(
const InnerIterator &other) {
164 return values > other.values;
168 template <
typename T,
typename indexT,
bool columnMajor>
169 inline void SparseMatrix<T, indexT, 2, columnMajor>::InnerIterator::operator++() {
179 if (countIndex >= indexSize) {
void coeff(T newValue)
Definition: IVCSC_Iterator_Methods.hpp:113
T value()
Definition: IVCSC_Iterator_Methods.hpp:101
indexT row()
Definition: IVCSC_Iterator_Methods.hpp:119
indexT col()
Definition: IVCSC_Iterator_Methods.hpp:129
indexT outerDim()
Definition: IVCSC_Iterator_Methods.hpp:95
indexT getIndex()
Definition: IVCSC_Iterator_Methods.hpp:107
InnerIterator()
Definition: IVCSC_Iterator.hpp:57
Definition: VCSC_SparseMatrix.hpp:21
indexT getNumUniqueVals(uint32_t vec) const
Definition: VCSC_Methods.hpp:48
indexT * getCounts(uint32_t vec) const
Definition: VCSC_Methods.hpp:35
indexT getNumIndices(uint32_t vec) const
Definition: VCSC_Methods.hpp:58
indexT * getIndices(uint32_t vec) const
Definition: VCSC_Methods.hpp:41
T * getValues(uint32_t vec) const
Definition: VCSC_Methods.hpp:29