Giter Site home page Giter Site logo

osqp_cpp_interface's Introduction

osqp_cpp_interface

Native C++ interface for the OSQP solver

Setup the repository

  1. Clone from Gitlab

  2. Add the following folder structure

  • osqp_cpp_interface/lib/osqp/lib
  • osqp_cpp_interface/lib/osqp/include
  • osqp_cpp_interface/build

Install OSQP by building from souce

https://osqp.org/docs/get_started/sources.html

Following these instructions will provide the following library file and include files.

  • osqp/build/out/libosqp.a
  • osqp/include

The library file 'libosqp.a' together with the 'include' files will be used to run the solver.

  1. Copy 'libosqp.a' from 'osqp' to the 'osqp_test' repository

osqp_cpp_interface/lib/osqp/lib/

  1. Copy the 'include' files from 'osqp' to the 'osqp_test' repository

osqp_cpp_interface/lib/osqp/include/

Build the test programs

Starting in the root:

  1. cd build
  2. cmake ../
  3. make all

Run the test programs

Starting in build/ directory:

  • ./osqp_cpp_interface
  • ./runTests

Successfully running 'osqp_cpp_interface' will provide the following output


       OSQP v0.6.0  -  Operator Splitting QP Solver
          (c) Bartolomeo Stellato,  Goran Banjac
    University of Oxford  -  Stanford University 2019

problem: variables n = 2, constraints m = 3 nnz(P) + nnz(A) = 9 settings: linear system solver = qdldl, eps_abs = 1.0e-03, eps_rel = 1.0e-03, eps_prim_inf = 1.0e-04, eps_dual_inf = 1.0e-04, rho = 1.00e-01 (adaptive), sigma = 1.00e-06, alpha = 1.00, max_iter = 4000 check_termination: on (interval 25), scaling: on, scaled_termination: off warm start: on, polish: off, time_limit: off

iter objective pri res dua res rho time 1 -9.3904e+00 3.61e-01 3.18e+00 1.00e-01 6.83e-05s 25 -8.2241e+00 3.08e-03 1.12e-03 1.00e-01 1.12e-04s

status: solved number of iterations: 25 optimal objective: -8.2241 run time: 1.30e-04s optimal rho estimate: 2.03e-01

0.668395 1.33266

osqp_cpp_interface's People

Contributors

robin-karlsson0 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

westsidems

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.