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

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

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

revision 221 by johnpye, Mon Jan 16 08:53:30 2006 UTC revision 222 by johnpye, Fri Jan 27 04:23:20 2006 UTC
# Line 766  static void calc_nominals( slv3_system_t Line 766  static void calc_nominals( slv3_system_t
766      if( n == 0.0 ) {      if( n == 0.0 ) {
767        n = TOO_SMALL;        n = TOO_SMALL;
768    
769        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
770        FPRINTF(fp,"QRSlv::calc_nominals: Variable ");        FPRINTF(fp,"QRSlv::calc_nominals: Variable ");
771        print_var_name(fp,sys,var);        print_var_name(fp,sys,var);
772        FPRINTF(fp,"has nominal value of zero. Resetting to %g.",n);        FPRINTF(fp,"has nominal value of zero. Resetting to %g.",n);
# Line 776  static void calc_nominals( slv3_system_t Line 776  static void calc_nominals( slv3_system_t
776      } else {      } else {
777        n =  -n;        n =  -n;
778    
779        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
780        FPRINTF(fp,"QRSlv::calc_nominals Variable ");        FPRINTF(fp,"QRSlv::calc_nominals Variable ");
781        print_var_name(fp,sys,var);        print_var_name(fp,sys,var);
782        FPRINTF(fp,"has negative nominal value. Resetting to %g.",n);        FPRINTF(fp,"has negative nominal value. Resetting to %g.",n);
# Line 1411  static int calc_pivots(slv3_system_t sys Line 1411  static int calc_pivots(slv3_system_t sys
1411          row = mtx_org_to_row(sys->J.mtx,org_row);          row = mtx_org_to_row(sys->J.mtx,org_row);
1412          rel = sys->rlist[org_row];          rel = sys->rlist[org_row];
1413    
1414          error_reporter_start(ASC_USER_ERROR,NULL,0);          ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
1415          FPRINTF(stderr,"Relation '");          FPRINTF(stderr,"Relation '");
1416          print_rel_name(stderr,sys,rel);          print_rel_name(stderr,sys,rel);
1417          FPRINTF(stderr,"' not pivoted.\n");          FPRINTF(stderr,"' not pivoted.\n");
# Line 2662  static void move_to_next_block( slv3_sys Line 2662  static void move_to_next_block( slv3_sys
2662      sys->s.calc_ok = TRUE;      sys->s.calc_ok = TRUE;
2663    
2664      if( !(ok = calc_objective(sys)) ) {      if( !(ok = calc_objective(sys)) ) {
2665        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
2666        FPRINTF(MIF(sys),"Objective calculation errors detected.\n");        FPRINTF(MIF(sys),"Objective calculation errors detected.\n");
2667        error_reporter_end_flush();        error_reporter_end_flush();
2668      }      }
# Line 2678  static void move_to_next_block( slv3_sys Line 2678  static void move_to_next_block( slv3_sys
2678    
2679      sys->residuals.accurate = FALSE;      sys->residuals.accurate = FALSE;
2680      if( !(ok = calc_residuals(sys)) ) {      if( !(ok = calc_residuals(sys)) ) {
2681        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
2682        FPRINTF(MIF(sys),        FPRINTF(MIF(sys),
2683          "Residual calculation errors detected in move_to_next_block.\n");          "Residual calculation errors detected in move_to_next_block.\n");
2684        error_reporter_end_flush();        error_reporter_end_flush();
# Line 2830  static void reorder_new_block(slv3_syste Line 2830  static void reorder_new_block(slv3_syste
2830                    1,mtx_SPK1);                    1,mtx_SPK1);
2831      } else {      } else {
2832        sys->s.cost[sys->s.block.current_block].reorder_method = 1;        sys->s.cost[sys->s.block.current_block].reorder_method = 1;
2833        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
2834        FPRINTF(MIF(sys),"QRSlv called with unknown reorder option\n");        FPRINTF(MIF(sys),"QRSlv called with unknown reorder option\n");
2835        FPRINTF(MIF(sys),"QRSlv using single edge tear drop (TEAR_DROP).\n");        FPRINTF(MIF(sys),"QRSlv using single edge tear drop (TEAR_DROP).\n");
2836        error_reporter_end_flush();        error_reporter_end_flush();
# Line 3591  void slv3_dump_internals(slv_system_t se Line 3591  void slv3_dump_internals(slv_system_t se
3591    (void) server;    (void) server;
3592    check_system(sys);    check_system(sys);
3593    if (level > 0) {    if (level > 0) {
3594      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3595      FPRINTF(stderr,"QRSlv:slv3_dump_internals: QRSlv does not dump its internals.\n");      FPRINTF(stderr,"QRSlv:slv3_dump_internals: QRSlv does not dump its internals.\n");
3596      error_reporter_end_flush();      error_reporter_end_flush();
3597    }    }
# Line 3694  void slv3_presolve(slv_system_t server, Line 3694  void slv3_presolve(slv_system_t server,
3694    iteration_begins(sys);    iteration_begins(sys);
3695    check_system(sys);    check_system(sys);
3696    if( sys->vlist == NULL ) {    if( sys->vlist == NULL ) {
3697      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3698      FPRINTF(stderr,"QRSlv::slv3_presolve: Variable list was never set.");      FPRINTF(stderr,"QRSlv::slv3_presolve: Variable list was never set.");
3699      error_reporter_end_flush();      error_reporter_end_flush();
3700      return;      return;
3701    }    }
3702    if( sys->rlist == NULL && sys->obj == NULL ) {    if( sys->rlist == NULL && sys->obj == NULL ) {
3703      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3704      FPRINTF(stderr,"QRSlv::slv3_presolve: Relation list and objective never set.");      FPRINTF(stderr,"QRSlv::slv3_presolve: Relation list and objective never set.");
3705      error_reporter_end_flush();      error_reporter_end_flush();
3706      return;      return;
# Line 3882  static void slv3_iterate(slv_system_t se Line 3882  static void slv3_iterate(slv_system_t se
3882    
3883  #if !CANOPTIMIZE  #if !CANOPTIMIZE
3884    if( OPTIMIZING(sys) ) {    if( OPTIMIZING(sys) ) {
3885      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3886      FPRINTF(stderr,"QRSlv::slv3_iterate: QRSlv cannot presently optimize.");      FPRINTF(stderr,"QRSlv::slv3_iterate: QRSlv cannot presently optimize.");
3887      error_reporter_end_flush();      error_reporter_end_flush();
3888    
# Line 3933  static void slv3_iterate(slv_system_t se Line 3933  static void slv3_iterate(slv_system_t se
3933          update_status(sys);          update_status(sys);
3934          return;          return;
3935        }        }
3936        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3937        FPRINTF(mif,"Direct solve found numerically impossible equation given variables solved in previous blocks.\n");        FPRINTF(mif,"Direct solve found numerically impossible equation given variables solved in previous blocks.\n");
3938        error_reporter_end_flush();        error_reporter_end_flush();
3939      case -1:      case -1:
3940        sys->s.inconsistent = TRUE;        sys->s.inconsistent = TRUE;
3941    
3942        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3943        FPRINTF(ASCERR,"No solution exists within the bounds given for variable '");        FPRINTF(ASCERR,"No solution exists within the bounds given for variable '");
3944        print_var_name(ASCERR,sys,var);        print_var_name(ASCERR,sys,var);
3945        FPRINTF(ASCERR,"' when inverting relation:\n");        FPRINTF(ASCERR,"' when inverting relation:\n");
# Line 3952  static void slv3_iterate(slv_system_t se Line 3952  static void slv3_iterate(slv_system_t se
3952      }      }
3953    } /* if fails with a 0, go on to newton a 1x1 */    } /* if fails with a 0, go on to newton a 1x1 */
3954    if( !calc_J(sys) ) {    if( !calc_J(sys) ) {
3955      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
3956      FPRINTF(MIF(sys),"Jacobian calculation errors detected.");      FPRINTF(MIF(sys),"Jacobian calculation errors detected.");
3957      error_reporter_end_flush();      error_reporter_end_flush();
3958    }    }
# Line 3998  static void slv3_iterate(slv_system_t se Line 3998  static void slv3_iterate(slv_system_t se
3998    
3999    if( !OPTIMIZING(sys) &&    if( !OPTIMIZING(sys) &&
4000        sys->gamma.norm2 <= TERM_TOL*sys->phi ) {        sys->gamma.norm2 <= TERM_TOL*sys->phi ) {
4001      error_reporter_start(ASC_PROG_ERROR,NULL,0);      ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
4002      FPRINTF(mif,"QRSlv: Problem diverged: Gamma norm too small.");      FPRINTF(mif,"QRSlv: Problem diverged: Gamma norm too small.");
4003      error_reporter_end_flush();      error_reporter_end_flush();
4004    
# Line 4039  static void slv3_iterate(slv_system_t se Line 4039  static void slv3_iterate(slv_system_t se
4039    
4040  /* 2004.11.5 code by AWW to eliminate runaway minor loop */  /* 2004.11.5 code by AWW to eliminate runaway minor loop */
4041      if(minor >= MAX_MINOR){      if(minor >= MAX_MINOR){
4042        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
4043        FPRINTF(mif,"QRSlv: Exceeded max line search iterations. Check for variables on bounds.");        FPRINTF(mif,"QRSlv: Exceeded max line search iterations. Check for variables on bounds.");
4044        error_reporter_end_flush();        error_reporter_end_flush();
4045    
# Line 4117  static void slv3_iterate(slv_system_t se Line 4117  static void slv3_iterate(slv_system_t se
4117      }      }
4118    
4119      if (sys->progress <= TERM_TOL) {      if (sys->progress <= TERM_TOL) {
4120        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
4121        FPRINTF(mif,"QRSlv: Problem diverged: Suggested progress too small.");        FPRINTF(mif,"QRSlv: Problem diverged: Suggested progress too small.");
4122        error_reporter_end_flush();        error_reporter_end_flush();
4123    
# Line 4143  static void slv3_iterate(slv_system_t se Line 4143  static void slv3_iterate(slv_system_t se
4143       **/       **/
4144      apply_step(sys);      apply_step(sys);
4145      if (sys->progress <= TERM_TOL) {      if (sys->progress <= TERM_TOL) {
4146        error_reporter_start(ASC_PROG_ERROR,NULL,0);        ERROR_REPORTER_START_NOLINE(ASC_PROG_ERROR);
4147        FPRINTF(mif,"Problem diverged: Applied progress too small.");        FPRINTF(mif,"Problem diverged: Applied progress too small.");
4148        error_reporter_end_flush();        error_reporter_end_flush();
4149    

Legend:
Removed from v.221  
changed lines
  Added in v.222

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