#include <TinyMatrix.hpp>


Public Types | |
| enum | { NumberOfLines = M, NumberOfRow = N } |
| typedef TinyVector< N > | AssociatedVector |
| typedef TinyVector< M > | AssociatedTransposedVector |
| typedef T | ValueType |
Public Member Functions | |
| T & | operator() (const size_t &i, const size_t &j) |
| const T & | operator() (const size_t &i, const size_t &j) const |
| const TinyMatrix< M, N, T > & | operator= (const TinyMatrix< M, N, T > &B) |
| const TinyMatrix< M, N, T > & | operator+= (const TinyMatrix< M, N, T > &B) |
| const TinyMatrix< M, N, T > & | operator-= (const TinyMatrix< M, N, T > &B) |
| template<size_t P> | |
| TinyMatrix< M, P > | operator* (const TinyMatrix< N, P > &B) const |
| TinyVector< M, T > | operator* (const TinyVector< N, T > &v) const |
| TinyMatrix< M, N, T > | operator* (const T &t) const |
| TinyMatrix< M, N, T > | operator/ (const T &t) const |
| const TinyMatrix< M, N, T > & | operator*= (const T &t) |
| const TinyMatrix< M, N, T > & | operator/= (const T &t) |
| TinyMatrix< M, N, T > | operator+ (const TinyMatrix< M, N, T > &B) const |
| TinyMatrix< M, N, T > | operator- (const TinyMatrix< M, N, T > &B) const |
| TinyMatrix () | |
| TinyMatrix (const TinyMatrix< M, N, T > &B) | |
| TinyMatrix (const T &t) | |
| ~TinyMatrix () | |
Private Attributes | |
| T | __x [M][N] |
Friends | |
| TinyMatrix< M, N, T > | operator* (const T &t, const TinyMatrix< M, N, T > &A) |
| std::ostream & | operator<< (std::ostream &os, const TinyMatrix< M, N, T > &A) |
specialization for matrices 1x1
,T>
Definition at line 37 of file TinyMatrix.hpp.
| typedef TinyVector<N> TinyMatrix< M, N, T >::AssociatedVector |
Type of compatibke vector
Definition at line 41 of file TinyMatrix.hpp.
| typedef TinyVector<M> TinyMatrix< M, N, T >::AssociatedTransposedVector |
Type of compatible transposed vector
Definition at line 44 of file TinyMatrix.hpp.
| typedef T TinyMatrix< M, N, T >::ValueType |
The type of the elements of the TinyMatrix
Definition at line 47 of file TinyMatrix.hpp.
| anonymous enum |
Definition at line 50 of file TinyMatrix.hpp.
00050 { 00051 NumberOfLines = M, 00052 NumberOfRow = N 00053 };
| TinyMatrix< M, N, T >::TinyMatrix | ( | ) | [inline] |
Default constructor
Definition at line 305 of file TinyMatrix.hpp.
00306 { 00307 T* y = __x[0]; 00308 for (size_t i=0; i<M*N; i++) { 00309 y[i] = 0; 00310 } 00311 }
| TinyMatrix< M, N, T >::TinyMatrix | ( | const TinyMatrix< M, N, T > & | B | ) | [inline] |
Copy constructor
| B | the matrix to copy |
Definition at line 318 of file TinyMatrix.hpp.
00319 { 00320 T* y = __x[0]; 00321 const T* B_y = B.__x[0]; 00322 for (size_t i=0; i<M*N; i++) { 00323 y[i] = B_y[i]; 00324 } 00325 }
| TinyMatrix< M, N, T >::TinyMatrix | ( | const T & | t | ) | [inline] |
Constructs a matrix using a given T
| t | the given T |
does have no sens (diagonal is not well defined)
Definition at line 336 of file TinyMatrix.hpp.
00337 { 00338 for (size_t i=0; i<M; i++) 00339 for (size_t j=0; j<N; j++) 00340 __x[i][j] = (i==j)?t:0; 00341 }
| TinyMatrix< M, N, T >::~TinyMatrix | ( | ) | [inline] |
| T& TinyMatrix< M, N, T >::operator() | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | [inline] |
Access to the
coefficient of the matrix
| i | the line number | |
| j | the row number |
Definition at line 68 of file TinyMatrix.hpp.
| const T& TinyMatrix< M, N, T >::operator() | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const [inline] |
Read-only access to the (i,j) coefficient of the matrix
| i | the line number | |
| j | the row number |
Definition at line 82 of file TinyMatrix.hpp.
| const TinyMatrix<M,N,T>& TinyMatrix< M, N, T >::operator= | ( | const TinyMatrix< M, N, T > & | B | ) | [inline] |
Makes the current matrix be equal to a given one
| B | the given matrix |
Definition at line 95 of file TinyMatrix.hpp.
00096 { 00097 T* y = __x[0]; 00098 const T* B_y = B.__x[0]; 00099 for (size_t i=0; i<M*N; i++) 00100 y[i] = B_y[i]; 00101 return (*this); 00102 }
| const TinyMatrix<M,N,T>& TinyMatrix< M, N, T >::operator+= | ( | const TinyMatrix< M, N, T > & | B | ) | [inline] |
Adds a matrix to a given one
| B | the matrix to add |
Definition at line 111 of file TinyMatrix.hpp.
00112 { 00113 T* y = __x[0]; 00114 const T* B_y = B.__x[0]; 00115 for (size_t i=0; i<M*N; i++) 00116 y[i] += B_y[i]; 00117 return (*this); 00118 }
| const TinyMatrix<M,N,T>& TinyMatrix< M, N, T >::operator-= | ( | const TinyMatrix< M, N, T > & | B | ) | [inline] |
Substracts a given matrix
| B | the matrix to substract |
Definition at line 127 of file TinyMatrix.hpp.
00128 { 00129 T* y = __x[0]; 00130 const T* B_y = B.__x[0]; 00131 for (size_t i=0; i<M*N; i++) 00132 y[i] -= B_y[i]; 00133 return (*this); 00134 }
| TinyMatrix<M,P> TinyMatrix< M, N, T >::operator* | ( | const TinyMatrix< N, P > & | B | ) | const [inline] |
Computes the product on the right to a given compatible matrix
| B | the given matrix |
Definition at line 144 of file TinyMatrix.hpp.
00145 { 00146 TinyMatrix<M,P> C(0); 00147 for (size_t i=0; i<M; i++) 00148 for (size_t j=0; j<P; j++) 00149 for (size_t k=0; k<N; k++) 00150 C(i,j) += __x[i][k] * B(k,j); 00151 return C; 00152 }
| TinyVector<M,T> TinyMatrix< M, N, T >::operator* | ( | const TinyVector< N, T > & | v | ) | const [inline] |
Computes the product with a given compatible vector
| v | the given vector |
Definition at line 161 of file TinyMatrix.hpp.
00162 { 00163 TinyVector<M,T> u = 0; 00164 for (size_t i=0; i<M; i++) 00165 for (size_t j=0; j<N; j++) 00166 u[i] += __x[i][j] * v[j]; 00167 return u; 00168 }
| TinyMatrix<M,N,T> TinyMatrix< M, N, T >::operator* | ( | const T & | t | ) | const [inline] |
Computes the product with a given T on the right
| t | the given T |
Definition at line 177 of file TinyMatrix.hpp.
00178 { 00179 TinyMatrix<M,N,T> B; 00180 for (size_t i=0; i<M; i++) 00181 for (size_t j=0; j<N; j++) 00182 B.__x[i][j] = __x[i][j] * t; 00183 return B; 00184 }
| TinyMatrix<M,N,T> TinyMatrix< M, N, T >::operator/ | ( | const T & | t | ) | const [inline] |
Computes the product with the invert of a given vector on the right
| t | the given vector |
Definition at line 193 of file TinyMatrix.hpp.
00194 { 00195 ASSERT(t != 0); 00196 TinyMatrix<M,N,T> B; 00197 const T t_1 = 1./t; 00198 for (size_t i=0; i<M; i++) 00199 for (size_t j=0; j<N; j++) 00200 B.__x[i][j] = __x[i][j] * t_1; 00201 return B; 00202 }
| const TinyMatrix<M,N,T>& TinyMatrix< M, N, T >::operator*= | ( | const T & | t | ) | [inline] |
Multiplies a matrix by a given T on the right
| t | the given T |
Definition at line 211 of file TinyMatrix.hpp.
00212 { 00213 for (size_t i=0; i<M; i++) 00214 for (size_t j=0; j<N; j++) 00215 __x[i][j] *= t; 00216 return (*this); 00217 }
| const TinyMatrix<M,N,T>& TinyMatrix< M, N, T >::operator/= | ( | const T & | t | ) | [inline] |
Multiplies a matrix by the invert of a given T on the right
| t | the given T |
Definition at line 226 of file TinyMatrix.hpp.
00227 { 00228 const T t_1 = 1./t; 00229 for (size_t i=0; i<M; i++) 00230 for (size_t j=0; j<N; j++) 00231 __x[i][j] *= t_1; 00232 return (*this); 00233 }
| TinyMatrix<M,N,T> TinyMatrix< M, N, T >::operator+ | ( | const TinyMatrix< M, N, T > & | B | ) | const [inline] |
Computes the sum of two matrices
| B | the second matrix |
Definition at line 256 of file TinyMatrix.hpp.
00257 { 00258 TinyMatrix<M,N,T> C; 00259 for (size_t i=0; i<M; i++) 00260 for (size_t j=0; j<N; j++) 00261 C.__x[i][j] = __x[i][j] + B.__x[i][j]; 00262 return C; 00263 }
| TinyMatrix<M,N,T> TinyMatrix< M, N, T >::operator- | ( | const TinyMatrix< M, N, T > & | B | ) | const [inline] |
Computes the difference of two matrices
| B | the second matrix |
Definition at line 272 of file TinyMatrix.hpp.
00273 { 00274 TinyMatrix<M,N,T> C; 00275 for (size_t i=0; i<M; i++) 00276 for (size_t j=0; j<N; j++) 00277 C.__x[i][j] = __x[i][j] - B.__x[i][j]; 00278 return C; 00279 }
| TinyMatrix<M,N,T> operator* | ( | const T & | t, | |
| const TinyMatrix< M, N, T > & | A | |||
| ) | [friend] |
Computes the product by a T on the left
| t | the multiplicative T | |
| A | the matrix |
Definition at line 243 of file TinyMatrix.hpp.
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const TinyMatrix< M, N, T > & | A | |||
| ) | [friend] |
Prints a matrix to a stream
| os | the given stream | |
| A | the given matrix |
Definition at line 289 of file TinyMatrix.hpp.
00291 { 00292 for (size_t i=0; i<M; i++) { 00293 for (size_t j=0; j<N; j++) 00294 os << A(i,j) << " "; 00295 os << '\n'; 00296 } 00297 return os; 00298 }
T TinyMatrix< M, N, T >::__x[M][N] [private] |
values of the matrix
Definition at line 56 of file TinyMatrix.hpp.
Referenced by TinyMatrix< 1, 1, T >::operator const T &(), TinyMatrix< 1, 1, T >::operator T &(), TinyMatrix< 1, 1, T >::operator()(), TinyMatrix< N, N, T >::operator()(), TinyMatrix< 3, 3, bool >::operator()(), TinyMatrix< N, N, T >::operator*(), TinyMatrix< 3, 3, bool >::operator*(), TinyMatrix< N, N, T >::operator*=(), TinyMatrix< 3, 3, bool >::operator*=(), TinyMatrix< N, N, T >::operator+(), TinyMatrix< 3, 3, bool >::operator+(), TinyMatrix< N, N, T >::operator+=(), TinyMatrix< 3, 3, bool >::operator+=(), TinyMatrix< N, N, T >::operator-(), TinyMatrix< 3, 3, bool >::operator-(), TinyMatrix< N, N, T >::operator-=(), TinyMatrix< 3, 3, bool >::operator-=(), TinyMatrix< N, N, T >::operator/(), TinyMatrix< 3, 3, bool >::operator/(), TinyMatrix< N, N, T >::operator/=(), TinyMatrix< 3, 3, bool >::operator/=(), TinyMatrix< N, N, T >::operator=(), TinyMatrix< 3, 3, bool >::operator=(), TinyMatrix< N, N, T >::swapLines(), TinyMatrix< N, N, T >::TinyMatrix(), and TinyMatrix< 3, 3, bool >::TinyMatrix().
1.5.6