My partial code as follows:
// symmetric matrix
for (int i = 0; i < n - 1; ++i)
{
hessian.insert(i, i + 1) = 1.0;
hessian.insert(i + 1, i) = 1.0;
}
// upper triangular matrix
for (int i = 0; i < n - 1; ++i)
{
hessian.insert(i, i + 1) = 2.0;
}
When I used the symmetric matrix, I got the true solution(I guess). Instead, solver return
status: problem non convex
while using upper triangular matrix.