Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCSMatrix not serializable #264

Closed
astanway opened this issue Dec 18, 2015 · 3 comments
Closed

CCSMatrix not serializable #264

astanway opened this issue Dec 18, 2015 · 3 comments

Comments

@astanway
Copy link

CCSMatrix sparseColumnMatrix = new CCSMatrix(5, 5);
File file = new File("matrix.bin");
FileOutputStream fop = new FileOutputStream(file);
ObjectOutputStream oos = new ObjectOutputStream(fop);
oos.writeObject(sparseColumnMatrix);

gets

java.io.NotSerializableException: org.la4j.matrix.sparse.CRSMatrix
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)

Also fails on CRSMatrix. Any ideas? Is serialization not supported for sparse matrices?

@vkostyukov
Copy link
Owner

It should definetelly work. Mind opening a PR with a fix? Sorry I not involved in la4j any rather than merging PRs and releasing new versions.

@vkostyukov
Copy link
Owner

Oh, I'm now thinking it shoundn't be serializible: it's been a while I was looking at the source code. You could do:

CCSMatrix m = new CCSMatrix(5, 5);
byte[] array = m.toBinary();

@astanway
Copy link
Author

Thanks - although, that won't tell me how much space the sparse matrix
itself takes up, which is what I'm trying to measure :/

On Fri, Dec 18, 2015 at 3:04 PM, Vladimir Kostyukov <
notifications@github.com> wrote:

Oh, I'm now thinking it shoundn't be serializible: it's been a while I was
looking at the source code. You could do:

CCSMatrix m = new CCSMatrix(5, 5);byte[] array = m.toBinary();


Reply to this email directly or view it on GitHub
#264 (comment).

Abe Stanway
abe.is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants