TarzaNN
TarzaNN neural network simulator
|
00001 /**************************************************************************** 00002 ** 00003 ** Copyright C 2002-2012 Laboratory for Active and Attentive Vision (LAAV), Department of Computer Science and Engineering, York University, Toronto, ON, Canada. 00004 ** All rights reserved. 00005 ** 00006 ** This file is part of the TarzaNN Neural Network Simulator. 00007 ** 00008 ** This file may be distributed and/or modified under the terms of the 00009 ** GNU General Public License version 2 as published by the Free Software 00010 ** Foundation and appearing in the file LICENSE.GPL included in the 00011 ** packaging of this file. 00012 ** 00013 ** See http://www.tarzann.org/gpl/ for GPL licensing information. 00014 ** 00015 ** Contact info@tarzann.org if any conditions of this licensing are 00016 ** not clear to you. 00017 ** 00018 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00019 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00020 ** 00021 ****************************************************************************/ 00022 00023 #ifndef DIRECTION_H 00024 #define DIRECTION_H 00025 00027 00053 class Direction { 00054 public: 00056 Direction(int resolution); 00057 ~Direction(); 00058 00060 int getDiscrete(float ang_rad); 00062 float getRadians(int discr); 00064 const int getResolution() { return resolution; } 00066 const float getIncrement() { return increment; } 00068 void setResolution(int); 00070 int normDiscrete(int); 00072 float normRadians(float); 00073 00074 // If resolution is not divisible by 4, you get weird 00075 // results here... 00077 00081 const int get90() { return resolution/4; } 00083 00087 const int get180() { return resolution/2; } 00088 00090 float sinD(int d); 00092 float cosD(int d); 00093 00094 // functions dependent solely upon directionality 00095 00097 float getSelectivity(int); 00098 00099 private: 00100 int resolution; 00101 float increment; 00102 float *selectivity; 00103 float *sin_cache, *cos_cache; 00104 }; 00105 00106 #endif /* DIRECTION_H */