Skip to content

Commit

Permalink
Added public enum HessianFormat, public class HighsHessian and privat…
Browse files Browse the repository at this point in the history
…e static extern int Highs_passHessian to highs_csharp_api.cs
  • Loading branch information
jajhall committed Aug 28, 2024
1 parent f78c215 commit d5af2b9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/interfaces/highs_csharp_api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public enum HighsMatrixFormat
kRowwise
}

public enum HessianFormat
{
kTriangular = 1,
kSquare
}

public enum HighsBasisStatus
{
kLower = 0,
Expand Down Expand Up @@ -104,6 +110,27 @@ public HighsModel(double[] colcost, double[] collower, double[] colupper, double
}
}

public class HighsHessian
{
public HessianFormat q_format;
public int[] qstart;
public int[] qindex;
public double[] qvalue;

public HighsHessian()
{

}

public HighsHessian(int[] qstart, int[] qindex, double[] qvalue, HessianFormat q_format = HessianFormat.kTriangular)
{
this.qstart = qstart;
this.qindex = qindex;
this.qvalue = qvalue;
this.q_format = q_format;
}
}

public class HighsSolution
{
public double[] colvalue;
Expand Down Expand Up @@ -236,6 +263,16 @@ private static extern int Highs_passMip(
double[] avalue,
int[] highs_integrality);

[DllImport(highslibname)]
private static extern int Highs_passHessian(
IntPtr highs,
int dim,
int numnz,
int q_format,
int[] qstart,
int[] qindex,
double[] qvalue);

[DllImport(highslibname)]
private static extern int Highs_setOptionValue(IntPtr highs, string option, string value);

Expand Down

0 comments on commit d5af2b9

Please sign in to comment.