@@ -482,22 +482,6 @@ public void testArcsecIllegalArgument() {
482482 "arcsec(x) : x out of range" ));
483483 }
484484
485- @ Test
486- public void testRandomGaussian () {
487- final long seed = 0xabcdef1234567890L ;
488- assertRandomGaussian (23 , 16.53373419964066 , seed );
489- assertRandomGaussian (27 , -15.542815799078497 , 0xfeeddeadbeefbeefL );
490- assertRandomGaussian (123 , -49.838353142718006 , 124 , 181.75101003563117 );
491- }
492-
493- @ Test
494- public void testRandomUniform () {
495- final long seed = 0xabcdef1234567890L ;
496- assertRandomUniform (23 , 14.278690684728433 , seed );
497- assertRandomUniform (27 , 5.940945158572171 , 0xfeeddeadbeefbeefL );
498- assertRandomUniform (123 , 52.3081016051914 , 124 , 95.52110798318904 );
499- }
500-
501485 // -- Helper methods --
502486
503487 private void assertArccsc (final double i , final double o ) {
@@ -513,46 +497,4 @@ private void assertArcsec(final double i, final double o) {
513497 ops .op ("math.arcsec" ).arity1 ().input (in ).output (out ).compute ();
514498 assertEquals (o , out .get (), 1e-15 );
515499 }
516-
517- private void assertRandomGaussian (final double i , final double o , final long seed ) {
518- final DoubleType in = new DoubleType (i );
519- final DoubleType out = in .createVariable ();
520- ops .op ("math.randomGaussian" ).arity2 ().input (in , seed ).output (out ).compute ();
521- assertEquals (o , out .get (), 0 );
522- }
523-
524- private void assertRandomGaussian (final double i , final double o , final double i2 , final double o2 ) {
525- final DoubleType in = new DoubleType (i );
526- final DoubleType out = new DoubleType ();
527- final long seed = 0xcafebabe12345678L ;
528- final Random rng = new Random (seed );
529- final Computers .Arity2 <DoubleType , Random , DoubleType > op = OpBuilder .matchComputer (ops , "math.randomGaussian" ,
530- new Nil <DoubleType >() {}, new Nil <Random >() {}, new Nil <DoubleType >() {});
531- op .compute (in , rng , out );
532- assertEquals (o , out .get (), 0 );
533- in .set (i2 );
534- op .compute (in , rng , out );
535- assertEquals (o2 , out .get (), 0 );
536- }
537-
538- private void assertRandomUniform (final double i , final double o , final long seed ) {
539- final DoubleType in = new DoubleType (i );
540- final DoubleType out = in .createVariable ();
541- ops .op ("math.randomUniform" ).arity2 ().input (in , seed ).output (out ).compute ();
542- assertEquals (o , out .get (), 0 );
543- }
544-
545- private void assertRandomUniform (final double i , final double o , final double i2 , final double o2 ) {
546- final DoubleType in = new DoubleType (i );
547- final DoubleType out = new DoubleType ();
548- final long seed = 0xcafebabe12345678L ;
549- final Random rng = new Random (seed );
550- final Computers .Arity2 <DoubleType , Random , DoubleType > op = OpBuilder .matchComputer (ops , "math.randomUniform" ,
551- new Nil <DoubleType >() {}, new Nil <Random >() {}, new Nil <DoubleType >() {});
552- op .compute (in , rng , out );
553- assertEquals (o , out .get (), 0 );
554- in .set (i2 );
555- op .compute (in , rng , out );
556- assertEquals (o2 , out .get (), 0 );
557- }
558500}
0 commit comments