-
Notifications
You must be signed in to change notification settings - Fork 275
Open
Labels
Description
The HighsLpSolver-class in the C# API does not support adding and clearing multiple linear objectives, despite this being exported by the DLLs.
HiGHS/highs/interfaces/highs_csharp_api.cs
Line 180 in 869cbd4
| 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);
}