Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

E1Sqrt.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Element_E1Sqrt_h
00002 #define Impala_Core_Array_Element_E1Sqrt_h
00003 
00004 #include "Core/Array/Element/ArithTypes.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Array
00011 {
00012 namespace Element
00013 {
00014 
00015 
00016 inline Real64
00017 E1Sqrt(Int32 v)
00018 {
00019     return ::sqrt(Real64(v));
00020 }
00021 
00022 inline Real64
00023 E1Sqrt(Real64 v)
00024 {
00025     return ::sqrt(v);
00026 }
00027 
00028 inline Vec3Real64
00029 E1Sqrt(const Vec3Int32& v)
00030 {
00031     return Vec3Real64(::sqrt(Real64(v.X())), ::sqrt(Real64(v.Y())),
00032                       ::sqrt(Real64(v.Z())));
00033 }
00034 
00035 inline Vec3Real64
00036 E1Sqrt(const Vec3Real64& v)
00037 {
00038     return Vec3Real64(::sqrt(v.X()), ::sqrt(v.Y()), ::sqrt(v.Z()));
00039 }
00040 
00041 inline Complex64
00042 E1Sqrt(const Complex64& v)
00043 {
00044     Real64 a = v.X();
00045     Real64 b = v.Y();
00046     Real64 sq = a*a+b*b;
00047     Real64 arg = ::atan(b/a)*0.5;
00048     Real64 mul = ::pow(sq, 0.25)*::exp(a*0.5);
00049 
00050     return Complex64(mul*::cos(arg), mul*::sin(arg));
00051 }
00052 
00053 } // namespace Element
00054 } // namespace Array
00055 } // namespace Core
00056 } // namespace Impala
00057 
00058 #endif

Generated on Fri Mar 19 09:30:45 2010 for ImpalaSrc by  doxygen 1.5.1