Remove unnecessary type annotations
These annotations are only needed for statically sized matrices.
This commit is contained in:
parent
144bfb8faf
commit
fb51e00503
@ -4,17 +4,8 @@ use std::f64::consts::{PI, E};
|
||||
/*use typenum::{B1, UInt, UTerm};*/
|
||||
|
||||
/* dynamic matrices */
|
||||
pub fn rand_eigval_series<N>(time_res: usize) -> Vec<OVector<Complex<f64>, Dyn>>
|
||||
where
|
||||
N: ToTypenum + DimName + DimSub<U1>,
|
||||
DefaultAllocator:
|
||||
Allocator<N> +
|
||||
Allocator<N, N> +
|
||||
Allocator<<N as DimSub<U1>>::Output> +
|
||||
Allocator<N, <N as DimSub<U1>>::Output>
|
||||
{
|
||||
pub fn rand_eigval_series(dim: usize, time_res: usize) -> Vec<OVector<Complex<f64>, Dyn>> {
|
||||
// initialize the random matrix
|
||||
let dim = N::try_to_usize().unwrap();
|
||||
let mut rand_mat = DMatrix::<f64>::from_fn(dim, dim, |j, k| {
|
||||
let n = j*dim + k;
|
||||
E*((n*n) as f64) % 2.0 - 1.0
|
||||
@ -44,17 +35,8 @@ pub fn rand_eigval_series<N>(time_res: usize) -> Vec<OVector<Complex<f64>, Dyn>>
|
||||
}
|
||||
|
||||
/* dynamic single float matrices */
|
||||
/*pub fn rand_eigval_series<N>(time_res: usize) -> Vec<OVector<Complex<f32>, Dyn>>
|
||||
where
|
||||
N: ToTypenum + DimName + DimSub<U1>,
|
||||
DefaultAllocator:
|
||||
Allocator<N> +
|
||||
Allocator<N, N> +
|
||||
Allocator<<N as DimSub<U1>>::Output> +
|
||||
Allocator<N, <N as DimSub<U1>>::Output>
|
||||
{
|
||||
/*pub fn rand_eigval_series(dim: usize, time_res: usize) -> Vec<OVector<Complex<f32>, Dyn>> {
|
||||
// initialize the random matrix
|
||||
let dim = N::try_to_usize().unwrap();
|
||||
let mut rand_mat = DMatrix::<f32>::from_fn(dim, dim, |j, k| {
|
||||
let n = j*dim + k;
|
||||
(E as f32)*((n*n) as f32) % 2.0_f32 - 1.0_f32
|
||||
|
@ -19,7 +19,8 @@ fn main() {
|
||||
on_mount(move || {
|
||||
let performance = window().unwrap().performance().unwrap();
|
||||
let start_time = performance.now();
|
||||
let eigval_series = engine::rand_eigval_series::<U60>(time_res);
|
||||
/*let eigval_series = engine::rand_eigval_series::<U60>(time_res);*/
|
||||
let eigval_series = engine::rand_eigval_series(60, time_res);
|
||||
let run_time = performance.now() - start_time;
|
||||
run_time_report.set(run_time);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user