-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: Add missing Min/MaxNumber generic math APIs on TensorPrimitives #98862
Comments
Tagging subscribers to this area: @dotnet/area-system-numerics-tensors Issue DetailsBackground and motivationThese slipped through when aiming for parity. API Proposalnamespace System.Numerics.Tensors;
public static class TensorPrimitives
{
// Same surface area as Min/Max{Magnitude}, but for Min/Max{Magnitude}Number
+ public static int IndexOfMaxNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static int IndexOfMinNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static int IndexOfMaxMagnitudeNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static int IndexOfMinMagnitudeNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static T MaxMagnitudeNumber<T>(System.ReadOnlySpan<T> x) where T : INumberBase<T>;
+ public static void MaxMagnitudeNumber<T>(System.ReadOnlySpan<T> x, System.ReadOnlySpan<T> y, System.Span<T> destination) where T : INumberBase<T>;
+ public static void MaxMagnitudeNumber<T>(System.ReadOnlySpan<T> x, T y, System.Span<T> destination) where T : INumberBase<T>;
+ public static T MaxNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static void MaxNumber<T>(System.ReadOnlySpan<T> x, System.ReadOnlySpan<T> y, System.Span<T> destination) where T : INumber<T>;
+ public static void MaxNumber<T>(System.ReadOnlySpan<T> x, T y, System.Span<T> destination) where T : INumber<T>;
+ public static T MinMagnitudeNumber<T>(System.ReadOnlySpan<T> x) where T : INumberBase<T>;
+ public static void MinMagnitudeNumber<T>(System.ReadOnlySpan<T> x, System.ReadOnlySpan<T> y, System.Span<T> destination) where T : INumberBase<T>;
+ public static void MinMagnitudeNumber<T>(System.ReadOnlySpan<T> x, T y, System.Span<T> destination) where T : INumberBase<T>;
+ public static T MinNumber<T>(System.ReadOnlySpan<T> x) where T : INumber<T>;
+ public static void MinNumber<T>(System.ReadOnlySpan<T> x, System.ReadOnlySpan<T> y, System.Span<T> destination) where T : INumber<T>;
+ public static void MinNumber<T>(System.ReadOnlySpan<T> x, T y, System.Span<T> destination) where T : INumber<T>;
} API UsageTensorPrimitives.MaxMagnitude(x, y, dest); Alternative DesignsNo response RisksNo response
|
The |
namespace System.Numerics.Tensors;
public static class TensorPrimitives
{
// Same surface area as Min/Max{Magnitude}, but for Min/Max{Magnitude}Number
public static int IndexOfMaxNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMaxMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static T MaxMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumberBase<T>;
public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, System.Span<T> destination) where T : INumberBase<T>;
public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumberBase<T>;
public static T MaxNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static void MaxNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) where T : INumber<T>;
public static void MaxNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumber<T>;
public static T MinMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumberBase<T>;
public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) where T : INumberBase<T>;
public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumberBase<T>;
public static T MinNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) where T : INumber<T>;
public static void MinNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumber<T>;
} |
Remaining after #101435 public static class TensorPrimitives
{
public static int IndexOfMaxNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMaxMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static T MaxMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumberBase<T>;
public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, System.Span<T> destination) where T : INumberBase<T>;
public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumberBase<T>;
public static T MinMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumberBase<T>;
public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) where T : INumberBase<T>;
public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination) where T : INumberBase<T>;
} |
These should be a little easier to implement with #103837 as well |
Remaining after #104651 public static class TensorPrimitives
{
public static int IndexOfMaxNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMaxMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
public static int IndexOfMinMagnitudeNumber<T>(ReadOnlySpan<T> x) where T : INumber<T>;
} |
Background and motivation
These slipped through when aiming for parity.
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: