hi_solver_add_cols: Add Variables to Model

View source: R/solver-api.R

hi_solver_add_colsR Documentation

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)

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.

Value

The solver instance with new variables added.

Examples

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


highs documentation built on June 8, 2025, 10:36 a.m.