[Scip] Nonlinear Constraint

Martin Tieves Martin.Tieves at rwth-aachen.de
Mon Jan 30 11:23:01 MET 2012


Hallo, thanky alot for your last response, it helped me a lot :)

Nevertheless, I am still getting the same error messages (dbg mode didn't give any further information there):

[src/scip/cons_nonlinear.c:3508] ERROR: Error <-11> in function call
[src/scip/cons_nonlinear.c:7193] ERROR: Error <-11> in function call
[src/scip/cons.c:5820] ERROR: Error <-11> in function call
[src/scip/scip.c:6083] ERROR: Error <-11> in function call
[src/scip/scip.c:20023] ERROR: Error <-11> in function call
[src/scip/heur_trivial.c:168] ERROR: Error <-11> in function call
[src/scip/heur.c:398] ERROR: Error <-11> in function call
[src/scip/solve.c:241] ERROR: Error <-11> in function call
[src/scip/scip.c:6856] ERROR: Error <-11> in function call
[src/scip/scip.c:7336] ERROR: Error <-11> in function call
[src/scip/scip.c:7521] ERROR: Error <-11> in function call   

I tried to incorporate your proposals and ended up with the following code (I did not use the SCIPcreateConsQuadratic
since I want to add further parts to the constraint later):

  
SCIP* _scip(0);
SCIPcreate(&_scip);
SCIPincludeDefaultPlugins(_scip);

SCIPcreateProb(_scip, "MyProject", NULL, NULL, NULL, NULL, NULL, NULL, NULL);
SCIPsetObjsense(_scip, SCIP_OBJSENSE_MINIMIZE);

SCIP_VAR* vars_[2];
SCIPcreateVar(_scip, &vars_[0], "myn1", 0.0, SCIPinfinity(_scip), 1.0, SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL);
SCIPcreateVar(_scip, &vars_[1], "myn2", 0.0, SCIPinfinity(_scip), 1.0, SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL);
SCIPaddVar(_scip, vars_[0]);
SCIPaddVar(_scip, vars_[1]);

BMS_BLKMEM* blkmem = SCIPblkmem(_scip);
SCIP_EXPR* root;
SCIP_EXPR* child[2];
SCIPexprCreate(blkmem, &child[0], SCIP_EXPR_VARIDX, 0);
SCIPexprCreate(blkmem, &child[1], SCIP_EXPR_VARIDX, 1);
SCIPexprCreate(blkmem, &root, SCIP_EXPR_MUL, child[0], child[1]);

SCIP_EXPRTREE* tree;
SCIPexprtreeCreate(blkmem, &tree, root, 0, 0, NULL);
SCIPexprtreeAddVars(tree, 2,vars_ );

SCIP_CONS* nl_cons;
SCIPcreateConsNonlinear(_scip, &nl_cons, "nl_test", 0, NULL, NULL, 1,&tree, NULL, -SCIPinfinity(_scip), 1, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);      
SCIPaddCons(_scip, nl_cons);

SCIPsolve(_scip);

Can you help me there? Thank you in advance :)



More information about the Scip mailing list