sparse non-negative least squares in C++ [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for a software package to solve a very large, sparse non-linear least squares problem in C++. I've come across a large number of modern linalg libraries in C++ (eigen, armadillo, boost, etc.), but none seem to have such a solver (or even a regular least-squares solver) built in. I'd really like to avoid a bunch of messy calls to an old C / Fortran interface if possible. Thanks!

I would simply use the general-purpose NLP solver IPOPT written in C++. It is the most robust solver among those I have tried and it is meant and successfully used on very large problems.
A change in requirements (e.g. adding constraints) would be no problem if you use the general-purpose IPOPT.
The time consuming part of the solution procedure is to solve the linear systems in each iteration step so it's worth getting the best linear solver + LinAlg package for your platform.
Unfortunately IPOPT calls Fortran subroutines internally so you will need a Fortran compiler which is sort of a pain.
If IPOPT is not enough, you will have to look for a problem specific solver.

If you don't need constraints, try out Ceres or g2o. Both build on top of Eigen and can utilize sparse matrix solvers, i.e. SuiteSparse and friends.

Related

Is there a fast and free alternative to MATLAB regarding matrix calculations? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for a fast and free alternative to MATLAB regarding matrix calculations (inversions, etc).
MATLAB is fast but also expensive.
Besides, as it is an interpreted language, I think there must be libraries for compiled languages which can achieve the same matrix operations faster.
I know Octave but I have heard it is slower than MATLAB...
Does anyone know of something?
Since you tagged your question with C++, I suggest Eigen.
I think that python with some library like SciPy and NumPy can be a good solution. (Python is not a strictly compiled language, but most of the libraries are written in C/C++ and are pretty fast).
I personally use the unofficial OpenGL Math Library GLM. It should have everything you should need.
http://glm.g-truc.net/0.9.5/index.html

finding static scheduling of DAG for multiprocessors - library? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have a graph of the dependencies of all tasks, and the costs of each task. Now I want to calculate a scheduling for a given amount of CPUs. I've found many papers on scheduling algorithms, optimal schedulers seem to be too expensive for my problem size (around 100 nodes) as it's an NP-hard problem. I'd settle for a heuristic, preferably one that has a bound how close it gets to the optimum. My problem now is: do I really have to code it myself?? This should have been solved many times before, it can be easily applied to project management, maybe there something exists?
If you happen to know a library in python that'd be perfect or the next best thing would be C++, otherwise i'd settle for anything else.
This is a pretty common problem. It also shows up in hardware design.
There has been a lot of work on algorithms to solve it.
If you are going to write something yourself, start by checking out "Hu's Algorithm".
If you just want a solution, these functions are built into architectural synthesis programs.
Look at the Wikipedia pages on high level synthesis and logic synthesis.
There are several professional tools that can handle this, if you can get access to them through school or work.
There are university programs you can often get for free that can also handle this problem.
I'm not up-to-date on what is currently available. An very old one is MIS II from Berkeley. It's scripting language was Tcl, not Python.

What can I use for developing on FPGA (Virtex): C, C++, OpenCL, MPI? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
What can I use for developing on FPGA Virtex-5 or Virtex-7: C, C++, C++11, OpenCL, MPI?
And what is mostly usually uses for this?
There are:
SystemC is a set of C++ classes and macros which provide an event-driven simulation interface in C++
AutoESL
Vivado HLS - (High-level synthesis)
VHDL (VHSIC(very-high-speed integrated circuits) Hardware Description Language
Software-based system realization with C/C++ and Future plans for OpenCL support
A FPGA is just a big configurable circuit, and developing for it is creating a program that is "compiled" into a gigantic map of how the transistors and other low-level components are configured. It is fundamentally different from a normal CPU, or even a GPU : it is massively parallel at a very low level.
Programming such board requires another way of thinking. There are two main strategies:
Develop with System Verilog, or another HDL (Hardware Description Language),
Use SystemC, or other wrapper that allows you to use C/C++ for FPGA (it will be less optimized)
Normally, the board should come with a manual indicating what to use to program it.
On a personal side, I never used OpenCL with a FPGA (but I used CUDA for GPGPU), so I don't know how it works (but I think you have some overhead, as you have to emulate some small computing units).

List of C++ libraries for Graph Theory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm going to start a scientific project about automata and graph theory, and I'm searching for a graph library that supports features like:
directed/undirected graphs
graph isomorphism test (i.e. is graph g1 isomorphic w.r.t. g2?)
subgraph isomorphism test (i.e. is a graph g1 isomorphic to a subgraph of g2?)
graph search, visits and such
possibly, quite fast since I need to make some serious computations
I know about the Boost Graph Library, but it lacks subgraph testing as far as I understood from its documentation.
So, my question is: which are the best c++ graph libraries, please?
They do not have to provide support for every feature I need, I know it's certainly possible that no existing library fits perfectly my needs.
You could use iGraph: http://igraph.sourceforge.net/ which is a C library which should satisfy what you are after.
There is also http://ubietylab.net/ubigraph/, there is a related SO post here: https://stackoverflow.com/questions/2751826/which-c-graph-library-should-i-use.
I have not used ubigraph so cannot comment on that, I mainly use networkX and iGraph
UPDATE
It seems that ubigraph is dead now so only igraph is maintained currently
You may use Cliquer library http://users.tkk.fi/pat/cliquer.html for all calculations related to finding cliques.

Best library for statistics in C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for high performance code (needs to run in real-time), preferably open source, but if there is nothing that's free and high-perf, I'll take something well supported and of high quality for a cost.
Any suggestions?
These are the ones I've found so far, in no particular order:
CodeCogs
GSL
Cephes
Boost MathToolkit
Blitz++
TNT
Check the links on mathtools.net. The page for statistics libraries for C++ has links. Another page http://www.thefreecountry.com/sourcecode/mathematics.shtml lists few more.
Have you checked the 'R project'? I think you can call 'R objects' from C/C++.
I'm surprised nobody's mentioned ALGLIB: http://www.alglib.net/
Root has pretty good statistical support. At least as us particle physics types judge these thing. Works in cint interpretation or as a native c++ library.
TNT is for matrix calculations but doesn't have any statistics functionality. (e.g. erf, mean/std/cov etc)
I haven't used Boost Math Toolkit, but skimming through the documentation, it looks like it has the opposite problem, e.g. lots of goodies for scalar calculations, but no support (that I could find) for multivariate situations.
I have used the IT++ library in the past, this library supports ACML and MKL routines trough BLAS and LAPACK. If it are calculations that need to happen fast, there is the possibility of using this library together with HPC, this is an although undocumented feature so some thought will be required.
The focus on this library is however positioned on matrix calculations, but many normal mathematic and statistic functions can be found in this framework thanks to its excellent signal processing support.