Example #1
0
        public void AddDefaults()
        {
            // random init
            V2DataOnGrid data_grid_1 = new V2DataOnGrid("data_grid_2", 6.0f, new Grid1D(2, 2), new Grid1D(3, 2));

            data_grid_1.InitRandom(-10.0, 15.0);
            V2DataOnGrid data_grid_2 = new V2DataOnGrid("data_grid_2", 6.0f, new Grid1D(1, 0), new Grid1D(2, 0));

            data_grid_2.InitRandom(-10.0, 15.0);


            V2DataCollection data_collection_1 = new V2DataCollection("data_collection_1", 2.0f);

            data_collection_1.InitRandom(0, 10.0f, 20.0f, -11.0f, -5.0f);
            V2DataCollection data_collection_2 = new V2DataCollection("data_collection_2", 3.0f);

            data_collection_2.InitRandom(2, 10.0f, 20.0f, -2.0f, 2.0f);
            V2DataCollection data_collection_3 = new V2DataCollection("data_collection_1", 2.0f);

            data_collection_3.InitRandom(4, 1.0f, 12.0f, 11.0f, 25.0f);

            V2data_list.Add(data_grid_1);
            V2data_list.Add(data_collection_1);
            V2data_list.Add(data_collection_2);
            V2data_list.Add(data_grid_2);
            V2data_list.Add(data_collection_3);
        }
Example #2
0
        public void AddDefaults()
        {
            // random init
            V2DataOnGrid data_grid = new V2DataOnGrid("data_grid_2", 1.0f, new Grid1D(1, 2), new Grid1D(2, 3));

            data_grid.InitRandom(-10.0, -5.0);

            V2DataCollection data_collection_1 = new V2DataCollection("data_collection_1", 2.0f);

            data_collection_1.InitRandom(3, 1.0f, 2.0f, 1.0f, 5.0f);

            V2DataCollection data_collection_2 = new V2DataCollection("data_collection_2", 3.0f);

            data_collection_2.InitRandom(5, 10.0f, 20.0f, -2.0f, 2.0f);

            V2data_list.Add(data_grid);
            V2data_list.Add(data_collection_1);
            V2data_list.Add(data_collection_2);
        }
Example #3
0
        static void Main(string[] args)
        {
            // ------------------------------

            V2DataOnGrid data_grid = new V2DataOnGrid("data_grid_1", 10.0f, new Grid1D(1, 2), new Grid1D(2, 3));

            data_grid.InitRandom(-10.0, -5.0);
            Console.WriteLine(data_grid.ToLongString());

            V2DataCollection data_collection = (V2DataCollection)data_grid;

            Console.WriteLine(data_collection.ToLongString());

            V2MainCollection main_collection = new V2MainCollection();

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

            Complex[] array;
            Console.WriteLine(" NearAverage of all elements in main_collection object:\n");
            foreach (V2Data data in main_collection)
            {
                array = data.NearAverage(1.0f);

                for (int i = 0; i < array.Length; i++)
                {
                    Console.WriteLine(array[i]);
                }

                Array.Clear(array, 0, array.Length);

                Console.WriteLine("\n");
            }

            // ------------------------------


            // --- deleting element ---
            //main_collection.Remove("data_collection_1", 2.0f);
            //Console.WriteLine(main_collection.ToString());
        }
Example #4
0
        public override IEnumerable <DataItem> GetDataItem()
        {
            V2DataCollection temp = (V2DataCollection)this;

            return(temp.GetDataItem());
        }