16#define CRS_rowSorting_D 0
17#define CCS_rowSorting_D 0
65 typename std::map<int, F>::const_iterator j =
line.begin();
66 for(; j !=
line.end(); ++j) {
91 DEBUGL(CRS_rowSorting_D,
"CRS format of " << m);
93 typedef typename F::value_type value;
98 std::map<int, value> row;
100 typename F::const_iterator i = m.begin();
101 DEBUGL(CRS_rowSorting_D,
"i = " << i);
102 for(; i != m.end(); ++i) {
103 DEBUGL((CRS_rowSorting_D && i != m.begin()),
"i = " << i);
114 xa[++r] =
nnz + row.size();
115 for(; r < getNumberofRows(m) ; )
116 xa[++r] =
nnz + row.size();
136 DEBUGL(CCS_rowSorting_D,
"CCS format of " << m);
141 uint n = m.nofCols();
143 for(
uint c = 0; c < n; ++c)
147 for(
typename F::const_iterator i = m.begin(); i != m.end(); ++i) {
148 if (i.col() < n-1) ++
xa[i.col()+1];
153 for(
uint c = 2; c < n; ++c)
159 DEBUGL(CCS_rowSorting_D,
"col_ptr = " << idx);
160 for(
typename F::const_iterator i = m.begin(); i != m.end(); ++i) {
161 int &j = idx[i.col()];
164 DEBUGL(CCS_rowSorting_D,
"write (" << i.row() <<
", " << i.col() <<
165 ", " << *i <<
") to idx " << j);
171 void convertIJK_unSorted(F& m,
typename F::type* a,
int*
irn,
int*
jcn) {
virtual uint used() const =0
Returns the number of used entries in the matrix.
virtual void convertCCS(F *a, int *asub, int *xa) const =0
virtual void convertCRS(F *a, int *asub, int *xa) const =0
virtual void convertIJK(F *a, int *irn, int *jcn) const =0
#define DEBUGL(doit, msg)
void convertCCS_rowSorting(F &m, typename F::type *a, int *asub, int *xa)
void sparseLineToArrays(std::map< int, F > &line, F *a, int *asub)
void convertCRS_rowSorting(F &m, typename F::value_type *a, int *asub, int *xa)
Set< F > makeSet(uint n, const F &first,...)