File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 39
39
/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
40
40
pub fn random_unitary < A > ( n : usize ) -> Array2 < A >
41
41
where
42
- A : Scalar + RandNormal ,
42
+ A : Scalar + Lapack ,
43
+ Standard : Distribution < A > ,
43
44
{
44
45
let a: Array2 < A > = random ( ( n, n) ) ;
45
46
let ( q, _r) = a. qr_into ( ) . unwrap ( ) ;
@@ -51,12 +52,13 @@ where
51
52
/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
52
53
pub fn random_regular < A > ( n : usize ) -> Array2 < A >
53
54
where
54
- A : Scalar + RandNormal ,
55
+ A : Scalar + Lapack ,
56
+ Standard : Distribution < A > ,
55
57
{
56
58
let a: Array2 < A > = random ( ( n, n) ) ;
57
59
let ( q, mut r) = a. qr_into ( ) . unwrap ( ) ;
58
60
for i in 0 ..n {
59
- r[ ( i, i) ] = A :: from_f64 ( 1.0 ) + AssociatedReal :: inject ( r[ ( i, i) ] . abs ( ) ) ;
61
+ r[ ( i, i) ] = A :: one ( ) + A :: from_real ( r[ ( i, i) ] . abs ( ) ) ;
60
62
}
61
63
q. dot ( & r)
62
64
}
You can’t perform that action at this time.
0 commit comments