20 template <
typename T,
typename indexT,
bool columnMajor>
28 indexT **counts =
nullptr;
29 indexT **indices =
nullptr;
31 indexT *valueSizes =
nullptr;
32 indexT *indexSizes =
nullptr;
37 template <
typename T2,
typename indexT2>
38 void compressCSC(T2 *vals, indexT2 *innerIndices, indexT2 *outerPointers);
41 void encodeValueType();
44 void checkValueType();
50 void calculateCompSize();
53 SparseMatrix(std::unordered_map<T, std::vector<indexT>> maps[], uint32_t num_rows, uint32_t num_cols);
59 inline void inPlaceScalarMultiply(T scalar);
62 inline Eigen::VectorXd vectorMultiply(Eigen::VectorXd &vec);
68 inline Eigen::Matrix<T, -1, -1> matrixMultiply(Eigen::Matrix<T, -1, -1> &mat);
108 SparseMatrix(Eigen::SparseMatrix<T, Eigen::RowMajor> &mat);
119 template <u
int8_t compressionLevel2>
135 template <
typename T2,
typename indexT2>
136 SparseMatrix(T2 *vals, indexT2 *innerIndices, indexT2 *outerPtr, uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
145 template <
typename T2,
typename indexT2>
146 SparseMatrix(std::vector<std::tuple<indexT2, indexT2, T2>> &entries, uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
194 T
coeff(uint32_t row, uint32_t col);
208 T *getValues(uint32_t vec)
const;
214 indexT *getCounts(uint32_t vec)
const;
220 indexT *getIndices(uint32_t vec)
const;
226 indexT getNumUniqueVals(uint32_t vec)
const;
232 indexT getNumIndices(uint32_t vec)
const;
297 inline double norm();
321 void write(
const char *filename);
343 Eigen::SparseMatrix<T, columnMajor ? Eigen::ColMajor : Eigen::RowMajor>
toEigen();
377 std::vector<typename IVSparse::SparseMatrix<T, indexT, 2, columnMajor>::Vector>
slice(uint32_t start, uint32_t end);
393 T operator()(uint32_t row, uint32_t col);
402 void operator*=(T scalar);
405 Eigen::VectorXd operator*(Eigen::VectorXd &vec);
411 Eigen::Matrix<T, -1, -1> operator*(Eigen::Matrix<T, -1, -1> mat);
Definition: IVCSC_Vector.hpp:27
Definition: CSC_SparseMatrix.hpp:24
Definition: VCSC_SparseMatrix.hpp:22
SparseMatrix()
Definition: VCSC_SparseMatrix.hpp:92
SparseMatrix(IVSparse::SparseMatrix< T, indexT, compressionLevel2, columnMajor > &other)
Definition: IVSparse_SparseMatrixBase.hpp:20
Definition: IVCSC_SparseMatrix.hpp:27
std::vector< T > maxRowCoeff()
Definition: IVCSC_BLAS.hpp:159
IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector getVector(uint32_t vec)
Definition: IVCSC_Methods.hpp:29
std::vector< T > minRowCoeff()
Definition: IVCSC_BLAS.hpp:189
IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor > transpose()
Definition: IVCSC_Methods.hpp:269
void append(typename SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector &vec)
Definition: IVCSC_Methods.hpp:202
std::vector< T > innerSum()
Definition: IVCSC_BLAS.hpp:131
IVSparse::SparseMatrix< T, indexT, 1, columnMajor > toCSC()
Definition: IVCSC_Methods.hpp:92
T coeff(uint32_t row, uint32_t col)
Definition: IVCSC_Methods.hpp:17
void write(const char *filename)
Definition: IVCSC_Methods.hpp:42
void print()
Definition: IVCSC_Methods.hpp:64
T sum()
Definition: IVCSC_BLAS.hpp:219
double norm()
Definition: IVCSC_BLAS.hpp:232
Eigen::SparseMatrix< T, columnMajor ? Eigen::ColMajor :Eigen::RowMajor > toEigen()
Definition: IVCSC_Methods.hpp:169
bool isColumnMajor() const
Definition: IVCSC_Methods.hpp:21
SparseMatrix()
Definition: IVCSC_SparseMatrix.hpp:93
std::vector< T > minColCoeff()
Definition: IVCSC_BLAS.hpp:174
std::vector< T > outerSum()
Definition: IVCSC_BLAS.hpp:118
double vectorLength(uint32_t vec)
Definition: IVCSC_BLAS.hpp:245
std::vector< typename IVSparse::SparseMatrix< T, indexT, compressionLevel, columnMajor >::Vector > slice(uint32_t start, uint32_t end)
Definition: IVCSC_Methods.hpp:350
std::vector< T > maxColCoeff()
Definition: IVCSC_BLAS.hpp:144
void inPlaceTranspose()
Definition: IVCSC_Methods.hpp:311
~SparseMatrix()
Destroy the Sparse Matrix object.
Definition: IVCSC_Constructors.hpp:15
T trace()
Definition: IVCSC_BLAS.hpp:205