Borderbasix

Plex.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 * This file is part of the source code of BORDERBASIX software. *
3 * (C) B. Mourrain, INRIA *
4 **********************************************************************
5 History:
6 $Id: Plex.hpp,v 1.1.1.1 2006/10/06 08:01:40 trebuche Exp $
7 **********************************************************************/
8 #ifndef _Plex_H_
9 #define _Plex_H_
10 
14 template <class M> struct Plex
15 {
16  static bool less (const M &, const M &);
17  bool operator() (const M &, const M &);
18 };
19 
20 template <class M>
21 inline bool Plex<M>::less(const M & m1, const M & m2) {
22  int n1 = m1.Lvar(), n2 =m2.Lvar();
23  int i = std::max(n1,n2);
24 
25  if(n1 <0 && n2>0) return true;
26  if(n2 <0 && n1>0) return false;
27 
28  while( m1.GetDegree(i) == m2.GetDegree(i) && i>=0) i--;
29  if(i <0)
30  return false;
31  else
32  return (m1.GetDegree(i)< m2.GetDegree(i));
33 }
34 
35 template <class M>
36 bool Plex<M>::operator()(const M & m1, const M & m2) {
37  return less(m1,m2);
38 }
39 
40 #endif // //_Plex_H_
41 
bool operator()(const M &, const M &)
Definition: Plex.hpp:36
#define max(a, b)
Definition: alp_f2c.H:167
static bool less(const M &, const M &)
Definition: Plex.hpp:21
MSKint32t MSKint32t MSKint32t i
Definition: mosek.h:2278
Definition: Plex.hpp:14
Home  |  Download & InstallContributions