if (source.isInputTrace() && dest.isFilterTrace()) {  if (((InputTraceNode)source).noInputs()) { System.out.println("source: " + source + ", dest: " + dest + " size: " + size); return true; }    if (((InputTraceNode)source).oneInput() && OffChipBuffer.getBuffer(((InputTraceNode)source).getSources()[0], source).getDRAM() == dram) return true; } else if (source.isOutputTrace() && dest.isInputTrace()) {  if (((OutputTraceNode)source).oneOutput() && OffChipBuffer.getBuffer(source.getPrevious(), source).getDRAM() == dram) return true; } else if (source.isFilterTrace() && dest.isOutputTrace()) {
if (source.isInputTrace() && dest.isFilterTrace()) return !necessary((InputTraceNode)source); else if (source.isOutputTrace() && dest.isInputTrace()) return !necessary((OutputTraceNode)source); else {
    public boolean redundant()     {	if (source.isInputTrace() && dest.isFilterTrace()) {	    //if this is a input->filter and no inputs then unnecessary	    if (((InputTraceNode)source).noInputs()) {		System.out.println("source: " + source + ", dest: " + dest + " size: " + size);		return true;	    }	    	    //if only one source to the input and the dram for the	    //previous buffer is the same then redunant	    if (((InputTraceNode)source).oneInput() &&		OffChipBuffer.getBuffer(((InputTraceNode)source).getSources()[0], source).getDRAM() == dram)		return true;	    	} else if (source.isOutputTrace() && dest.isInputTrace()) {	    //one output and the dram is the same as the previous 	    if (((OutputTraceNode)source).oneOutput() &&		OffChipBuffer.getBuffer(source.getPrevious(), source).getDRAM() == dram)		return true;	} else if (source.isFilterTrace() && dest.isOutputTrace()) {	    //if this a filter->outputtrace and the output has no outputs	    if (((OutputTraceNode)dest).noOutputs())		return true;	}	return false;	    }