Citlali
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
BlockAccessor< Array, n_dims_ > Struct Template Reference

The BlockAccessor struct This provides methods to access array in block notions. More...

Collaboration diagram for BlockAccessor< Array, n_dims_ >:
Collaboration graph

Public Types

using array_t = Array
 
using index_t = predefs::index_t
 
using bins_t = Eigen::Matrix< index_t, 2, Eigen::Dynamic >
 

Public Member Functions

 BlockAccessor (array_t array_)
 
template<index_t dim>
constexpr auto bins () -> decltype(auto)
 Return the bins for dim.
 
template<index_t dim>
constexpr index_t n_bins () const
 Return the number of bins for dim.
 
template<index_t dim>
void set_bins (bins_t bins_)
 Set bins with bin matrix of shape (2, nbins).
 
template<index_t dim>
void set_bins (const std::vector< std::pair< index_t, index_t > > &bins_)
 Set bins with vector of pairs of (left, right).
 
template<index_t dim>
void set_bins (const std::vector< index_t > &bin_edges)
 Set bins with vector of bin edges of size (nbins + 1).
 
constexpr index_t n_blocks () const
 Returns number of blocks.
 
template<index_t n_dims__ = n_dims, REQUIRES_V(n_dims__==1) >
auto block (index_t i)
 
template<index_t n_dims__ = n_dims, REQUIRES_V(n_dims__==2) >
auto block (index_t i, index_t j)
 

Public Attributes

array_t array
 
std::array< bins_t, n_dimsall_bins
 

Static Public Attributes

static constexpr const index_t n_dims = n_dims_
 
static constexpr const index_t left = 0
 
static constexpr const index_t right = 1
 

Friends

std::ostream & operator<< (std::ostream &os, const BlockAccessor &b)
 

Detailed Description

template<typename Array, auto n_dims_ = 2>
struct BlockAccessor< Array, n_dims_ >

The BlockAccessor struct This provides methods to access array in block notions.

Member Typedef Documentation

◆ array_t

template<typename Array , auto n_dims_ = 2>
using BlockAccessor< Array, n_dims_ >::array_t = Array

◆ bins_t

template<typename Array , auto n_dims_ = 2>
using BlockAccessor< Array, n_dims_ >::bins_t = Eigen::Matrix<index_t, 2, Eigen::Dynamic>

◆ index_t

template<typename Array , auto n_dims_ = 2>
using BlockAccessor< Array, n_dims_ >::index_t = predefs::index_t

Constructor & Destructor Documentation

◆ BlockAccessor()

template<typename Array , auto n_dims_ = 2>
BlockAccessor< Array, n_dims_ >::BlockAccessor ( array_t  array_)
inline

Member Function Documentation

◆ bins()

template<typename Array , auto n_dims_ = 2>
template<index_t dim>
constexpr auto BlockAccessor< Array, n_dims_ >::bins ( ) -> decltype(auto)
inlineconstexpr

Return the bins for dim.

◆ block() [1/2]

template<typename Array , auto n_dims_ = 2>
template<index_t n_dims__ = n_dims, REQUIRES_V(n_dims__==1) >
auto BlockAccessor< Array, n_dims_ >::block ( index_t  i)
inline

◆ block() [2/2]

template<typename Array , auto n_dims_ = 2>
template<index_t n_dims__ = n_dims, REQUIRES_V(n_dims__==2) >
auto BlockAccessor< Array, n_dims_ >::block ( index_t  i,
index_t  j 
)
inline

◆ n_bins()

template<typename Array , auto n_dims_ = 2>
template<index_t dim>
constexpr index_t BlockAccessor< Array, n_dims_ >::n_bins ( ) const
inlineconstexpr

Return the number of bins for dim.

Here is the caller graph for this function:

◆ n_blocks()

template<typename Array , auto n_dims_ = 2>
constexpr index_t BlockAccessor< Array, n_dims_ >::n_blocks ( ) const
inlineconstexpr

Returns number of blocks.

◆ set_bins() [1/3]

template<typename Array , auto n_dims_ = 2>
template<index_t dim>
void BlockAccessor< Array, n_dims_ >::set_bins ( bins_t  bins_)
inline

Set bins with bin matrix of shape (2, nbins).

Here is the caller graph for this function:

◆ set_bins() [2/3]

template<typename Array , auto n_dims_ = 2>
template<index_t dim>
void BlockAccessor< Array, n_dims_ >::set_bins ( const std::vector< index_t > &  bin_edges)
inline

Set bins with vector of bin edges of size (nbins + 1).

Here is the call graph for this function:

◆ set_bins() [3/3]

template<typename Array , auto n_dims_ = 2>
template<index_t dim>
void BlockAccessor< Array, n_dims_ >::set_bins ( const std::vector< std::pair< index_t, index_t > > &  bins_)
inline

Set bins with vector of pairs of (left, right).

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

template<typename Array , auto n_dims_ = 2>
std::ostream & operator<< ( std::ostream &  os,
const BlockAccessor< Array, n_dims_ > &  b 
)
friend

Member Data Documentation

◆ all_bins

template<typename Array , auto n_dims_ = 2>
std::array<bins_t, n_dims> BlockAccessor< Array, n_dims_ >::all_bins

◆ array

template<typename Array , auto n_dims_ = 2>
array_t BlockAccessor< Array, n_dims_ >::array

◆ left

template<typename Array , auto n_dims_ = 2>
constexpr const index_t BlockAccessor< Array, n_dims_ >::left = 0
staticconstexpr

◆ n_dims

template<typename Array , auto n_dims_ = 2>
constexpr const index_t BlockAccessor< Array, n_dims_ >::n_dims = n_dims_
staticconstexpr

◆ right

template<typename Array , auto n_dims_ = 2>
constexpr const index_t BlockAccessor< Array, n_dims_ >::right = 1
staticconstexpr

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