1 |
/* ASCEND Solver Interface |
2 |
Copyright (C) 2006 Carnegie Mellon University |
3 |
|
4 |
This program is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU General Public License |
6 |
as published by the Free Software Foundation; either version 2 |
7 |
of the License, or (at your option) any later version. |
8 |
|
9 |
This program is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU General Public License for more details. |
13 |
|
14 |
You should have received a copy of the GNU General Public License |
15 |
along with this program; if not, write to the Free Software |
16 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 |
*//** @file |
18 |
This file wraps up the routines for making a data structure |
19 |
containing system incidence matrix information, which can then be |
20 |
plotted or interactively queried using the GUI |
21 |
*/ |
22 |
|
23 |
#ifndef ASC_INCIDENCE_H |
24 |
#define ASC_INCIDENCE_H |
25 |
|
26 |
/** @addtogroup system System |
27 |
@{ |
28 |
*/ |
29 |
|
30 |
#include <stdio.h> |
31 |
|
32 |
/* The includes required just for this *header* to load */ |
33 |
#include <utilities/ascConfig.h> |
34 |
#include "slv_types.h" |
35 |
#include "var.h" |
36 |
#include "rel.h" |
37 |
|
38 |
/* Note, removed 'own' attribute from mplotvars struct since it was unused */ |
39 |
|
40 |
typedef struct{ |
41 |
int nprow; /**< number of plotted rows (== neqn always for now) */ |
42 |
int neqn; /**< number of relations. orgrows 0-neqns are relations */ |
43 |
int npcol; /**< number of plotted columns (== nfakevar) */ |
44 |
int nvar; /**< number of variables. orgcols 0-nvars-1 are variables */ |
45 |
int nfakevar; /**< nvar -nnincident + nslack (currently always == npcol) */ |
46 |
int *pr2e; /**< len nprow, mapping plot row -> eqn id */ |
47 |
int *e2pr; /**< len neqn, mapping eqn id -> plot row */ |
48 |
int *pc2v; /**< len npcol, mapping plot column -> var org col */ |
49 |
int *v2pc; /**< len nvar, mapping var org col -> plot col */ |
50 |
char *vfixed; /**< len nvar, fixed flags by var org col */ |
51 |
|
52 |
struct var_variable **vlist; /** pointer to the array of variables in the system */ |
53 |
struct rel_relation **rlist; /** pointer to the array of relations in the system */ |
54 |
} incidence_vars_t; |
55 |
|
56 |
ASC_DLLSPEC int build_incidence_data(CONST slv_system_t sys, incidence_vars_t *pd); |
57 |
/**< |
58 |
Fill in an mplotvars struct |
59 |
|
60 |
@return 0 if ok, 1 otherwise |
61 |
|
62 |
This function is in charge of setting the layout that will appear |
63 |
in the canvas (row and column ordering). right now it is doing |
64 |
its own arrangement based on the mtx structure associated with |
65 |
the solver. Eventually it would be much better if the solvers |
66 |
provided the display orderings themselves. |
67 |
Also this does a 1time query of all the var fixed flags. |
68 |
*/ |
69 |
|
70 |
|
71 |
ASC_DLLSPEC void free_incidence_data(incidence_vars_t *pd); |
72 |
/**< |
73 |
free memory in an mplotvars struct, if it is our memory |
74 |
*/ |
75 |
/* @} */ |
76 |
|
77 |
#endif /* ASC_INCIDENCE_H */ |