00001 //----------------------------------------------------------------------------- 00002 // Author: Jim Holmström 00003 // Date: 2002-02-13 00004 //----------------------------------------------------------------------------- 00005 00006 #ifndef __SGNGALGORITHM_H 00007 #define __SGNGALGORITHM_H 00008 00009 #include "GNGAlgorithm.hpp" 00010 #include <GNGCore/GNGNode.hpp> 00015 class SGNGAlgorithm : public GNGAlgorithm 00016 { 00017 public: 00021 SGNGAlgorithm(unsigned int MSEBackLog) : GNGAlgorithm(MSEBackLog) {}; 00022 00027 void SetSquaredError(double d) { m_squaredError = d; } 00028 00029 protected: 00034 virtual void UpdateError(GNGNode & s) 00035 { 00036 s.SetAccumulatedError( s.GetAccumulatedError() + m_squaredError ); 00037 } 00038 00042 virtual void PurgeEdges(); 00043 00050 virtual void MoveWinner(GNGNode & s); 00051 00058 virtual void MoveNeighbor(GNGNode & s); 00059 00065 virtual double CalculateMeanDistance(GNGNode & s); 00066 00067 00068 protected: 00069 double m_squaredError; 00070 }; 00071 00072 00073 #endif