dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02352
More thoughts on the linear algebra
I thought about the linear algebra some more...
If we make the main interface a template, doesn't that mean we need to
template all the assembly routines?
My suggestion would therefore be to do the usual envelope-letter design
that we have in other places with a class Matrix as the common
interface, but at the same time allow users to work with the
DenseMatrix class. If someone needs to do something which is more
efficient with the DenseMatrix class or do something which is not
supported by the common interface, then use a DenseMatrix.
If we then supply constructors in Matrix that accept as arguments
either SparseMatrix or DenseMatrix, one can call the assembly routines
(which take as input a Matrix) with a DenseMatrix as well as with a
Matrix.
This way, there would be no overhead in accessing individual elements
(if you work through the DenseMatrix interface) and there would be a
common interface Matrix which can be used whenever someone does not
have special need for individual accessing.
/Anders
Follow ups