Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions highs/interfaces/highs_csharp_api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,15 @@ private static extern int Highs_addCols(
[DllImport(highslibname)]
private static extern int Highs_getInt64InfoValue(IntPtr highs, string info, out long value);

[DllImport(highslibname)]
private static extern int Highs_changeObjectiveOffset(IntPtr highs, double offset);

[DllImport(highslibname)]
private static extern int Highs_addLinearObjective(IntPtr highs, double weight, double offset, double[] coefficients, double abs_tolerance, double rel_tolerance, int priority);

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

[DllImport(highslibname)]
private static extern int Highs_setSolution(IntPtr highs, double[] col_value, double[] row_value, double[] col_dual, double[] row_dual);

Expand Down Expand Up @@ -1023,6 +1032,21 @@ public SolutionInfo getInfo()
return info;
}

public HighsStatus changeObjectiveOffset(double offset)
{
return (HighsStatus)HighsLpSolver.Highs_changeObjectiveOffset(this.highs, offset);
}

public HighsStatus addLinearObjective(double weight, double offset, double[] coefficients, double abs_tolerance, double rel_tolerance, int priority)
{
return (HighsStatus)HighsLpSolver.Highs_addLinearObjective(this.highs, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority);
}

public HighsStatus clearLinearObjectives()
{
return (HighsStatus)HighsLpSolver.Highs_clearLinearObjectives(this.highs);
}

public HighsStatus setSolution(HighsSolution solution)
{
return (HighsStatus)HighsLpSolver.Highs_setSolution(this.highs, solution.colvalue, solution.rowvalue, solution.coldual, solution.rowdual);
Expand Down
Loading