xor_combine クラス
組み合わせ分布を生成します。
template<class Engine1, int S1,
class Engine2, int S2>
class xor_combine {
public:
typedef Engine1 base1_type;
typedef Engine2 base2_type;
typedef typename Engine1::result_type;
static const int shift1 = S1;
static const int shift2 = S2;
xor_combine();
xor_combine(const base1_type& eng1, const base2_type& eng2);
template<class Gen>
xor_combine(Gen& gen);
xor_combine(const xor_combine& right);
xor_combine(xor_combine& right);
void seed();
template<class Gen>
void seed(Gen& gen);
const base1_type& base1() const;
const base2_type& base2() const;
result_type min() const;
result_type max() const;
result_type operator()();
private:
base1_type stored_eng1; // exposition only
base2_type stored_eng2; // exposition only
};
パラメーター
Engine1
1 つ目の乱数エンジンの型。S1
1 つ目の乱数エンジンのシフト数。Engine2
2 つ目の乱数エンジンの型。S2
2 つ目の乱数エンジンのシフト数。
解説
このテンプレート クラスは、2 つのエンジンによって生成された値を組み合わせることによって値を生成する複合エンジンを表します。エンジンの状態は、stored_eng1 の状態を初期状態とし、その後、stored_eng2 の状態となります。
必要条件
ヘッダー : <random>
名前空間: std