store Cython buffers in low-level mumps classes
Currently MUMPSContext
has to keep self.row
, self.col
and self.data
around in addition to calling self.mumps_instance.set_assembled_matrix
. This is because the low-level mumps_instance
only keeps around the pointers. This means that each call to set_assembled_matrix
needs to be accompanied by extra code, or memory will be corrupted.
Instead, we should keep around Cython memoryviews inside the low-level classes, one per array, and ensure that the pointers are always pointing to the start of these memoryviews. The memoryview will ensure that the underlying buffer is not deallocated.