isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
isce3::core::Cube< cell_t > Class Template Reference

Public Types

using rep_t = std::array< size_t, 3 >
 
using index_t = pyre::grid::index_t< rep_t >
 
using layout_t = pyre::grid::layout_t< index_t >
 
using grid_t = pyre::grid::grid_t< cell_t, layout_t, pyre::memory::view_t< cell_t >>
 
using view_t = typename grid_t::view_type
 
using shape_t = typename layout_t::shape_type
 
using slice_t = typename layout_t::slice_type
 
using packing_t = typename layout_t::packing_type
 

Public Member Functions

 Cube ()
 Default constructor.
 
 Cube (size_t nslices, size_t nrows, size_t ncols)
 Constructor with number of slices, rows and columns. More...
 
 Cube (const Cube< cell_t > &m)
 Deep copy constructor from another cube - allocates memory and copies values. More...
 
 Cube (Cube< cell_t > &m)
 Shallow copy constructor from another cube - does not allocate own memory. More...
 
 Cube (cell_t *data, size_t nslices, size_t nrows, size_t ncols)
 Shallow copy constructor from raw pointer to data - does not allocate own memory. More...
 
 Cube (std::valarray< cell_t > &data, size_t nrows, size_t ncols)
 Shallow copy constructor from an std::valarray - does not allocate own memory. More...
 
 Cube (std::vector< cell_t > &data, size_t nrows, size_t ncols)
 Shallow copy constructor from an std::vector - does not allocate own memory. More...
 
 ~Cube ()
 Destructor.
 
Cube< cell_t > & operator= (const Cube< cell_t > &m)
 Deep assignment operator - allocates memory and copies values. More...
 
Cube< cell_t > & operator= (Cube< cell_t > &m)
 Shallow assignment operator - does not allocate own memory. More...
 
void resize (size_t nslices, size_t nrows, size_t ncols)
 Resize memory for a given number of slices, rows and columns. More...
 
const view_t subcube (size_t slice, size_t row, size_t col, size_t slicespan, size_t rowspan, size_t colspan)
 Extract copy of sub-cube given starting indices and span. More...
 
cell_t * data ()
 Access to data buffer.
 
const cell_t * data () const
 Read-only access to data buffer.
 
cell_t * sliceptr (size_t slice)
 Access to data buffer at a specific slice. More...
 
const cell_t * sliceptr (size_t slice) const
 Read-only access to data buffer at a specific slice. More...
 
cell_t & operator() (size_t slice, size_t row, size_t col)
 Access matrix value for a given slice, row and column. More...
 
const cell_t & operator() (size_t slice, size_t row, size_t col) const
 Read-only access to matrix value for a given slice, row and column. More...
 
cell_t & operator() (size_t index)
 Access matrix value for a flattened index. More...
 
const cell_t & operator() (size_t index) const
 Read-only access to matrix value for a flattened index. More...
 
cell_t & operator[] (const index_t &index)
 Access matrix value for a given grid::index_type. More...
 
const cell_t & operator[] (const index_t &index) const
 Read-only access to matrix value for a given grid::idnex_type. More...
 
void zeros ()
 Fill with zeros.
 
void fill (cell_t value)
 Fill with a constant value.
 
shape_t shape () const
 Get shape information as grid::shape_type.
 
size_t width () const
 Get cube width.
 
size_t length () const
 Get cube length.
 
size_t height () const
 Get cube height.
 
shape_t byteoffset () const
 Get byteoffset for row and column for reading flat binary buffer. More...
 

Constructor & Destructor Documentation

template<typename cell_t >
isce3::core::Cube< cell_t >::Cube ( size_t  nslices,
size_t  nrows,
size_t  ncols 
)
inline

Constructor with number of slices, rows and columns.

Parameters
[in]nslicesNumber of slices
[in]nrowsNumber of rows
[in]ncolsNumber of columns
template<typename cell_t>
isce3::core::Cube< cell_t >::Cube ( const Cube< cell_t > &  m)
inline

Deep copy constructor from another cube - allocates memory and copies values.

Parameters
[in]misce3::core::Cube object to copy
template<typename cell_t>
isce3::core::Cube< cell_t >::Cube ( Cube< cell_t > &  m)
inline

Shallow copy constructor from another cube - does not allocate own memory.

Parameters
[in]misce3::core::Cube object to copy
template<typename cell_t>
isce3::core::Cube< cell_t >::Cube ( cell_t *  data,
size_t  nslices,
size_t  nrows,
size_t  ncols 
)
inline

Shallow copy constructor from raw pointer to data - does not allocate own memory.

