mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-26 03:17:39 +00:00 
			
		
		
		
	hyperpoint:: det function is now based on the largest coordinate, making it more precise
This commit is contained in:
		| @@ -936,12 +936,14 @@ EX ld det(const transmatrix& T) { | ||||
|     ld det = 1; | ||||
|     transmatrix M = T; | ||||
|     for(int a=0; a<MDIM; a++) { | ||||
|       int max_at = a; | ||||
|       for(int b=a; b<MDIM; b++) | ||||
|         if(M[b][a]) { | ||||
|           if(b != a) | ||||
|             for(int c=a; c<MDIM; c++) tie(M[b][c], M[a][c]) = make_pair(-M[a][c], M[b][c]); | ||||
|           break; | ||||
|           } | ||||
|         if(abs(M[b][a]) > abs(M[max_at][a])) | ||||
|           max_at = b; | ||||
|        | ||||
|       if(max_at != a) | ||||
|         for(int c=a; c<MDIM; c++) tie(M[max_at][c], M[a][c]) = make_pair(-M[a][c], M[max_at][c]); | ||||
|  | ||||
|       if(!M[a][a]) return 0; | ||||
|       for(int b=a+1; b<MDIM; b++) { | ||||
|         ld co = -M[b][a] / M[a][a]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue