Skip to content
Discussion options

You must be logged in to vote

In get_nlp_info(), you have

            n=2;
            m=0;
            nnz_jac_g=1;
            nnz_h_lag = 4;

If you don't have constraints, then you Jacobian also has no entries, so this should be nnz_jac_g.

In your Hessian implementation, you have

            for( Index row = 0; row < 4; row++ )
            {
                for( Index col = 0; col <= row; col++ )
                {
                    iRow[idx] = row;
                    jCol[idx] = col;
                    idx++;
                }
            }

But since you have only 2 variables, there should be only 2 rows and columns. And since only half of the (symmetry) Hessian should be provided, you probably meant nnz_h_lag=3

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SlothDragon
Comment options

Answer selected by svigerske
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants