class EpiMath::Function

Public Instance Methods

calc(x) click to toggle source
# File lib/epimath100/function.class.rb, line 16
def calc x
  return 0
end
convert_hash(hash) click to toggle source
# File lib/epimath100/function.class.rb, line 20
def convert_hash hash
  coef = []
  hash.select{|k,v| k.to_s.match(/[a-z]/)}.each do |k,v|
    key = (k.to_s.ord - "a".ord).to_i
    hash[key] = v if hash[key] == nil
  end
  return coef
end
get_degree(x) click to toggle source
# File lib/epimath100/function.class.rb, line 33
def get_degree x
  return @coef[x]
end
get_degree_max() click to toggle source
# File lib/epimath100/function.class.rb, line 29
def get_degree_max
  return @coef.rindex{|x| x != nil}
end