lib/dydx/algebra/operator/parts/general.rb in dydx-0.0.9 vs lib/dydx/algebra/operator/parts/general.rb in dydx-0.1.0
- old
+ new
@@ -25,18 +25,18 @@
end
elsif operator == :+ && inverse?(:+, x)
e0
elsif operator == :* && inverse?(:*, x)
e1
- elsif [:+, :*].include?(operator) && x.send("#{to_str(operator)}?")
+ elsif [:+, :*].include?(operator) && x.formula?(operator)
if combinable?(x.f, operator)
send(operator, x.f).send(operator, x.g)
elsif combinable?(x.g, operator)
send(operator, x.g).send(operator, x.f)
else
super(x)
end
- elsif x.is_a?(Inverse) && x.operator == operator && x.x.send("#{to_str(operator)}?")
+ elsif x.is_a?(Inverse) && x.operator == operator && x.x.formula?(operator)
if combinable?(x.x.f, operator)
send(operator, inverse(x.x.f, operator)).send(operator, inverse(x.x.g, operator))
elsif combinable?(x.x.g, operator)
send(operator, inverse(x.x.g, operator)).send(operator, inverse(x.x.f, operator))
else