use na::{Real, DefaultAllocator}; use aliases::Vec; use traits::{Alloc, Dimension}; pub fn exp(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.exp()) } pub fn exp2(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.exp2()) } pub fn inversesqrt(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| N::one() / x.sqrt()) } pub fn log(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.ln()) } pub fn log2(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.log2()) } pub fn pow(base: &Vec, exponent: &Vec) -> Vec where DefaultAllocator: Alloc { base.zip_map(exponent, |b, e| b.powf(e)) } pub fn sqrt(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.sqrt()) }