public void inOilOutArray(Vector3 p, Vector3 Previous) { //for分で回す必要めっちゃある for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { InArray ins = inArrays[x, y]; if (p == worldPos[x, y]) { inArrays[x, y] = InArray.Cube; } if (Previous != p && Previous == worldPos[x, y]) { if (OutOfOilChack(1, 18, width - 1, height - 1, Previous)) { inArrays[x, y] = InArray.OutOfOil; } else { inArrays[x, y] = InArray.Space; } //inArrays[x, y] = InArray.OutOfOil; } } } }
//自分の情報を返す public InArray SelfState(Vector3 p) { InArray i = InArray.Space; for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { if (p == worldPos[x, y]) { i = inArrays[x, y]; } } } return i; }
/// <summary> /// Example update function used for dynamic updates to the plot /// </summary> /// <param name="A">New data, matching the requirements of your plot</param> public void Update(InArray<double> A) { using (Scope.Enter(A)) { // fetch a reference to the plot var plot = ilPanel1.Scene.First<LinePlot>(tag: "mylineplot"); if (plot != null) { // make sure, to convert elements to float plot.Update(ILMath.tosingle(A)); // // ... do more manipulations here ... // finished with updates? -> Call Configure() on the changes plot.Configure(); // cause immediate redraw of the scene ilPanel1.Refresh(); } } }
public void Execute() { //Create instance of OpenCL compiler var compiler = new OpenCLCompiler(); //Select a default device compiler.UseDevice(0); //Compile the sample kernel compiler.CompileKernel(typeof(SGEMMKernals), typeof(SimpleKernels)); //Create variable a, b and r int M = 30; int N = 30; int K = 20; var x = new InArray(new long[] { M, K }, DType.Float32); var y = new InArray(new long[] { K, M }, DType.Float32); var z = new OutArray(new long[] { M, N }, DType.Float32) { IsElementWise = false }; //Get the execution engine var exec = compiler.GetExec(); exec.Fill(x, 2); exec.Fill(y, 3); var r = y.ToArray(); exec.MatMul(M, N, K, x, y, z); r = z.ToArray(); //Print the result Console.WriteLine("\nResult----"); for (int i = 0; i < z.Count; i++) { Console.Write(z[i] + " "); } }
public Result RefreshApplicationAddOnContent(InArray <Ncm.ApplicationId> ids) => _interface.Target.RefreshApplicationAddOnContent(ids);