Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.
- Non-linear Least Squares problems with bounds constraints.
- General unconstrained optimization problems.
Please see ceres-solver.org for more information.
Run:
$ npm i ceres-solver.cxxAnd then include ceres.h as follows:
// main.cxx
#include <ceres.h> // or, ceres/ceres.h
int main() { /* ... */ }Finally, compile while adding the path node_modules/ceres-solver.cxx to your compiler's include paths.
$ clang++ -std=c++20 -I./node_modules/ceres-solver.cxx main.cxx # or, use g++
$ g++ -std=c++20 -I./node_modules/ceres-solver.cxx main.cxxYou may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
$ cpoach clang++ -std=c++20 main.cxx # or, use g++
$ cpoach g++ -std=c++20 main.cxx