Esempio n. 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Gets random y coordinate set. </summary>
        ///
        /// <param name="dataCount">    Number of data. </param>
        /// <param name="xdim">         The xdim. </param>
        ///
        /// <returns>   The random y coordinate set. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public TestDataSet GetRandomYSet(int dataCount, int xdim)
        {
            NdArray listY  = new NdArray(new[] { 1, xdim, xdim }, dataCount, (Function)null);
            NdArray listTy = new NdArray(new[] { 1 }, dataCount, (Function)null);

            for (int i = 0; i < dataCount; i++)
            {
                int index = Mother.Dice.Next(Y.Length);

                Array.Copy(Y[index].Data, 0, listY.Data, i * listY.Length, listY.Length);
                listTy.Data[i] = Ty[index].Data[0];
            }

            TestDataSet tds = new TestDataSet(listY, listTy);

            RILogManager.Default?.SendDebug("Getting random Y data (" + tds.Data.Length + ") bytes");
            return(tds);
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Gets random x coordinate set. </summary>
        ///
        /// <param name="dataCount">    Number of data. </param>
        /// <param name="x">            The x coordinate. </param>
        /// <param name="y">            The y coordinate. </param>
        ///
        /// <returns>   The random x coordinate set. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public TestDataSet GetRandomXSet(int dataCount, int x, int y)
        {
            NdArray listX  = new NdArray(new[] { 1, x, y }, dataCount, (Function)null);
            NdArray listTx = new NdArray(new[] { 1 }, dataCount, (Function)null);

            for (int i = 0; i < dataCount; i++)
            {
                int index = Mother.Dice.Next(X.Length);

                Array.Copy(X[index].Data, 0, listX.Data, i * listX.Length, listX.Length);
                listTx.Data[i] = Tx[index].Data[0];
            }

            TestDataSet tds = new TestDataSet(listX, listTx);

            RILogManager.Default?.SendDebug("Getting random X data (" + tds.Data.Length + ") bytes");
            return(tds);
        }