← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2197: 1. Add forgotten file

 

------------------------------------------------------------
revno: 2197
fixes bug(s): https://launchpad.net/bugs/575210
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-05-04 17:52:56 +0200
message:
  1. Add forgotten file
added:
  lib/base/Math.cpp
modified:
  lib/base/Math.hpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== added file 'lib/base/Math.cpp'
--- lib/base/Math.cpp	1970-01-01 00:00:00 +0000
+++ lib/base/Math.cpp	2010-05-04 15:52:56 +0000
@@ -0,0 +1,11 @@
+#include<yade/lib-base/Math.hpp>
+#if defined(YADE_NOWM3) and defined(YADE_EIGEN)
+	template<> const Real Math<Real>::EPSILON = DBL_EPSILON;
+	template<> const Real Math<Real>::ZERO_TOLERANCE = 1e-20;
+	template<> const Real Math<Real>::MAX_REAL = DBL_MAX;
+	template<> const Real Math<Real>::PI = 4.0*atan(1.0);
+	template<> const Real Math<Real>::TWO_PI = 2.0*Math<Real>::PI;
+	template<> const Real Math<Real>::HALF_PI = 0.5*Math<Real>::PI;
+	template<> const Real Math<Real>::DEG_TO_RAD = Math<Real>::PI/180.0;
+	template<> const Real Math<Real>::RAD_TO_DEG = 180.0/Math<Real>::PI;
+#endif

=== modified file 'lib/base/Math.hpp'
--- lib/base/Math.hpp	2010-05-04 13:56:05 +0000
+++ lib/base/Math.hpp	2010-05-04 15:52:56 +0000
@@ -1,6 +1,14 @@
 // © 2010 Václav Šmilauer <eudoxos@xxxxxxxx>
 #pragma once
 
+#if 0 // broken, do not use
+// optimize as much as possible even in the debug mode (effective?)
+#if defined(__GNUG__) && __GNUC__ >= 4 && __GNUC_MINOR__ >=4
+	#pragma GCC push_options
+	#pragma GCC optimize "2"
+#endif
+#endif
+
 #ifdef QUAD_PRECISION
 	typedef long double quad;
 	typedef quad Real;
@@ -20,11 +28,11 @@
 	#define EIGEN_DONT_VECTORIZE
 	#define EIGEN_DONT_ALIGN
 	#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
-	#include<Eigen/Core>
-	#include<Eigen/Geometry>
-	#include<Eigen/QR>
-	#include<Eigen/LU>
-	#include<float.h>
+		#include<Eigen/Core>
+		#include<Eigen/Geometry>
+		#include<Eigen/QR>
+		#include<Eigen/LU>
+		#include<float.h>
 	// USING_PART_OF_NAMESPACE_EIGEN
 	//using namespace eigen; // for eigen3
 	// 
@@ -296,4 +304,9 @@
 
 #endif /* __GCCXML */
 
-
+#if 0
+// revert optimization options back
+#if defined(__GNUG__) && __GNUC__ >= 4 && __GNUC_MINOR__ >=4
+	#pragma GCC pop_options
+#endif
+#endif