IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 10, 2009, 4:53:42 PM (17 years ago)
Author:
Paul Price
Message:

Changing API for psRandomAlloc() to make it easier to be deterministic. psRandomAlloc() now takes only a single argument, which is the generator type (only PS_RANDOM_TAUS is currently supported; others could easily be added). The seed used by the generator is set by psRandomSeed(). This allows us to use the same seed for the random number generator over multiple calls, which means that we can be deterministic by setting the seed. The old API for psRandomAlloc() is available using psRandomAllocSpecific(). Added to the configuration setup in psModules to include recording the random seed, and setting if desired. Updated all our products to use this API. Some fixes and updates to the configuration run-time information dumping. ppImage now dumps the configuration at the end, allowing the list of files in the run-time information to be set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstest/src/tst_psPolynomial.c

    r5873 r23259  
    289289            fillVectors(x, f, NORD, NPTS, type[k]);
    290290            psTime *now = psTimeGetNow(PS_TIME_UTC);
    291             const psRandom *r = psRandomAlloc(PS_RANDOM_TAUS, now->sec);
     291            const psRandom *r = psRandomAllocSpecific(PS_RANDOM_TAUS, now->sec);
    292292            for (int i = 0; i < NPTS; i++) {
    293293                double errgen = psRandomGaussian(r);
     
    361361            // add random errors to the vector
    362362            psTime *now = psTimeGetNow(PS_TIME_UTC);
    363             const psRandom *r = psRandomAlloc(PS_RANDOM_TAUS, now->sec);
     363            const psRandom *r = psRandomAllocSpecific(PS_RANDOM_TAUS, now->sec);
    364364            for (int i = 0; i < NPTS; i++) {
    365365                double errgen = psRandomGaussian(r);
     
    464464            fillVectors(x, f, NORD, NPTS, type[k]);
    465465            psTime *now = psTimeGetNow(PS_TIME_UTC);
    466             const psRandom *r = psRandomAlloc(PS_RANDOM_TAUS, now->sec);
     466            const psRandom *r = psRandomAllocSpecific(PS_RANDOM_TAUS, now->sec);
    467467            for (int i = 0; i < NPTS; i++) {
    468468                double errgen = psRandomGaussian(r);
Note: See TracChangeset for help on using the changeset viewer.