Fixes #963
(Actually, PETSC 3.19.0 broke the world.)
This PR:
Assembles before multTranspose to prevent newly added exception
Renames bandwidth to nonZerosPerRow and removes sizeHint
The two were confusingly redundant:
PySparse takes sizeHint, the number of non-zeros in the matrix.
PyTrilinos takes NumEntriesPerRow.
petsc4py didn't used to be clear what it took, but is now
documented as number of non-zeros per row (of the local portion
of the matrix, but we'll ignore that part).
scipy doesn't preallocate.
Linear algebra
defines bandwidth
as "number $k$ such that $a_{i,j}=0$ if $|i-j| > k$", which is
roughly half the number of non-zeros per row (and only applies
to a band-diagonal matrix).
Better to be explicit about what we really mean.
Now all take same parameter and PySparse adjusts as needed.
sizeHint was introduced in @a15d696 (in 2006!) to
"allow smaller preallocations", but it was never used that way.
Now, nonZerosPerRow can take an array_like to specify row-by-row
preallocations, which are directly supported by PyTrilinos and petsc4py,
and can be simulated for PySparse.
Added exactNonZeros, which may have performance benefits for
PyTrilinos and petsc4py. Currently unused.
Uses Term's knowledge of own stencil to preallocate more effectively.
Still doesn't do a good job with vector equations, but that's a deeper change
(the resolution of which might help #920).
Fixes #963 (Actually, PETSC 3.19.0 broke the world.)
This PR:
multTranspose
to prevent newly added exceptionRenames
bandwidth
tononZerosPerRow
and removessizeHint
The two were confusingly redundant:
sizeHint
, the number of non-zeros in the matrix.NumEntriesPerRow
.Now all take same parameter and PySparse adjusts as needed.
sizeHint
was introduced in @a15d696 (in 2006!) to "allow smaller preallocations", but it was never used that way. Now,nonZerosPerRow
can take an array_like to specify row-by-row preallocations, which are directly supported by PyTrilinos and petsc4py, and can be simulated for PySparse.Added
exactNonZeros
, which may have performance benefits for PyTrilinos and petsc4py. Currently unused.Term
's knowledge of own stencil to preallocate more effectively. Still doesn't do a good job with vector equations, but that's a deeper change (the resolution of which might help #920).