00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024 #ifndef SHLIBMATRIX_HPP
00025 #define SHLIBMATRIX_HPP
00026
00027 #include "ShGeneric.hpp"
00028 #include "ShLib.hpp"
00029 #include "ShMatrix.hpp"
00030
00031 #ifndef WIN32
00032 namespace SH {
00033
00042 template<int M, int N, ShBindingType Binding, ShBindingType Binding2, typename T1, typename T2>
00043 ShMatrix<N, M, SH_TEMP, CT1T2>
00044 operator+(const ShMatrix<N, M, Binding, T1>& a, const ShMatrix<N, M, Binding2, T2>& b);
00045
00049 template<int M, int N, ShBindingType Binding, ShBindingType Binding2, typename T1, typename T2>
00050 ShMatrix<N, M, SH_TEMP, CT1T2>
00051 operator-(const ShMatrix<N, M, Binding, T1>& a, const ShMatrix<N, M, Binding2, T2>& b);
00052
00056 template<int M, int N, ShBindingType Binding, ShBindingType Binding2, typename T1, typename T2>
00057 ShMatrix<N, M, SH_TEMP, CT1T2>
00058 operator/(const ShMatrix<N, M, Binding, T1>& a, const ShMatrix<N, M, Binding2, T2>& b);
00059
00063 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2,
00064 typename T1, typename T2>
00065 ShMatrix<M, P, SH_TEMP, CT1T2>
00066 operator|(const ShMatrix<M, N, Binding, T1>& a,
00067 const ShMatrix<N, P, Binding2, T2>& b);
00068 template<int M, int N, int P, ShBindingType Binding, ShBindingType Binding2, typename T1, typename T2>
00069 ShMatrix<M, P, SH_TEMP, CT1T2>
00070 operator*(const ShMatrix<M, N, Binding, T1>& a,
00071 const ShMatrix<N, P, Binding2, T2>& b);
00072
00076 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00077 ShGeneric<M, CT1T2> operator|(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<N, T2>& b);
00078 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00079 ShGeneric<M, CT1T2> operator*(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<N, T2>& b);
00080
00084 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00085 ShGeneric<N, CT1T2> operator|(const ShGeneric<M, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00086 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00087 ShGeneric<N, CT1T2> operator*(const ShGeneric<M, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00088
00090 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00091 ShMatrix<M, N, SH_TEMP, CT1T2>
00092 operator*(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<1, T2>& b);
00093
00094 template<int M, ShBindingType Binding, typename T1, typename T2>
00095 ShMatrix<M, 1, SH_TEMP, CT1T2>
00096 operator*(const ShMatrix<M, 1, Binding, T1>& a, const ShGeneric<1, T2>& b);
00097
00099 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00100 ShMatrix<M, N, SH_TEMP, CT1T2>
00101 operator*(const ShGeneric<1, T1>& a, const ShMatrix<M, N, Binding, T2>& b);
00102
00103 template<int N, ShBindingType Binding, typename T1, typename T2>
00104 ShMatrix<1, N, SH_TEMP, CT1T2>
00105 operator*(const ShGeneric<1, T1>& a, const ShMatrix<1, N, Binding, T2>& b);
00106
00108 template<int M, int N, ShBindingType Binding, typename T1, typename T2>
00109 ShMatrix<M, N, SH_TEMP, CT1T2>
00110 operator/(const ShMatrix<M, N, Binding, T1>& a, const ShGeneric<1, T2>& b);
00111
00115 template<ShBindingType Binding2, typename T2>
00116 ShAttrib1f det(const ShMatrix<1, 1, Binding2, T2>& matrix);
00117
00118 template<ShBindingType Binding2, typename T2>
00119 ShAttrib1f det(const ShMatrix<2, 2, Binding2, T2>& matrix);
00120
00121 template<int RowsCols, ShBindingType Binding2, typename T2>
00122 ShAttrib1f det(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00123
00124
00128 template<int RowsCols, ShBindingType Binding2, typename T2>
00129 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2>
00130 cofactors(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00131
00137 template<int M, int N, ShBindingType Binding2, typename T2>
00138 ShMatrix<N, M, SH_TEMP, T2>
00139 transpose(const ShMatrix<M, N, Binding2, T2>& matrix);
00140
00144 template<int RowsCols, ShBindingType Binding2, typename T2>
00145 ShMatrix<RowsCols, RowsCols, SH_TEMP, T2>
00146 adjoint(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00147
00153 template<int RowsCols, ShBindingType Binding2, typename T2>
00154 ShMatrix<RowsCols,RowsCols, SH_TEMP, T2>
00155 inverse(const ShMatrix<RowsCols, RowsCols, Binding2, T2>& matrix);
00156
00161 template<int RowsCols, ShBindingType Binding, typename T>
00162 ShGeneric<1, T>
00163 trace(const ShMatrix<RowsCols, RowsCols, Binding, T>& matrix);
00164
00165 template<int N, typename T>
00166 ShMatrix<1, N, SH_TEMP, T>
00167 rowmat(const ShGeneric<N, T>& s0);
00168
00169 template<int N, typename T1, typename T2>
00170 ShMatrix<2, N, SH_TEMP, CT1T2>
00171 rowmat(const ShGeneric<N, T1>& s0,
00172 const ShGeneric<N, T2>& s1);
00173
00174 template<int N, typename T1, typename T2, typename T3>
00175 ShMatrix<3, N, SH_TEMP, CT1T2T3>
00176 rowmat(const ShGeneric<N, T1>& s0,
00177 const ShGeneric<N, T2>& s1,
00178 const ShGeneric<N, T3>& s2);
00179
00180 template<int N, typename T1, typename T2, typename T3, typename T4>
00181 ShMatrix<4, N, SH_TEMP, CT1T2T3T4>
00182 rowmat(const ShGeneric<N, T1>& s0,
00183 const ShGeneric<N, T2>& s1,
00184 const ShGeneric<N, T3>& s2,
00185 const ShGeneric<N, T4>& s3);
00186
00187 template<int N, typename T>
00188 ShMatrix<N, 1, SH_TEMP, T>
00189 colmat(const ShGeneric<N, T>& s0);
00190
00191 template<int N, typename T>
00192 ShMatrix<N, 2, SH_TEMP, T>
00193 colmat(const ShGeneric<N, T>& s0,
00194 const ShGeneric<N, T>& s1);
00195
00196 template<int N, typename T>
00197 ShMatrix<N, 3, SH_TEMP, T>
00198 colmat(const ShGeneric<N, T>& s0,
00199 const ShGeneric<N, T>& s1,
00200 const ShGeneric<N, T>& s2);
00201
00202 template<int N, typename T>
00203 ShMatrix<N, 4, SH_TEMP, T>
00204 colmat(const ShGeneric<N, T>& s0,
00205 const ShGeneric<N, T>& s1,
00206 const ShGeneric<N, T>& s2,
00207 const ShGeneric<N, T>& s3);
00208
00209 template<int N, typename T>
00210 ShMatrix<N, N, SH_TEMP, T>
00211 diag(const ShGeneric<N, T>& a);
00212
00226 template<typename T>
00227 ShMatrix<4, 4, SH_TEMP, T>
00228 rotate(const ShGeneric<3, T>& axis, const ShGeneric<1, T>& angle);
00229
00235 template<typename T>
00236 ShMatrix<3, 3, SH_TEMP, T>
00237 rotate(const ShGeneric<1, T>& angle);
00238
00244 template<typename T>
00245 ShMatrix<4, 4, SH_TEMP, T>
00246 translate(const ShGeneric<3, T>& a);
00247
00253 template<typename T>
00254 ShMatrix<3, 3, SH_TEMP, T>
00255 translate(const ShGeneric<2, T>& a);
00256
00262 template<typename T>
00263 ShMatrix<4, 4, SH_TEMP, T>
00264 scale(const ShGeneric<3, T>& a);
00265
00271 template<typename T>
00272 ShMatrix<3, 3, SH_TEMP, T>
00273 scale(const ShGeneric<2, T>& a);
00274
00280 template<int N, typename T>
00281 ShMatrix<N, N, SH_TEMP, T>
00282 scale(const ShGeneric<1, T>& a);
00283
00286 }
00287 #endif
00288
00289 #include "ShLibMatrixImpl.hpp"
00290
00291 #endif