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

ShLibMatrix.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 SHLIBMATRIX_HPP 00028 #define SHLIBMATRIX_HPP 00029 00030 #include "ShGeneric.hpp" 00031 #include "ShLib.hpp" 00032 #include "ShMatrix.hpp" 00033 00034 namespace SH { 00035 00044 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2, typename T> 00045 ShMatrix<M, P, SH_TEMP, T> 00046 operator|(const ShMatrix<M, N, Binding, T>& a, 00047 const ShMatrix<N, P, Binding2, T>& b); 00048 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2, typename T> 00049 ShMatrix<M, P, SH_TEMP, T> 00050 operator*(const ShMatrix<M, N, Binding, T>& a, 00051 const ShMatrix<N, P, Binding2, T>& b); 00052 00056 template<int M, int N, ShBindingType Binding, typename T> 00057 ShGeneric<M, T> operator|(const ShMatrix<M, N, Binding, T>& a, const ShGeneric<N, T>& b); 00058 template<int M, int N, ShBindingType Binding, typename T> 00059 ShGeneric<M, T> operator*(const ShMatrix<M, N, Binding, T>& a, const ShGeneric<N, T>& b); 00060 00064 template<int M, int N, ShBindingType Binding, typename T> 00065 ShGeneric<N, T> operator|(const ShGeneric<M, T>& a, const ShMatrix<M, N, Binding, T>& b); 00066 template<int M, int N, ShBindingType Binding, typename T> 00067 ShGeneric<N, T> operator*(const ShGeneric<M, T>& a, const ShMatrix<M, N, Binding, T>& b); 00068 00070 template<int M, int N, ShBindingType Binding, typename T> 00071 ShMatrix<M, N, SH_TEMP, T> 00072 operator*(const ShMatrix<M, N, Binding, T>& a, const ShGeneric<1, T>& b); 00073 template<int M, ShBindingType Binding, typename T> 00074 ShMatrix<M, 1, SH_TEMP, T> 00075 operator*(const ShMatrix<M, 1, Binding, T>& a, const ShGeneric<1, T>& b); 00077 template<int M, int N, ShBindingType Binding, typename T> 00078 ShMatrix<M, N, SH_TEMP, T> 00079 operator*(const ShGeneric<1, T>& a, const ShMatrix<M, N, Binding, T>& b); 00080 template<int N, ShBindingType Binding, typename T> 00081 ShMatrix<1, N, SH_TEMP, T> 00082 operator*(const ShGeneric<1, T>& a, const ShMatrix<1, N, Binding, T>& b); 00084 template<int M, int N, ShBindingType Binding, typename T> 00085 ShMatrix<M, N, SH_TEMP, T> 00086 operator/(const ShMatrix<M, N, Binding, T>& a, const ShGeneric<1, T>& b); 00087 00091 template<ShBindingType Binding2, typename T2> 00092 ShAttrib1f det(const ShMatrix<1, 1, Binding2, T2>& matrix); 00093 00094 template<ShBindingType Binding2, typename T2> 00095 ShAttrib1f det(const ShMatrix<2, 2, Binding2, T2>& matrix); 00096 00097 template<int RowsCols, ShBindingType Binding2, typename T2> 00098 ShAttrib1f det(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix); 00099 00100 00104 template<int RowsCols, ShBindingType Binding2, typename T2> 00105 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2> 00106 cofactors(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix); 00107 00113 template<int M, int N, ShBindingType Binding2, typename T2> 00114 ShMatrix<N, M, SH_TEMP, T2> 00115 transpose(const ShMatrix<M, N, Binding2, T2>& matrix); 00116 00120 template<int RowsCols, ShBindingType Binding2, typename T2> 00121 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2> 00122 adjoint(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix); 00123 00129 template<int RowsCols, ShBindingType Binding2, typename T2> 00130 ShMatrix<RowsCols,RowsCols, SH_TEMP, T2> 00131 inverse(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix); 00132 00133 template<int N, typename T> 00134 ShMatrix<1, N, SH_TEMP, T> 00135 rowmat(const ShGeneric<N, T>& s0); 00136 00137 template<int N, typename T> 00138 ShMatrix<2, N, SH_TEMP, T> 00139 rowmat(const ShGeneric<N, T>& s0, 00140 const ShGeneric<N, T>& s1); 00141 00142 template<int N, typename T> 00143 ShMatrix<3, N, SH_TEMP, T> 00144 rowmat(const ShGeneric<N, T>& s0, 00145 const ShGeneric<N, T>& s1, 00146 const ShGeneric<N, T>& s2); 00147 00148 template<int N, typename T> 00149 ShMatrix<4, N, SH_TEMP, T> 00150 rowmat(const ShGeneric<N, T>& s0, 00151 const ShGeneric<N, T>& s1, 00152 const ShGeneric<N, T>& s2, 00153 const ShGeneric<N, T>& s3); 00154 00155 template<int N, typename T> 00156 ShMatrix<N, 1, SH_TEMP, T> 00157 colmat(const ShGeneric<N, T>& s0); 00158 00159 template<int N, typename T> 00160 ShMatrix<N, 2, SH_TEMP, T> 00161 colmat(const ShGeneric<N, T>& s0, 00162 const ShGeneric<N, T>& s1); 00163 00164 template<int N, typename T> 00165 ShMatrix<N, 3, SH_TEMP, T> 00166 colmat(const ShGeneric<N, T>& s0, 00167 const ShGeneric<N, T>& s1, 00168 const ShGeneric<N, T>& s2); 00169 00170 template<int N, typename T> 00171 ShMatrix<N, 4, SH_TEMP, T> 00172 colmat(const ShGeneric<N, T>& s0, 00173 const ShGeneric<N, T>& s1, 00174 const ShGeneric<N, T>& s2, 00175 const ShGeneric<N, T>& s3); 00176 00177 template<int N, typename T> 00178 ShMatrix<N, N, SH_TEMP, T> 00179 diag(const ShGeneric<N, T>& a); 00180 00194 template<typename T> 00195 ShMatrix<4, 4, SH_TEMP, T> 00196 rotate(const ShGeneric<3, T>& axis, const ShGeneric<1, T>& angle); 00197 00203 template<typename T> 00204 ShMatrix<3, 3, SH_TEMP, T> 00205 rotate(const ShGeneric<1, T>& angle); 00206 00212 template<typename T> 00213 ShMatrix<4, 4, SH_TEMP, T> 00214 translate(const ShGeneric<3, T>& a); 00215 00221 template<typename T> 00222 ShMatrix<3, 3, SH_TEMP, T> 00223 translate(const ShGeneric<2, T>& a); 00224 00230 template<typename T> 00231 ShMatrix<4, 4, SH_TEMP, T> 00232 scale(const ShGeneric<3, T>& a); 00233 00239 template<typename T> 00240 ShMatrix<3, 3, SH_TEMP, T> 00241 scale(const ShGeneric<2, T>& a); 00242 00248 template<int N, typename T> 00249 ShMatrix<N, N, SH_TEMP, T> 00250 scale(const ShGeneric<1, T>& a); 00251 00254 } 00255 00256 #include "ShLibMatrixImpl.hpp" 00257 00258 #endif

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