@Override public void visit(InnerProduct node) { result = null; node.getLeft().accept(this); Expression leftResult = result; node.getRight().accept(this); Expression rightResult = result; if (leftResult != null || rightResult != null) result = new InnerProduct(leftResult, rightResult); }
@Override public Object visitInnerProduct(CluCalcParser.InnerProductContext ctx) { return new InnerProduct((Expression) visit(ctx.left), (Expression) visit(ctx.right)); }
for (ExpressionStatement s : statements) { String productName = prefix + "PRODUCT" + i; AssignmentNode renderNode = new AssignmentNode(graph, new Variable(productName), new InnerProduct(s.getExpression(), visualizationPoint)); graph.addLocalVariable(new Variable(productName)); s.insertAfter(renderNode);
@Override public Expression copy() { return new InnerProduct(getLeft().copy(), getRight().copy()); }
result = new InnerProduct(l, r); if ( state.backtracking==0 ) { result = new Division(new Reverse(op), new InnerProduct(op, new Reverse(op)));
/** * Converts this node into a human readable string representation. * @return Returns the string "<code>left . right</code>" where left and right are the two operands converted * to strings using their toString methods. */ public String toString() { return bracketComposite(getLeft()) + " . " + bracketComposite(getRight()); }