dst2srcDependency[n] = n;
int dstStage = 0, srcStage = 0; int nDataInChannel = 0; { for (dstStage = 0; dstStage < dst.getInitNumPhases(); dstStage++) { int dataNeeded = dst.getPhasePeek(dstStage, inputChannel);  while (dataNeeded >= nDataInChannel) { nDataInChannel += src.getPhasePush(srcStage, outputChannel); srcStage++; }  nDataInChannel -= dst.getPhasePop(dstStage, inputChannel); } }    { 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];       { int dstStage = 0, srcStage = 0; int nDataInChannel = 0; for (dstStage = 0; dstStage < numInitDstExec + numSteadyDstExec; dstStage++) { int dataNeeded = dst.getPhasePeek(dstStage, inputChannel);  while (dataNeeded >= nDataInChannel) { nDataInChannel += src.getPhasePush(srcStage, outputChannel); srcStage++; }  dst2srcDependency[dstStage] = srcStage - 1;  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];        // create the appropriate latency maps        {            int n;            for (n = 0; n < numInitDstExec + numSteadyDstExec; n++)            {                dst2srcDependency[n] = n;            }        }    }