Esempio n. 1
0
        public Containers <decimal> BuildContainersExampl1()
        {
            Containers <decimal> a = new Containers <decimal>(3, 1, 1, 0, 100);

            a.AllocateMemoryForPoints2DInEachContainer(1, 0, 50);
            a.AllocateMemoryForPoints2DInEachContainer(1, 1, 200);
            for (int i = 0; i < 3; i++)
            {
                a.SetRaingPoint2DInAllocatedMemory(i, 1, 0, GenereteColectionPoint2D(50));
                a.SetRaingPoint2DInAllocatedMemory(i, 1, 1, GenereteColectionPoint2D(200));
                a.AddRangePoint1D(i, 0, 0, GenereteColectionPoint1D(rnd1.Next(15, 250)));
                a.AddRangePoint1D(i, 0, 1, GenereteColectionPoint1D(rnd1.Next(60, 250)));
            }
            return(a);
        }
Esempio n. 2
0
        public Containers <int> BuildContainersMyExampl()
        {
            Containers <int> myContainer = new Containers <int>();

            myContainer.AddContainers(2);
            myContainer.AddMatrixInEachContainer(TypeMatrix.MatrixXYZ, 3);
            myContainer.AddMatrixInEachContainer(TypeMatrix.MatrixX, 2);
            myContainer.AddPositionsInEachMatrix(6);
            myContainer.AllocateMemoryForPoints3D(8);
            myContainer.AddContainers(1); //кількість контейнерів стало 3 і в доданому контейнері
                                          //така сама кількість матриць, позицій і точок 3д
            for (int i = 0; i < 3; i++)
            {
                for (int k = 0; k < 6; k++)
                {
                    for (int j1 = 0; j1 < 3; j1++)
                    {
                        myContainer.SetRaingPoint3DInAllocatedMemory(i, j1, k, GenereteColectionPoint3D(8));
                    }
                    for (int j2 = 0; j2 < 2; j2++)
                    {
                        myContainer.AddRangePoint1D(i, j2 + 3, k, GenereteColectionPoint1D(rnd1.Next(10)));
                    }
                }
            }
            return(myContainer);
        }
Esempio n. 3
0
        public Containers <double> BuildContainersExampl2()
        {
            Containers <double> a = new Containers <double>(10, 5, 5, 0, 10);

            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    a.AllocateMemoryForPoints2DInEachContainer(5 + i, j, rnd1.Next(5, 15));
                }
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    for (int k = 0; k < 10; k++)
                    {
                        a.SetRaingPoint2DInAllocatedMemory(i, j + 5, k, GenereteColectionPoint2D(rnd1.Next(5, 15)));
                        a.AddRangePoint1D(i, j, k, GenereteColectionPoint1D(rnd1.Next(1, 20)));
                    }
                }
            }
            return(a);
        }