| 
            Last change
 on this file since 3122 was             3077, checked in by cmv, 19 years ago           | 
        
        
          | 
             
remplacement nbrandom.h (obsolete) -> srandgen.h  cmv 14/09/2006 
 
           | 
        
        
          | 
            File size:
            1.1 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <stdio.h>
 | 
|---|
| 2 | #include <stdlib.h>
 | 
|---|
| 3 | #include "sopnamsp.h"
 | 
|---|
| 4 | #include "math.h"
 | 
|---|
| 5 | #include <iostream>
 | 
|---|
| 6 | #include <string>
 | 
|---|
| 7 | 
 | 
|---|
| 8 | // Pour le test 
 | 
|---|
| 9 | #include "histinit.h"
 | 
|---|
| 10 | #include "histos.h"
 | 
|---|
| 11 | #include "histos2.h"
 | 
|---|
| 12 | #include "psighand.h"
 | 
|---|
| 13 | 
 | 
|---|
| 14 | 
 | 
|---|
| 15 | #include "fmath.h"
 | 
|---|
| 16 | #include "srandgen.h"
 | 
|---|
| 17 | 
 | 
|---|
| 18 | void tdcr(AnyDataObj * obj)
 | 
|---|
| 19 | {
 | 
|---|
| 20 | Histo & h = *(dynamic_cast<Histo *>(obj));
 | 
|---|
| 21 | h.Print();
 | 
|---|
| 22 | }
 | 
|---|
| 23 | 
 | 
|---|
| 24 | int main(int narg, char* arg[])
 | 
|---|
| 25 | {
 | 
|---|
| 26 | 
 | 
|---|
| 27 |   SophyaInit();
 | 
|---|
| 28 |   SophyaConfigureSignalhandling(true,true,true);
 | 
|---|
| 29 |   try { 
 | 
|---|
| 30 |   Histo *h;
 | 
|---|
| 31 |   float x;
 | 
|---|
| 32 | 
 | 
|---|
| 33 | 
 | 
|---|
| 34 |   h = new Histo(0., 200., 100);  // Creation histo (AVEC new )
 | 
|---|
| 35 |   for(int i=0; i<100; i++)  // Remplissage d'histo
 | 
|---|
| 36 |     { x = (2*i+1.);  h->Add(x, x*(200.-x)); }
 | 
|---|
| 37 |   cout << " Appel tdcr(histo) " << endl;
 | 
|---|
| 38 |   tdcr(h);
 | 
|---|
| 39 |   cout << " Appel tdcr(histo2D) " << endl;
 | 
|---|
| 40 |   Histo2D * h2 = new Histo2D(0., 1., 10, 0., 1., 10);
 | 
|---|
| 41 |   tdcr(h2);
 | 
|---|
| 42 |   //  cout << " Appel tdcr(NULL) " << endl;
 | 
|---|
| 43 |   //  tdcr(NULL);
 | 
|---|
| 44 |   cout << " End --- exit .... " << endl;
 | 
|---|
| 45 | }
 | 
|---|
| 46 |   catch (PThrowable & exc) {
 | 
|---|
| 47 |     cerr << " catched Exception " << exc.Msg() << endl;
 | 
|---|
| 48 |   }  
 | 
|---|
| 49 |   catch (...) {
 | 
|---|
| 50 |     cerr << " catched unknown (...) exception " << endl; 
 | 
|---|
| 51 |   }  
 | 
|---|
| 52 | }
 | 
|---|
| 53 | 
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.