00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _HSOLVE_UTILS_H
00011 #define _HSOLVE_UTILS_H
00012
00013 #include "../basecode/header.h"
00014 #include "../basecode/global.h"
00015 #include "../external/debug/print_function.hpp"
00016 #include "../external/debug/simple_test.hpp"
00017
00018 #include "../biophysics/HHGate.h"
00019 #include "../biophysics/ChanBase.h"
00020 #include "../biophysics/ChanCommon.h"
00021 #include "../biophysics/HHChannelBase.h"
00022 #include "../biophysics/HHChannel.h"
00023 #include "../basecode/OpFunc.h"
00024
00025
00026 class HSolveUtils
00027 {
00028 public:
00029 static void initialize( Id object );
00030 static int adjacent( Id compartment, vector< Id >& ret );
00031 static int adjacent( Id compartment, Id exclude, vector< Id >& ret );
00032 static int children( Id compartment, vector< Id >& ret );
00033 static int channels( Id compartment, vector< Id >& ret );
00034 static int hhchannels( Id compartment, vector< Id >& ret );
00035 static int gates( Id channel, vector< Id >& ret, bool getOriginals = true );
00036 static int spikegens( Id compartment, vector< Id >& ret );
00037 static int synchans( Id compartment, vector< Id >& ret );
00038 static int leakageChannels( Id compartment, vector< Id >& ret );
00039 static int caTarget( Id channel, vector< Id >& ret );
00040 static int caDepend( Id channel, vector< Id >& ret );
00041
00042 class Grid
00043 {
00044 public:
00045 Grid( double min, double max, unsigned int divs )
00046 :
00047 min_( min ),
00048 max_( max ),
00049 divs_( divs )
00050 {
00051 dx_ = ( max_ - min_ ) / divs_;
00052 }
00053
00054 unsigned int size();
00055 double entry( unsigned int i );
00056
00057 bool operator ==( const Grid& other )
00058 {
00059 return
00060 min_ == other.min_ &&
00061 max_ == other.max_ &&
00062 divs_ == other.divs_;
00063 }
00064
00065 double min_;
00066 double max_;
00067 unsigned int divs_;
00068 double dx_;
00069 };
00070
00071
00072
00073
00074
00075
00076 static void rates(
00077 Id gate,
00078 Grid grid,
00079 vector< double >& A,
00080 vector< double >& B );
00081
00082
00083
00084
00085
00086 static int targets(
00087 Id object,
00088 string msg,
00089 vector< Id >& target,
00090 string filter = "",
00091 bool include = true );
00092
00093 static int targets(
00094 Id object,
00095 string msg,
00096 vector< Id >& target,
00097 const vector< string >& filter,
00098 bool include = true );
00099 };
00100
00101 #endif // _HSOLVE_UTILS_H