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/psLib/src/fits/psFitsScale.c

    r21183 r23259  
    112112    // psImageBackground automatically excludes pixels that are non-finite, so we don't need to bother about a
    113113    // mask.
    114     psU64 seed = p_psRandomGetSystemSeed(false);
    115     psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, seed);
     114    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS);
    116115    psStats *stats = psStatsAlloc(MEAN_STAT | STDEV_STAT); // Statistics object
    117116    if (!psImageBackground(stats, NULL, image, mask, maskVal, rng)) {
     
    290289    if (!psMemIncrRefCounter(rng) && options->fuzz) {
    291290        // Don't blab about which seed we're going to get --- it's not necessary for this purpose
    292         psU64 seed = p_psRandomGetSystemSeed(false);
    293         rng = psRandomAlloc(PS_RANDOM_TAUS, seed);
     291        rng = psRandomAlloc(PS_RANDOM_TAUS);
    294292    }
    295293
Note: See TracChangeset for help on using the changeset viewer.