linmod.h

Go to the documentation of this file.
00001 #ifndef linmod_h
00002 #define linmod_h
00003 
00004 #include <OS/list.h>
00005 #include "ocmatrix.h"
00006 #include "ivocvect.h"
00007 #include "nrnoc2iv.h"
00008 
00009 class MatrixMap {
00010 public:
00011    MatrixMap(Matrix*);
00012    ~MatrixMap();
00013    Matrix* m_;
00014 
00015    void alloc(int, int, Node**, int*);
00016    void mmfree();
00017    void add(double fac);
00018 
00019    // the map
00020    int plen_;
00021    double** pm_;
00022    double** ptree_;
00023 };
00024 
00025 class LinearModelAddition {
00026 public:
00027    LinearModelAddition(Matrix* c, Matrix* g, Vect* y, Vect* y0, Vect* b,
00028       int nnode, Node** nodes, Vect* elayer = nil);
00029    virtual ~LinearModelAddition();
00030    int extra_eqn_count();
00031    void alloc(int);
00032    void lmafree();
00033    void init();
00034    void lhs();
00035    void rhs();
00036    void dkmap(double**, double**);
00037    void dkres(double*, double*, double*);
00038    void dkpsol(double);
00039    void update();
00040 
00041 private:
00042    MatrixMap* c_;
00043    MatrixMap* g_;
00044    Vect* b_;
00045    Vect* y_;
00046    Vect* y0_;
00047    // connection to the voltage tree part of the matrix
00048    int nnode_;
00049    Node** nodes_;
00050 
00051    int size_;
00052    int start_;
00053    int* bmap_;
00054    Vect* gy_, *cyp_;
00055    Vect* ytmp_, *yptmp_; // temporary vectors used along with cy_ for res.
00056    int* elayer_; //normally elements are 0 and refer to internal potential
00057    //otherwise range from 1 to nlayer and refer to vext[elayer-1]
00058    // vm+vext and vext must be placed in y for calculation of rhs
00059    void v2y();
00060 };
00061 
00062 declarePtrList(LinmodPtrList, LinearModelAddition)
00063 
00064 #endif
Generated on Mon Jun 13 08:10:25 2011 for NEURON by  doxygen 1.6.3