All Classes Namespaces Files Functions Variables Typedefs Macros
clizSelector.h
Go to the documentation of this file.
1 // clizSelector.h - ClusterLizard header file - Module: Selector
2 
3 // Copyright (C) 2013, 2014 Simeon Knieling, M.Sc.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 //
9 
10 //Selector Class
11 
12 #pragma once
13 #ifndef _INCLUDE_CLIZSELECTOR
14 #define _INCLUDE_CLIZSELECTOR
15 
16 #include "clizSave.h"
17 
20 namespace cliz
21 {
22 
26  {
27  unsigned int numAllFeatures;
28  unsigned int numFeatures;
29  unsigned int spikeWindowSize;
31  };
32 
46  class Selector
47  {
48  private:
49  SelectorHandle handle; //Parameter handle
50  std::vector<IndicesStruct> indicesOut; //Which Modules that receive output from this module need which output?
51  std::vector<Save*> inputSaveVec; //Input Saves
52  std::vector<Save*> outputSaveVec; //Output Saves
53 
54  unsigned int *featureIDs; //Feature IDs that currently have the greatest KS value
55  float *features; //All features from the last X spikes (X=spikeWindowSize)
56  float *featureStd; //Std of all features from the last X spikes (X=spikeWindowSize)
57  float *featureWeightsAvg; //Weights of all feature
58  float *featureWeights; //Weights of all feature
59  unsigned int numFilled;
60  MemoryManager memMan;
61 
62  public:
66  Selector(SelectorHandle iHandle, std::vector<Save*> &iInputSaveVec, std::vector<Save*> &iOutputSaveVec, std::vector<IndicesStruct> iIndicesOut);
67 
71  void selectFeatures(int numNewSpikes);
72 
76  void threadFunc();
77 
79  {
80  memMan.free(featureIDs);
81  memMan.free(featureStd);
82  memMan.free(featureWeights);
83  memMan.free(features);
84  };
85  };
86 }
87 
88 #endif
void selectFeatures(int numNewSpikes)
Definition: clizSelector.cpp:170
Definition: clizSelector.h:25
Definition: cliz.h:55
float stdMultiplier4Weighting
Definition: clizSelector.h:30
Selector(SelectorHandle iHandle, std::vector< Save * > &iInputSaveVec, std::vector< Save * > &iOutputSaveVec, std::vector< IndicesStruct > iIndicesOut)
Definition: clizSelector.cpp:22
unsigned int numAllFeatures
Definition: clizSelector.h:27
unsigned int numFeatures
Definition: clizSelector.h:28
Definition: clizSelector.h:46
Definition: clizFunctions.h:268
void free(memPtr *memAdr)
Definition: clizFunctions.h:331
unsigned int spikeWindowSize
Definition: clizSelector.h:29
void threadFunc()
Definition: clizSelector.cpp:48
~Selector()
Definition: clizSelector.h:78