nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java
public static void applyWhere(IComplexNDArray to, Condition condition,
                                  Function<IComplexNumber, IComplexNumber> function) {
        IComplexNDArray linear = to.linearView();
        for (int i = 0; i < linear.linearView().length(); i++) {
            if (condition.apply(linear.getDouble(i))) {
                linear.putScalar(i, function.apply(linear.getComplex(i)));
            }
        }
    }
public static void applyWhere(IComplexNDArray to, Condition condition,
                                  Function<IComplexNumber, IComplexNumber> function) {
        IComplexNDArray linear = to.linearView();
        for (int i = 0; i < linear.linearView().length(); i++) {
            if (condition.apply(linear.getDouble(i))) {
                linear.putScalar(i, function.apply(linear.getComplex(i)));
            }
        }
    }
public static void applyWhere ( IComplexNDArray to , Condition condition , Function < IComplexNumber , IComplexNumber > function ) { IComplexNDArray linear = to . linearView ( ) ; for ( int i = 0 ; i < linear . linearView ( ) . length ( ) ; i ++ ) { if ( condition . apply ( linear . getDouble ( i ) ) ) { linear . putScalar ( i , function . apply ( linear . getComplex ( i ) ) ) ; } } }
Based on the matching elements
op to based on condition to with function function

@param to        the ndarray to op
@param condition the condition on op
@param function  the function to apply the op to
Based on the matching elements op to based on condition to with function function