Package 'ROI.plugin.coinclp'

Title: 'COIN-OR' 'Clp' Plugin for the 'R' Optimization Infrastructure
Description: Registers the 'COIN-OR' 'Clp' linear programming solver with 'ROI', the 'R' Optimization Infrastructure, through the 'coinclp' package. Linear programs with continuous variables are then solved by 'ROI' with the 'coinclp' solver, keeping sparse constraint matrices sparse all the way to the solver, and returning dual values, reduced costs and row activities alongside the primal solution.
Authors: Sam Lovick [aut, cre]
Maintainer: Sam Lovick <[email protected]>
License: EPL
Version: 0.1.0.9000
Built: 2026-09-28 22:15:23 UTC
Source: https://github.com/samlovick/roi.plugin.coinclp

Help Index


Dual values and auxiliary quantities

Description

solution(x, "dual") returns the dual value of each constraint, the shadow price of its right hand side. solution(x, "aux") returns a list with the row activities as primal and the reduced costs of the variables as dual.

Usage

## S3 method for class 'coinclp_solution'
ROI_plugin_solution_dual(x)

## S3 method for class 'coinclp_solution'
ROI_plugin_solution_aux(x)

Arguments

x

A solution returned by ROI_solve with solver = "coinclp".

Details

Signs follow Clp's own convention for the direction that was solved, so a maximisation and the equivalent minimisation of the negated objective report duals of opposite sign.

Value

A numeric vector of dual values, or a list of auxiliary vectors.

Examples

library(ROI)
op <- OP(objective = c(143, 60),
         constraints = L_constraint(rbind(c(120, 210), c(110, 30), c(1, 1)),
                                    rep("<=", 3), c(15000, 4000, 75)),
         maximum = TRUE)
result <- ROI_solve(op, solver = "coinclp")
solution(result, "dual")
solution(result, "aux")

Solve a linear program with Clp

Description

The method ROI dispatches to when a linear program is solved with solver = "coinclp". It is not called directly; use ROI_solve.

Usage

solve_OP(x, control = list())

Arguments

x

An object of class "OP" holding a linear program.

control

A named list of solver controls, see ROI.plugin.coinclp for the ones recognised.

Value

An object of class "coinclp_solution", which solution unpacks.

Examples

library(ROI)
op <- OP(objective = c(143, 60),
         constraints = L_constraint(rbind(c(120, 210), c(110, 30), c(1, 1)),
                                    rep("<=", 3), c(15000, 4000, 75)),
         maximum = TRUE)
result <- ROI_solve(op, solver = "coinclp")
solution(result)
solution(result, "dual")