public static List <BigInteger> GetFactorialsList() { //string location = "C:/Temp/FactorialsList/factorials.fl"; // need to use reflection to find folder location to pinpoint file location in actual build DataListObject <BigInteger> loaded = FactorialListActions.LoadListOfFactorialsFromFile(location); List <BigInteger> listOfFactorials = loaded.List; return(listOfFactorials); }
static void QuickAndDirtyFactorialListCreation(string location = "D:/DataDump/facList001.fl", bool showTextDuringListCreation = false) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // leisure/debugging purposes int factorialsToCreate = Access.FetchInt(10, "Type the number of the highest factorial that you wish to create > "); // user can input number of factorials to create FactorialListActions.GenerateFileWithListOfFactorials(factorialsToCreate, showTextDuringListCreation, location); stopwatch.Stop(); if (showTextDuringListCreation) { BinomialStochasticVariables.factorialsList = FactorialListActions.GetFactorialsList(); for (int i = 0; i < BinomialStochasticVariables.factorialsList.Count; i++) { Console.WriteLine("Factorial of {0}: {1}", i, BinomialStochasticVariables.factorialsList[i]); } } Console.WriteLine("It took this much time to complete list creation: {0}" + "\nEnding sequence, probably program. All is good. Press enter.", stopwatch.Elapsed); }
internal void InitializeFactorialsList() // if the factorials-list is not initialized, all calculations will be done 'from scratch' at runtime { BinomialStochasticVariables.factorialsList = FactorialListActions.GetFactorialsList(); }