?? jbmr.c
字號:
#else cum_2_pos= cum_1_pos+cost(t2ip1,t2ip2);cum_2_neg= cum_1_neg;#endif #if JBMR_DECLUSTER_IN_ELIGIBILITY_TESTif(CAREFUL_OP(cum_2,<=,cluster_dist+best_gain)){/*160:*/#line 3769 "./jbmr.w"#if JBMR_MAX_VERBOSEnum_reject_by_decluster++;#if JBMR_MAX_VERBOSE >= 500if(verbose>=500){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3774 "./jbmr.w"printf("%d: %d %d "length_t_spec" s%d rejected (#%d), clust_dist==%f\n",enbl,t2ip1,t2ip2,#if !SPLIT_GAIN_VARlength_t_pcast(cum_2),#elselength_t_pcast(cum_2_pos-cum_2_neg),#endife[BL][enbl].scheme_id,num_reject_by_decluster,(double)cluster_dist);fflush(stdout);}#endif#endif/*:160*/#line 1789 "./jbmr.w"}else#endif{/*66:*/#line 1842 "./jbmr.w"#if BL==0if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){e[BL][enbl].scheme_id= 4;if(t[1]!=t[4]){/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 1847 "./jbmr.w"}}else{e[BL][enbl].scheme_id= 0;}#endif/*:66*//*81:*/#line 2371 "./jbmr.w"#if BL==1if(scheme_num_cities[e[BL][enbl].scheme_id= base_scheme[6]]==6){/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 2374 "./jbmr.w"}#endif/*:81*//*90:*/#line 2709 "./jbmr.w"#if BL==2e[BL][enbl].scheme_id= base_scheme[8];/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 2712 "./jbmr.w"#endif/*:90*//*100:*/#line 2944 "./jbmr.w"#if BL==3e[BL][enbl].scheme_id= 13;/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 2947 "./jbmr.w"#endif/*:100*/#line 1794 "./jbmr.w"e[BL][enbl].t2ip1= t2ip1;e[BL][enbl].t2ip2= t2ip2;#if !SPLIT_GAIN_VARe[BL][enbl].gain_for_comparison= e[BL][enbl].gain= cum_2;#elsee[BL][enbl].gain_for_comparison= cum_2_pos-cum_2_neg;e[BL][enbl].gain_pos= cum_2_pos;e[BL][enbl].gain_neg= cum_2_neg;#endif#if JBMR_DECLUSTER_IN_GREEDYe[BL][enbl].gain_for_comparison-= cluster_dist;#endif#if JBMR_DECLUSTER_IN_ELIGIBILITY_TESTe[BL][enbl].cluster_dist= cluster_dist;#endif/*158:*/#line 3739 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 500if(verbose>=500){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3742 "./jbmr.w"#if !SPLIT_GAIN_VARprintf("%d: %d %d "length_t_spec" s%d\n",enbl,t2ip1,t2ip2,length_t_pcast(cum_2),#elseprintf("%d: %d %d "length_t_spec"-"length_t_spec"="length_t_spec" s%d\n",enbl,t2ip1,t2ip2,length_t_pcast(cum_2_pos),length_t_pcast(cum_2_neg),length_t_pcast(cum_2_pos-cum_2_neg),#endife[BL][enbl].scheme_id);fflush(stdout);}#endif/*:158*/#line 1813 "./jbmr.w"enbl++;}}/*:64*/#line 2307 "./jbmr.w"}}#endif /*:80*//*87:*/#line 2588 "./jbmr.w"#if BL==2if(!((t2ip2==t[6])||(t2ip1==t[4]&&t2ip2==t[5])||(t2ip1==t[5]&&t2ip2==t[4])||(t2ip1==t[2]&&t2ip2==t[3])||(t2ip1==t[3]&&t2ip2==t[2]))){int infeasible_4_change,is_illegal= 0;switch(base_scheme[7]){case 2:if(tour_inorder(t[1],t[2],t2ip1,t2ip2)){base_scheme[8]= 2;is_illegal= t2ip2==t[4]||t2ip2==t[1];}else{base_scheme[8]= 3;}break;case 5:if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){base_scheme[8]= 5;}else{base_scheme[8]= 6;is_illegal= t2ip2==t[3];}break;case 9:if(tour_inorder(t[1],t[2],t2ip1,t[4])){if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){base_scheme[8]= 9;}else{base_scheme[8]= 10;is_illegal= t2ip2==t[3];}}else{if(tour_inorder(t[1],t[2],t2ip1,t2ip2)){base_scheme[8]= 11;is_illegal= t2ip2==t[6];}else{base_scheme[8]= 12;is_illegal= t2ip2==t[4];}}break;default:errorif(1,"Non-exhaustive switch: %d",base_scheme[7]);}if(!is_illegal){/*88:*/#line 2669 "./jbmr.w"{int i,*sc,sn;t[7]= t2ip1;t[8]= t2ip2;infeasible_4_change= 0;sc= &scheme_feas_check[base_scheme[8]][0];sn= scheme_feas_n[base_scheme[8]];for(i= 0;i<sn;i+= 2){if(t[sc[i]]==t[sc[i+1]]){infeasible_4_change= 1;break;}}}/*:88*/#line 2657 "./jbmr.w"if(!infeasible_4_change){/*64:*/#line 1773 "./jbmr.w"{#if JBMR_DECLUSTER_IN_ELIGIBILITY_TEST || JBMR_DECLUSTER_IN_GREEDYconst length_t cluster_dist= decluster_d(t[1],t2ip2);/*159:*/#line 3760 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 501 && (JBMR_DECLUSTER_IN_ELIGIBILITY_TEST||JBMR_DECLUSTER_IN_GREEDY)if(verbose>=501){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3763 "./jbmr.w"printf(" v---- next clust_dist==%f\n",(double)cluster_dist);}#endif/*:159*/#line 1777 "./jbmr.w"#endif#if !SPLIT_GAIN_VARcum_2= cum_1+cost(t2ip1,t2ip2);#else cum_2_pos= cum_1_pos+cost(t2ip1,t2ip2);cum_2_neg= cum_1_neg;#endif #if JBMR_DECLUSTER_IN_ELIGIBILITY_TESTif(CAREFUL_OP(cum_2,<=,cluster_dist+best_gain)){/*160:*/#line 3769 "./jbmr.w"#if JBMR_MAX_VERBOSEnum_reject_by_decluster++;#if JBMR_MAX_VERBOSE >= 500if(verbose>=500){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3774 "./jbmr.w"printf("%d: %d %d "length_t_spec" s%d rejected (#%d), clust_dist==%f\n",enbl,t2ip1,t2ip2,#if !SPLIT_GAIN_VARlength_t_pcast(cum_2),#elselength_t_pcast(cum_2_pos-cum_2_neg),#endife[BL][enbl].scheme_id,num_reject_by_decluster,(double)cluster_dist);fflush(stdout);}#endif#endif/*:160*/#line 1789 "./jbmr.w"}else#endif{/*66:*/#line 1842 "./jbmr.w"#if BL==0if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){e[BL][enbl].scheme_id= 4;if(t[1]!=t[4]){/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 1847 "./jbmr.w"}}else{e[BL][enbl].scheme_id= 0;}#endif/*:66*//*81:*/#line 2371 "./jbmr.w"#if BL==1if(scheme_num_cities[e[BL][enbl].scheme_id= base_scheme[6]]==6){/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 2374 "./jbmr.w"}#endif/*:81*//*90:*/#line 2709 "./jbmr.w"#if BL==2e[BL][enbl].scheme_id= base_scheme[8];/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif#if !LENGTH_TYPE_IS_EXACTbest_gain_with_slop= best_gain+instance_epsilon;#endifbest_two_i= two_i;best_exit_a= t2ip1;best_exit_b= t2ip2;best_scheme_id= e[BL][enbl].scheme_id;/*148:*/#line 3587 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 200if(verbose>=200){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3590 "./jbmr.w"printf("best_gain = "length_t_spec" %d %d s%d\n",length_t_pcast(best_gain),best_exit_a,best_exit_b,best_scheme_id);fflush(stdout);}#endif/*:148*/#line 1894 "./jbmr.w"}}/*:67*/#line 2712 "./jbmr.w"#endif/*:90*//*100:*/#line 2944 "./jbmr.w"#if BL==3e[BL][enbl].scheme_id= 13;/*67:*/#line 1864 "./jbmr.w"{const length_t cost_phantom= cost(t[1],t2ip2);#if !SPLIT_GAIN_VARconst length_t cum_exit_now= cum_2-cost_phantom;#endifif(#if LENGTH_TYPE_IS_EXACTcum_exit_now> best_gain#elif SPLIT_GAIN_VARcum_2_pos> best_gain_with_slop+cum_2_neg+cost_phantom#elsecum_exit_now> best_gain_with_slop#endif){#if SPLIT_GAIN_VARbest_gain= cum_2_pos-cum_2_neg-cost_phantom;#elsebest_gain= cum_exit_now;#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -