Ejemplo n.º 1
0
 public V2DataOnGrid(string info, double freq, Grid1D ox, Grid1D oy) : base(info, freq)
 {
     Info  = info;
     Freq  = freq;
     Grids = new Grid1D[2] {
         ox, oy
     };
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            /* 1 */
            Grid1D       x    = new Grid1D(10, 3);
            Grid1D       y    = new Grid1D(10, 3);
            V2DataOnGrid test = new V2DataOnGrid("test", 100, x, y);

            test.initRandom(0, 100);
            Console.WriteLine(test.ToLongString());

            //Console.WriteLine("\n\n ========== OPERATOR ========== \n\n");

            V2DataCollection collection = (V2DataCollection)test;

            Console.WriteLine(collection.ToLongString());

            /* 2 */
            V2MainCollection mainCollection = new V2MainCollection();

            mainCollection.AddDefaults();
            Console.WriteLine(mainCollection.ToString());

            /* 3 */
            Complex[] c;
            int       count = 1;

            foreach (V2Data item in mainCollection)
            {
                Console.WriteLine("item " + count.ToString());
                item.ToLongString();

                c = item.NearAverage(10);
                Console.WriteLine("average eps = 10");
                for (int i = 0; i < c.Length; i++)
                {
                    Console.WriteLine(c[i].ToString());
                }
                count++;
            }

            /* test remove */
            mainCollection.Remove("data info2", 2);
            Console.WriteLine(mainCollection.ToString());
        }
Ejemplo n.º 3
0
        public void AddDefaults()
        {
            Grid1D Ox = new Grid1D(10, 3);
            Grid1D Oy = new Grid1D(10, 3);

            v2Datas = new List <V2Data>();
            V2DataOnGrid[]     grid        = new V2DataOnGrid[3];
            V2DataCollection[] collections = new V2DataCollection[3];

            for (int i = 0; i < 3; i++)
            {
                grid[i]        = new V2DataOnGrid("data info2" /*+ i.ToString()*/, 2, Ox, Oy); // test i = 2
                collections[i] = new V2DataCollection("collection info" + i.ToString(), i);
            }

            for (int i = 0; i < 3; i++)
            {
                grid[i].initRandom(0, 100);
                collections[i].initRandom(4, 100, 100, 0, 100);
                v2Datas.Add(grid[i]);
                v2Datas.Add(collections[i]);
            }
        }