00001 #ifndef INDII_ML_ODE_MULTISEEDNEURALMODELMK2_HPP 00002 #define INDII_ML_ODE_MULTISEEDNEURALMODELMK2_HPP 00003 00004 #include "indii/ml/aux/vector.hpp" 00005 #include "indii/ml/aux/matrix.hpp" 00006 #include "indii/ml/ode/DifferentialModel.hpp" 00007 #include "indii/ml/ode/FunctionModel.hpp" 00008 00009 namespace indii { 00010 namespace fmri { 00011 namespace neural { 00012 00013 /** 00014 * Multi-seed differential %model with %experimental input. 00015 * 00016 * @author Lawrence Murray <lawrence@indii.org> 00017 * @version $Rev: 285 $ 00018 * @date $Date: 2007-07-20 17:25:40 +0100 (Fri, 20 Jul 2007) $ 00019 * 00020 * Neural activities of \f$N\f$ seeds \f$\mathbf{x}\f$ and the effects 00021 * of an %experimental input \f$u(t)\f$ are related according to the 00022 * differential system: 00023 * 00024 * \f[ 00025 * \frac{d\mathbf{x}}{dt} = A\mathbf{x} + \mathbf{c}u 00026 * \f] 00027 * 00028 * where \f$A\f$ is an \f$N \times N\f$ matrix of efficacies between 00029 * seeds and \f$\mathbf{c}\f$ a vector of \f$N\f$ efficacies of the 00030 * input on the seeds. 00031 */ 00032 class MultiSeedNeuralModelMk2 : public indii::ml::ode::DifferentialModel { 00033 public: 00034 /** 00035 * Construct new %model with given number of seeds. The efficacies 00036 * remain uninitialised. 00037 * 00038 * @param N \f$N\f$; the number of seeds. 00039 * @param u \f$u(t)\f$; the %experimental input, e.g. an 00040 * instantiation of indii::fmri::experimental::BlockDesignModel. 00041 */ 00042 MultiSeedNeuralModelMk2(const unsigned int N, 00043 indii::ml::ode::FunctionModel* u); 00044 00045 /** 00046 * Construct new %model with given efficacies. 00047 * 00048 * @param A \f$A\f$; efficacies between seeds, assumed to be \f$N 00049 * \times N\f$ in size. 00050 * @param c \f$\mathbf{c}\f$; efficacies of input on seeds, must be 00051 * of size \f$N\f$. 00052 * @param u \f$u(t)\f$; the %experimental input, e.g. an 00053 * instantiation of indii::fmri::experimental::BlockDesignModel. 00054 */ 00055 MultiSeedNeuralModelMk2(const indii::ml::aux::matrix& A, 00056 const indii::ml::aux::vector& c, indii::ml::ode::FunctionModel* u); 00057 00058 /** 00059 * Destructor. 00060 */ 00061 virtual ~MultiSeedNeuralModelMk2(); 00062 00063 /** 00064 * Set all efficacies between all seeds. 00065 * 00066 * @param A \f$A\f$; efficacies between seeds, must be \f$N \times 00067 * N\f$ in size. 00068 */ 00069 void setEfficacies(const indii::ml::aux::matrix& A); 00070 00071 /** 00072 * Set all efficacies of input on seeds. 00073 * 00074 * @param c \f$c\f$; efficacies of input on seeds, must be of size 00075 * \f$N\f$. 00076 */ 00077 void setInputEfficacies(const indii::ml::aux::vector& c); 00078 00079 /** 00080 * Set the efficacy between two seeds. 00081 * 00082 * @param i \f$i\f$; index of the affected seed. 00083 * @param j \f$j\f$; index of the affecting seed. 00084 * @param A_ij \f$A_{ij}\f$; efficacy of seed \f$j\f$ on seed 00085 * \f$i\f$. 00086 */ 00087 void setEfficacy(const unsigned int i, const unsigned int j, 00088 const double A_ij); 00089 00090 /** 00091 * Set the efficacy of the input on a seed. 00092 * 00093 * @param i \f$i\f$; index of the affected seed. 00094 * @param c_i \f$c_i\f$; efficacy of the input on seed \f$i\f$. 00095 */ 00096 void setInputEfficacy(const unsigned int i, const double c_i); 00097 00098 /** 00099 * @see indii::ml::ode::DifferentialModel 00100 */ 00101 virtual void calculateDerivatives(double t, const double y[], double dydt[]); 00102 00103 private: 00104 /** 00105 * \f$N\f$n; the number of seeds in the model. 00106 */ 00107 const unsigned int N; 00108 00109 /** 00110 * \f$A\f$; the efficacy matrix. 00111 */ 00112 indii::ml::aux::matrix A; 00113 00114 /** 00115 * \f$\mathbf{c}\f$; the input efficacy vector. 00116 */ 00117 indii::ml::aux::vector c; 00118 00119 /** 00120 * \f$u(t)\f$; the input. 00121 */ 00122 indii::ml::ode::FunctionModel* u; 00123 00124 }; 00125 00126 } 00127 } 00128 } 00129 00130 #endif
1.5.2