Henri-Lo / cvxr

An R modeling language for convex optimization problems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CVXR

An R modeling language for convex optimization problems.

Note

This package is still under active development. You can install it, but crucial glue to the Canon interface which bridges any language---in our case R---and C-level libraries still requires work to do anything useful.

Installation

To install, make sure you have the development tools for R available, including the C compilers etc.

  1. Install the packages devtools Rcpp, RcppEigen, BH, uuid, bitops.
  2. In R, execute
library(devtools)
install_github("anqif/cvxr")

Support

You may experiment with the DSL expressing problems using the current version. We are unable to provide any support until the package is officially released.

A simple (but otherwise useless) example for testing:

library(cvxr)
## Problem data.
m <- 1; n <- 2
A <- matrix(c(17, 19), nrow = m, byrow = TRUE)
## Construct the problem.
x <- Variable(n)
objective <- Minimize(A %*% x)
constraint <- list(1 <= x)
prob <- Problem(objective, constraint)
result <- solve(prob)
cat("Solver Status: ", result$status, "\n")
cat("Primal Solution:\n")
print(result$primal_values)
cat("Dual Solution:\n")
print(result$dual_values)

About

An R modeling language for convex optimization problems.

License:GNU General Public License v2.0


Languages

Language:C 93.0%Language:R 5.5%Language:C++ 1.2%Language:Makefile 0.1%Language:MATLAB 0.0%Language:Python 0.0%Language:Rebol 0.0%Language:M4 0.0%Language:M 0.0%Language:Shell 0.0%