Giter Site home page Giter Site logo

custom number types about qdldl HOT 6 CLOSED

osqp avatar osqp commented on May 25, 2024
custom number types

from qdldl.

Comments (6)

goulart-paul avatar goulart-paul commented on May 25, 2024

I'm not necessarily against doing this, but note that I haved use bool, float and int types in the factorisation to keep the memory footprint small. If we are to enumerate overall a variety of input types then we should probably replace bool with int to minimize the number of combinations.

from qdldl.

mlubin avatar mlubin commented on May 25, 2024

I'd agree that there's no real need to let the bool type vary. int (or something else set at compile-time config) is a reasonable choice.

from qdldl.

goulart-paul avatar goulart-paul commented on May 25, 2024

I would be happy to insist that the boolean type should always be of type bool (or _Bool), but that doesn't exist in C89. The reason for making it user definable was largely to preserve the option to define it as 'int' if when there is no native boolean type.

If it is to be the same type as the other ints (most likely int64), then there is a fairly large memory penalty if you have a really huge matrix with very low density.

from qdldl.

bstellato avatar bstellato commented on May 25, 2024

Another possibility is to specify the types as CMakeLists.txt options in a qdldl_configure.h.in file as done for osqp here. The same could be done with the bool/int decision for memory usage. What do you think?

from qdldl.

mlubin avatar mlubin commented on May 25, 2024

Given that C89/C99 support is known at compile time, it's quite reasonable to let this be a config option or just switch on int/bool with macros based on the value of __STDC_VERSION__.

from qdldl.

bstellato avatar bstellato commented on May 25, 2024

This should be fixed in 2644bc2. CMake flags for doubles and integers + __STDC_VERSION__ check for bools.

from qdldl.

Related Issues (16)

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.