Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ShLibTrigImpl.hpp

00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00004 // Project administrator: Michael D. McCool 00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00006 // Michael D. McCool 00007 // 00008 // This software is provided 'as-is', without any express or implied 00009 // warranty. In no event will the authors be held liable for any damages 00010 // arising from the use of this software. 00011 // 00012 // Permission is granted to anyone to use this software for any purpose, 00013 // including commercial applications, and to alter it and redistribute it 00014 // freely, subject to the following restrictions: 00015 // 00016 // 1. The origin of this software must not be misrepresented; you must 00017 // not claim that you wrote the original software. If you use this 00018 // software in a product, an acknowledgment in the product documentation 00019 // would be appreciated but is not required. 00020 // 00021 // 2. Altered source versions must be plainly marked as such, and must 00022 // not be misrepresented as being the original software. 00023 // 00024 // 3. This notice may not be removed or altered from any source 00025 // distribution. 00027 #ifndef SHLIBTRIGIMPL_HPP 00028 #define SHLIBTRIGIMPL_HPP 00029 00030 #include "ShLibTrig.hpp" 00031 #include "ShAttrib.hpp" 00032 #include "ShInstructions.hpp" 00033 00034 namespace SH { 00035 00036 template<int N, typename T> 00037 inline 00038 ShGeneric<N, T> acos(const ShGeneric<N, T>& var) 00039 { 00040 ShAttrib<N, SH_TEMP, T> t; 00041 shACOS(t, var); 00042 return t; 00043 } 00044 00045 template<int N, typename T> 00046 inline 00047 ShGeneric<N, T> asin(const ShGeneric<N, T>& var) 00048 { 00049 ShAttrib<N, SH_TEMP, T> t; 00050 shASIN(t, var); 00051 return t; 00052 } 00053 00054 template<int N, typename T> 00055 inline 00056 ShGeneric<N, T> atan(const ShGeneric<N, T>& var) 00057 { 00058 ShAttrib<N, SH_TEMP, T> t; 00059 shATAN(t, var); 00060 return t; 00061 } 00062 00063 template<int N, typename T> 00064 inline 00065 ShGeneric<N, T> atan2(const ShGeneric<N, T>& y, const ShGeneric<N, T>& x) 00066 { 00067 ShAttrib<N, SH_TEMP, T> t; 00068 shATAN2(t, y, x); 00069 return t; 00070 } 00071 00072 template<int N, typename T> 00073 inline 00074 ShGeneric<N, T> cos(const ShGeneric<N, T>& var) 00075 { 00076 ShAttrib<N, SH_TEMP, T> t; 00077 shCOS(t, var); 00078 return t; 00079 } 00080 00081 template<int N, typename T> 00082 inline 00083 ShGeneric<N, T> sin(const ShGeneric<N, T>& var) 00084 { 00085 ShAttrib<N, SH_TEMP, T> t; 00086 shSIN(t, var); 00087 return t; 00088 } 00089 00090 template<int N, typename T> 00091 inline 00092 ShGeneric<N, T> tan(const ShGeneric<N, T>& var) 00093 { 00094 ShAttrib<N, SH_TEMP, T> t; 00095 shTAN(t, var); 00096 return t; 00097 } 00098 00099 } 00100 00101 #endif

Generated on Mon Oct 18 14:17:39 2004 for Sh by doxygen 1.3.7