Version: 8.3.0
Sphere Class Reference

#include <aleas.hxx>

Inheritance diagram for Sphere:
Collaboration diagram for Sphere:

Public Member Functions

 Sphere (long s)
 
virtual void fill (std::vector< double > &)
 
- Public Member Functions inherited from Normale
 Normale (long s)
 
virtual double tire (void)
 
- Public Member Functions inherited from Aleatoire
 Aleatoire (long)
 
virtual std::vector< double > * gen (void)
 

Additional Inherited Members

- Protected Attributes inherited from Aleatoire
long size
 

Detailed Description

Definition at line 55 of file aleas.hxx.

Constructor & Destructor Documentation

Sphere::Sphere ( long  s)
inline

Definition at line 57 of file aleas.hxx.

57 : Normale(s) {};

Member Function Documentation

void Sphere::fill ( std::vector< double > &  ret)
virtual

Reimplemented from Aleatoire.

Reimplemented in SpherePositif.

Definition at line 139 of file aleas.cxx.

References Aleatoire::fill(), genrand_real1(), CORBAEngineTest::i, and Aleatoire::size.

Referenced by SpherePositif::fill().

140 {
141  long i;
142  double cum, r;
143 
145  for (cum=0, i=0; i<size; i++)
146  cum += ret[i] * ret[i];
147  cum = sqrt(cum);
148  r = pow(genrand_real1(), size);
149  for (i=0; i<size; i++)
150  ret[i] *= cum * r;
151 }

The documentation for this class was generated from the following files: