Esempio n. 1
0
        public void rndVal()
        {
            RndGenerator       r    = new RndGenerator(mLeftBorder, mRightBorder);
            Func <int, double> temp = x => r.GetNext();

            mFunc = temp;
            compute();
        }
Esempio n. 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     r = new RndGenerator();
     validate_input();
     mDrawData = new GraphData[5];
     for (int i = 0; i < 5; i++)
     {
         mDrawData[i] = new GraphData();
     }
 }
Esempio n. 3
0
        public GraphData(double pLeft, double pRight, double pDelta, RndGenerator pr)
        {
            mCount = (int)Math.Ceiling((pRight - pLeft) / pDelta);
            Func <int, double> temp = x => pr.GetNext();

            mFunc         = temp;
            mLeftBorder   = pLeft;
            mRightBorder  = pRight;
            mDelta        = pDelta;
            mValues       = new double[mCount];
            mArguments    = new double[mCount];
            mArguments[0] = mLeftBorder;
            mValues[0]    = mArguments[0];
            for (int i = 1; i < mCount; i++)
            {
                mArguments[i] = (mArguments[i - 1] + mDelta) > mRightBorder ? mRightBorder : (mArguments[i - 1] + mDelta);
                mValues[i]    = mArguments[i];
            }
        }
Esempio n. 4
0
 public void mSetMyRnd(RndGenerator r, double a = -1, double b = 1)
 {
     mFunc = x => a + (b - a) * r.GetNext();
 }