Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (61 sloc) 5.32 KB
title: What's new in 1.0?
author: Anqi Fu, David Kang and Balasubramanian Narasimhan
date: '2020-01-15'
- Version 1.0 features
slug: whats_new_1.0
mode: ignore
testdata_dir: test_data
data_dir: whats_new
`CVXR` 1.0 includes a major rewrite of the `CVXR` internals, as well
as a number of changes to the user interface. The goal is to follow
`cvxpy` as much as possible. We first give an overview of the changes,
before diving into the details. We only cover changes that might be of
interest to users.
## Overview
* Disciplined geometric programming (DGP): Starting with version 1.0.11, `CVXR` lets you formulate and solve log-log convex programs, which generalize both traditional geometric programs and generalized geometric programs. To get started with DGP, check out the tutorial and consult the accompanying paper.
* Reductions: `CVXR` 1.0 uses a modular system of reductions to convert problems input by the user into the format required by the solver, which makes it easy to support new standard forms, such as quadratic programs, and more advanced user inputs, such as problems with complex variables. See Reductions and the accompanying paper for further details.
* Attributes: Variables and parameters now support a variety of attributes that describe their symbolic properties, such as nonnegative or symmetric. This unifies the treatment of symbolic properties for variables and parameters and replaces specialized variable classes such as `Int`, `Bool` and `Semidef`.
## Reductions
A reduction is a transformation from one problem to an equivalent problem. Two problems are equivalent if a solution of one can be converted to a solution of the other with no more than a moderate amount of effort. `CVXR` uses reductions to rewrite problems into forms that solvers will accept. The practical benefit of the reduction based framework is that `CVXR` 1.0 supports quadratic programs as a target solver standard form in addition to cone programs, with more standard forms on the way. It also makes it easy to add generic problem transformations such as converting problems with complex variables into problems with only real variables.
## Attributes
Attributes describe the symbolic properties of variables and parameters and are specified as arguments to the constructor. For example, Variable(nonneg=TRUE) creates a scalar variable constrained to be nonnegative. Attributes replace the previous syntax of special variable classes like Bool for boolean variables and Semidef for symmetric positive semidefinite variables, as well as specification of the sign for parameters (e.g., Parameter(sign='positive')). Concretely, write
* `Variable(shape, boolean=TRUE)` instead of `Bool(shape)`.
* `Variable(shape, integer=TRUE)` instead of `Int(shape)`.
* `Variable(c(n, n), PSD=TRUE)` instead of `Semidef(n)`.
* `Variable(c(n, n), symmetric=TRUE)` instead of `Symmetric(n)`.
* `Variable(shape, nonneg=TRUE)` instead of `NonNegative(shape)`.
* `Parameter(shape, nonneg=TRUE)` instead of `Parameter(shape, sign='positive')`.
* `Parameter(shape, nonpos=TRUE)` instead of `Parameter(shape, sign='negative')`.
The full constructor of the `Leaf` class (the parent class of `Variable` and `Parameter`) is given below
Leaf <- setClass("Leaf", representation(dim = "NumORNULL", value = "ConstVal", nonneg = "logical", nonpos = "logical",
complex = "logical", imag = "logical", symmetric = "logical", diag = "logical",
PSD = "logical", NSD = "logical", hermitian = "logical", boolean = "NumORLogical", integer = "NumORLogical",
sparsity = "matrix", pos = "logical", neg = "logical",
attributes = "list", boolean_idx = "matrix", integer_idx = "matrix"), ...#more arguments)
* __Parameters__
+ __value__ (*numeric type*) - A value to assign to the variable.
+ __nonneg__ (*bool*) – Is the variable constrained to be nonnegative?
+ __nonpos__ (*bool*) – Is the variable constrained to be nonpositive?
+ __complex__ (*bool*) – Is the variable complex valued?
+ __imag__ (*bool*) – Is the variable purely imaginary?
+ __symmetric__ (*bool*) – Is the variable constrained to be symmetric?
+ __diag__ (*bool*) – Is the variable constrained to be diagonal?
+ __PSD__ (*bool*) – Is the variable constrained to be symmetric positive semidefinite?
+ __NSD__ (*bool*) – Is the variable constrained to be symmetric negative semidefinite?
+ __hermitian__ (*bool*) – Is the variable constrained to be Hermitian?
+ __boolean__ (*bool or list of tuple*) – Is the variable boolean (i.e., 0 or 1)? True, which constrains the entire variable to be boolean, False, or a list of indices which should be constrained as boolean, where each index is a tuple of length exactly equal to the length of shape.
+ __integer__ (*bool or list of tuple*) – Is the variable integer? The semantics are the same as the boolean argument.
+ __sparsity__ (*matrix*) A matrix representing the fixed sparsity pattern of the leaf.
+ __pos__ (*bool*) Is the leaf strictly positive?
+ __neg__ (*bool*) Is the leaf strictly negative?
## Session Info
## Source
[R Markdown](
## References
You can’t perform that action at this time.