예제 #1
0
        private void ApplyOperatorR()
        {
            int length = _rx.Nx * _rx.Ny;
            int nz     = _rx.Nz;

            Iterate(length, i => //for (int i = 0; i < length; i++)
            {
                long inz  = i * nz;
                long inz3 = i * nz * 3;

                UNM.MultiplyElementwise(nz, _rFunction + inz, _input.Ptr + inz3, _rx.Ptr + inz3);
                UNM.MultiplyElementwise(nz, _rFunction + inz, _input.Ptr + inz3 + nz, _rx.Ptr + inz3 + nz);
                UNM.MultiplyElementwise(nz, _rFunction + inz, _input.Ptr + inz3 + nz + nz, _rx.Ptr + inz3 + nz + nz);
                //}
            });
        }
예제 #2
0
        private void ExtractData()
        {
            int nx = _output.Nx;
            int ny = _output.Ny;
            int nz = Model.Nz;

            var output = Pool.Plan3Nz.Buffer2Ptr;

            Iterate(nx, i => //for (int i = 0; i < nx; i++)
            {
                for (int j = 0; j < ny; j++)
                {
                    long shiftDst = (i * ny + j) * 3L * nz;
                    long shiftSrc = (i * ny * 2 + j) * 3L * nz;

                    UNM.MultiplyElementwise(nz, _backwardFactors, output + shiftSrc, _output.Ptr + shiftDst);
                    UNM.MultiplyElementwise(nz, _backwardFactors, output + shiftSrc + nz,
                                            _output.Ptr + shiftDst + nz);
                    UNM.MultiplyElementwise(nz, _backwardFactors, output + shiftSrc + nz + nz,
                                            _output.Ptr + shiftDst + nz + nz);
                }
            });
        }
예제 #3
0
        private void PrepareForForwardFft()
        {
            var inputPtr = Pool.Plan3Nz.Buffer1Ptr;

            UNM.ClearBuffer(inputPtr, Pool.Plan3Nz.BufferLength);

            int nx = _rx.Nx;
            int ny = _rx.Ny;
            int nz = Model.Nz;

            Iterate(nx, i => //for (int i = 0; i < nx; i++)
            {
                for (int j = 0; j < ny; j++)
                {
                    long shiftSrc = (i * ny + j) * 3L * nz;
                    long shiftDst = (i * ny * 2 + j) * 3L * nz;

                    UNM.MultiplyElementwise(nz, _forwardFactors, _rx.Ptr + shiftSrc, inputPtr + shiftDst);
                    UNM.MultiplyElementwise(nz, _forwardFactors, _rx.Ptr + shiftSrc + nz, inputPtr + shiftDst + nz);
                    UNM.MultiplyElementwise(nz, _forwardFactors, _rx.Ptr + shiftSrc + nz + nz,
                                            inputPtr + shiftDst + nz + nz);
                }
            });
        }