Search code examples
c#.net-5system.numerics

System.Numerics.Vector<int> are only partially initialized


I'm trying to initialize a Vector<int> (to integrate with BepuPhysics but I think it's irrilevant).

The static property System.Numerics.Vector<int>.Count is equal to 8 on my system so I manually initialized an 8-elements array.

This is my code:

var handles = new []{1, 2, 3, 4, 5, 6, 7, 8};
var vector = new System.Numerics.Vector<int>(handles);

but only the first half of vector is initialized to the correct values: debugger screenshot

Am I missing something obvious? Thanks in advance.


Solution

  • I don't know the answer why it happens, but it looks like aghidini is right - it's a debugger problem, it displays just 4 values for a Vector instance.

    Look at the following experiment:

    enter image description here