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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 290 - (show annotations) (download) (as text)
Fri Feb 10 03:30:05 2006 UTC (14 years, 7 months ago) by johnpye
File MIME type: text/x-chdr
File size: 1599 byte(s)
Fixable vars added to interface (outputs to console)
Added 'next big' and 'prev big' to move between 'big blocks' in the diagnose window.
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 const int getBlockRow(const int & row) const;
59 const std::vector<Variable> getBlockVars(const int &block);
60 const std::vector<Relation> getBlockRels(const int &block);
61 const std::vector<int> getBlockLocation(const int &block) const;
62 const int getNumBlocks();
63 };
64
65 #endif // ASCXX_INCIDENCEMATRIX_H

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