[][src]Struct optlib::genetic::cross::CrossMean

pub struct CrossMean;

Child chromosome is arithmetic mean of parent chromosomes. Result of cross is single child. The chromosomes must be numeric type.

Methods

impl CrossMean[src]

pub fn new() -> Self[src]

Trait Implementations

impl<G: NumCast + Num + Clone> Cross<G> for CrossMean[src]

use optlib::genetic::cross;
use optlib::genetic::Cross;

assert!(cross::CrossMean::new().cross(&vec![&1.0_f32, &2.0_f32]) == vec![1.5_f32]);
assert!(cross::CrossMean::new().cross(&vec![&0.0_f64, &1.0_f64]) == vec![0.5_f64]);
assert!(cross::CrossMean::new().cross(&vec![&0.0_f64, &1.0_f64, &2.0_f64]) == vec![1.0_f64]);

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]