module Algebra::MIndex::V_grevlex

Public Instance Methods

<=>(other) click to toggle source
# File lib/algebra/m-index.rb, line 68
def <=>(other)
  s = (totdeg <=> other.totdeg)
  return s unless s.zero?
  #       n = [size, other.size].max
  #       (n-1).downto 0 do |i|
  V_ORDER.reverse_each do |i|
    #       x = other[V_ORDER[i]] - self[V_ORDER[i]]
    x = other[i] - self[i]
    return x unless x.zero?
  end
  0
end