Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

PDiscrete Class Reference

#include <parameters.h>

Inheritance diagram for PDiscrete:

Inheritance graph
[legend]

Public Member Functions

void Setup (icstring s, const int qte=1000)
 ~PDiscrete (void)

Constructor & Destructor Documentation

PDiscrete::~PDiscrete void   )  [inline]
 

Definition at line 41 of file parameters.h.

00042         {
00043                 for( vector<DiscreteProba *>::iterator it = begin() ; it != end() ; ++it )
00044                         delete (*it);
00045                 clear();
00046         }


Member Function Documentation

void PDiscrete::Setup icstring  s,
const int  qte = 1000
[inline]
 

Definition at line 22 of file parameters.h.

References DiscreteProba::Setup().

Referenced by Parameters::SetupStarInfo().

00023         {
00024                 vector<double>  vect;
00025                 double  sum = 0.0;
00026                 while( !s.empty() )
00027                 {
00028                         double  d = Rsrc::GetDbl( s );
00029                         sum += d;
00030                         vect.push_back( d );
00031                 }
00032                 if( sum > 0 && sum != 1.0 )
00033                         for( vector<double>::iterator it = vect.begin() ; it != vect.end() ; ++it )
00034                                 *it /= sum;
00035                 DiscreteProba   *p = new DiscreteProba;
00036                 if( sum > 0 )
00037                         p->Setup( vect , vect.size() , qte );
00038                 push_back( p );
00039         }


The documentation for this class was generated from the following file:
Generated on Fri Dec 5 04:06:30 2003 for Borqueror by doxygen 1.3.3