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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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