2
0
mirror of https://github.com/boostorg/random.git synced 2026-01-22 17:33:00 +00:00
Files
random/python/boost_random.py
Daniel Wallin a7623eae4b Major improvements to binding.
[SVN r3180]
2006-09-02 09:02:02 +00:00

18 lines
533 B
Python
Executable File

from _boost_random import *
class UnknownVariateGenerator(Exception):
def __init__(self, engine, dist):
self.engine = engine
self.dist = dist
def __str__(self):
return 'No variate_generator combination for "%s" and "%s"' \
% (self.engine.__name__, self.dist.__name__)
def variate_generator(engine, dist):
try:
return distribution_variate_map[dist.__class__](engine, distribution)
except KeyError:
raise UnknownVariateGenerator(engine.__class__, dist.__class__)