pymor.tools.io.matrices

Module Contents

pymor.tools.io.matrices.load_matrix(path, key=None)[source]

Load matrix from file.

Parameters:
  • path – Path to the file (str or pathlib.Path).

  • key – Key of the matrix (only for NPY, NPZ, and MATLAB files).

Returns:

matrixNumPy array of SciPy spmatrix.

Raises:

IOError – If loading fails.

pymor.tools.io.matrices.save_matrix(path, matrix, key=None)[source]

Save matrix to file.

Parameters:
  • path – Path to the file (str or pathlib.Path).

  • matrix – Matrix to save.

  • key – Key of the matrix (only for NPY, NPZ, and MATLAB files).

Raises:

IOError – If saving fails.