Learn R Programming

highs (version 1.10.0-1)

hi_solver_add_cols: Add Variables to Model

Description

This function adds new variables (columns) to the optimization model.

Usage

hi_solver_add_cols(solver, costs, lower, upper, start, index, value)

Value

The solver instance with new variables added.

Arguments

solver

An object of class "highs_solver".

costs

A numeric vector of objective coefficients.

lower

A numeric vector giving the lower bounds of the new variables.

upper

A numeric vector giving the upper bounds of the new variables.

start

An integer vector of starting positions in the sparse matrix.

index

An integer vector of row indices.

value

A numeric vector of coefficient values.

Examples

Run this code
solver <- example_solver()
hi_solver_add_cols(solver, c(1), c(0), c(10), c(0, 1), c(0), c(2))

Run the code above in your browser using DataLab