I don't have a lot of experience using OPC CPLEX. I've just started to use it in the university few months ago. I'm duing an exercise and I need some help.
I have this vector: int RetrasosBultos with negative and positives values. And I want to convert the negatives values to 0.
How can I do that? I supose it must be easy, but I don`t know...
This topic has been locked.
1 reply Latest Post - 2012-12-11T13:46:37Z by SystemAdmin
Pinned topic Convert negatives values to 0
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-12-11T13:46:37Z at 2012-12-11T13:46:37Z by SystemAdmin
SystemAdmin 110000D4XK2130 PostsACCEPTED ANSWER
Re: Convert negatives values to 02012-12-11T13:46:37Z in response to SystemAdminSay that you have:
int a[i in I] = ...
then you could convert the negative values to 0 using the one line if syntax:
int b[i in I] = a[i] > 0 ? a[i] : 0;
The meaning of the instruction is simply: "if a[i] is greater than 0 then b[i] = a[i] else b[i] = 0".