Sha256: 84bfe502fc759bd2bd7db089f7df3448152b384f01c29dceb4d4b7121acdbf9e

Contents?: true

Size: 399 Bytes

Versions: 9

Compression:

Stored size: 399 Bytes

Contents

module Dydx
  class Function
    attr_accessor :algebra, :vars
    def initialize(*vars)
      @vars = vars
    end

    def <=(algebra)
      @algebra = algebra
      self
    end

    def differentiate(sym=:x)
      @algebra.differentiate(sym)
    end
    alias_method :d, :differentiate

    def to_s
      algebra.to_s
    end

    def ==(function)
      to_s == function.to_s
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dydx-0.1.314 lib/dydx/function.rb
dydx-0.1.31 lib/dydx/function.rb
dydx-0.1.3 lib/dydx/function.rb
dydx-0.1.29 lib/dydx/function.rb
dydx-0.1.28 lib/dydx/function.rb
dydx-0.1.25 lib/dydx/function.rb
dydx-0.1.2 lib/dydx/function.rb
dydx-0.1.1 lib/dydx/function.rb
dydx-0.1.0 lib/dydx/function.rb