Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JMARKOV::JShiftedGenerator Class Reference

Implementation of the JGenerator interface. More...

#include <JMarkovGenerator.hh>

Inheritance diagram for JMARKOV::JShiftedGenerator:
JMARKOV::JGenerator

Public Member Functions

 JShiftedGenerator (JGenerator *_g, JPosition3D _shift)
 Constructor. More...
 
JPosition3D getPosition ()
 Return a randomly generated position. More...
 
double getWeight (JPosition3D pos)
 return the weight (=probability density dP/dV) for the given position. More...
 

Protected Attributes

JGenerator * g
 
JPosition3D shift
 

Detailed Description

Implementation of the JGenerator interface.

Generates positions by shifting the positions from another JGenerator

Definition at line 481 of file JMarkovGenerator.hh.

Constructor & Destructor Documentation

JMARKOV::JShiftedGenerator::JShiftedGenerator ( JGenerator *  _g,
JPosition3D  _shift 
)
inline

Constructor.

_g is a pointer to some other generator, note that memory ownership of the instance pointed to by _g is not transferred, so

Definition at line 493 of file JMarkovGenerator.hh.

493  :
494  g(_g), shift(_shift) {}

Member Function Documentation

JPosition3D JMARKOV::JShiftedGenerator::getPosition ( )
inlinevirtual

Return a randomly generated position.

Implements JMARKOV::JGenerator.

Definition at line 496 of file JMarkovGenerator.hh.

496  {
497  return g->getPosition() + shift ;
498  }
virtual JPosition3D getPosition()=0
Return a randomly generated position.
double JMARKOV::JShiftedGenerator::getWeight ( JPosition3D  pos)
inlinevirtual

return the weight (=probability density dP/dV) for the given position.

When the generator is properly normalized, the integral of this quantity over the whole space is 1.

Implements JMARKOV::JGenerator.

Definition at line 500 of file JMarkovGenerator.hh.

500  {
501  return g->getWeight( pos-shift ) ;
502  }
virtual double getWeight(JPosition3D pos)=0
return the weight (=probability density dP/dV) for the given position.

Member Data Documentation

JGenerator* JMARKOV::JShiftedGenerator::g
protected

Definition at line 506 of file JMarkovGenerator.hh.

JPosition3D JMARKOV::JShiftedGenerator::shift
protected

Definition at line 507 of file JMarkovGenerator.hh.


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