Skip to content
OSQP (Operator Splitting Quadratic Program) solver for Ruby
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
vendor
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
LICENSE.txt
NOTICE.txt
README.md
Rakefile
appveyor.yml
osqp.gemspec

README.md

OSQP

The OSQP (Operator Splitting Quadratic Program) solver for Ruby

Build Status Build status

Installation

Add this line to your application’s Gemfile:

gem 'osqp'

Getting Started

Prep the problem - here’s how it should be setup

p = [[4, 1], [0, 2]]
q = [1, 1]
a = [[1, 1], [1, 0], [0, 1]]
l = [1, 0, 0]
u = [1, 0.7, 0.7]

And solve it

solver = OSQP::Solver.new
solver.solve(p, q, a, l, u, alpha: 1.0)

All of these settings are supported.

Warm start

solver.warm_start(x, y)

Data

Arrays and matrices can be Ruby arrays

[[1, 2, 3], [4, 5, 6]]

Or a Numo NArrays

Numo::DFloat.new(3, 2).seq

Resources

Credits

This library is modeled after the OSQP Python API.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/osqp.git
cd osqp
bundle install
bundle exec rake test
You can’t perform that action at this time.