Skip to content

Commit

Permalink
https://github.com/crowlogic/arb4j/issues/253
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlogic committed Nov 28, 2024
1 parent a8f6272 commit 21c893f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/main/java/arb/expressions/nodes/binary/DivisionNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* {@link TheArb4jLibrary}
*/
public class DivisionNode<D, R, F extends Function<? extends D, ? extends R>> extends
BinaryOperationNode<D, R, F>
BinaryOperationNode<D, R, F>
{

public DivisionNode(Expression<D, R, F> expression, Node<D, R, F> left, Node<D, R, F> right)
Expand All @@ -41,7 +41,7 @@ public boolean isCommutative()
@Override
public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
{
// return new
// return new
assert false : "TODO: implement integration rule for division, left=" + left + " right=" + right;
return null;
}
Expand All @@ -51,9 +51,7 @@ public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
Node<E, S, G>
spliceInto(Expression<E, S, G> newExpression)
{
return new DivisionNode<E, S, G>(newExpression,
left.spliceInto(newExpression),
right.spliceInto(newExpression));
return left.spliceInto(newExpression).div(right.spliceInto(newExpression));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
Node<E, S, G>
spliceInto(Expression<E, S, G> newExpression)
{
return new ExponentiationNode<E, S, G>(newExpression,
left.spliceInto(newExpression),
right.spliceInto(newExpression));
return left.spliceInto(newExpression).pow(right.spliceInto(newExpression));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
Node<E, S, G>
spliceInto(Expression<E, S, G> newExpression)
{
return new MultiplicationNode<E, S, G>(newExpression,
left.spliceInto(newExpression),
right.spliceInto(newExpression));
return left.spliceInto(newExpression).mul(right.spliceInto(newExpression));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
Node<E, S, G>
spliceInto(Expression<E, S, G> newExpression)
{
return new SubtractionNode<E, S, G>(newExpression,
left.spliceInto(newExpression),
right.spliceInto(newExpression));
return left.spliceInto(newExpression).sub(right.spliceInto(newExpression));
}

@Override
Expand Down

0 comments on commit 21c893f

Please sign in to comment.