Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 #ifndef WIN32
00035 namespace SH {
00036 
00045 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2, 
00046   typename T1, typename T2>
00047 ShMatrix<M, P, SH_TEMP, CT1T2>
00048 operator|(const ShMatrix<M, N, Binding, T1>& a,
00049           const ShMatrix<N, P, Binding2, T2>& b);
00050 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2, typename T1, typename T2>
00051 ShMatrix<M, P, SH_TEMP, CT1T2>
00052 operator*(const ShMatrix<M, N, Binding, T1>& a,
00053           const ShMatrix<N, P, Binding2, T2>& b);
00054 
00058 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00059 ShGeneric<M, CT1T2> 
00060 operator|(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<N, T2>& b);
00061 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00062 ShGeneric<M, CT1T2> operator*(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<N, T2>& b);
00063 
00067 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00068 ShGeneric<N, CT1T2> operator|(const ShGeneric<M, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00069 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00070 ShGeneric<N, CT1T2> operator*(const ShGeneric<M, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00071 
00073 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00074 ShMatrix<M, N, SH_TEMP, CT1T2>
00075 operator*(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<1, T2>& b);
00076 template<int M, ShBindingType Binding, typename T1, typename T2>
00077 ShMatrix<M, 1, SH_TEMP, CT1T2>
00078 operator*(const ShMatrix<M, 1, Binding, T1>& a, const ShGeneric<1, T2>& b);
00080 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00081 ShMatrix<M, N, SH_TEMP, CT1T2>
00082 operator*(const ShGeneric<1, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00083 template<int N, ShBindingType Binding, typename T1, typename T2>
00084 ShMatrix<1, N, SH_TEMP, CT1T2>
00085 operator*(const ShGeneric<1, T1>& a, const ShMatrix<1, N, Binding, T2>& b);
00087 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00088 ShMatrix<M, N, SH_TEMP, CT1T2>
00089 operator/(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<1, T2>& b);
00090 
00094 template<ShBindingType Binding2, typename T2>
00095 ShAttrib1f det(const ShMatrix<1, 1, Binding2, T2>& matrix);
00096 
00097 template<ShBindingType Binding2, typename T2>
00098 ShAttrib1f det(const ShMatrix<2, 2, Binding2, T2>& matrix);
00099     
00100 template<int RowsCols, ShBindingType Binding2, typename T2>
00101 ShAttrib1f det(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00102 
00103 
00107 template<int RowsCols, ShBindingType Binding2, typename T2>
00108 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2>
00109 cofactors(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00110     
00116 template<int M, int N, ShBindingType Binding2, typename T2>
00117 ShMatrix<N, M, SH_TEMP, T2>
00118 transpose(const ShMatrix<M, N, Binding2, T2>& matrix);
00119   
00123 template<int RowsCols, ShBindingType Binding2, typename T2>
00124 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2>
00125 adjoint(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00126 
00132 template<int RowsCols, ShBindingType Binding2, typename T2>
00133 ShMatrix<RowsCols,RowsCols, SH_TEMP, T2>
00134 inverse(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00135 
00136 template<int N, typename T>
00137 ShMatrix<1, N, SH_TEMP, T>
00138 rowmat(const ShGeneric<N, T>& s0);
00139 
00140 template<int N, typename T1, typename T2>
00141 ShMatrix<2, N, SH_TEMP, CT1T2>
00142 rowmat(const ShGeneric<N, T1>& s0,
00143        const ShGeneric<N, T2>& s1);
00144 
00145 template<int N, typename T1, typename T2, typename T3>
00146 ShMatrix<3, N, SH_TEMP, CT1T2T3>
00147 rowmat(const ShGeneric<N, T1>& s0,
00148        const ShGeneric<N, T2>& s1,
00149        const ShGeneric<N, T3>& s2);
00150 
00151 template<int N, typename T1, typename T2, typename T3, typename T4>
00152 ShMatrix<4, N, SH_TEMP, CT1T2T3T4>
00153 rowmat(const ShGeneric<N, T1>& s0,
00154        const ShGeneric<N, T2>& s1,
00155        const ShGeneric<N, T3>& s2,
00156        const ShGeneric<N, T4>& s3);
00157 
00158 template<int N, typename T>
00159 ShMatrix<N, 1, SH_TEMP, T>
00160 colmat(const ShGeneric<N, T>& s0);
00161 
00162 template<int N, typename T>
00163 ShMatrix<N, 2, SH_TEMP, T>
00164 colmat(const ShGeneric<N, T>& s0,
00165        const ShGeneric<N, T>& s1);
00166 
00167 template<int N, typename T>
00168 ShMatrix<N, 3, SH_TEMP, T>
00169 colmat(const ShGeneric<N, T>& s0,
00170        const ShGeneric<N, T>& s1,
00171        const ShGeneric<N, T>& s2);
00172 
00173 template<int N, typename T>
00174 ShMatrix<N, 4, SH_TEMP, T>
00175 colmat(const ShGeneric<N, T>& s0,
00176        const ShGeneric<N, T>& s1,
00177        const ShGeneric<N, T>& s2,
00178        const ShGeneric<N, T>& s3);
00179 
00180 template<int N, typename T>
00181 ShMatrix<N, N, SH_TEMP, T>
00182 diag(const ShGeneric<N, T>& a);
00183 
00197 template<typename T>
00198 ShMatrix<4, 4, SH_TEMP, T>
00199 rotate(const ShGeneric<3, T>& axis, const ShGeneric<1, T>& angle);
00200 
00206 template<typename T>
00207 ShMatrix<3, 3, SH_TEMP, T>
00208 rotate(const ShGeneric<1, T>& angle);
00209 
00215 template<typename T>
00216 ShMatrix<4, 4, SH_TEMP, T>
00217 translate(const ShGeneric<3, T>& a);
00218 
00224 template<typename T>
00225 ShMatrix<3, 3, SH_TEMP, T>
00226 translate(const ShGeneric<2, T>& a);
00227 
00233 template<typename T>
00234 ShMatrix<4, 4, SH_TEMP, T>
00235 scale(const ShGeneric<3, T>& a);
00236 
00242 template<typename T>
00243 ShMatrix<3, 3, SH_TEMP, T>
00244 scale(const ShGeneric<2, T>& a);
00245 
00251 template<int N, typename T>
00252 ShMatrix<N, N, SH_TEMP, T>
00253 scale(const ShGeneric<1, T>& a);
00254 
00257 }
00258 #endif
00259 
00260 #include "ShLibMatrixImpl.hpp"
00261 
00262 #endif

Generated on Mon Jan 24 18:36:33 2005 for Sh by  doxygen 1.4.1