/[ascend]/trunk/tcltk98/generic/interface/DebugProc.h
ViewVC logotype

Annotation of /trunk/tcltk98/generic/interface/DebugProc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations) (download) (as text)
Fri Oct 29 20:54:12 2004 UTC (17 years, 7 months ago) by aw0a
Original Path: trunk/ascend4/interface/DebugProc.h
File MIME type: text/x-chdr
File size: 18587 byte(s)
Setting up web subdirectory in repository
1 aw0a 1 /*
2     * DebugProc.h
3     * by Kirk Abbott and Ben Allan
4     * Created: 1/94
5     * Version: $Revision: 1.14 $
6     * Version control file: $RCSfile: DebugProc.h,v $
7     * Date last modified: $Date: 2003/08/23 18:43:05 $
8     * Last modified by: $Author: ballan $
9     *
10     * This file is part of the ASCEND Tcl/Tk interface
11     *
12     * Copyright 1997, Carnegie Mellon University
13     *
14     * The ASCEND Tcl/Tk interface is free software; you can redistribute
15     * it and/or modify it under the terms of the GNU General Public License as
16     * published by the Free Software Foundation; either version 2 of the
17     * License, or (at your option) any later version.
18     *
19     * The ASCEND Tcl/Tk interface is distributed in hope that it will be
20     * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22     * General Public License for more details.
23     *
24     * You should have received a copy of the GNU General Public License
25     * along with the program; if not, write to the Free Software Foundation,
26     * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
27     * COPYING. COPYING is found in ../compiler.
28     */
29    
30     #ifndef DebugProc_module_loaded
31     #define DebugProc_module_loaded
32    
33    
34     /*
35     * To include this header, you must include the following:
36     * #include "tcl.h"
37     * #include "interface/DebugProc.h"
38     */
39    
40    
41     extern int Asc_DebuGetBlkOfVar(ClientData cdata, Tcl_Interp *interp,
42     int argc, CONST84 char *argv[]);
43     /*
44     * dbg_get_blk_of_var varindex
45     * returns "none" if var is not in a partition (not assigned included)
46     * returns tclerror if var isn't in system
47     * returns block # that var is in from C structure
48     * assumes g_solvsys_cur exists.
49     * var_block wrapper
50     */
51    
52     extern int Asc_DebuGetBlkOfEqn(ClientData cdata, Tcl_Interp *interp,
53     int argc, CONST84 char *argv[]);
54     /*
55     * dbg_get_blk_of_eqn eqnindex
56     * returns "none" if eqn is not in a partition (not assigned included)
57     * returns tclerror if eqn isn't in system
58     * returns block # that eqn is in from C structure
59     * assumes g_solvsys_cur exists.
60     * rel_block wrapper
61     */
62    
63     extern int Asc_DebuGetBlkCoords(ClientData cdata, Tcl_Interp *interp,
64     int argc, CONST84 char *argv[]);
65     /*
66     * dbg_get_blk_coords blocknumber
67     * returns "none" if block is not a partition
68     * returns collo rowlo colhi rowhi from C structure
69     * assumes g_solvsys_cur exists.
70     * mtx_block wrapper
71     */
72    
73     extern int Asc_DebuGetEqnOfVar(ClientData cdata, Tcl_Interp *interp,
74     int argc, CONST84 char *argv[]);
75     /*
76     * call is: dbg_get_eqn_of_var varindex
77     * returns "none" if var is not assigned (fixed or not incident)
78     * returns tclerror if var isn't in system
79     * returns eqn # that var is assigned to from C structure
80     * assumes g_solvsys_cur. not yet working. needs some linsol.
81     */
82    
83     extern int Asc_DebuGetVarPartition(ClientData cdata, Tcl_Interp *interp,
84     int argc, CONST84 char *argv[]);
85     /*
86     * return a / and space delimited list of the variables in the system.
87     * / separates partitions, space separates var #s. There's a trailing
88     * / at end.
89     * no args
90     */
91    
92     extern int Asc_DebuGetEqnPartition(ClientData cdata, Tcl_Interp *interp,
93     int argc, CONST84 char *argv[]);
94     /*
95     * return a / and space delimited list of the equations in the system.
96     * / separates partitions, space separates eqn #s. There's a trailing
97     * / at end.
98     * no args
99     */
100    
101     extern int Asc_DebuListRels(ClientData cdata, Tcl_Interp *interp,
102     int argc, CONST84 char *argv[]);
103     /*
104     * return the C index list of rels matching the simple filter specified
105     * no filter --> usage message,error
106     * not all of filter.h is yet supported.
107     * unrecognized filters return an error.
108     * tcl call: dbg_list_rels <filtercode> [anything]
109     * any argument in the anything position cause negation of the filter
110     */
111    
112     extern int Asc_DebuListVars(ClientData cdata, Tcl_Interp *interp,
113     int argc, CONST84 char *argv[]);
114     /*
115     * return the C index list of vars matching the simple filter specified
116     * no filter --> usage message,error
117     * unrecognized filters return an error.
118     * tcl call: dbg_list_vars <filtercode> [anything]
119     * an argument in the anything position cause negation of the filter
120     * Note: solvers which do not partition do not assign, e.g. minos
121     * leaves all variables 'unassigned.'
122     */
123    
124     extern int Asc_DebuWriteVar(ClientData cdata, Tcl_Interp *interp,
125     int argc, CONST84 char *argv[]);
126     /*
127     * writes a real variable given:
128     * 1) output device; stderr stdout or interp (0,1,2)
129     * 2) it's C index number
130     * 3) with detail level: 0 name 1 val 2 dims 3 var# 4 fixedflag
131     * 5 lower_bound 6 nominal 7 upper_bound
132     * 4) the selection of the master list or
133     * solvers list of variables. 0 is solver list, 1 is master.
134     * 5) with optional string prepended to the qlfdid
135     *
136     * Name returned is qualified id from root instance g_solvinst_root.
137     * The string is not prepended to the interp qlfdid,
138     * an ampersand marks the root and should be edited in tcl before
139     * displaying the result. interp is returned as a list
140     * tcl call is: dbg_write_var out# Cindex detail# [string]
141     * If cdata 1,uses g_browsys_cur instead of g_solvsys_cur
142     */
143    
144    
145     extern int Asc_DebuWriteUnattachedVar(ClientData cdata, Tcl_Interp *interp,
146     int argc, CONST84 char *argv[]);
147     /*
148     * registered as: dbg_write_unattvar
149     *
150     * It is not assumed anymore that the unattached variables are in the
151     * solver list of variables. There is a specific list now ofr this
152     * nonincident variables.
153     *
154     * Writes the list of unattached variables to stderr stdout or interp
155     * (0,1,2)
156     * Name returned is qualified id from root instance g_solvinst_root
157     * The string is not prepended to the interp qlfdid,
158     * an ampersand marks the root and should be edited in tcl before
159     * displaying the result. interp is returned as a list
160     * tcl call is: dbg_write_var out# [simname]
161     * If cdata 1,uses g_browsys_cur instead of g_solvsys_cur
162     */
163    
164    
165     extern int Asc_DebuWriteRel(ClientData cdata, Tcl_Interp *interp,
166     int argc, CONST84 char *argv[]);
167     /*
168     * writes a relation to stderr stdout or interp (0,1,2)
169     * given it's C index number
170     * with detail level 0 name 1 resid 2 rel# 3 include flag
171     * cumulative.
172     * If detail level is 4, only the relation itself is written/returned.
173     * Name returned is qualified id from root instance g_solvinst_root.
174     * The string is not prepended to the interp qlfdid,
175     * an ampersand marks the root and should be edited in tcl before
176     * displaying the result. interp is returned as a list
177     * tcl call is: dbg_write_rel <out> <Cindex> <detail> [string]
178     * If cdata 1,uses g_browsys_cur instead of g_solvsys_cur.
179     * SIDE EFFECTS: updates the residual of the relation examined.
180     * bugs: detail level is not exactly analogous to write_Var
181     * does not trap fp exceptions.
182     */
183    
184     extern int Asc_DebuWriteObj(ClientData cdata, Tcl_Interp *interp,
185     int argc, CONST84 char *argv[]);
186     /*
187     * same as Debu_Write_Rel except applies to objective relations
188     */
189    
190     extern int Asc_DebuWriteVarAttr(ClientData cdata, Tcl_Interp *interp,
191     int argc, CONST84 char *argv[]);
192     /*
193     * dual registration as dbg_write_varattr & dbg_write_qlfattr
194     *
195     * call is: dbg_write_varattr <Cindex> (cdata==0)
196     * writes a solver_var instance including some ip properties
197     * given it's C index number in a list:
198     * atom type, dims, value, shortest qlfdid, ip data items
199     * atom children and values.
200     * current ip data items are var.index, var.incident, and var.in_block
201     *
202     * call is: dbg_write_qlfattr <qlfdid> (cdata==1)
203     * As dbg_write_varattr except takes qlfdid and
204     * if ip is null (var has never been to solver) ip data will be -1
205     *
206     * if something is amiss with the inst, returns nothing and TCL_ERROR.
207     */
208    
209     extern int Asc_DebuRelIncluded(ClientData cdata, Tcl_Interp *interp,
210     int argc, CONST84 char *argv[]);
211     extern int Asc_DebuVarFixed(ClientData cdata, Tcl_Interp *interp,
212     int argc, CONST84 char *argv[]);
213     /*
214     * dbg_rel_included <index>
215     * returns 1 if rel included flag set true, 0 if not.
216     * dbg_var_fixed <index>
217     * returns 1 if var fixed flag set true, 0 if not.
218     * These calls are used primarily for speed in the incidence matrix
219     * construction. The normal rel and var queries give more useful
220     * information in most cases.
221     */
222    
223     extern int Asc_DebuGetIncidence(ClientData cdata, Tcl_Interp *interp,
224     int argc, CONST84 char *argv[]);
225     /*
226     * returns the list of indexes of variables occuring in the relation
227     * index given. Uses NumberVaribles and RelationVariable routines to
228     * determine incidence, so it does not rely on a specific solver to set
229     * incidence flags. Uses the rel and var lists from g_solvsys_cur.
230     */
231    
232     extern int Asc_DebuGetOrder(ClientData cdata, Tcl_Interp *interp,
233     int argc, CONST84 char *argv[]);
234     /*
235     * TCL: dbg_get_order <row,col>
236     * return the list of original indexes as found running
237     * along the mtx of the current system's linsol_sys.
238     * will be relation indexes if arg is row. will be var indexes if col
239     */
240    
241     extern int Asc_DebuWriteIncidence(ClientData cdata, Tcl_Interp *interp,
242     int argc, CONST84 char *argv[]);
243     /*
244     * dumps the incidence matrix from slv
245     * dbg_write_incidence <dest> 0= stdout 1 = stderr 2= list
246     */
247    
248     extern int Asc_DebuFindEligible(ClientData cdata, Tcl_Interp *interp,
249     int argc, CONST84 char *argv[]);
250     /*
251     * dbg_find_eligible <dest> 0= stdout 1 = stderr 2= list
252     * Operates on g_solvsys_cur
253     * Output will be a list of indexes of the eligible variables
254     * that if fixed reduce the excess column count of the system.
255     * This list will be enclosed in {} so the output of the function is
256     * always a 1 item list whose first item is the list of indices.
257     * The DOF solver will do its own presolve, so our DOF analysis may
258     * not line up with an arbitrary clients.
259     * The list may come back empty if appropriate.
260     */
261    
262     extern int Asc_DebuConsistencyAnalysis(ClientData cdata, Tcl_Interp *interp,
263     int argc, CONST84 char *argv[]);
264     /*
265     * dbg_consistency_analysis <dest> 0= stdout 1 = stderr 2= list
266     *
267     * Operates on g_solvsys_cur
268     *
269     * Output will a set of indices of the variables , which, if fixed, will
270     * result in all the alternatives of a conditional model being square and
271     * structurally consistent.
272     * This list will be enclosed in {} so the output of the function is
273     * always a 1 item list whose first item is the list of indices.
274     * The list may come back empty if appropriate.
275     */
276    
277     extern int Asc_DebuFindGlobalEligible(ClientData cdata, Tcl_Interp *interp,
278     int argc, CONST84 char *argv[]);
279     /*
280     * dbg_global_eligible <dest> 0= stdout 1 = stderr 2= list
281     * Operates on g_solvsys_cur
282     * Output will be a list of indexes of the eligible variables
283     * that if fixed reduce the excess column count of the system. The
284     * resulting set is of eligible variables consistent will all the
285     * alternatives in a conditional model.
286     * This list will be enclosed in {} so the output of the function is
287     * always a 1 item list whose first item is the list of indices.
288     * The list may come back empty if appropriate.
289     */
290    
291     extern int Asc_DebuInstEligible(ClientData cdata, Tcl_Interp *interp,
292     int argc, CONST84 char *argv[]);
293     /*
294     * brow_find_eligible <dest> 0= stdout 1 = stderr 2= list
295     * Operates on newly made g_browsys_cur made from curinst
296     * and destroys g_browsys_cur when done, leaving it NULL.
297     * Output will be a list of indexes of the eligible variables
298     * that if fixed reduce the excess column count of the system.
299     * This list will be enclosed in {} so the output of the function is
300     * always a 1 item list whose first item is the list of indices.
301     * The list may come back empty if appropriate.
302     * if dest is 0 or 1, output wil be names instead of indices.
303     */
304    
305     extern int Asc_DebuFindActive(ClientData cdata, Tcl_Interp *interp,
306     int argc, CONST84 char *argv[]);
307     /*
308     * dbg_find_activerels <dest> 0= stdout 1 = stderr 2= list
309     * Operates on g_solvsys_cur
310     * Output will be a list of indexes of the active relations in the
311     * system.
312     * This list will be enclosed in {} so the output of the function is
313     * always a 1 item list whose first item is the list of indices.
314     */
315    
316     extern int Asc_DebuInstActive(ClientData cdata, Tcl_Interp *interp,
317     int argc, CONST84 char *argv[]);
318     /*
319     * brow_find_activerels <dest> 0= stdout 1 = stderr 2= list
320     * Operates on newly made g_browsys_cur made from curinst
321     * and destroys g_browsys_cur when done, leaving it NULL.
322     * Output will be a list of indexes of the active relations
323     * of the system.
324     * This list will be enclosed in {} so the output of the function is
325     * always a 1 item list whose first item is the list of indices.
326     * if dest is 0 or 1, output wil be names instead of indices.
327     */
328    
329     extern int Asc_DebuNumBlockSing(ClientData cdata, Tcl_Interp *interp,
330     int argc, CONST84 char *argv[]);
331     /*
332     * dbg_num_block_singular <dest> 0= stdout 1 = stderr 2= interp
333     * <block #> <row,col>
334     * output will be a list(or lists):
335     * {index {eqn coef} {eqn coef}}
336     * where index is the index of an unpivoted relation and the set of
337     * eqn coef pairs is the linear combination that contribute.
338     * Interpretation of the coefs (how small is zero?) is left to tcl.
339     * Dependency will be done with rows or colums as specified.
340     * The lists may come back empty if appropriate.
341     * Works only for Slv, since no other solver is currently blocking.
342     */
343    
344     extern int Asc_DebuStructSing(ClientData cdata, Tcl_Interp *interp,
345     int argc, CONST84 char *argv[]);
346     /*
347     * dbg_struct_singular <dest> 0= stdout 1 = stderr 2= list <relindex>
348     * relindex should be the index of an unassigned but included row, or
349     * -1 if you want the total cause of all singular rows.
350     * output will be a list of indexes of the responsible relations
351     * and a list of indexes of the vars in the singularity(s)
352     * and a list of vars that reduce singularity if freed.
353     * if dest is 0 or 1, list will be names instead of indices.
354     * The lists may come back empty if appropriate.
355     */
356    
357     extern int Asc_DebuVarFree2Nom(ClientData cdata, Tcl_Interp *interp,
358     int argc, CONST84 char *argv[]);
359     /*
360     * moves all free vars in current solve system to their nominal values.
361     * This is basically a crash recovery call. Vars must also be incident.
362     * registered as var_free2nom <no args>
363     */
364    
365     extern int Asc_DebuVarNom2Free(ClientData cdata, Tcl_Interp *interp,
366     int argc, CONST84 char *argv[]);
367     /*
368     * moves all free vars nominals in current solve system to var values.
369     * Vars must also be incident.
370     * registered as var_nom2free <no args>
371     */
372    
373     extern int Asc_DebuCheckRelFp(ClientData cdata, Tcl_Interp *interp,
374     int argc, CONST84 char *argv[]);
375     /*
376     * returns a list which is
377     * {{index lstat rstat dlstat drstat} ...}
378     * There is a quintuplet for each relation in the current solver list
379     * which produces a float or calc_ok error.
380     * lstat rstat reflect any problems evaluating the function l/rhs
381     * dl/rstat reflect any problems evaluating the derivatives of l/rhs
382     * A stat flag of 0 -> ok, 1 -> exception.
383     * Bugs: dlstat, drstat are not currently implemented: always 0.
384     */
385    
386     extern int Asc_DebuCalcRelNominals(ClientData cdata, Tcl_Interp *interp,
387     int argc, CONST84 char *argv[]);
388     /*
389     * returns a list which is
390     * {{index lstat rstat nom} ...}
391     * There is a quintuplet for each relation in the current solver list
392     * which produces a float or calc_ok error.
393     * lstat rstat reflect any problems evaluating the function l/rhs
394     * A stat flag of 1 -> !calc_ok. 2 -> float error. 0->ok
395     * nom is the nominal the relation was left with after the error.
396     */
397    
398     extern int Asc_DebuWriteSystem(ClientData cdata, Tcl_Interp *interp,
399     int argc, CONST84 char *argv[]);
400     /*
401     * write a system description suitable for a standalone slv0 to the
402     * file given. destroys anything in the file if it already exists.
403     * All values will be in internal units (si)
404     * Bugs: doesn't deal with bnds.
405     */
406    
407     extern int Asc_DebuWriteKirkSystem(ClientData cdata, Tcl_Interp *interp,
408     int argc, CONST84 char *argv[]);
409     extern int Asc_DebuWriteGAMSSystem(ClientData cdata, Tcl_Interp *interp,
410     int argc, CONST84 char *argv[]);
411    
412     /* KAA_DEBUG */
413     extern int Asc_DebuMtxCalcJacobianCmd(ClientData cdata, Tcl_Interp *interp,
414     int argc, CONST84 char *argv[]);
415     /*
416     * Usage dbg_calc_jacobian whichsolver.
417     * At the moment which solver must be an int which is the index of
418     * the solver. Only slv5 is now supported.
419     * The jacobian is calculated at the current point.
420     */
421    
422     extern int Asc_DebuMtxWritePlotCmd(ClientData cdata, Tcl_Interp *interp,
423     int argc, CONST84 char *argv[]);
424     /*
425     * write a mtx to the named file:
426     * Usage: __debug_mtxwriteplot file type fmt
427     * where file is an openable file name or path/filename,
428     * type is 'coeff' (coefficient) or anything else (inverse),
429     * fmt is the file format to use ('mtx','smms','plot','csr').
430     * Trashes the file if the name already exists.
431     * smms, plot, and csr uses the symbolic rank to determine the size
432     * of the region to write.
433     * mtx writes the entire matrix.
434     * a lot smarter.
435     * Features: Deals only with solvers which can produce an mtx.
436     * Missing Features: Does not accept a block no.
437     * Does not accept a set of region coordinates.
438     * WARNINGS:
439     * This is not a command for use in a production interface -- in
440     * particular solvers are not and should not be in the habit of exposing
441     * their factorized matrices to casual users.
442     */
443    
444     extern int Asc_DebuHelpList(ClientData cdata, Tcl_Interp *interp,
445     int argc, CONST84 char *argv[]);
446     /*
447     * dbghelp command for tcl
448     * dbghelp [s,l]
449     * no arg -> return tcl list
450     * "s" -> list names only, "l" -> short explanations also, to stderr
451     */
452    
453     #endif

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