Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct PhasePoint
- {
- List<double> x;
- PhasePoint(List<double x) {
- this.x = x;
- }
- PhasePoint(params double[] x) {
- this.x = x.ToList();
- }
- static PhasePoint opeartor+(PhasePoint p1, PhasePoint p2) {
- if (p1.x.Lenght != p2.x.Lenght)
- throw new InvalidOperationException("Phase points must have same dimension!");
- var result_x = new List<double>();
- for (int i = 0; i < p1.x.Length; i++)
- result_x.Add(p1.x.[i] + p2.x.[i]);
- return new PhasePoint(result_x);
- }
- //аналогично реализуешь остальные операторы
- }
- //потом в коде метода используешь PhasePoint так же как обычный double
- public List<SolvingPoint> Met(DelegateFunc.Func func,double h,double x0, double xk) ->
- public List<SolvingPoint> Met(DelegateFunc.Func func,PhasePoint h,PhasePoint x0, PhasePoint xk)
- etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement