@Override public int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { // Check that all input depths are the same if (isLeaf()) // No children! throw new IterationTypeMismatchException("Dot product with no children"); int depth = getChildAt(0).getIterationDepth(inputDepths); for (IterationStrategyNode childNode : getChildren()) if (childNode.getIterationDepth(inputDepths) != depth) throw new IterationTypeMismatchException( "Mismatched input types for dot product node"); return depth; } }
@Override public int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { if (isLeaf()) // No children! throw new IterationTypeMismatchException( "Cross product with no children"); int temp = 0; for (IterationStrategyNode child : getChildren()) temp += child.getIterationDepth(inputDepths); return temp; } }
for (MergeInputPort ip : inputs) if (ip.getIncomingLink().getResolvedDepth() != inputDepth) throw new IterationTypeMismatchException();