Function peroxide::complex::matrix::complex_combine

source ·
pub fn complex_combine(
    m1: ComplexMatrix,
    m2: ComplexMatrix,
    m3: ComplexMatrix,
    m4: ComplexMatrix,
) -> ComplexMatrix
Expand description

Combine separated Complex Matrix to one Complex Matrix

§Examples

use peroxide::fuga::*;
use peroxide::complex::matrix::*;
use peroxide::traits::fp::FPMatrix;

fn main() {
    let x1 = cmatrix(vec![C64::new(1f64, 1f64)], 1, 1, Row);
    let x2 = cmatrix(vec![C64::new(2f64, 2f64)], 1, 1, Row);
    let x3 = cmatrix(vec![C64::new(3f64, 3f64)], 1, 1, Row);
    let x4 = cmatrix(vec![C64::new(4f64, 4f64)], 1, 1, Row);

    let y = complex_combine(x1, x2, x3, x4);

    let y_exp = cmatrix(vec![C64::new(1f64, 1f64),
                                    C64::new(2f64, 2f64),
                                    C64::new(3f64, 3f64),
                                    C64::new(4f64, 4f64)],
                            2, 2, Row
    );

    assert_eq!(y, y_exp);
}