EigenRand  0.3.0
Eigen::Rand::MultinomialGen< _Scalar, Dim > Class Template Reference

Generator of real vectors on a multinomial distribution. More...

#include <Multinomial.h>

Inheritance diagram for Eigen::Rand::MultinomialGen< _Scalar, Dim >:
Collaboration diagram for Eigen::Rand::MultinomialGen< _Scalar, Dim >:

Public Member Functions

template<typename WeightTy >
 MultinomialGen (_Scalar _trials, const MatrixBase< WeightTy > &_weights)
 Construct a new multinomial generator. More...
 
 MultinomialGen (const MultinomialGen &)=default
 
 MultinomialGen (MultinomialGen &&)=default
 
Index dims () const
 
template<typename Urng >
Matrix< _Scalar, Dim, -1 > generate (Urng &&urng, Index samples)
 
template<typename Urng >
Matrix< _Scalar, Dim, 1 > generate (Urng &&urng)
 
- Public Member Functions inherited from Eigen::Rand::MvVecGenBase< MultinomialGen< int32_t, -1 >, int32_t, -1 >
Index dims () const
 returns the dimensions of vectors to be generated
 
Matrix< int32_t, Dim, -1 > generate (Urng &&urng, Index samples)
 generates multiple samples at once More...
 
Matrix< int32_t, Dim, 1 > generate (Urng &&urng)
 generates one sample More...
 

Detailed Description

template<typename _Scalar = int32_t, Index Dim = -1>
class Eigen::Rand::MultinomialGen< _Scalar, Dim >

Generator of real vectors on a multinomial distribution.

Template Parameters
_Scalar
Dimnumber of dimensions, or Eigen::Dynamic

Constructor & Destructor Documentation

◆ MultinomialGen()

template<typename _Scalar = int32_t, Index Dim = -1>
template<typename WeightTy >
Eigen::Rand::MultinomialGen< _Scalar, Dim >::MultinomialGen ( _Scalar  _trials,
const MatrixBase< WeightTy > &  _weights 
)
inline

Construct a new multinomial generator.

Template Parameters
WeightTy
Parameters
_trialsthe number of trials
_weightsthe weights of each category, (Dim, 1) shape matrix or vector

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