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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 521 - (show annotations) (download) (as text)
Fri Apr 21 05:35:59 2006 UTC (14 years, 9 months ago) by johnpye
File MIME type: text/x-chdr
File size: 24466 byte(s)
Getting the modular version the Tcl/Tk GUI working. In progress.
1 /* ASCEND modelling environment
2 Copyright (C) 1990 Karl Michael Westerberg
3 Copyright (C) 1993 Joseph Zaher
4 Copyright (C) 1994 Joseph Zaher, Benjamin Andrew Allan
5 Copyright (C) 2006 Carnegie Mellon University
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
21 *//**
22 @file
23 Variable module of the SLV solver.
24
25 This is the ascend version of the var module. This
26 version should be used by any user who receives his/her
27 equations indirectly from an instance tree created by the
28 ASCEND compiler.
29
30 The idea of a var makes no sense outside the context of
31 a slv_system_t, so some of the functions here may require
32 the passing of a slv_system_t with the var.
33
34 06/90 - original version
35 01/94 - added var_make_name() to create a copy of the
36 instance name
37 04/94 - added var_apply_filter() which uses the new
38 var_filter_t data structure for perfoming all
39 variable filtering needs (eliminating the
40 filter module)
41 08/94 - added var_BackendTokens_to_vars. BAA.
42
43 Requires:
44 #include <stdio.h>
45 #include "utilities/ascConfig.h"
46 #include "solver/slv_types.h"
47
48 @TODO
49 At present there is some insanity about asking the instance tree
50 vs asking our data structure about the flag values - This needs to
51 be fixed (see longer BAA comment in solver/var.h).
52 *//*
53 Authors: Karl Westerberg and Joseph Zaher
54 Version: $Revision: 1.26 $
55 Date last modified: $Date: 1998/03/30 22:07:10 $
56 Last modified by: $Author: rv2a $
57 */
58
59 #ifndef ASC_VAR_H
60 #define ASC_VAR_H
61
62 #include <utilities/ascConfig.h>
63
64 /*
65 The first section of flagbit definitions are those flags to be
66 set by the server. Clients should not mess with them unless
67 they are very, very smart.
68 */
69 #define VAR_REAL 0x1
70 /**< don't know what this is good for. */
71 #define VAR_INCIDENT 0x2
72 /**< is this variable incident on some equation in the slv_system? */
73 #define VAR_PVAR 0x4
74 /**< do we think this var a 'solver_par'? */
75 #define VAR_SVAR 0x8
76 /**< do we think this var a 'solver_var'? */
77 #define VAR_INTEGER 0x10
78 /**< do we think this var a solver_integer? */
79 #define VAR_BINARY 0x20
80 /**< do we think this var a solver_binary? */
81 #define VAR_SEMICONT 0x40
82 /**< do we think this var a solver_semi(continuous) ? */
83
84 /*
85 The remaining flagbit definitions are those flags to be
86 manipulated by registered clients. Unregistered clients
87 should not change these bits unless the manner in which
88 they affect the bits is explained in the header for the
89 unregistered client.
90 */
91
92 #define VAR_PARAM 0x1000
93 /**< is this variable considered parametric currently? */
94 #define VAR_FIXED 0x2000
95 /**< is this variable considered fixed currently? */
96 #define VAR_INBLOCK 0x4000
97 /**< is this var in the columns of the block we are currently solving? */
98 #define VAR_INTERFACE 0x8000
99 /**< is this var an interface var currently? */
100 #define VAR_RELAXED 0x10000
101 /**< is this var currently a relaxed int or binary or semi var? */
102 #define VAR_ACTIVE 0x20000
103 /**< is this var currently a part of my problem? */
104 #define VAR_NONBASIC 0x40000
105 /**< is this var currently an independent variable (optimization)? */
106 #define VAR_ACTIVE_AT_BND 0x80000
107 /**< is this var active in some of the subregions neighboring the
108 boundary on which the problem currently lies ? */
109 #define VAR_ELIGIBLE 0x100000
110 /**< is this variable eligible to be fixed (globally)? */
111 #define VAR_ELIGIBLE_IN_SUBREGION 0x200000
112 /**< is this variable eligible to be fixed (in current subregion) ? */
113 #define VAR_POTENTIALLY_FIXED 0x400000
114 /**< this bit is auxiliar while iteratively and recurively we are
115 performing a combinatorial search, looking for a consitent
116 partition for all the alternatives in an conditional model */
117 #define VAR_INCIDENT_IN_CASE 0x800000
118 /**< is this variable incident in some relation of a CASE in a
119 WHEN statement ?. This is for purposes of simplfying the
120 analysis of conditional models */
121
122 /**
123 Variable structure.
124 Finally, we have a real structure so that we aren't hanging stuff
125 of the global instance tree. Do not dereference this structure except
126 via macros/functions, because we make no commitments about being
127 backward compatible with such code.
128
129 struct Instance * and struct var_variable * are no longer synonymous!
130 */
131 struct var_variable {
132 SlvBackendToken ratom; /**< the associated ascend ATOM */
133 struct rel_relation **incidence; /**< array rels which contain var */
134 int32 n_incidences; /**< length of incidence. */
135 int32 sindex; /**< index in the solver clients list (often column index) */
136 int32 mindex; /**< index in the slv_system_t master list */
137 uint32 flags; /**< batch of binary flags. The bit positions are as above */
138 };
139
140 /** Variable filter structure */
141 typedef struct var_filter_structure {
142 uint32 matchbits; /**< Bits to match. */
143 uint32 matchvalue; /**< Value to match. */
144 } var_filter_t;
145 /**< Variable filter type */
146
147 #define var_NO_UPPER_BOUND MAXDOUBLE
148 #define var_NO_LOWER_BOUND (-MAXDOUBLE/2)
149
150 #ifdef NDEBUG
151 # define var_instance(var) ((var)->ratom)
152 #else
153 # define var_instance(var) var_instanceF(var)
154 #endif
155 /**<
156 Returns the ATOM instance associated with the variable.
157 @param var const struct var_variable *, the variable to query.
158 @return Returns the instance as a SlvBackendToken.
159 @see var_instanceF()
160 */
161
162 #ifdef NDEBUG
163 # define var_set_instance(var,inst) ((var)->ratom = (inst))
164 #else
165 # define var_set_instance(var,inst) var_set_instanceF((var),(inst))
166 #endif
167 /**<
168 Sets the ATOM instance associated with the variable.
169 @param var struct var_variable *, the variable to modify.
170 @param inst SlvBackendToken, the new instance value.
171 @return No return value.
172 @see var_instanceF()
173 */
174
175 ASC_DLLSPEC(SlvBackendToken) var_instanceF(const struct var_variable *var);
176 /**<
177 Implementation function for var_instance(). Do not call this
178 function directly - use var_instance() instead.
179 */
180 extern void var_set_instanceF(struct var_variable *var, SlvBackendToken i);
181 /**<
182 Implementation function for var_set_instance(). Do not call this
183 function directly - use var_set_instance() instead.
184 */
185
186 extern char *var_make_xname(const struct var_variable *var);
187 /**<
188 Returns the index name, eg x23 rather than full name.
189 See var_make_name() for more information.
190 */
191 ASC_DLLSPEC(char*) var_make_name(
192 const slv_system_t sys,
193 const struct var_variable *var
194 );
195 /**<
196 Creates and returns a sufficiently large string storing the
197 qualified name of var as known by the solver instance tree.
198 If the instance is not found, "?" is returned. The string
199 should be destroyed when no longer in use.<br><br>
200
201 The name of a var is context dependent, so you have to provide the
202 slv_system_t from which you got the var.
203 */
204
205 ASC_DLLSPEC(void) var_write_name(const slv_system_t sys,
206 const struct var_variable *var,
207 FILE *file);
208 /**<
209 Writes a name to the file given. Handles NULL inputs gracefully.
210 Does not print any whitespace, including carriage returns.
211 Is faster than slv_print_var_name().
212 If sys is NULL, writes full ascend name. If file or var is NULL
213 does not write.
214 */
215
216 void var_destroy(struct var_variable *var);
217 /**<
218 Since someone else allocates vars en masse, this just sets
219 our integrity check to ERROR.
220 */
221
222 #ifdef NDEBUG
223 # define var_mindex(var) (var)->mindex
224 #else
225 # define var_mindex(var) var_mindexF(var)
226 #endif
227 /**<
228 Returns the index of the variable as it appears in a variable list.
229 The index is also used to assign the variable to a specific
230 original column of a matrix.
231 @param var const struct var_variable *, the variable to query.
232 @return Returns the index as an int32.
233 @see var_mindexF().
234 */
235
236 #ifdef NDEBUG
237 # define var_set_mindex(var,index) (var)->mindex = (index)
238 #else
239 # define var_set_mindex(var,index) var_set_mindexF((var),(index))
240 #endif
241 /**<
242 Sets the index of the variable as it appears in a variable list.
243 @param var struct var_variable *, the variable to modify.
244 @param index int32, the new value for the index.
245 @return No return value.
246 @see var_set_mindexF().
247 */
248
249 extern int32 var_mindexF(const struct var_variable *var);
250 /**<
251 Implementation function for var_mindex(). Do not call this
252 function directly - use var_mindex() instead.
253 */
254 extern void var_set_mindexF(struct var_variable *var, int32 index);
255 /**<
256 Implementation function for var_set_mindex(). Do not call this
257 function directly - use var_set_mindex() instead.
258 */
259
260 #ifdef NDEBUG
261 # define var_sindex(var) (var)->sindex
262 #else
263 # define var_sindex(var) var_sindexF(var)
264 #endif
265 /**<
266 Returns the index of the variable as it appears in a solvers
267 variable list. The index is also used to assign the variable
268 to a specific original column of a matrix.
269 @param var const struct var_variable *, the variable to query.
270 @return Returns the index as an int32.
271 @see var_sindexF().
272 */
273
274 #ifdef NDEBUG
275 # define var_set_sindex(var,index) (var)->sindex = (index)
276 #else
277 # define var_set_sindex(var,index) var_set_sindexF((var),(index))
278 #endif
279 /**<
280 Sets the index of the variable as it appears in a solver's
281 variable list.
282 @param var struct var_variable *, the variable to modify.
283 @param index int32, the new value for the index.
284 @return No return value.
285 @see var_set_sindexF().
286 */
287
288 ASC_DLLSPEC(int32) var_sindexF(const struct var_variable *var);
289 /**<
290 Implementation function for var_sindex(). Do not call this
291 function directly - use var_sindex() instead.
292 */
293 extern void var_set_sindexF(struct var_variable *var, int32 index);
294 /**<
295 Implementation function for var_set_sindex(). Do not call this
296 function directly - use var_set_sindex() instead.
297 */
298
299 ASC_DLLSPEC(real64) var_value(const struct var_variable *var);
300 /**< Returns the value of the variable. */
301 extern void var_set_value(struct var_variable *var, real64 value);
302 /**<
303 Sets the value of the variable.
304 */
305
306 ASC_DLLSPEC(real64) var_nominal(struct var_variable *var);
307 /**< Returns the nominal value of the variable, or 1.0 if it has none. */
308 extern void var_set_nominal(struct var_variable *var, real64 nominal);
309 /**<
310 Sets the nominal value of the variable.
311 If no nominal field in var, returns 1.0.
312 */
313
314 ASC_DLLSPEC(real64) var_lower_bound(struct var_variable *var);
315 /**< Returns the lower bound value of the variable. */
316 extern void var_set_lower_bound(struct var_variable *var, real64 lower_bound);
317 /**<
318 Sets the lower bound value of the variable.
319 */
320
321 ASC_DLLSPEC(real64) var_upper_bound(struct var_variable *var);
322 /**< Returns the upper bound value of the variable. */
323 extern void var_set_upper_bound(struct var_variable *var, real64 upper_bound);
324 /**<
325 Gets/sets the upper bound value of the variable.
326 */
327
328 #ifdef NDEBUG
329 # define var_n_incidences(var) ((var)->n_incidences)
330 #else
331 # define var_n_incidences(var) var_n_incidencesF(var)
332 #endif
333 /**<
334 Returns the length of the incidence list.
335 Not everything in the incidence list is necessarily a
336 variable for your particular solver -- check the flags.
337 @param var const struct var_variable *, the variable to query.
338 @return Returns the index as an int32.
339 @see var_n_incidencesF().
340 */
341
342 #ifdef NDEBUG
343 # define var_set_incidences(var,n,ilist) \
344 (var)->n_incidences=(n); (var)->incidence = (ilist)
345 #else
346 # define var_set_incidences(var,n,ilist) var_set_incidencesF((var),(n),(ilist))
347 #endif
348 /**<
349 Sets the incidence list for a variable.
350 Solver clients should not call var_set_incidences(). It is
351 only for use by constructors of bridges to varation back ends.
352 @param var struct var_variable *, the variable to query.
353 @param n int32, length of the new incidence list.
354 @param ilist struct rel_relation **, the new incidence list.
355 @return No return value.
356 @see var_set_incidencesF().
357 */
358
359 extern int32 var_n_incidencesF(struct var_variable *var);
360 /**<
361 Implementation function for var_n_incidences(). Do not call this
362 function directly - use var_n_incidences() instead.
363 */
364 extern void var_set_incidencesF(struct var_variable *var,
365 int32 n,
366 struct rel_relation **ilist);
367 /**<
368 Implementation function for var_set_incidences(). Do not call this
369 function directly - use var_set_incidences() instead.
370 */
371
372 extern struct rel_relation
373 **var_incidence_list_to_modify(struct var_variable *var);
374 /**< Same as var_incidence_list(), except the returned list is modifiable. */
375 extern const struct rel_relation **var_incidence_list(struct var_variable *var);
376 /**<
377 Returns a pointer to an array var_n_incidences(var) long of vars.
378 Each element of the array is a struct rel_relation *.
379 Check the var sindex to see where each might go in a jacobian.
380 If there is no incidence, NULL is returned.
381 Pointers in this array will be unique.
382 The list belongs to the varation. Do not destroy it. Do not change it.<br><br>
383
384 RA IS NOT a NULL-TERMINATED LIST.
385 */
386
387 #ifdef NDEBUG
388 # define var_flags(var) ((var)->flags)
389 #else
390 # define var_flags(var) var_flagsF(var)
391 #endif
392 /**<
393 Returns the flags field of the var. This flags value should
394 be composed of the var_xxx values defined above.
395 @param var const struct var_variable *, the variable to query.
396 @return Returns the index as an int32.
397 @see var_flagsF().
398 */
399
400 #ifdef NDEBUG
401 # define var_set_flags(var,flags) ((var)->flags = (flags))
402 #else
403 # define var_set_flags(var,flags) var_set_flagsF((var),(flags))
404 #endif
405 /**<
406 Sets the entire flag field to the value of flags given.
407 This flags value should be composed of the var_xxx values
408 defined above.
409 @param var struct var_variable *, the variable to query.
410 @param flags uint32, the new flags value.
411 @return No return value.
412 @see var_set_flagsF().
413 */
414
415 ASC_DLLSPEC(uint32) var_flagsF(const struct var_variable *var);
416 /**<
417 Implementation function for var_flags(). Do not call this
418 function directly - use var_flags() instead.
419 */
420 extern void var_set_flagsF(struct var_variable *var, uint32 flags);
421 /**<
422 Implementation function for var_set_flags(). Do not call this
423 function directly - use var_set_flags() instead.
424 */
425
426 ASC_DLLSPEC(uint32) var_flagbit(const struct var_variable *rel, const uint32 name);
427 /**<
428 Returns the value of the bit specified from the variable flags.
429 name should be a VAR_xx flag defined above.
430 */
431
432 extern void var_set_flagbit(struct var_variable *var,
433 uint32 NAME,
434 uint32 oneorzero);
435 /**<
436 Sets the bit, which should be referred to by its macro name,
437 on if oneorzero is >0 and off is oneorzero is 0.
438 The macro names are the defined up at the top of this file.<br><br>
439
440 Example: var_set_flags(var,VAR_PARTITION,1) turns on the
441 VAR_PARTITION bit.
442 <pre>
443 What it really does is:
444 if (oneorzero) {
445 var->flags |= field;
446 } else {
447 var->flags &= ~field;
448 }
449 </pre>
450 */
451
452 /*
453 * At present there is some insanity about asking the instance tree
454 * vs asking our data structure about the flag values. This needs to
455 * be fixed. In the process of that fix, we should establish a
456 * protocol that means vars/rels never need to look back at ATOM
457 * instances to be queried during the solution process. Rather, we
458 * need to establish a process in which the var list tells all its
459 * atoms about the solver derived values or the var list updates
460 * its values and flags from the instance tree.
461 * There is a counterpart exercise that needs to go on in the
462 * rel module so that (for remote processing) it is possible to
463 * do everything without looking back at the instance tree.
464 * At present, we will always keep VAR_FIXED in sync with the
465 * instance tree, but the instance tree is the leader.
466 * 6/96. baa
467 */
468
469 extern int32 var_apply_filter(const struct var_variable *var,
470 const var_filter_t *filter);
471 /**<
472 Returns 1 if filter and var flags are compatible, 0 elsewise.
473 See the filter description in rel.h. This is exactly the same.
474 */
475
476 extern uint32 var_fixed(struct var_variable *var);
477 /**< Returns the fixed flag of var. Has side effects in the ascend instance. */
478 extern void var_set_fixed(struct var_variable *var, uint32 fixed);
479 /**< Sets the fixed flag of var. Has side effects in the ascend instance. */
480 extern uint32 var_relaxed(struct var_variable *var);
481 /**< Returns the relaxed flag of var. Has side effects in the ascend instance. */
482 extern void var_set_relaxed(struct var_variable *var, uint32 fixed);
483 /**< Sets the relaxed flag of var. Has side effects in the ascend instance. */
484 extern uint32 var_interface(struct var_variable *var);
485 /**< Returns the interface flag of var. Has side effects in the ascend instance. */
486 extern void var_set_interface(struct var_variable *var, uint32 fixed);
487 /**< Sets the interface flag of var. Has side effects in the ascend instance.
488 @todo solver/var.h: var_set_interface() not implemented. Implement or remove.
489 */
490 /*
491 The above... Gets/sets the fixed/relaxed/interface flag of the variable. This
492 has side effects in the ascend instance, with which
493 we are keeping the bits in sync.
494 */
495
496 #ifdef NDEBUG
497 # define var_in_block(var) ((var)->flags & VAR_INBLOCK)
498 /**< Returns the in_block flag of var as a uint32. */
499 # define var_incident(var) ((var)->flags & VAR_INCIDENT)
500 /**< Returns the incident flag of var as a uint32. */
501
502 # define var_active(var) ((var)->flags & VAR_ACTIVE)
503 /**< Returns the active flag of var as a uint32. */
504 # define var_nonbasic(var) ((var)->flags & VAR_NONBASIC)
505 /**< Returns the nonbasic flag of var as a uint32. */
506 # define var_active_at_bnd(var) ((var)->flags & VAR_ACTIVE_AT_BND)
507 /**< Returns the active_at_bnd flag of var as a uint32. */
508 # define var_eligible(var) ((var)->flags & VAR_ELIGIBLE)
509 /**< Returns the eligible flag of var as a uint32. */
510 # define var_eligible_in_subregion(var) ((var)->flags & VAR_ELIGIBLE_IN_SUBREGION)
511 /**< Returns the eligible_in_subregion flag of var as a uint32. */
512 # define var_incident_in_case(var) ((var)->flags & VAR_INCIDENT_IN_CASE)
513 /**< Returns the incident_in_case flag of var as a uint32. */
514 # define var_potentially_fixed(var) ((var)->flags & VAR_POTENTIALLY_FIXED)
515 /**< Returns the potentially_fixed flag of var as a uint32. */
516 #else
517 # define var_in_block(var) var_flagbit((var),VAR_INBLOCK)
518 /**< Returns the in_block flag of var as a uint32. */
519
520 # define var_incident(var) var_flagbit((var),VAR_INCIDENT)
521 /**< Returns the incident flag of var as a uint32. */
522 # define var_active(var) var_flagbit((var),VAR_ACTIVE)
523 /**< Returns the active flag of var as a uint32. */
524 # define var_nonbasic(var) var_flagbit((var),VAR_NONBASIC)
525 /**< Returns the nonbasic flag of var as a uint32. */
526 # define var_active_at_bnd(var) var_flagbit((var),VAR_ACTIVE_AT_BND)
527 /**< Returns the active_at_bnd flag of var as a uint32. */
528 # define var_eligible(var) var_flagbit((var),VAR_ELIGIBLE)
529 /**< Returns the eligible flag of var as a uint32. */
530 # define var_eligible_in_subregion(var) var_flagbit((var),VAR_ELIGIBLE_IN_SUBREGION)
531 /**< Returns the eligible_in_subregion flag of var as a uint32. */
532 # define var_incident_in_case(var) var_flagbit((var),VAR_INCIDENT_IN_CASE)
533 /**< Returns the incident_in_case flag of var as a uint32. */
534 # define var_potentially_fixed(var) var_flagbit((var),VAR_POTENTIALLY_FIXED)
535 /**< Returns the potentially_fixed flag of var as a uint32. */
536 #endif /* NDEBUG */
537
538 #define var_set_in_block(var,oneorzero) \
539 var_set_flagbit((var),VAR_INBLOCK,(oneorzero))
540 /**< Sets the in_block flag of var on (1) or off (0). */
541 #define var_set_incident(var,oneorzero) \
542 var_set_flagbit((var),VAR_INCIDENT,(oneorzero))
543 /**< Sets the incident flag of var on (1) or off (0). */
544 #define var_set_interface(var,oneorzero) \
545 var_set_flagbit((var),VAR_INTERFACE,(oneorzero))
546 /**< Sets the interface flag of var on (1) or off (0). */
547 #define var_set_active(var,oneorzero) \
548 var_set_flagbit((var),VAR_ACTIVE,(oneorzero))
549 /**< Sets the active flag of var on (1) or off (0). */
550 #define var_set_nonbasic(var,oneorzero) \
551 var_set_flagbit((var),VAR_NONBASIC,(oneorzero))
552 /**< Sets the nonbasic flag of var on (1) or off (0). */
553 #define var_set_active_at_bnd(var,oneorzero) \
554 var_set_flagbit((var),VAR_ACTIVE_AT_BND,(oneorzero))
555 /**< Sets the active_at_bnd flag of var on (1) or off (0). */
556 #define var_set_eligible(var,oneorzero) \
557 var_set_flagbit((var),VAR_ELIGIBLE,(oneorzero))
558 /**< Sets the eligible flag of var on (1) or off (0). */
559 #define var_set_eligible_in_subregion(var,oneorzero) \
560 var_set_flagbit((var),VAR_ELIGIBLE_IN_SUBREGION,(oneorzero))
561 /**< Sets the eligible_in_subregion flag of var on (1) or off (0). */
562 #define var_set_incident_in_case(var,oneorzero) \
563 var_set_flagbit((var),VAR_INCIDENT_IN_CASE,(oneorzero))
564 /**< Sets the incident_in_case flag of var on (1) or off (0). */
565 #define var_set_potentially_fixed(var,oneorzero) \
566 var_set_flagbit((var),VAR_POTENTIALLY_FIXED,(oneorzero))
567 /**< Sets the potentially_fixed flag of var on (1) or off (0). */
568
569 extern struct var_variable **
570 var_BackendTokens_to_vars(slv_system_t sys, SlvBackendToken *tokenlist, int32 len);
571 /**<
572 varp is NULL iff something is amiss, OTHERWISE it
573 contains len struct var_variable * s.
574 The user should free the array varp when done with it.
575 Some entries in the array varp may be NULL if the tokenlist
576 contains a token which is not from the sys given.
577 tokenlist[i] <--> varp[i];<br><br>
578
579 The whole point of a slv_system_t is to isolate the client from
580 the compiler backend. Clients who find themselves in need of
581 this function are very much in need of rethinking as well.
582 For that reason, among others, this function is not heavily
583 optimized, it is however reasonable for 1-off jobs.<br><br>
584
585 CPU Cost = k1*complexity of the instance under sys +
586 k2*number of vars in sys + k3*len.
587
588 @todo Hasn't been through verification and testing - SQA asleep.
589 */
590
591 /*
592 * What constitutes a solver_var (and some other interesting types)
593 * is controlled by the ascend server via the following functions.
594 * Clients shouldn't use these.
595 */
596
597 #define SOLVER_VAR_STR "solver_var"
598 #define SOLVER_INT_STR "solver_int"
599 #define SOLVER_BINARY_STR "solver_binary"
600 #define SOLVER_SEMI_STR "solver_semi"
601
602 #define solver_par(i) (0)
603
604 extern boolean solver_var(SlvBackendToken inst);
605 /**<
606 Returns true if the instance in question matches the currently
607 known definition of solver_var. Since these definitions
608 involve refinement, solver_var() will report TRUE on variables
609 matching any of these types:
610 - solver_var
611 - solver_int
612 - solver_binary
613 - solver_semi
614
615 SERVER ONLY. clients should just look at the flagbits.
616 */
617 extern boolean solver_int(SlvBackendToken inst);
618 /**<
619 Returns true if the instance in question matches the currently
620 known definition of solver_int.
621 SERVER ONLY. clients should just look at the flagbits.
622 */
623 extern boolean solver_binary(SlvBackendToken inst);
624 /**<
625 Returns true if the instance in question matches the currently
626 known definition of solver_binary.
627 SERVER ONLY. clients should just look at the flagbits.
628 */
629 extern boolean solver_semi(SlvBackendToken inst);
630 /**<
631 Returns true if the instance in question matches the currently
632 known definition of solver_semi.
633 SERVER ONLY. clients should just look at the flagbits.
634 */
635 /* For the above...
636 Note that these definitions involve refinement, so
637 solver_var will report TRUE on variables matching any of
638 these types, while solver_binary will only be TRUE on binaries.
639
640 hierarchy is solvervar-\----solver_int-----solver_binary
641 \-solver_semi
642
643 */
644
645 extern boolean set_solver_types(void);
646 /**<
647 Sets (changes) the current definition of solver_var to match
648 the current library. Returns 1 if unsuccessful, 0 if ok.
649 If 1, it is useless to invoke the solvers.
650 Also sets all the related types listed above.
651 */
652
653 #endif /* ASC_VAR_H */
654

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