diff options
Diffstat (limited to '')
-rw-r--r-- | src/column.cpp | 4 | ||||
-rw-r--r-- | src/column.h | 15 | ||||
-rw-r--r-- | src/network.cpp | 1 | ||||
-rw-r--r-- | src/network.h | 29 |
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 | |||
3 | template class Neural::Column<float>; | ||
4 | template class Neural::Column<double>; | ||
5 | template 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 | |||
6 | namespace 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 | ||