static void Main(string[] args) { SudokuField sudoku = new SudokuField(); MainSolver solver = new MainSolver(); sudoku = solver.Process(sudoku); Console.WriteLine(sudoku); }
static void Main(String[] args) { Options options = new Options(); if (!options.parse(args)) { //return; } Scanner scanner = new Scanner(); // Take all the parameters from the input double a, b; int N; int fx; int _realN; // ------ lower limit input ----- Console.Write("Ingrese a: "); if (options.isASet) { a = options.a; Console.WriteLine(a); } else { a = scanner.nextDouble(); } // ------ upper limit input ----- Console.Write("Ingrese b: "); if (options.isBSet) { b = options.b; Console.WriteLine(b); } else { b = scanner.nextDouble(); } // ------ number of partitions input ----- Console.Write("Ingrese N: "); if (options.isNumPartitionsSet) { N = options.numPartitions; Console.WriteLine(N); } else { N = scanner.nextInt(); } _realN = 3 * N; Console.WriteLine("Seleccione la funcion a integrar (1 - {0}):", functions.Length); for (int i = 0; i < functions.Length; i++) { Console.WriteLine(" opcion #{0}: {1}", i, functions[i].GetName()); } // ------ function index input ------ if (options.isFxSet) { Console.Write(" ingrese la opcion: "); fx = options.fx; Console.WriteLine(fx); } else { do { Console.Write(" ingrese la opcion: "); fx = scanner.nextInt(); } while (fx < 0 || fx >= functions.Length); } Console.WriteLine(); // ----- begin to calculate the final results ----- double h = (b - a) / _realN; Console.WriteLine("Resultado Integracion:"); Console.WriteLine("=========================="); Console.WriteLine(); Console.WriteLine("Funcion a integrar : {0}", functions[fx].GetName()); Console.WriteLine("Numero de particiones : 3 * (N={0}) = {1}", N, _realN); Console.WriteLine("Limite inferior : {0}", a); Console.WriteLine("Limite superior : {0}", b); Console.WriteLine("Paso (h = (b-a)/N) : {0}", h); // ----- solve and print the final result ----------- MainSolver solver = new MainSolver(a, b, h, _realN, functions[fx]); double result = solver.ExecuteThreads(); Console.WriteLine("Resultado de integracion: {0}", result); }