Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::uniform_on_sphere< RealType, Cont > Class Template Reference

Instantiations of class template uniform_on_sphere model a . More...

#include <uniform_on_sphere.hpp>

Classes

class  param_type
 

Public Types

typedef RealType input_type
 
typedef Cont result_type
 

Public Member Functions

 uniform_on_sphere (int dim_arg=2)
 Constructs a uniform_on_sphere distribution. More...
 
 uniform_on_sphere (const param_type &parm)
 Constructs a uniform_on_sphere distribution from its parameters. More...
 
int dim () const
 Returns the dimension of the sphere. More...
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets the parameters of the distribution. More...
 
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the smallest value that the distribution can produce. More...
 
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the largest value that the distribution can produce. More...
 
void reset ()
 Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More...
 
template<class Engine >
const result_typeoperator() (Engine &eng)
 Returns a point uniformly distributed over the surface of a sphere of dimension dim(). More...
 
template<class Engine >
result_type operator() (Engine &eng, const param_type &parm) const
 Returns a point uniformly distributed over the surface of a sphere of dimension param.dim(). More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, uniform_on_sphere, sd)
 Writes the distribution to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, uniform_on_sphere, sd)
 Reads the distribution from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (uniform_on_sphere, lhs, rhs)
 Returns true if the two distributions will produce identical sequences of values, given equal generators. More...
 

Detailed Description

template<class RealType = double, class Cont = std::vector<RealType>>
class boost::random::uniform_on_sphere< RealType, Cont >

Instantiations of class template uniform_on_sphere model a .

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.

Member Typedef Documentation

template<class RealType = double, class Cont = std::vector<RealType>>
typedef RealType boost::random::uniform_on_sphere< RealType, Cont >::input_type
template<class RealType = double, class Cont = std::vector<RealType>>
typedef Cont boost::random::uniform_on_sphere< RealType, Cont >::result_type

Constructor & Destructor Documentation

template<class RealType = double, class Cont = std::vector<RealType>>
boost::random::uniform_on_sphere< RealType, Cont >::uniform_on_sphere ( int  dim_arg = 2)
inlineexplicit

Constructs a uniform_on_sphere distribution.

dim is the dimension of the sphere.

Requires: dim >= 0

Referenced by boost::random::uniform_on_sphere< RealType, Cont >::operator()().

template<class RealType = double, class Cont = std::vector<RealType>>
boost::random::uniform_on_sphere< RealType, Cont >::uniform_on_sphere ( const param_type parm)
inlineexplicit

Constructs a uniform_on_sphere distribution from its parameters.

Member Function Documentation

template<class RealType = double, class Cont = std::vector<RealType>>
result_type min boost::random::uniform_on_sphere< RealType, Cont >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

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.

template<class RealType = double, class Cont = std::vector<RealType>>
result_type max boost::random::uniform_on_sphere< RealType, Cont >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

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.

template<class RealType = double, class Cont = std::vector<RealType>>
boost::random::uniform_on_sphere< RealType, Cont >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( uniform_on_sphere< RealType, Cont >  ,
lhs  ,
rhs   
)
inline

Returns true if the two distributions will produce identical sequences of values, given equal generators.

template<class RealType = double, class Cont = std::vector<RealType>>
boost::random::uniform_on_sphere< RealType, Cont >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
uniform_on_sphere< RealType, Cont >  ,
sd   
)
inline

Reads the distribution from a std::istream.

template<class RealType = double, class Cont = std::vector<RealType>>
boost::random::uniform_on_sphere< RealType, Cont >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
uniform_on_sphere< RealType, Cont >  ,
sd   
)
inline

Writes the distribution to a std::ostream.

template<class RealType = double, class Cont = std::vector<RealType>>
int boost::random::uniform_on_sphere< RealType, Cont >::dim ( ) const
inline

Returns the dimension of the sphere.

template<class RealType = double, class Cont = std::vector<RealType>>
template<class Engine >
const result_type& boost::random::uniform_on_sphere< RealType, Cont >::operator() ( Engine &  eng)
inline

Returns a point uniformly distributed over the surface of a sphere of dimension dim().

References boost::bind2nd(), boost::it, boost::geometry::math::sqrt(), boost::fusion::transform(), boost::phoenix::val(), boost::flyweights::x, and boost::polygon::y().

template<class RealType = double, class Cont = std::vector<RealType>>
template<class Engine >
result_type boost::random::uniform_on_sphere< RealType, Cont >::operator() ( Engine &  eng,
const param_type parm 
) const
inline

Returns a point uniformly distributed over the surface of a sphere of dimension param.dim().

References boost::random::uniform_on_sphere< RealType, Cont >::uniform_on_sphere().

template<class RealType = double, class Cont = std::vector<RealType>>
param_type boost::random::uniform_on_sphere< RealType, Cont >::param ( ) const
inline

Returns the parameters of the distribution.

References boost::random::uniform_on_sphere< RealType, Cont >::param_type::param_type().

template<class RealType = double, class Cont = std::vector<RealType>>
void boost::random::uniform_on_sphere< RealType, Cont >::param ( const param_type parm)
inline

Sets the parameters of the distribution.

References boost::random::uniform_on_sphere< RealType, Cont >::param_type::dim().

template<class RealType = double, class Cont = std::vector<RealType>>
void boost::random::uniform_on_sphere< RealType, Cont >::reset ( void  )
inline

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.


The documentation for this class was generated from the following file: