|
Orrery
A GPU-accelerated N-body gravitational simulator
|
A resizable array of 3-vectors in component-array layout. More...
#include <orrery/core/vec3_array.hpp>
Public Member Functions | |
| Vec3Array (Index count) | |
| Create count vectors, every component zero. | |
| Index | size () const noexcept |
| bool | empty () const noexcept |
| void | resize (Index count) |
| Change the length, zero-filling anything new. | |
| Vec3Span< Real > | view () noexcept |
| Vec3Span< const Real > | view () const noexcept |
A resizable array of 3-vectors in component-array layout.
The three components are always the same length, for the same reason and by the same means as in ParticleData: every operation that can change a length applies to all three.
| void orrery::core::Vec3Array::resize | ( | Index | count | ) |
Change the length, zero-filling anything new.
The intended use is a scratch buffer that a repeated operation resizes on its first call and finds already the right length on every call after, which is what keeps an integrator step free of allocation.