// @(#)root/mlp:$Id$
// Author: Christophe.Delaere@cern.ch   20/07/2003

/*************************************************************************
 * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TSynapse
#define ROOT_TSynapse

#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TNeuron;

//____________________________________________________________________
//
// TSynapse
//
// This is a simple weighted bidirectionnal connection between
// two neurons.
// A network is built connecting two neurons by a synapse.
// In addition to the value, the synapse can return the DeDw
//
//____________________________________________________________________

class TSynapse : public TObject {
 public:
   TSynapse();
   TSynapse(TNeuron*, TNeuron*, Double_t w = 1);
   virtual ~TSynapse() {}
   void SetPre(TNeuron* pre);
   void SetPost(TNeuron* post);
   inline TNeuron* GetPre()  const { return fpre; }
   inline TNeuron* GetPost() const { return fpost; }
   void SetWeight(Double_t w);
   inline Double_t GetWeight() const { return fweight; }
   Double_t GetValue() const;
   Double_t GetDeDw() const;
   void SetDEDw(Double_t in);
   Double_t GetDEDw() const { return fDEDw; }

 private:
   TNeuron* fpre;         // the neuron before the synapse
   TNeuron* fpost;        // the neuron after the synapse
   Double_t fweight;      // the weight of the synapse
   Double_t fDEDw;        //! the derivative of the total error wrt the synapse weight

   ClassDef(TSynapse, 1)  // simple weighted bidirectionnal connection between 2 neurons
};

#endif
 TSynapse.h:1
 TSynapse.h:2
 TSynapse.h:3
 TSynapse.h:4
 TSynapse.h:5
 TSynapse.h:6
 TSynapse.h:7
 TSynapse.h:8
 TSynapse.h:9
 TSynapse.h:10
 TSynapse.h:11
 TSynapse.h:12
 TSynapse.h:13
 TSynapse.h:14
 TSynapse.h:15
 TSynapse.h:16
 TSynapse.h:17
 TSynapse.h:18
 TSynapse.h:19
 TSynapse.h:20
 TSynapse.h:21
 TSynapse.h:22
 TSynapse.h:23
 TSynapse.h:24
 TSynapse.h:25
 TSynapse.h:26
 TSynapse.h:27
 TSynapse.h:28
 TSynapse.h:29
 TSynapse.h:30
 TSynapse.h:31
 TSynapse.h:32
 TSynapse.h:33
 TSynapse.h:34
 TSynapse.h:35
 TSynapse.h:36
 TSynapse.h:37
 TSynapse.h:38
 TSynapse.h:39
 TSynapse.h:40
 TSynapse.h:41
 TSynapse.h:42
 TSynapse.h:43
 TSynapse.h:44
 TSynapse.h:45
 TSynapse.h:46
 TSynapse.h:47
 TSynapse.h:48
 TSynapse.h:49
 TSynapse.h:50
 TSynapse.h:51
 TSynapse.h:52
 TSynapse.h:53
 TSynapse.h:54
 TSynapse.h:55
 TSynapse.h:56
 TSynapse.h:57