Exemple #1
0
        /// <summary>
        /// Adds the number <paramref name="value2"/> and the elements of array <paramref name="value1"/>
        /// </summary>
        /// <param name="value1">The array to addition</param>
        /// <param name="value2">The number, which will be addition with <paramref name="value1"/> array</param>
        /// <param name="result">The result of addition</param>
        /// <param name="length">A 32-bit integer that represents the number of elements to addition</param>
        /// <param name="value1Index">A 32-bit integer that represents the index in the <paramref name="value1"/> array at which addition begins</param>
        /// <param name="value2Index">A 32-bit integer that represents the index in the <paramref name="value2"/> array at which addition begins</param>
        /// <param name="resultIndex">A 32-bit integer that represents the index in the <paramref name="result"/> array at which copying result begins</param>
        /// <remarks>If the <paramref name="result"/> array is null, operation result copying to the <paramref name="value1"/></remarks>
        unsafe public override void Addition(Complex[] value1, Complex value2, Complex[] result = null, int length = int.MaxValue, int value1Index = 0, int resultIndex = 0)
        {
            Th.ThrowOneValueWithNullableResult(value1, ref result, ref length, value1Index, resultIndex);

            fixed(Complex *value1Ptr = value1, resultPtr = result)
            DoubleArrayHelper.Addition((double *)value1Ptr, value2.Real, value2.Imaginary, (double *)resultPtr, length * 2, value1Index * 2, resultIndex * 2);
        }
        /// <summary>
        /// Adds the number <paramref name="value2"/> and the elements of array <paramref name="value1"/>
        /// </summary>
        /// <param name="value1">The array to addition</param>
        /// <param name="value2">The number, which will be addition with <paramref name="value1"/> array</param>
        /// <param name="result">The result of addition</param>
        /// <param name="length">A 32-bit integer that represents the number of elements to addition</param>
        /// <param name="value1Index">A 32-bit integer that represents the index in the <paramref name="value1"/> array at which addition begins</param>
        /// <param name="value2Index">A 32-bit integer that represents the index in the <paramref name="value2"/> array at which addition begins</param>
        /// <param name="resultIndex">A 32-bit integer that represents the index in the <paramref name="result"/> array at which copying result begins</param>
        /// <remarks>If the <paramref name="result"/> array is null, operation result copying to the <paramref name="value1"/></remarks>
        unsafe public override void Addition(Block2x2[] value1, Block2x2 value2, Block2x2[] result = null, int length = int.MaxValue, int value1Index = 0, int resultIndex = 0)
        {
            Th.ThrowOneValueWithNullableResult(value1, ref result, ref length, value1Index, resultIndex);

            fixed(Block2x2 *value1Ptr = value1, resultPtr = result)
            DoubleArrayHelper.Addition((double *)value1Ptr, value2.f00, value2.f01, value2.f10, value2.f11, (double *)resultPtr, length * 4, value1Index * 4, resultIndex * 4);
        }
        /// <summary>
        /// Adds the number <paramref name="value2"/> and the elements of array <paramref name="value1"/>
        /// </summary>
        /// <param name="value1">The array to addition</param>
        /// <param name="value2">The number, which will be addition with <paramref name="value1"/> array</param>
        /// <param name="result">The result of addition</param>
        /// <param name="length">A 32-bit integer that represents the number of elements to addition</param>
        /// <param name="value1Index">A 32-bit integer that represents the index in the <paramref name="value1"/> array at which addition begins</param>
        /// <param name="value2Index">A 32-bit integer that represents the index in the <paramref name="value2"/> array at which addition begins</param>
        /// <param name="resultIndex">A 32-bit integer that represents the index in the <paramref name="result"/> array at which copying result begins</param>
        /// <remarks>If the <paramref name="result"/> array is null, operation result copying to the <paramref name="value1"/></remarks>
        unsafe public override void Addition(double[] value1, double value2, double[] result = null, int length = int.MaxValue, int value1Index = 0, int resultIndex = 0)
        {
            Th.ThrowOneValueWithNullableResult(value1, ref result, ref length, value1Index, resultIndex);

            fixed(double *value1Ptr = value1, resultPtr = result)
            DoubleArrayHelper.Addition((double *)value1Ptr, value2, (double *)resultPtr, length, value1Index, resultIndex);
        }