s/std::atan2/ei_atan2

This commit is contained in:
Gael Guennebaud 2009-07-31 10:08:23 +02:00
parent 2dce3311f7
commit 841ec959e5
2 changed files with 13 additions and 13 deletions

View File

@ -102,7 +102,7 @@ inline float ei_exp(float x) { return std::exp(x); }
inline float ei_log(float x) { return std::log(x); } inline float ei_log(float x) { return std::log(x); }
inline float ei_sin(float x) { return std::sin(x); } inline float ei_sin(float x) { return std::sin(x); }
inline float ei_cos(float x) { return std::cos(x); } inline float ei_cos(float x) { return std::cos(x); }
inline float ei_atan2( float y, float x ) { return std::atan2(y,x); } inline float ei_atan2(float y, float x) { return std::atan2(y,x); }
inline float ei_pow(float x, float y) { return std::pow(x, y); } inline float ei_pow(float x, float y) { return std::pow(x, y); }
template<> inline float ei_random(float a, float b) template<> inline float ei_random(float a, float b)
@ -150,7 +150,7 @@ inline double ei_exp(double x) { return std::exp(x); }
inline double ei_log(double x) { return std::log(x); } inline double ei_log(double x) { return std::log(x); }
inline double ei_sin(double x) { return std::sin(x); } inline double ei_sin(double x) { return std::sin(x); }
inline double ei_cos(double x) { return std::cos(x); } inline double ei_cos(double x) { return std::cos(x); }
inline double ei_atan2( double y, double x ) { return std::atan2(y,x); } inline double ei_atan2(double y, double x) { return std::atan2(y,x); }
inline double ei_pow(double x, double y) { return std::pow(x, y); } inline double ei_pow(double x, double y) { return std::pow(x, y); }
template<> inline double ei_random(double a, double b) template<> inline double ei_random(double a, double b)
@ -195,7 +195,7 @@ inline float ei_abs2(const std::complex<float>& x) { return std::norm(x); }
inline std::complex<float> ei_exp(std::complex<float> x) { return std::exp(x); } inline std::complex<float> ei_exp(std::complex<float> x) { return std::exp(x); }
inline std::complex<float> ei_sin(std::complex<float> x) { return std::sin(x); } inline std::complex<float> ei_sin(std::complex<float> x) { return std::sin(x); }
inline std::complex<float> ei_cos(std::complex<float> x) { return std::cos(x); } inline std::complex<float> ei_cos(std::complex<float> x) { return std::cos(x); }
inline std::complex<float> ei_atan2(std::complex<float> , std::complex<float> ) { ei_assert(false); return 0; } inline std::complex<float> ei_atan2(std::complex<float>, std::complex<float> ) { ei_assert(false); return 0; }
template<> inline std::complex<float> ei_random() template<> inline std::complex<float> ei_random()
{ {
@ -230,7 +230,7 @@ inline double ei_abs2(const std::complex<double>& x) { return std::norm(x); }
inline std::complex<double> ei_exp(std::complex<double> x) { return std::exp(x); } inline std::complex<double> ei_exp(std::complex<double> x) { return std::exp(x); }
inline std::complex<double> ei_sin(std::complex<double> x) { return std::sin(x); } inline std::complex<double> ei_sin(std::complex<double> x) { return std::sin(x); }
inline std::complex<double> ei_cos(std::complex<double> x) { return std::cos(x); } inline std::complex<double> ei_cos(std::complex<double> x) { return std::cos(x); }
inline std::complex<double> ei_atan2(std::complex<double> , std::complex<double> ) { ei_assert(false); return 0; } inline std::complex<double> ei_atan2(std::complex<double>, std::complex<double>) { ei_assert(false); return 0; }
template<> inline std::complex<double> ei_random() template<> inline std::complex<double> ei_random()
{ {
@ -268,7 +268,7 @@ inline long double ei_exp(long double x) { return std::exp(x); }
inline long double ei_log(long double x) { return std::log(x); } inline long double ei_log(long double x) { return std::log(x); }
inline long double ei_sin(long double x) { return std::sin(x); } inline long double ei_sin(long double x) { return std::sin(x); }
inline long double ei_cos(long double x) { return std::cos(x); } inline long double ei_cos(long double x) { return std::cos(x); }
inline long double ei_atan2( long double y, long double x ) { return std::atan2(y,x); } inline long double ei_atan2(long double y, long double x) { return std::atan2(y,x); }
inline long double ei_pow(long double x, long double y) { return std::pow(x, y); } inline long double ei_pow(long double x, long double y) { return std::pow(x, y); }
template<> inline long double ei_random(long double a, long double b) template<> inline long double ei_random(long double a, long double b)

View File

@ -60,31 +60,31 @@ MatrixBase<Derived>::eulerAngles(int a0, int a1, int a2) const
if (a0==a2) if (a0==a2)
{ {
Scalar s = Vector2(coeff(j,i) , coeff(k,i)).norm(); Scalar s = Vector2(coeff(j,i) , coeff(k,i)).norm();
res[1] = std::atan2(s, coeff(i,i)); res[1] = ei_atan2(s, coeff(i,i));
if (s > epsilon) if (s > epsilon)
{ {
res[0] = std::atan2(coeff(j,i), coeff(k,i)); res[0] = ei_atan2(coeff(j,i), coeff(k,i));
res[2] = std::atan2(coeff(i,j),-coeff(i,k)); res[2] = ei_atan2(coeff(i,j),-coeff(i,k));
} }
else else
{ {
res[0] = Scalar(0); res[0] = Scalar(0);
res[2] = (coeff(i,i)>0?1:-1)*std::atan2(-coeff(k,j), coeff(j,j)); res[2] = (coeff(i,i)>0?1:-1)*ei_atan2(-coeff(k,j), coeff(j,j));
} }
} }
else else
{ {
Scalar c = Vector2(coeff(i,i) , coeff(i,j)).norm(); Scalar c = Vector2(coeff(i,i) , coeff(i,j)).norm();
res[1] = std::atan2(-coeff(i,k), c); res[1] = ei_atan2(-coeff(i,k), c);
if (c > epsilon) if (c > epsilon)
{ {
res[0] = std::atan2(coeff(j,k), coeff(k,k)); res[0] = ei_atan2(coeff(j,k), coeff(k,k));
res[2] = std::atan2(coeff(i,j), coeff(i,i)); res[2] = ei_atan2(coeff(i,j), coeff(i,i));
} }
else else
{ {
res[0] = Scalar(0); res[0] = Scalar(0);
res[2] = (coeff(i,k)>0?1:-1)*std::atan2(-coeff(k,j), coeff(j,j)); res[2] = (coeff(i,k)>0?1:-1)*ei_atan2(-coeff(k,j), coeff(j,j));
} }
} }
if (!odd) if (!odd)