private object LoadLaplace() { int nx, ny; GetLaplacianSize(cbLaplace.Text, out nx, out ny); return(MatrixHelper.CreateLaplacian(typeName, nx, ny)); }
private async void btnRun_Click(object sender, EventArgs e) { if (busy) { if (cts != null) { cts.Cancel(); } return; } cts = new CancellationTokenSource(); var solver = comboSolver.SelectedItem as TypeNameProvider; var preconditioner = comboPrecon.SelectedItem as TypeNameProvider; var setup = new BenchmarkSetup(); setup.CancellationToken = cts.Token; if (matrix == null) { matrix = MatrixHelper.CreateLaplacian(typeName, 50, 50); } if (typeName == "Double") { setup.SetMatrix <double>(matrix); } else { setup.SetMatrix <Complex>(matrix); } setup.Solver = cache.GetSolver(typeName, solver.Type); setup.Preconditioner = cache.GetPreconditioner(typeName, preconditioner.Type); setup.Tolerance = GetTolerance(); setup.IterationsLimit = GetLimit(); btnRun.Image = Properties.Resources.stop; try { busy = true; await benchmarkResultsView1.Run(setup, typeName); } catch (Exception ex) { lbInfo.Text = ex.Message; } finally { busy = false; } btnRun.Image = Properties.Resources.play; }