Generated on Mon Jun 23 17:17:53 2008 for ell-2.3.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 
00089     class WalkAdaptive : public Walk {
00090     public:
00091         
00093             enum NeighborGenType {SUCCESSIVE, RANDOM};
00094             
00102         WalkAdaptive(   const NeighborGenType ngt,
00103                         const bool isDegenerate = false
00104                     );
00105         
00107         virtual ~WalkAdaptive() {};
00108         
00122         static 
00123             StateCollector* 
00124             walkAdaptive(
00125                 const State* const start, 
00126                 StateCollector* const scWalk,
00127                 const NeighborGenType ngt,
00128                 StateCollector* const scRejected = NULL,
00129                 const bool isDegenerate = false
00130                 );
00131 
00132         // implements abstract function of superclass
00133         virtual
00134             StateCollector* 
00135             walk(
00136                 const State* const start, 
00137                 StateCollector* const scWalk,
00138                 StateCollector* const scRejected = NULL
00139                 ) const;
00140                 
00141     protected:
00143         const NeighborGenType t;
00144 
00149         const bool isDeg;
00150     };
00151 
00152     
00153     
00154     
00160     class WalkGradient : public Walk{
00161     public:
00162             
00168         WalkGradient( const bool isDegenerate = false );
00169 
00171         virtual ~WalkGradient() {};
00172 
00182         static 
00183             StateCollector* 
00184             walkGradient(
00185                 const State* const start, 
00186                 StateCollector* const scWalk,
00187                 const bool isDegenerate = false
00188                 );
00189         
00190         // implementation of virtual member function for a gradient walk of an WalkGradient object
00191         virtual 
00192             StateCollector* 
00193             walk(
00194                 const State* const start, 
00195                 StateCollector* const scWalk,
00196                 StateCollector* const scRejected
00197                 ) const;
00198         
00199     protected:
00200         
00205         const bool isDeg;
00206     };
00207 
00208     
00209     
00210 
00217     class WalkMC : public Walk{
00218     public:
00219         
00222         WalkMC( const WalkAbortionCriterion* const wac, 
00223                     const double beta );
00224         
00226         virtual ~WalkMC() {delete wac;};
00227         
00239         static 
00240             StateCollector* 
00241             walkMC( const State* const start, 
00242                     StateCollector* const scWalk, 
00243                     const WalkAbortionCriterion* const wac, 
00244                     const double beta,
00245                     StateCollector* const scRejected = NULL
00246                     );
00247         
00248         // implementation of virtual member function for a monte carlo walk of an WalkMC object
00249         virtual 
00250             StateCollector* 
00251             walk(
00252                 const State* const start, 
00253                 StateCollector* const scWalk,
00254                 StateCollector* const scRejected = NULL
00255             ) const;
00256                 
00257     protected:
00258         
00260         const WalkAbortionCriterion* const wac; 
00261             
00263         const double beta;
00264     };
00265     
00266     
00267     
00268     
00269     
00270 
00277     class WalkRandom : public Walk {
00278     public:
00279         
00283             WalkRandom( 
00284                         const WalkAbortionCriterion* const wac
00285                     );
00286             
00288             virtual ~WalkRandom() {};
00289             
00298         static 
00299             StateCollector* 
00300             walkRandom( const State* const start, 
00301                         StateCollector* const scWalk,
00302                         const WalkAbortionCriterion* const wac, 
00303                         StateCollector* const scRejected = NULL
00304                         );
00305         
00306         // implementation of virtual member function for a random walk of a WalkRandom object
00307         virtual 
00308             StateCollector* 
00309             walk(   const State* const start, 
00310                     StateCollector* const scWalk,
00311                     StateCollector* const scRejected = NULL
00312                     ) const;
00313         
00314     protected:
00315         
00317         const WalkAbortionCriterion* const wac;
00318         
00319     };
00320 
00321     
00322     
00323 } // end namespace ell
00324 
00325 #endif /*WALK_HH_*/