1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use basic_dsp_vector::*;
use basic_dsp_vector::numbers::*;
use super::*;
use TransformContent;
use std::marker;

macro_rules! add_mat_impl {
    ($($matrix:ident);*) => {
        $(
			impl<V, O, S: ToSlice<T>, T: RealNumber> RededicateForceOps<$matrix<O, S, T>>
                for $matrix<V, S, T>
                where V: RededicateForceOps<O> + Vector<T>,
                      T: RealNumber,
                      O: Vector<T> {

                fn rededicate_from_force(origin: $matrix<O, S, T>) -> Self {
					let rows = origin.rows.transform(V::rededicate_from_force);
					$matrix {
                        rows: rows,
                        storage_type: marker::PhantomData,
                	  	number_type: marker::PhantomData
                    }
                }

                fn rededicate_with_runtime_data(
                        origin: $matrix<O, S, T>,
                        is_complex: bool,
                        domain: DataDomain) -> Self {
					let rows =
                        origin.rows.transform(
                            |v|V::rededicate_with_runtime_data(v, is_complex, domain));
					$matrix {
                        rows: rows,
                        storage_type: marker::PhantomData,
                	  	number_type: marker::PhantomData
                    }
                }
            }
		)*
	}
}

add_mat_impl!(MatrixMxN; Matrix2xN; Matrix3xN; Matrix4xN);