use ndarray::prelude::*;
pub trait Neural {
fn get_lateral(&self) -> &Array2<f64>;
fn get_lateral_mut(&mut self) -> &mut Array2<f64>;
fn set_lateral(&mut self, lateral: Array2<f64>);
fn get_patterns(&self) -> &Array2<f64>;
fn get_patterns_mut(&mut self) -> &mut Array2<f64>;
fn set_patterns(&mut self, patterns: Array2<f64>);
}
#[derive(Default)]
pub struct NeuralLayer {
pub lateral: Array2<f64>,
pub patterns: Array2<f64>,
}
impl NeuralLayer {
pub fn new() -> NeuralLayer {
NeuralLayer {
lateral: Array2::<f64>::zeros((0, 0)),
patterns: Array2::<f64>::zeros((0, 0)),
}
}
}
impl Neural for NeuralLayer {
fn get_lateral(&self) -> &Array2<f64> {
&self.lateral
}
fn get_lateral_mut(&mut self) -> &mut Array2<f64> {
&mut self.lateral
}
fn set_lateral(&mut self, lateral: Array2<f64>) {
todo!()
}
fn get_patterns(&self) -> &Array2<f64> {
&self.patterns
}
fn get_patterns_mut(&mut self) -> &mut Array2<f64> {
&mut self.patterns
}
fn set_patterns(&mut self, patterns: Array2<f64>) {
todo!()
}
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}