Giter Club home page Giter Club logo

Comments (5)

alugowski avatar alugowski commented on July 18, 2024

Good question.

As of today there are three ways to handle diagonal elements of symmetric matrices:

  • the default behavior: create two elements, the second is zero
  • create two elements, both identical
  • turn off FMM symmetry handling altogether and do it yourself

These are controlled by read_options::generalize_symmetry and read_options::generalize_coordinate_diagnonal_values, see

There is no "just one element" option at the moment because such an option is more tricky to implement than it seems, largely because there is no way to know how many diagonal elements there are without reading the entire file.

A common next step after loading is to convert to something like CSR, with a sum of duplicate elements. Hence the default behavior works well for that.

If you don't allow explicit zeros, then use your library's method to drop those. Again, that's often called anyway since the matrix market format allows explicit zeros.

If neither of those apply, then you can do what the Python bindings do. Disable FMM symmetry generalization, then do it yourself. Since you know your datastructure, you can iterate it to count how many elements need to be added, resize the matrix in whatever way your datastructure requires, and duplicate the non-diagonal elements.

Though having written that last paragraph and scanned through the code a little, it seems possible to add that feature for most already supported bindings, including the one you're using. I'll have a crack at it.

from fast_matrix_market.

Rhythmicc avatar Rhythmicc commented on July 18, 2024

Thank you very much for your reply, I did in fact convert the read to CSR format and skipped the handling of the zero elements. What I'm thinking is that there has to be a place for FMM or user call code to add additional judgment conditions, and perhaps a configuration option could be added to weed out the extra zero elements.

from fast_matrix_market.

alugowski avatar alugowski commented on July 18, 2024

I added an option to handle symmetric files at the binding level, and nearly all bindings (including the triplet one you're using) no longer create those zero elements.

@Rhythmicc The change is in main and on by default, would you be able to test that it works for you?

from fast_matrix_market.

Rhythmicc avatar Rhythmicc commented on July 18, 2024

Sure, and my test results were fine.

from fast_matrix_market.

alugowski avatar alugowski commented on July 18, 2024

from fast_matrix_market.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.