[−][src]Trait peroxide::traits::fp::FPVector
Functional Programming tools for Vector
Associated Types
Loading content...Required methods
pub fn fmap<F>(&self, f: F) -> Self where
F: Fn(Self::Scalar) -> Self::Scalar,
[src]
F: Fn(Self::Scalar) -> Self::Scalar,
pub fn reduce<F, T>(&self, init: T, f: F) -> Self::Scalar where
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
T: Into<Self::Scalar>,
[src]
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
T: Into<Self::Scalar>,
pub fn zip_with<F>(&self, f: F, other: &Self) -> Self where
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
[src]
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
pub fn filter<F>(&self, f: F) -> Self where
F: Fn(Self::Scalar) -> bool,
[src]
F: Fn(Self::Scalar) -> bool,
pub fn take(&self, n: usize) -> Self
[src]
pub fn skip(&self, n: usize) -> Self
[src]
pub fn sum(&self) -> Self::Scalar
[src]
pub fn prod(&self) -> Self::Scalar
[src]
Implementations on Foreign Types
impl FPVector for Vec<Dual>
[src]
type Scalar = Dual
pub fn fmap<F>(&self, f: F) -> Self where
F: Fn(Self::Scalar) -> Self::Scalar,
[src]
F: Fn(Self::Scalar) -> Self::Scalar,
pub fn reduce<F, T>(&self, _init: T, _f: F) -> Self::Scalar where
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
T: Into<Self::Scalar>,
[src]
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
T: Into<Self::Scalar>,
pub fn zip_with<F>(&self, f: F, other: &Self) -> Self where
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
[src]
F: Fn(Self::Scalar, Self::Scalar) -> Self::Scalar,
pub fn filter<F>(&self, _f: F) -> Self where
F: Fn(Self::Scalar) -> bool,
[src]
F: Fn(Self::Scalar) -> bool,
pub fn take(&self, n: usize) -> Self
[src]
pub fn skip(&self, n: usize) -> Self
[src]
pub fn sum(&self) -> Self::Scalar
[src]
pub fn prod(&self) -> Self::Scalar
[src]
impl FPVector for Vec<f64>
[src]
type Scalar = f64
pub fn fmap<F>(&self, f: F) -> Vec<f64> where
F: Fn(f64) -> f64,
[src]
F: Fn(f64) -> f64,
fmap for Vec
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); assert_eq!(a.fmap(|x| x*2f64), seq!(2,10,2)); }
pub fn reduce<F, T>(&self, init: T, f: F) -> f64 where
F: Fn(f64, f64) -> f64,
T: Into<f64>,
[src]
F: Fn(f64, f64) -> f64,
T: Into<f64>,
reduce for Vec
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = seq!(1,100,1); assert_eq!(a.reduce(0, |x,y| x + y), 5050f64); }
pub fn zip_with<F>(&self, f: F, other: &Vec<f64>) -> Vec<f64> where
F: Fn(f64, f64) -> f64,
[src]
F: Fn(f64, f64) -> f64,
pub fn filter<F>(&self, f: F) -> Vec<f64> where
F: Fn(f64) -> bool,
[src]
F: Fn(f64) -> bool,
Filter for Vec
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); let b = a.filter(|x| x > 3.); assert_eq!(b, c!(4,5)); }
pub fn take(&self, n: usize) -> Vec<f64>
[src]
Take for Vec
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); let b = a.take(3); assert_eq!(b, c!(1,2,3)); }
pub fn skip(&self, n: usize) -> Vec<f64>
[src]
Skip for Vec
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); let b = a.skip(3); assert_eq!(b, c!(4,5)); }