mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	sag:: fixed some warnings
This commit is contained in:
		| @@ -144,7 +144,7 @@ void dofullsa(ld satime) { | ||||
|      | ||||
|     if(t2 - tl > view_each * .98) { | ||||
|       tl = t2; | ||||
|       println(hlog, format("it %12Ld temp %6.4f [1/e at %13.6f] cost = %f ", | ||||
|       println(hlog, format("it %12lld temp %6.4f [1/e at %13.6f] cost = %f ", | ||||
|         numiter, double(sag::temperature), (double) exp(sag::temperature), | ||||
|         double(sag::cost))); | ||||
|       } | ||||
| @@ -205,7 +205,7 @@ void dofullsa_iterations(long long saiter) { | ||||
|  | ||||
|     if(cpct > lpct && output_fullsa) { | ||||
|       lpct = cpct; | ||||
|       println(hlog, format("it %12Ld ratio %6.3f temp %8.4f step %9.3g cost %9.2f R=%8.4f T=%8.4f", | ||||
|       println(hlog, format("it %12lld ratio %6.3f temp %8.4f step %9.3g cost %9.2f R=%8.4f T=%8.4f", | ||||
|         numiter, last_ratio, double(sag::temperature), (double) exp(sag::temperature), cost, lgsag.R, lgsag.T)); | ||||
|       } | ||||
|  | ||||
|   | ||||
| @@ -79,7 +79,7 @@ struct sagdist_t { | ||||
|     clear(); | ||||
|     fd = open(fname.c_str(), O_RDONLY | O_LARGEFILE); | ||||
|     if(fd == -1) throw hr_exception("open failed in map"); | ||||
|     read(fd, &N, 8); | ||||
|     if(read(fd, &N, 8) < 8) throw hr_exception("file error"); | ||||
|     tabmap = (distance*) mmap(nullptr, N*N*sizeof(distance)+8, PROT_READ, MAP_SHARED, fd, 0); | ||||
|  | ||||
|  | ||||
| @@ -117,7 +117,7 @@ struct sagdist_t { | ||||
|  | ||||
|   void save(string fname) { | ||||
|     fd = open(fname.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666); | ||||
|     write(fd, &N, 8); | ||||
|     if(write(fd, &N, 8) < 8) throw hr_exception("write error"); | ||||
|     size_t size =  N*N*sizeof(distance); | ||||
|     println(hlog, "size is ", hr::format("%zd", size)); | ||||
|     char *p = (char*) tab; | ||||
|   | ||||
| @@ -173,7 +173,7 @@ void load_sag_solution(const string& fname) { | ||||
| void load_sag_solution_basic(const string& fname) { | ||||
|   if(!(state & SS_DATA)) throw hr_exception("load_sag_solution_basic with no data"); | ||||
|   FILE *f = fopen(fname.c_str(), "rt"); | ||||
|   for(auto& i: sagid) fscanf(f, "%d", &i); | ||||
|   for(auto& i: sagid) if(fscanf(f, "%d", &i) < 1) throw hr_exception("read error in load_sag_solution_basic"); | ||||
|   fclose(f); | ||||
|   println(hlog, "loaded sagid = ", sagid); | ||||
|  | ||||
|   | ||||
| @@ -41,7 +41,7 @@ void iterate() { | ||||
|   if(t < (sag_ittime+1) / 2) ipturn *= 2; | ||||
|   else if(t > sag_ittime * 2) ipturn /= 2; | ||||
|   else ipturn = ipturn * sag_ittime / t; | ||||
|   print(hlog, format("it %12Ld temp %6.4f [2:%8.6f,10:%8.6f,50:%8.6f] cost = %f\n", | ||||
|   print(hlog, format("it %12lld temp %6.4f [2:%8.6f,10:%8.6f,50:%8.6f] cost = %f\n", | ||||
|     numiter, double(sag::temperature),  | ||||
|     (double) exp(-2 * exp(-sag::temperature)), | ||||
|     (double) exp(-10 * exp(-sag::temperature)), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue