Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::data::DataSequence2D< Cpu, bool > Class Template Reference
Collaboration diagram for ska::cheetah::data::DataSequence2D< Cpu, bool >:
Collaboration graph

Public Types

typedef bool DataType
 
typedef std::vector< bool >::iterator Iterator
 
typedef std::vector< bool >::const_iterator ConstIterator
 
typedef DataSequence2DPartialRange< Cpu, bool > PartialRange
 
typedef DataSequence2DConstPartialRange< Cpu, bool > ConstPartialRange
 
typedef DataSequence2DPartialIterator< Cpu, bool > PartialIterator
 
typedef DataSequence2DPartialIterator< Cpu, const bool > ConstPartialIterator
 

Public Member Functions

 DataSequence2D ()
 Create a zero-sized DataSequence2D.
 
 DataSequence2D (std::size_t fast_axis_length, std::size_t slow_axis_length)
 Create a pre-sized DataSequence2D filled with the default constructor of T. More...
 
 DataSequence2D (std::size_t fast_axis_length, std::size_t slow_axis_length, const bool &fill)
 Create a pre-sized DataSequence2D, filled with copies of a provided T. More...
 
 ~DataSequence2D ()
 Free memory associated with DataSequence2D.
 
std::size_t fast_axis_length () const
 Get the current fast_axis_length.
 
std::size_t slow_axis_length () const
 Get the current slow_axis_length.
 
std::size_t size () const
 the number fo elements in the data
 
void resize (std::size_t fast_axis_length, std::size_t slow_axis_length, const bool &fill)
 Destructive resize of underlying data. Fill with copies. More...
 
void resize (std::size_t fast_axis_length, std::size_t slow_axis_length)
 Destructive resize of underlying data. More...
 
Iterator begin ()
 get the default Iterator More...
 
ConstIterator begin () const
 get the default Iterator More...
 
ConstIterator cbegin () const
 get the default Iterator More...
 
Iterator end ()
 get the default end Iterator More...
 
ConstIterator end () const
 get the default end Iterator More...
 
ConstIterator cend () const
 get the default end Iterator More...
 
PartialRange slice (std::size_t fbegin, std::size_t fend, std::size_t sbegin, std::size_t send)
 Return an Iterator to a slice of the datasequence. The partial Iterator returned will iterate only over the range specified, from fbegin to fend on the fast axis and from sbegin to send on the slow axis. Otherwise the Iterator behaves as if it were a FastIterator over a smaller DataSequence2D of length (fend-fbegin) by (send-sbegin) More...
 
ConstPartialRange slice (std::size_t fbegin, std::size_t fend, std::size_t sbegin, std::size_t send) const
 

Detailed Description

template<>
class ska::cheetah::data::DataSequence2D< Cpu, bool >

Definition at line 33 of file DataSequence2D_bool.cpp.

Constructor & Destructor Documentation

◆ DataSequence2D() [1/2]

ska::cheetah::data::DataSequence2D< Cpu, bool >::DataSequence2D ( std::size_t  fast_axis_length,
std::size_t  slow_axis_length 
)

Create a pre-sized DataSequence2D filled with the default constructor of T.

Parameters
fast_axis_lengththe length of the fast axis
slow_axis_lengththe length of the slow axis.

Definition at line 35 of file DataSequence2D_bool.cpp.

36  : _fast_axis_length(fast_axis_length)
37  , _slow_axis_length(slow_axis_length)
38  , _data()
39 {
40  this->_data.resize(fast_axis_length*slow_axis_length);
41 }
std::size_t slow_axis_length() const
Get the current slow_axis_length.
std::size_t fast_axis_length() const
Get the current fast_axis_length.

◆ DataSequence2D() [2/2]

ska::cheetah::data::DataSequence2D< Cpu, bool >::DataSequence2D ( std::size_t  fast_axis_length,
std::size_t  slow_axis_length,
const bool &  fill 
)

Create a pre-sized DataSequence2D, filled with copies of a provided T.

Parameters
fast_axis_lengththe length of the fast axis
slow_axis_lengththe length of the slow axis.
fillobject to be copied.

Definition at line 43 of file DataSequence2D_bool.cpp.

44  : _fast_axis_length(fast_axis_length)
45  , _slow_axis_length(slow_axis_length)
47 {
48 }
std::size_t slow_axis_length() const
Get the current slow_axis_length.
std::size_t fast_axis_length() const
Get the current fast_axis_length.

Member Function Documentation

◆ begin() [1/2]

DataSequence2D< Cpu, bool >::Iterator ska::cheetah::data::DataSequence2D< Cpu, bool >::begin ( )

get the default Iterator

iterates over fast axis first, then slow axis

Definition at line 67 of file DataSequence2D_bool.cpp.

67  {
68  return _data.begin();
69 }

◆ begin() [2/2]

DataSequence2D< Cpu, bool >::ConstIterator ska::cheetah::data::DataSequence2D< Cpu, bool >::begin ( ) const

get the default Iterator

iterates over fast axis first, then slow axis

Definition at line 71 of file DataSequence2D_bool.cpp.

71  {
72  return _data.begin();
73 }

◆ cbegin()

DataSequence2D< Cpu, bool >::ConstIterator ska::cheetah::data::DataSequence2D< Cpu, bool >::cbegin ( ) const

get the default Iterator

iterates over fast axis first, then slow axis

Definition at line 75 of file DataSequence2D_bool.cpp.

75  {
76  return _data.cbegin();
77 }

◆ cend()

DataSequence2D< Cpu, bool >::ConstIterator ska::cheetah::data::DataSequence2D< Cpu, bool >::cend ( ) const

get the default end Iterator

iterates over fast axis first, then slow axis

Definition at line 88 of file DataSequence2D_bool.cpp.

88  {
89  return _data.cend();
90 }

◆ end() [1/2]

DataSequence2D< Cpu, bool >::Iterator ska::cheetah::data::DataSequence2D< Cpu, bool >::end ( )

get the default end Iterator

iterates over fast axis first, then slow axis

Definition at line 80 of file DataSequence2D_bool.cpp.

80  {
81  return _data.end();
82 }

◆ end() [2/2]

DataSequence2D< Cpu, bool >::ConstIterator ska::cheetah::data::DataSequence2D< Cpu, bool >::end ( ) const

get the default end Iterator

iterates over fast axis first, then slow axis

Definition at line 84 of file DataSequence2D_bool.cpp.

84  {
85  return _data.end();
86 }

◆ resize() [1/2]

void ska::cheetah::data::DataSequence2D< Cpu, bool >::resize ( std::size_t  fast_axis_length,
std::size_t  slow_axis_length,
const bool &  fill 
)

Destructive resize of underlying data. Fill with copies.

Parameters
fast_axis_lengthnew fast axis length
slow_axis_lengthnew slow axis length
fillValue to copy to fill underlying array.

Definition at line 52 of file DataSequence2D_bool.cpp.

53 {
54  this->_fast_axis_length = fast_axis_length;
55  this->_slow_axis_length = slow_axis_length;
56  this->_data.resize(this->_fast_axis_length*this->_slow_axis_length);
57  std::fill(this->_data.begin(),this->_data.end(), fill);
58 }
std::size_t slow_axis_length() const
Get the current slow_axis_length.
std::size_t fast_axis_length() const
Get the current fast_axis_length.

◆ resize() [2/2]

void ska::cheetah::data::DataSequence2D< Cpu, bool >::resize ( std::size_t  fast_axis_length,
std::size_t  slow_axis_length 
)

Destructive resize of underlying data.

the contents of the memory are not defined after a call to this method.

Parameters
fast_axis_lengthnew fast axis length
slow_axis_lengthnew slow axis length
fillValue to copy to fill underlying array.

Definition at line 60 of file DataSequence2D_bool.cpp.

61 {
62  this->_fast_axis_length = fast_axis_length;
63  this->_slow_axis_length = slow_axis_length;
64  this->_data.resize(this->_fast_axis_length*this->_slow_axis_length);
65 }
std::size_t slow_axis_length() const
Get the current slow_axis_length.
std::size_t fast_axis_length() const
Get the current fast_axis_length.

◆ slice()

DataSequence2D< Cpu, bool >::PartialRange ska::cheetah::data::DataSequence2D< Cpu, bool >::slice ( std::size_t  fbegin,
std::size_t  fend,
std::size_t  sbegin,
std::size_t  send 
)

Return an Iterator to a slice of the datasequence. The partial Iterator returned will iterate only over the range specified, from fbegin to fend on the fast axis and from sbegin to send on the slow axis. Otherwise the Iterator behaves as if it were a FastIterator over a smaller DataSequence2D of length (fend-fbegin) by (send-sbegin)

  • fbegin the fast axis to start at (inclusive)
  • fend the fast axis to end at (not inclusive)
  • sbegin the slow axis to start at (inclusive)
  • send the slow axis to end at (not inclusive)

Definition at line 92 of file DataSequence2D_bool.cpp.

97 {
98  BOOST_ASSERT(fend <= this->fast_axis_length());
99  BOOST_ASSERT(send <= this->slow_axis_length());
100 
101  return DataSequence2DPartialRange<Cpu,bool>(*this, fbegin, fend, sbegin, send, _fast_axis_length);
102 }
std::size_t slow_axis_length() const
Get the current slow_axis_length.
std::size_t fast_axis_length() const
Get the current fast_axis_length.

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