/[ascend]/trunk/pygtk/solver.i
ViewVC logotype

Diff of /trunk/pygtk/solver.i

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1111 by johnpye, Wed Jan 10 01:01:12 2007 UTC revision 1112 by johnpye, Thu Jan 11 05:38:15 2007 UTC
# Line 8  Line 8 
8  %import "ascpy.i"  %import "ascpy.i"
9    
10  %{  %{
11    #include "config.h"
12  #include "integrator.h"  #include "integrator.h"
13  #include "integratorreporter.h"  #include "integratorreporter.h"
14  #include "solver.h"  #include "solver.h"
# Line 16  Line 17 
17  #include "solverparameters.h"  #include "solverparameters.h"
18  #include "solverreporter.h"  #include "solverreporter.h"
19  #include "curve.h"  #include "curve.h"
20    
21    #ifdef ASC_WITH_MFGRAPH
22    # include <fstream>
23    # include <mfgraph/mfg_draw_graph.h>
24    #endif
25  %}  %}
26    
27  %pythoncode{  %pythoncode{
# Line 166  public: Line 172  public:
172      }      }
173  }  }
174    
175  /* Incidence matrix stuff */  %template(IncidencePointVector) std::vector<IncidencePoint>;
176  typedef enum{  %include "incidencematrix.h"
     IM_NULL=0, IM_ACTIVE_FIXED, IM_ACTIVE_FREE, IM_DORMANT_FIXED, IM_DORMANT_FREE  
 } IncidencePointType;  
   
 class IncidencePoint{  
 public:  
     IncidencePoint(const IncidencePoint &);  
   
     int row;  
     int col;  
     IncidencePointType type;  
 };  
177    
178  %extend IncidencePoint{  %extend IncidencePoint{
179      %pythoncode{      %pythoncode{
# Line 187  public: Line 182  public:
182      }      }
183  }  }
184    
185  %template(IncidencePointVector) std::vector<IncidencePoint>;  %extend IncidenceMatrix{
186    #ifdef ASC_WITH_MFGRAPH
187  class IncidenceMatrix{      void writeBlockGraph(const char *filen,const int block){
188  public:          mfg::DrawGraph G = self->getBlockGraph(block);
189      explicit IncidenceMatrix(Simulation &);          std::ofstream f(filen);
190      const std::vector<IncidencePoint> &getIncidenceData();          G.PrintAsDot(f);
191      const int &getNumRows() const;      }
192      const int &getNumCols() const;  #endif
193      const Variable getVariable(const int &col);  }
     const Relation getRelation(const int &col);  
     const int getBlockRow(const int &row) const;  
     const std::vector<Variable> getBlockVars(const int block);  
     const std::vector<Relation> getBlockRels(const int block);  
     const std::vector<int> getBlockLocation(const int &block) const;  
     const int getNumBlocks();  
 };  
   
194    
195  /* Variables and relations belong to solvers, so they're here: */  /* Variables and relations belong to solvers, so they're here: */
196    
   
197  %include "variable.h"  %include "variable.h"
198    
199  %extend Variable {  %extend Variable {

Legend:
Removed from v.1111  
changed lines
  Added in v.1112

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22