Skip to content

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

astrea::trace::PositionCache::PositionCache () = default

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:

  • platformId Unique ID of the platform
  • nTimesteps Number of timesteps to cache for this platform

Returns:

std::size_t Index of the platform in the cache


function clear

Clear all data.

void astrea::trace::PositionCache::clear () 


function get_index

Convert platform ID to internal index.

std::size_t astrea::trace::PositionCache::get_index (
    std::size_t platformId
) const

Parameters:

  • platformId Unique 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.

std::size_t astrea::trace::PositionCache::get_platform_id (
    std::size_t platformIdx
) const

Parameters:

  • platformIdx Index 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:

  • platformId Unique ID of the platform
  • timeIdx Index 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:

  • platformIdx Index of the platform in the cache
  • timeIdx Index of the timestep

Returns:

const EcefRadiusVec& Cached ECI position vector


function n_platforms

Get number of platforms.

std::size_t astrea::trace::PositionCache::n_platforms () const

Returns:

std::size_t Number of platforms in the cache


function n_timesteps

Get number of timesteps.

std::size_t astrea::trace::PositionCache::n_timesteps () const

Returns:

std::size_t Number of timesteps cached per platform


function reserve

Reserve space for platforms and timesteps.

void astrea::trace::PositionCache::reserve (
    std::size_t nPlatforms
) 

Parameters:

  • nPlatforms Number 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:

  • platformIdx Index of the platform in the cache
  • timeIdx Index of the timestep
  • position ECI position vector to cache

function ~PositionCache

astrea::trace::PositionCache::~PositionCache () = default


The documentation for this class was generated from the following file astrea/trace/trace/analysis/PositionCache.hpp