Generated on Tue Dec 16 13:34:02 2008 for ell-3.0.0 by doxygen 1.5.1

src/ell/Walk.hh

Go to the documentation of this file.
00001 #ifndef WALK_HH_
00002 #define WALK_HH_
00003 
00004 
00005 #include "ell/State.hh"
00006 #include "ell/NeighborGenerator.hh"
00007 #include "ell/StateAcceptor.hh"
00008 #include "ell/WalkAbortionCriterion.hh"
00009 #include "ell/StateCollector.hh"
00010 
00011 namespace ell {
00012     
00013     
00014 
00015     
00016     
00029     class Walk {
00030     public:
00031         
00033             virtual ~Walk() {};
00034             
00042         virtual 
00043             StateCollector*
00044             walk(   const State* const start, 
00045                     StateCollector* const scWalk, 
00046                     StateCollector* scRejected = NULL
00047                 ) const = 0;
00048         
00065         static 
00066             StateCollector* 
00067             walk(   const State* const start, 
00068                     StateCollector* const scWalk,
00069                     const NeighborGenerator* const ng, 
00070                     const StateAcceptor* const sa, 
00071                     const WalkAbortionCriterion* const wac, 
00072                     StateCollector* scRejected = NULL
00073                 );
00074         
00075     protected:
00076     };
00077     
00078     
00079     
00080     
00081 
00097     class WalkAdaptive : public Walk {
00098     public:
00099         
00101             enum NeighborGenType {SUCCESSIVE, RANDOM};
00102             
00106         WalkAdaptive(   const NeighborGenType ngt
00107                     );
00108         
00110         virtual ~WalkAdaptive() {};
00111         
00121         static 
00122             StateCollector* 
00123             walkAdaptive(
00124                 const State* const start, 
00125                 StateCollector* const scWalk,
00126                 const NeighborGenType ngt,
00127                 StateCollector* const scRejected = NULL
00128                 );
00129 
00130         // implements abstract function of superclass
00131         virtual
00132             StateCollector* 
00133             walk(
00134                 const State* const start, 
00135                 StateCollector* const scWalk,
00136                 StateCollector* const scRejected = NULL
00137                 ) const;
00138                 
00139     protected:
00141         const NeighborGenType t;
00142 
00143     };
00144 
00145     
00146     
00147     
00159     class WalkGradient : public Walk{
00160     public:
00161             
00163         WalkGradient();
00164 
00166         virtual ~WalkGradient() {};
00167 
00173         static 
00174             StateCollector* 
00175             walkGradient(
00176                 const State* const start, 
00177                 StateCollector* const scWalk
00178                 );
00179         
00180         // implementation of virtual member function for a gradient walk of an WalkGradient object
00181         virtual 
00182             StateCollector* 
00183             walk(
00184                 const State* const start, 
00185                 StateCollector* const scWalk,
00186                 StateCollector* const scRejected
00187                 ) const;
00188         
00189     };
00190 
00191     
00192     
00193 
00200     class WalkMC : public Walk{
00201     public:
00202         
00205         WalkMC( const WalkAbortionCriterion* const wac, 
00206                     const double beta );
00207         
00209         virtual ~WalkMC() {delete wac;};
00210         
00224         static 
00225             StateCollector* 
00226             walkMC( const State* const start, 
00227                     StateCollector* const scWalk, 
00228                     const WalkAbortionCriterion* const wac, 
00229                     const double kT,
00230                     StateCollector* const scRejected = NULL
00231                     );
00232         
00233         // implementation of virtual member function for a monte carlo walk of an WalkMC object
00234         virtual 
00235             StateCollector* 
00236             walk(
00237                 const State* const start, 
00238                 StateCollector* const scWalk,
00239                 StateCollector* const scRejected = NULL
00240             ) const;
00241                 
00242     protected:
00243         
00245         const WalkAbortionCriterion* const wac; 
00246             
00249         const double kT;
00250     };
00251     
00252     
00253     
00254     
00255     
00256 
00263     class WalkRandom : public Walk {
00264     public:
00265         
00269             WalkRandom( 
00270                         const WalkAbortionCriterion* const wac
00271                     );
00272             
00274             virtual ~WalkRandom() {};
00275             
00284         static 
00285             StateCollector* 
00286             walkRandom( const State* const start, 
00287                         StateCollector* const scWalk,
00288                         const WalkAbortionCriterion* const wac, 
00289                         StateCollector* const scRejected = NULL
00290                         );
00291         
00292         // implementation of virtual member function for a random walk of a WalkRandom object
00293         virtual 
00294             StateCollector* 
00295             walk(   const State* const start, 
00296                     StateCollector* const scWalk,
00297                     StateCollector* const scRejected = NULL
00298                     ) const;
00299         
00300     protected:
00301         
00303         const WalkAbortionCriterion* const wac;
00304         
00305     };
00306 
00307     
00308     
00309 } // end namespace ell
00310 
00311 #endif /*WALK_HH_*/