Ejemplo n.º 1
0
 public static int sgn(fi f, double x)
 {
     if (f(x) >= 0)
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public EquipmentItemDescriptor(fi instance) : base(instance)
 {
     _internal = instance;
 }
Ejemplo n.º 6
0
 public static double[,] transform(double[,] x, fi f, int i)
 {
     return(f(x, i));
 }