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

[LinearAlgebra] CompressedRowSparseMatrixConstraint: make consistent the serialization/deserialization process #5087

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Oct 31, 2024

For now, the serialization of a CSR cannot be used a deserialization as the format are different.
In a nutshell, it is not possible to do:

    std::ostringstream oss;
    oss << outMatrix;

    CSR inMatrix;
    std::istringstream iss(oss.str());
    iss >> inMatrix;

So this PR tries to fix it by changing the output format of the serialization.
+ more concise (faster to serialize, less space)
- much less human-readable

Other/complimentary solutions:
- adding a nice printing (same as the deserialization now)
- dont change the serialization but the deserialization

EDIT:

  • restoration of the pretty output in a function (prettyPrint())
  • use this print in a specialization for its Qt Widget (so no change of behavior with the Qt GUI)

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request pr: dev meeting topic PR to be discussed in sofa-dev meeting labels Oct 31, 2024
@fredroy
Copy link
Contributor Author

fredroy commented Oct 31, 2024

[ci-build][with-all-tests]

@fredroy fredroy force-pushed the fix_csr_serialization branch 2 times, most recently from dd6d831 to 37582ab Compare November 12, 2024 06:30
@fredroy fredroy removed the pr: dev meeting topic PR to be discussed in sofa-dev meeting label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant