Beispiel #1
0
        /// <summary>
        /// Shift (offset) the elements in the array
        /// </summary>
        /// <param name="array"></param>
        /// <param name="offset"></param>
        static public void Shift(ComplexF[] array, int offset)
        {
            Debug.Assert(array != null);
            Debug.Assert(offset >= 0);
            Debug.Assert(offset < array.Length);

            if (offset == 0)
            {
                return;
            }

            int length = array.Length;

            ComplexF[] workspace = null;
            ComplexArray.LockWorkspaceF(length, ref workspace);

            for (int i = 0; i < length; i++)
            {
                workspace[(i + offset) % length] = array[i];
            }
            for (int i = 0; i < length; i++)
            {
                array[i] = workspace[i];
            }

            ComplexArray.UnlockWorkspaceF(ref workspace);
        }
Beispiel #2
0
 /// <summary>
 /// Divide each element in target array with corresponding element in rhs array
 /// </summary>
 /// <param name="target"></param>
 /// <param name="rhs"></param>
 static public void Divide(ComplexF[] target, ComplexF[] rhs)
 {
     ComplexArray.Divide(target, rhs, target);
 }
Beispiel #3
0
 /// <summary>
 /// Multiply each element in target array with corresponding element in rhs array
 /// </summary>
 /// <param name="target"></param>
 /// <param name="rhs"></param>
 static public void Multiply(ComplexF[] target, ComplexF[] rhs)
 {
     ComplexArray.Multiply(target, rhs, target);
 }