LexRevDegree Struct Reference

#include <monomial_ordering.hpp>

Inheritance diagram for LexRevDegree:
MonomialOrdering

List of all members.

Public Member Functions


Detailed Description

Definition at line 42 of file monomial_ordering.hpp.


Member Function Documentation

bool less ( const int *  m1,
int  s1,
const int *  m2,
int  s2 
) const [virtual]

Implements MonomialOrdering.

Definition at line 34 of file monomial_ordering.cpp.

00034                                                                             {
00035     
00036     int d1=0, d2=0;
00037     for(int i=0;i<n1;i++) d1+=m1[i];
00038     for(int i=0;i<n2;i++) d2+=m2[i];
00039   
00040     //    std::cout<< "less d1:= "<<d1<<std::endl;
00041     //    std::cout<< "less d2:= "<<d2<<std::endl;
00042     if (d1 < d2 ) return false;
00043     else if (d1 > d2) return true;
00044     else {
00045       //     if(n1 <=0 && n2>0) return false;
00046       //     if(n1 <=0 && n2<=0) return false;
00047       //     if(n2 <=0 && n1>0) return true;
00048      int n = (n1>n2?n1:n2); 
00049      //     std::cout<< "less n:= "<<n<<std::endl;
00050      int i;
00051      for(i = (n>0?n:0); i>=0 && (i<n1?m1[i]:0) == (i<n2?m2[i]:0);i--);
00052      //     std::cout<< "less i:= "<<i<<std::endl;
00053      if(i < 0) 
00054        return false;
00055      else 
00056        return ((i<n1?m1[i]:0) > (i<n2?m2[i]:0));
00057    }
00058   }


The documentation for this struct was generated from the following files:

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1