Exemple #1
0
        private void Worker(object num)
        {
            int count = (int)num;

            _pool.WaitOne();
            Interpolator interpolator = new Interpolator();

            // buffer.CountPoly += interpolator.StartInterpolate;

            for (int i = count; i < count + 100; ++i)
            {
                points2_y[i] = interpolator.computeNewtonPoly(p, p.Length, points2_x[i], buff);
            }
            _pool.Release();
            --ThreadCount;
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (!double.TryParse(textBox1.Text, out x))
                {
                    x = double.Parse(textBox1.Text, CultureInfo.InvariantCulture);
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Wrong value", ":(", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            Interpolator interpolator = new Interpolator();
            MainForm     form1        = new MainForm();

            textBox2.Show();
            textBox2.Clear();
            textBox2.Text = interpolator.computeNewtonPoly(p, p.Length, x, buff).ToString();
        }