|
RTOp Package Browser (Single Doxygen Collection)
Version of the Day
|
Generate a random vector in the range [l,u]: z0[i] = 0.5*((u-l)*Teuchos::ScalarTraits<Scalar>::random()+(u+l)), i=0...n-1.
More...
#include <RTOpPack_TOpRandomize.hpp>

Public Member Functions | |
| TOpRandomize (const Scalar &l=-ScalarTraits< Scalar >::one(), const Scalar &u=+ScalarTraits< Scalar >::one()) | |
| | |
| void | set_bounds (const Scalar &l, const Scalar &u) |
| | |
| void | set_seed (const unsigned int seed) |
| | |
| unsigned int | get_seed () const |
| | |
Static Public Member Functions | |
| static void | set_static_seed (const unsigned int static_seed) |
| | |
| static unsigned int | get_static_seed () |
| | |
Private Attributes | |
| unsigned int | seed_ |
| Scalar | l_ |
| Scalar | u_ |
Static Private Attributes | |
| static unsigned int | static_seed_ = 0 |
Overridden from RTOpT | |
| void | apply_op_impl (const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const |
| | |
Generate a random vector in the range [l,u]: z0[i] = 0.5*((u-l)*Teuchos::ScalarTraits<Scalar>::random()+(u+l)), i=0...n-1.
The seed for the random number generator can be set by TOpRandomize<Scalar>::set_seed(s) where s is some unsigned integer. Note that this class generates random numbers based on the initial seed and the global element ID so this should produce the same pseudo-random elements independent of the number of processors being used.
The seed changes every time a new object is created in order to improve the randomness to some degree.
Definition at line 65 of file RTOpPack_TOpRandomize.hpp.
| RTOpPack::TOpRandomize< Scalar >::TOpRandomize | ( | const Scalar & | l = -ScalarTraits<Scalar>::one(), |
| const Scalar & | u = +ScalarTraits<Scalar>::one() |
||
| ) | [inline] |
Definition at line 74 of file RTOpPack_TOpRandomize.hpp.
| static void RTOpPack::TOpRandomize< Scalar >::set_static_seed | ( | const unsigned int | static_seed | ) | [inline, static] |
Definition at line 69 of file RTOpPack_TOpRandomize.hpp.
| static unsigned int RTOpPack::TOpRandomize< Scalar >::get_static_seed | ( | ) | [inline, static] |
Definition at line 72 of file RTOpPack_TOpRandomize.hpp.
| void RTOpPack::TOpRandomize< Scalar >::set_bounds | ( | const Scalar & | l, |
| const Scalar & | u | ||
| ) | [inline] |
Definition at line 85 of file RTOpPack_TOpRandomize.hpp.
| void RTOpPack::TOpRandomize< Scalar >::set_seed | ( | const unsigned int | seed | ) | [inline] |
Definition at line 88 of file RTOpPack_TOpRandomize.hpp.
| unsigned int RTOpPack::TOpRandomize< Scalar >::get_seed | ( | ) | const [inline] |
Definition at line 90 of file RTOpPack_TOpRandomize.hpp.
| void RTOpPack::TOpRandomize< Scalar >::apply_op_impl | ( | const ArrayView< const ConstSubVectorView< Scalar > > & | sub_vecs, |
| const ArrayView< const SubVectorView< Scalar > > & | targ_sub_vecs, | ||
| const Ptr< ReductTarget > & | reduct_obj_inout | ||
| ) | const [inline, virtual] |
Implements RTOpPack::RTOpT< Scalar >.
Definition at line 94 of file RTOpPack_TOpRandomize.hpp.
unsigned int RTOpPack::TOpRandomize< Scalar >::static_seed_ = 0 [static, private] |
Definition at line 125 of file RTOpPack_TOpRandomize.hpp.
unsigned int RTOpPack::TOpRandomize< Scalar >::seed_ [private] |
Definition at line 126 of file RTOpPack_TOpRandomize.hpp.
Scalar RTOpPack::TOpRandomize< Scalar >::l_ [private] |
Definition at line 127 of file RTOpPack_TOpRandomize.hpp.
Scalar RTOpPack::TOpRandomize< Scalar >::u_ [private] |
Definition at line 128 of file RTOpPack_TOpRandomize.hpp.
1.7.6.1