mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
545 lines
22 KiB
C#
545 lines
22 KiB
C#
// <auto-generated /> - edit Vector.numerics.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
// INumberBase
|
|
public partial struct double4 : INumberBase<double4>
|
|
{
|
|
/// <inheritdoc />
|
|
public static double4 Zero => new(0);
|
|
|
|
/// <inheritdoc />
|
|
public static double4 One => new(1);
|
|
|
|
static double4 IAdditiveIdentity<double4, double4>.AdditiveIdentity => Zero;
|
|
|
|
static double4 IMultiplicativeIdentity<double4, double4>.MultiplicativeIdentity => One;
|
|
|
|
static int INumberBase<double4>.Radix => 2; // every component type is binary
|
|
|
|
/// <inheritdoc cref="Vector4.Abs" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Abs(double4 value)
|
|
{
|
|
return new(double.Abs(value.X), double.Abs(value.Y), double.Abs(value.Z), double.Abs(value.W));
|
|
}
|
|
|
|
static bool INumberBase<double4>.IsCanonical(double4 value) => true;
|
|
|
|
static bool INumberBase<double4>.IsComplexNumber(double4 value) => false;
|
|
|
|
static bool INumberBase<double4>.IsImaginaryNumber(double4 value) => false;
|
|
|
|
/// <summary>Determines if every component of a value is zero.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsZero(double4 value)
|
|
{
|
|
return value == Zero;
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an even integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsEvenInteger(double4 value)
|
|
{
|
|
return double.IsEvenInteger(value.X) && double.IsEvenInteger(value.Y) && double.IsEvenInteger(value.Z) && double.IsEvenInteger(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an odd integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsOddInteger(double4 value)
|
|
{
|
|
return double.IsOddInteger(value.X) && double.IsOddInteger(value.Y) && double.IsOddInteger(value.Z) && double.IsOddInteger(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is negative.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsNegative(double4 value)
|
|
{
|
|
return double.IsNegative(value.X) && double.IsNegative(value.Y) && double.IsNegative(value.Z) && double.IsNegative(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is positive.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsPositive(double4 value)
|
|
{
|
|
return double.IsPositive(value.X) && double.IsPositive(value.Y) && double.IsPositive(value.Z) && double.IsPositive(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is finite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsFinite(double4 value)
|
|
{
|
|
return double.IsFinite(value.X) && double.IsFinite(value.Y) && double.IsFinite(value.Z) && double.IsFinite(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is infinite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsInfinity(double4 value)
|
|
{
|
|
return double.IsInfinity(value.X) && double.IsInfinity(value.Y) && double.IsInfinity(value.Z) && double.IsInfinity(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is negative infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsNegativeInfinity(double4 value)
|
|
{
|
|
return double.IsNegativeInfinity(value.X) && double.IsNegativeInfinity(value.Y) && double.IsNegativeInfinity(value.Z) && double.IsNegativeInfinity(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is positive infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsPositiveInfinity(double4 value)
|
|
{
|
|
return double.IsPositiveInfinity(value.X) && double.IsPositiveInfinity(value.Y) && double.IsPositiveInfinity(value.Z) && double.IsPositiveInfinity(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsInteger(double4 value)
|
|
{
|
|
return double.IsInteger(value.X) && double.IsInteger(value.Y) && double.IsInteger(value.Z) && double.IsInteger(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is a real value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsRealNumber(double4 value)
|
|
{
|
|
return double.IsRealNumber(value.X) && double.IsRealNumber(value.Y) && double.IsRealNumber(value.Z) && double.IsRealNumber(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if any component of a value is NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsNaN(double4 value)
|
|
{
|
|
return double.IsNaN(value.X) || double.IsNaN(value.Y) || double.IsNaN(value.Z) || double.IsNaN(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is normal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsNormal(double4 value)
|
|
{
|
|
return double.IsNormal(value.X) && double.IsNormal(value.Y) && double.IsNormal(value.Z) && double.IsNormal(value.W);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is subnormal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<double4>.IsSubnormal(double4 value)
|
|
{
|
|
return double.IsSubnormal(value.X) && double.IsSubnormal(value.Y) && double.IsSubnormal(value.Z) && double.IsSubnormal(value.W);
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is greater.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MaxMagnitude(double4 a, double4 b)
|
|
{
|
|
return new(double.MaxMagnitude(a.X, b.X), double.MaxMagnitude(a.Y, b.Y), double.MaxMagnitude(a.Z, b.Z), double.MaxMagnitude(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is greater, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MaxMagnitudeNumber(double4 a, double4 b)
|
|
{
|
|
return new(double.MaxMagnitudeNumber(a.X, b.X), double.MaxMagnitudeNumber(a.Y, b.Y), double.MaxMagnitudeNumber(a.Z, b.Z), double.MaxMagnitudeNumber(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is smaller.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MinMagnitude(double4 a, double4 b)
|
|
{
|
|
return new(double.MinMagnitude(a.X, b.X), double.MinMagnitude(a.Y, b.Y), double.MinMagnitude(a.Z, b.Z), double.MinMagnitude(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is smaller, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MinMagnitudeNumber(double4 a, double4 b)
|
|
{
|
|
return new(double.MinMagnitudeNumber(a.X, b.X), double.MinMagnitudeNumber(a.Y, b.Y), double.MinMagnitudeNumber(a.Z, b.Z), double.MinMagnitudeNumber(a.W, b.W));
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Add" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Add(double4 a, double4 b)
|
|
{
|
|
return a + b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Divide(Vector4, Vector4)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Divide(double4 a, double4 b)
|
|
{
|
|
return a / b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Multiply(Vector4, Vector4)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Multiply(double4 a, double4 b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Negate" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Negate(double4 value)
|
|
{
|
|
return -value;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Subtract" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Subtract(double4 a, double4 b)
|
|
{
|
|
return a - b;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator +(double4 a, double4 b)
|
|
{
|
|
return new(a.X + b.X, a.Y + b.Y, a.Z + b.Z, a.W + b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator -(double4 a, double4 b)
|
|
{
|
|
return new(a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator *(double4 a, double4 b)
|
|
{
|
|
return new(a.X * b.X, a.Y * b.Y, a.Z * b.Z, a.W * b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator /(double4 a, double4 b)
|
|
{
|
|
return new(a.X / b.X, a.Y / b.Y, a.Z / b.Z, a.W / b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator -(double4 a)
|
|
{
|
|
return new(-a.X, -a.Y, -a.Z, -a.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator +(double4 a)
|
|
{
|
|
return a;
|
|
}
|
|
|
|
// ++/-- are well-defined (+/- One) but a footgun on a concrete vector: generic-plane only.
|
|
|
|
static double4 IIncrementOperators<double4>.operator ++(double4 value) => value + One;
|
|
|
|
static double4 IDecrementOperators<double4>.operator --(double4 value) => value - One;
|
|
|
|
|
|
static bool INumberBase<double4>.TryConvertFromChecked<TOther>(TOther value, out double4 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<double4, double, TOther, NumberConversion.Checked>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<double4>.TryConvertToChecked<TOther>(double4 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
|
|
static bool INumberBase<double4>.TryConvertFromSaturating<TOther>(TOther value, out double4 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<double4, double, TOther, NumberConversion.Saturating>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<double4>.TryConvertToSaturating<TOther>(double4 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
|
|
static bool INumberBase<double4>.TryConvertFromTruncating<TOther>(TOther value, out double4 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<double4, double, TOther, NumberConversion.Truncating>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<double4>.TryConvertToTruncating<TOther>(double4 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// IMultiplyOperators<TSelf, TComponent, TSelf>, IDivisionOperators<TSelf, TComponent, TSelf>
|
|
public partial struct double4
|
|
: IMultiplyOperators<double4, double, double4>
|
|
, IDivisionOperators<double4, double, double4>
|
|
{
|
|
/// <inheritdoc cref="Vector4.Divide(Vector4, float)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Divide(double4 a, double b)
|
|
{
|
|
return a / b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Multiply(Vector4, float)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Multiply(double4 a, double b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Multiply(float, Vector4)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Multiply(double a, double4 b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator *(double4 a, double b)
|
|
{
|
|
return new(a.X * b, a.Y * b, a.Z * b, a.W * b);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator /(double4 a, double b)
|
|
{
|
|
return new(a.X / b, a.Y / b, a.Z / b, a.W / b);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator *(double a, double4 b)
|
|
{
|
|
return new(a * b.X, a * b.Y, a * b.Z, a * b.W);
|
|
}
|
|
}
|
|
|
|
// INumber
|
|
public partial struct double4 : INumber<double4>
|
|
{
|
|
/// <inheritdoc cref="Vector4.Clamp" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Clamp(double4 value, double4 min, double4 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="Vector4.Max" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Max(double4 a, double4 b)
|
|
{
|
|
return new(double.Max(a.X, b.X), double.Max(a.Y, b.Y), double.Max(a.Z, b.Z), double.Max(a.W, b.W));
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector4.Min" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 Min(double4 a, double4 b)
|
|
{
|
|
return new(double.Min(a.X, b.X), double.Min(a.Y, b.Y), double.Min(a.Z, b.Z), double.Min(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Selects, componentwise, the larger value, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MaxNumber(double4 a, double4 b)
|
|
{
|
|
return new(double.MaxNumber(a.X, b.X), double.MaxNumber(a.Y, b.Y), double.MaxNumber(a.Z, b.Z), double.MaxNumber(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Selects, componentwise, the smaller value, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 MinNumber(double4 a, double4 b)
|
|
{
|
|
return new(double.MinNumber(a.X, b.X), double.MinNumber(a.Y, b.Y), double.MinNumber(a.Z, b.Z), double.MinNumber(a.W, b.W));
|
|
}
|
|
|
|
/// <summary>Copies, componentwise, the sign of <paramref name="sign" /> onto the magnitude of <paramref name="value" />.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 CopySign(double4 value, double4 sign)
|
|
{
|
|
return new(double.CopySign(value.X, sign.X), double.CopySign(value.Y, sign.Y), double.CopySign(value.Z, sign.Z), double.CopySign(value.W, sign.W));
|
|
}
|
|
|
|
// the Native variants permit either NaN/signed-zero behavior - forwarding is always legal
|
|
static double4 INumber<double4>.ClampNative(double4 value, double4 min, double4 max) => Clamp(value, min, max);
|
|
|
|
static double4 INumber<double4>.MaxNative(double4 a, double4 b) => Max(a, b);
|
|
|
|
static double4 INumber<double4>.MinNative(double4 a, double4 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<double4>.Sign(double4 value) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no scalar sign.");
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double4 operator %(double4 a, double4 b)
|
|
{
|
|
return new double4(a.X % b.X, a.Y % b.Y, a.Z % b.Z, a.W % b.W);
|
|
}
|
|
|
|
int IComparable.CompareTo(object? obj) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
|
|
int IComparable<double4>.CompareTo(double4 other) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
|
|
static bool IComparisonOperators<double4, double4, bool>.operator <(double4 a, double4 b) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
|
|
static bool IComparisonOperators<double4, double4, bool>.operator <=(double4 a, double4 b) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
|
|
static bool IComparisonOperators<double4, double4, bool>.operator >(double4 a, double4 b) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
|
|
static bool IComparisonOperators<double4, double4, bool>.operator >=(double4 a, double4 b) =>
|
|
throw new NotSupportedException($"{nameof(double4)} has no total order.");
|
|
}
|
|
|
|
// IComponentwiseComparison + the componentwise predicate masks (no interface to mirror)
|
|
public partial struct double4 : IComponentwiseComparison<double4, bool4>
|
|
{
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator <(double4 a, double4 b)
|
|
{
|
|
return new bool4(a.X < b.X, a.Y < b.Y, a.Z < b.Z, a.W < b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator <=(double4 a, double4 b)
|
|
{
|
|
return new bool4(a.X <= b.X, a.Y <= b.Y, a.Z <= b.Z, a.W <= b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator >(double4 a, double4 b)
|
|
{
|
|
return new bool4(a.X > b.X, a.Y > b.Y, a.Z > b.Z, a.W > b.W);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator >=(double4 a, double4 b)
|
|
{
|
|
return new bool4(a.X >= b.X, a.Y >= b.Y, a.Z >= b.Z, a.W >= b.W);
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are zero.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsZero(double4 value)
|
|
{
|
|
return new bool4(value.X == 0, value.Y == 0, value.Z == 0, value.W == 0);
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an even integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsEvenInteger(double4 value)
|
|
{
|
|
return new bool4(double.IsEvenInteger(value.X), double.IsEvenInteger(value.Y), double.IsEvenInteger(value.Z), double.IsEvenInteger(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an odd integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsOddInteger(double4 value)
|
|
{
|
|
return new bool4(double.IsOddInteger(value.X), double.IsOddInteger(value.Y), double.IsOddInteger(value.Z), double.IsOddInteger(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are negative.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsNegative(double4 value)
|
|
{
|
|
return new bool4(double.IsNegative(value.X), double.IsNegative(value.Y), double.IsNegative(value.Z), double.IsNegative(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are positive.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsPositive(double4 value)
|
|
{
|
|
return new bool4(double.IsPositive(value.X), double.IsPositive(value.Y), double.IsPositive(value.Z), double.IsPositive(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are finite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsFinite(double4 value)
|
|
{
|
|
return new bool4(double.IsFinite(value.X), double.IsFinite(value.Y), double.IsFinite(value.Z), double.IsFinite(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are infinite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsInfinity(double4 value)
|
|
{
|
|
return new bool4(double.IsInfinity(value.X), double.IsInfinity(value.Y), double.IsInfinity(value.Z), double.IsInfinity(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are negative infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsNegativeInfinity(double4 value)
|
|
{
|
|
return new bool4(double.IsNegativeInfinity(value.X), double.IsNegativeInfinity(value.Y), double.IsNegativeInfinity(value.Z), double.IsNegativeInfinity(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are positive infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsPositiveInfinity(double4 value)
|
|
{
|
|
return new bool4(double.IsPositiveInfinity(value.X), double.IsPositiveInfinity(value.Y), double.IsPositiveInfinity(value.Z), double.IsPositiveInfinity(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsInteger(double4 value)
|
|
{
|
|
return new bool4(double.IsInteger(value.X), double.IsInteger(value.Y), double.IsInteger(value.Z), double.IsInteger(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are a real value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsRealNumber(double4 value)
|
|
{
|
|
return new bool4(double.IsRealNumber(value.X), double.IsRealNumber(value.Y), double.IsRealNumber(value.Z), double.IsRealNumber(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsNaN(double4 value)
|
|
{
|
|
return new bool4(double.IsNaN(value.X), double.IsNaN(value.Y), double.IsNaN(value.Z), double.IsNaN(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are normal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsNormal(double4 value)
|
|
{
|
|
return new bool4(double.IsNormal(value.X), double.IsNormal(value.Y), double.IsNormal(value.Z), double.IsNormal(value.W));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are subnormal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 IsSubnormal(double4 value)
|
|
{
|
|
return new bool4(double.IsSubnormal(value.X), double.IsSubnormal(value.Y), double.IsSubnormal(value.Z), double.IsSubnormal(value.W));
|
|
}
|
|
}
|
|
|
|
// ISignedNumber
|
|
public partial struct double4 : ISignedNumber<double4>
|
|
{
|
|
/// <inheritdoc />
|
|
public static double4 NegativeOne => new(-1);
|
|
}
|