Code Monkey home page Code Monkey logo

Comments (12)

lukkio88 avatar lukkio88 commented on August 16, 2024 1

So it's just a class istantiated somewhere that is necessary to call the functions, there's no particular use of it.

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on August 16, 2024

The Common class is a wrapper for cholmod_common, which is struct that stores the state of the cholmod library & needs to be passed to all cholmod functions. There isn't really an Eigen equivalent for this class, I would simply get rid of it and replace the internals of the Sparse and Dense matrix classes with Eigen equivalents.

from boundary-first-flattening.

keenancrane avatar keenancrane commented on August 16, 2024

Be warned that Eigen, though somewhat easier to install than CHOLMOD, is significantly slower.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on August 16, 2024

Hi again,

Do you reckon replacing the supernodal factoring with some of the ones provided by eigen would yield differences in quality of result?

from boundary-first-flattening.

keenancrane avatar keenancrane commented on August 16, 2024

No, I think Eigen is just gonna be slower. It's newer code, and not as well-developed as CHOLMOD/SuiteSparse.

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on August 16, 2024

The result should be the same, but supernodal is likely to be fastest. I believe Eigen provides a wrapper around the supernodal version of Cholmod.

from boundary-first-flattening.

keenancrane avatar keenancrane commented on August 16, 2024

That being said, the difference is only about a 2x slowdown for using Eigen over CHOLMOD (IIRC). So if you don't need this extra speed, it's probably no big deal.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on August 16, 2024

Thank you for the support, I realize I'm asking too many questions.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on August 16, 2024

By the way:

inline void Cholesky::buildSymbolic(cholmod_sparse *C)
{
    clear();

    factor = cholmod_l_analyze(C, common);
    if (factor) validSymbolic = true;
}

What would this be, what's a symbolic factorization in suitesparse?

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on August 16, 2024

This corresponds to the 'analyzePattern' function in Eigen's Cholesky implementation, while buildNumeric corresponds to 'factorize' function (http://eigen.tuxfamily.org/dox/classEigen_1_1SimplicialCholesky.html). The symbolic factorization determines the nonzero pattern of the Cholesky factorization, the numeric entries of the factorization are determined after computing this pattern. This is done to so that the symbolic (i.e., nonzero) pattern can be reused when only numeric values in the input matrix change.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on August 16, 2024

Hi again,

I've seen you have few error checks, like the following:

inline void Cholesky::buildSymbolic(cholmod_sparse *C)
{
    clear();

    factor = cholmod_l_analyze(C, common);
    if (factor) validSymbolic = true;
}

inline void Cholesky::buildNumeric(cholmod_sparse *C)
{
    if (factor) validNumeric = (bool)cholmod_l_factorize(C, factor, common);
}

Eigen doesn't seem to provide a mechanism to check if the factorizations are valid.
Is there anything you can suggest for an equivalent error checking? The documentation doesn't say much unfortunately, I could return a default value but I don't want to propagate any error.

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on August 16, 2024

Take a look at the "Sparse Solver Concept" section here: https://eigen.tuxfamily.org/dox/group__TopicSparseSystems.html. "solver.info()!=Success" lets you check if the decomposition failed.

from boundary-first-flattening.

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.