1- use na:: { Cholesky , DMatrix , DVector } ;
1+ use na:: { Cholesky , DVector } ;
22
33fn cholesky_100x100 ( bh : & mut criterion:: Criterion ) {
44 bh. bench_function ( "cholesky_100x100" , |bh| {
55 bh. iter_batched (
66 || {
7- let m = DMatrix :: < f64 > :: new_random ( 100 , 100 ) ;
7+ let m = crate :: reproducible_dmatrix ( 100 , 100 ) ;
88 & m * m. transpose ( )
99 } ,
1010 |m| Cholesky :: new ( m) ,
@@ -17,7 +17,7 @@ fn cholesky_500x500(bh: &mut criterion::Criterion) {
1717 bh. bench_function ( "cholesky_500x500" , |bh| {
1818 bh. iter_batched (
1919 || {
20- let m = DMatrix :: < f64 > :: new_random ( 500 , 500 ) ;
20+ let m = crate :: reproducible_dmatrix ( 500 , 500 ) ;
2121 & m * m. transpose ( )
2222 } ,
2323 |m| Cholesky :: new ( m) ,
@@ -31,7 +31,7 @@ fn cholesky_decompose_unpack_100x100(bh: &mut criterion::Criterion) {
3131 bh. bench_function ( "cholesky_decompose_unpack_100x100" , |bh| {
3232 bh. iter_batched (
3333 || {
34- let m = DMatrix :: < f64 > :: new_random ( 100 , 100 ) ;
34+ let m = crate :: reproducible_dmatrix ( 100 , 100 ) ;
3535 & m * m. transpose ( )
3636 } ,
3737 |m| {
@@ -46,7 +46,7 @@ fn cholesky_decompose_unpack_500x500(bh: &mut criterion::Criterion) {
4646 bh. bench_function ( "cholesky_decompose_unpack_500x500" , |bh| {
4747 bh. iter_batched (
4848 || {
49- let m = DMatrix :: < f64 > :: new_random ( 500 , 500 ) ;
49+ let m = crate :: reproducible_dmatrix ( 500 , 500 ) ;
5050 & m * m. transpose ( )
5151 } ,
5252 |m| {
@@ -62,7 +62,7 @@ fn cholesky_solve_10x10(bh: &mut criterion::Criterion) {
6262 bh. bench_function ( "cholesky_solve_10x10" , |bh| {
6363 bh. iter_batched_ref (
6464 || {
65- let m = DMatrix :: < f64 > :: new_random ( 10 , 10 ) ;
65+ let m = crate :: reproducible_dmatrix ( 10 , 10 ) ;
6666 let m = & m * m. transpose ( ) ;
6767 let v = DVector :: < f64 > :: new_random ( 10 ) ;
6868 let chol = Cholesky :: new ( m) . unwrap ( ) ;
@@ -78,7 +78,7 @@ fn cholesky_solve_100x100(bh: &mut criterion::Criterion) {
7878 bh. bench_function ( "cholesky_solve_100x100" , |bh| {
7979 bh. iter_batched_ref (
8080 || {
81- let m = DMatrix :: < f64 > :: new_random ( 100 , 100 ) ;
81+ let m = crate :: reproducible_dmatrix ( 100 , 100 ) ;
8282 let m = & m * m. transpose ( ) ;
8383 let v = DVector :: < f64 > :: new_random ( 100 ) ;
8484 let chol = Cholesky :: new ( m) . unwrap ( ) ;
@@ -94,7 +94,7 @@ fn cholesky_solve_500x500(bh: &mut criterion::Criterion) {
9494 bh. bench_function ( "cholesky_solve_500x500" , |bh| {
9595 bh. iter_batched_ref (
9696 || {
97- let m = DMatrix :: < f64 > :: new_random ( 500 , 500 ) ;
97+ let m = crate :: reproducible_dmatrix ( 500 , 500 ) ;
9898 let m = & m * m. transpose ( ) ;
9999 let v = DVector :: < f64 > :: new_random ( 500 ) ;
100100 let chol = Cholesky :: new ( m) . unwrap ( ) ;
@@ -110,7 +110,7 @@ fn cholesky_inverse_10x10(bh: &mut criterion::Criterion) {
110110 bh. bench_function ( "cholesky_inverse_10x10" , |bh| {
111111 bh. iter_batched_ref (
112112 || {
113- let m = DMatrix :: < f64 > :: new_random ( 10 , 10 ) ;
113+ let m = crate :: reproducible_dmatrix ( 10 , 10 ) ;
114114 let m = & m * m. transpose ( ) ;
115115 Cholesky :: new ( m) . unwrap ( )
116116 } ,
@@ -124,7 +124,7 @@ fn cholesky_inverse_100x100(bh: &mut criterion::Criterion) {
124124 bh. bench_function ( "cholesky_inverse_100x100" , |bh| {
125125 bh. iter_batched_ref (
126126 || {
127- let m = DMatrix :: < f64 > :: new_random ( 100 , 100 ) ;
127+ let m = crate :: reproducible_dmatrix ( 100 , 100 ) ;
128128 let m = & m * m. transpose ( ) ;
129129 Cholesky :: new ( m) . unwrap ( )
130130 } ,
@@ -138,7 +138,7 @@ fn cholesky_inverse_500x500(bh: &mut criterion::Criterion) {
138138 bh. bench_function ( "cholesky_inverse_500x500" , |bh| {
139139 bh. iter_batched_ref (
140140 || {
141- let m = DMatrix :: < f64 > :: new_random ( 500 , 500 ) ;
141+ let m = crate :: reproducible_dmatrix ( 500 , 500 ) ;
142142 let m = & m * m. transpose ( ) ;
143143 Cholesky :: new ( m) . unwrap ( )
144144 } ,
0 commit comments