openModeller  Version 1.4.0
distance_to_average.hh
Go to the documentation of this file.
00001 
00029 #ifndef _DISTANCE_TO_AVERAGEHH__
00030 #define _DISTANCE_TO_AVERAGEHH__
00031 
00032 #include <openmodeller/om.hh>
00033 
00034 /****************************************************************/
00035 /************************ Distance To Average *******************/
00036 
00042 class DistanceToAverage : public AlgorithmImpl
00043 {
00044 public:
00045 
00046   DistanceToAverage();
00047   virtual ~DistanceToAverage();
00048 
00049   int initialize();
00050   int iterate();
00051   int done() const;
00052 
00053   Scalar getValue( const Sample& x ) const;
00054   int    getConvergence( Scalar *val );
00055 
00056 protected:
00057   virtual void _getConfiguration( ConfigurationPtr& ) const;
00058   virtual void _setConfiguration( const ConstConfigurationPtr&  );
00059 
00060 private:
00061 
00062   bool _done;
00063   Scalar _dist;
00064   mutable Scalar _min; 
00065   mutable Scalar _max; 
00066 
00067   Sample  _avg;  
00068 };
00069 
00070 
00071 #endif
00072