Parameters
[in]dataraw pointer to buffer containing data
[in]nslicesNumber of slices for data
[in]nrowsNumber of rows for data
[in]ncolsNumber of columns for data (assume row major packing)
template<typename cell_t>
isce3::core::Cube< cell_t >::Cube ( std::valarray< cell_t > &  data,
size_t  nrows,
size_t  ncols 
)
inline

Shallow copy constructor from an std::valarray - does not allocate own memory.

Parameters
[in]dataValarray containing data
[in]nrowsNumber of rows for data
[in]ncolsNumber of columns for data (assume row major packing)
template<typename cell_t>
isce3::core::Cube< cell_t >::Cube ( std::vector< cell_t > &  data,
size_t  nrows,
size_t  ncols 
)
inline

Shallow copy constructor from an std::vector - does not allocate own memory.

Parameters
[in]dataVector containing data
[in]nrowsNumber of rows for data
[in]ncolsNumber of columns for data (assume row major packing)

Member Function Documentation

template<typename cell_t >
isce3::core::Cube< cell_t >::shape_t isce3::core::Cube< cell_t >::byteoffset ( ) const
inline

Get byteoffset for row and column for reading flat binary buffer.

Get matrix byte offset for slice, row and column for raw binary buffer.

template<typename cell_t >
cell_t & isce3::core::Cube< cell_t >::operator() ( size_t  slice,
size_t  row,
size_t  col 
)
inline

Access matrix value for a given slice, row and column.

Parameters
[in]sliceSlice coordinate to access
[in]rowRow coordinate to access
[in]colColumn coordinate to access
template<typename cell_t >
const cell_t & isce3::core::Cube< cell_t >::operator() ( size_t  slice,
size_t  row,
size_t  col 
) const
inline

Read-only access to matrix value for a given slice, row and column.

Parameters
[in]sliceSlice coordinate to access
[in]rowRow coordinate to access
[in]colColumn coordinate to access
template<typename cell_t >
cell_t & isce3::core::Cube< cell_t >::operator() ( size_t  index)
inline

Access matrix value for a flattened index.

Parameters
[in]indexFlattened index to access
template<typename cell_t >
const cell_t & isce3::core::Cube< cell_t >::operator() ( size_t  index) const
inline

Read-only access to matrix value for a flattened index.

Parameters
[in]indexFlattened index to access
template<typename cell_t>
isce3::core::Cube< cell_t > & isce3::core::Cube< cell_t >::operator= ( const Cube< cell_t > &  m)
inline

Deep assignment operator - allocates memory and copies values.

Parameters
[in]misce3::core::Cube object to copy
template<typename cell_t>
isce3::core::Cube< cell_t > & isce3::core::Cube< cell_t >::operator= ( Cube< cell_t > &  m)
inline

Shallow assignment operator - does not allocate own memory.

Parameters
[in]misce3::core::Cube object to copy
template<typename cell_t >
cell_t & isce3::core::Cube< cell_t >::operator[] ( const index_t &  index)
inline

Access matrix value for a given grid::index_type.

Parameters
[in]indexpyre::grid_t::index_type for coordinate
template<typename cell_t >
const cell_t & isce3::core::Cube< cell_t >::operator[] ( const index_t &  index) const
inline

Read-only access to matrix value for a given grid::idnex_type.

Parameters
[in]indexpyre::grid_t::index_type for coordinate
template<typename cell_t >
void isce3::core::Cube< cell_t >::resize ( size_t  nslices,
size_t  nrows,
size_t  ncols 
)
inline

Resize memory for a given number of slices, rows and columns.

Parameters
[in]nslicesNumber of slices
[in]nrowsNumber of rows
[in]ncolsNumber of columns
template<typename cell_t >
cell_t * isce3::core::Cube< cell_t >::sliceptr ( size_t  slice)
inline

Access to data buffer at a specific slice.

Access to data buffer at specific slice.

template<typename cell_t >
const cell_t * isce3::core::Cube< cell_t >::sliceptr ( size_t  slice) const
inline

Read-only access to data buffer at a specific slice.

Read-only access to data buffer at specific slice.

template<typename cell_t >
const isce3::core::Cube< cell_t >::view_t isce3::core::Cube< cell_t >::subcube ( size_t  slice,
size_t  row,
size_t  col,
size_t  slicespan,
size_t  rowspan,
size_t  colspan 
)
inline

Extract copy of sub-cube given starting indices and span.

Parameters
[in]sliceStarting slice of subcube
[in]rowStarting row of subcube
[in]colStarting column of subcube
[in]slicespanNumber of slices of subcube
[in]rowspanNumber of rows of subcube
[in]colspanNumber of columns of subcube

The documentation for this class was generated from the following files:

Generated for ISCE3.0 by doxygen 1.8.5.