/[ascend]/trunk/pygtk/interface/incidencematrix.h
ViewVC logotype

Contents of /trunk/pygtk/interface/incidencematrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 233 - (show annotations) (download) (as text)
Sun Jan 29 16:55:27 2006 UTC (17 years, 4 months ago) by johnpye
File MIME type: text/x-chdr
File size: 1127 byte(s)
Something resembling an incidence matrix returned via SWIG...
1 #ifndef ASCXX_INCIDENCEMATRIX_H
2 #define ASCXX_INCIDENCEMATRIX_H
3
4 #include <vector>
5
6 #include "simulation.h"
7
8 extern "C"{
9 #include <solver/incidence.h>
10 }
11
12 typedef enum{
13 IM_NULL=0, IM_ACTIVE_FIXED, IM_ACTIVE_FREE, IM_DORMANT_FIXED, IM_DORMANT_FREE
14 } IncidencePointType;
15
16 class IncidencePoint{
17 public:
18 IncidencePoint(const int&row, const int&col, const IncidencePointType &type);
19 IncidencePoint(const IncidencePoint &);
20 IncidencePoint();
21
22 int row;
23 int col;
24 IncidencePointType type;
25 };
26
27 /**
28 Special class for plotting incidence matrices using matplotlib
29
30 GOAL: facilitate use of pylab 'spy2' function, but hopefully add extra
31 stuff for viewing blocks and fixed/free incidences, solved/active/unsolved
32 variables, etc.
33
34 This is going to be like a C++ified copy of MtxProc.c
35 */
36 class IncidenceMatrix{
37
38 private:
39 Simulation &sim;
40 slv_system_structure *sys;
41
42 std::vector<IncidencePoint> data;
43 incidence_vars_t i;
44 bool is_built;
45
46 void buildPlotData();
47 public:
48 explicit IncidenceMatrix(Simulation &sim);
49 ~IncidenceMatrix();
50
51 const std::vector<IncidencePoint> &getIncidenceData();
52 };
53
54 #endif // ASCXX_INCIDENCEMATRIX_H

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