dst2srcDependency[n] = n;
int dstStage = 0, srcStage = 0; int nDataInChannel = initDataInChannel; { int minProducedData = dst.getInitPop(inputChannel) + (dst.getSteadyStatePeek(inputChannel) - dst.getSteadyStatePop(inputChannel)) - initDataInChannel;  int totalConsumed = 0; for (dstStage = 0; dstStage < dst.getInitNumPhases() || totalConsumed < initDataInChannel || nDataInChannel + totalConsumed < minProducedData; dstStage++) { int dataNeeded = dst.getPhasePeek(dstStage, inputChannel);  while (dataNeeded > nDataInChannel) { int dataPushed = src.getPhasePush(srcStage, outputChannel); nDataInChannel += dataPushed; srcStage++; }  int dataPopped = dst.getPhasePop(dstStage, inputChannel); nDataInChannel -= dataPopped; totalConsumed += dataPopped; } }    { for (; srcStage < src.getInitNumPhases(); srcStage++) { nDataInChannel += src.getPhasePush(srcStage, outputChannel);  while (nDataInChannel >= dst.getPhasePeek(dstStage, inputChannel)) { nDataInChannel -= dst.getPhasePop(dstStage, inputChannel); dstStage++; } } }  numInitSrcExec = srcStage; numInitDstExec = dstStage; }   dst2srcDependency = new int[numInitDstExec + numSteadyDstExec + 1];       { int dstStage = 0, srcStage = 0; int nDataInChannel = initDataInChannel; for (dstStage = 0; dstStage < numInitDstExec + numSteadyDstExec; dstStage++) { int dataNeeded = dst.getPhasePeek(dstStage, inputChannel);  while (dataNeeded > nDataInChannel) { nDataInChannel += src.getPhasePush(srcStage, outputChannel); srcStage++; }  dst2srcDependency[dstStage + 1] = srcStage;  nDataInChannel -= dst.getPhasePop(dstStage, inputChannel); }
    public LatencyEdge(LatencyNode node)    {        src = node;        srcChannel = -1;        dst = node;        dstChannel = -1;        srcUpstream = true;        numInitSrcExec = node.getInitNumPhases();        numInitDstExec = node.getInitNumPhases();        numSteadySrcExec = node.getSteadyNumPhases();        numSteadyDstExec = node.getSteadyNumPhases();        dst2srcDependency = new int[numInitDstExec + numSteadyDstExec + 1];        // create the appropriate latency maps        {            int n;            for (n = 0; n < numInitDstExec + numSteadyDstExec + 1; n++)            {                dst2srcDependency[n] = n;            }        }    }