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 b710de6 commit a8f6272
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/arb/expressions/nodes/binary/SubtractionNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* {@link TheArb4jLibrary}
*/
public class SubtractionNode<D, R, F extends Function<? extends D, ? extends R>> extends
BinaryOperationNode<D, R, F>
BinaryOperationNode<D, R, F>
{

@Override
Expand All @@ -39,7 +39,7 @@ private void fillInNullLeftHandSide()
if (left == null)
{
left = new LiteralConstantNode<>(expression,
"0");
"0");
}
}

Expand Down Expand Up @@ -78,14 +78,13 @@ public Node<D, R, F> integrate(VariableNode<D, R, F> variable)
spliceInto(Expression<E, S, G> newExpression)
{
return new SubtractionNode<E, S, G>(newExpression,
left.spliceInto(newExpression),
right.spliceInto(newExpression));
left.spliceInto(newExpression),
right.spliceInto(newExpression));
}

@Override
public Node<D, R, F> differentiate(VariableNode<D, R, F> variable)
{
assert false : "TODO";
return null;
return left.differentiate(variable).sub(right.differentiate(variable));
}
}

0 comments on commit a8f6272

Please sign in to comment.