bnmf-algs
Classes | Namespaces | Functions
sampling.hpp File Reference

Go to the source code of this file.

Classes

class  bnmf_algs::details::SampleOnesNoReplaceComputer< Scalar >
 Computer type that will compute the next sample from a given matrix without replacement when its operator() is invoked. More...
 
class  bnmf_algs::details::SampleOnesReplaceComputer< Scalar >
 Computer type that will compute the next sample from a given matrix with replacement when its operator() is invoked. More...
 

Namespaces

 bnmf_algs
 Main namespace for bnmf-algs library.
 
 bnmf_algs::util
 Namespace for general purpose utility functions to be used by all bnmf_algs functions.
 
 bnmf_algs::details
 Namespace that contains types and functions for internal computations.
 

Functions

template<typename RandomIterator >
RandomIterator bnmf_algs::util::choice (RandomIterator cum_prob_begin, RandomIterator cum_prob_end, const bnmf_algs::util::gsl_rng_wrapper &gsl_rng)
 Choose a random sample according to the given cumulative probability distribution. More...
 
template<typename Real , typename Integer >
void bnmf_algs::util::multinomial_mode (Integer num_trials, const vector_t< Real > &prob, vector_t< Integer > &count, double eps=1e-50)
 Find the mode of a multinomial distribution using Finucan's algorithm. More...
 
template<typename T >
matrix_t< T > bnmf_algs::util::dirichlet_mat (const matrix_t< T > &gamma_shape_mat, size_t norm_axis)
 Construct a matrix containing Dirichlet distribution samples on its rows or columns. More...
 
template<typename T >
void bnmf_algs::details::check_sample_ones_params (const matrix_t< T > &X)
 
template<typename T >
util::Generator< std::pair< int, int >, details::SampleOnesNoReplaceComputer< T > > bnmf_algs::util::sample_ones_noreplace (const matrix_t< T > &X)
 Return a bnmf_algs::util::Generator that will generate a sequence of samples from the given matrix without replacement by using details::SampleOnesNoReplaceComputer as its Computer. More...
 
template<typename T >
util::Generator< std::pair< int, int >, details::SampleOnesReplaceComputer< T > > bnmf_algs::util::sample_ones_replace (const matrix_t< T > &X, size_t num_samples)
 Return a bnmf_algs::util::Generator that will generate a sequence of samples from the given matrix with replacement by using details::SampleOnesReplaceComputer as its Computer. More...