'How to divide IloNumExpr from Cplex?
I'm using Java to solve a maximization problem in Cplex. My objective function is quite complex. In a nutshell, there are two parts, A and B. Both of them contain variables.
My goal is to maximize A/B, but the problem is that, the Cplex only allows me to do the production operation. I try to use the reciprocal of B to solve this problem, but the reciprocal of an expression is also not allowed.
In the attached figure, "objective" is part A, and "cost" is the B. Both of them are IloNumExpr.
Does anyone know how I can solve this problem? Many thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|