mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
// <auto-generated /> - edit Matrix.access.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
public partial struct double3x2
|
|
{
|
|
/// <inheritdoc />
|
|
public double this[int row, int column]
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
readonly get
|
|
{
|
|
if ((uint)row >= RowCount)
|
|
throw new ArgumentOutOfRangeException(nameof(row));
|
|
|
|
return Unsafe.Add(ref Unsafe.AsRef(in X), row)[column];
|
|
}
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
set
|
|
{
|
|
if ((uint)row >= RowCount)
|
|
throw new ArgumentOutOfRangeException(nameof(row));
|
|
|
|
Unsafe.Add(ref X, row)[column] = value;
|
|
}
|
|
}
|
|
|
|
public readonly void Deconstruct(out double2 x, out double2 y, out double2 z)
|
|
{
|
|
x = X;
|
|
y = Y;
|
|
z = Z;
|
|
}
|
|
|
|
public Span<double> AsSpan()
|
|
{
|
|
return MemoryMarshal.CreateSpan(ref Unsafe.As<double3x2, double>(ref this), 6);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public readonly ReadOnlySpan<double> AsReadOnlySpan()
|
|
{
|
|
return MemoryMarshal.CreateReadOnlySpan(in Unsafe.As<double3x2, double>(ref Unsafe.AsRef(in this)), 6);
|
|
}
|
|
}
|