[geos-commits] r3336 - in trunk: include/geos/algorithm src/algorithm

svn_geos at osgeo.org svn_geos at osgeo.org
Tue May 10 05:50:05 EDT 2011


Author: strk
Date: 2011-05-10 02:50:05 -0700 (Tue, 10 May 2011)
New Revision: 3336

Modified:
   trunk/include/geos/algorithm/HCoordinate.h
   trunk/src/algorithm/HCoordinate.cpp
Log:
Bring hcoordinate back to double precision (from long double)

Modified: trunk/include/geos/algorithm/HCoordinate.h
===================================================================
--- trunk/include/geos/algorithm/HCoordinate.h	2011-05-09 11:57:28 UTC (rev 3335)
+++ trunk/include/geos/algorithm/HCoordinate.h	2011-05-10 09:50:05 UTC (rev 3336)
@@ -63,11 +63,11 @@
 				 const geom::Coordinate &q2,
 				 geom::Coordinate &ret);
 
-	long double x,y,w;
+	double x,y,w;
 
 	HCoordinate();
 
-	HCoordinate(long double _x, long double _y, long double _w);
+	HCoordinate(double _x, double _y, double _w);
 
 	HCoordinate(const geom::Coordinate& p);
 
@@ -86,9 +86,9 @@
 
 	HCoordinate(const HCoordinate &p1, const HCoordinate &p2);
 
-	long double getX() const;
+	double getX() const;
 
-	long double getY() const;
+	double getY() const;
 
 	void getCoordinate(geom::Coordinate &ret) const;
 
@@ -101,19 +101,3 @@
 
 #endif // GEOS_ALGORITHM_HCOORDINATE_H
 
-/**********************************************************************
- * $Log$
- * Revision 1.4  2006/04/20 14:27:40  strk
- * HCoordinate class changed to use long double types internally, in order to improve computation precision
- *
- * Revision 1.3  2006/04/14 09:02:16  strk
- * Hadded output operator and debugging prints for HCoordinate.
- *
- * Revision 1.2  2006/04/04 11:37:01  strk
- * Port information + initialization lists in ctors
- *
- * Revision 1.1  2006/03/09 16:46:48  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/
-

Modified: trunk/src/algorithm/HCoordinate.cpp
===================================================================
--- trunk/src/algorithm/HCoordinate.cpp	2011-05-09 11:57:28 UTC (rev 3335)
+++ trunk/src/algorithm/HCoordinate.cpp	2011-05-10 09:50:05 UTC (rev 3336)
@@ -34,7 +34,7 @@
 #endif
 
 // Define to make -ffloat-store be effective for this class
-//#define STORE_INTERMEDIATE_COMPUTATION_VALUES 1
+#define STORE_INTERMEDIATE_COMPUTATION_VALUES 1
 
 using namespace std;
 using namespace geos::geom;
@@ -112,7 +112,7 @@
 }
 
 /*public*/
-HCoordinate::HCoordinate(long double _x, long double _y, long double _w)
+HCoordinate::HCoordinate(double _x, double _y, double _w)
 	:
 	x(_x),
 	y(_y),
@@ -172,16 +172,16 @@
 
 HCoordinate::HCoordinate(const HCoordinate &p1, const HCoordinate &p2)
 {
-        long double xf1 = p1.y*p2.w;
-        long double xf2 = p2.y*p1.w;
+        double xf1 = p1.y*p2.w;
+        double xf2 = p2.y*p1.w;
         x = xf1 - xf2;
 
-        long double yf1 = p2.x*p1.w;
-        long double yf2 = p1.x*p2.w;
+        double yf1 = p2.x*p1.w;
+        double yf2 = p1.x*p2.w;
         y = yf1 - yf2;
 
-        long double wf1 = p1.x*p2.y;
-        long double wf2 = p2.x*p1.y;
+        double wf1 = p1.x*p2.y;
+        double wf2 = p2.x*p1.y;
         w = wf1 - wf2;
 
 #if GEOS_DEBUG
@@ -200,10 +200,10 @@
 #endif // def STORE_INTERMEDIATE_COMPUTATION_VALUES
 
 /*public*/
-long double
+double
 HCoordinate::getX() const
 {
-	long double a = x/w;
+	double a = x/w;
 
 	//if (std::fabs(a) > std::numeric_limits<double>::max())
 	if ( !FINITE(a) )
@@ -214,10 +214,10 @@
 }
 
 /*public*/
-long double
+double
 HCoordinate::getY() const
 {
-	long double a = y/w;
+	double a = y/w;
 
 	//if (std::fabs(a) > std::numeric_limits<double>::max())
 	if ( !FINITE(a) )
@@ -243,32 +243,3 @@
 } // namespace geos.algorithm
 } // namespace geos
 
-/**********************************************************************
- * $Log$
- * Revision 1.24  2006/06/27 15:59:36  strk
- * * source/algorithm/HCoordinate.cpp: added support for MingW -ansi builds.
- *
- * Revision 1.23  2006/04/20 14:27:40  strk
- * HCoordinate class changed to use long double types internally, in order to improve computation precision
- *
- * Revision 1.22  2006/04/20 11:11:57  strk
- * source/algorithm/HCoordinate.cpp: added compile time define to force storage of intermediate computation values to variables (in order to make the -ffloat-store gcc switch effective). Disabled by default.
- *
- * Revision 1.21  2006/04/14 09:02:16  strk
- * Hadded output operator and debugging prints for HCoordinate.
- *
- * Revision 1.20  2006/04/04 11:37:00  strk
- * Port information + initialization lists in ctors
- *
- * Revision 1.19  2006/04/04 11:28:12  strk
- * NotRepresentable condition detected using finite() from <cmath>
- * rather then using FINITE() macro. Made ::intersection() body
- * more readable.
- *
- * Revision 1.18  2006/03/21 11:12:23  strk
- * Cleanups: headers inclusion and Log section
- *
- * Revision 1.17  2006/03/09 16:46:45  strk
- * geos::geom namespace definition, first pass at headers split
- **********************************************************************/
-



More information about the geos-commits mailing list