#ifndef INCLUDE_QNEURON #define INCLUDE_QNEURON #include #include #include "quaternion.h" using namespace std; class Qneuron{ private: int K, N; vector neuron; vector X ; public: Qneuron( int k, int n ); void set( int i , int s1, int s2 ) { neuron[ 2*i ] = s1 ; neuron[ 2*i+1 ] = s2 ; } void activation( Quaternion x , int & c1 , int & c2 ) const ; int cactivation( Complex x ) const ; int update( int i , Quaternion x ) ; // 0 : unchanged , 1 : changed void addnoise( double level ) ; Quaternion getv( int i ) const ; int getstate( int i ) const { return neuron[ i ] ; } }; #endif