1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#ifndef DEF_MATRICE
#define DEF_MATRICE
#define N 5
class Matrice
{
public:
Matrice();
Matrice(unsigned int taille);
Matrice(unsigned int taille, std::string type); //sert à creer des matrice de type ide ou autre
//Matrice(unsigned int nbLigne, unsigned int nbColonne);//dans le futur, crées des matrices non carrées
~Matrice();
void setElt(unsigned int ligne, unsigned int colonne, int value);
int getElt(unsigned int ligne, unsigned int colonne);
void affiche();
void displayError(std::string error);//centralisation des message d'erreur, pour un meilleur controle du comportement (tout désactiver , attendre l'appui d'une touche)
bool T1(int ligne, int value);
bool T2(int ligne1, int ligne2);
bool T3(int ligne1, int ligne2, int value);
Matrice operator+(const Matrice matrice);//addition de matrice
Matrice operator*(const Matrice matrice);//multiplication de matrice
Matrice operator*(int valeur);//multiplication par un scalaire
Matrice operator/(int valeur);//division par un scalaire
protected:
bool initialise(unsigned int nb_ligne, unsigned int nb_colonne);//prévu pour réserver l'espace mémoire, ne marche pas
int **m_elt;// avant : m_elt[N][N]
int m_largElt;//sert pour l(affichage, pour aligner tous les nombres il faut connaitre celui qui prend le plus de caractères.
int m_nbLigne;
int m_nbColonne;
};
#endif |
Partager