Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Q_constraint

Quadratic Constraints


Description

Quadratic constraints are typically of the form

\frac{1}{2}x^{\top}Q_ix + L_i x ≤q rhs_i

where Q_i is the ith of m (sparse) matrices (all of dimension n \times n) giving the coefficients of the quadratic part of the equation. The m \times n (sparse) matrix L holds the coefficients of the linear part of the equation and L_i refers to the ith row. The right hand side of the constraints is represented by the vector rhs.

Usage

Q_constraint(Q, L, dir, rhs, names = NULL)

## S3 method for class 'Q_constraint'
variable.names(object, ...)

as.Q_constraint(x)

is.Q_constraint(x)

## S3 method for class 'Q_constraint'
length(x)

## S3 method for class 'Q_constraint'
terms(x, ...)

Arguments

Q

a list of (sparse) matrices representing the quadratic part of each constraint.

L

a numeric vector of length n (a single constraint) or a matrix of dimension m \times n, where n is the number of objective variables and m is the number of constraints. Matrices can be of class "simple_triplet_matrix" to allow a sparse representation of constraints.

dir

a character vector with the directions of the constraints. Each element must be one of "<=", ">=" or "==".

rhs

a numeric vector with the right hand side of the constraints.

names

an optional character vector giving the names of x (row/column names of Q, column names of A).

object

an R object.

...

further arguments passed to or from other methods (currently ignored).

x

an R object.

Value

an object of class "Q_constraint" which inherits from "constraint".

Author(s)

Stefan Theussl


ROI

R Optimization Infrastructure

v1.0-0
GPL-3
Authors
Kurt Hornik [aut], David Meyer [aut], Florian Schwendinger [aut], Stefan Theussl [aut, cre], Diethelm Wuertz [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.