Learn R Programming

highs (version 1.10.0-1)

hi_solver_set_objective: Set the objective coefficient for a variable.

Description

This function assigns a coefficient to a variable in the objective function.

Usage

hi_solver_set_objective(solver, index, obj)

Value

The solver instance with the updated objective.

Arguments

solver

An object of class "highs_solver".

index

The variable index.

obj

A numeric value representing the objective coefficient.

Examples

Run this code
solver <- example_solver()
hi_solver_set_objective(solver, 2, 3.5)

Run the code above in your browser using DataLab