no longer needed.
-Let dSMatrixStruct be derived from Subscriptor and let the dSMatrix
- subscribe to that. The present behaviour is just about to dangerous.
-
-
Use memcpy in dSMatrix::copy_from instead of elementwise copying.
This should yield a significant speed-up.
Assert (m.max_len==0, ExcInvalidConstructorCall());
};
+
+
template <typename number>
SparseMatrix<number>&
SparseMatrix<number>::operator = (const SparseMatrix<number> &m)
return *this;
};
-
+
+
template <typename number>
SparseMatrix<number>::SparseMatrix (const SparseMatrixStruct &c) :
val(0),
max_len(0)
{
+ cols->subscribe ();
reinit();
};
template <typename number>
SparseMatrix<number>::~SparseMatrix ()
{
- delete[] val;
+ if (cols != 0)
+ cols->unsubscribe();
+
+ if (val != 0)
+ delete[] val;
};
void
SparseMatrix<number>::reinit (const SparseMatrixStruct &sparsity)
{
+ if (cols != 0)
+ cols->unsubscribe();
+
cols = &sparsity;
+ cols->subscribe();
+
reinit ();
};
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams