Learn R Programming

rspa (version 0.2.8)

sparseConstraints: DEPRECATED Generate sparse set of constraints.

Description

This function is deprecated. Please use function sparse_constraints from package lintools instead.

Usage

sparseConstraints(x, ...)

# S3 method for editmatrix sparseConstraints(x, tol = 1e-08, ...)

# S3 method for matrix sparseConstraints(x, b, neq = length(b), tol = 1e-08, ...)

# S3 method for data.frame sparseConstraints( x, b, neq = length(b), base = min(x[, 2]), sorted = FALSE, ... )

# S3 method for sparseConstraints print(x, range = 1L:10L, ...)

Value

Object of class sparseConstraints (see details).

Arguments

x

R object to be translated to sparseConstraints format.

...

options to be passed to other methods

tol

Tolerance for testing where coefficients are zero

b

Constant vector

neq

The first new equations are interpreted as equality constraints, the rest as '<='

base

are the indices in x[,1:2] base 0 or base 1?

sorted

is x sorted by the first column?

range

integer vector stating which constraints to print

Details

The sparseConstraints objects holds the system \(\boldsymbol{Ax}\leq \boldsymbol{b}\) in column sparse format, outside of R's memory. In R, it is a reference object. In particular, it is meaningless to

  • Copy the object. You only will only generate a pointer to physically the same object.

  • Save the object. The physical object is destroyed when R closes, or when R's garbage collector cleans up a removed sparseConstraints object.