Пример #1
0
        /// <summary>
        /// Shifts all the elements...
        /// </summary>
        /// <param name="offsetX"></param>
        /// <param name="offsetZ"></param>
        public void Shift(int offsetX, int offsetZ)
        {
            Array2D orig = new Array2D(this);

            for (int i = 0; i < this.nx; ++i)
            {
                for (int j = 0; j < this.nz; ++j)
                {
                    int i0 = (i + offsetX) % this.nx;
                    int j0 = (j + offsetZ) % this.nz;

                    this.SetAt(i0, j0, orig.GetAt(i, j));
                }
            }
        }
Пример #2
0
        public void Shift(int offsetX, int offsetZ)
        {
            var orig = new Array2D(this);

            for (var i = 0; i < Nx; ++i)
            {
                for (var j = 0; j < Nz; ++j)
                {
                    var i0 = (i + offsetX) % Nx;
                    var j0 = (j + offsetZ) % Nz;

                    SetAt(i0, j0, orig.GetAt(i, j));
                }
            }
        }
Пример #3
0
        /// <summary>
        /// shifts all the elements...
        /// </summary>
        /// <param name="offsetX"></param>
        /// <param name="offsetY"></param>
        public void Shift(int offsetX, int offsetZ)
        {
            Array2D orig = new Array2D(this);

            for (int i = 0; i < this.nx; ++i)
            {
                for (int j = 0; j < this.nz; ++j)
                {
                    int i0 = (i + offsetX) % this.nx;
                    int j0 = (j + offsetZ) % this.nz;

                    this.SetAt(i0, j0, orig.GetAt(i, j));
                }
            }
        }