Thanks to visit codestin.com
Credit goes to github.com

Skip to content

System.Numerics.Vectors and Span<T> #25608

@dangi12012

Description

@dangi12012

Please think about implementing this operator:

public static partial struct Vector2
{
    public Vector2(ReadOnlySpan<byte> values);
    public Vector2(ReadOnlySpan<T> values);

    public readonly void CopyTo(Span<byte> destination);
    public readonly void CopyTo(Span<T> destination);
}

public static partial struct Vector3
{
    public Vector3(ReadOnlySpan<byte> values);
    public Vector3(ReadOnlySpan<T> values);

    public readonly void CopyTo(Span<byte> destination);
    public readonly void CopyTo(Span<T> destination);
}

public static partial struct Vector4
{
    public Vector4(ReadOnlySpan<byte> values);
    public Vector4(ReadOnlySpan<T> values);

    public readonly void CopyTo(Span<byte> destination);
    public readonly void CopyTo(Span<T> destination);
}

Since the span can be a stackallocated Array the performance gain should be huge! Also Vertical Operators are missing from Vector like T Min(Vector vector)

Metadata

Metadata

Assignees

Labels

Cost:SWork that requires one engineer up to 1 weekapi-approvedAPI was approved in API review, it can be implementedarea-System.Numerics

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions