next up previous contents
Next: Fonctions P1 et matrices Up: Algèbres et Types Previous: Vecteurs de longueur

Matrice carrées pleines et de taille fixe

template <class T,  int N> class MatN{ public:   
  T val[N][N];     
MatN(const MatN& r) ; 
MatN();
T& operator() ( int i, int j) 
{   assert((i< N)&&(i>=0)&&(j< N)&&(j>=0));  return val[i][j];}
const T& operator() ( int i, int j) const  
{   assert((i< N)&&(i>=0)&&(j< N)&&(j>=0));  return val[i][j];}
MatN&   operator+=     (const MatN& a);
MatN&   operator-=     (const MatN& a);
MatN    operator+      (const MatN& a);  
MatN    operator-      (const MatN& a);  
MatN    operator*      (const MatN& a);  
MatN    operator/      (const MatN& a);  
MatN&   operator=      (const MatN& a);  
MatN&   operator=      ( float a);  
VectN<T,N> operator*   (const VectN<T,N>& x);
MatN operator*         (const T& a);  
MatN operator/         (const T& a);  
float modul();
};



Pironneau Olivier
Jeudi 26 juin 1997 07:15:20