A data structure for O(1) source sampling.  
 More...
#include <source_sampling.h>
|  | 
| int | n | 
|  | 
| std::vector< double > | prob | 
|  | Number of bins in the PDF. 
 | 
|  | 
| std::vector< int > | alias | 
|  | Probabilities. 
 | 
|  | 
A data structure for O(1) source sampling. 
◆ AliasTable()
      
        
          | pyne::AliasTable::AliasTable | ( | std::vector< double > | p | ) |  | 
      
 
Constructor 
- Parameters
- 
  
    | p | A normalized probability distribution function |  
 
 
 
◆ sample_pdf()
      
        
          | int pyne::AliasTable::sample_pdf | ( | double | rand1, | 
        
          |  |  | double | rand2 | 
        
          |  | ) |  |  | 
      
 
Samples the alias table 
- Parameters
- 
  
    | rand1 | A random number in range [0, 1]. |  | rand2 | A random number in range [0, 1]. |  
 
 
 
The documentation for this class was generated from the following files:
- /home/mouginot/work/app/pyne/src/source_sampling.h
- /home/mouginot/work/app/pyne/src/source_sampling.cpp