Beispiel #1
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //layout
            layout = new MultiArrayLayout();
            layout.Randomize();
            //data
            arraylength = rand.Next(10);
            if (data == null)
            {
                data = new long[arraylength];
            }
            else
            {
                Array.Resize(ref data, arraylength);
            }
            for (int i = 0; i < data.Length; i++)
            {
                //data[i]
                data[i] = (System.Int64)(rand.Next() << 32) | rand.Next();
            }
        }
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //layout
            layout = new MultiArrayLayout();
            layout.Randomize();
            //data
            arraylength = rand.Next(10);
            if (data == null)
            {
                data = new byte[arraylength];
            }
            else
            {
                Array.Resize(ref data, arraylength);
            }
            for (int i = 0; i < data.Length; i++)
            {
                //data[i]
                myByte = new byte[1];
                rand.NextBytes(myByte);
                data[i] = myByte[0];
            }
        }
Beispiel #3
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //layout
            layout = new MultiArrayLayout();
            layout.Randomize();
            //data
            arraylength = rand.Next(10);
            if (data == null)
            {
                data = new Single[arraylength];
            }
            else
            {
                Array.Resize(ref data, arraylength);
            }
            for (int i = 0; i < data.Length; i++)
            {
                //data[i]
                data[i] = (float)(rand.Next() + rand.NextDouble());
            }
        }