16 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
22 data = (
void *)0xFFFFFFFFFFFFFFFF;
23 endPtr = (
void *)0xFFFFFFFFFFFFFFFF;
37 data = (uint8_t *)data +
sizeof(T);
40 indexWidth = *(uint8_t *)data;
41 data = (uint8_t *)data +
sizeof(uint8_t);
48 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
54 data = vector.
begin();
57 if (data ==
nullptr) {
64 data = (uint8_t *)data +
sizeof(T);
67 endPtr = vector.
end();
70 indexWidth = *(uint8_t *)data;
71 data = (uint8_t *)data +
sizeof(uint8_t);
80 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
84 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
88 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
92 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
96 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
100 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
102 if constexpr (!columnMajor) {
return outer; }
103 else {
return index; }
107 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
109 if constexpr (!columnMajor) {
return index;}
116 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
119 switch (indexWidth) {
121 newIndex =
static_cast<indexT
>(*
static_cast<uint8_t *
>(data));
124 newIndex =
static_cast<indexT
>(*
static_cast<uint16_t *
>(data));
127 newIndex =
static_cast<indexT
>(*
static_cast<uint32_t *
>(data));
130 newIndex =
static_cast<indexT
>(*
static_cast<uint64_t *
>(data));
138 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
139 T &SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator*() {
return *val; }
142 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
143 bool SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator==(
const InnerIterator &other) {
return data == other.getIndex(); }
146 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
147 bool SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator!=(
const InnerIterator &other) {
return data != other.getIndex(); }
150 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
151 bool SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator<(
const InnerIterator &other) {
return data < other.getIndex(); }
154 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
155 bool SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator>(
const InnerIterator &other) {
return data > other.getIndex(); }
158 template <
typename T,
typename indexT, u
int8_t compressionLevel,
bool columnMajor>
159 void SparseMatrix<T, indexT, compressionLevel, columnMajor>::InnerIterator::operator++() {
161 data = (uint8_t *)data + indexWidth;
168 if (data >= (uint8_t *)endPtr - indexWidth) [[unlikely]] {
return; }
170 data = (uint8_t *)data + indexWidth;
174 data = (uint8_t *)data +
sizeof(T);
177 indexWidth = *(uint8_t *)data;
178 data = (uint8_t *)data +
sizeof(uint8_t);
void coeff(T newValue)
Definition: IVCSC_Iterator_Methods.hpp:97
T value()
Definition: IVCSC_Iterator_Methods.hpp:89
indexT row()
Definition: IVCSC_Iterator_Methods.hpp:101
indexT col()
Definition: IVCSC_Iterator_Methods.hpp:108
indexT outerDim()
Definition: IVCSC_Iterator_Methods.hpp:85
indexT getIndex()
Definition: IVCSC_Iterator_Methods.hpp:93
InnerIterator()
Definition: IVCSC_Iterator.hpp:58
bool isNewRun()
Definition: IVCSC_Iterator_Methods.hpp:81
Definition: IVCSC_Vector.hpp:27
void * end()
Definition: IVCSC_Vector_Methods.hpp:171
void * begin()
Definition: IVCSC_Vector_Methods.hpp:167
Definition: IVCSC_SparseMatrix.hpp:27
void * vectorPointer(uint32_t vec)
Definition: IVCSC_Methods.hpp:25
size_t getVectorSize(uint32_t vec) const
Definition: IVCSC_Methods.hpp:33