00001 #ifndef CGENERALLINEARCOMBINER_H
00002 #define CGENERALLINEARCOMBINER_H
00003 #include <vector>
00004 #include <boost/shared_ptr.hpp>
00005
00006 class GeneralNeuron;
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 class GeneralLinearCombiner{
00017 public:
00018 typedef std::vector<boost::shared_ptr<GeneralNeuron> > tinvector;
00019 private:
00020
00021 std::vector<double> Weights;
00022
00023 double Output;
00024
00025 tinvector Input;
00026
00027 double Bias;
00028
00029 bool wchanged;
00030
00031 bool bchanged;
00032
00033 bool cachedoutput;
00034 public:
00035
00036 void SetBias(const double b){bchanged = true; Bias = b;}
00037
00038 double GetBias() const {return Bias;}
00039
00040 const std::vector<double> &GetWeights() const {return Weights;}
00041
00042 std::vector<double> &SetWeights(){wchanged = true; return Weights;}
00043
00044 virtual double CalcOutput();
00045
00046 virtual void SetInput(const tinvector &LocalInput);
00047
00048 const tinvector &GetInput() const {return Input;}
00049 explicit GeneralLinearCombiner(bool wantcached = false);
00050 virtual ~GeneralLinearCombiner();
00051 };
00052
00053 #endif // CGENERALLINEARCOMBINER_H