flavius

Conditional store

Discussion created by flavius on Mar 28, 2011
Latest reply on Mar 28, 2011 by flavius
Any workaround for that?

Hi, I was wondering how I can correctly write this statement

foo[bar] = select(foo[bar], other_values, some_condition);

if the foo[bar] is a vector array. If it was scalar, I could write

if (some_condition) foo[bar] = other_value;

but repeating this for vector variables is probably not the best choice. My concern is that I actually do not need to load the contents of foo[bar] to store it again if the condition does not hold, but I want to conditionaly overwrite it.

Is there something like vstore4_cond(other_values, bar, foo, some_condition) or any hack that would work this way?

Thanks for your suggestions.

Outcomes