You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Licensed to the .NET Foundation under one or more agreements.
2
+
// The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+
usingSystem.Runtime.CompilerServices;
5
+
usingSystem.Runtime.InteropServices;
6
+
usingSystem.Runtime.Intrinsics;
7
+
usingSystem.Runtime.Intrinsics.Arm;
8
+
9
+
namespaceSystem.Numerics.Tensors
10
+
{
11
+
publicstaticpartialclassTensorPrimitives
12
+
{
13
+
/// <summary>Searches for the largest number in the specified tensor.</summary>
14
+
/// <param name="x">The tensor, represented as a span.</param>
15
+
/// <returns>The maximum element in <paramref name="x"/>.</returns>
16
+
/// <exception cref="ArgumentException">Length of <paramref name="x" /> must be greater than zero.</exception>
17
+
/// <remarks>
18
+
/// <para>
19
+
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. Positive 0 is considered greater than negative 0.
20
+
/// </para>
21
+
/// <para>
22
+
/// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different
23
+
/// operating systems or architectures.
24
+
/// </para>
25
+
/// </remarks>
26
+
publicstaticTMaxNumber<T>(ReadOnlySpan<T>x)
27
+
whereT:INumber<T>=>
28
+
MinMaxCore<T,MaxNumberOperator<T>>(x);
29
+
30
+
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
31
+
/// <param name="x">The first tensor, represented as a span.</param>
32
+
/// <param name="y">The second tensor, represented as a span.</param>
33
+
/// <param name="destination">The destination tensor, represented as a span.</param>
34
+
/// <exception cref="ArgumentException">Length of <paramref name="x" /> must be same as length of <paramref name="y" />.</exception>
35
+
/// <exception cref="ArgumentException">Destination is too short.</exception>
36
+
/// <exception cref="ArgumentException"><paramref name="x"/> and <paramref name="destination"/> reference overlapping memory locations and do not begin at the same location.</exception>
37
+
/// <exception cref="ArgumentException"><paramref name="y"/> and <paramref name="destination"/> reference overlapping memory locations and do not begin at the same location.</exception>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
44
+
/// the other is returned. Positive 0 is considered greater than negative 0.
45
+
/// </para>
46
+
/// <para>
47
+
/// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
56
+
/// <param name="x">The first tensor, represented as a span.</param>
57
+
/// <param name="y">The second tensor, represented as a scalar.</param>
58
+
/// <param name="destination">The destination tensor, represented as a span.</param>
59
+
/// <exception cref="ArgumentException">Destination is too short.</exception>
60
+
/// <exception cref="ArgumentException"><paramref name="x"/> and <paramref name="destination"/> reference overlapping memory locations and do not begin at the same location.</exception>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
67
+
/// the other is returned. Positive 0 is considered greater than negative 0.
68
+
/// </para>
69
+
/// <para>
70
+
/// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different
0 commit comments