Ejemplo n.º 1
0
        public BinaryStatefulIntKeyedOperator(int index, Stage <T> stage, bool input1Immutable, bool input2Immutable, Expression <Func <S1, Int32> > k1, Expression <Func <S2, Int32> > k2, Expression <Func <S1, V1> > v1, Expression <Func <S2, V2> > v2, bool maintainOC = true)
            : base(index, stage, null)
        {
            key1   = k1.Compile();
            value1 = v1.Compile();

            key2   = k2.Compile();
            value2 = v2.Compile();

            keyExpression1   = k1;
            keyExpression2   = k2;
            valueExpression1 = v1;
            valueExpression2 = v2;

            MaintainOutputTrace = maintainOC;

            this.keyIndices = new BinaryKeyIndices[0][];

            this.inputImmutable1 = input1Immutable;
            this.inputImmutable2 = input2Immutable;

            keyIndices  = new BinaryKeyIndices[65536][];
            inputTrace1 = createInputTrace1();
            inputTrace2 = createInputTrace2();
            outputTrace = createOutputTrace();

            outputWorkspace = 0;
        }
Ejemplo n.º 2
0
        public ConservativeUnaryStatefulOperator(int index, Stage <T> collection, bool immutableInput, Expression <Func <S, K> > k, Expression <Func <S, V> > v, bool ignored = true)
            : base(index, collection, null)
        {
            key   = k.Compile();
            value = v.Compile();

            keyExpression   = k;
            valueExpression = v;

            this.inputImmutable = immutableInput;

            internTable = new LatticeInternTable <T>();
            keyIndices  = new Dictionary <K, UnaryKeyIndices>();
            inputTrace  = createInputTrace();
            outputTrace = createOutputTrace();
        }
Ejemplo n.º 3
0
        public UnaryStatefulIntKeyedOperator(int index, Stage <T> collection, bool immutableInput, Expression <Func <S, int> > k, Expression <Func <S, V> > v, bool maintainOutputTrace = true)
            : base(index, collection, null)
        {
            key   = k.Compile();
            value = v.Compile();

            keyExpression   = k;
            valueExpression = v;

            MaintainOutputTrace = maintainOutputTrace;

            if (immutableInput)
            {
                this.inputImmutable = true;
            }

            internTable = new LatticeInternTable <T>();
            keyIndices  = new UnaryKeyIndices[65536][];
            inputTrace  = createInputTrace();
            outputTrace = createOutputTrace();

            //this.Input = new Naiad.Frameworks.RecvFiberBank<Weighted<S>, T>(this, collection.Input);

            //if (inputImmutable)
            //    collection.Input.Register(new ActionReceiver<Weighted<S>, T>(this, x => { this.OnInput(x.s, x.t); this.ScheduleAt(x.t); }));

#if false
            if (this.inputImmutable)
            {
                this.input = new ActionReceiver <Weighted <S>, T>(this, x => { this.OnInput(x.s, x.t); this.ScheduleAt(x.t); });
            }
            else
            {
                this.RecvInput = new Naiad.Frameworks.RecvFiberBank <Weighted <S>, T>(this);
                this.input     = this.RecvInput;
            }
#endif
        }
Ejemplo n.º 4
0
        public ConservativeBinaryStatefulOperator(int index, Stage <T> stage, bool input1Immutable, bool input2Immutable, Expression <Func <S1, K> > k1, Expression <Func <S2, K> > k2, Expression <Func <S1, V1> > v1, Expression <Func <S2, V2> > v2, bool maintainOC = true)
            : base(index, stage, null)
        {
            key1   = k1.Compile();
            value1 = v1.Compile();

            key2   = k2.Compile();
            value2 = v2.Compile();

            keyExpression1   = k1;
            keyExpression2   = k2;
            valueExpression1 = v1;
            valueExpression2 = v2;

            inputImmutable1 = input1Immutable;
            inputImmutable2 = input2Immutable;

            keyIndices  = new Dictionary <K, BinaryKeyIndices>();
            inputTrace1 = createInputTrace1();
            inputTrace2 = createInputTrace2();
            outputTrace = createOutputTrace();

            outputWorkspace = 0;
        }