From: <and...@us...> - 2009-01-08 14:30:31
|
Revision: 9278 http://plplot.svn.sourceforge.net/plplot/?rev=9278&view=rev Author: andrewross Date: 2009-01-08 14:30:16 +0000 (Thu, 08 Jan 2009) Log Message: ----------- Add plseed call to all implementations of example 21. This function is not currently tested in any of the examples. The seed value used is the same as the default in the library so the output should remain unchanged. Update fortran 77 and 95 bindings to fix the implementation of plseed in these languages. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/examples/ada/x21a.adb.cmake trunk/examples/ada/xthick21a.adb.cmake trunk/examples/c/x21c.c trunk/examples/c++/x21.cc trunk/examples/f77/x21f.fm4 trunk/examples/f95/x21f.f90 trunk/examples/java/x21.java trunk/examples/ocaml/x21.ml trunk/examples/perl/x21.pl trunk/examples/python/xw21.py trunk/examples/tcl/x21.tcl Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/bindings/f77/scstubs.c 2009-01-08 14:30:16 UTC (rev 9278) @@ -738,9 +738,9 @@ } void -PLSEED(unsigned int s) +PLSEED(unsigned int *s) { - c_plseed(s); + c_plseed(*s); } void Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/bindings/f95/plstubs.h 2009-01-08 14:30:16 UTC (rev 9278) @@ -294,7 +294,7 @@ #define PLSDIORI FNAME(PLSDIORI,plsdiori) #define PLSDIPLT FNAME(PLSDIPLT,plsdiplt) #define PLSDIPLZ FNAME(PLSDIPLZ,plsdiplz) -#define PLSEED FNAME(PLSEEDF77,plseedf77) +#define PLSEED FNAME(PLSEED,plseed) #define PLSESC FNAME(PLSESC,plsesc) #define PLSETOPT7 FNAME(PLSETOPT7,plsetopt7) #define PLSFAM FNAME(PLSFAM,plsfam) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/bindings/f95/scstubs.c 2009-01-08 14:30:16 UTC (rev 9278) @@ -797,9 +797,9 @@ } void -PLSEED(unsigned int s) +PLSEED(unsigned int *s) { - c_plseed(s); + c_plseed(*s); } void Modified: trunk/examples/ada/x21a.adb.cmake =================================================================== --- trunk/examples/ada/x21a.adb.cmake 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/ada/x21a.adb.cmake 2009-01-08 14:30:16 UTC (rev 9278) @@ -170,6 +170,8 @@ -- Initialize plplot plinit; + plseed(5489); + create_data(x, y, z); -- the sampled data zmin := Vector_Min(z); zmax := Vector_Max(z); Modified: trunk/examples/ada/xthick21a.adb.cmake =================================================================== --- trunk/examples/ada/xthick21a.adb.cmake 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/ada/xthick21a.adb.cmake 2009-01-08 14:30:16 UTC (rev 9278) @@ -170,6 +170,8 @@ -- Initialize plplot Initialize_PLplot; + Random_Number_Seed(5489); + create_data(x, y, z); -- the sampled data zmin := Vector_Min(z); zmax := Vector_Max(z); Modified: trunk/examples/c/x21c.c =================================================================== --- trunk/examples/c/x21c.c 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/c/x21c.c 2009-01-08 14:30:16 UTC (rev 9278) @@ -180,6 +180,9 @@ plinit(); + /* Initialise random number generator */ + plseed(5489); + create_data(&x, &y, &z, pts); /* the sampled data */ zmin = z[0]; zmax = z[0]; Modified: trunk/examples/c++/x21.cc =================================================================== --- trunk/examples/c++/x21.cc 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/c++/x21.cc 2009-01-08 14:30:16 UTC (rev 9278) @@ -189,6 +189,8 @@ // plplot initialization pls = new plstream(); + + pls->seed(5489); // Parse and process command line arguments. pls->MergeOpts(options, "x21c options", NULL); Modified: trunk/examples/f77/x21f.fm4 =================================================================== --- trunk/examples/f77/x21f.fm4 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/f77/x21f.fm4 2009-01-08 14:30:16 UTC (rev 9278) @@ -105,6 +105,8 @@ call plinit + call plseed(5489) + do i=1,pts xt = (xmax-xmin)*plrandd() yt = (ymax-ymin)*plrandd() Modified: trunk/examples/f95/x21f.f90 =================================================================== --- trunk/examples/f95/x21f.f90 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/f95/x21f.f90 2009-01-08 14:30:16 UTC (rev 9278) @@ -98,6 +98,8 @@ call plinit + call plseed(5489) + do i=1,pts xt = (xmax-xmin)*plrandd() yt = (ymax-ymin)*plrandd() Modified: trunk/examples/java/x21.java =================================================================== --- trunk/examples/java/x21.java 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/java/x21.java 2009-01-08 14:30:16 UTC (rev 9278) @@ -162,6 +162,8 @@ // Initialize PLplot. pls.init(); + pls.seed(5489); + x = new double[pts]; y = new double[pts]; z = new double[pts]; Modified: trunk/examples/ocaml/x21.ml =================================================================== --- trunk/examples/ocaml/x21.ml 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/ocaml/x21.ml 2009-01-08 14:30:16 UTC (rev 9278) @@ -107,6 +107,8 @@ (* Initialize plplot *) plinit (); + plseed (5489L); + (* The sampled data *) let x, y, z = create_data pts in let zmin = Array.fold_left min infinity z in Modified: trunk/examples/perl/x21.pl =================================================================== --- trunk/examples/perl/x21.pl 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/perl/x21.pl 2009-01-08 14:30:16 UTC (rev 9278) @@ -113,6 +113,8 @@ plinit (); + plseed (5489); + my ($x, $y, $z) = create_data ($pts); # the sampled data my $zmin = min ($z); my $zmax = max ($z); Modified: trunk/examples/python/xw21.py =================================================================== --- trunk/examples/python/xw21.py 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/python/xw21.py 2009-01-08 14:30:16 UTC (rev 9278) @@ -69,6 +69,8 @@ opt[2] = wmin opt[3] = knn_order opt[4] = threshold + + plseed(5489) # Create the sampled data # For consistency across languages use plrandd to create the Modified: trunk/examples/tcl/x21.tcl =================================================================== --- trunk/examples/tcl/x21.tcl 2009-01-08 09:17:50 UTC (rev 9277) +++ trunk/examples/tcl/x21.tcl 2009-01-08 14:30:16 UTC (rev 9278) @@ -82,6 +82,8 @@ opt 3 = [expr {double($knn_order)}] opt 4 = $threshold + $w cmd plseed 5489 + for {set i 0} {$i < $pts} {incr i} { set xt [expr {($xmax-$xmin)*[plrandd]}] set yt [expr {($ymax-$ymin)*[plrandd]}] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |