20 template <
typename T,
typename indexT,
bool columnMajor>
26 indexT **counts =
nullptr;
27 indexT **indices =
nullptr;
29 indexT *valueSizes =
nullptr;
30 indexT *indexSizes =
nullptr;
35 template <
typename T2,
typename indexT2>
36 void compressCSC(T2 *vals, indexT2 *innerIndices, indexT2 *outerPointers);
39 void encodeValueType();
42 void checkValueType();
48 void calculateCompSize();
51 SparseMatrix(std::unordered_map<T, std::vector<indexT>> maps[],
52 uint32_t num_rows, uint32_t num_cols);
59 inline void inPlaceScalarMultiply(T scalar);
62 inline Eigen::Matrix<T, -1, 1> vectorMultiply(Eigen::Matrix<T, -1, 1> &vec);
65 inline Eigen::Matrix<T, -1, 1> vectorMultiply(
108 SparseMatrix(Eigen::SparseMatrix<T, Eigen::RowMajor> &mat);
121 template <u
int8_t compressionLevel2>
139 template <
typename T2,
typename indexT2>
140 SparseMatrix(T2 *vals, indexT2 *innerIndices, indexT2 *outerPtr,
141 uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
151 template <
typename T2,
typename indexT2>
152 SparseMatrix(std::vector<std::tuple<indexT2, indexT2, T2>> &entries,
153 uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
173 T, indexT, 2, columnMajor>::Vector> &vecs);
208 T
coeff(uint32_t row, uint32_t col);
222 T *getValues(uint32_t vec)
const;
228 indexT *getCounts(uint32_t vec)
const;
234 indexT *getIndices(uint32_t vec)
const;
240 indexT getNumUniqueVals(uint32_t vec)
const;
247 indexT getNumIndices(uint32_t vec)
const;
314 inline double norm();
338 void write(
const char *filename);
361 Eigen::SparseMatrix<T, columnMajor ? Eigen::ColMajor : Eigen::RowMajor>
400 slice(uint32_t start, uint32_t end);
417 T operator()(uint32_t row, uint32_t col);
427 void operator*=(T scalar);
430 Eigen::Matrix<T, -1, 1> operator*(Eigen::Matrix<T, -1, 1> &vec);
433 Eigen::Matrix<T, -1, 1> operator*(
437 Eigen::Matrix<T, -1, -1> operator*(Eigen::Matrix<T, -1, -1> mat);
Definition: IVCSC_Vector.hpp:25
Definition: CSC_SparseMatrix.hpp:24
Definition: VCSC_SparseMatrix.hpp:21
SparseMatrix()
Definition: VCSC_SparseMatrix.hpp:91
SparseMatrix(IVSparse::SparseMatrix< T, indexT, compressionLevel2, columnMajor > &other)
Definition: IVSparse_SparseMatrixBase.hpp:20
Definition: IVCSC_SparseMatrix.hpp:29
std::vector< T > maxRowCoeff()
Definition: IVCSC_BLAS.hpp:161
IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector getVector(uint32_t vec)
Definition: IVCSC_Methods.hpp:47
std::vector< T > minRowCoeff()
Definition: IVCSC_BLAS.hpp:199
IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor > transpose()
Definition: IVCSC_Methods.hpp:329
void append(typename SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector &vec)
Definition: IVCSC_Methods.hpp:245
std::vector< T > innerSum()
Definition: IVCSC_BLAS.hpp:126
IVSparse::SparseMatrix< T, indexT, 1, columnMajor > toCSC()
Definition: IVCSC_Methods.hpp:126
T coeff(uint32_t row, uint32_t col)
Definition: IVCSC_Methods.hpp:17
void write(const char *filename)
Definition: IVCSC_Methods.hpp:72
void print()
Definition: IVCSC_Methods.hpp:97
T sum()
Definition: IVCSC_BLAS.hpp:239
double norm()
Definition: IVCSC_BLAS.hpp:256
Eigen::SparseMatrix< T, columnMajor ? Eigen::ColMajor :Eigen::RowMajor > toEigen()
Definition: IVCSC_Methods.hpp:210
bool isColumnMajor() const
Definition: IVCSC_Methods.hpp:30
SparseMatrix()
Definition: IVCSC_SparseMatrix.hpp:99
std::vector< T > minColCoeff()
Definition: IVCSC_BLAS.hpp:180
std::vector< T > outerSum()
Definition: IVCSC_BLAS.hpp:111
double vectorLength(uint32_t vec)
Definition: IVCSC_BLAS.hpp:272
std::vector< typename IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector > slice(uint32_t start, uint32_t end)
Definition: IVCSC_Methods.hpp:416
std::vector< T > maxColCoeff()
Definition: IVCSC_BLAS.hpp:142
void inPlaceTranspose()
Definition: IVCSC_Methods.hpp:374
~SparseMatrix()
Destroy the Sparse Matrix object.
Definition: IVCSC_Constructors.hpp:15
T trace()
Definition: IVCSC_BLAS.hpp:218