Trait ha_ndarray::NDArrayWhere
source · pub trait NDArrayWhere: NDArray<DType = u8> + Debug {
// Provided method
fn cond<T, L, R>(
self,
then: L,
or_else: R
) -> Result<ArrayOp<GatherCond<Self, T, L, R>>, Error>
where T: CDatatype,
L: NDArray<DType = T> + Debug,
R: NDArray<DType = T> + Debug,
Self: Sized { ... }
}
Expand description
Conditional selection (boolean logic) methods
Provided Methods§
sourcefn cond<T, L, R>(
self,
then: L,
or_else: R
) -> Result<ArrayOp<GatherCond<Self, T, L, R>>, Error>where
T: CDatatype,
L: NDArray<DType = T> + Debug,
R: NDArray<DType = T> + Debug,
Self: Sized,
fn cond<T, L, R>( self, then: L, or_else: R ) -> Result<ArrayOp<GatherCond<Self, T, L, R>>, Error>where T: CDatatype, L: NDArray<DType = T> + Debug, R: NDArray<DType = T> + Debug, Self: Sized,
Construct a boolean selection operation.
The resulting array will return values from then
where self
is true
and from or_else
where self
is false
.