Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Grid_Snapshot< T > Struct Template Reference

Dense numeric snapshot used by CSV and JSON readers. More...

#include <ca-io.H>

Collaboration diagram for Aleph::CA::Grid_Snapshot< T >:
[legend]

Public Member Functions

T at (ca_size_t row, ca_size_t col) const
 Return the value at (row, col).
 

Public Attributes

ca_size_t width = 0
 number of columns
 
ca_size_t height = 0
 number of rows
 
Array< T > cells
 row-major payload
 

Detailed Description

template<typename T>
struct Aleph::CA::Grid_Snapshot< T >

Dense numeric snapshot used by CSV and JSON readers.

Values are stored row-major. The type is deliberately small so callers can adapt it into Dense_Cell_Storage, an engine frame or a custom lattice.

Template Parameters
Tnumeric cell type.

Definition at line 127 of file ca-io.H.

Member Function Documentation

◆ at()

template<typename T >
T Aleph::CA::Grid_Snapshot< T >::at ( ca_size_t  row,
ca_size_t  col 
) const
inline

Return the value at (row, col).

Parameters
[in]rowrow index.
[in]colcolumn index.
Returns
value stored at that coordinate.
Exceptions
std::out_of_rangeif the coordinate is outside the snapshot.
Complexity
O(1).

Definition at line 142 of file ca-io.H.

References ah_out_of_range_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Grid_Snapshot< T >::cells, col, Aleph::CA::Grid_Snapshot< T >::height, row, and Aleph::CA::Grid_Snapshot< T >::width.

Member Data Documentation

◆ cells

template<typename T >
Array<T> Aleph::CA::Grid_Snapshot< T >::cells

row-major payload

Definition at line 131 of file ca-io.H.

Referenced by Aleph::CA::Grid_Snapshot< T >::at().

◆ height

template<typename T >
ca_size_t Aleph::CA::Grid_Snapshot< T >::height = 0

number of rows

Definition at line 130 of file ca-io.H.

Referenced by Aleph::CA::Grid_Snapshot< T >::at(), and Aleph::CA::read_json_snapshot().

◆ width

template<typename T >
ca_size_t Aleph::CA::Grid_Snapshot< T >::width = 0

number of columns

Definition at line 129 of file ca-io.H.

Referenced by Aleph::CA::Grid_Snapshot< T >::at().


The documentation for this struct was generated from the following file: