Changeset 3389 in Sophya for trunk/SophyaLib/BaseTools


Ignore:
Timestamp:
Nov 22, 2007, 6:20:04 PM (18 years ago)
Author:
cmv
Message:

intro classe RandomGenerator , cmv+rz 22/11/2007

Location:
trunk/SophyaLib/BaseTools
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/Makefile

    r3123 r3389  
    11include ../BuildMgr/sophyamake.inc
    2  
     2
    33all: $(SOPHYALIBP)libBaseTools.a
    44 
    55clean:
    6          rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o
     6         rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o
    77        rm -f $(SOPHYALIBP)libBaseTools.a
    88 
    9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)srandgen.o $(SOPHYAOBJP)timestamp.o
     9$(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)srandgen.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
    1212 
    13 $(SOPHYAOBJP)datatype.o: datatype.cc sopnamsp.h datatype.h \
     13$(SOPHYAOBJP)datatype.o: datatype.cc datatype.h \
    1414  $(SOPHYAINCP)machdefs.h
    1515        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  datatype.cc
    1616 
    17 $(SOPHYAOBJP)dvlist.o: dvlist.cc sopnamsp.h \
    18   $(SOPHYAINCP)machdefs.h dvlist.h \
    19   objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h ppfbinstream.h \
    20   rawstream.h ppfnametag.h mutyv.h timestamp.h \
     17$(SOPHYAOBJP)dvlist.o: dvlist.cc $(SOPHYAINCP)machdefs.h \
     18  dvlist.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
     19  ppfbinstream.h rawstream.h ppfnametag.h mutyv.h timestamp.h \
    2120  $(SOPHYAINCP)strutil.h
    2221        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  dvlist.cc
    2322 
    2423$(SOPHYAOBJP)fiondblock.o: fiondblock.cc sopnamsp.h \
    25   $(SOPHYAINCP)machdefs.h \
    26   pexceptions.h datatype.h fiondblock.h ppersist.h gnumd5.h \
    27   ppfbinstream.h rawstream.h ppfnametag.h ndatablock.h anydataobj.h
     24  $(SOPHYAINCP)machdefs.h pexceptions.h \
     25  datatype.h fiondblock.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
     26  ppfnametag.h ndatablock.h anydataobj.h
    2827        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fiondblock.cc
    2928 
    3029$(SOPHYAOBJP)mutyv.o: mutyv.cc sopnamsp.h mutyv.h \
    31   $(SOPHYAINCP)machdefs.h \
    32   timestamp.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
    33   ppfbinstream.h rawstream.h ppfnametag.h
     30  $(SOPHYAINCP)machdefs.h timestamp.h objfio.h \
     31  anydataobj.h ppersist.h pexceptions.h gnumd5.h ppfbinstream.h \
     32  rawstream.h ppfnametag.h
    3433        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  mutyv.cc
    3534 
    3635$(SOPHYAOBJP)ndatablock.o: ndatablock.cc sopnamsp.h \
    37   $(SOPHYAINCP)machdefs.h \
    38   pexceptions.h ndatablock.h anydataobj.h
     36  $(SOPHYAINCP)machdefs.h pexceptions.h \
     37  ndatablock.h anydataobj.h thsafeop.h
    3938        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ndatablock.cc
    4039 
     
    4443 
    4544$(SOPHYAOBJP)ppersist.o: ppersist.cc sopnamsp.h \
    46   $(SOPHYAINCP)machdefs.h \
    47   pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
    48   ppfnametag.h anydataobj.h
     45  $(SOPHYAINCP)machdefs.h pexceptions.h \
     46  ppersist.h gnumd5.h ppfbinstream.h rawstream.h ppfnametag.h \
     47  anydataobj.h
    4948        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppersist.cc
    5049 
    5150$(SOPHYAOBJP)ppfbinstream.o: ppfbinstream.cc sopnamsp.h \
    52   $(SOPHYAINCP)machdefs.h \
    53   ppfbinstream.h rawstream.h pexceptions.h
     51  $(SOPHYAINCP)machdefs.h ppfbinstream.h \
     52  rawstream.h pexceptions.h
    5453        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppfbinstream.cc
    5554 
    5655$(SOPHYAOBJP)ppftpointerio.o: ppftpointerio.cc \
    57   $(SOPHYAINCP)machdefs.h \
    58   sopnamsp.h ppftpointerio.h ppersist.h pexceptions.h gnumd5.h \
    59   ppfbinstream.h rawstream.h ppfnametag.h
     56  $(SOPHYAINCP)machdefs.h ppftpointerio.h \
     57  ppersist.h pexceptions.h gnumd5.h ppfbinstream.h rawstream.h \
     58  ppfnametag.h
    6059        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppftpointerio.cc
    6160 
    6261$(SOPHYAOBJP)rawstream.o: rawstream.cc sopnamsp.h rawstream.h \
    63   $(SOPHYAINCP)machdefs.h \
    64   pexceptions.h
     62  $(SOPHYAINCP)machdefs.h pexceptions.h
    6563        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  rawstream.cc
    6664 
    6765$(SOPHYAOBJP)sophyainit.o: sophyainit.cc sopnamsp.h \
    68   $(SOPHYAINCP)machdefs.h \
    69   sophyainit.h pexceptions.h ppersist.h gnumd5.h ppfbinstream.h \
    70   rawstream.h ppfnametag.h fiondblock.h ndatablock.h anydataobj.h \
    71   dvlist.h objfio.h mutyv.h timestamp.h fiosegdb.h segdatablock.h \
     66  $(SOPHYAINCP)machdefs.h sophyainit.h \
     67  pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
     68  ppfnametag.h fiondblock.h ndatablock.h anydataobj.h dvlist.h objfio.h \
     69  mutyv.h timestamp.h fiosegdb.h segdatablock.h thsafeop.h \
    7270  ppftpointerio.h ppfwrapstlv.h sversion.h
    7371        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  sophyainit.cc
    7472 
    75 $(SOPHYAOBJP)timestamp.o: timestamp.cc sopnamsp.h \
    76   $(SOPHYAINCP)machdefs.h \
     73$(SOPHYAOBJP)stsrand.o: stsrand.cc stsrand.h \
     74  $(SOPHYAINCP)machdefs.h objfio.h anydataobj.h \
     75  ppersist.h pexceptions.h gnumd5.h ppfbinstream.h rawstream.h \
     76  ppfnametag.h ndatablock.h thsafeop.h srandgen.h fiondblock.h
     77        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  stsrand.cc
     78 
     79$(SOPHYAOBJP)timestamp.o: timestamp.cc $(SOPHYAINCP)machdefs.h \
    7780  timestamp.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
    7881  ppfbinstream.h rawstream.h ppfnametag.h
    7982        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  timestamp.cc
    8083 
    81 $(SOPHYAOBJP)gnumd5.o: gnumd5.c \
    82   $(SOPHYAINCP)machdefs.h \
     84$(SOPHYAOBJP)gnumd5.o: gnumd5.c $(SOPHYAINCP)machdefs.h \
    8385  bithelp.h gnumd5.h
    8486        $(CCOMPILE) -o $@  gnumd5.c
    8587 
    86 $(SOPHYAOBJP)srandgen.o: srandgen.c \
    87   $(SOPHYAINCP)machdefs.h \
     88$(SOPHYAOBJP)srandgen.o: srandgen.c $(SOPHYAINCP)machdefs.h \
    8889  srandgen.h smathconst.h
    8990        $(CCOMPILE) -o $@  srandgen.c
  • trunk/SophyaLib/BaseTools/objlist.list

    r2687 r3389  
    1212sophyainit.o
    1313srandgen.o
     14stsrand.o
    1415timestamp.o
  • trunk/SophyaLib/BaseTools/smakefile

    r3074 r3389  
    44 
    55clean:
    6          rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o
     6         rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o
    77        rm -f $(SOPHYALIBP)libBaseTools.a
    88 
    9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)srandgen.o $(SOPHYAOBJP)timestamp.o
     9$(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)srandgen.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
    1212 
    13 $(SOPHYAOBJP)datatype.o: datatype.cc sopnamsp.h datatype.h \
     13$(SOPHYAOBJP)datatype.o: datatype.cc datatype.h \
    1414  $(SOPHYAINCP)machdefs.h
    1515        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  datatype.cc
    1616 
    17 $(SOPHYAOBJP)dvlist.o: dvlist.cc sopnamsp.h \
    18   $(SOPHYAINCP)machdefs.h dvlist.h \
    19   objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h ppfbinstream.h \
    20   rawstream.h ppfnametag.h mutyv.h timestamp.h \
     17$(SOPHYAOBJP)dvlist.o: dvlist.cc $(SOPHYAINCP)machdefs.h \
     18  dvlist.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
     19  ppfbinstream.h rawstream.h ppfnametag.h mutyv.h timestamp.h \
    2120  $(SOPHYAINCP)strutil.h
    2221        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  dvlist.cc
    2322 
    2423$(SOPHYAOBJP)fiondblock.o: fiondblock.cc sopnamsp.h \
    25   $(SOPHYAINCP)machdefs.h \
    26   pexceptions.h datatype.h fiondblock.h ppersist.h gnumd5.h \
    27   ppfbinstream.h rawstream.h ppfnametag.h ndatablock.h anydataobj.h
     24  $(SOPHYAINCP)machdefs.h pexceptions.h \
     25  datatype.h fiondblock.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
     26  ppfnametag.h ndatablock.h anydataobj.h
    2827        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  fiondblock.cc
    2928 
    3029$(SOPHYAOBJP)mutyv.o: mutyv.cc sopnamsp.h mutyv.h \
    31   $(SOPHYAINCP)machdefs.h \
    32   timestamp.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
    33   ppfbinstream.h rawstream.h ppfnametag.h
     30  $(SOPHYAINCP)machdefs.h timestamp.h objfio.h \
     31  anydataobj.h ppersist.h pexceptions.h gnumd5.h ppfbinstream.h \
     32  rawstream.h ppfnametag.h
    3433        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  mutyv.cc
    3534 
    3635$(SOPHYAOBJP)ndatablock.o: ndatablock.cc sopnamsp.h \
    37   $(SOPHYAINCP)machdefs.h \
    38   pexceptions.h ndatablock.h anydataobj.h
     36  $(SOPHYAINCP)machdefs.h pexceptions.h \
     37  ndatablock.h anydataobj.h thsafeop.h
    3938        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ndatablock.cc
    4039 
     
    4443 
    4544$(SOPHYAOBJP)ppersist.o: ppersist.cc sopnamsp.h \
    46   $(SOPHYAINCP)machdefs.h \
    47   pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
    48   ppfnametag.h anydataobj.h
     45  $(SOPHYAINCP)machdefs.h pexceptions.h \
     46  ppersist.h gnumd5.h ppfbinstream.h rawstream.h ppfnametag.h \
     47  anydataobj.h
    4948        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppersist.cc
    5049 
    5150$(SOPHYAOBJP)ppfbinstream.o: ppfbinstream.cc sopnamsp.h \
    52   $(SOPHYAINCP)machdefs.h \
    53   ppfbinstream.h rawstream.h pexceptions.h
     51  $(SOPHYAINCP)machdefs.h ppfbinstream.h \
     52  rawstream.h pexceptions.h
    5453        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppfbinstream.cc
    5554 
    5655$(SOPHYAOBJP)ppftpointerio.o: ppftpointerio.cc \
    57   $(SOPHYAINCP)machdefs.h \
    58   sopnamsp.h ppftpointerio.h ppersist.h pexceptions.h gnumd5.h \
    59   ppfbinstream.h rawstream.h ppfnametag.h
     56  $(SOPHYAINCP)machdefs.h ppftpointerio.h \
     57  ppersist.h pexceptions.h gnumd5.h ppfbinstream.h rawstream.h \
     58  ppfnametag.h
    6059        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  ppftpointerio.cc
    6160 
    6261$(SOPHYAOBJP)rawstream.o: rawstream.cc sopnamsp.h rawstream.h \
    63   $(SOPHYAINCP)machdefs.h \
    64   pexceptions.h
     62  $(SOPHYAINCP)machdefs.h pexceptions.h
    6563        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  rawstream.cc
    6664 
    6765$(SOPHYAOBJP)sophyainit.o: sophyainit.cc sopnamsp.h \
    68   $(SOPHYAINCP)machdefs.h \
    69   sophyainit.h pexceptions.h ppersist.h gnumd5.h ppfbinstream.h \
    70   rawstream.h ppfnametag.h fiondblock.h ndatablock.h anydataobj.h \
    71   dvlist.h objfio.h mutyv.h timestamp.h fiosegdb.h segdatablock.h \
     66  $(SOPHYAINCP)machdefs.h sophyainit.h \
     67  pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \
     68  ppfnametag.h fiondblock.h ndatablock.h anydataobj.h dvlist.h objfio.h \
     69  mutyv.h timestamp.h fiosegdb.h segdatablock.h thsafeop.h \
    7270  ppftpointerio.h ppfwrapstlv.h sversion.h
    7371        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  sophyainit.cc
    7472 
    75 $(SOPHYAOBJP)timestamp.o: timestamp.cc sopnamsp.h \
    76   $(SOPHYAINCP)machdefs.h \
     73$(SOPHYAOBJP)stsrand.o: stsrand.cc stsrand.h \
     74  $(SOPHYAINCP)machdefs.h objfio.h anydataobj.h \
     75  ppersist.h pexceptions.h gnumd5.h ppfbinstream.h rawstream.h \
     76  ppfnametag.h ndatablock.h thsafeop.h srandgen.h fiondblock.h
     77        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  stsrand.cc
     78 
     79$(SOPHYAOBJP)timestamp.o: timestamp.cc $(SOPHYAINCP)machdefs.h \
    7780  timestamp.h objfio.h anydataobj.h ppersist.h pexceptions.h gnumd5.h \
    7881  ppfbinstream.h rawstream.h ppfnametag.h
    7982        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  timestamp.cc
    8083 
    81 $(SOPHYAOBJP)gnumd5.o: gnumd5.c \
    82   $(SOPHYAINCP)machdefs.h \
     84$(SOPHYAOBJP)gnumd5.o: gnumd5.c $(SOPHYAINCP)machdefs.h \
    8385  bithelp.h gnumd5.h
    8486        $(CCOMPILE) -o $@  gnumd5.c
    8587 
    86 $(SOPHYAOBJP)srandgen.o: srandgen.c \
    87   $(SOPHYAINCP)machdefs.h \
     88$(SOPHYAOBJP)srandgen.o: srandgen.c $(SOPHYAINCP)machdefs.h \
    8889  srandgen.h smathconst.h
    8990        $(CCOMPILE) -o $@  srandgen.c
  • trunk/SophyaLib/BaseTools/srandgen.h

    r3364 r3389  
    8484#endif
    8585
    86 /* -- Declaration d'une classe pour la centralier la doc -- Oct 2006 */
    87 #ifdef __cplusplus
    88 namespace SOPHYA {
    89 class RandomGenerator {
    90  public:
    91   /*! \brief Automatic initialization through Auto_Ini_Ranf() */
    92   static inline void AutoInit(int lp=0) { Auto_Ini_Ranf(lp); return; }
    93   /*! \brief Return a random number \b r with a flat distribution  0<=r<=1 */
    94   static inline double Flat01() { return drand48(); }
    95   /*! \brief Return a random number \b r with a flat distribution  -1<=r<=1 */
    96   static inline double Flatpm1() { return drandpm1(); }
    97   /*! \brief Return a random number following a zero mean gaussian distribution  */
    98   static inline double Gaussian(double sigma=1.) { return GauRnd(0., sigma); }
    99   /*! \brief Return a random number following a Poisson distribution with mean \b mu  */
    100   static inline int    Poisson(double mu) { return PoissRand(mu); }
    101 };
    102 } /* namespace SOPHYA */
    10386#endif
    10487
    105 #endif
    106 
Note: See TracChangeset for help on using the changeset viewer.