RTOpPack::TOpRandomize< Scalar > Class Template Reference

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>

Inheritance diagram for RTOpPack::TOpRandomize< Scalar >:

[legend]
List of all members.

Overridden from RTOpT

void apply_op (const int num_vecs, const ConstSubVectorView< Scalar > sub_vecs[], const int num_targ_vecs, const SubVectorView< Scalar > targ_sub_vecs[], ReductTarget *reduct_obj) const
 

Public Member Functions

 TOpRandomize (const Scalar &l=-Teuchos::ScalarTraits< Scalar >::one(), const Scalar &u=+Teuchos::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

void set_static_seed (const unsigned int static_seed)
 
unsigned int get_static_seed ()
 

Detailed Description

template<class Scalar>
class RTOpPack::TOpRandomize< Scalar >

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 save elements independent of the number of processors being used.

The seed changes every time a new object is created

Definition at line 49 of file RTOpPack_TOpRandomize.hpp.


Constructor & Destructor Documentation

template<class Scalar>
RTOpPack::TOpRandomize< Scalar >::TOpRandomize const Scalar &  l = -Teuchos::ScalarTraits<Scalar>::one(),
const Scalar &  u = +Teuchos::ScalarTraits<Scalar>::one()
[inline]
 

Definition at line 56 of file RTOpPack_TOpRandomize.hpp.


Member Function Documentation

template<class Scalar>
void RTOpPack::TOpRandomize< Scalar >::set_static_seed const unsigned int  static_seed  )  [inline, static]
 

Definition at line 52 of file RTOpPack_TOpRandomize.hpp.

template<class Scalar>
unsigned int RTOpPack::TOpRandomize< Scalar >::get_static_seed  )  [inline, static]
 

Definition at line 54 of file RTOpPack_TOpRandomize.hpp.

template<class Scalar>
void RTOpPack::TOpRandomize< Scalar >::set_bounds const Scalar &  l,
const Scalar &  u
[inline]
 

Definition at line 66 of file RTOpPack_TOpRandomize.hpp.

template<class Scalar>
void RTOpPack::TOpRandomize< Scalar >::set_seed const unsigned int  seed  )  [inline]
 

Definition at line 68 of file RTOpPack_TOpRandomize.hpp.

template<class Scalar>
unsigned int RTOpPack::TOpRandomize< Scalar >::get_seed  )  const [inline]
 

Definition at line 70 of file RTOpPack_TOpRandomize.hpp.

template<class Scalar>
void RTOpPack::TOpRandomize< Scalar >::apply_op const int  num_vecs,
const ConstSubVectorView< Scalar >  sub_vecs[],
const int  num_targ_vecs,
const SubVectorView< Scalar >  targ_sub_vecs[],
ReductTarget reduct_obj
const [inline, virtual]
 

Implements RTOpPack::RTOpT< Scalar >.

Definition at line 74 of file RTOpPack_TOpRandomize.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:30:41 2008 for Collection of Concrete Vector Reduction/Transformation Operator Implementations by doxygen 1.3.9.1