brutal/brutal.numerics/Brutal.Numerics/Vector/ulong3/ulong3.numerics.gen.cs
2026-10-15 14:12:02 +13:00

389 lines
13 KiB
C#

// <auto-generated /> - edit Vector.numerics.tt to modify
#nullable enable
namespace Brutal.Numerics;
// INumberBase
public partial struct ulong3 : INumberBase<ulong3>
{
/// <inheritdoc />
public static ulong3 Zero => new(0);
/// <inheritdoc />
public static ulong3 One => new(1);
static ulong3 IAdditiveIdentity<ulong3, ulong3>.AdditiveIdentity => Zero;
static ulong3 IMultiplicativeIdentity<ulong3, ulong3>.MultiplicativeIdentity => One;
static int INumberBase<ulong3>.Radix => 2; // every component type is binary
static ulong3 INumberBase<ulong3>.Abs(ulong3 value) => value;
static bool INumberBase<ulong3>.IsCanonical(ulong3 value) => true;
static bool INumberBase<ulong3>.IsComplexNumber(ulong3 value) => false;
static bool INumberBase<ulong3>.IsImaginaryNumber(ulong3 value) => false;
/// <summary>Determines if every component of a value is zero.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool INumberBase<ulong3>.IsZero(ulong3 value)
{
return value == Zero;
}
/// <summary>Determines if every component of a value is an even integral value.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool INumberBase<ulong3>.IsEvenInteger(ulong3 value)
{
return (value.X & 1) == 0 && (value.Y & 1) == 0 && (value.Z & 1) == 0;
}
/// <summary>Determines if every component of a value is an odd integral value.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool INumberBase<ulong3>.IsOddInteger(ulong3 value)
{
return (value.X & 1) == 1 && (value.Y & 1) == 1 && (value.Z & 1) == 1;
}
static bool INumberBase<ulong3>.IsNegative(ulong3 value) => false;
static bool INumberBase<ulong3>.IsPositive(ulong3 value) => true;
static bool INumberBase<ulong3>.IsFinite(ulong3 value) => true;
static bool INumberBase<ulong3>.IsInfinity(ulong3 value) => false;
static bool INumberBase<ulong3>.IsNegativeInfinity(ulong3 value) => false;
static bool INumberBase<ulong3>.IsPositiveInfinity(ulong3 value) => false;
static bool INumberBase<ulong3>.IsInteger(ulong3 value) => true;
static bool INumberBase<ulong3>.IsRealNumber(ulong3 value) => true;
static bool INumberBase<ulong3>.IsNaN(ulong3 value) => false;
static bool INumberBase<ulong3>.IsNormal(ulong3 value) => value.X != 0 && value.Y != 0 && value.Z != 0;
static bool INumberBase<ulong3>.IsSubnormal(ulong3 value) => false;
/// <summary>Computes, componentwise, the value whose magnitude is greater.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 MaxMagnitude(ulong3 a, ulong3 b)
{
return Max(a, b);
}
/// <summary>Computes, componentwise, the value whose magnitude is greater.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 MaxMagnitudeNumber(ulong3 a, ulong3 b)
{
return Max(a, b);
}
/// <summary>Computes, componentwise, the value whose magnitude is smaller.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 MinMagnitude(ulong3 a, ulong3 b)
{
return Min(a, b);
}
/// <summary>Computes, componentwise, the value whose magnitude is smaller.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 MinMagnitudeNumber(ulong3 a, ulong3 b)
{
return Min(a, b);
}
/// <inheritdoc cref="Vector3.Add" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Add(ulong3 a, ulong3 b)
{
return a + b;
}
/// <inheritdoc cref="Vector3.Divide(Vector3, Vector3)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Divide(ulong3 a, ulong3 b)
{
return a / b;
}
/// <inheritdoc cref="Vector3.Multiply(Vector3, Vector3)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Multiply(ulong3 a, ulong3 b)
{
return a * b;
}
/// <inheritdoc cref="Vector3.Negate" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Negate(ulong3 value)
{
return -value;
}
/// <inheritdoc cref="Vector3.Subtract" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Subtract(ulong3 a, ulong3 b)
{
return a - b;
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator +(ulong3 a, ulong3 b)
{
return new(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator -(ulong3 a, ulong3 b)
{
return new(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator *(ulong3 a, ulong3 b)
{
return new(a.X * b.X, a.Y * b.Y, a.Z * b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator /(ulong3 a, ulong3 b)
{
return new(a.X / b.X, a.Y / b.Y, a.Z / b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator -(ulong3 a)
{
return new(0 - a.X, 0 - a.Y, 0 - a.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator +(ulong3 a)
{
return a;
}
// ++/-- are well-defined (+/- One) but a footgun on a concrete vector: generic-plane only.
static ulong3 IIncrementOperators<ulong3>.operator ++(ulong3 value) => value + One;
static ulong3 IDecrementOperators<ulong3>.operator --(ulong3 value) => value - One;
static bool INumberBase<ulong3>.TryConvertFromChecked<TOther>(TOther value, out ulong3 result)
{
return NumberConversion.TryConvertFrom<ulong3, ulong, TOther, NumberConversion.Checked>(value, out result);
}
static bool INumberBase<ulong3>.TryConvertToChecked<TOther>(ulong3 value, [MaybeNullWhen(false)] out TOther result)
{
result = default;
return false;
}
static bool INumberBase<ulong3>.TryConvertFromSaturating<TOther>(TOther value, out ulong3 result)
{
return NumberConversion.TryConvertFrom<ulong3, ulong, TOther, NumberConversion.Saturating>(value, out result);
}
static bool INumberBase<ulong3>.TryConvertToSaturating<TOther>(ulong3 value, [MaybeNullWhen(false)] out TOther result)
{
result = default;
return false;
}
static bool INumberBase<ulong3>.TryConvertFromTruncating<TOther>(TOther value, out ulong3 result)
{
return NumberConversion.TryConvertFrom<ulong3, ulong, TOther, NumberConversion.Truncating>(value, out result);
}
static bool INumberBase<ulong3>.TryConvertToTruncating<TOther>(ulong3 value, [MaybeNullWhen(false)] out TOther result)
{
result = default;
return false;
}
}
// IMultiplyOperators<TSelf, TComponent, TSelf>, IDivisionOperators<TSelf, TComponent, TSelf>
public partial struct ulong3
: IMultiplyOperators<ulong3, ulong, ulong3>
, IDivisionOperators<ulong3, ulong, ulong3>
{
/// <inheritdoc cref="Vector3.Divide(Vector3, float)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Divide(ulong3 a, ulong b)
{
return a / b;
}
/// <inheritdoc cref="Vector3.Multiply(Vector3, float)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Multiply(ulong3 a, ulong b)
{
return a * b;
}
/// <inheritdoc cref="Vector3.Multiply(float, Vector3)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Multiply(ulong a, ulong3 b)
{
return a * b;
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator *(ulong3 a, ulong b)
{
return new(a.X * b, a.Y * b, a.Z * b);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator /(ulong3 a, ulong b)
{
return new(a.X / b, a.Y / b, a.Z / b);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator *(ulong a, ulong3 b)
{
return new(a * b.X, a * b.Y, a * b.Z);
}
}
// INumber
public partial struct ulong3 : INumber<ulong3>
{
/// <inheritdoc cref="Vector3.Clamp" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Clamp(ulong3 value, ulong3 min, ulong3 max)
{
// HLSL contract when min > max: max wins (clamp is Max-then-Min); pinned in
// Clamp_InvertedBounds_MatchesBcl. NOT scalar T.Clamp, which throws on inversion.
return Min(Max(value, min), max);
}
/// <inheritdoc cref="Vector3.Max" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Max(ulong3 a, ulong3 b)
{
return new(ulong.Max(a.X, b.X), ulong.Max(a.Y, b.Y), ulong.Max(a.Z, b.Z));
}
/// <inheritdoc cref="Vector3.Min" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 Min(ulong3 a, ulong3 b)
{
return new(ulong.Min(a.X, b.X), ulong.Min(a.Y, b.Y), ulong.Min(a.Z, b.Z));
}
static ulong3 INumber<ulong3>.MaxNumber(ulong3 a, ulong3 b) => Max(a, b);
static ulong3 INumber<ulong3>.MinNumber(ulong3 a, ulong3 b) => Min(a, b);
static ulong3 INumber<ulong3>.CopySign(ulong3 value, ulong3 sign) => value;
// the Native variants permit either NaN/signed-zero behavior - forwarding is always legal
static ulong3 INumber<ulong3>.ClampNative(ulong3 value, ulong3 min, ulong3 max) => Clamp(value, min, max);
static ulong3 INumber<ulong3>.MaxNative(ulong3 a, ulong3 b) => Max(a, b);
static ulong3 INumber<ulong3>.MinNative(ulong3 a, ulong3 b) => Min(a, b);
// Sign's int return cannot hold a per-lane answer, and a collapsed one would lie for mixed signs
static int INumber<ulong3>.Sign(ulong3 value) =>
throw new NotSupportedException($"{nameof(ulong3)} has no scalar sign.");
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong3 operator %(ulong3 a, ulong3 b)
{
return new ulong3(a.X % b.X, a.Y % b.Y, a.Z % b.Z);
}
int IComparable.CompareTo(object? obj) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
int IComparable<ulong3>.CompareTo(ulong3 other) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
static bool IComparisonOperators<ulong3, ulong3, bool>.operator <(ulong3 a, ulong3 b) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
static bool IComparisonOperators<ulong3, ulong3, bool>.operator <=(ulong3 a, ulong3 b) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
static bool IComparisonOperators<ulong3, ulong3, bool>.operator >(ulong3 a, ulong3 b) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
static bool IComparisonOperators<ulong3, ulong3, bool>.operator >=(ulong3 a, ulong3 b) =>
throw new NotSupportedException($"{nameof(ulong3)} has no total order.");
}
// IComponentwiseComparison + the componentwise predicate masks (no interface to mirror)
public partial struct ulong3 : IComponentwiseComparison<ulong3, bool3>
{
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 operator <(ulong3 a, ulong3 b)
{
return new bool3(a.X < b.X, a.Y < b.Y, a.Z < b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 operator <=(ulong3 a, ulong3 b)
{
return new bool3(a.X <= b.X, a.Y <= b.Y, a.Z <= b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 operator >(ulong3 a, ulong3 b)
{
return new bool3(a.X > b.X, a.Y > b.Y, a.Z > b.Z);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 operator >=(ulong3 a, ulong3 b)
{
return new bool3(a.X >= b.X, a.Y >= b.Y, a.Z >= b.Z);
}
/// <summary>Determines which components of a value are zero.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 IsZero(ulong3 value)
{
return new bool3(value.X == 0, value.Y == 0, value.Z == 0);
}
/// <summary>Determines which components of a value are an even integral value.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 IsEvenInteger(ulong3 value)
{
return new bool3(ulong.IsEvenInteger(value.X), ulong.IsEvenInteger(value.Y), ulong.IsEvenInteger(value.Z));
}
/// <summary>Determines which components of a value are an odd integral value.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 IsOddInteger(ulong3 value)
{
return new bool3(ulong.IsOddInteger(value.X), ulong.IsOddInteger(value.Y), ulong.IsOddInteger(value.Z));
}
}
// IUnsignedNumber - a marker, so there is nothing to implement
public partial struct ulong3 : IUnsignedNumber<ulong3>;