dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #03029
More linear algebra...
Some more inconsistencies in the linear algebra interface:
1. In GenericVector, there's an operator() but not in GenericMatrix.
Should we add one to GenericMatrix?
2. Should we make it assignable? This would require the
GenericMatrix::Element trick. Maybe it's ok since this is just a fix
for the C++ interface? Indexing in the Python interface is handled
differently anyway.
3. Are all the functions in GenericMatrix/Vector necessary? Could some
be removed? Also, there are plenty of functions in PETScMatrix/Vector
and uBlasMatrix/Vector that are not in GenericMatrix/Vector. Should we
make sure that the interface stays the same for all linear algebra
types so for example only GenericMatrix functions are present in the
public interface of PETScMatrix?
4. Indexing in a PETSc matrix does not work as expected:
>>> from dolfin import *
>>> A = Matrix(10, 10)
>>> print A[(5,5)]
[0]PETSC ERROR: MatGetValues() line 1324 in src/mat/interface/matrix.c
[0]PETSC ERROR: Object is in wrong state!
[0]PETSC ERROR: Not for unassembled matrix!
1.27319747458e-313
The natural would be for this to return zero.
/Anders
Follow ups