public static int sgn(fi f, double x) { if (f(x) >= 0) { return(1); } else { return(-1); } }
public static double Sum(double x, fi f) { int den = 1; int i = 0; double a, s = 0; do { a = f(x, ref i, ref den); s += a; } while (Math.Abs(a) > 0.00001); return(s); }
public static int cnt(fi f, double a, double b, double h) { int ans = 1, curr = sgn(f, a); for (double x = a + h; x <= b; x += h) { if (curr != sgn(f, x)) { ans++; curr *= -1; } } return(ans); }
public FilesData(string[] str) { count = str.Length; fi[] K = new fi[count]; foreach (string s in str) { count--; FileStream A = new FileStream(s, FileMode.Open, FileAccess.Read); BufferedStream B = new BufferedStream(A); K[count].path = s; K[count].data = new byte[B.Length]; B.Read(K[count].data, 0, (int)B.Length); B.Close(); A.Close(); } dataFi = K; count = str.Length; }
public EquipmentItemDescriptor(fi instance) : base(instance) { _internal = instance; }
public static double[,] transform(double[,] x, fi f, int i) { return(f(x, i)); }