public void TestNextLesserPanlindrome() { IComparer x = new StructInt32d(); int[] input = new int[] { 9, 9, 9, 9, 9, 9 }; var expected = Tuple.Create(998899, new int[] { 9, 9, 8, 8, 9, 9 }); var actual = FunctionLib.NextLesserPanlindrome(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); input = new int[] { 9, 9, 9, 9, 9 }; expected = Tuple.Create(99899, new int[] { 9, 9, 8, 9, 9 }); actual = FunctionLib.NextLesserPanlindrome(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); input = new int[] { 9, 9, 0, 9, 9 }; expected = Tuple.Create(98989, new int[] { 9, 8, 9, 8, 9 }); actual = FunctionLib.NextLesserPanlindrome(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); input = new int[] { 9 }; expected = Tuple.Create(8, new int[] { 8 }); actual = FunctionLib.NextLesserPanlindrome(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); }
public void LoadingThread() { Thread.Sleep(1000); //Zuerst alles Laden, danach das geladene wieder Speichern. (Zur Sichertheit) int which = MWDS.Ints["SelectedHardware", 0]; if (which == 0) { HWC = new HardwareAPI.HardwareController(); } else { try { HWC = new AerotechHardware.AerotechHardwareController(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\n\nPlease restart your PC, check the service or select the correct HardwareController with a restart of LaserControl!", "Connection Error", MessageBoxButton.OK, MessageBoxImage.Error); MWDS.Ints["SelectedHardware"] = -1; Environment.Exit(0); } } HWC.Save(); Thread.Sleep(1000); FunctionLib.Load(); this.Dispatcher.Invoke(new Action(() => { this.Close(); })); }
public void TestMakeSequenceUnder() { FunctionLib.NextSequenceElement funct = FunctionLib.NextEvenFibonacci; List <int> listNum = FunctionLib.MakeSequenceUnder(funct, 2, 4000000, 1, 2); Assert.AreEqual(4613732, FunctionLib.SumArray(listNum.ToArray())); }
private static int problem4() { int result = 999999; int[] input = new int[] { 9, 9, 9, 9, 9, 9 }; while (result > 1) { Tuple <int, int[]> nextPandl = FunctionLib.NextLesserPanlindrome(input); result = nextPandl.Item1; List <int[]> factors = FunctionLib.PrimeFactorize(nextPandl.Item1); if (factors.Count > 1) { List <int> allFactors = new List <int>(); foreach (int[] n in factors) { foreach (int i in n) { allFactors.Add(i); } } //permutation algorithm } input = nextPandl.Item2; nextPandl = FunctionLib.NextLesserPanlindrome(input); } return(result); }
private static int problem2() { FunctionLib.NextSequenceElement funct = FunctionLib.NextEvenFibonacci; List <int> listNum = FunctionLib.MakeSequenceUnder(funct, 2, 4000000, 1, 2); return(FunctionLib.SumArray(listNum.ToArray())); }
public void TestPrimeFactorize() { List <int[]> list = FunctionLib.PrimeFactorize(199); List <int[]> expected = new List <int[]> { new int[2] { 199, 1 } }; IComparer cmp = (IComparer) new StructInt32d(); CollectionAssert.AreEqual( expected, list, cmp); for (int i = 2; i <= 100; i++) { int calculatedNum = 1; list = FunctionLib.PrimeFactorize(i); foreach (int[] n in list) { for (int j = 0; j < n[1]; j++) { calculatedNum *= n[0]; } } Assert.AreEqual(i, calculatedNum); } }
public static string OpenDataGet(string inputValue) { FunctionLib FunctionList = new FunctionLib(); string Result = ""; if (inputValue == "weather") { Result = FunctionList.WeatherDataParse(); } else if (inputValue == "radiation") { Result = FunctionList.radiationInformation(); } else if (inputValue == "uv") { Result = FunctionList.UVInformation(); } else if (inputValue == "ocean") { Result = FunctionList.OceanDataParse(); } else if (inputValue == "air") { Result = FunctionList.AQXInformation(); } else { List <MarkerLocation> MarkerLocationItemList = new List <MarkerLocation>(); string webAddr = "http://protecttw.cloudapp.net/Service1.svc/GetOpenData/" + inputValue + "/" + Guid.NewGuid(); HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(webAddr); httpWebRequest.ContentType = "application/json"; httpWebRequest.Method = "GET"; HttpWebResponse response = (HttpWebResponse)httpWebRequest.GetResponse(); Stream resStream = response.GetResponseStream(); DataContractJsonSerializer obj = new DataContractJsonSerializer(typeof(List <GetSitedata>)); List <GetSitedata> GetData = obj.ReadObject(resStream) as List <GetSitedata>; foreach (var item in GetData) { MarkerLocation MarkerLocationItem = new MarkerLocation(); if (string.IsNullOrEmpty(item.SiteName) == false) { MarkerLocationItem.title = item.SiteName.Replace(@"""", ""); } else { MarkerLocationItem.title = item.SiteType.Replace(@"""", ""); } MarkerLocationItem.lat = double.Parse(item.SiteLatitude); MarkerLocationItem.lng = double.Parse(item.SiteLongitude); MarkerLocationItem.description = item.SiteAddress.Replace(@"""", ""); MarkerLocationItem.icon = ""; MarkerLocationItemList.Add(MarkerLocationItem); } string json = Newtonsoft.Json.JsonConvert.SerializeObject(MarkerLocationItemList); return(json); } return(Result); }
public void TestCountInteger() { Assert.AreEqual(3, FunctionLib.CountIntegerChar(100)); Assert.AreEqual(0, FunctionLib.CountIntegerChar(0)); Assert.AreEqual(3, FunctionLib.CountIntegerChar(-100)); Assert.AreEqual(3, FunctionLib.CountIntegerChar(100)); Assert.AreEqual(3, FunctionLib.CountIntegerChar(999)); }
public void TestListPrimesUnder() { List <int> list = FunctionLib.ListPrimesUnder(100); List <int> expected = new List <int>() { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 }; CollectionAssert.AreEqual(expected, list); }
protected virtual void Awake() { inputState = GetComponent <InputState>(); body2d = GetComponent <Rigidbody2D>(); collisionState = GetComponent <CollisionState>(); pm = GetComponent <PhysicsManager>(); gm = GameObject.Find("GameManager").GetComponent <GameManager>(); fl = new FunctionLib(); plm = GameObject.Find("PlayerManager").GetComponent <PlayerManager>(); }
public void TestIntToCharArray() { char[] expected = new char[] { '1', '2', '3', '4' }; char[] actual = FunctionLib.IntToCharArray(1234); Assert.AreEqual(expected.Length, actual.Length); for (int i = 0; i < actual.Length; i++) { Assert.AreEqual(expected[i], actual[i]); } }
protected void Application_Start() { RegisterRoutes(RouteTable.Routes); ViewEngines.Engines.Clear(); FunctionLib.Register(new MathLib()); TagLib.Register(new MyTagLib()); var engine = new TilesViewEngine(); ViewEngines.Engines.Add(engine.Init()); engine.LoadResourceBundle("CustomTaglibsTagsAndFunctions.Views.default"); }
public void TestListPrimes() { List <int> list = FunctionLib.ListPrimes(100); Assert.AreEqual(100, list.Count); List <int> expected = new List <int>() { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541 }; Assert.AreEqual(100, expected.Count); CollectionAssert.AreEqual(expected, list); }
public void TestListMultiples() { List <int> list = FunctionLib.ListMultiples(10, 21, 132132131, 0); List <int> expected = new List <int> { }; CollectionAssert.AreEqual(expected, list); list = FunctionLib.ListMultiples(10, 21, 132132131, 1); expected = new List <int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; CollectionAssert.AreEqual(expected, list); }
private void NewCategoryBtn_Click(object sender, RoutedEventArgs e) { string res = Dialogs.Prompts.ShowDialog_Text("New category", "Name:", ""); if (string.IsNullOrEmpty(res) || string.IsNullOrWhiteSpace(res)) { return; } FunctionLib.AddCategory(new FunctionCategory(res)); FunctionLib.Save(); AllFunctions.Items.Clear(); TVStringItem[] tvsi = FunctionLib.GetTreeViewNodes(); foreach (var i in tvsi) { AllFunctions.Items.Add(i); } }
public void MainStartOfCardinalSolverSystem() { int N = 25; double a = 0; double b = 3.14; FunctionLib.Function f = (t) => 0.5 * Math.Sin(t); for (int i = 5; i <= 5; i++) { MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.D4_B_bc(31, a, b , new DividedDifferencesStategy(), 0, FunctionLib.sin(b), 0, -FunctionLib.sin(b), f); //System.Diagnostics.Debug.WriteLine("==================="); Console.WriteLine("========================================="); } }
public ScriptSettings() { InitializeComponent(); Data = FindResource("datahandler") as FunctionDataHandler; ParameterType.Add("bool"); ParameterType.Add("int"); ParameterType.Add("double"); ParameterType.Add("string"); ParamTypeColumn.ItemsSource = ParameterType; TVStringItem[] tvsi = FunctionLib.GetTreeViewNodes(); foreach (var i in tvsi) { AllFunctions.Items.Add(i); } }
public void TestNextEvenFibonacci() { IComparer x = new StructInt32d(); int[] input = new int[] { 1, 2 }; var expected = Tuple.Create(8, new int[] { 5, 8 }); var actual = FunctionLib.NextEvenFibonacci(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); actual = FunctionLib.NextEvenFibonacci(input); input = new int[] { 2, 3 }; actual = FunctionLib.NextEvenFibonacci(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); input = new int[] { 3, 5 }; actual = FunctionLib.NextEvenFibonacci(input); Assert.AreEqual(expected.Item1, actual.Item1); Assert.IsTrue(x.Compare(expected.Item2, actual.Item2) == 0); }
private void NewFunctionBtn_Click(object sender, RoutedEventArgs e) { string name = ""; List <string> items = new List <string>(); TVStringItem[] tvsi = FunctionLib.GetTreeViewNodes(); for (int i = 1; i < tvsi.Length; ++i) { items.Add(tvsi[i].Title); } string selCat = ""; Dialogs.Prompts.ShowDialog_Text_Combo("New Function", "Name:", "Category", ref name, items, out selCat); items.Clear(); if (string.IsNullOrEmpty(name) || string.IsNullOrWhiteSpace(name)) { return; } if (string.IsNullOrEmpty(selCat) || string.IsNullOrWhiteSpace(selCat)) { return; } Function f = new Function(name, ""); FunctionLib.AddFunction(selCat, f); FunctionLib.Save(); AllFunctions.Items.Clear(); tvsi = FunctionLib.GetTreeViewNodes(); foreach (var i in tvsi) { AllFunctions.Items.Add(i); } }
private void AllFunctions_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { TVStringItem item = e.NewValue as TVStringItem; if (item != null && item.IsFunction) { currentFunction = FunctionLib.GetFunction(item.FunctionName); Data.Name = currentFunction.FunctionName; Data.ReturnIndex = Function.TypeToIndex(currentFunction.ReturnType); Data.Code = currentFunction.Code; //Set parameter grid ! List <ParameterGridEntry> p = new List <ParameterGridEntry>(); for (int i = 0; i < currentFunction.ParameterCount; ++i) { p.Add(new ParameterGridEntry() { ParamName = currentFunction.GetParamName(i), ParamType = Function.TypeToString(currentFunction.GetParamtype(i)) }); } List <ParameterGridEntry> old = Data.Parameters; Data.Parameters = p; if (old != null) { old.Clear(); } Data.RightVisibility = System.Windows.Visibility.Visible; } else { currentFunction = null; Data.RightVisibility = System.Windows.Visibility.Hidden; } }
protected object CreateDataSource() { var avgFunc = FunctionLib.Avg(); var sumFunc = FunctionLib.Sum(); string[] date = new string[2]; //DateTime date = DateTime.Parse("0"); ObservableCollection <ReportViewModel> res = new ObservableCollection <ReportViewModel>(); var groupedBySymbolBenchMark = benchMark.GroupBy(s => s.Symbol); var groupedBySymbolLive = live.GroupBy(s => s.Symbol); decimal liveaEx = 0; decimal liveaEn = 0; string liveside = "Other"; int livesize = 0; decimal pnl = 0; decimal slippage = -100; string benchMarkSide = ""; string benchMarkAccount = ""; string liveAccount = "";// int liveNumSym = 0; int benchMarkNumSym = 0; #region get the number of live and benchmark trades symbols /*IEnumerable<AccountViewModel> noduplicates = live.Distinct(new SymbolComparer()); * foreach (var product in noduplicates) * liveNumSym++; * * IEnumerable<BenchMarkViewModel> bnoduplicates = benchMark.Distinct(new BenchMarkSymbolComparer()); * foreach (var product in bnoduplicates) * benchMarkNumSym++;*/ #endregion #region combine all data in live data foreach (var group in groupedBySymbolLive) { var avgExit = FunctionLib.Delay(avgFunc, 1); var avgEntry = FunctionLib.Delay(avgFunc, 1); var sumSize = FunctionLib.Delay(sumFunc, 1); var bMsumSize = FunctionLib.Delay(sumFunc, 1); var bMavgEntry = FunctionLib.Delay(avgFunc, 1); var bMavgExit = FunctionLib.Delay(avgFunc, 1); int fisrtbmSide = 0; int fisrtSide = 0; decimal benchMarkaEn = 0; int benchMarksize = 0; decimal benchMarkaEx = 0; benchMarkSide = ""; #region get the ave price and sum size in the group foreach (var liveData in group) { liveAccount = liveData.Account; //date = DateTime.ParseExact(liveData.Timestamp.ToString(), "yyyyMMdd-HH:mm:ss.fff",System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); date = liveData.Timestamp.Split(new char[] { '-' }); if (fisrtSide == 0) { liveside = liveData.Side; fisrtSide++; } if (liveside == "Short") { if (liveData.Side == "Long") { liveaEx = avgExit(liveData.Price); } else if (liveData.Side == "Short") { liveaEn = avgEntry(liveData.Price); livesize = sumSize(liveData.Size); } } if (liveside == "Long") { if (liveData.Side == "Short") { liveaEx = avgExit(liveData.Price); } else if (liveData.Side == "Long") { liveaEn = avgEntry(liveData.Price); livesize = sumSize(liveData.Size); } } } #endregion #region get pnl data if (liveside == "Short") { pnl = -(liveaEn + liveaEx) * livesize; } if (liveside == "Long") { pnl = -(liveaEx + liveaEn) * livesize; } #endregion #region join the benchMark data // bool show = true; foreach (var brenMarkGroup in groupedBySymbolBenchMark) { if (group.Key == brenMarkGroup.Key) { foreach (var brenchMarkData in brenMarkGroup) { benchMarkAccount = brenchMarkData.Account; if (fisrtbmSide == 0) { benchMarkSide = brenchMarkData.Side; fisrtbmSide++; } if (benchMarkSide == "Short") { if (brenchMarkData.Side == "Long") { benchMarkaEx = bMavgExit(brenchMarkData.Price); } else if (brenchMarkData.Side == "Short") { benchMarksize = bMsumSize(brenchMarkData.Size); benchMarkaEn = bMavgEntry(brenchMarkData.Price); } } if (benchMarkSide == "Long") { if (brenchMarkData.Side == "Short") { benchMarkaEx = bMavgExit(brenchMarkData.Price); } else if (brenchMarkData.Side == "Long") { benchMarkaEn = bMavgEntry(brenchMarkData.Price); benchMarksize = bMsumSize(brenchMarkData.Size); } } } } } #endregion #region get slippage data if (benchMarkaEn != 0) { slippage = liveaEn - benchMarkaEn; } else { slippage = -100; } #endregion res.Add(new ReportViewModel() { // LiveSymbolsTraded = liveNumSym, // BenchMarkSymbolsTraded = benchMarkNumSym, LiveAccount = liveAccount, BenchMarkAccount = benchMarkAccount, Symbol = group.Key, LiveSide = liveside, LiveAveEntry = Math.Round(liveaEn, 2), LiveAveExit = Math.Round(liveaEx, 2), LiveSize = livesize, BenchMarkAveEntry = Math.Round(benchMarkaEn, 2), BenchMarkSide = benchMarkSide, BenchMarkSize = benchMarksize, BenchMarkAveExit = Math.Round(benchMarkaEx, 2), PnL = Math.Round(pnl, 2), Slippage = Math.Round(slippage, 4), Date = date[0], }); } #endregion #region get data only in benchMark and no in live data foreach (var brenMarkGroup in groupedBySymbolBenchMark) { var bMsumSize = FunctionLib.Delay(sumFunc, 1); var bMavgEntry = FunctionLib.Delay(avgFunc, 1); var bMavgExit = FunctionLib.Delay(avgFunc, 1); int fisrtbmSide = 0; decimal benchMarkaEn = 0; int benchMarksize = 0; decimal benchMarkaEx = 0; bool liveSymExist = false; #region find the symbol no in live data foreach (var compgroup in groupedBySymbolLive) { if (compgroup.Key == brenMarkGroup.Key) { liveSymExist = true; } } #endregion if (liveSymExist == false) { #region caluate ave benchmark data foreach (var brenchMarkData in brenMarkGroup) { if (fisrtbmSide == 0) { benchMarkSide = brenchMarkData.Side; fisrtbmSide++; } if (benchMarkSide == "Short") { if (brenchMarkData.Side == "Long") { benchMarkaEx = bMavgExit(brenchMarkData.Price); } else if (brenchMarkData.Side == "Short") { benchMarksize = bMsumSize(brenchMarkData.Size); benchMarkaEn = bMavgEntry(brenchMarkData.Price); } } if (benchMarkSide == "Long") { if (brenchMarkData.Side == "Short") { benchMarkaEx = bMavgExit(brenchMarkData.Price); } else if (brenchMarkData.Side == "Long") { benchMarkaEn = bMavgEntry(brenchMarkData.Price); benchMarksize = bMsumSize(brenchMarkData.Size); } } } #endregion res.Add(new ReportViewModel() { // LiveSymbolsTraded = liveNumSym, // BenchMarkSymbolsTraded = benchMarkNumSym, LiveAccount = "", BenchMarkAccount = benchMarkAccount, Symbol = brenMarkGroup.Key, LiveSide = "", LiveAveEntry = 0, LiveAveExit = 0, LiveSize = 0, BenchMarkAveEntry = Math.Round(benchMarkaEn, 2), BenchMarkSide = benchMarkSide, BenchMarkSize = benchMarksize, BenchMarkAveExit = Math.Round(benchMarkaEx, 2), PnL = 0, Slippage = -100, Date = "", }); } } #endregion return(res.GroupBy(g => new { DateMaster = g.Date, BenchMarkAccount = g.BenchMarkAccount, LiveAccount = g.LiveAccount, }) .Select(s => new { s.Key.DateMaster, s.Key.BenchMarkAccount, s.Key.LiveAccount, BenchMarkSymbolsTraded = s.Where(r => r.BenchMarkSide != "").Select(r => r.Symbol).Distinct().Count(), LiveSymbolsTraded = s.Where(r => r.LiveSide != "").Select(r => r.Symbol).Distinct().Count(), LiveGross = s.Where(r => r.LiveSide == "Long").Sum(r => r.LiveSize * r.LiveAveEntry) - s.Where(r => r.LiveSide == "Short").Sum(r => r.LiveSize * r.LiveAveEntry), BenchMarkGross = s.Where(r => r.BenchMarkSide == "Long").Sum(r => r.BenchMarkSize * r.BenchMarkAveEntry) - s.Where(r => r.BenchMarkSide == "Short").Sum(r => r.BenchMarkSize * r.BenchMarkAveEntry), LiveExposure = s.Where(r => r.LiveSide == "Long").Sum(r => r.LiveSize * r.LiveAveEntry) + s.Where(r => r.LiveSide == "Short").Sum(r => r.LiveSize * r.LiveAveEntry), BenchMarkExposure = s.Where(r => r.BenchMarkSide == "Long").Sum(r => r.BenchMarkSize * r.BenchMarkAveEntry) + s.Where(r => r.BenchMarkSide == "Short").Sum(r => r.BenchMarkSize * r.BenchMarkAveEntry), ReportOrders = s, })); // return res; }
public void TestSumArray() { int[] test = new int [] { 3, 5, 7 }; Assert.AreEqual(15, FunctionLib.SumArray(test)); }
private static int problem3() { List <int[]> listNum = FunctionLib.PrimeFactorize(600851475143); return(listNum.ElementAt(listNum.Count - 1)[0]); }
private static int problem1() { List <int> listNum = FunctionLib.ListMultiples(999, 3, 5); return(FunctionLib.SumArray(listNum.ToArray())); }
public void SecondDerevitiveSinTest() { int N = 50; int degree = 2; double a_border = 0, b_border = 6.29; double h = MyMath.Basic.GetStep(N, a_border, b_border); double u0 = FunctionLib.cos(a_border), u1 = FunctionLib.cos(b_border); Vector f = MyMath.Basic.GetVectorFunction(N, a_border, b_border, FunctionLib.cos); Matrix D = CardinalDifferentialEquation.SecondDirevetive(N); Matrix DD = D * Matrix.Transpose(D); // Console.WriteLine(DD); Matrix A = (1d / (h * h)) * DD; Console.WriteLine(D * f); Vector Dy = D * f; Vector b = new Vector(N + 4); for (int i = 0; i < N + 2; i++) { b[i] = Dy[i]; } b[N + 2] = u0; b[N + 3] = u1; Console.WriteLine("b = " + b); Matrix B = new Matrix(N + 4); for (int i = 0; i < N + 2; i++) { for (int j = 0; j < N + 2; j++) { B[i, j] = A[i, j]; } } for (int i = 0; i < N + 2; i++) { B[N + 2, i] = CardinalSpline.Cardinal(degree + 2, a_border, a_border + (i - (degree + 2) + 1) * h, h); B[N + 3, i] = CardinalSpline.Cardinal(degree + 2, b_border, a_border + (i - (degree + 2) + 1) * h, h); B[i, N + 2] = -B[N + 2, i]; B[i, N + 3] = -B[N + 3, i]; } // Console.WriteLine(B); //Console.WriteLine("b = " + b); Vector c = Solver.BCG(B, b, 0.00000001d); Console.WriteLine("anser = " + c); Console.WriteLine("Ax = " + B * c); Vector d = c.SubVector(0, N + 2); CardinalSpline spline = new CardinalSpline(); Vector anser = spline.GetVectorFunction(10, a_border, b_border, d, h, degree + 2); Vector expect = MyMath.Basic.GetVectorFunction(10, a_border, b_border, FunctionLib.cos); Console.WriteLine(anser); Console.WriteLine(expect); Console.WriteLine("||u - u_spl|| = " + (expect - anser).Norm); }
public FunctionParser(FunctionLib lib) { _lib = lib; }
public void SecondStartOfCardinalSolverSystem() { int N = 10; MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.D2_B_bc(N, 0, 1 , new DividedDifferencesStategy(), 1d / 2d, FunctionLib.exp(1) / 2d, FunctionLib.exp); MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.D2_B_bc(2 * N, 0, 1 , new DividedDifferencesStategy(), 1d / 2d, FunctionLib.exp(1) / 2d, FunctionLib.exp); MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.D2_B_bc(3 * N, 0, 1 , new DividedDifferencesStategy(), 0.5 * 1, 0.5 * FunctionLib.exp(1), FunctionLib.exp); }
public void FirstStartOfCardinalSolverSystem() { int N = 10; MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.SolveSecondDerevetivWhithBounderyCondition(N, 0, 1 , new DividedDifferencesStategy(), 1, FunctionLib.exp(1), FunctionLib.exp); MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.SolveSecondDerevetivWhithBounderyCondition(2 * N, 0, 1 , new DividedDifferencesStategy(), 1, FunctionLib.exp(1), FunctionLib.exp); MyMathLib.Spline.CardinalFiniteMethod.CardinalSolver.SolveSecondDerevetivWhithBounderyCondition(3 * N, 0, 1 , new DividedDifferencesStategy(), 1, FunctionLib.exp(1), FunctionLib.exp); }