Exemplo n.º 1
0
        public DepthCounter(IDoubleStatistic[] statisticsToCollect = null, bool optimizeDepth = false)
        {
            stats = new StatisticsCollector <CallGraphEdge>(
                Utils.MethodParametersNames(this, "StatisticsRecord"),
                statisticsToCollect ?? StatisticsCollector <CallGraphEdge> .DefaultStatistics()
                );
            operationCallStack = new Stack <OperationCallRecord>();

            OperationCallRecord opRec = new OperationCallRecord();

            opRec.OperationName = CallGraphEdge.CallGraphRootHashed;
            operationCallStack.Push(opRec);

            this.optimizeDepth = optimizeDepth;
            if (optimizeDepth)
            {
                qubitStartTimes = new SortedQubitPool();
                qubitEndTimes   = new SortedQubitPool();
            }
            else
            {
                qubitAvailabilityTime = new QubitAvailabilityTimeTracker(
                    initialCapacity: 128, // Reasonable number to preallocate.
                    defaultAvailabilityTime: 0.0);
            }
        }
Exemplo n.º 2
0
 public WidthCounter(IDoubleStatistic[] statisticsToCollect = null)
 {
     statisticsCollector = new StatisticsCollector <CallGraphEdge>(
         Utils.MethodParametersNames(this, "StatisticsRecord"),
         statisticsToCollect ?? StatisticsCollector <CallGraphEdge> .DefaultStatistics()
         );
     operationCallStack = new Stack <OperationCallRecord>();
     AddToCallStack(CallGraphEdge.CallGraphRootHashed, OperationFunctor.Body);
 }
Exemplo n.º 3
0
        public DepthCounter(IDoubleStatistic[] statisticsToCollect = null)
        {
            stats = new StatisticsCollector <CallGraphEdge>(
                Utils.MethodParametersNames(this, "StatisticsRecord"),
                statisticsToCollect ?? StatisticsCollector <CallGraphEdge> .DefaultStatistics()
                );
            operationCallStack = new Stack <OperationCallRecord>();

            OperationCallRecord opRec = new OperationCallRecord();

            opRec.OperationName = CallGraphEdge.CallGraphRootHashed;
            operationCallStack.Push(opRec);
        }