<div dir="ltr">Hi, I posted this same question to Stackoverflow with that tag SCIP.<div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">I am using the Opti Toolbox, a free optimization toolbox for Matlab. I am solving a Mixed Integer Nonlinear Program, a MINLP. Inside the Opti Toolbox, the MINLP solver used is SCIP.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">I define my own objective as a separate function (<em style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">fun</em> argument in Opti), and this function needs to call other matlab functions which take double arguments.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">The problem is that whenever Opti invokes my function to evaluate the objective, it first calls it using a vector of '<strong style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">scipvar</strong>' objects and then it calls it again using a vector of '<strong style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">double</strong>' objects. My obj function does not work with the scipvar objects, it returns an error.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">I tried (just for testing) setting the output of my function for something fixed when the type is '<strong style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">scipvar</strong>', and for the actual real thing when the type is '<strong style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">double</strong>', and this doesn't work, changing the fixed value actually changes the final optimal value.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">I basically need to convert a scipvar object to double, is this possible? Or is there any other alternative?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Thank you.</p></div></div>