/[ascend]/trunk/base/generic/solver/incidence.h
ViewVC logotype

Contents of /trunk/base/generic/solver/incidence.h

Parent Directory Parent Directory | Revision Log Revision Log


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

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