Function peroxide::structure::matrix::py_matrix

source ·
pub fn py_matrix<T>(v: Vec<Vec<T>>) -> Matrix
where T: Into<f64> + Copy,
Expand description

Python-like matrix constructor

§Examples

#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;

fn main() {
    let a = py_matrix(vec![c!(1,2), c!(3,4)]);
    let b = matrix(c!(1,2,3,4), 2, 2, Row);
    assert_eq!(a, b);
}