Skip to content

Commit

Permalink
TensorPrimitives XML docs: MinNumber/ReciprocalSqrt/`Reciprocal…
Browse files Browse the repository at this point in the history
…SqrtEstimate` oversights (#109889)

* Fix XML docs for `MinNumber`

They ware accidentally referring to maxima

* Add `T.Sqrt` to XML docs of reciprocal square root

The effective code was copied from the other reciprocal
  • Loading branch information
delreluca authored Nov 17, 2024
1 parent d9855f2 commit 96ae7cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace System.Numerics.Tensors
{
public static partial class TensorPrimitives
{
/// <summary>Searches for the largest number in the specified tensor.</summary>
/// <summary>Searches for the smallest number in the specified tensor.</summary>
/// <param name="x">The tensor, represented as a span.</param>
/// <returns>The maximum element in <paramref name="x"/>.</returns>
/// <returns>The minimum element in <paramref name="x"/>.</returns>
/// <exception cref="ArgumentException">Length of <paramref name="x" /> must be greater than zero.</exception>
/// <remarks>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. Positive 0 is considered greater than negative 0.
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>
/// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different
Expand All @@ -28,7 +28,7 @@ public static T MinNumber<T>(ReadOnlySpan<T> x)
where T : INumber<T> =>
MinMaxCore<T, MinNumberOperator<T>>(x);

/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
/// <param name="x">The first tensor, represented as a span.</param>
/// <param name="y">The second tensor, represented as a span.</param>
/// <param name="destination">The destination tensor, represented as a span.</param>
Expand All @@ -41,7 +41,7 @@ public static T MinNumber<T>(ReadOnlySpan<T> x)
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />[i])</c>.
/// </para>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// the other is returned. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>
Expand All @@ -53,7 +53,7 @@ public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> de
where T : INumber<T> =>
InvokeSpanSpanIntoSpan<T, MinNumberOperator<T>>(x, y, destination);

/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
/// <param name="x">The first tensor, represented as a span.</param>
/// <param name="y">The second tensor, represented as a scalar.</param>
/// <param name="destination">The destination tensor, represented as a span.</param>
Expand All @@ -64,7 +64,7 @@ public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> de
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />)</c>.
/// </para>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// the other is returned. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void ReciprocalEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
/// <remarks>
/// <para>
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
/// </para>
/// </remarks>
public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
Expand All @@ -62,7 +62,7 @@ public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
/// <remarks>
/// <para>
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
/// </para>
/// </remarks>
public static void ReciprocalSqrtEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)
Expand Down

0 comments on commit 96ae7cf

Please sign in to comment.