File tree 3 files changed +8
-27
lines changed 3 files changed +8
-27
lines changed Original file line number Diff line number Diff line change 36
36
}
37
37
38
38
/// Generate random unitary matrix using QR decomposition
39
+ ///
40
+ /// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
39
41
pub fn random_unitary < A > ( n : usize ) -> Array2 < A >
40
42
where
41
43
A : Scalar + RandNormal ,
46
48
}
47
49
48
50
/// Generate random regular matrix
51
+ ///
52
+ /// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
49
53
pub fn random_regular < A > ( n : usize ) -> Array2 < A >
50
54
where
51
55
A : Scalar + RandNormal ,
58
62
q. dot ( & r)
59
63
}
60
64
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
-
74
65
/// Random Hermite matrix
75
66
pub fn random_hermite < A , S > ( n : usize ) -> ArrayBase < S , Ix2 >
76
67
where
Original file line number Diff line number Diff line change @@ -138,10 +138,10 @@ fn det() {
138
138
det_impl ( random_regular :: < f32 > ( rows) , 1e-4 ) ;
139
139
det_impl ( random_regular :: < c64 > ( rows) , 1e-9 ) ;
140
140
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 ) ;
145
145
}
146
146
}
147
147
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments