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

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

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

revision 1575 by jpye, Mon Jul 23 14:30:35 2007 UTC revision 1576 by jpye, Sun Aug 5 09:44:07 2007 UTC
# Line 70  const SlvFunctionsT *solver_engine(const Line 70  const SlvFunctionsT *solver_engine(const
70      const struct gl_list_t *L = solver_get_engines();      const struct gl_list_t *L = solver_get_engines();
71      int i;      int i;
72      const SlvFunctionsT *S, *Sfound=NULL;      const SlvFunctionsT *S, *Sfound=NULL;
73        /* CONSOLE_DEBUG("Searching for solver #%d in list of %d solvers",number,gl_length(L)); */
74      for(i=1; i <= gl_length(L); ++i){      for(i=1; i <= gl_length(L); ++i){
75          S = gl_fetch(L,i);          S = gl_fetch(L,i);
76            /* CONSOLE_DEBUG("Looking at %s (%d)",S->name,S->number); */
77          if(S->number==number){          if(S->number==number){
78                /* CONSOLE_DEBUG("Match!"); */
79              Sfound = S;              Sfound = S;
80              break;              break;
81          }          }
82      }      }
83        /* CONSOLE_DEBUG("Returning %d",Sfound); */
84      return Sfound;      return Sfound;
85  }  }
86    
# Line 121  int slv_lookup_client(const char *name){ Line 125  int slv_lookup_client(const char *name){
125          return S->number;          return S->number;
126      }else{      }else{
127          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Invalid engine name '%s'",name);          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Invalid engine name '%s'",name);
128          return 1;          return -1;
129      }      }
130  }  }
131    
# Line 376  int slv_select_solver(slv_system_t sys,i Line 380  int slv_select_solver(slv_system_t sys,i
380      return -1;      return -1;
381    }    }
382    
383    CONSOLE_DEBUG("CHECKING FOR SOLVER %d", solver);    /* CONSOLE_DEBUG("CHECKING FOR SOLVER %d", solver); */
384    
385    if(solver_engine(solver)){    if(solver_engine(solver)){
386      CONSOLE_DEBUG("SOLVER FOUND");      /* CONSOLE_DEBUG("SOLVER FOUND"); */
387      if(sys->ct != NULL && solver != sys->solver){      if(sys->ct != NULL && solver != sys->solver){
388        CONSOLE_DEBUG("DIFFERENT SOLVER");        /* CONSOLE_DEBUG("DIFFERENT SOLVER"); */
389        //CONSOLE_DEBUG("g_SlvNumberOfRegisteredClients = %d, sys->solver = %d", g_SlvNumberOfRegisteredClients, sys->solver);        //CONSOLE_DEBUG("g_SlvNumberOfRegisteredClients = %d, sys->solver = %d", g_SlvNumberOfRegisteredClients, sys->solver);
390        asc_assert(sys->solver >= -1);        asc_assert(sys->solver >= -1);
391        //asc_assert(g_SlvNumberOfRegisteredClients > 0);        //asc_assert(g_SlvNumberOfRegisteredClients > 0);
# Line 397  int slv_select_solver(slv_system_t sys,i Line 401  int slv_select_solver(slv_system_t sys,i
401        }        }
402      }      }
403    
404      CONSOLE_DEBUG("PREVIOUS SOLVER IS CLEAR");      /* CONSOLE_DEBUG("PREVIOUS SOLVER IS CLEAR"); */
405    
406      if(sys->ct != NULL) {      if(sys->ct != NULL) {
407        CONSOLE_DEBUG("CURRENT SOLVER UNCHANGED");        CONSOLE_DEBUG("CURRENT SOLVER UNCHANGED");
# Line 445  int slv_switch_solver(slv_system_t sys,i Line 449  int slv_switch_solver(slv_system_t sys,i
449      return -1;      return -1;
450    }    }
451    
452    CONSOLE_DEBUG("CHECKING FOR SOLVER %d", solver);    /* CONSOLE_DEBUG("CHECKING FOR SOLVER %d", solver); */
453    
454    if(solver_engine(solver)){    if(solver_engine(solver)){
455      status_index = solver;      status_index = solver;

Legend:
Removed from v.1575  
changed lines
  Added in v.1576

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