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

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

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

revision 300 by johnpye, Wed Nov 30 16:31:29 2005 UTC revision 301 by johnpye, Mon Feb 20 07:39:14 2006 UTC
# Line 124  struct rel_relation { Line 124  struct rel_relation {
124  extern struct rel_relation *rel_create(SlvBackendToken instance,  extern struct rel_relation *rel_create(SlvBackendToken instance,
125                                         struct rel_relation *rel);                                         struct rel_relation *rel);
126  /**<  /**<
  *  <!--  rel_create(instance,rel)                                     -->  
  *  <!--  rel = rel_create(instance,NULL)                              -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  SlvBackendToken instance;                                    -->  
  *  
127   *  Creates a relation given the relation instance.   *  Creates a relation given the relation instance.
128   *  If the rel supplied is NULL, we allocate the memory for the   *  If the rel supplied is NULL, we allocate the memory for the
129   *  rel we return, else we just init the memory you hand us and   *  rel we return, else we just init the memory you hand us and
# Line 143  extern struct rel_relation *rel_create(S Line 138  extern struct rel_relation *rel_create(S
138    
139  extern void rel_destroy(struct rel_relation *rel);  extern void rel_destroy(struct rel_relation *rel);
140  /**<  /**<
  *  <!--  rel_destroy(rel)                                             -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
141   *  Destroys a relation.   *  Destroys a relation.
142   */   */
143    
144  extern void rel_write_name(slv_system_t sys, struct rel_relation *rel, FILE *file);  extern void rel_write_name(slv_system_t sys, struct rel_relation *rel, FILE *file);
145  /**<  /**<
  *  <!--  rel_write_name(sys,rel,file);                                -->  
146   *  Writes a name to the file given. Handles NULL inputs gracefully.   *  Writes a name to the file given. Handles NULL inputs gracefully.
147   *  Does not print any whitespace, including carriage returns.   *  Does not print any whitespace, including carriage returns.
148   *  Is faster than slv_print_var_name.   *  Is faster than slv_print_var_name.
# Line 168  typedef struct rel_filter_structure { Line 159  typedef struct rel_filter_structure {
159    
160  extern SlvBackendToken rel_instance(struct rel_relation *rel);  extern SlvBackendToken rel_instance(struct rel_relation *rel);
161  /**<  /**<
  *  <!--  rel_instance(rel)                                            -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
162   *  Returns the instance pointer from a rel.   *  Returns the instance pointer from a rel.
163   */   */
164    
# Line 179  extern void rel_set_extnodeinfo(struct r Line 167  extern void rel_set_extnodeinfo(struct r
167  /**< Sets the external node information structure for a relation. */  /**< Sets the external node information structure for a relation. */
168  extern struct rel_extnode *rel_extnodeinfo(struct rel_relation *rel);  extern struct rel_extnode *rel_extnodeinfo(struct rel_relation *rel);
169  /**<  /**<
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  struct rel_extnode *nodeinfo;                                -->  
  *  
  *  <!--  struct rel_extnode *nodeinfo = rel_extnodeinfo(rel);         -->  
  *  <!--  rel_set_extnodeinfo(rel,nodeinfo);                           -->  
170   *  Fetches the pointer to the external node information structure for   *  Fetches the pointer to the external node information structure for
171   *  a relation. If this is NULL, which will be the case for most   *  a relation. If this is NULL, which will be the case for most
172   *  relations, then there are no external call nodes present.   *  relations, then there are no external call nodes present.
# Line 193  extern void rel_set_extwhichvar(struct r Line 176  extern void rel_set_extwhichvar(struct r
176  /**< Sets the argument list index for a relation having external nodes. */  /**< Sets the argument list index for a relation having external nodes. */
177  extern int32 rel_extwhichvar(struct rel_relation *rel);  extern int32 rel_extwhichvar(struct rel_relation *rel);
178  /**<  /**<
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  int32 whichvar;                                              -->  
  *  
179   *  Returns the index into the argument list from which rel was   *  Returns the index into the argument list from which rel was
180   *  constructed.  This applies ONLY to rels that have external nodes !   *  constructed.  This applies ONLY to rels that have external nodes !
181   *  Relations that have external nodes have associated with them an   *  Relations that have external nodes have associated with them an
# Line 247  extern boolean rel_greater(struct rel_re Line 227  extern boolean rel_greater(struct rel_re
227    
228  extern enum rel_enum rel_relop(struct rel_relation *rel);  extern enum rel_enum rel_relop(struct rel_relation *rel);
229  /**<  /**<
  * <!--  relop = rel_relop(rel);                                       -->  
  * <!--  rel_enum relop;                                               -->  
  * <!--  struct rel_relation *rel;                                     -->  
230   * Returns the type of the relational operator of a given relation.   * Returns the type of the relational operator of a given relation.
231   */   */
232    
233  extern char *rel_make_name(slv_system_t sys, struct rel_relation *rel);  extern char *rel_make_name(slv_system_t sys, struct rel_relation *rel);
234  /**<  /**<
  *  <!--  name = rel_make_name(sys,rel)                                -->  
  *  <!--  slv_system_t sys;                                            -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  char *name;                                                  -->  
  *  
235   *  Copies of the relation instance name can be made and returned.   *  Copies of the relation instance name can be made and returned.
236   *  The string returned should be freed when no longer in use.   *  The string returned should be freed when no longer in use.
237   */   */
# Line 271  extern int32 rel_mindex(struct rel_relat Line 243  extern int32 rel_mindex(struct rel_relat
243   */   */
244  extern void rel_set_mindex(struct rel_relation *rel, int32 index);  extern void rel_set_mindex(struct rel_relation *rel, int32 index);
245  /**<  /**<
  *  <!--  index = rel_mindex(rel)                                      -->  
  *  <!--  rel_set_mindex(rel,index)                                    -->  
  *  <!--  int32 index;                                                 -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
246   *  Sets the index number of the given relation as it   *  Sets the index number of the given relation as it
247   *  appears in a slv_system_t master relation list.   *  appears in a slv_system_t master relation list.
248   */   */
# Line 288  extern int32 rel_sindex(const struct rel Line 255  extern int32 rel_sindex(const struct rel
255   */   */
256  extern void rel_set_sindex(struct rel_relation *rel, int32 index);  extern void rel_set_sindex(struct rel_relation *rel, int32 index);
257  /**<  /**<
  *  <!--  index = rel_sindex(rel)                                      -->  
  *  <!--  rel_set_sindex(rel,index)                                    -->  
  *  <!--  int32 index;                                                 -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
258   *  Sets the index number of the given relation as it   *  Sets the index number of the given relation as it
259   *  appears in a solvers relation list. The index is most often used   *  appears in a solvers relation list. The index is most often used
260   *  to assign the relation to a specific original row of a matrix.   *  to assign the relation to a specific original row of a matrix.
# Line 306  extern int32 rel_model(const struct rel_ Line 268  extern int32 rel_model(const struct rel_
268   */   */
269  extern void rel_set_model(struct rel_relation *rel, int32 index);  extern void rel_set_model(struct rel_relation *rel, int32 index);
270  /**<  /**<
  *  <!--  index = rel_model(rel)                                       -->  
  *  <!--  rel_set_model(rel,index) //SERVER ONLY                       -->  
  *  <!--  int32 index;                                                 -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
271   *  Sets the model number of the given relation.   *  Sets the model number of the given relation.
272   *  In a hierarchy, relations come in groups associated with   *  In a hierarchy, relations come in groups associated with
273   *  models. Models are numbered from 1 to some upper limit.   *  models. Models are numbered from 1 to some upper limit.
# Line 325  extern real64 rel_residual(struct rel_re Line 282  extern real64 rel_residual(struct rel_re
282   */   */
283  extern void rel_set_residual(struct rel_relation *rel, real64 residual);  extern void rel_set_residual(struct rel_relation *rel, real64 residual);
284  /**<  /**<
  *  <!--  residual = rel_residual(rel)                                 -->  
  *  <!--  rel_set_residual(rel,residual)                               -->  
  *  <!--  real64 residual;                                             -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
285   *  Sets the residual field of the given relation.   *  Sets the residual field of the given relation.
286   */   */
287    
288  extern real64 rel_nominal(struct rel_relation *rel);  extern real64 rel_nominal(struct rel_relation *rel);
289  /**<  /**<
  *  <!--  nominal = rel_nominal(rel)                                   -->  
  *  <!--  real64 nominal;                                              -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
290   *  Retrieves the nominal field of the given relation.   *  Retrieves the nominal field of the given relation.
291   *  No slv client has any business being able to set the nominal,   *  No slv client has any business being able to set the nominal,
292   *  so no such operator is provided.   *  so no such operator is provided.
# Line 421  extern struct var_variable Line 369  extern struct var_variable
369   */   */
370  extern const struct var_variable **rel_incidence_list(struct rel_relation *rel);  extern const struct var_variable **rel_incidence_list(struct rel_relation *rel);
371  /**<  /**<
  *  <!--  va = rel_incidence_list(rel)                                 -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  struct var_variable **va;                                    -->  
  *  
372   *  Returns a pointer to an array rel_n_incidences(rel) long of vars.   *  Returns a pointer to an array rel_n_incidences(rel) long of vars.
373   *  Each element of the array is a struct var_variable *.   *  Each element of the array is a struct var_variable *.
374   *  Check the var sindex to see where each might go in a jacobian.   *  Check the var sindex to see where each might go in a jacobian.
# Line 446  extern const struct var_variable **rel_i Line 390  extern const struct var_variable **rel_i
390  extern int32 rel_apply_filter(const struct rel_relation *rel,  extern int32 rel_apply_filter(const struct rel_relation *rel,
391                                rel_filter_t *filter);                                rel_filter_t *filter);
392  /**<  /**<
  *  <!--  value = rel_apply_filter(rel,filter)                         -->  
  *  <!--  int32 value;                                                 -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  rel_filter_t *filter;                                        -->  
  *  
393   *  Returns 1 only if all of the positions specified in   *  Returns 1 only if all of the positions specified in
394   *  filter->matchbits have the same values in   *  filter->matchbits have the same values in
395   *  filter->matchvalue and the relation's flags value.   *  filter->matchvalue and the relation's flags value.
# Line 474  extern uint32 rel_flags(struct rel_relat Line 413  extern uint32 rel_flags(struct rel_relat
413   */   */
414  extern void rel_set_flags(struct rel_relation *rel, uint32 flags);  extern void rel_set_flags(struct rel_relation *rel, uint32 flags);
415  /**<  /**<
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  uint32 flags;                                                -->  
  *  
  *  <!--  rel_flags(rel) returns the flags field of the relation.      -->  
416   *  Sets the entire flag field to the value of flags given.   *  Sets the entire flag field to the value of flags given.
417   */   */
418    
419  extern uint32 rel_flagbit(struct rel_relation *rel, uint32 name);  extern uint32 rel_flagbit(struct rel_relation *rel, uint32 name);
420  /**<  /**<
  *  <!--  rel_flagbit(rel,name);                                       -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  uint32 name;                                                     -->  
421   *  Returns the value of the bit specified from the relation flags.   *  Returns the value of the bit specified from the relation flags.
422   *  name should be a REL_xx flag defined above)   *  name should be a REL_xx flag defined above)
423   */   */
# Line 493  extern uint32 rel_flagbit(struct rel_rel Line 425  extern uint32 rel_flagbit(struct rel_rel
425  extern void rel_set_flagbit(struct rel_relation *rel,  extern void rel_set_flagbit(struct rel_relation *rel,
426                              uint32 NAME, uint32 oneorzero);                              uint32 NAME, uint32 oneorzero);
427  /**<  /**<
  *  <!--  struct rel_relation *rel;                                    -->  
  *  <!--  uint32 NAME,oneorzero;                                       -->  
  *  <!--  rel_set_flagbit(rel,NAME,oneorzero)                          -->  
  *  
428   *  Sets the bit, which should be referred to by its macro name,   *  Sets the bit, which should be referred to by its macro name,
429   *  on if oneorzero is >0 and off is oneorzero is 0.   *  on if oneorzero is >0 and off is oneorzero is 0.
430   *  The macro names are the defined up at the top of this file.   *  The macro names are the defined up at the top of this file.
# Line 679  extern uint32 rel_included(struct rel_re Line 607  extern uint32 rel_included(struct rel_re
607   */   */
608  extern void rel_set_included(struct rel_relation *rel, uint32 included);  extern void rel_set_included(struct rel_relation *rel, uint32 included);
609  /**<  /**<
  *  <!--  included = rel_included(rel)                                 -->  
  *  <!--  rel_set_included(rel,included)                               -->  
  *  <!--  uint32 included;                                             -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
610   *  Sets the included field of the given relation.   *  Sets the included field of the given relation.
611   *  <!--  This has side effect on the ascend instance, so it isn't     -->   *  <!--  This has side effect on the ascend instance, so it isn't     -->
612   *  <!--  implemented with the rest of the macros above. This needs to -->   *  <!--  implemented with the rest of the macros above. This needs to -->
# Line 739  extern real64 rel_multiplier(struct rel_ Line 662  extern real64 rel_multiplier(struct rel_
662  extern void rel_set_multiplier(struct rel_relation *rel, real64 multiplier);  extern void rel_set_multiplier(struct rel_relation *rel, real64 multiplier);
663  /**<  /**<
664   *  (<!--  won a temporary reprieve. this should be a system property, not rel.) -->   *  (<!--  won a temporary reprieve. this should be a system property, not rel.) -->
  *  <!--  multiplier = rel_multiplier(rel)                             -->  
  *  <!--  rel_set_multiplier(rel,multiplier)                           -->  
  *  <!--  real64 multiplier;                                           -->  
  *  <!--  struct rel_relation *rel;                                    -->  
  *  
665   *  Sets the multiplier field of the given relation.   *  Sets the multiplier field of the given relation.
666   *  This is expected to be computed as a lagrange multiplier which will   *  This is expected to be computed as a lagrange multiplier which will
667   *  relate the gradient of the relation rel with that of some objective   *  relate the gradient of the relation rel with that of some objective

Legend:
Removed from v.300  
changed lines
  Added in v.301

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