ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/outil/src/ot_mathematique.h
Revision: 1025
Committed: Thu Jun 20 20:14:36 2019 UTC (6 years ago) by francois
Content type: text/plain
File size: 18356 byte(s)
Log Message:
Prise en compte et correction du fait qu'opencascade en trouve pas forcement toutes les surfaces fermees

File Contents

# User Rev Content
1 francois 283 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4     // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6     //------------------------------------------------------------
7     // Le projet MAGIC est un projet de recherche du d�partement
8     // de g�nie m�canique de l'Universit� du Qu�bec �
9     // Trois Rivi�res
10     // Les librairies ne peuvent �tre utilis�es sans l'accord
11     // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // ot_mathematique.h
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 � 11H23
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23     #ifndef _OTMATHEMATIQUE_
24     #define _OTMATHEMATIQUE_
25    
26     #ifdef WINDOWS_VERSION
27     #ifdef BUILT_DLL_OUTIL
28     #define DLLPORTOUTIL __declspec(dllexport)
29     #else
30     #define DLLPORTOUTIL __declspec(dllimport)
31     #endif
32     #else
33     #define DLLPORTOUTIL
34     #endif
35    
36     #include "ot_doubleprecision.h"
37     #include <iostream>
38 couturad 919 #include <map>
39 francois 283 #include <vector>
40    
41    
42 couturad 919 class DLLPORTOUTIL OT_HISTOGRAMME
43     {
44     public:
45 couturad 926 OT_HISTOGRAMME(void);
46 couturad 919 OT_HISTOGRAMME(double largeur_colonne);
47 couturad 997 OT_HISTOGRAMME(double largeur_colonne,OT_HISTOGRAMME &mdd);
48 couturad 968 OT_HISTOGRAMME(OT_HISTOGRAMME &mdd);
49 couturad 919 ~OT_HISTOGRAMME(void);
50 couturad 926 void fixe_largeur_colonne(double largeur_colonne);
51     double get_largeur_colonne(void);
52 couturad 919 void ajouter_valeur(double x,double val);
53     void ajouter_valeur(long i,double val);
54 couturad 968 int get_valeur(double x,double &val);
55     int get_valeur(long i,double &val);
56 couturad 926 int get_premiere_valeur(std::map<long,double>::iterator &it,double &valeur);
57     int get_suivante_valeur(std::map<long,double>::iterator &it,double &valeur);
58     int get_premiere_valeur(std::map<long,double>::iterator &it,double &valeur,double &borne_min,double &borne_max);
59     int get_suivante_valeur(std::map<long,double>::iterator &it,double &valeur,double &borne_min,double &borne_max);
60     int get_premiere_valeur(std::map<long,double>::iterator &it,double &valeur,long &i);
61     int get_suivante_valeur(std::map<long,double>::iterator &it,double &valeur,long &i);
62 couturad 919 long get_nb_colonne(void);
63     double get_x_min(void);
64     double get_x_max(void);
65 couturad 926 OT_HISTOGRAMME& operator=(OT_HISTOGRAMME& mdd);
66 couturad 966 OT_HISTOGRAMME& operator=(const OT_HISTOGRAMME& mdd);
67 couturad 926 void enregistrer_bin(std::ofstream& ofstr);
68     void ouvrir_bin(std::ifstream& ifstr);
69 couturad 997 void ouvrir_txt(char* nom_fichier);
70 couturad 926 void exporter(std::ofstream& ofstrm);
71 couturad 919 protected:
72     bool m_init;
73     long m_i_min;
74     long m_i_max;
75     double m_largeur_colonne;
76 couturad 926 std::map<long,double,std::less<long>> m_map_colonne;
77 couturad 919 };
78    
79 couturad 906 class DLLPORTOUTIL OT_QUATERNION
80     {
81     public:
82     OT_QUATERNION(void);
83     OT_QUATERNION(double x,double y,double z,double w);
84     OT_QUATERNION(OT_QUATERNION &mdd);
85     double get_x(void);
86     void change_x(double x);
87     double get_y(void);
88     void change_y(double y);
89     double get_z(void);
90     void change_z(double z);
91     double get_w(void);
92     void change_w(double w);
93    
94     OT_QUATERNION& operator=(OT_QUATERNION& mdd);
95    
96     protected:
97     double valeur[4];
98     };
99 francois 283
100    
101    
102     class DLLPORTOUTIL OT_VECTEUR_3D
103     {
104     public :
105     // construction
106     OT_VECTEUR_3D(double x,double y,double z);
107     OT_VECTEUR_3D(double *xyz);
108     OT_VECTEUR_3D(double *xyz1,double *xyz2);
109     OT_VECTEUR_3D(void);
110     OT_VECTEUR_3D(const OT_VECTEUR_3D& mdd);
111     OT_VECTEUR_3D unite(int i);
112     // stream string output
113     friend std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_3D & __vec);
114    
115     // comparison
116     bool operator== (const OT_VECTEUR_3D& mdd) const;
117     bool operator!= (const OT_VECTEUR_3D& mdd) const;
118     bool operator< (const OT_VECTEUR_3D& mdd) const;
119     bool operator<= (const OT_VECTEUR_3D& mdd) const;
120     bool operator> (const OT_VECTEUR_3D& mdd) const;
121     bool operator>= (const OT_VECTEUR_3D& mdd) const;
122     int compare_valeur (const OT_VECTEUR_3D& mdd) const;
123    
124     // coordinate access
125     virtual double get_x(void) const ;
126     virtual double get_y(void) const ;
127     virtual double get_z(void) const ;
128     virtual void change_x(double x);
129     virtual void change_y(double y);
130     virtual void change_z(double z);
131     virtual double* get_xyz(void);
132    
133     operator const double* () const;
134     operator double* ();
135     double operator[] (int i) const;
136     double& operator[] (int i);
137     double operator() (int i) const;
138     double & operator() (int i);
139    
140     // arithmetic operations
141     friend OT_VECTEUR_3D operator / (const OT_VECTEUR_3D& mdd1, double a);
142     friend OT_VECTEUR_3D operator - (const OT_VECTEUR_3D& mdd1);
143     friend double operator*(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
144     friend OT_VECTEUR_3D operator&(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
145     friend OT_VECTEUR_3D operator*(const class OT_MATRICE_3D& mdd1,const OT_VECTEUR_3D& mdd2);
146     friend OT_VECTEUR_3D operator+(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
147     friend OT_VECTEUR_3D operator-(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
148     friend OT_VECTEUR_3D operator*(double mdd1,const OT_VECTEUR_3D& mdd2);
149    
150     // arithmetic updates
151     OT_VECTEUR_3D& operator+= (const OT_VECTEUR_3D& rkV);
152     OT_VECTEUR_3D& operator-= (const OT_VECTEUR_3D& rkV);
153     OT_VECTEUR_3D& operator*= (double fScalar);
154     OT_VECTEUR_3D& operator/= (double fScalar);
155    
156     // vector operations
157     virtual double get_longueur(void) const ;
158     virtual double get_longueur2(void) const ;
159     virtual void norme(void);
160     OT_VECTEUR_3D gram_shmidt(const OT_VECTEUR_3D& vint);
161     virtual double diff(void);
162    
163    
164     private:
165     double valeur[3];
166     };
167    
168     class DLLPORTOUTIL OT_MATRICE_3D
169     {
170     public:
171     OT_MATRICE_3D(OT_VECTEUR_3D& v1,OT_VECTEUR_3D& v2,OT_VECTEUR_3D& v3);
172     OT_MATRICE_3D(void);
173     OT_MATRICE_3D(double* t);
174     OT_MATRICE_3D(const OT_MATRICE_3D& mdd);
175    
176     // stream string output
177     friend std::ostream & operator << ( std::ostream & __os, const OT_MATRICE_3D & __mat);
178    
179     // access to matrix elements
180     double operator() (int iLigne, int iCol) const;
181     double & operator() (int iLigne, int iCol);
182     double valeur(int iLigne, int iCol) const;
183     double & valeur(int iLigne, int iCol);
184     OT_VECTEUR_3D& get_vecteur1(void);
185     OT_VECTEUR_3D& get_vecteur2(void);
186     OT_VECTEUR_3D& get_vecteur3(void);
187     void change_vecteur1(OT_VECTEUR_3D v);
188     void change_vecteur2(OT_VECTEUR_3D v);
189     void change_vecteur3(OT_VECTEUR_3D v);
190     OT_VECTEUR_3D & operator [](int i);
191     // return inverse matrix
192     OT_MATRICE_3D inverse() const;
193     // assignements methods
194     void identite(void);
195     double get_determinant();
196     void transpose(OT_MATRICE_3D& res) const;
197     OT_MATRICE_3D transpose() const;
198 francois 1025 friend OT_MATRICE_3D operator+(const OT_MATRICE_3D& mdd1,const OT_MATRICE_3D& mdd2);
199 francois 283
200 francois 1025
201 francois 283 private:
202     OT_VECTEUR_3D vec[3]; // attention ! vecteurs colonne
203     friend OT_VECTEUR_3D operator*(const OT_MATRICE_3D& mdd1,const OT_VECTEUR_3D& mdd2);
204     };
205    
206     DLLPORTOUTIL std::ostream & operator << ( std::ostream & __os, const OT_MATRICE_3D & __mat);
207     DLLPORTOUTIL std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_3D & __vec);
208     DLLPORTOUTIL OT_VECTEUR_3D operator / (const OT_VECTEUR_3D& mdd1, double a);
209     DLLPORTOUTIL OT_VECTEUR_3D operator - (const OT_VECTEUR_3D& mdd1);
210     DLLPORTOUTIL double operator*(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
211     DLLPORTOUTIL OT_VECTEUR_3D operator&(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
212     DLLPORTOUTIL OT_VECTEUR_3D operator*(const OT_MATRICE_3D& mdd1,const OT_VECTEUR_3D& mdd2);
213     DLLPORTOUTIL OT_VECTEUR_3D operator+(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
214     DLLPORTOUTIL OT_VECTEUR_3D operator-(const OT_VECTEUR_3D& mdd1,const OT_VECTEUR_3D& mdd2);
215     DLLPORTOUTIL OT_MATRICE_3D operator*(const OT_MATRICE_3D& mdd1,const OT_MATRICE_3D& mdd2);
216     DLLPORTOUTIL OT_MATRICE_3D operator+(const OT_MATRICE_3D& mdd1,const OT_MATRICE_3D& mdd2);
217     DLLPORTOUTIL OT_VECTEUR_3D operator*(double mdd1,const OT_VECTEUR_3D& mdd2);
218    
219    
220    
221     #define ot_vecteur_4d
222     #ifdef ot_vecteur_4d
223     class DLLPORTOUTIL OT_VECTEUR_4D
224     {
225     public :
226     //construction
227     OT_VECTEUR_4D(double x,double y,double z,double w);
228     OT_VECTEUR_4D(double *xyzw);
229 francois 1025 OT_VECTEUR_4D(double *xyz1,double *xyz2);
230 francois 283 OT_VECTEUR_4D(void) {};
231     OT_VECTEUR_4D(const OT_VECTEUR_4D& mdd);
232     OT_VECTEUR_4D & operator= (double);
233    
234     // stream string output
235     friend std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_4D & __vec);
236    
237     // comparison
238     bool operator== (const OT_VECTEUR_4D& mdd) const;
239     bool operator!= (const OT_VECTEUR_4D& mdd) const;
240     bool operator< (const OT_VECTEUR_4D& mdd) const;
241     bool operator<= (const OT_VECTEUR_4D& mdd) const;
242     bool operator> (const OT_VECTEUR_4D& mdd) const;
243     bool operator>= (const OT_VECTEUR_4D& mdd) const;
244 francois 743 // int compare_valeur (const OT_VECTEUR_4D& mdd) const;
245 francois 283
246     // coordinate access
247     virtual double get_x(void) const ;
248     virtual double get_y(void) const ;
249     virtual double get_z(void) const ;
250     virtual double get_w(void) const ;
251     virtual double & x(void);
252     virtual double & y(void);
253     virtual double & z(void);
254     virtual double & w(void);
255     virtual void change_x(double x);
256     virtual void change_y(double y);
257     virtual void change_z(double z);
258     virtual void change_w(double w);
259     virtual double* get_xyzw(void);
260     operator const double* () const;
261     operator double* ();
262     double operator[] (int i) const;
263     double& operator[] (int i);
264     double operator() (int i) const;
265     double & operator() (int i);
266    
267     // arithmetic operations
268     OT_VECTEUR_4D operator+ (const OT_VECTEUR_4D& rkV);
269     OT_VECTEUR_4D operator- (const OT_VECTEUR_4D& rkV);
270     double operator* (const OT_VECTEUR_4D & a);
271    
272     // arithmetic updates
273     OT_VECTEUR_4D& operator+= (const OT_VECTEUR_4D& rkV);
274     OT_VECTEUR_4D& operator-= (const OT_VECTEUR_4D& rkV);
275     OT_VECTEUR_4D& operator*= (double fScalar);
276     OT_VECTEUR_4D& operator/= (double fScalar);
277 francois 1025 virtual double get_longueur(void) const ;
278     virtual double get_longueur2(void) const ;
279 francois 283
280     private:
281     double valeur[4];
282     };
283    
284     DLLPORTOUTIL OT_VECTEUR_4D operator* (const OT_VECTEUR_4D & rkV, const double a);
285     DLLPORTOUTIL OT_VECTEUR_4D operator* (const double a, const OT_VECTEUR_4D & rkV);
286     DLLPORTOUTIL OT_VECTEUR_4D operator/ (const OT_VECTEUR_4D & rkV, const double a);
287     DLLPORTOUTIL OT_VECTEUR_4D operator/ (const double a, const OT_VECTEUR_4D & rkV);
288     DLLPORTOUTIL std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_4D & __vec);
289     #endif // ot_vecteur_4d
290    
291    
292    
293     class DLLPORTOUTIL OT_VECTEUR_4DD
294     {
295     public :
296     //construction
297     OT_VECTEUR_4DD(double2 x,double2 y,double2 z,double2 w);
298     OT_VECTEUR_4DD(double2 *xyzw);
299     OT_VECTEUR_4DD() {};
300     OT_VECTEUR_4DD(const OT_VECTEUR_4DD& mdd);
301     //OT_VECTEUR_4DD & operator= (double2);
302     OT_VECTEUR_4DD & operator= (const OT_VECTEUR_4DD&);
303    
304     // stream string output
305     friend std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_4DD & __vec);
306    
307     // comparison
308     bool operator== (const OT_VECTEUR_4DD& mdd) const;
309     bool operator!= (const OT_VECTEUR_4DD& mdd) const;
310     bool operator< (const OT_VECTEUR_4DD& mdd) const;
311     bool operator<= (const OT_VECTEUR_4DD& mdd) const;
312     bool operator> (const OT_VECTEUR_4DD& mdd) const;
313     bool operator>= (const OT_VECTEUR_4DD& mdd) const;
314     int compare_valeur (const OT_VECTEUR_4DD& mdd) const;
315    
316     // coordinate access
317     virtual double2 get_x(void) const ;
318     virtual double2 get_y(void) const ;
319     virtual double2 get_z(void) const ;
320     virtual double2 get_w(void) const ;
321     virtual double2 & x(void);
322     virtual double2 & y(void);
323     virtual double2 & z(void);
324     virtual double2 & w(void);
325     virtual void change_x(double2 x);
326     virtual void change_y(double2 y);
327     virtual void change_z(double2 z);
328     virtual void change_w(double2 w);
329     virtual double2* get_xyzw(void);
330     double2 norme();
331     OT_VECTEUR_4DD vecteur_norme() ;
332 francois 363 OT_VECTEUR_4DD vecteur_norme_3d() ;
333 francois 283 operator const double2* () const;
334     operator double2* ();
335     double2 operator[] (int i) const;
336     double2& operator[] (int i);
337     double2 operator() (int i) const;
338     double2 & operator() (int i);
339    
340     // arithmetic operations
341     OT_VECTEUR_4DD operator+ (const OT_VECTEUR_4DD& rkV);
342     OT_VECTEUR_4DD operator- (const OT_VECTEUR_4DD& rkV);
343     double2 operator* (const OT_VECTEUR_4DD & a);
344    
345     // arithmetic updates
346     OT_VECTEUR_4DD& operator+= (const OT_VECTEUR_4DD& rkV);
347     OT_VECTEUR_4DD& operator-= (const OT_VECTEUR_4DD& rkV);
348     OT_VECTEUR_4DD& operator*= (double2 fScalar);
349     OT_VECTEUR_4DD& operator/= (double2 fScalar);
350     OT_VECTEUR_4DD operator^(const OT_VECTEUR_4DD& v2);
351 francois 743 bool est_nul(void);
352     bool est_nul_3d(void);
353 francois 283
354    
355     private:
356     double2 valeur[4];
357     };
358    
359    
360    
361     class DLLPORTOUTIL OT_VECTEUR_3DD
362     {
363     public :
364     //construction
365     OT_VECTEUR_3DD(double2 x,double2 y,double2 z);
366 francois 550 OT_VECTEUR_3DD(double2 *xyzw);
367     OT_VECTEUR_3DD(double2 *xyz1,double2 *xyz2);
368 francois 283 OT_VECTEUR_3DD() {};
369     OT_VECTEUR_3DD(const OT_VECTEUR_3DD& mdd);
370     OT_VECTEUR_3DD & operator= (const OT_VECTEUR_3DD&);
371    
372     // stream string output
373     friend std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_3DD & __vec);
374    
375     // comparison
376     bool operator== (const OT_VECTEUR_3DD& mdd) const;
377     bool operator!= (const OT_VECTEUR_3DD& mdd) const;
378     bool operator< (const OT_VECTEUR_3DD& mdd) const;
379     bool operator<= (const OT_VECTEUR_3DD& mdd) const;
380     bool operator> (const OT_VECTEUR_3DD& mdd) const;
381     bool operator>= (const OT_VECTEUR_3DD& mdd) const;
382     int compare_valeur (const OT_VECTEUR_3DD& mdd) const;
383    
384     // coordinate access
385     virtual double2 get_x(void) const ;
386     virtual double2 get_y(void) const ;
387     virtual double2 get_z(void) const ;
388     virtual double2 & x(void);
389     virtual double2 & y(void);
390     virtual double2 & z(void);
391     virtual void change_x(double2 x);
392     virtual void change_y(double2 y);
393     virtual void change_z(double2 z);
394     virtual double2* get_xyz(void);
395     double2 norme();
396     OT_VECTEUR_3DD vecteur_norme() ;
397 francois 550 virtual double2 get_longueur(void) ;
398     virtual double2 get_longueur2(void) ;
399 francois 283 operator const double2* () const;
400     operator double2* ();
401     double2 operator[] (int i) const;
402     double2& operator[] (int i);
403     double2 operator() (int i) const;
404     double2 & operator() (int i);
405    
406     // arithmetic operations
407     OT_VECTEUR_3DD operator+ (const OT_VECTEUR_3DD& rkV);
408     OT_VECTEUR_3DD operator- (const OT_VECTEUR_3DD& rkV);
409     double2 operator* (const OT_VECTEUR_3DD & a);
410    
411     // arithmetic updates
412     OT_VECTEUR_3DD& operator+= (const OT_VECTEUR_3DD& rkV);
413     OT_VECTEUR_3DD& operator-= (const OT_VECTEUR_3DD& rkV);
414     OT_VECTEUR_3DD& operator*= (double2 fScalar);
415     OT_VECTEUR_3DD& operator/= (double2 fScalar);
416     OT_VECTEUR_3DD operator&(const OT_VECTEUR_3DD& v2);
417    
418    
419     private:
420     double2 valeur[3];
421     };
422    
423    
424    
425    
426    
427    
428     DLLPORTOUTIL OT_VECTEUR_4DD operator* (const OT_VECTEUR_4DD & rkV, const double2 a);
429     DLLPORTOUTIL OT_VECTEUR_4DD operator* (const double2 a, const OT_VECTEUR_4DD & rkV);
430     DLLPORTOUTIL OT_VECTEUR_4DD operator/ (const OT_VECTEUR_4DD & rkV, const double2 a);
431     DLLPORTOUTIL OT_VECTEUR_4DD operator/ (const double2 a, const OT_VECTEUR_4DD & rkV);
432     DLLPORTOUTIL std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_4DD & __vec);
433     DLLPORTOUTIL OT_VECTEUR_3DD operator* (const OT_VECTEUR_3DD & rkV, const double2 a);
434     DLLPORTOUTIL OT_VECTEUR_3DD operator* (const double2 a, const OT_VECTEUR_3DD & rkV);
435     DLLPORTOUTIL OT_VECTEUR_3DD operator/ (const OT_VECTEUR_3DD & rkV, const double2 a);
436     DLLPORTOUTIL OT_VECTEUR_3DD operator/ (const double2 a, const OT_VECTEUR_3DD & rkV);
437     DLLPORTOUTIL std::ostream & operator << ( std::ostream & __os, const OT_VECTEUR_4DD & __vec);
438    
439    
440    
441    
442    
443    
444     class DLLPORTOUTIL OPERATEUR
445     {
446     public:
447 francois 418 enum ETAT {EXTERIEUR=0,INTERIEUR=4,STRICTINTERIEUR=3,SUR_FACE=1,SUR_ARETE=5,FACE1=10,FACE2=11,FACE3=12,FACE4=13,ARETE1=20,ARETE2=21,ARETE3=22,ARETE4=23,ARETE5=24,ARETE6=25,SOMMET1=30,SOMMET2=31,SOMMET3=32,SOMMET4=33};
448    
449 francois 283 static int egal(double a,double b,double eps);
450 couturad 906 static int egal(double *xyz1,double *xyz2,double eps);
451 francois 283 static double qualite_triangle(double* noeud1,double* noeud2,double* noeud3);
452     static double qualite_tetra(double* noeud1,double* noeud2,double* noeud3,double *noeud4);
453     static void doubleto2int(double val,int& val1,int& val2);
454 francois 418 static int estdansletetra(double *xyz1,double *xyz2,double *xyz3,double *xyz4,double x,double y, double z);
455     static int estdansletriangle(double *xyz1,double *xyz2,double *xyz3,double x,double y, double z);
456     static int projeteestdansletriangle(double *xyz1,double *xyz2,double *xyz3,double x,double y, double z);
457    
458     static int compare_etat_tetra(int etat,int valeur);
459     static int compare_etat_triangle(int etat,int valeur);
460 couturad 926
461     static double taille_tetra(double* noeud1,double* noeud2,double* noeud3,double *noeud4);
462     static double taille_triangle(double* noeud1,double* noeud2,double* noeud3);
463 francois 283 };
464    
465    
466     template <int N=4>
467     class DLLPORTOUTIL DOUBLEN
468     {
469     public:
470     DOUBLEN();
471     DOUBLEN(double *v);
472     DOUBLEN(DOUBLEN& mdd);
473     DOUBLEN(const DOUBLEN& mdd);
474     ~DOUBLEN();
475     double get_valeur(int num);
476     void change_valeur(int num,double val);
477     DOUBLEN<N> & operator=(DOUBLEN<N> & mdd);
478     DOUBLEN<N> & operator=(const DOUBLEN<N> & mdd);
479     private:
480     double tab[N];
481     };
482    
483 couturad 951 struct lessOT_VECTEUR_4DD : std::binary_function<OT_VECTEUR_4DD, OT_VECTEUR_4DD, bool>
484 francois 283 {
485     bool operator() ( OT_VECTEUR_4DD v1, OT_VECTEUR_4DD v2)
486     {
487     if (v1[0]!=v2[0]) return v1[0]<v2[0] ;
488     if (v1[1]!=v2[1]) return v1[1]<v2[1] ;
489     if (v1[2]!=v2[2]) return v1[2]<v2[2] ;
490     if (v1[3]!=v2[3]) return v1[3]<v2[3] ;
491     return 0;
492    
493     }
494     ;
495     };
496    
497 couturad 951 struct lessOT_VECTEUR_3DD : std::binary_function<OT_VECTEUR_3DD, OT_VECTEUR_3DD, bool>
498 francois 283 {
499     bool operator() ( OT_VECTEUR_3DD v1, OT_VECTEUR_3DD v2)
500     {
501     if (v1[0]!=v2[0]) return v1[0]<v2[0] ;
502     if (v1[1]!=v2[1]) return v1[1]<v2[1] ;
503     if (v1[2]!=v2[2]) return v1[2]<v2[2] ;
504     return 0;
505    
506     }
507     ;
508     };
509    
510    
511     #endif