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

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

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

revision 730 by johnpye, Tue Jul 4 05:03:59 2006 UTC revision 731 by johnpye, Tue Jul 4 07:42:06 2006 UTC
# Line 2230  static int analyze_make_solvers_lists(st Line 2230  static int analyze_make_solvers_lists(st
2230    */    */
2231    vlen = gl_length(p_data->vars);    vlen = gl_length(p_data->vars);
2232    for (v = 0; v < vlen; v++) {    for (v = 0; v < vlen; v++) {
2233      CONSOLE_DEBUG("VAR %d",v);      /* CONSOLE_DEBUG("VAR %d",v); */
2234      var = &(p_data->vardata[v]);      var = &(p_data->vardata[v]);
2235      vip = SIP(gl_fetch(p_data->vars,v+1));      vip = SIP(gl_fetch(p_data->vars,v+1));
2236      vip->u.v.data = var;      vip->u.v.data = var;
# Line 2244  static int analyze_make_solvers_lists(st Line 2244  static int analyze_make_solvers_lists(st
2244      if (vip->u.v.fixed)     flags |= VAR_FIXED;      if (vip->u.v.fixed)     flags |= VAR_FIXED;
2245      if (!vip->u.v.basis)    flags |= VAR_NONBASIC;      if (!vip->u.v.basis)    flags |= VAR_NONBASIC;
2246      if (vip->u.v.solvervar) flags |= VAR_SVAR;      if (vip->u.v.solvervar) flags |= VAR_SVAR;
2247      CONSOLE_DEBUG("VAR %p IS IN BLOCK",var);      /* CONSOLE_DEBUG("VAR %p IS IN BLOCK",var); */
2248      var_set_flags(var,flags);      var_set_flags(var,flags);
2249      p_data->mastervl[v] = var;      p_data->mastervl[v] = var;
2250      p_data->solvervl[v] = var;      p_data->solvervl[v] = var;
# Line 2292  static int analyze_make_solvers_lists(st Line 2292  static int analyze_make_solvers_lists(st
2292      if (vip->u.v.incident)  flags |= VAR_INCIDENT;      if (vip->u.v.incident)  flags |= VAR_INCIDENT;
2293      if (vip->u.v.fixed)     flags |= VAR_FIXED;      if (vip->u.v.fixed)     flags |= VAR_FIXED;
2294      if (vip->u.v.solvervar) flags |= VAR_SVAR;      if (vip->u.v.solvervar) flags |= VAR_SVAR;
2295      CONSOLE_DEBUG("VAR AT %p IS UNASSIGNED",var);      /* CONSOLE_DEBUG("VAR AT %p IS UNASSIGNED",var); */
2296      /* others may be appropriate (PVAR) */      /* others may be appropriate (PVAR) */
2297      var_set_flags(var,flags);      var_set_flags(var,flags);
2298      p_data->masterul[v] = var;      p_data->masterul[v] = var;
# Line 2318  static int analyze_make_solvers_lists(st Line 2318  static int analyze_make_solvers_lists(st
2318      gut = GetInstanceRelationOnly(rip->i);      gut = GetInstanceRelationOnly(rip->i);
2319      assert(gut!=NULL);      assert(gut!=NULL);
2320      len = NumberVariables(gut);      len = NumberVariables(gut);
2321      CONSOLE_DEBUG("FOR REL INSTANCE AT %p, NUM INCID VARS= %d",rip->i, len);      /* CONSOLE_DEBUG("FOR REL INSTANCE AT %p, NUM INCID VARS= %d",rip->i, len); */
2322      if (len > 0) {      if (len > 0) {
2323        incidence = get_incidence_space(len,p_data);        incidence = get_incidence_space(len,p_data);
2324        for( c = 0; c < len; c++ ) {        for( c = 0; c < len; c++ ) {
2325          i = RelationVariable(gut,c+1);          i = RelationVariable(gut,c+1);
2326          CONSOLE_DEBUG("INCIDENCE OF REL INSTANCE %p WITH VAR %p",rip->i,i);          /* CONSOLE_DEBUG("INCIDENCE OF REL INSTANCE %p WITH VAR %p",rip->i,i); */
2327          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;
2328        }        }
2329        CONSOLE_DEBUG("SETTING INCIDENCES FOR CONSTRAINING REL");        /* CONSOLE_DEBUG("SETTING INCIDENCES FOR CONSTRAINING REL"); */
2330        rel_set_incidences(rel,len,incidence);        rel_set_incidences(rel,len,incidence);
2331      } else {      } else {
2332        rel_set_incidences(rel,0,NULL);        rel_set_incidences(rel,0,NULL);
# Line 2337  static int analyze_make_solvers_lists(st Line 2337  static int analyze_make_solvers_lists(st
2337          rel_set_extcache(rel,cache);          rel_set_extcache(rel,cache);
2338          extrel_store_output_var(rel);          extrel_store_output_var(rel);
2339        }else{        }else{
2340          CONSOLE_DEBUG("rip = %p, rip->i = %p",rip,rip->i);          /* CONSOLE_DEBUG("rip = %p, rip->i = %p",rip,rip->i); */
2341          cache = CreateCacheFromInstance(rip->i);          cache = CreateCacheFromInstance(rip->i);
2342          CONSOLE_DEBUG("cache = %p",cache);          /* CONSOLE_DEBUG("cache = %p",cache); */
2343          gl_append_ptr(p_data->extrels,(POINTER)cache);          gl_append_ptr(p_data->extrels,(POINTER)cache);
2344          rel_set_extcache(rel,cache);          rel_set_extcache(rel,cache);
2345          extrel_store_input_vars(rel);          extrel_store_input_vars(rel);
# Line 2401  static int analyze_make_solvers_lists(st Line 2401  static int analyze_make_solvers_lists(st
2401          i = RelationVariable(gut,c+1);          i = RelationVariable(gut,c+1);
2402          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;
2403        }        }
2404        CONSOLE_DEBUG("SETTING INCIDENCES FOR OBJECTIVE FN REL");        /* CONSOLE_DEBUG("SETTING INCIDENCES FOR OBJECTIVE FN REL"); */
2405        rel_set_incidences(rel,len,incidence);        rel_set_incidences(rel,len,incidence);
2406      } else {      } else {
2407        rel_set_incidences(rel,0,NULL);        rel_set_incidences(rel,0,NULL);
# Line 2448  static int analyze_make_solvers_lists(st Line 2448  static int analyze_make_solvers_lists(st
2448          i = RelationVariable(gut,c+1);          i = RelationVariable(gut,c+1);
2449          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;          incidence[c] = SIP(GetInterfacePtr(i))->u.v.data;
2450        }        }
2451        CONSOLE_DEBUG("SETTING INCIDENCES FOR CONDITIONAL REL");        /* CONSOLE_DEBUG("SETTING INCIDENCES FOR CONDITIONAL REL"); */
2452        rel_set_incidences(rel,len,incidence);        rel_set_incidences(rel,len,incidence);
2453      } else {      } else {
2454        rel_set_incidences(rel,0,NULL);        rel_set_incidences(rel,0,NULL);

Legend:
Removed from v.730  
changed lines
  Added in v.731

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