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

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

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

revision 197 by johnpye, Thu Jan 19 07:59:19 2006 UTC revision 198 by johnpye, Thu Jan 19 08:14:26 2006 UTC
# Line 1267  struct gl_list_t *slv_get_symbol_list(sl Line 1267  struct gl_list_t *slv_get_symbol_list(sl
1267    return sys->symbollist;    return sys->symbollist;
1268  }  }
1269    
1270    #define DEFINE_SOLVERS_GET_NUM_METHOD(TYPE) \
1271        int slv_get_num_solvers_##TYPE(slv_system_t sys){ \
1272            if(sys==NULL){ \
1273                ERROR_REPORTER_NOLINE(ASC_PROG_ERR,"slv_get_num_solvers_" #TYPE " called with NULL system."); \
1274                return 0; \
1275            } \
1276            return sys->TYPE.snum; \
1277        }
1278    
1279    #define DEFINE_MASTER_GET_NUM_METHOD(TYPE) \
1280        int slv_get_num_master_##TYPE(slv_system_t sys){ \
1281            if(sys==NULL){ \
1282                ERROR_REPORTER_NOLINE(ASC_PROG_ERR,"slv_get_num_master_" #TYPE " called with NULL system."); \
1283                return 0; \
1284            } \
1285            return sys->TYPE.mnum; \
1286        }
1287    
1288    #define DEFINE_SLV_METHODS(D) \
1289        D(vars) \
1290        D(pars) \
1291        D(unattached) \
1292        D(dvars) \
1293        D(disunatt) \
1294        D(rels) \
1295        D(condrels) \
1296        D(objs) \
1297        D(logrels) \
1298        D(condlogrels) \
1299        D(whens) \
1300        D(bnds)
1301    
1302  int slv_get_num_solvers_vars(slv_system_t sys)  DEFINE_SLV_METHODS(DEFINE_SOLVERS_GET_NUM_METHOD)
1303  {  DEFINE_SLV_METHODS(DEFINE_MASTER_GET_NUM_METHOD)
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_vars called with NULL system.\n");  
     return 0;  
   }  
   return sys->vars.snum;  
 }  
   
   
 int slv_get_num_solvers_pars(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_pars called with NULL system.\n");  
     return 0;  
   }  
   return sys->pars.snum;  
 }  
   
 int slv_get_num_solvers_unattached(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_unattached called with NULL system.\n");  
     return 0;  
   }  
   return sys->unattached.snum;  
 }  
   
 int slv_get_num_solvers_dvars(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_dvars called with NULL system.\n");  
     return 0;  
   }  
   return sys->dvars.snum;  
 }  
   
 int slv_get_num_solvers_disunatt(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_disunatt called with NULL system.\n");  
     return 0;  
   }  
   return sys->disunatt.snum;  
 }  
   
   
 int slv_get_num_solvers_rels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_rels called with NULL system.\n");  
     return 0;  
   }  
   return sys->rels.snum;  
 }  
   
   
 int slv_get_num_solvers_condrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_condrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->condrels.snum;  
 }  
   
 int slv_get_num_solvers_objs(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_objs called with NULL system.\n");  
     return 0;  
   }  
   return sys->objs.snum;  
 }  
   
 int slv_get_num_solvers_logrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_logrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->logrels.snum;  
 }  
   
 int slv_get_num_solvers_condlogrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_condlogrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->condlogrels.snum;  
 }  
   
 int slv_get_num_solvers_whens(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_whens called with NULL system.\n");  
     return 0;  
   }  
   return sys->whens.snum;  
 }  
   
 int slv_get_num_solvers_bnds(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_solvers_bnds called with NULL system.\n");  
     return 0;  
   }  
   return sys->bnds.snum;  
 }  
   
 int slv_get_num_master_vars(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_vars called with NULL system.\n");  
     return 0;  
   }  
   return sys->vars.mnum;  
 }  
   
   
 int slv_get_num_master_pars(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_pars called with NULL system.\n");  
     return 0;  
   }  
   return sys->pars.mnum;  
 }  
 int slv_get_num_master_unattached(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_unattached called with NULL system.\n");  
     return 0;  
   }  
   return sys->unattached.mnum;  
 }  
   
 int slv_get_num_master_dvars(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_dvars called with NULL system.\n");  
     return 0;  
   }  
   return sys->dvars.mnum;  
 }  
   
 int slv_get_num_master_disunatt(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_disunatt called with NULL system.\n");  
     return 0;  
   }  
   return sys->disunatt.mnum;  
 }  
   
 int slv_get_num_master_rels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_rels called with NULL system.\n");  
     return 0;  
   }  
   return sys->rels.mnum;  
 }  
   
   
 int slv_get_num_master_condrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_condrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->condrels.mnum;  
 }  
   
 int slv_get_num_master_objs(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_objs called with NULL system.\n");  
     return 0;  
   }  
   return sys->objs.mnum;  
 }  
   
 int slv_get_num_master_logrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_logrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->logrels.mnum;  
 }  
   
 int slv_get_num_master_condlogrels(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_logrels called with NULL system.\n");  
     return 0;  
   }  
   return sys->condlogrels.mnum;  
 }  
   
 int slv_get_num_master_whens(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_whens called with NULL system.\n");  
     return 0;  
   }  
   return sys->whens.mnum;  
 }  
   
 int slv_get_num_master_bnds(slv_system_t sys)  
 {  
   if (sys==NULL) {  
     ERROR_REPORTER_NOLINE(ASC_PROG_ERROR,"slv_get_num_master_bnds called with NULL system.\n");  
     return 0;  
   }  
   return sys->bnds.mnum;  
 }  
1304    
1305  void slv_set_obj_relation(slv_system_t sys,struct rel_relation *obj)  void slv_set_obj_relation(slv_system_t sys,struct rel_relation *obj)
1306  {  {

Legend:
Removed from v.197  
changed lines
  Added in v.198

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