![]() |
Home | Libraries | People | FAQ | More |
boost::random::uniform_on_sphere
// In header: <boost/random/uniform_on_sphere.hpp> template<typename RealType = double, typename Cont = RealType> > class uniform_on_sphere { public: // types typedef RealType ; typedef Cont ; // member classes/structs/unions class param_type { public: // types typedef uniform_on_sphere ; // construct/copy/destruct (int = ); // public member functions int () ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const param_type &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const param_type &); bool (const param_type &, const param_type &); bool (const param_type &, const param_type &); }; // construct/copy/destruct (int = ); (const param_type &); // public member functions int () ; param_type () ; void (const param_type &); result_type () ; result_type () ; void (); template<typename Engine> const result_type & (Engine &); template<typename Engine> result_type (Engine &, const param_type &) ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const uniform_on_sphere &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const uniform_on_sphere &); bool (const uniform_on_sphere &, const uniform_on_sphere &); bool (const uniform_on_sphere &, const uniform_on_sphere &); };
Instantiations of class template uniform_on_sphere model a random distribution . Such a distribution produces random numbers uniformly distributed on the unit sphere of arbitrary dimension dim
. The Cont
template parameter must be a STL-like container type with begin and end operations returning non-const ForwardIterators of type Cont::iterator
.
uniform_on_sphere
public
construct/copy/destruct(int dim = );
Constructs a
distribution. uniform_on_sphere
dim
is the dimension of the sphere.
Requires: dim >= 0
(const param_type & param);
Constructs a
distribution from its parameters. uniform_on_sphere
uniform_on_sphere
public member functionsint () ;
Returns the dimension of the sphere.
param_type () ;
Returns the parameters of the distribution.
void (const param_type & param);
Sets the parameters of the distribution.
result_type () ;
Returns the smallest value that the distribution can produce. Note that this is required to approximate the standard library's requirements. The behavior is defined according to lexicographical comparison so that for a container type of std::vector, dist.min() <= x <= dist.max() where x is any value produced by the distribution.
result_type () ;
Returns the largest value that the distribution can produce. Note that this is required to approximate the standard library's requirements. The behavior is defined according to lexicographical comparison so that for a container type of std::vector, dist.min() <= x <= dist.max() where x is any value produced by the distribution.
void ();
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
template<typename Engine> const result_type & (Engine & eng);
Returns a point uniformly distributed over the surface of a sphere of dimension dim().
template<typename Engine> result_type (Engine & eng, const param_type & param) ;
Returns a point uniformly distributed over the surface of a sphere of dimension param.dim().
uniform_on_sphere
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const uniform_on_sphere & sd);
Writes the distribution to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const uniform_on_sphere & sd);
Reads the distribution from a std::istream
.
bool (const uniform_on_sphere & lhs, const uniform_on_sphere & rhs);
Returns true if the two distributions will produce identical sequences of values, given equal generators.
bool (const uniform_on_sphere & lhs, const uniform_on_sphere & rhs);
Returns true if the two distributions may produce different sequences of values, given equal generators.