コード例 #1
0
 public static void BasicExample(NCube a, NCube b, NCube c, double d, NCube result)
 {
     // what if the NCube is a matrix?
     // a.MatrixMultiply(b)?
     // if Matrix-Vector, then makes sense to include in parallelize as long as matrix dimension is small
     result.Assign(c * a * b + d);
 }
コード例 #2
0
        public static void Run()
        {
            NCube a = new NCube();
            NCube b = new NCube();
            NCube c = new NCube();

            NCube result = new NCube();

            a.AssignIfElse(a,
                           a + b,
                           a + c);

            // need to keep track of
            //
            // for if else, need to work back up the stack and identify sections that apply to

            a.AssignIfElse2(a,
                            () => { return(a + b); },
                            () => { return(a + c); });

            BasicExample(a, b, c, 3, result);

            ExecutionContext.ExecuteDeferred(() => BasicExample(a, b, c, 3, result));


            //var launcher = new DeferredLauncher();
            //launcher.Launch.BasicExample(a, b, c, 3, result);
        }
コード例 #3
0
        public static void Run()
        {
            NCube a = new NCube();
            NCube b = new NCube();
            NCube c = new NCube();

            NCube result = new NCube();

            a.AssignIfElse(a,
                a + b,
                a + c);

            // need to keep track of
            //
            // for if else, need to work back up the stack and identify sections that apply to

            a.AssignIfElse2(a,
                () => { return a + b; },
                () => { return a + c; });

            BasicExample(a, b, c, 3, result);

            ExecutionContext.ExecuteDeferred(() => BasicExample(a, b, c, 3, result));

            //var launcher = new DeferredLauncher();
            //launcher.Launch.BasicExample(a, b, c, 3, result);
        }
コード例 #4
0
 public static void BasicExample(NCube a, NCube b, NCube c, double d, NCube result)
 {
     // what if the NCube is a matrix?
     // a.MatrixMultiply(b)?
     // if Matrix-Vector, then makes sense to include in parallelize as long as matrix dimension is small
     result.Assign(c * a * b + d);
 }
コード例 #5
0
ファイル: Cube.cs プロジェクト: coffeecup-winner/tongs
 public static NCube <T1, T2, bool> Create <T1, T2>(IEnumerable <T1> source1, IEnumerable <T2> source2, Func <T1, T2, bool> cellFunc)
 {
     return(NCube <T1, T2, bool> .Create(source1, source2, (i1, i2) => cellFunc(i1, i2)?Option.Some(true) : Option.None <bool>()));
 }
コード例 #6
0
ファイル: Cube.cs プロジェクト: coffeecup-winner/tongs
 public static NCube <T1, T2, TCell> Create <T1, T2, TCell>(IEnumerable <T1> source1, IEnumerable <T2> source2, Func <T1, T2, Option <TCell> > cellFunc)
 {
     return(NCube <T1, T2, TCell> .Create(source1, source2, cellFunc));
 }
コード例 #7
0
ファイル: Cube.cs プロジェクト: coffeecup-winner/tongs
 public static NCube <T1, T2, TCell> Create <T1, T2, TCell>(IEnumerable <T1> source1, IEnumerable <T2> source2, Func <T1, T2, TCell> cellFunc)
 {
     return(NCube <T1, T2, TCell> .Create(source1, source2, (i1, i2) => Option.Some(cellFunc(i1, i2))));
 }