Skip to content

Commit 5102019

Browse files
committed
Remove *_t
1 parent d6684d7 commit 5102019

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

src/generate.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ where
3636
}
3737

3838
/// Generate random unitary matrix using QR decomposition
39+
///
40+
/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
3941
pub fn random_unitary<A>(n: usize) -> Array2<A>
4042
where
4143
A: Scalar + RandNormal,
@@ -46,6 +48,8 @@ where
4648
}
4749

4850
/// Generate random regular matrix
51+
///
52+
/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
4953
pub fn random_regular<A>(n: usize) -> Array2<A>
5054
where
5155
A: Scalar + RandNormal,
@@ -58,19 +62,6 @@ where
5862
q.dot(&r)
5963
}
6064

61-
/// Generate random regular matrix
62-
pub fn random_regular_t<A>(n: usize) -> Array2<A>
63-
where
64-
A: Scalar + RandNormal,
65-
{
66-
let a: Array2<A> = random((n, n).f());
67-
let (q, mut r) = a.qr_into().unwrap();
68-
for i in 0..n {
69-
r[(i, i)] = A::from_f64(1.0) + AssociatedReal::inject(r[(i, i)].abs());
70-
}
71-
q.dot(&r).t().to_owned()
72-
}
73-
7465
/// Random Hermite matrix
7566
pub fn random_hermite<A, S>(n: usize) -> ArrayBase<S, Ix2>
7667
where

tests/det.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ fn det() {
138138
det_impl(random_regular::<f32>(rows), 1e-4);
139139
det_impl(random_regular::<c64>(rows), 1e-9);
140140
det_impl(random_regular::<c32>(rows), 1e-4);
141-
det_impl(random_regular_t::<f64>(rows), 1e-9);
142-
det_impl(random_regular_t::<f32>(rows), 1e-4);
143-
det_impl(random_regular_t::<c64>(rows), 1e-9);
144-
det_impl(random_regular_t::<c32>(rows), 1e-4);
141+
det_impl(random_regular::<f64>(rows).t().to_owned(), 1e-9);
142+
det_impl(random_regular::<f32>(rows).t().to_owned(), 1e-4);
143+
det_impl(random_regular::<c64>(rows).t().to_owned(), 1e-9);
144+
det_impl(random_regular::<c32>(rows).t().to_owned(), 1e-4);
145145
}
146146
}
147147

tests/generate.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)