ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/solveur/src/matpleine.h
Revision: 161
Committed: Thu Sep 18 16:04:06 2008 UTC (16 years, 8 months ago) by souaissa
Content type: text/plain
Original Path: magic/lib/solveur/solveur/src/matpleine.h
File size: 4724 byte(s)
Log Message:
mise a jour du solveur

File Contents

# User Rev Content
1 souaissa 108
2     //---------------------------------------------------------------------------
3    
4     #ifndef sl_matpleineH
5     #define sl_matpleineH
6     //---------------------------------------------------------------------------
7     #include <iostream>
8     #include <vector.h>
9     #include <assert>
10    
11 souaissa 161 #include "sl_vecteur.h"
12 souaissa 108
13     #ifdef WINDOWS_VERSION
14     #ifdef BUILT_DLL_SOLVEUR
15     #define DLLPORTSOLVEUR __declspec(dllexport)
16     #else
17     #define DLLPORTSOLVEUR __declspec(dllimport)
18     #endif
19     #else
20     #define DLLPORTSOLVEUR
21     #endif
22    
23 souaissa 161 class DLLPORTSOLVEUR vecteur;
24 souaissa 108
25    
26     class DLLPORTSOLVEUR Matrice
27     {
28     private:
29 souaissa 161 int NbRows;
30     int NbCols;
31 souaissa 108 double** Data;
32    
33     public:
34 souaissa 161 friend class DLLPORTSOLVEUR vecteur;
35 souaissa 108 Matrice();
36     Matrice(int Rows, int Cols,double InitVal);
37     Matrice(double* Data, int Rows, int Cols);
38     Matrice(double** Data, int Rows, int Cols);
39    
40     Matrice(const Matrice& obj);
41     ~Matrice();
42     Matrice& operator =(const Matrice& obj);
43     Matrice& operator +(const Matrice& obj) const;
44     Matrice& operator -(const Matrice& obj) const;
45     Matrice& operator *(const Matrice& obj) const;
46     Matrice& operator *(const double _d) const;
47     Matrice& operator /(const double _d) const;
48     Matrice& operator +=(const Matrice& obj);
49     Matrice& operator -=(const Matrice& obj);
50     Matrice& operator *=(const Matrice& obj);
51     Matrice& operator *=(const double _d);
52     Matrice& operator /=(const double _d);
53     bool operator ==(const Matrice& obj) const;
54     bool operator !=(const Matrice& obj) const;
55     double* operator [](const int _i) const;
56     double& operator ()(const int _i, const int _j) const;
57     bool IsIdentity() const;
58     bool IsZeroMatrice() const;
59     double Get_SumAll() const;
60     double Get_SumRow(const int Row) const;
61     double Get_SumColumn(const int Col) const;
62     double Get_Max() const;
63     double Get_Min() const;
64     double Get_AbMax() const;
65     double Get_RowMax(const int Row) const;
66     double Get_RowMin(const int Row) const;
67     double Get_ColumnMax(const int Col) const;
68     double Get_ColumnMin(const int Col) const;
69     double* Get_DataOneDimen() const;
70     double** Get_DataTwoDimen() const;
71     int Get_NbRows() const;
72     int Get_NbCols() const;
73     Matrice& Clear();
74     Matrice& ClearRow(const int Row);
75     Matrice& ClearColumn(const int Col);
76     Matrice& Fill(const double _d);
77     Matrice& FillRow(const int Row, const double _d);
78     Matrice& FillColumn(const int Col, const double _d);
79     Matrice& Get_SubMatrice(const int RowSpot, const int ColSpot, const int RowLen, const int ColLen) const ;
80     Matrice& Set_SubMatrice(const int RowSpot, const int ColSpot, const int RowLen, const int ColLen);
81     Matrice& Get_SwapRows(const int Row1, const int Row2);
82     Matrice& Get_SwapCols(const int Col1, const int Col2);
83 souaissa 161 Matrice& Get_Transpose() const ;
84     Matrice& Transpose();
85 souaissa 108 Matrice& Get_ConMatAsRow(const Matrice& obj);
86     Matrice& Get_ConMatAsCol(const Matrice& obj);
87     Matrice& GetCMAR(const Matrice& obj) const ;
88     Matrice& GetCMAC(const Matrice& obj) const ;
89     Matrice& ConcatenateRow(const double* RowData);
90     Matrice& ConcatenateColumn(const double* ColumnData);
91 souaissa 161 Matrice& Add_Row(const vecteur& RowData, const int RowSpot);
92     Matrice& Add_Column(const vecteur& ColumnData, const int ColumnSpot);
93     vecteur Get_Row(int i);
94     vecteur Get_Col(int j);
95     Matrice Get_SubMatrice(int ln1,int ln2, int cl1,int cl2);
96     Matrice Get_SubMatrice(vecteur& lgn,vecteur& col);
97 souaissa 108 Matrice& RemoveRow(const int Row);
98     Matrice& RemoveColumn(const int Column);
99     Matrice& Get_Covariant() const;
100     Matrice& Set_Covariant();
101     Matrice& IdentityMatrice(int Diagonal);
102 souaissa 161 Matrice& Get_LU(vecteur& perm,double&d);
103     vecteur Get_Solution(vecteur& perm,const vecteur& b);
104     void Get_Solution(vecteur& perm, vecteur& b, vecteur& x);
105 souaissa 108 friend std::ostream& operator <<(std::ostream& ostr, const Matrice& obj);
106 souaissa 161 vecteur Multiply (const vecteur&);
107     Matrice Get_Inverse();
108 souaissa 108 void affiche();
109 souaissa 161 friend vecteur operator * (const Matrice&,const vecteur&);
110 souaissa 108 // void convert_Mat(const Matrice&,double,MatCr&);
111    
112     };
113    
114    
115 souaissa 161 DLLPORTSOLVEUR vecteur operator * (const Matrice&,const vecteur&);
116 souaissa 108 DLLPORTSOLVEUR std::ostream& operator <<(std::ostream& ostr, const Matrice& obj);
117    
118    
119     #endif
120    
121