26 template <
typename T,
typename indexT = u
int64_t, u
int8_t compressionLevel = 3,
bool columnMajor = true>
32 void **data =
nullptr;
33 void **endPointers =
nullptr;
38 template <
typename T2,
typename indexT2>
39 void compressCSC(T2 *vals, indexT2 *innerIndices, indexT2 *outerPointers);
42 void encodeValueType();
45 void checkValueType();
51 void calculateCompSize();
54 SparseMatrix(std::unordered_map<T, std::vector<indexT>> maps[], uint32_t num_rows, uint32_t num_cols);
60 inline void inPlaceScalarMultiply(T scalar);
63 inline Eigen::VectorXd vectorMultiply(Eigen::VectorXd &vec);
69 inline Eigen::Matrix<T, -1, -1> matrixMultiply(Eigen::Matrix<T, -1, -1> &mat);
116 SparseMatrix(Eigen::SparseMatrix<T, Eigen::RowMajor> &mat);
127 template <u
int8_t compressionLevel2>
143 template <
typename T2,
typename indexT2>
144 SparseMatrix(T2 *vals, indexT2 *innerIndices, indexT2 *outerPtr, uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
155 template <
typename T2,
typename indexT2>
156 SparseMatrix(std::vector<std::tuple<indexT2, indexT2, T2>> &entries, uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
204 T
coeff(uint32_t row, uint32_t col);
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, compressionLevel, 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_Iterator.hpp:25
Definition: IVCSC_Vector.hpp:27
Definition: CSC_SparseMatrix.hpp:24
Definition: VCSC_SparseMatrix.hpp:22
Definition: IVSparse_SparseMatrixBase.hpp:20
Definition: IVCSC_SparseMatrix.hpp:27
std::vector< T > maxRowCoeff()
Definition: IVCSC_BLAS.hpp:159
IVSparse::SparseMatrix< T, indexT, 2, columnMajor > toVCSC()
Definition: IVCSC_Methods.hpp:116
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
void * vectorPointer(uint32_t vec)
Definition: IVCSC_Methods.hpp:25
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
size_t getVectorSize(uint32_t vec) const
Definition: IVCSC_Methods.hpp:33
SparseMatrix(IVSparse::SparseMatrix< T, indexT, compressionLevel2, columnMajor > &other)
T trace()
Definition: IVCSC_BLAS.hpp:205