Changeset 9161


Ignore:
Timestamp:
Aug 31, 2016 4:22:20 PM (3 years ago)
Author:
Christian Andersson
Message:

Merged changes made in branch to trunk. Related to ticket:4411

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/RuntimeLibrary/src

  • trunk/RuntimeLibrary/src/jmi/jmi_block_solver.c

    r9082 r9161  
    546546            /* Write back the current iteration variables, needed for checking discrete variables. */
    547547            block_solver->F(block_solver->problem_data, x, NULL, JMI_BLOCK_WRITE_BACK);
     548           
     549            /* Check for convergence in first try before computing a reduced step */
     550            if (block_solver->check_discrete_variables_change(block_solver->problem_data, x_new) == JMI_EQUAL) {
     551                /* Set the correct solution */
     552                block_solver->F(block_solver->problem_data, x_new, NULL, JMI_BLOCK_WRITE_BACK);
     553                /* block_solver->update_discrete_variables(block_solver->problem_data, &non_reals_changed_flag);  Not needed, nothing changed */
     554                jmi_log_node(log, logInfo, "Found consistent solution on first try in enhanced fixed point iteration in <block:%s, iter:%I> at <t:%E>",
     555                        block_solver->label, iter, cur_time);
     556                converged = 1;
     557            }
    548558
    549559            iter = 0;
    550             while (1 && ef==0){
     560            while (ef == 0 && converged == 0){
    551561
    552562                jmi_log_node_t iter_node = jmi_log_enter_fmt(log, logInfo, "BlockIteration",
Note: See TracChangeset for help on using the changeset viewer.