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

OptimizationProblem-methods

Optimization problem methods


Description

These functions are used to access data from an OptimizationProblem object.

Usage

nrow(x)

## S4 method for signature 'OptimizationProblem'
nrow(x)

ncol(x)

## S4 method for signature 'OptimizationProblem'
ncol(x)

ncell(x)

## S4 method for signature 'OptimizationProblem'
ncell(x)

modelsense(x)

## S4 method for signature 'OptimizationProblem'
modelsense(x)

vtype(x)

## S4 method for signature 'OptimizationProblem'
vtype(x)

obj(x)

## S4 method for signature 'OptimizationProblem'
obj(x)

A(x)

## S4 method for signature 'OptimizationProblem'
A(x)

rhs(x)

## S4 method for signature 'OptimizationProblem'
rhs(x)

sense(x)

## S4 method for signature 'OptimizationProblem'
sense(x)

lb(x)

## S4 method for signature 'OptimizationProblem'
lb(x)

ub(x)

## S4 method for signature 'OptimizationProblem'
ub(x)

col_ids(x)

## S4 method for signature 'OptimizationProblem'
col_ids(x)

row_ids(x)

## S4 method for signature 'OptimizationProblem'
row_ids(x)

compressed_formulation(x)

## S4 method for signature 'OptimizationProblem'
compressed_formulation(x)

Arguments

Details

The functions return the following data:

nrow

integer number of rows (constraints).

ncol

integer number of columns (decision variables).

ncell

integer number of cells.

modelsense

character describing if the problem is to be maximized ("max") or minimized ("min").

vtype

character describing the type of each decision variable: binary ("B"), semi-continuous ("S"), or continuous ("C")

obj

numeric vector specifying the objective function.

A

dgCMatrix matrix object defining the problem matrix.

rhs

numeric vector with right-hand-side linear constraints

sense

character vector with the senses of the linear constraints ("<=", ">=", "=").

lb

numeric lower bound for each decision variable. Missing data values (NA) indicate no lower bound for a given variable.

ub

numeric upper bounds for each decision variable. Missing data values (NA) indicate no upper bound for a given variable.

number_of_planning_units

integer number of planning units in the problem.

number_of_features

integer number of features the problem.

Value

dgCMatrix, numeric vector, numeric vector, or scalar integer depending on the method used.


prioritizr

Systematic Conservation Prioritization in R

v7.0.1
GPL-3
Authors
Jeffrey O Hanson [aut] (<https://orcid.org/0000-0002-4716-6134>), Richard Schuster [aut, cre] (<https://orcid.org/0000-0003-3191-7869>), Nina Morrell [aut], Matthew Strimas-Mackey [aut] (<https://orcid.org/0000-0001-8929-7776>), Matthew E Watts [aut], Peter Arcese [aut] (<https://orcid.org/0000-0002-8097-482X>), Joseph Bennett [aut] (<https://orcid.org/0000-0002-3901-9513>), Hugh P Possingham [aut] (<https://orcid.org/0000-0001-7755-996X>)
Initial release

We don't support your browser anymore

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