use na::{self, DefaultAllocator}; use traits::{Alloc, Number, Dimension}; use aliases::Vec; pub fn max(a: &Vec, b: N) -> Vec where DefaultAllocator: Alloc { a.map(|a| na::sup(&a, &b)) } pub fn max2(a: &Vec, b: &Vec) -> Vec where DefaultAllocator: Alloc { na::sup(a, b) } pub fn max3(a: &Vec, b: &Vec, c: &Vec) -> Vec where DefaultAllocator: Alloc { max2(&max2(a, b), c) } pub fn max4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec where DefaultAllocator: Alloc { max2(&max2(a, b), &max2(c, d)) } pub fn min(x: &Vec,y: N) -> Vec where DefaultAllocator: Alloc { x.map(|x| na::inf(&x, &y)) } pub fn min2(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { na::inf(x, y) } pub fn min3(a: &Vec, b: &Vec, c: &Vec) -> Vec where DefaultAllocator: Alloc { min2(&min2(a, b), c) } pub fn min4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec where DefaultAllocator: Alloc { min2(&min2(a, b), &min2(c, d)) }