?? jbmr.c
字號(hào):
{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 1760 "./jbmr.w"}#endif/*:63*//*80:*/#line 2210 "./jbmr.w"#if BL==1if(!((t2ip2==t[4])||(t2ip1==t[2]&&t2ip2==t[3])||(t2ip1==t[3]&&t2ip2==t[2]))){int is_illegal= 0;switch(base_scheme[5]){case 0:if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){base_scheme[6]= 0;is_illegal= t[2]==t2ip1||t[1]==t2ip2;}else{base_scheme[6]= 1;is_illegal= t[2]==t2ip2||t[1]==t2ip1||t[4]==t2ip2||t[1]==t2ip2;}break;case 2:base_scheme[6]= 2;is_illegal= tour_inorder(t[3],t[4],t2ip1,t2ip2);break;case 5:if(tour_inorder(t[1],t[2],t2ip2,t2ip1)){base_scheme[6]= 5;}else{base_scheme[6]= 7;is_illegal= t2ip2==t[1]||t[1]==t[4];}break;case 8:if(tour_inorder(t[4],t[3],t2ip2,t2ip1)){base_scheme[6]= 8;}else{base_scheme[6]= 9;is_illegal= t2ip2==t[2];}break;default:errorif(1,"Non-exhaustive switch: %d",base_scheme[5]);}if(!is_illegal){/*166:*/#line 3856 "./jbmr.w"#if JBMR_MAX_VERBOSE >= 1000if(verbose>=1000){/*167:*/#line 3866 "./jbmr.w"#if JBMR_MAX_VERBOSE{int i;for(i= 0;i<two_i;i++)printf(" ");}#endif/*:167*/#line 3859 "./jbmr.w"printf("base_scheme6 == %d\n",base_scheme[6]);fflush(stdout);}#endif/*:166*/#line 2306 "./jbmr.w"/*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#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"en
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -