28 template <
typename T,
typename indexT = u
int64_t, u
int8_t compressionLevel = 3,
bool columnMajor = true>
33 void **data =
nullptr;
34 void **endPointers =
nullptr;
39 template <
typename T2,
typename indexT2>
40 void compressCSC(T2 *vals, indexT2 *innerIndices, indexT2 *outerPointers);
43 void encodeValueType();
46 void checkValueType();
52 void calculateCompSize();
55 SparseMatrix(std::unordered_map<T, std::vector<indexT>> maps[],
56 uint32_t num_rows, uint32_t num_cols);
60 scalarMultiply(T scalar);
63 inline void inPlaceScalarMultiply(T scalar);
66 inline Eigen::Matrix<T, -1, 1> vectorMultiply(Eigen::Matrix<T, -1, 1> vec);
69 inline Eigen::Matrix<T, -1, 1> vectorMultiply(
74 inline Eigen::Matrix<T, -1, -1> matrixMultiply(Eigen::Matrix<T, -1, -1> mat);
123 SparseMatrix(Eigen::SparseMatrix<T, Eigen::RowMajor> &mat);
136 template <u
int8_t compressionLevel2>
147 columnMajor> &other);
155 template <
typename T2,
typename indexT2>
156 SparseMatrix(T2 *vals, indexT2 *innerIndices, indexT2 *outerPtr,
157 uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
170 template <
typename T2,
typename indexT2>
171 SparseMatrix(std::vector<std::tuple<indexT2, indexT2, T2>> &entries,
172 uint32_t num_rows, uint32_t num_cols, uint32_t nnz);
182 columnMajor>::
Vector &vec);
192 T, indexT, compressionLevel, columnMajor>::
Vector> &vecs);
227 T
coeff(uint32_t row, uint32_t col);
322 inline double norm();
346 void write(
const char *filename);
369 Eigen::SparseMatrix<T, columnMajor ? Eigen::ColMajor : Eigen::RowMajor>
401 columnMajor>::
Vector &vec);
409 slice(uint32_t start, uint32_t end);
429 T operator()(uint32_t row, uint32_t col);
434 operator[](uint32_t vec);
441 void operator*=(T scalar);
444 Eigen::Matrix<T, -1, 1> operator*(Eigen::Matrix<T, -1, 1> vec);
447 Eigen::Matrix<T, -1, 1> operator*(
452 Eigen::Matrix<T, -1, -1> operator*(Eigen::Matrix<T, -1, -1> mat);
Definition: IVCSC_Iterator.hpp:25
Definition: IVCSC_Vector.hpp:25
Definition: CSC_SparseMatrix.hpp:24
Definition: VCSC_SparseMatrix.hpp:21
Definition: IVSparse_SparseMatrixBase.hpp:20
Definition: IVCSC_SparseMatrix.hpp:29
std::vector< T > maxRowCoeff()
Definition: IVCSC_BLAS.hpp:161
IVSparse::SparseMatrix< T, indexT, 2, columnMajor > toVCSC()
Definition: IVCSC_Methods.hpp:153
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
void * vectorPointer(uint32_t vec)
Definition: IVCSC_Methods.hpp:36
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
size_t getVectorSize(uint32_t vec) const
Definition: IVCSC_Methods.hpp:57
SparseMatrix(IVSparse::SparseMatrix< T, indexT, compressionLevel2, columnMajor > &other)
T trace()
Definition: IVCSC_BLAS.hpp:218