summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormike <mike@d8baa203-390c-0410-a584-dba4c0749223>2011-07-17 21:57:41 +0000
committermike <mike@d8baa203-390c-0410-a584-dba4c0749223>2011-07-17 21:57:41 +0000
commita59a43a3b7f61dcaa4120f8283cb62aef5727b7f (patch)
treef92a7e66ec0ef990760dd917bea23ba6c32b1619 /src
parent9a8b77707c12bab9d64e92b19a8256ac5b1e252e (diff)
downloadlibneural-a59a43a3b7f61dcaa4120f8283cb62aef5727b7f.tar.gz
libneural-a59a43a3b7f61dcaa4120f8283cb62aef5727b7f.tar.bz2
libneural-a59a43a3b7f61dcaa4120f8283cb62aef5727b7f.tar.xz
libneural-a59a43a3b7f61dcaa4120f8283cb62aef5727b7f.zip
The network class will simply facilitate the input and output buffers, memory
management, and probably contain the parsing code a little later on. git-svn-id: http://svn.xagasoft.com/misc/libneural/trunk@472 d8baa203-390c-0410-a584-dba4c0749223
Diffstat (limited to '')
-rw-r--r--src/column.cpp4
-rw-r--r--src/column.h15
-rw-r--r--src/network.cpp1
-rw-r--r--src/network.h29
4 files changed, 44 insertions, 5 deletions
diff --git a/src/column.cpp b/src/column.cpp
index 10b010b..881284e 100644
--- a/src/column.cpp
+++ b/src/column.cpp
@@ -1 +1,5 @@
1#include "neural/column.h" 1#include "neural/column.h"
2
3template class Neural::Column<float>;
4template class Neural::Column<double>;
5template class Neural::Column<long double>;
diff --git a/src/column.h b/src/column.h
index 17ba899..8c07f62 100644
--- a/src/column.h
+++ b/src/column.h
@@ -40,14 +40,19 @@ namespace Neural
40 40
41 virtual void process( sigtype *aInput, sigtype *aOutput ) 41 virtual void process( sigtype *aInput, sigtype *aOutput )
42 { 42 {
43 43 typename BufferList::iterator iBuf = lBuffer.begin();
44 sigtype *pInput, *pOutput; 44 sigtype *pBuffer = aInput;
45 int iOutputOffset = 0; 45 sigtype *pNextBuffer = *iBuf;
46 for( typename Container<sigtype>::NodeList::iterator i = 46 for( typename Container<sigtype>::NodeList::iterator i =
47 Container<sigtype>::getNodeList().begin(); i; i++ ) 47 Container<sigtype>::getNodeList().begin(); i; i++ )
48 { 48 {
49 (*i)->process( aInput, aOutput+iOutputOffset ); 49 (*i)->process( pBuffer, pNextBuffer );
50 iOutputOffset += (*i)->getNumOutputs(); 50 pBuffer = pNextBuffer;
51 iBuf++;
52 if( iBuf )
53 pNextBuffer = *iBuf;
54 else
55 pNextBuffer = aOutput;
51 } 56 }
52 } 57 }
53 58
diff --git a/src/network.cpp b/src/network.cpp
index e69de29..972c88d 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -0,0 +1 @@
#include "neural/network.h"
diff --git a/src/network.h b/src/network.h
index e69de29..85d8407 100644
--- a/src/network.h
+++ b/src/network.h
@@ -0,0 +1,29 @@
1#ifndef NEURAL_NETWORK_H
2#define NEURAL_NETWORK_H
3
4#include "neural/node.h"
5
6namespace Neural
7{
8 template<typename sigtype>
9 class Network
10 {
11 public:
12 Network() :
13 pRoot( 0 )
14 {
15 }
16
17 virtual ~Network()
18 {
19 delete pRoot;
20 }
21
22
23
24 private:
25 Node<sigtype> *pRoot;
26 };
27};
28
29#endif