Skip to content

C# API does not support adding multiple objectives #2667

@Vab123

Description

@Vab123

The HighsLpSolver-class in the C# API does not support adding and clearing multiple linear objectives, despite this being exported by the DLLs.

public class HighsLpSolver : IDisposable

This could be added by the following code:

[DllImport(Highslibname)]
private static extern int Highs_clearLinearObjectives(IntPtr highs);

[DllImport(Highslibname)]
private static extern int Highs_addLinearObjective(IntPtr highs, double weight, int offset, double[] coefficients, double absTolerance, double relTolerance, int priority);

public HighsStatus clearLinearObjectives() 
{
	return (HighsStatus)Highs_clearLinearObjectives(_highs);
}

public HighsStatus addLinearObjective(double weight, int offset, double[] coefficients, double absTolerance, double relTolerance, int priority) 
{
	return (HighsStatus)Highs_addLinearObjective(_highs, weight, offset, coefficients, absTolerance, relTolerance, priority);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions