mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48: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 bool3
|
|
{
|
|
/// <inheritdoc />
|
|
public static bool3 Zero => new(false);
|
|
|
|
/// <inheritdoc />
|
|
public static bool3 One => new(true);
|
|
}
|
|
|
|
// IBitwiseOperators
|
|
public partial struct bool3 : IBitwiseOperators<bool3, bool3, bool3>
|
|
{
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool3 operator |(bool3 a, bool3 b)
|
|
{
|
|
return new bool3(a.X | b.X, a.Y | b.Y, a.Z | b.Z);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool3 operator &(bool3 a, bool3 b)
|
|
{
|
|
return new bool3(a.X & b.X, a.Y & b.Y, a.Z & b.Z);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool3 operator ^(bool3 a, bool3 b)
|
|
{
|
|
return new bool3(a.X ^ b.X, a.Y ^ b.Y, a.Z ^ b.Z);
|
|
}
|
|
|
|
/// <inheritdoc cref="IBitwiseOperators{TSelf, TOther, TResult}.op_OnesComplement" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool3 operator !(bool3 value)
|
|
{
|
|
return new bool3(!value.X, !value.Y, !value.Z);
|
|
}
|
|
|
|
// bool has no ~; the interface's complement is componentwise logical not
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool3 IBitwiseOperators<bool3, bool3, bool3>.operator ~(bool3 value)
|
|
{
|
|
return !value;
|
|
}
|
|
}
|