/***************************************************************/
Type Matrice Implemente Public : IAlgebreCommutative Defaut Final TailleSegment 4 ConserverObjets
/* Objet : Encapsulation du type Matrice. */
/***************************************************************/
/*-------------------------------------------------------------*/
/* Heritage des proprietes d'Objet. */
/*-------------------------------------------------------------*/
Prive :
EstInstanceDe : Type Lecture Public;
/*-------------------------------------------------------------*/
/* Proprietes propres. */
/*-------------------------------------------------------------*/
Prive :
NbLignes : Entier Lecture Public;
NbColonnes : Entier Lecture Public;
/*-------------------------------------------------------------*/
/* Heritage des methodes d'Objet. */
/*-------------------------------------------------------------*/
Public :
Fonction Optimiser(Invariant) Identique(O : Nul Ou Objet) Retourner Nul Ou Booleen;
Procedure Convertir(O : Nul Ou Objet);
Fonction Optimiser(Invariant) CreeParLeServeur() Retourner Entier;
Fonction Optimiser(Invariant) CreeParLeProcessus() Retourner Entier;
Fonction Optimiser(Invariant) CreeDansLEntrepot() Retourner Entrepot;
Fonction Cloner(EntrepotCible : Nul Ou Entrepot=Nul, Profondeur : ModeClonage = ClonageObjetSeul) Retourner Nul Ou Objet;
Fonction LirePropriete(NomPropriete : Caractere) Retourner Nul Ou Objet;
Procedure EcrirePropriete(NomPropriete : Caractere, Valeur : Nul Ou Objet);
Fonction IncrementerDecrementerPropriete(NomPropriete : Nul Ou Caractere, Incrementer : Booleen, Prefixe : Booleen) Retourner Nul Ou Objet;
Procedure SupprimerPropriete(NomPropriete : Caractere);
Fonction Optimiser(Invariant) EnumererProprietes(NumeroPropriete : Entier, TypePropriete : Nul Ou Type=? Sortie, PeutEtreNul : Booleen=? Sortie, Aide : Nul Ou Caractere=? Sortie, NomEnumere : Nul Ou Caractere=? Sortie) Retourner Nul Ou Caractere;
Fonction Optimiser(Invariant) Adresse() Retourner Nul Ou Caractere;
Prive :
Fonction Exporter(E : Nul Ou IEchangeElementaire) Retourner Boolean;
Fonction Importer(E : Nul Ou IEchangeElementaire, EntrepotCible : Nul Ou Entrepot=Nul, EstFiltre : Booleen=Faux, V : Entier=0, R : Entier=0, C : Entier=0) Retourner Nul Ou Objet;
/*-------------------------------------------------------------*/
/* Heritage des methodes de IAlgebreCommutative. */
/*-------------------------------------------------------------*/
Public :
Operateur Optimiser(Invariant, NulAbsorbant) +(M : Nul Ou Matrice(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant) -() Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) -(M : Nul Ou Matrice(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) *(M : Nul Ou Matrice(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur ++(P : Booleen) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur --(P : Booleen) Retourner Nul Ou Matrice(Nul Ou TypeElement);
/*-------------------------------------------------------------*/
/* Methodes propres. */
/*-------------------------------------------------------------*/
Constructeur Optimiser(Invariant, NulAbsorbant) (T : Nul Ou Type, L : Nul Ou Entier, H : Nul Ou Entier, E : Nul Ou TypeElement, D : Booleen=Vrai);
Operateur Optimiser(Invariant, NulAbsorbant) ==(M : Nul Ou Matrice) Retourner Nul Ou Booleen;
Operateur Optimiser(Invariant, NulAbsorbant) !=(M : Nul Ou Matrice) Retourner Nul Ou Booleen;
Operateur =(E : Nul Ou TypeElement);
Operateur =(C : Nul Ou ICollection(Nul Ou ICollection(Nul Ou TypeElement)));
Operateur Optimiser(Invariant, NulAbsorbant) +(E : Nul Ou TypeElement) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) -(E: Nul Ou TypeElement) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) *(E : Nul Ou TypeElement) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) /(M : Nul Ou Matrice) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) /(E : Nul Ou TypeElement) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant, NulAbsorbant) ^(E : Nul Ou Entier) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Operateur Optimiser(Invariant) [](L : Nul Ou Entier, C : Nul Ou Entier) Retourner Nul Ou TypeElement;
Operateur [](L : Nul Ou Entier, C : Nul Ou Entier, Valeur : Nul Ou TypeElement, MethodeAComposer : Nul Ou Fonction(P1 : Nul Ou TypeElement, P2 : Nul Ou TypeElement) Retourner Nul Ou TypeElement);
Operateur [](L : Nul Ou Entier, C : Nul Ou Entier, Prefixe : Booleen, MethodeAComposer : Nul Ou Fonction(P1 : Nul Ou TypeElement, P2 : Booleen) Retourner Nul Ou TypeElement) Retourner Nul Ou TypeElement;
Fonction Optimiser(Invariant, NulAbsorbant) Copier(L : Nul Ou Entier, C : Nul Ou Entier, L2 : Nul Ou Entier, H : Nul Ou Entier) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Procedure Optimiser(NulAbsorbant) Coller(L : Nul Ou Entier, C : Nul Ou Entier, M : Nul Ou Matrice(Nul Ou TypeElement));
Fonction Optimiser(NulAbsorbant) InsererColonne(C : Nul Ou Entier, E : Nul Ou TypeElement=Nul, D : Booleen=Vrai) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) InsererLigne(L : Nul Ou Entier, E : Nul Ou TypeElement=Nul, D : Booleen=Vrai) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) SupprimerColonne(C : Nul Ou Entier) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) SupprimerLigne(L : Nul Ou Entier) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Procedure PermuterColonnes(C1 : Nul Ou Entier, C2 : Nul Ou Entier);
Procedure PermuterLignes(L1 : Nul Ou Entier, L2 : Nul Ou Entier);
Procedure Transposer();
Fonction Optimiser(Invariant) EstDiagonale() Retourner Booleen;
Fonction Optimiser(Invariant) EstTriangulaireSuperieure() Retourner Booleen;
Fonction Optimiser(Invariant) EstTriangulaireInferieure() Retourner Booleen;
Fonction Optimiser(Invariant) EstSymetrique() Retourner Booleen;
Fonction Optimiser(Invariant) EstAntiSymetrique() Retourner Booleen;
Procedure AppliquerSymetrieVerticale();
Procedure AppliquerSymetrieHorizontale();
Procedure Appliquer(Traitement : Nul Ou Procedure (O : Nul Ou TypeElement));
Procedure Appliquer(Traitement : Nul Ou Procedure (O1 : Nul Ou TypeElement, O2 : Nul Ou TypeElement), M : Nul Ou Matrice(Nul Ou TypeElement));
Fonction Optimiser(NulAbsorbant) Appliquer(Traitement : Nul Ou Fonction (O : Nul Ou TypeElement) Retourner Nul Ou TypeElement) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) Appliquer(Traitement : Nul Ou Fonction (O1 : Nul Ou TypeElement, O2 : Nul Ou TypeElement) Retourner Nul Ou TypeElement, M : Nul Ou Matrice(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant, Invariant) VersMatrice(T : Nul Ou Type) Retourner Nul Ou Matrice;
Operateur =(C : Nul Ou ICollection(Nul Ou Vecteur(Nul Ou TypeElement)));
Operateur Optimiser(Invariant, NulAbsorbant) *(V : Nul Ou Vecteur(Nul Ou TypeElement)) Retourner Nul Ou Vecteur(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) InsererColonne(C : Nul Ou Entier, V : Nul Ou Vecteur(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Fonction Optimiser(NulAbsorbant) InsererLigne(L : Nul Ou Entier, V : Nul Ou Vecteur(Nul Ou TypeElement)) Retourner Nul Ou Matrice(Nul Ou TypeElement);
Prive :
Destructeur(MettreEnAnteMemoire : Booleen) Retourner Booleen;
Fin Type
Le type Matrice modélise une matrice de NbLignes par NbColonnes éléments dont leur type est donné par son paramètre. Ce dernier ne peut être que :
Le type Matrice possède un constructeur permettant de créer une matrice de type T de L lignes et H colonnes initialisée avec l'élement E.
L'initialisation est uniquement diagonale si le paramètre D a pour valeur Vrai.
Principal
/*******/
Variable
/******/
M : Nul Ou Matrice(Complexe);
M2 : Nul Ou Matrice(Complexe);
/* 'M' est une variable de type matrice. */
Debut
M=Matrice(Complexe, 3, 3);
M2=Matrice(Complexe, 3, 3);
M=M+M2;
/* Addition de deux matrices. */
M=M+Complexe(10);
/* Addition d'une matrice et d'un complexe. */
M=M-M2;
/* Soustraction de deux matrices. */
M=M-Complexe(10);
/* Soustraction d'une matrice et d'un complexe. */
M=M*M2;
/* Multiplication de deux matrices. */
M=M*Complexe(2);
/* Multiplication d'une matrice et d'un complexe. */
M=M/M2;
/* Division de deux matrices. */
M=M/Complexe(10);
/* Division d'une matrice et d'un complexe. */
M=M^2;
/* Puissance d'une matrice. */
Si M==M2 Alors
/* Egalité entre deux matrices. */
...
Fin Si
Si M!=M2 Alors
/* Inégalité entre deux matrices. */
...
Fin Si
Fin Principal
- | - | - | - | - | - | - | - | - |