[petsc-dev] [petsc-users] ublas sparse matrix bindings?

Jed Brown jed at 59A2.org
Fri Jul 2 13:45:44 CDT 2010

On Tue, 29 Jun 2010 15:26:38 -0500, Matthew Knepley <knepley at gmail.com> wrote:
> I am not so sure here. Our problem is not with type parametrization so much
> I think (since MatScalar is there)
> but with mixing this with another value type. I suspect that a templated
> version would have 1G of compiler
> errors right now.

PETSc's philosophy often involves moving the solver to the highest level
of control (instead of rolling loops around the solver as an ad-hoc way
to answer a question of interest).  If you have matrices/vectors with
different scalar type/precision, then you would naturally want entries
of mixed type within single matrices and vectors (and usually mixed type
within blocks associated with nodes/cells of your discretization).  C++
templates are pretty much inadequate for this because you would want to
flatten the recursive types (not to mention the error message and
compilation time insanity).


More information about the petsc-dev mailing list