亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? read.c

?? Lin-Kernighan heuristic for the TSP and minimum weight perfect matching
?? C
?? 第 1 頁 / 共 2 頁
字號:
#define matchword(STR) (0==strncmp(keyword,STR,strlen(STR) ) )  \#define min(X,Y) ((X) >(Y) ?(Y) :(X) ) #define max(X,Y) ((X) <(Y) ?(Y) :(X) ) #define check_num_read(R,K)  \errorif((R) !=(K) ,"Error: expected %d arguments, got %d",K,R)  \#define truncate_to_zero(x) ((double) (int) (x) ) #define PI (3.14159265358979323846)  \/*1:*/#line 181 "./read.w"#include <config.h>#include "lkconfig.h"#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <math.h>#include "fixincludes.h"/*7:*/#line 264 "./read.w"#include "memory.h"#include "error.h"/*:7*//*12:*/#line 376 "./read.w"#include <string.h>/*:12*//*14:*/#line 402 "./read.w"#include <ctype.h>/*:14*//*20:*/#line 445 "./read.w"#include "gb_flip.h"/*:20*//*27:*/#line 554 "./read.w"#include "length.h"/*:27*//*34:*/#line 629 "./read.w"#include <limits.h>/*:34*/#line 189 "./read.w"#include "read.h"/*3:*/#line 219 "./read.w"static tsp_instance_t*p;/*:3*//*43:*/#line 726 "./read.w"length_t(*cost)(const int,const int);length_t(*pseudo_cost)(const int,const int);/*:43*/#line 193 "./read.w"/*48:*/#line 815 "./read.w"#if defined(COST_USE_HYPOT)#define my_hypot(A,B) (hypot((A),(B)))#else#define my_hypot(A,B) (sqrt((A)*(A)+(B)*(B)))#endif/*:48*//*57:*/#line 990 "./read.w"#if SIZEOF_INT==4typedef int int32;#elif SIZEOF_SHORT==4typedef short int int32;#elif SIZEOF_LONG==4typedef long int32;#else#error "I need a 32 bit integer for consistent results with DSJ_RANDOM"#endif/*:57*/#line 194 "./read.w"/*17:*/#line 435 "./read.w"static const char edge_weight_type_name[]= {"NO_EDGE_TYPE","EUC_2D","CEIL_2D","GEO","ATT","DSJ_RANDOM","EXPLICIT","RANDOM_EDGES"};/*:17*//*23:*/#line 468 "./read.w"static const char edge_weight_format_name[]= {"NO_EDGE_FORMAT","LOWER_DIAG_ROW","FULL_MATRIX","UPPER_ROW"};/*:23*//*39:*/#line 676 "./read.w"static double dsj_random_factor= 1;static int32 dsj_random_param= 1;/*:39*/#line 195 "./read.w"/*45:*/#line 739 "./read.w"length_t cost_from_matrix(const int i,const int j);length_tcost_from_matrix(const int i,const int j){return(length_t)p->edge_weights[i][j];}length_t cost_from_short_matrix(const int i,const int j);length_tcost_from_short_matrix(const int i,const int j){return(length_t)p->short_edge_weights[i][j];}/*:45*//*46:*/#line 777 "./read.w"length_t cost_from_euc2d(const int i,const int j);length_tcost_from_euc2d(const int i,const int j){coord_2d*coord_array= p->coord;double xd= coord_array[i].x[0]-coord_array[j].x[0];double yd= coord_array[i].x[1]-coord_array[j].x[1];return(length_t)floor(0.5+my_hypot(xd,yd));}/*:46*//*47:*/#line 792 "./read.w"length_t cost_from_ceil2d(const int i,const int j);length_tcost_from_ceil2d(const int i,const int j){coord_2d*coord_array= p->coord;double xd= coord_array[i].x[0]-coord_array[j].x[0];double yd= coord_array[i].x[1]-coord_array[j].x[1];return(length_t)ceil(my_hypot(xd,yd));}/*:47*//*49:*/#line 825 "./read.w"length_t cost_from_euc2d_not_rounded(const int i,const int j);length_tcost_from_euc2d_not_rounded(const int i,const int j){coord_2d*coord_array= p->coord;double xd= coord_array[i].x[0]-coord_array[j].x[0];double yd= coord_array[i].x[1]-coord_array[j].x[1];return(length_t)my_hypot(xd,yd);}/*:49*//*52:*/#line 865 "./read.w"length_t pseudo_cost_from_euc2d(const int i,const int j);length_tpseudo_cost_from_euc2d(const int i,const int j){coord_2d*coord_array= p->coord;double xd= coord_array[i].x[0]-coord_array[j].x[0];double yd= coord_array[i].x[1]-coord_array[j].x[1];return(length_t)(xd*xd+yd*yd);}/*:52*//*53:*/#line 895 "./read.w"length_t cost_from_geo(const int i,const int j);length_tcost_from_geo(const int i,const int j){coord_2d*coord_array= p->coord;const double x1= coord_array[i].x[0],x2= coord_array[j].x[0];const double y1= coord_array[i].x[1],y2= coord_array[j].x[1];double degrees,minutes;double latitude1,latitude2,longitude1,longitude2;double q1,q2,q3;const double radius= 6378.388;degrees= truncate_to_zero(x1);minutes= x1-degrees;latitude1= (PI/180)*(degrees+minutes*(5.0/3.0));degrees= truncate_to_zero(x2);minutes= x2-degrees;latitude2= (PI/180)*(degrees+minutes*(5.0/3.0));degrees= truncate_to_zero(y1);minutes= y1-degrees;longitude1= (PI/180)*(degrees+minutes*(5.0/3.0));degrees= truncate_to_zero(y2);minutes= y2-degrees;longitude2= (PI/180)*(degrees+minutes*(5.0/3.0));q1= cos(longitude1-longitude2);q2= cos(latitude1-latitude2);q3= cos(latitude1+latitude2);return(length_t)truncate_to_zero(radius*acos(0.5*((1+q1)*q2-(1-q1)*q3))+1);}/*:53*//*54:*/#line 937 "./read.w"length_t cost_from_att(const int i,const int j);length_tcost_from_att(const int i,const int j){coord_2d*coord_array= p->coord;double xd= coord_array[i].x[0]-coord_array[j].x[0];double yd= coord_array[i].x[1]-coord_array[j].x[1];return(length_t)ceil(my_hypot(xd,yd)*0.31622776601683793319988935);}/*:54*//*55:*/#line 955 "./read.w"length_t cost_from_dsj_random(const int i,const int j);length_tcost_from_dsj_random(const int ii,const int jj){const int32 i= ii,j= jj;const int32 salt1= 0x12345672*(i+1)+1;const int32 salt2= 0x12345672*(j+1)+1;int32 x,y,z;x= salt1&salt2;y= salt1|salt2;z= dsj_random_param;x*= z;y*= x;z*= y;z^= dsj_random_param;x*= z;y*= x;z*= y;x= ((salt1+salt2)^z)&0x7fffffff;return(length_t)(x*dsj_random_factor);}/*:55*/#line 196 "./read.w"/*4:*/#line 227 "./read.w"tsp_instance_t*switch_to(tsp_instance_t*new_problem){tsp_instance_t*old_problem;old_problem= p;p= new_problem;/*56:*/#line 985 "./read.w"dsj_random_factor= p->dsj_random_factor;dsj_random_param= p->dsj_random_param;/*:56*//*58:*/#line 1005 "./read.w"switch(p->edge_weight_type){case EXPLICIT:cost= cost_from_matrix;pseudo_cost= cost_from_matrix;break;case EUC_2D:{extern int noround;cost= noround?cost_from_euc2d_not_rounded:cost_from_euc2d;}pseudo_cost= pseudo_cost_from_euc2d;break;case CEIL_2D:{extern int noround;cost= noround?cost_from_euc2d_not_rounded:cost_from_ceil2d;}pseudo_cost= pseudo_cost_from_euc2d;break;case GEO:cost= cost_from_geo;pseudo_cost= cost_from_geo;break;case ATT:cost= cost_from_att;pseudo_cost= cost_from_att;break;case DSJ_RANDOM:cost= cost_from_dsj_random;pseudo_cost= cost_from_dsj_random;break;case RANDOM_EDGES:errorif(p->short_edge_weights==NULL,"RANDOM_EDGES specified but no SEED given");cost= cost_from_short_matrix;pseudo_cost= cost_from_short_matrix;break;case NO_EDGE_TYPE:default:errorif(1,"Switching to an instance with unknown edge type %d",p->edge_weight_type);}/*:58*/#line 234 "./read.w"return old_problem;}/*:4*//*6:*/#line 249 "./read.w"tsp_instance_t*read_tsp_file(FILE*in,FILE*debug,const int force_even_num){p= new_of(tsp_instance_t);/*10:*/#line 308 "./read.w"p->name= NULL;p->comment= NULL;p->n= 0;p->scale= 1e6;/*:10*//*19:*/#line 442 "./read.w"p->edge_weight_type= NO_EDGE_TYPE;/*:19*//*25:*/#line 475 "./read.w"p->edge_weight_format= NO_EDGE_FORMAT;/*:25*//*29:*/#line 560 "./read.w"p->edge_weights= NULL;/*:29*//*33:*/#line 624 "./read.w"p->coord= NULL;p->xmin= p->ymin= INT_MAX;p->xmax= p->ymax= INT_MIN;/*:33*//*38:*/#line 670 "./read.w"p->seed= 1;p->dsj_random_factor= 1.0;p->dsj_random_param= 1;/*:38*//*42:*/#line 707 "./read.w"p->short_edge_weights= NULL;/*:42*/#line 254 "./read.w"/*11:*/#line 319 "./read.w"{#define MAX_KEYWORD_LEN (25)#define MAX_LINE_LEN (200)char keyword[MAX_KEYWORD_LEN],rest_of_line[MAX_LINE_LEN];int more_input= 1,lineno= 0;while(more_input){char*colon;int r;keyword[0]= 0;r= fscanf(in," %s ",keyword);if(r==EOF){more_input= 0;break;}errorif(r!=1,"%d: Couldn't read the word following \"%s\". (r==%d)",lineno+1,keyword,r);if(NULL!=(colon= strchr(keyword,':')))*colon= '\0';if(matchword("EOF")){more_input= 0;}else if(matchword("NAME")){/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 336 "./read.w"p->name= dup_string(rest_of_line);}else if(matchword("COMMENT")){/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 339 "./read.w"p->comment= dup_string(rest_of_line);}else if(matchword("TYPE")){/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 342 "./read.w"errorif(strcmp(rest_of_line,"TSP"),"Can't read TSPLIB files of type %s.",rest_of_line);}else if(matchword("DIMENSION")){/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 345 "./read.w"p->input_n= p->n= atoi(rest_of_line);}else if(matchword("DISPLAY_DATA_TYPE")){/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 348 "./read.w"}else if(matchword("EDGE_WEIGHT_TYPE")){/*15:*/#line 410 "./read.w"/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 411 "./read.w"if(0==strcmp(rest_of_line,"EUC_2D")){p->edge_weight_type= EUC_2D;}else if(0==strcmp(rest_of_line,"CEIL_2D")){p->edge_weight_type= CEIL_2D;}else if(0==strcmp(rest_of_line,"GEO")){p->edge_weight_type= GEO;}else if(0==strcmp(rest_of_line,"ATT")){p->edge_weight_type= ATT;}else if(0==strcmp(rest_of_line,"DSJ_RANDOM")){p->edge_weight_type= DSJ_RANDOM;}else if(0==strcmp(rest_of_line,"EXPLICIT")){p->edge_weight_type= EXPLICIT;}else if(0==strcmp(rest_of_line,"RANDOM_EDGES")){p->edge_weight_type= RANDOM_EDGES;}else{errorif(1,"%d: Apology: Unknown edge weight type \"%s\".",lineno,rest_of_line);}/*:15*/#line 351 "./read.w"}else if(matchword("EDGE_WEIGHT_FORMAT")){/*21:*/#line 451 "./read.w"/*13:*/#line 385 "./read.w"{int l;char*rcp;if(colon==NULL){int r= fscanf(in," : ");errorif(r!=0,"%d: Missed the colon.",lineno);}rcp= fgets(rest_of_line,MAX_LINE_LEN,in);errorif(NULL==rcp,"%d: Couldn't read after the colon; truncated file?",lineno);l= strlen(rest_of_line)-1;if(l>=0&&rest_of_line[l]=='\n'){rest_of_line[l--]= '\0';lineno++;}while(l>=0&&isspace(rest_of_line[l]))rest_of_line[l--]= '\0';if(feof(in))more_input= 0;}/*:13*/#line 452 "./read.w"if(0==strcmp(rest_of_line,"LOWER_DIAG_ROW")){p->edge_weight_format= LOWER_DIAG_ROW;}else if(0==strcmp(rest_of_line,"FULL_MATRIX")){p->edge_weight_format= FULL_MATRIX;}else if(0==strcmp(rest_of_line,"UPPER_ROW")){p->edge_weight_format= UPPER_ROW;}else{errorif(1,"%d: Unknown edge weight format \"%s\".",lineno,rest_of_line);}/*:21*/#line 353 "./read.w"}else if(matchword("EDGE_WEIGHT_SECTION")){/*26:*/#line 484 "./read.w"switch(p->edge_weight_format){long int long_dummy;case LOWER_DIAG_ROW:{int row,col;p->edge_weights= new_arr_of(length_t*,p->input_n);for(row= 0;row<p->input_n;row++){p->edge_weights[row]= new_arr_of(length_t,p->input_n);}for(row= 0;row<p->input_n;row++){for(col= 0;col<=row;col++){int r= fscanf(in," %ld ",&long_dummy);errorif(1!=r,"Couldn't convert an edge weight: %d to %d.",row+1,col+1);p->edge_weights[col][row]= p->edge_weights[row][col]= long_dummy;}}}break;case FULL_MATRIX:{int row,col;p->edge_weights= new_arr_of(length_t*,p->input_n);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国精品国产尤物美女| 欧美高清www午色夜在线视频| 精品99999| 成人小视频免费观看| 国产精品网站一区| 91亚洲精品一区二区乱码| 一区二区三区波多野结衣在线观看 | 无吗不卡中文字幕| 欧美日韩国产一二三| 久久精品国产一区二区三| 精品成人一区二区三区四区| 成人av在线一区二区| 夜夜精品视频一区二区| 91精品免费在线| 国产精品1区2区3区在线观看| 亚洲丝袜另类动漫二区| 欧美色综合久久| 久久精品99国产精品| 国产精品美女久久久久久久| 欧美色图天堂网| 久草在线在线精品观看| 成人欧美一区二区三区| 91精品国产综合久久精品麻豆 | 欧美日韩久久一区二区| 激情文学综合丁香| 玉足女爽爽91| 久久在线免费观看| 在线亚洲高清视频| 国产精品一区二区你懂的| 一区二区三区精品视频| 日韩欧美亚洲国产另类| 一本一道久久a久久精品 | 亚洲国产精品麻豆| 国产午夜精品一区二区| 欧美美女一区二区三区| 国产a视频精品免费观看| 三级久久三级久久| 国产精品久久久久三级| 欧美一区二区三区电影| 色狠狠一区二区| 丁香婷婷综合五月| 日本伊人午夜精品| 亚洲欧美中日韩| 精品久久久久久久人人人人传媒 | 中文字幕精品一区二区精品绿巨人 | 国产精品色呦呦| 日韩一区二区三区电影在线观看| www.日韩在线| 国产精品一线二线三线精华| 图片区日韩欧美亚洲| 亚洲欧美另类小说| 国产日韩欧美一区二区三区乱码| 91精品在线一区二区| 在线一区二区视频| 97久久超碰国产精品| 国产精品12区| 国产美女在线观看一区| 日韩av一二三| 亚洲电影视频在线| 伊人色综合久久天天| 国产精品女主播av| 中文一区二区在线观看| 欧美成人a视频| 日韩欧美一级特黄在线播放| 欧美日韩大陆在线| 欧美日韩精品一区二区三区蜜桃| 91亚洲永久精品| 91亚洲精品久久久蜜桃网站| av在线播放一区二区三区| 国产69精品久久久久毛片| 国产精品系列在线播放| 国产精品 欧美精品| 国产成人亚洲精品青草天美| 国产精品一区免费在线观看| 国产精品亚洲成人| 成人久久视频在线观看| 成人sese在线| 99国产精品久久久| 色婷婷精品大在线视频| 欧美日韩在线免费视频| 91精品国产欧美日韩| 日韩欧美一二区| 久久这里只精品最新地址| 国产日韩一级二级三级| 国产精品久久久久久久久晋中 | 久久麻豆一区二区| 久久丝袜美腿综合| 国产精品久久久久婷婷二区次| 亚洲欧洲一区二区在线播放| 亚洲欧美偷拍另类a∨色屁股| 亚洲精品国产精华液| 亚洲成人你懂的| 蜜臀91精品一区二区三区| 国产一区二区三区免费在线观看| 成人小视频在线| 欧洲精品一区二区| 欧美一区二区在线观看| 国产欧美一区二区在线观看| 亚洲日本在线看| 日韩av一区二区三区四区| 国产制服丝袜一区| 91热门视频在线观看| 欧美日韩亚洲丝袜制服| 久久免费的精品国产v∧| 亚洲天堂网中文字| 三级精品在线观看| 国产suv精品一区二区三区| 色av成人天堂桃色av| 欧美一级欧美三级| 国产精品久久久久久久久免费相片| 一区二区三区国产| 精品一区二区三区在线播放视频 | 午夜欧美大尺度福利影院在线看 | 成人激情午夜影院| 91激情在线视频| 欧美成人aa大片| 亚洲欧洲精品天堂一级| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品免费久久久久| 亚洲网友自拍偷拍| 国产精品一线二线三线精华| 欧美性xxxxxxxx| 久久久精品国产免大香伊| 亚洲一区二区三区小说| 国产成人欧美日韩在线电影| 欧美日韩国产三级| 国产精品国产馆在线真实露脸| 免费日韩伦理电影| 91亚洲国产成人精品一区二区三 | jlzzjlzz欧美大全| 日韩精品一区二区三区视频在线观看 | 日本高清不卡一区| 日韩午夜小视频| 亚洲精品国产无天堂网2021| 国产综合色视频| 91精品国产全国免费观看| 亚洲免费在线播放| 成人午夜私人影院| 精品成a人在线观看| 亚洲国产成人av网| 色欧美片视频在线观看| 国产精品免费aⅴ片在线观看| 精品一区二区三区免费观看| 欧美综合视频在线观看| **欧美大码日韩| 国产精品91一区二区| 欧美xfplay| 免费在线观看精品| 制服丝袜在线91| 午夜精品在线看| 欧美体内she精高潮| 亚洲伦在线观看| av在线一区二区| 国产精品国产自产拍高清av| 日韩欧美国产系列| 欧美性极品少妇| 国产精品超碰97尤物18| 成人永久免费视频| 久久久久久一二三区| 久久国产精品无码网站| 日韩三级在线观看| 香港成人在线视频| 欧美女孩性生活视频| 亚洲成人一区在线| 欧美日韩dvd在线观看| 香蕉加勒比综合久久| 欧美日韩一区在线| 日韩va亚洲va欧美va久久| 欧美一区二区三区不卡| 美女网站一区二区| 欧美xxxxxxxxx| 国产成人精品亚洲777人妖| 国产欧美日本一区视频| 不卡一卡二卡三乱码免费网站| 欧美激情一区二区三区全黄| av成人免费在线观看| 一区二区三区美女视频| 欧美亚洲综合在线| 偷拍一区二区三区四区| 日韩一区二区三区电影| 狠狠网亚洲精品| 日本一区二区三区视频视频| 91免费在线看| 亚洲成a人片在线不卡一二三区| 91精品国产欧美一区二区18| 激情六月婷婷综合| 亚洲精品视频观看| 一本到一区二区三区| 一区二区成人在线| 91精品国产综合久久精品麻豆 | 欧美性感一区二区三区| 五月婷婷激情综合网| 欧美成人bangbros| 成人福利电影精品一区二区在线观看| 亚洲欧美日韩国产手机在线| 欧美日韩国产在线观看| 国产制服丝袜一区| 一区二区三区久久| 日韩精品一区在线| 99精品在线免费|