tahoma2d/toonz/sources/stdfx/igs_math_random.h

40 lines
1 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef igs_math_random_h
#define igs_math_random_h
/*
2001-04-25 update
2001-06-19 rename to 'calculator_random_plus_long.h'
2005-02-03 rename to 'ptbl_random.h'
2005-02-10 separete to 'ptbl_random.h' and 'ptbl_random.cxx'
(2005-02-03.thu wrote)
rand()
radhat9とWindowsとでは疑似乱数列が違う
random()radhat9にはあるがMS-Cにはない
:ANSI C/C++
*/
2016-06-15 18:43:10 +12:00
namespace igs {
namespace math {
class random {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
random();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/* 乱数種 seed(0〜std::numeric_limits<long>::max()) */
void seed(unsigned long seed);
unsigned long seed(void) const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/* 乱数生成 0〜std::numeric_limits<long>::max() */
long next(void);
double next_d(void); /* 0 ... 1 */
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
unsigned long seed_;
2016-03-19 06:57:51 +13:00
};
}
}
#endif /* !igs_math_random_h */