SparseMatrixStruct (const unsigned int n,
const unsigned int max_per_row);
+ /**
+ * Copy operator. For this the same holds
+ * as for the copy constructor: it is
+ * declared, defined and fine to be called,
+ * but the latter only for empty objects.
+ */
+ SparseMatrixStruct & operator = (const SparseMatrixStruct &);
+
/**
* Make a copy with extra off-diagonals.
*
*/
bool compressed;
- /**
- * Copy operator. Declare but don't
- * define it and make it private above
- * that to avoid that anyone tries to
- * use this operator.
- */
- SparseMatrixStruct & operator = (const SparseMatrixStruct &);
-
template <typename number> friend class SparseMatrix;
};
+SparseMatrixStruct &
+SparseMatrixStruct::opertor = (const SparseMatrixStruct &s)
+{
+ Assert (s.rowstart == 0, ExcInvalidConstructorCall());
+ Assert (s.colnums == 0, ExcInvalidConstructorCall());
+ Assert (s.rows == 0, ExcInvalidConstructorCall());
+ Assert (s.cols == 0, ExcInvalidConstructorCall());
+
+ // no need to free existing arrays, since we
+ // should never get here.
+ max_dim = 0;
+ max_vec_len = 0;
+ rowstart = 0;
+ colnums = 0;
+
+ reinit (0,0,0);
+};
+
+
+
void
SparseMatrixStruct::reinit (const unsigned int m,