random¶
Bindings for numeric::random namespace
-
class
pyrosetta.rosetta.numeric.random.
RandomGenerator
¶ Bases:
pybind11_builtins.pybind11_object
Random number generator system
-
__call__
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → float¶ C++: numeric::random::RandomGenerator::operator()() –> double
-
__delattr__
¶ Implement delattr(self, name).
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
assign
(self: pyrosetta.rosetta.numeric.random.RandomGenerator, : pyrosetta.rosetta.numeric.random.RandomGenerator) → pyrosetta.rosetta.numeric.random.RandomGenerator¶ C++: numeric::random::RandomGenerator::operator=(const class numeric::random::RandomGenerator &) –> class numeric::random::RandomGenerator &
-
gaussian
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → float¶ Get Gaussian distribution random number
C++: numeric::random::RandomGenerator::gaussian() –> double
-
get_seed
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → int¶ Return the seed used by this RNG.
C++: numeric::random::RandomGenerator::get_seed() const –> int
-
initialized
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → bool¶ Return whether the RandomGenerator has been initialized (by a call to set_seed)
C++: numeric::random::RandomGenerator::initialized() const –> bool
-
max
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → float¶ C++: numeric::random::RandomGenerator::max() const –> double
-
min
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → float¶ C++: numeric::random::RandomGenerator::min() const –> double
-
random_range
(self: pyrosetta.rosetta.numeric.random.RandomGenerator, low: int, high: int) → int¶ Returns a random int in the range specified by the arguments
C++: numeric::random::RandomGenerator::random_range(int, int) –> int
-
random_range2
(self: pyrosetta.rosetta.numeric.random.RandomGenerator, low: int, high: int) → int¶ - Returns a random int in the range specified by the arguments
- If low == high, it will return the given integer to simplify code using this.
s
- JAB - Editing random_range produced huge integration test changes, so this is the result.
- If you have a better name, please change this.
C++: numeric::random::RandomGenerator::random_range2(int, int) –> int
-
restoreState
(self: pyrosetta.rosetta.numeric.random.RandomGenerator, in: pyrosetta.rosetta.std.istream) → None¶ C++: numeric::random::RandomGenerator::restoreState(class std::basic_istream<char> &) –> void
-
saveState
(self: pyrosetta.rosetta.numeric.random.RandomGenerator, out: pyrosetta.rosetta.std.ostream) → None¶ C++: numeric::random::RandomGenerator::saveState(class std::basic_ostream<char> &) –> void
-
set_seed
(*args, **kwargs)¶ Overloaded function.
- set_seed(self: pyrosetta.rosetta.numeric.random.RandomGenerator, generator_type: str, seed: int) -> None
- Set the seed and the generator type synchronously.
- Currently the two supported generator types are “standard” and “mt19937” with the latter being the recommended form.
C++: numeric::random::RandomGenerator::set_seed(const class std::basic_string<char> &, int) –> void
- set_seed(self: pyrosetta.rosetta.numeric.random.RandomGenerator, seed: int) -> None
Return the seed used by this RNG.
C++: numeric::random::RandomGenerator::set_seed(int) –> void
-
uniform
(self: pyrosetta.rosetta.numeric.random.RandomGenerator) → float¶ Return from range [0, 1] (?) uniform random number
The implementation of random_range leads me to believe this is actually [0, 1), like most other random number generators. -IWDC++: numeric::random::RandomGenerator::uniform() –> double
-
-
pyrosetta.rosetta.numeric.random.
do_recursion
(r: pyrosetta.rosetta.W128_T, a: pyrosetta.rosetta.W128_T, b: pyrosetta.rosetta.W128_T, c: pyrosetta.rosetta.W128_T, lung: pyrosetta.rosetta.W128_T) → None¶ This function represents the recursion formula.
output
a 128-bit part of the internal state array
a 128-bit part of the internal state array
a 128-bit part of the internal state array
a 128-bit part of the internal state array
C++: numeric::random::do_recursion(union W128_T *, union W128_T *, union W128_T *, union W128_T *, union W128_T *) –> void
-
pyrosetta.rosetta.numeric.random.
gaussian
() → float¶ C++: numeric::random::gaussian() –> double
-
pyrosetta.rosetta.numeric.random.
gaussian_random_xform
(angsd: float, movsd: float) → pyrosetta.rosetta.numeric.xyzTransform_double_t¶ C++: numeric::random::gaussian_random_xform(const double &, const double &) –> class numeric::xyzTransform<double>
-
pyrosetta.rosetta.numeric.random.
ini_func1
(x: int) → int¶ C++: numeric::random::ini_func1(unsigned int) –> unsigned int
-
pyrosetta.rosetta.numeric.random.
ini_func2
(x: int) → int¶ C++: numeric::random::ini_func2(unsigned int) –> unsigned int
-
pyrosetta.rosetta.numeric.random.
lshift128
(out: pyrosetta.rosetta.W128_T, in: pyrosetta.rosetta.W128_T, shift: int) → None¶ C++: numeric::random::lshift128(union W128_T *, const union W128_T *, int) –> void
-
pyrosetta.rosetta.numeric.random.
random_normal
() → pyrosetta.rosetta.numeric.xyzVector_double_t¶ A random vector chosens uniformly from the surface of a unit sphere centered on the origin.
C++: numeric::random::random_normal() –> class numeric::xyzVector<double>
-
pyrosetta.rosetta.numeric.random.
random_range
(low: int, high: int) → int¶ - Return a number uniformly drawn from the inclusive range between low
- and high. Threadsafe since each thread uses its own random generator.
C++: numeric::random::random_range(int, int) –> int
-
pyrosetta.rosetta.numeric.random.
random_rotation
() → pyrosetta.rosetta.numeric.xyzMatrix_double_t¶ C++: numeric::random::random_rotation() –> class numeric::xyzMatrix<double>
-
pyrosetta.rosetta.numeric.random.
random_vector
() → pyrosetta.rosetta.numeric.xyzVector_double_t¶ A random vector chosen with spherical symmetry around the origin.
Actual distribution is a 3D gaussian with unit variance centered at the origin.C++: numeric::random::random_vector() –> class numeric::xyzVector<double>
-
pyrosetta.rosetta.numeric.random.
random_vector_spherical
() → pyrosetta.rosetta.numeric.xyzVector_double_t¶ A random vector chosen with spherical symmetry around the origin.
Actual distribution is a 3D gaussian with unit variance centered at the origin.C++: numeric::random::random_vector_spherical() –> class numeric::xyzVector<double>
-
pyrosetta.rosetta.numeric.random.
random_vector_unit_cube
() → pyrosetta.rosetta.numeric.xyzVector_double_t¶ A random vector chosen uniformly from within the volume of a unit cube with opposite verticies at (0,0,0) and (1,1,1)
C++: numeric::random::random_vector_unit_cube() –> class numeric::xyzVector<double>
-
pyrosetta.rosetta.numeric.random.
random_xform
() → pyrosetta.rosetta.numeric.xyzTransform_double_t¶ C++: numeric::random::random_xform() –> class numeric::xyzTransform<double>
-
pyrosetta.rosetta.numeric.random.
reservoir_sample_accept_prob
(n_wanted: int, n_seen: int) → float¶ - Returns the probability that the Nth value in a sequence
should be accepted using the reservoir sampling criterion.
If we’ve seen N values and we want to keep K of them, the probability of the Nth value being accepted is min(K/N,1.0).
C++: numeric::random::reservoir_sample_accept_prob(unsigned long, unsigned long) –> double
-
pyrosetta.rosetta.numeric.random.
rg
() → numeric::random::RandomGenerator¶ Return the one-per-thread “singleton” random generator.
C++: numeric::random::rg() –> class numeric::random::RandomGenerator &
-
pyrosetta.rosetta.numeric.random.
sformat_idxof
(i: int) → int¶ C++: numeric::random::sformat_idxof(int) –> int
-
class
pyrosetta.rosetta.numeric.random.
standard_RG
¶ Bases:
pyrosetta.rosetta.numeric.random.uniform_RG
Generator based on rand() < clib > function.
-
__delattr__
¶ Implement delattr(self, name).
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
(self: pyrosetta.rosetta.numeric.random.standard_RG) → None¶
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
assign
(self: pyrosetta.rosetta.numeric.random.standard_RG, : pyrosetta.rosetta.numeric.random.standard_RG) → pyrosetta.rosetta.numeric.random.standard_RG¶ C++: numeric::random::standard_RG::operator=(const class numeric::random::standard_RG &) –> class numeric::random::standard_RG &
-
getRandom
(self: pyrosetta.rosetta.numeric.random.standard_RG) → float¶ C++: numeric::random::standard_RG::getRandom() –> double
-
getSeed
(self: pyrosetta.rosetta.numeric.random.standard_RG) → int¶ C++: numeric::random::standard_RG::getSeed() –> int
-
restoreState
(self: pyrosetta.rosetta.numeric.random.standard_RG, : pyrosetta.rosetta.std.istream) → None¶ C++: numeric::random::standard_RG::restoreState(class std::basic_istream<char> &) –> void
-
saveState
(self: pyrosetta.rosetta.numeric.random.standard_RG, : pyrosetta.rosetta.std.ostream) → None¶ C++: numeric::random::standard_RG::saveState(class std::basic_ostream<char> &) –> void
-
setSeed
(*args, **kwargs)¶ Overloaded function.
- setSeed(self: pyrosetta.rosetta.numeric.random.standard_RG, seed: int) -> None
C++: numeric::random::standard_RG::setSeed(const int) –> void
- setSeed(self: pyrosetta.rosetta.numeric.random.standard_RG, : str) -> None
C++: numeric::random::standard_RG::setSeed(const class std::basic_string<char> &) –> void
-
-
pyrosetta.rosetta.numeric.random.
uniform
() → float¶ C++: numeric::random::uniform() –> double
-
class
pyrosetta.rosetta.numeric.random.
uniform_RG
¶ Bases:
pybind11_builtins.pybind11_object
Uniform random number generator
-
__delattr__
¶ Implement delattr(self, name).
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pyrosetta.rosetta.numeric.random.uniform_RG) -> None
- __init__(self: pyrosetta.rosetta.numeric.random.uniform_RG, arg0: pyrosetta.rosetta.numeric.random.uniform_RG) -> None
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
assign
(self: pyrosetta.rosetta.numeric.random.uniform_RG, : pyrosetta.rosetta.numeric.random.uniform_RG) → pyrosetta.rosetta.numeric.random.uniform_RG¶ C++: numeric::random::uniform_RG::operator=(const class numeric::random::uniform_RG &) –> class numeric::random::uniform_RG &
-
getRandom
(self: pyrosetta.rosetta.numeric.random.uniform_RG) → float¶ C++: numeric::random::uniform_RG::getRandom() –> double
-
getSeed
(self: pyrosetta.rosetta.numeric.random.uniform_RG) → int¶ C++: numeric::random::uniform_RG::getSeed() –> int
-
restoreState
(self: pyrosetta.rosetta.numeric.random.uniform_RG, in: pyrosetta.rosetta.std.istream) → None¶ C++: numeric::random::uniform_RG::restoreState(class std::basic_istream<char> &) –> void
-
saveState
(self: pyrosetta.rosetta.numeric.random.uniform_RG, out: pyrosetta.rosetta.std.ostream) → None¶ C++: numeric::random::uniform_RG::saveState(class std::basic_ostream<char> &) –> void
-
setSeed
(*args, **kwargs)¶ Overloaded function.
- setSeed(self: pyrosetta.rosetta.numeric.random.uniform_RG, seed: int) -> None
C++: numeric::random::uniform_RG::setSeed(const int) –> void
- setSeed(self: pyrosetta.rosetta.numeric.random.uniform_RG, seed: str) -> None
C++: numeric::random::uniform_RG::setSeed(const class std::basic_string<char> &) –> void
-
-
pyrosetta.rosetta.numeric.random.
uniform_vector_sphere
(*args, **kwargs)¶ Overloaded function.
- uniform_vector_sphere() -> pyrosetta.rosetta.numeric.xyzVector_double_t
- uniform_vector_sphere(radius: float) -> pyrosetta.rosetta.numeric.xyzVector_double_t
A random vector chosen uniformly from the ball (volume enclosed within a sphere) of the given radius around the origin.
C++: numeric::random::uniform_vector_sphere(double) –> class numeric::xyzVector<double>