Function peroxide::complex::matrix::py_cmatrix

source ·
pub fn py_cmatrix<T>(v: Vec<Vec<T>>) -> ComplexMatrix
where T: Into<C64> + Copy,
Expand description

Python-like complex matrix constructor

§Examples

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

fn main() {
    let a = py_cmatrix(vec![vec![C64::new(1f64, 1f64),
                                        C64::new(2f64, 2f64)],
                                   vec![C64::new(3f64, 3f64),
                                        C64::new(4f64, 4f64)]
    ]);
    let b = cmatrix(vec![C64::new(1f64, 1f64),
                                C64::new(2f64, 2f64),
                                C64::new(3f64, 3f64),
                                C64::new(4f64, 4f64)],
                            2, 2, Row
    );
    assert_eq!(a, b);
}