public class BooleanIndexing extends Object
| Constructor and Description |
|---|
BooleanIndexing() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
and(IComplexNDArray n,
Condition cond)
And
|
static boolean |
and(INDArray n,
Condition cond)
And over the whole ndarray given some condition
|
static boolean[] |
and(INDArray n,
Condition condition,
int... dimension)
And over the whole ndarray given some condition, with respect to dimensions
|
static INDArray |
applyMask(INDArray arr,
INDArray mask)
A minor shortcut for applying a bitmask to
a matrix
|
static INDArray |
applyMaskInPlace(INDArray arr,
INDArray mask)
A minor shortcut for applying a bitmask to
a matrix
|
static void |
applyWhere(IComplexNDArray to,
Condition condition,
com.google.common.base.Function<IComplexNumber,IComplexNumber> function)
Based on the matching elements
op to based on condition to with function function
|
static void |
applyWhere(INDArray to,
Condition condition,
com.google.common.base.Function<Number,Number> function)
Based on the matching elements
op to based on condition to with function function
|
static void |
applyWhere(INDArray to,
Condition condition,
com.google.common.base.Function<Number,Number> function,
com.google.common.base.Function<Number,Number> alternativeFunction)
Based on the matching elements
op to based on condition to with function function
|
static void |
applyWhere(INDArray to,
Condition condition,
Number number)
This method sets provided number to all elements which match specified condition
|
static void |
assignIf(INDArray to,
INDArray from,
Condition condition)
This method does element-wise comparison
for 2 equal-sized matrices, for each element that matches Condition.
|
static INDArray |
chooseFrom(INDArray[] input,
Condition condition)
Choose from the inputs based on the given condition.
|
static INDArray |
chooseFrom(INDArray[] input,
List<Double> tArgs,
List<Integer> iArgs,
Condition condition)
Choose from the inputs based on the given condition.
|
static INDArray |
firstIndex(INDArray array,
Condition condition)
This method returns first index matching given condition
PLEASE NOTE: This method will return -1 value if condition wasn't met
|
static INDArray |
firstIndex(INDArray array,
Condition condition,
int... dimension)
This method returns first index matching given condition along given dimensions
PLEASE NOTE: This method will return -1 values for missing conditions
|
static INDArray |
lastIndex(INDArray array,
Condition condition)
This method returns last index matching given condition
PLEASE NOTE: This method will return -1 value if condition wasn't met
|
static INDArray |
lastIndex(INDArray array,
Condition condition,
int... dimension)
This method returns first index matching given condition along given dimensions
PLEASE NOTE: This method will return -1 values for missing conditions
|
static boolean |
or(IComplexNDArray n,
Condition cond)
Or over the whole ndarray given some condition
|
static boolean |
or(INDArray n,
Condition cond)
Or over the whole ndarray given some condition
|
static boolean[] |
or(INDArray n,
Condition condition,
int... dimension)
Or over the whole ndarray given some condition, with respect to dimensions
|
static void |
replaceWhere(INDArray to,
INDArray from,
Condition condition)
This method does element-wise comparison for 2 equal-sized matrices, for each element that matches Condition
|
static void |
replaceWhere(INDArray to,
Number set,
Condition condition)
This method does element-wise assessing for 2 equal-sized matrices, for each element that matches Condition
|
public static boolean and(IComplexNDArray n, Condition cond)
n - cond - public static boolean or(IComplexNDArray n, Condition cond)
n - cond - public static boolean and(INDArray n, Condition cond)
n - the ndarray to testcond - the condition to test againstpublic static boolean[] and(INDArray n, Condition condition, int... dimension)
n - the ndarray to testcondition - the condition to test againstpublic static boolean[] or(INDArray n, Condition condition, int... dimension)
n - the ndarray to testcondition - the condition to test againstpublic static boolean or(INDArray n, Condition cond)
n - cond - public static void applyWhere(INDArray to, Condition condition, com.google.common.base.Function<Number,Number> function)
to - the ndarray to opcondition - the condition on opfunction - the function to apply the op topublic static void applyWhere(INDArray to, Condition condition, Number number)
to - condition - number - public static void assignIf(@NonNull
INDArray to,
@NonNull
INDArray from,
@NonNull
Condition condition)
INDArray.gt(Number),INDArray.gte(Number),
INDArray.lt(Number),..to - the array to apply the condition tofrom - the mask arraycondition - the condition to applypublic static void replaceWhere(@NonNull
INDArray to,
@NonNull
INDArray from,
@NonNull
Condition condition)
to - from - condition - public static INDArray chooseFrom(@NonNull INDArray[] input, @NonNull Condition condition)
input - the input to filtercondition - the condition to filter based onpublic static INDArray applyMask(INDArray arr, INDArray mask)
arr - The array to apply the mask tomask - the mask to applypublic static INDArray applyMaskInPlace(INDArray arr, INDArray mask)
arr - The array to apply the mask tomask - the mask to applypublic static INDArray chooseFrom(@NonNull INDArray[] input, @NonNull List<Double> tArgs, @NonNull List<Integer> iArgs, @NonNull Condition condition)
input - the input to filtertArgs - the double argsiArgs - the integer argscondition - the condition to filter based onpublic static void replaceWhere(@NonNull
INDArray to,
@NonNull
Number set,
@NonNull
Condition condition)
to - set - condition - public static void applyWhere(INDArray to, Condition condition, com.google.common.base.Function<Number,Number> function, com.google.common.base.Function<Number,Number> alternativeFunction)
to - the ndarray to opcondition - the condition on opfunction - the function to apply the op topublic static void applyWhere(IComplexNDArray to, Condition condition, com.google.common.base.Function<IComplexNumber,IComplexNumber> function)
to - the ndarray to opcondition - the condition on opfunction - the function to apply the op topublic static INDArray firstIndex(INDArray array, Condition condition)
array - condition - public static INDArray firstIndex(INDArray array, Condition condition, int... dimension)
array - condition - dimension - public static INDArray lastIndex(INDArray array, Condition condition)
array - condition - public static INDArray lastIndex(INDArray array, Condition condition, int... dimension)
array - condition - dimension - Copyright © 2018. All rights reserved.