Skip to content

Commit 2584a4d

Browse files
authored
Merge pull request #2581 from WarrenWeckesser/fix-csharp-example
Fix the QP example in `call_highs_from_csharp.cs`.
2 parents 26b632a + 87b08e8 commit 2584a4d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/call_highs_from_csharp.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void Main(string[] args) {
1111
// minimize x_2 + (1/2)(2x_1^2 - 2x_1x_3 + 0.2x_2^2 + 2x_3^2)
1212
//
1313
// subject to x_1 + x_2 + x_3 >= 1; x>=0
14-
double[] cc = {0, 1, 0};
14+
double[] cc = {0, 1, 0};
1515
double[] cl = {0, 0, 0};
1616
double[] cu = {1.0e30, 1.0e30, 1.0e30};
1717
double[] rl = {1};
@@ -52,10 +52,10 @@ static void Main(string[] args) {
5252
Console.WriteLine("x" + i + " = " + sol.colvalue[i] + " is " + bas.colbasisstatus[i]);
5353
}
5454
// Add the Hessian
55-
int dim = 2;
56-
int[] qstart = {0, 2, 3};
57-
int[] qindex = {0, 1, 1};
58-
double[] qvalue = {2, -1, 2};
55+
int dim = 3;
56+
int[] qstart = {0, 2, 3, 4};
57+
int[] qindex = {0, 1, 1, 2};
58+
double[] qvalue = {2, -1, 0.2, 2};
5959
HessianFormat q_format = HessianFormat.kTriangular;
6060
HighsHessian hessian = new HighsHessian(dim, qstart, qindex, qvalue, q_format);
6161
status = solver.passHessian(hessian);

0 commit comments

Comments
 (0)