📄 read.w,v
字号:
double yd = coord_array[i].y - coord_array[j].y;d671 2a672 2 double xd = coord_array[i].x - coord_array[j].x; double yd = coord_array[i].y - coord_array[j].y;@1.126log@Added Index major section.@text@d5 5a9 1{\obeylines$Log: read.w,v $d92 1a92 1const char *read_rcs_id="$Id: read.w,v 1.125 1997/05/16 18:11:41 neto Exp neto $";@1.125log@Break locks by david and neto.Include <config.h> and "lkconfig.h"@text@d6 4d88 1a88 1const char *read_rcs_id="$Id: read.w,v 1.124 1997/05/16 18:09:40 neto Exp neto $";d738 2@1.124log@Include <config.h> and lkconfig.h@text@d6 3d84 1a84 1const char *read_rcs_id="$Id: read.w,v 1.123 1997/02/10 19:25:03 neto Exp neto $";@1.123log@Limit the size of the PostScript arrays.@text@d6 3d67 2d81 1a81 1const char *read_rcs_id="$Id: read.w,v 1.122 1997/02/10 19:16:26 neto Exp neto $";@1.122log@Fixed printf spec.@text@d6 3d76 1a76 1const char *read_rcs_id="$Id: read.w,v 1.121 1997/02/10 19:13:51 neto Exp neto $";d685 6d694 2a695 1 fprintf(debug,"/xs N 1 add array def\n/ys N 1 add array def\n");@1.121log@Changed debugging PostScript output so that we don't depend onlarge (>8191 element) arrays.@text@d6 4d73 1a73 1const char *read_rcs_id="$Id: read.w,v 1.120 1997/01/21 21:55:55 david Exp neto $";d711 1a711 1 fprintf(debug,"%f %f ts\n",i+1,p->coord[i].x,p->coord[i].y);@1.120log@Added standard copyright notice by including copyrt.w@text@d5 4a8 1{\obeylines$Log: read.w,v $d69 1a69 1const char *read_rcs_id="$Id: read.w,v 1.119 96/12/20 14:02:47 neto Exp $";d707 1a707 1 fprintf(debug,"%d %f %f s \n",i+1,p->coord[i].x,p->coord[i].y);a708 1fprintf(debug,"1 1 N { dup xs exch get exch ys exch get dot } for\n");@1.119log@Make EOF optional.@text@d1 1d6 3d66 1a66 1const char *read_rcs_id="$Id: read.w,v 1.118 96/12/13 17:11:23 neto Exp $";@1.118log@Make hypot optional.@text@d5 3d62 1a62 1const char *read_rcs_id="$Id: read.w,v 1.117 96/12/13 14:44:43 neto Exp $";d178 3a180 2 errorif( r != 1, "%d: Couldn't read the word following \"%s\".", lineno+1,keyword);d422 1@1.117log@Used hypot instead of sqrt.Also, added cost\_from\_euc2d\_raw.@text@d5 4d56 1d59 1a59 1const char *read_rcs_id="$Id: read.w,v 1.116 96/12/05 14:43:16 neto Exp $";d552 1a552 1 return (length_t) floor(0.5+hypot(xd,yd));d555 18d584 1a584 1 return (length_t) hypot(xd,yd);d601 1a601 1 return hypot(xd,yd);d610 1a610 1|floor| and |hypot|.@1.116log@Added support for no rounding.@text@d5 3d54 1a54 1const char *read_rcs_id="$Id: read.w,v 1.115 96/09/12 15:25:37 neto Exp Locker: neto $";d547 1a547 1 return (length_t) floor(0.5+sqrt(xd*xd+yd*yd));d561 1a561 1 return (length_t) sqrt(xd*xd+yd*yd);d564 6d571 14d587 1a587 1|floor| and |sqrt|.@1.115log@Empty input doesn't print a garbage keyword now.@text@d5 3d51 1a51 1const char *read_rcs_id="$Id: read.w,v 1.114 96/08/16 13:05:01 neto Exp Locker: neto $";d534 1a534 1Maybe be more intelligent about integer square roots???d547 2d550 12d586 2a587 1of the problem.d596 4a599 1 cost = cost_from_euc2d;@1.114log@Added fixincludes.@text@d5 3d48 1a48 1const char *read_rcs_id="$Id: read.w,v 1.113 96/08/15 14:01:29 neto Exp $";d160 1@1.113log@Make it pass all flags, except for error problem.@text@d5 3d37 1d45 1a45 1const char *read_rcs_id="$Id: read.w,v 1.112 96/08/15 12:34:25 neto Exp $";d457 1a457 1 putchar('\n');@1.112log@Make it pass -Wall@text@d5 3d39 1a39 1@@<Local subroutines@@>@@;d41 1a41 1const char *read_rcs_id="$Id: read.w,v 1.111 96/07/29 17:07:58 neto Exp $";d493 3a495 1@@<Local subroutines@@>=d502 2d510 1d525 2a526 1@@<Local subroutines@@>=d548 2a549 1@@<Local subroutines@@>=@1.111log@Fixed to compile.@text@d5 3d38 1a38 1const char *read_rcs_id="$Id: read.w,v 1.110 96/07/29 16:24:28 neto Exp $";d155 1a155 1 if ( colon = strchr(keyword,':') ) *colon = '\0';d286 1a286 1int long_dummy;a387 1 double dummy;@1.110log@oops. TeX again.@text@d5 3a24 1const char read_rcs_id="$Id: read.w,v 1.109 96/07/29 16:22:58 neto Exp $";d35 1@1.109log@TeX barfed on the Log.@text@d4 4a7 1{\obelyines$Log:$d22 1a22 1const char read_rcs_id="$Id: read.w,v 1.108 96/07/29 16:20:09 neto Exp $";@1.108log@Added *\_rcs\_id.Made sure RCS log is activated within this file.@text@d4 5a8 1{\obelyines$Log$d19 1a19 1const char read_rcs_id="$Id$";@1.107log@Took away side effects from the errorif calls.@text@d4 3d15 1d33 1@1.106log@Shortened `stuffcoord' to `s'.@text@d133 3a135 3 char *colon; errorif( 1 != fscanf(in," %s ", keyword), "%d: Couldn't read the word following \"%s\".",d188 7a194 5int l;if ( colon == NULL ) errorif( 0 != fscanf(in," : "), "%d: Missed the colon.\n", lineno);errorif( NULL == fgets(rest_of_line,MAX_LINE_LEN,in),d279 2a280 1 errorif( 1 != fscanf(in," %ld ", &long_dummy),d297 2a298 1 errorif( 1 != fscanf(in," %ld ", &long_dummy),d324 2a325 1 errorif( 1 != fscanf(in," %ld ", &long_dummy),@1.105log@Fixed grammar.@text@d588 1a588 1 fprintf(debug,"%d %f %f stuffcoord \n",i+1,p->coord[i].x,p->coord[i].y);d591 1@1.104log@Changed range values to double from int.@text@d181 1a181 1We're make sure that the colon is actually there, and that the line@1.103log@Leftrightarrow is now iffInclude webdefs.w and types.w@text@d382 1a382 1int xmin, xmax, ymin, ymax;d384 7a390 1@@ @@<Set the problem defaults@@>=d575 4a578 4fprintf(debug,"/xmin {%d} def \n",p->xmin);fprintf(debug,"/xmax {%d} def \n",p->xmax);fprintf(debug,"/ymin {%d} def \n",p->ymin);fprintf(debug,"/ymax {%d} def \n",p->ymax);@1.102log@*** empty log message ***@text@d1 3@1.101log@Changed interface to read_tsp_file@text@d441 1a441 1$${\mit cost}(i,j)\le {\mit cost}(k,l) \Leftrightarrowd443 1a443 1%$$ |cost(i,j)|\le|cost(k,l)|\Leftrightarrow@1.100log@This version works. Needs improvement: command-line switches faster tabu check allow Papadimitriou tabu rule faster preprocessing different candidate lists@text@d70 1a70 1read_tsp_file(const char *filename)a71 2 FILE *in;a72 2 in = fopen(filename,"r"); errorif(in==NULL,"Couldn't open the file \"%s\" for reading.\n",filename);d87 1a87 1tsp_instance_t * read_tsp_file(const char *filename);d132 2a133 2 "%s:%d: Couldn't read the word following \"%s\".", filename,lineno+1,keyword);d166 1a166 1 errorif(1,"%s:%d: Don't know what the keyword %s is!\n",filename,lineno,keyword);d188 1a188 1 "%s:%d: Missed the colon.\n", filename,lineno);d190 1a190 1 @@|"%s:%d: Couldn't read after the colon; truncated file?\n", filename,lineno);@@;d215 1a215 1 errorif(1,"%s:%d: Apology: Unknown edge weight type \"%s\".\n",filename,lineno,rest_of_line);d242 1a242 1 errorif(1,"%s:%d: Unknown edge weight format \"%s\".\n",filename,lineno,rest_of_line);d539 1a539 1@@*Verbose output routines.d541 1a541 1When debugging output is desired, |verbose>0|.d544 2a545 1about its contents to a debugging file. The file handle is |debug|.a546 5@@<Global variables@@>=extern int verbose;extern FILE *debug;a581 29}@@*Testing the file reading routine.@@(testread.c@@>=#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include "read.h"intmain(int argc,char **argv){ tsp_instance_t *p;errorif( argc!=2, "Usage: %s <tsp-filename>\n",argv[0] );p = read_tsp_file(argv[1]);printf("name: \"%s\"\n",p->name);printf("comment: \"%s\"\n",p->comment);printf("cities: %d\n",p->n); {int i,j; for(i=0;i<3; i++) { for(j=0;j<3; j++) { printf("cost(%d,%d)="length_t_spec"\n", i,j,(length_t_pcast(cost(i,j))); } } }return 0;@1.2log@Initial implementation of LK. This is buggy.@text@@1.1log@Initial revision@text@@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -