I'm trying to initialize a matrix in an OPL script (an execute{}block) Each element must be set to a float power (> 0)
The pow function is not recognized in script, so I tried the ^ operator... but it is not what I expected : the reference says "^ means power in OPL and bitwise xor in Script"
So for now I just used a for() loop, which works but does not accept floating powers :
var temp;
for (var p = 1; p<=nbP; p++){
for (var n = 1; n <= nbC; n++){
temp = w[n][p] / i[p];
MATRIX[n][p] = 1;
for (var i = 1; i <= desiredPower; i++){
MATRIX[n][p] = tempNGSI * MATRIX[n][p];
}
}
}
Is there an equivalent for pow() in OPL script? How can I do otherwise? Note that for() blocks are not recognized outside of the script blocks (execute{})