28 #if !defined(_SPARSE_MATRIX_H_)
29 #define _SPARSE_MATRIX_H_ 1
46 #if !defined(BEGIN_NAMESPACE)
47 #define BEGIN_NAMESPACE(x) namespace x {
48 #define END_NAMESPACE(x) }
59 virtual const char *
what()
const throw() {
return msg; }
76 std::vector<int>
const & permutationHML);
79 for(
int i=0; i<n; i++) {
80 delete [](columns[i]);
81 delete [](offsets[i]);
90 void print(
const char *title)
const;
95 std::vector<int>
const & permutationHML)
const;
102 const int *hi = his[col];
104 for(idx = 0; idx < cnt[col] && row >hi[idx]; ++idx);
107 throw Exception(
"SparseMatrix::add called with incorrect args");
108 int offset = offsets[col][idx];
112 columnData[row-offset] += val;
120 const ergo_real *columnData = columns[col];
121 const int *hi = his[col];
122 int idx;
for(idx = 0; idx < cnt[col] && row >hi[idx]; ++idx);
124 throw Exception(
"SparseMatrix::at called with incorrect args");
126 int offset = offsets[col][idx];
130 return columnData[row-offset];
140 const
int* nblocks, const
int (*iblocks)[2],
145 const
int* nblocks, const
int (*iblocks)[2],