[ADOL-C] Conditional branch in eval_constraints - Runtime error (IPOPT with ADOL-C)

Andrea Walther awalther at math.uni-paderborn.de
Sun Apr 28 11:34:54 EDT 2013


Hi,

>
> if( x[i] <= 0.0) // it errors out as soon as I add any condition
> {
> fext(i) = 10;
> //fext(i) += kContact* x[i];
> }
>
>
>
> Does this mean that we cant have conditonal branching in eval_constraints
> or eval_objectives?

no, you can have branches in the constraints or the objective. However,
you have to take special care if the branch conditions depend on the
variables. Fur this purpose, ADOL-C provides the so-called
condassign statement. Please check the manual of ADOL-C for the
coding of such branches and give it a try.

If you still have problems using condassigns please email again.

Best regards

Andrea





More information about the ADOL-C mailing list