mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 12:38:24 +01:00
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
// <auto-generated /> - edit Vector.numerics.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
// INumberBase
|
|
public partial struct bool4
|
|
{
|
|
/// <inheritdoc />
|
|
public static bool4 Zero => new(false);
|
|
|
|
/// <inheritdoc />
|
|
public static bool4 One => new(true);
|
|
}
|
|
|
|
// IBitwiseOperators
|
|
public partial struct bool4 : IBitwiseOperators<bool4, bool4, bool4>
|
|
{
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator |(bool4 a, bool4 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 &(bool4 a, bool4 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 ^(bool4 a, bool4 b)
|
|
{
|
|
return new bool4(a.X ^ b.X, a.Y ^ b.Y, a.Z ^ b.Z, a.W ^ b.W);
|
|
}
|
|
|
|
/// <inheritdoc cref="IBitwiseOperators{TSelf, TOther, TResult}.op_OnesComplement" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool4 operator !(bool4 value)
|
|
{
|
|
return new bool4(!value.X, !value.Y, !value.Z, !value.W);
|
|
}
|
|
|
|
// bool has no ~; the interface's complement is componentwise logical not
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool4 IBitwiseOperators<bool4, bool4, bool4>.operator ~(bool4 value)
|
|
{
|
|
return !value;
|
|
}
|
|
}
|