Class astrea::trace::PositionCache¶
ClassList > astrea > trace > PositionCache
Contiguous memory cache for platform positions across time. More...
#include <PositionCache.hpp>
Public Functions¶
| Type | Name |
|---|---|
| PositionCache () = default |
|
| std::size_t | add_platform (std::size_t platformId, std::size_t nTimesteps) Add a platform to the cache. |
| void | clear () Clear all data. |
| std::size_t | get_index (std::size_t platformId) const Convert platform ID to internal index. |
| std::size_t | get_platform_id (std::size_t platformIdx) const Get platform ID from internal index. |
| const EcefRadiusVec & | get_position_by_id (std::size_t platformId, std::size_t timeIdx) const Get position by platform ID and time index. |
| const EcefRadiusVec & | get_position_by_index (std::size_t platformIdx, std::size_t timeIdx) const Get position by platform index and time index (faster) |
| std::size_t | n_platforms () const Get number of platforms. |
| std::size_t | n_timesteps () const Get number of timesteps. |
| void | reserve (std::size_t nPlatforms) Reserve space for platforms and timesteps. |
| void | set_position (std::size_t platformIdx, std::size_t timeIdx, const EcefRadiusVec & position) Set position for a platform at a specific timestep. |
| ~PositionCache () = default |
Detailed Description¶
Uses structure-of-arrays layout for better cache locality and SIMD potential
Public Functions Documentation¶
function PositionCache¶
function add_platform¶
Add a platform to the cache.
std::size_t astrea::trace::PositionCache::add_platform (
std::size_t platformId,
std::size_t nTimesteps
)
Parameters:
platformIdUnique ID of the platformnTimestepsNumber of timesteps to cache for this platform
Returns:
std::size_t Index of the platform in the cache
function clear¶
Clear all data.
function get_index¶
Convert platform ID to internal index.
Parameters:
platformIdUnique ID of the platform
Returns:
std::size_t Index of the platform in the cache
function get_platform_id¶
Get platform ID from internal index.
Parameters:
platformIdxIndex of the platform in the cache
Returns:
std::size_t Unique ID of the platform
function get_position_by_id¶
Get position by platform ID and time index.
const EcefRadiusVec & astrea::trace::PositionCache::get_position_by_id (
std::size_t platformId,
std::size_t timeIdx
) const
Parameters:
platformIdUnique ID of the platformtimeIdxIndex of the timestep
Returns:
const EcefRadiusVec& Cached ECI position vector
function get_position_by_index¶
Get position by platform index and time index (faster)
const EcefRadiusVec & astrea::trace::PositionCache::get_position_by_index (
std::size_t platformIdx,
std::size_t timeIdx
) const
Parameters:
platformIdxIndex of the platform in the cachetimeIdxIndex of the timestep
Returns:
const EcefRadiusVec& Cached ECI position vector
function n_platforms¶
Get number of platforms.
Returns:
std::size_t Number of platforms in the cache
function n_timesteps¶
Get number of timesteps.
Returns:
std::size_t Number of timesteps cached per platform
function reserve¶
Reserve space for platforms and timesteps.
Parameters:
nPlatformsNumber of platforms to cache
function set_position¶
Set position for a platform at a specific timestep.
void astrea::trace::PositionCache::set_position (
std::size_t platformIdx,
std::size_t timeIdx,
const EcefRadiusVec & position
)
Parameters:
platformIdxIndex of the platform in the cachetimeIdxIndex of the timesteppositionECI position vector to cache
function ~PositionCache¶
The documentation for this class was generated from the following file astrea/trace/trace/analysis/PositionCache.hpp