Files Classes Functions Hierarchy
#include <random.h>
Public Member Functions | |
| uintc | operator() () const |
| Generate a random uinteger. | |
| void | randomize_start () |
| void | seed (uintc s=1) |
| Initialize the state of the random number generator. | |
Static Public Member Functions | |
| template<typename Q > | |
| static boolc | domain (point3< Q > const &p, boolc zero=true, boolc one=true) |
| Test 3D point in interval 0 to 1 optionally with endpoints. | |
| template<typename Q > | |
| static boolc | domain (point2< Q > const &p, boolc zero=true, boolc one=true) |
| Test 2D point in interval 0 to 1 optionally with endpoints. | |
| template<typename T > | |
| static boolc | domain (T const &x, boolc zero=true, boolc one=true) |
| Test interval 0 to 1 optionally with end points. | |
The sample of random numbers generated is hundreds of times smaller than what is needed for robust applications. However it uses C functions so is convenient for small and not so accurate applications.
Definition at line 34 of file random.h.
| boolc randomgenerator::domain | ( | T const & | x, | |
| boolc | zero = true, |
|||
| boolc | one = true | |||
| ) | [inline, static] |
Test interval 0 to 1 optionally with end points.
Definition at line 267 of file random.h.
References assertreturnfalse, and assertreturnfalseN.
00268 { 00269 //cout << SHOW(x) << endl; 00270 if (zero==false) 00271 assertreturnfalseN( x == (T)0 ); 00272 00273 if (one==false) 00274 assertreturnfalseN( x == (T)1 ); 00275 00276 assertreturnfalseN( x < (T)0 ); 00277 00278 assertreturnfalse( x <= (T)1 ); 00279 00280 return true; 00281 }
| boolc randomgenerator::domain | ( | point2< Q > const & | p, | |
| boolc | zero = true, |
|||
| boolc | one = true | |||
| ) | [inline, static] |
Test 2D point in interval 0 to 1 optionally with endpoints.
Definition at line 285 of file random.h.
References domain(), point2< T >::x, and point2< T >::y.
00286 { 00287 bool res=true; 00288 if ( domain(p.x,zero,one) == false ) 00289 res=false; 00290 if ( domain(p.y,zero,one) == false ) 00291 res=false; 00292 00293 return res; 00294 }
| boolc randomgenerator::domain | ( | point3< Q > const & | p, | |
| boolc | zero = true, |
|||
| boolc | one = true | |||
| ) | [inline, static] |
Test 3D point in interval 0 to 1 optionally with endpoints.
Definition at line 297 of file random.h.
References point3< T >::x, point3< T >::y, and point3< T >::z.
Referenced by domain(), randomtest::domaintest(), vispointxml::handlecommand(), and randomtest::test05().
00298 { 00299 bool res=true; 00300 res &= domain(p.x,zero,one); 00301 res &= domain(p.y,zero,one); 00302 res &= domain(p.z,zero,one); 00303 00304 return res; 00305 }
| uintc randomgenerator::operator() | ( | ) | const [inline] |
| void randomgenerator::randomize_start | ( | ) | [inline] |
| void randomgenerator::seed | ( | uintc | s = 1 |
) |
Initialize the state of the random number generator.
Definition at line 3 of file random.cpp.
Referenced by main().
1.5.8