pub struct Max<T> { /* private fields */ }Expand description
Calculates the max value over n samples given
Implementations§
Source§impl<T> Max<T>
impl<T> Max<T>
Sourcepub fn new(over_n: usize) -> Node<T>
pub fn new(over_n: usize) -> Node<T>
Generate a new max operation
§Example
use sac_base::operations::math::max::Max;
use sac_base::network::node::Node;
let mut max = Max::new(3) as Node<f32>;
let mut inputs = Vec::new();
inputs.push(&[1.0, 5.0, 6.0, 2.0, 11.0, 12.0, 3.0][..]);
max.process((inputs, 7));
assert_eq!(max.poll(), &[12.0][..]);
let mut inputs = Vec::new();
inputs.push(&[1.0, 5.0][..]);
max.process((inputs, 2));
assert_eq!(max.poll(), &[5.0][..]);Auto Trait Implementations§
impl<T> Freeze for Max<T>
impl<T> RefUnwindSafe for Max<T>where
T: RefUnwindSafe,
impl<T> Send for Max<T>where
T: Send,
impl<T> Sync for Max<T>where
T: Sync,
impl<T> Unpin for Max<T>where
T: Unpin,
impl<T> UnsafeUnpin for Max<T>
impl<T> UnwindSafe for Max<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more