mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 12:38:24 +01:00
54 lines
2.1 KiB
C#
54 lines
2.1 KiB
C#
// <auto-generated /> - edit Vector.numerics-binary.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
// IBinaryNumber
|
|
public partial struct double3 : IBinaryNumber<double3>
|
|
{
|
|
/// <summary>Determines if every component of a value is a power of two.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool IBinaryNumber<double3>.IsPow2(double3 value)
|
|
{
|
|
return double.IsPow2(value.X) && double.IsPow2(value.Y) && double.IsPow2(value.Z);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double3 IBitwiseOperators<double3, double3, double3>.operator &(double3 a, double3 b)
|
|
{
|
|
return Unsafe.BitCast<long3, double3>(Unsafe.BitCast<double3, long3>(a) & Unsafe.BitCast<double3, long3>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double3 IBitwiseOperators<double3, double3, double3>.operator |(double3 a, double3 b)
|
|
{
|
|
return Unsafe.BitCast<long3, double3>(Unsafe.BitCast<double3, long3>(a) | Unsafe.BitCast<double3, long3>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double3 IBitwiseOperators<double3, double3, double3>.operator ^(double3 a, double3 b)
|
|
{
|
|
return Unsafe.BitCast<long3, double3>(Unsafe.BitCast<double3, long3>(a) ^ Unsafe.BitCast<double3, long3>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double3 IBitwiseOperators<double3, double3, double3>.operator ~(double3 value)
|
|
{
|
|
return Unsafe.BitCast<long3, double3>(~Unsafe.BitCast<double3, long3>(value));
|
|
}
|
|
}
|
|
|
|
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
|
|
public partial struct double3
|
|
{
|
|
/// <summary>Determines which components of a value are powers of two.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool3 IsPow2(double3 value)
|
|
{
|
|
return new bool3(double.IsPow2(value.X), double.IsPow2(value.Y), double.IsPow2(value.Z));
|
|
}
|
|
}
|