// DD_MATCONV.H #ifndef DD_MATCONV_H #define DD_MATCONV_H #include "Constants.h" #include "sparmat.h" #include "../dgtd-performance.hpp" class matlist { friend class matconv; public: int col; matlist *next; public: matlist(); void print(); }; // needed for de-allocating memory class list2 { public: list2 *next; matlist *matListPtr; public: list2(); }; class matconv { friend class matlist; private: matlist* newMem; matlist* matDiag; int dim; int NZ; MatrixType type; list2 *allocPos; list2 *tmpList2; public: matconv(); ~matconv(); void setMatType(MatrixType t) { type = t; } char getMatType() { return type; } int getNZ() { return NZ; } void deleteMemory(); void init(int n); void setDim(int); void setNsDim(int n); void addentry(int r, int c); void addNsEntry(int r, int c); void blockAddEntry(int n, int *map); void blockAddEntry(int n, int *rowMap, int *colMap); void blockAddEntry(int rowDim, int colDim, int *rowMap, int *colMap); void conversion(sparMat *A); void print(); void setDimNonSymm(int n); void addentryNonSymm(int r, int c); void blockAddEntryNonSymm(int rowDim, int colDim, int *rowMap, int *colMap); void conversionNonSymm(sparMat *A); void conversion(sparMat *A, int rowDim, int colDim); private: void blockMemory(int n); void freeMemory(matlist *entry); }; #endif