diff --git a/lang-trials/rust-benchmark/src/engine.rs b/lang-trials/rust-benchmark/src/engine.rs index 04377fd..eed73a1 100644 --- a/lang-trials/rust-benchmark/src/engine.rs +++ b/lang-trials/rust-benchmark/src/engine.rs @@ -1,7 +1,5 @@ use nalgebra::{*, allocator::Allocator}; use std::f64::consts::{PI, E}; -/*use std::ops::Sub;*/ -/*use typenum::{B1, UInt, UTerm};*/ /* dynamic matrices */ pub fn rand_eigval_series(dim: usize, time_res: usize) -> Vec, Dyn>> { @@ -104,43 +102,4 @@ pub fn rand_eigval_series(dim: usize, time_res: usize) -> Vec(time_res: usize) -> Vec, Const>> - where - Const: ToTypenum, - as ToTypenum>::Typenum: Sub>, - < as ToTypenum>::Typenum as Sub>>::Output: ToConst -{ - // initialize the random matrix - /*let mut rand_mat = SMatrix::::zeros(); - for n in 0..N*N { - rand_mat[n] = E*((n*n) as f64) % 2.0 - 1.0; - }*/ - let rand_mat = OMatrix::, Const>::from_fn(|j, k| { - let n = j*N + k; - E*((n*n) as f64) % 2.0 - 1.0 - }); - - // initialize the rotation step - let mut rot_step = OMatrix::, Const>::identity(); - let max_freq = 4; - for n in (0..N).step_by(2) { - let ang = PI * ((n % max_freq) as f64) / (time_res as f64); - let ang_cos = ang.cos(); - let ang_sin = ang.sin(); - rot_step[(n, n)] = ang_cos; - rot_step[(n+1, n)] = ang_sin; - rot_step[(n, n+1)] = -ang_sin; - rot_step[(n+1, n+1)] = ang_cos; - } - - // find the eigenvalues - let mut eigvals = Vec::, Const>>::with_capacity(time_res); - unsafe { eigvals.set_len(time_res); } - for t in 0..time_res { - eigvals[t] = rand_mat.complex_eigenvalues(); - } - eigvals }*/ \ No newline at end of file