staticContourNeuronProp.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #ifndef STATICCONTOURNEURONPROP2_H_DEFINED
00054 #define STATICCONTOURNEURONPROP2_H_DEFINED
00055
00056
00057 template <class FLOAT, class INT> class staticContourNeuronProp
00058 {
00059 private:
00060
00061 unsigned int sCNP_activeNeuronCount;
00062
00063 INT sCNP_ID;
00064
00065 FLOAT *sCNP_groupMod;
00066
00067 std::vector<bool> sCNP_otherNeuronPol;
00068
00069 std::vector<unsigned char> sCNP_otherNeuronAlpha;
00070
00071 std::vector<unsigned char> sCNP_otherNeuron_i;
00072
00073 std::vector<unsigned char> sCNP_otherNeuron_j;
00074
00075 std::vector<FLOAT> sCNP_weightStoreValue;
00076
00077 public:
00078
00079 const static int sCNP_vecSize = 32;
00080
00081 staticContourNeuronProp();
00082
00083 ~staticContourNeuronProp();
00084
00085 inline void sCNP_setID(const INT ID);
00086
00087 inline INT sCNP_getID() const;
00088
00089 inline void sCNP_setGroupMod(FLOAT *gmod);
00090
00091 inline FLOAT* sCNP_getGroupMod() const;
00092
00093 inline void sCNP_insertStoreList(const unsigned char a,
00094 const unsigned char i,
00095 const unsigned char j,
00096 const bool polarity,
00097 const FLOAT storeVal);
00098
00099
00100 inline bool sCNP_getOtherNeuronPol( unsigned int i) const;
00101
00102 inline FLOAT sCNP_getWeightStoreVal( unsigned int i) const;
00103
00104 inline unsigned char sCNP_getOtherNeuronAlpha(unsigned int i) const;
00105
00106 inline unsigned char sCNP_getOtherNeuron_i( unsigned int i) const;
00107
00108 inline unsigned char sCNP_getOtherNeuron_j( unsigned int i) const;
00109
00110 inline unsigned int sCNP_getActiveNeuronCount() const;
00111 };
00112
00113
00114 template <class FLOAT, class INT>
00115 inline staticContourNeuronProp<FLOAT,INT>::staticContourNeuronProp()
00116 {
00117 sCNP_activeNeuronCount = 0;
00118
00119 sCNP_otherNeuronAlpha.resize(sCNP_activeNeuronCount + sCNP_vecSize,0);
00120 sCNP_otherNeuron_i.resize(sCNP_activeNeuronCount + sCNP_vecSize,0);
00121 sCNP_otherNeuron_j.resize(sCNP_activeNeuronCount + sCNP_vecSize,0);
00122 sCNP_otherNeuronPol.resize(sCNP_activeNeuronCount + sCNP_vecSize,false);
00123 sCNP_weightStoreValue.resize(sCNP_activeNeuronCount + sCNP_vecSize,0.0F);
00124 }
00125
00126
00127 template <class FLOAT, class INT>
00128 inline staticContourNeuronProp<FLOAT,INT>::~staticContourNeuronProp()
00129 {}
00130
00131
00132 template <class FLOAT, class INT>
00133 inline void staticContourNeuronProp<FLOAT,INT>::sCNP_setID(const INT ID)
00134 {
00135 sCNP_ID = ID;
00136 }
00137
00138
00139 template <class FLOAT, class INT>
00140 inline INT staticContourNeuronProp<FLOAT,INT>::sCNP_getID() const
00141 {
00142 return sCNP_ID;
00143 }
00144
00145
00146 template <class FLOAT, class INT>
00147 inline void staticContourNeuronProp<FLOAT,INT>::sCNP_setGroupMod(FLOAT *gmod)
00148 {
00149 sCNP_groupMod = gmod;
00150 }
00151
00152
00153 template <class FLOAT, class INT>
00154 inline FLOAT *staticContourNeuronProp<FLOAT,INT>::sCNP_getGroupMod() const
00155 {
00156 return sCNP_groupMod;
00157 }
00158
00159
00160 template <class FLOAT, class INT>
00161 inline void staticContourNeuronProp<FLOAT,INT>::sCNP_insertStoreList(
00162 const unsigned char a,
00163 const unsigned char i,
00164 const unsigned char j,
00165 const bool polarity,
00166 const FLOAT storeVal)
00167 {
00168 if(sCNP_activeNeuronCount == (sCNP_weightStoreValue.size() - 1))
00169 {
00170 sCNP_otherNeuronAlpha.resize(sCNP_activeNeuronCount + sCNP_vecSize);
00171 sCNP_otherNeuron_i.resize(sCNP_activeNeuronCount + sCNP_vecSize);
00172 sCNP_otherNeuron_j.resize(sCNP_activeNeuronCount + sCNP_vecSize);
00173 sCNP_otherNeuronPol.resize(sCNP_activeNeuronCount + sCNP_vecSize);
00174 sCNP_weightStoreValue.resize(sCNP_activeNeuronCount + sCNP_vecSize);
00175 }
00176
00177 sCNP_otherNeuronAlpha[sCNP_activeNeuronCount] = a;
00178 sCNP_otherNeuron_i[sCNP_activeNeuronCount] = i;
00179 sCNP_otherNeuron_j[sCNP_activeNeuronCount] = j;
00180 sCNP_otherNeuronPol[sCNP_activeNeuronCount] = polarity;
00181 sCNP_weightStoreValue[sCNP_activeNeuronCount] = storeVal;
00182
00183 sCNP_activeNeuronCount++;
00184 }
00185
00186
00187 template <class FLOAT, class INT> inline bool
00188 staticContourNeuronProp<FLOAT,INT>::sCNP_getOtherNeuronPol(unsigned int i) const
00189 {
00190 return sCNP_otherNeuronPol[i];
00191 }
00192
00193
00194 template <class FLOAT, class INT> inline FLOAT
00195 staticContourNeuronProp<FLOAT,INT>::sCNP_getWeightStoreVal(unsigned int i) const
00196 {
00197 return sCNP_weightStoreValue[i];
00198 }
00199
00200
00201 template <class FLOAT, class INT> inline unsigned char
00202 staticContourNeuronProp<FLOAT,INT>::sCNP_getOtherNeuronAlpha(unsigned int i) const
00203 {
00204 return sCNP_otherNeuronAlpha[i];
00205 }
00206
00207
00208 template <class FLOAT, class INT> inline unsigned char
00209 staticContourNeuronProp<FLOAT,INT>::sCNP_getOtherNeuron_i(unsigned int i) const
00210 {
00211 return sCNP_otherNeuron_i[i];
00212 }
00213
00214
00215 template <class FLOAT, class INT> inline unsigned char
00216 staticContourNeuronProp<FLOAT,INT>::sCNP_getOtherNeuron_j(unsigned int i) const
00217 {
00218 return sCNP_otherNeuron_j[i];
00219 }
00220
00221 template <class FLOAT, class INT> inline unsigned int
00222 staticContourNeuronProp<FLOAT,INT>::sCNP_getActiveNeuronCount() const
00223 {
00224 return sCNP_activeNeuronCount;
00225 }
00226
00227
00228 #endif