Trait arr_rs::math::operations::extrema::ArrayExtrema
source · pub trait ArrayExtrema<N: Numeric>where
Self: Sized + Clone,{
// Required methods
fn maximum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
fn max(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
fn amax(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
fn fmax(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
fn nanmax(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
fn minimum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
fn min(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
fn amin(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
fn fmin(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
fn nanmin(&self, axis: Option<isize>) -> Result<Array<N>, ArrayError>;
}
Expand description
ArrayTrait - Array Extrema functions
Required Methods§
sourcefn maximum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
fn maximum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
Element-wise maximum of array elements
Arguments
other
- array to perform the operation with
Examples
use arr_rs::prelude::*;
let arr = Array::flat(vec![1., 2., 3., 4.]);
assert_eq!(
format!("{:#}", Array::flat(vec![2., f64::NAN, 3., 10.]).unwrap()),
format!("{:#}", arr.maximum(&Array::flat(vec![2., f64::NAN, 2., 10.]).unwrap()).unwrap())
);
sourcefn fmax(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
fn fmax(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
Element-wise maximum of array elements
Arguments
other
- array to perform the operation with
Examples
use arr_rs::prelude::*;
let arr = Array::flat(vec![1., 2., 3., 4.]);
assert_eq!(
format!("{:#}", Array::flat(vec![2., 2., 3., 10.]).unwrap()),
format!("{:#}", arr.fmax(&Array::flat(vec![2., f64::NAN, 2., 10.]).unwrap()).unwrap())
);
sourcefn minimum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
fn minimum(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
Element-wise minimum of array elements
Arguments
other
- array to perform the operation with
Examples
use arr_rs::prelude::*;
let arr = Array::flat(vec![1., 2., 3., 4.]);
assert_eq!(
format!("{:#}", Array::flat(vec![1., f64::NAN, 2., 4.]).unwrap()),
format!("{:#}", arr.minimum(&Array::flat(vec![2., f64::NAN, 2., 10.]).unwrap()).unwrap())
);
sourcefn fmin(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
fn fmin(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>
Element-wise maximum of array elements
Arguments
other
- array to perform the operation with
Examples
use arr_rs::prelude::*;
let arr = Array::flat(vec![1., 2., 3., 4.]);
assert_eq!(
format!("{:#}", Array::flat(vec![1., 2., 2., 4.]).unwrap()),
format!("{:#}", arr.fmin(&Array::flat(vec![2., f64::NAN, 2., 10.]).unwrap()).unwrap())
);