File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 11use ndarray:: * ;
22use ndarray_linalg:: * ;
33
4+ #[ should_panic]
5+ #[ test]
6+ fn solveh_shape_mismatch ( ) {
7+ let a: Array2 < f64 > = random_hpd ( 3 ) ;
8+ let b: Array1 < f64 > = random ( 2 ) ;
9+ let _ = a. solveh_into ( b) ;
10+ }
11+
12+ #[ should_panic]
13+ #[ test]
14+ fn factorizeh_solveh_shape_mismatch ( ) {
15+ let a: Array2 < f64 > = random_hpd ( 3 ) ;
16+ let b: Array1 < f64 > = random ( 2 ) ;
17+ let f = a. factorizeh_into ( ) . unwrap ( ) ;
18+ let _ = f. solveh_into ( b) ;
19+ }
20+
421#[ test]
522fn solveh_random ( ) {
623 let a: Array2 < f64 > = random_hpd ( 3 ) ;
@@ -15,6 +32,23 @@ fn solveh_random() {
1532 assert_close_l2 ! ( & x, & y, 1e-7 ) ;
1633}
1734
35+ #[ should_panic]
36+ #[ test]
37+ fn solveh_t_shape_mismatch ( ) {
38+ let a: Array2 < f64 > = random_hpd ( 3 ) . reversed_axes ( ) ;
39+ let b: Array1 < f64 > = random ( 2 ) ;
40+ let _ = a. solveh_into ( b) ;
41+ }
42+
43+ #[ should_panic]
44+ #[ test]
45+ fn factorizeh_solveh_t_shape_mismatch ( ) {
46+ let a: Array2 < f64 > = random_hpd ( 3 ) . reversed_axes ( ) ;
47+ let b: Array1 < f64 > = random ( 2 ) ;
48+ let f = a. factorizeh_into ( ) . unwrap ( ) ;
49+ let _ = f. solveh_into ( b) ;
50+ }
51+
1852#[ test]
1953fn solveh_random_t ( ) {
2054 let a: Array2 < f64 > = random_hpd ( 3 ) . reversed_axes ( ) ;
You can’t perform that action at this time.
0 commit comments