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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 218 by jds, Tue Aug 2 11:20:09 2005 UTC revision 219 by johnpye, Wed Jan 25 07:41:58 2006 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Problem Analysis Routines      Problem Analysis Routines
3   *  by Benjamin Andrew Allan      by Benjamin Andrew Allan
4   *  5/19/96      5/19/96
5   *  Version: $Revision: 1.10 $      Version: $Revision: 1.10 $
6   *  Version control file: $RCSfile: analyze.h,v $      Version control file: $RCSfile: analyze.h,v $
7   *  Date last modified: $Date: 1997/07/18 12:13:50 $      Date last modified: $Date: 1997/07/18 12:13:50 $
8   *  Last modified by: $Author: mthomas $      Last modified by: $Author: mthomas $
9   *  Copyright(C) 1996 Benjamin Andrew Allan      Copyright(C) 1996 Benjamin Andrew Allan
10   *  
11   *  This file is part of the ASCEND IV math programming system.      This file is part of the ASCEND IV math programming system.
12   *  
13   *  The SLV solver is free software; you can redistribute      The SLV solver is free software; you can redistribute
14   *  it and/or modify it under the terms of the GNU General Public License as      it and/or modify it under the terms of the GNU General Public License as
15   *  published by the Free Software Foundation; either version 2 of the      published by the Free Software Foundation; either version 2 of the
16   *  License, or (at your option) any later version.      License, or (at your option) any later version.
17   *  
18   *  The SLV solver is distributed in hope that it will be      The SLV solver is distributed in hope that it will be
19   *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of      useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
20   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21   *  General Public License for more details.      General Public License for more details.
22   *  
23   *  You should have received a copy of the GNU General Public License      You should have received a copy of the GNU General Public License
24   *  along with the program; if not, write to the Free Software Foundation,      along with the program; if not, write to the Free Software Foundation,
25   *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named      Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
26   *  COPYING.  COPYING is found in ../compiler.      COPYING.  COPYING is found in ../compiler.
27   */   */
28    
29  /** @file  /** @file
30   *  Problem Analysis Routines.      Problem Analysis Routines.
31   *  <pre>      
32   *  These functions are the start of a new design for feeding      These functions are the start of a new design for feeding
33   *  solvers from the ASCEND compiler or any arbitrary backend.      solvers from the ASCEND compiler or any arbitrary backend.
34   *  
35   *  The intention is that eventually the other code in the solver      The intention is that eventually the other code in the solver
36   *  directory will really be for *solution algorithms* and the      directory will really be for *solution algorithms* and the
37   *  definition of a *problem* will come from here. In essence, most      definition of a *problem* will come from here. In essence, most
38   *  of what was solver/system.c will be here. Negotiating directly      of what was solver/system.c will be here. Negotiating directly
39   *  with the ASCEND instance hierarchy should not be a solver's      with the ASCEND instance hierarchy should not be a solver's
40   *  job.      job.
41   *  The goal of this module is to CREATE a slv_system_t data structure      The goal of this module is to CREATE a slv_system_t data structure
42   *  capable of supporting code generation, an interactive interface, and      capable of supporting code generation, an interactive interface, and
43   *  in-core solvers, while being expandable in the future to out of core      in-core solvers, while being expandable in the future to out of core
44   *  solvers/external-process solvers.      solvers/external-process solvers.
45   *  
46   *  A secondary goal is to have nonlinear solver files be independent of      A secondary goal is to have nonlinear solver files be independent of
47   *  all the compiler directory files except ascmalloc.h.      all the compiler directory files except ascmalloc.h.
48   *  The present fly in the ointment is expr.h because of the objective fcns.      The present fly in the ointment is expr.h because of the objective fcns.
49   *  The relman and exprman modules go away because they are indicative of      The relman and exprman modules go away because they are indicative of
50   *  functionality that belongs either in the compiler or rel.c.      functionality that belongs either in the compiler or rel.c.
51   *  If we meet this goal, then it is a simple matter to connect any      If we meet this goal, then it is a simple matter to connect any
52   *  arbitrary compiler backend to the solver API by replacing the rel      arbitrary compiler backend to the solver API by replacing the rel
53   *  and var and analyze modules.      and var and analyze modules.
54   *  
55   *  Requires:      Requires:
56   *         #include "utilities/ascConfig.h"             #include "utilities/ascConfig.h"
57   *         #include "system.h"             #include "system.h"
58   *         #include "instance_enum.h"             #include "instance_enum.h"
59   *  </pre>      </pre>
60   */  */
61    
62  #ifndef _analyze_h_seen_  #ifndef ASC_ANALYZE_H
63  #define _analyze_h_seen_  #define ASC_ANALYZE_H
64    
65  /** Used to give an integer value to each symbol used in a when */  /** Used to give an integer value to each symbol used in a when */
66  struct SymbolValues {  struct SymbolValues {
# Line 70  struct SymbolValues { Line 70  struct SymbolValues {
70    
71  extern int analyze_make_problem(slv_system_t sys, struct Instance *inst);  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.      Takes a system and populates the guts of it from the instance.
74   *  this implementation of analyze is specific to the ascend compiler  
75   *  back end.      @NOTE
76   */          This implementation of analyze is specific to the ascend compiler
77            back end.
78    */
79    
80    #if 0 /* NOT IMPLEMENTED */
81  extern int analyze_remake_problem(slv_system_t sys);  extern int analyze_remake_problem(slv_system_t sys);
82  /**<  /*
83   * Reanalyzes the system, reordering solvers var and relation lists      Reanalyzes the system, reordering solvers var and relation lists
84   * if needed.      if needed.
85   * @todo Not implemented.  Remove from header if not needed.      
86   */      @todo Not implemented.  Remove from header if not needed.
87    */
88    #endif
89    
90  extern void analyze_free_reused_mem(void);  extern void analyze_free_reused_mem(void);
91  /**<  /**<
92   * Resets all internal memory recycles.      Resets all internal memory recycles.
93   */  */
94    
95  extern int varinst_found_in_whenlist(slv_system_t sys, struct Instance *inst);  extern int varinst_found_in_whenlist(slv_system_t sys, struct Instance *inst);
96  /**<  /**<
97   * Determine if the conditional variable inst is part of the      Determine if the conditional variable inst is part of the
98   * variable list of some when in the when list of slv_system_t      variable list of some when in the when list of slv_system_t
99   */  */
100    
101  extern int dis_var_in_a_when(struct Instance *var, struct w_when *when);  extern int dis_var_in_a_when(struct Instance *var, struct w_when *when);
102  /**<  /**<
103   * Return 1 if the discrete var is a member of the when var list, else      Return 1 if the discrete var is a member of the when var list, else
104   * return 0      return 0
105   */  */
106    
107  extern int GetIntFromSymbol(CONST char *symval, struct gl_list_t *symbol_list);  extern int GetIntFromSymbol(CONST char *symval, struct gl_list_t *symbol_list);
108  /**<  /**<
109   * Creates the gl_list of SymboValues struct to asign an integer      Creates the gl_list of SymboValues struct to asign an integer
110   * value to a symbol value      value to a symbol value
111   */  */
112    
113  extern void DestroySymbolValuesList(struct gl_list_t *symbol_list);  extern void DestroySymbolValuesList(struct gl_list_t *symbol_list);
114  /**<  /**<
115   * Destroy the gl_list of SymbolValues struct created to asign an integer      Destroy the gl_list of SymbolValues struct created to asign an integer
116   * value to symbol value      value to symbol value
117   */  */
   
 #endif /*  _analyze_h_seen_ */  
118    
119    #endif /* ASC_ANALYZE_H */

Legend:
Removed from v.218  
changed lines
  Added in v.219

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