File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -82,4 +82,13 @@ mod tests {
82
82
assert_almost_eq ! ( x[ 0 ] * x[ 0 ] + x[ 1 ] * x[ 1 ] , 1. , 1e-15 ) ;
83
83
}
84
84
}
85
+
86
+ #[ test]
87
+ fn value_stability ( ) {
88
+ let mut rng = :: test:: rng ( 2 ) ;
89
+ let dist = UnitCircle :: new ( ) ;
90
+ assert_eq ! ( dist. sample( & mut rng) , [ -0.8150602311723979 , 0.5793762331690843 ] ) ;
91
+ assert_eq ! ( dist. sample( & mut rng) , [ -0.056204569973983196 , 0.998419273809375 ] ) ;
92
+ assert_eq ! ( dist. sample( & mut rng) , [ 0.7761923749562624 , -0.630496151502733 ] ) ;
93
+ }
85
94
}
Original file line number Diff line number Diff line change @@ -77,4 +77,16 @@ mod tests {
77
77
assert_almost_eq ! ( x[ 0 ] * x[ 0 ] + x[ 1 ] * x[ 1 ] + x[ 2 ] * x[ 2 ] , 1. , 1e-15 ) ;
78
78
}
79
79
}
80
+
81
+ #[ test]
82
+ fn value_stability ( ) {
83
+ let mut rng = :: test:: rng ( 2 ) ;
84
+ let dist = UnitSphereSurface :: new ( ) ;
85
+ assert_eq ! ( dist. sample( & mut rng) ,
86
+ [ 0.1660727273690104 , 0.5202698793511903 , 0.8376986939610902 ] ) ;
87
+ assert_eq ! ( dist. sample( & mut rng) ,
88
+ [ 0.40052443371799834 , 0.4237054996596154 , -0.812436968356975 ] ) ;
89
+ assert_eq ! ( dist. sample( & mut rng) ,
90
+ [ 0.9209910250970449 , -0.32692477745072107 , 0.21188610520628948 ] ) ;
91
+ }
80
92
}
You can’t perform that action at this time.
0 commit comments