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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1252 - (show annotations) (download) (as text)
Sat Jan 27 06:29:17 2007 UTC (15 years, 5 months ago) by johnpye
File MIME type: text/x-chdr
File size: 4479 byte(s)
Removed the 'command line solver' from the Tcl/Tk interface.
Deactivated the 'plot' command in slv_interface.
Eliminated various #include <compiler/*> from the solver.
Added another sample model (which current fails because of problem with non-incident diff vars.
1 /* ASCEND modelling environment
2 Copyright (C) 2006 Carnegie Mellon University
3 Copyright (C) 1996 Benjamin Andrew Allan
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 *//** @file
20 Problem Analysis Routines.
21
22 These functions are the start of a new design for feeding
23 solvers from the ASCEND compiler or any arbitrary backend.
24
25 The intention is that eventually the other code in the solver
26 directory will really be for *solution algorithms* and the
27 definition of a *problem* will come from here. In essence, most
28 of what was solver/system.c will be here. Negotiating directly
29 with the ASCEND instance hierarchy should not be a solver's
30 job.
31 The goal of this module is to CREATE a slv_system_t data structure
32 capable of supporting code generation, an interactive interface, and
33 in-core solvers, while being expandable in the future to out of core
34 solvers/external-process solvers.
35
36 A secondary goal is to have nonlinear solver files be independent of
37 all the compiler directory files except ascmalloc.h.
38 The present fly in the ointment is expr.h because of the objective fcns.
39 The relman and exprman modules go away because they are indicative of
40 functionality that belongs either in the compiler or rel.c.
41 If we meet this goal, then it is a simple matter to connect any
42 arbitrary compiler backend to the solver API by replacing the rel
43 and var and analyze modules.
44 *//*
45 by Benjamin Andrew Allan 5/19/96
46 Last in CVS: $Revision: 1.10 $ $Date: 1997/07/18 12:13:50 $ $Author: mthomas $
47 */
48
49 #ifndef ASC_ANALYZE_H
50 #define ASC_ANALYZE_H
51
52 #include <utilities/config.h>
53 #include <utilities/ascConfig.h>
54
55 #include <compiler/instance_enum.h>
56 #include "slv_types.h"
57 #include "conditional.h"
58
59 /** @addtogroup analyse Analyse
60 @{
61 */
62
63 struct problem_t;
64
65 /** Used to give an integer value to each symbol used in a when */
66 struct SymbolValues {
67 char *name;
68 int value;
69 };
70
71 extern int analyze_make_problem(slv_system_t sys, struct Instance *inst);
72 /**<
73 Takes a system and populates the guts of it from the instance. Called by
74 system_build -- you don't need to call it yourself.
75
76 @TODO this routine should be part of the 'problem provider' API?
77
78 @NOTE
79 This implementation of analyze is specific to the ASCEND Compiler
80 back end.
81 */
82
83 extern void analyze_free_reused_mem(void);
84 /**<
85 Resets all internal memory recycles.
86 */
87
88 /*------------------------------------------------------------------------------
89 These routines are in use elsewhere in the solver directory, but we want
90 to get rid of them, as they contain dependencies on the compiler's data
91 structures.
92 */
93
94 extern int varinst_found_in_whenlist(slv_system_t sys, struct Instance *inst);
95 /**<
96 Determine if the conditional variable inst is part of the
97 variable list of some when in the when list of slv_system_t
98
99 @DEPRECATED we want to get rid of this in order to clean up the
100 solver interface (divorce it from dependencies on compiler)
101 */
102
103 extern int dis_var_in_a_when(struct Instance *var, struct w_when *when);
104 /**<
105 Return 1 if the discrete var is a member of the when var list, else
106 return 0
107
108 @DEPRECATED we want to get rid of this in order to clean up the
109 solver interface (divorce it from dependencies on compiler)*/
110
111 extern int GetIntFromSymbol(CONST char *symval, struct gl_list_t *symbol_list);
112 /**<
113 Creates the gl_list of SymboValues struct to asign an integer
114 value to a symbol value
115
116 @DEPRECATED we want to get rid of this in order to clean up the
117 solver interface (divorce it from dependencies on compiler)*/
118
119 extern void DestroySymbolValuesList(struct gl_list_t *symbol_list);
120 /**<
121 Destroy the gl_list of SymbolValues struct created to asign an integer
122 value to symbol value
123
124 @DEPRECATED we want to get rid of this in order to clean up the
125 solver interface (divorce it from dependencies on compiler) -- JP
126 */
127
128 /* @} */
129
130 #endif /* ASC_ANALYZE_H */

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