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); }
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); }
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); }
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>())); }
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)); }
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)))); }