Commit 87b08e8
committed
Fix the QP example in
The code was creating a Hessian matrix that did not match the expression
given in the comments.
The comment says the QP is
minimize x_2 + (1/2)(2x_1^2 - 2x_1x_3 + 0.2x_2^2 + 2x_3^2)
so the Hessian matrix is
[ 2 0 -1]
[ 0 0.2 0]
[-1 0 2]
To create this Hessian, the code that creates the Hessian matrix
is changed from
int dim = 2;
int[] qstart = {0, 2, 3};
int[] qindex = {0, 1, 1};
double[] qvalue = {2, -1, 2};
(which would correspond to the 2x2 matrix Q = [[2, -1], [0, 2]])
to
int dim = 3;
int[] qstart = {0, 2, 3, 4};
int[] qindex = {0, 1, 1, 2};
double[] qvalue = {2, -1, 0.2, 2};call_highs_from_csharp.cs.1 parent 26b632a commit 87b08e8
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments