Skip to main content

TensorColumnAnalogStorage

TensorColumnAnalogStorage

Zero-copy analog storage backed by a TensorData column. More…

#include <TensorColumnAnalogStorage.hpp>

Inherits from AnalogDataStorageBase< TensorColumnAnalogStorage >

Public Functions

Name
TensorColumnAnalogStorage(std::shared_ptr< TensorData const > tensor, std::size_t column_index)
Construct storage referencing a specific column of a TensorData.
~TensorColumnAnalogStorage() =default
float getValueAtImpl(std::size_t index) const
std::size_t sizeImpl() const
std::span< float const > getSpanImpl() const
std::span< float const > getSpanRangeImpl(std::size_t start, std::size_t end) const
bool isContiguousImpl() const
AnalogStorageType getStorageTypeImpl() const
AnalogDataStorageCache tryGetCacheImpl() const
std::shared_ptr< TensorData const > const & tensor() const
Get the source tensor.
std::size_t columnIndex() const
Get the column index this storage references.
float const * data() const
Get raw pointer to contiguous column data (nullptr if not Armadillo-backed).

Additional inherited members

Public Functions inherited from AnalogDataStorageBase< TensorColumnAnalogStorage >

Name
std::size_t size() const
Get the number of samples in storage.
bool empty() const
Check if storage is empty.
float getValueAt(std::size_t index) const
Get the value at a specific index.
std::span< float const > getSpan() const
Get a span over all data (if contiguous).
std::span< float const > getSpanRange(std::size_t start, std::size_t end) const
Get a span over a sub-range of data (if contiguous).
bool isContiguous() const
Check if data is stored contiguously in memory.
AnalogStorageType getStorageType() const
Get the storage type identifier.
bool isView() const
Check if this storage is a view (non-owning).
bool isLazy() const
Check if this storage is lazy-evaluated.
AnalogDataStorageCache tryGetCache() const
Try to get a cache for fast-path contiguous access.

Protected Functions inherited from AnalogDataStorageBase< TensorColumnAnalogStorage >

Name
~AnalogDataStorageBase() =default

Detailed Description

class TensorColumnAnalogStorage;

Zero-copy analog storage backed by a TensorData column.

Precondition:

  • The source tensor must be 2D.
  • column_index must be in [0, tensor->numColumns()).

Holds shared ownership of the source TensorData and a column index. When the tensor uses Armadillo storage (column-major layout), each column is contiguous in memory, enabling zero-copy span access via arma::fmat::colptr(). For non-Armadillo backends, element access goes through [TensorData::at()](/api_generated/Classes/classTensorData.md#function-at).

Public Functions Documentation

function TensorColumnAnalogStorage

inline TensorColumnAnalogStorage(
    std::shared_ptr< TensorData const > tensor,
    std::size_t column_index
)

Construct storage referencing a specific column of a TensorData.

Parameters:

  • tensor Shared pointer to the source tensor (const; view is read-only).
  • column_index The column index to view.

Precondition:

  • tensor != nullptr
  • tensor->ndim() == 2
  • column_index < tensor->numColumns()

function ~TensorColumnAnalogStorage

~TensorColumnAnalogStorage() =default

function getValueAtImpl

inline float getValueAtImpl(
    std::size_t index
) const

function sizeImpl

inline std::size_t sizeImpl() const

function getSpanImpl

inline std::span< float const > getSpanImpl() const

function getSpanRangeImpl

inline std::span< float const > getSpanRangeImpl(
    std::size_t start,
    std::size_t end
) const

function isContiguousImpl

inline bool isContiguousImpl() const

function getStorageTypeImpl

inline AnalogStorageType getStorageTypeImpl() const

function tryGetCacheImpl

inline AnalogDataStorageCache tryGetCacheImpl() const

function tensor

inline std::shared_ptr< TensorData const > const & tensor() const

Get the source tensor.

function columnIndex

inline std::size_t columnIndex() const

Get the column index this storage references.

function data

inline float const * data() const

Get raw pointer to contiguous column data (nullptr if not Armadillo-backed).


Updated on 2026-11-13 at 20:25:39 +0000