Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/PRNG.cfa

    r470618c0 r5910fc0  
    88// Created On       : Wed Dec 29 09:38:12 2021
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Sat Feb 12 12:23:57 2022
    11 // Update Count     : 342
     10// Last Modified On : Fri Feb 11 08:16:43 2022
     11// Update Count     : 328
    1212//
    1313
     
    2020#include <malloc.h>                                                                             // malloc_stats
    2121#include <locale.h>                                                                             // setlocale
    22 #include <mutex_stmt.hfa>
    2322
    2423// FIX ME: spurious characters appear in output
     
    5150        } // for
    5251        double std = sqrt( sum / BUCKETS );
    53         mutex( sout ) sout | "trials"  | TRIALS | "buckets" | BUCKETS
    54                 | "min" | min | "max" | max
    55                 | "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%";
     52        sout | "trials"  | TRIALS | "buckets" | BUCKETS
     53                 | "min" | min | "max" | max
     54                 | "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%";
    5655} // avgstd
    5756
    58 
    5957uint32_t seed = 1009;
     58
    6059
    6160thread T1 {};
     
    9594        unsigned int * buckets = calloc( BUCKETS );                     // too big for task stack
    9695        for ( TRIALS ) {
    97                 buckets[prng( th ) % BUCKETS] += 1;     // concurrent
     96                buckets[prng( (thread$ &)th ) % BUCKETS] += 1;  // concurrent
    9897        } // for
    9998        avgstd( buckets );
Note: See TracChangeset for help on using the changeset viewer.