lib/dydx.rb in dydx-0.1.41421 vs lib/dydx.rb in dydx-0.2.7000000

- old
+ new

@@ -2,25 +2,25 @@ require 'dydx/algebra' require 'dydx/delta' require 'dydx/function' require 'dydx/integrand' +require 'dydx/api' + module Dydx include Algebra %w(f g h temp_cal_f).each do |functioner| define_method(functioner) do |*vars| function = eval("$#{functioner}") return eval("$#{functioner} = Function.new(*vars)") unless function - fail ArgumentError, "invalid number of values (#{vars.count} for #{function.vars.count})" unless function.vars.count == vars.count + unless function.vars.count == vars.count + fail ArgumentError, "invalid number of values (#{vars.count} for #{function.vars.count})" + end + return function if function.vars == vars || !function.algebra - subst_hash = Hash[*[function.vars, vars].transpose.flatten] - begin - function.algebra.subst(subst_hash).to_f - rescue ArgumentError - eval(function.algebra.subst(subst_hash).to_s) - end + function.evalue(vars) end end def S(function, delta) itgrl_var = delta.var