Exemplo n.º 1
0
 public void CreateClean()
 {
     for (int i = 0; i < 100; i++)
     {
         using (PinnedImageBuffer <int> buffer = PinnedImageBuffer <int> .CreateClean(42, 42))
         {
             for (int j = 0; j < buffer.Length; j++)
             {
                 Assert.Equal(0, buffer.Array[j]);
                 buffer.Array[j] = 666;
             }
         }
     }
 }
            /// <summary>
            /// Initializes a new instance of the <see cref="WeightsBuffer"/> class.
            /// </summary>
            /// <param name="sourceSize">The size of the source window</param>
            /// <param name="destinationSize">The size of the destination window</param>
            public WeightsBuffer(int sourceSize, int destinationSize)
            {
                this.dataBuffer = PinnedImageBuffer <float> .CreateClean(sourceSize, destinationSize);

                this.Weights = new WeightsWindow[destinationSize];
            }