00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #ifndef SYNAPS_MPOL_ILEX_H
00010 #define SYNAPS_MPOL_ILEX_H
00011 
00012 #include <synaps/init.h>
00013 
00014 __BEGIN_NAMESPACE_SYNAPS
00015 
00021 struct Ilex 
00022 {
00023   template <class M>
00024   static bool less (const M &, const M &);
00025   template <class M>
00026   bool operator() (const M & m1, const M & m2) const {return less(m1,m2);}
00027 };
00028  
00029 template <class M>
00030 inline bool Ilex::less(const M & m1, const M & m2) {
00031    int n1 = m1.nvars(), n2 =m2.nvars();
00032    int i = 0, mx = std::max(n1,n2);
00033         
00034 
00035 
00036 
00037    while( m1[i] == m2[i] && i<=mx) i++;
00038    if(i >mx) 
00039      return false;     
00040    else 
00041      return (m1[i]< m2[i]);
00042 }
00043 
00044 
00045 __END_NAMESPACE_SYNAPS
00046 
00047 #endif // SYNAPS_MPOL_ILEX_H
00048