I currently have a SparseStore matrix on which I perform a lot of counting and calculations. I want to store it to file, so I can later reuse it without re-doing all previous calculations.
I tried basic serialization in Java:
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(exportFileName));
outputStream.writeObject(mySparseStoreInstance);
but it seems the class doesn't implement java.io.Serializable:
java.io.NotSerializableException: org.ojalgo.matrix.store.SparseStore
I wouldn't mind changing to Array2D or some other ojalgo sparse structure, but also can't find if any of those can be serialized.
What is recommended to store sparse arrays to file?