Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Android Can i use setTo() with a Condition, just like in C/C++

Hi,

i am actually porting some code to Android, but i don't know, how i can translate this code :

myMat.setTo(0, otherMat < threshVal);

As i think, every value in the matrix - myMat is set to 0 when the value at the corresponding place in "otherMat" is lower than "threshVal" - right?

I would just use a for-loop to solve this, but i think there must be a better way - just as in the C-Code Version.

Thank you for your help.

Android Can i use setTo() with a Condition, just like in C/C++

Hi,

i am actually porting some code to Android, but i don't know, how i can translate this code :

myMat.setTo(0, otherMat < threshVal);

As i think, every value in the matrix - myMat is set to 0 when the value at the corresponding place in "otherMat" is lower than "threshVal" - right?

I would just use a for-loop to solve this, but i think there must be a better way - just as in the C-Code Version.

Also - how to translate this C-Code:

myMat = myMat / ( otherMat+1 );

Thank you for your help.