Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataSequence2D_bool.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
25 #include "panda/Error.h"
26 #include "cheetah/data/DataSequence2DPartialRange.h"
27 
28 namespace ska {
29 namespace cheetah {
30 namespace data {
31 
32 template <>
33 class DataSequence2D<Cpu,bool> {
34  public:
35  typedef bool DataType;
36  typedef std::vector<bool>::iterator Iterator;
37  typedef std::vector<bool>::const_iterator ConstIterator;
38 
41 
44 
45  public:
46 
51 
59  DataSequence2D(std::size_t fast_axis_length, std::size_t slow_axis_length);
60 
69  DataSequence2D(std::size_t fast_axis_length, std::size_t slow_axis_length, const bool &fill);
70 
74  ~DataSequence2D();
75 
79  inline std::size_t fast_axis_length() const;
80 
84  inline std::size_t slow_axis_length() const;
85 
89  inline std::size_t size() const;
90 
98  void resize(std::size_t fast_axis_length, std::size_t slow_axis_length, const bool &fill);
99 
110  void resize(std::size_t fast_axis_length, std::size_t slow_axis_length);
111 
116  Iterator begin();
121  ConstIterator begin() const;
126  ConstIterator cbegin() const;
127 
132  Iterator end();
137  ConstIterator end() const;
138 
143  ConstIterator cend() const;
144 
157  PartialRange slice(
158  std::size_t fbegin,
159  std::size_t fend,
160  std::size_t sbegin,
161  std::size_t send);
162 
163  ConstPartialRange slice(
164  std::size_t fbegin,
165  std::size_t fend,
166  std::size_t sbegin,
167  std::size_t send) const;
168 
169  private:
170  std::size_t _fast_axis_length = 0;
171  std::size_t _slow_axis_length = 0;
172  std::vector<bool> _data;
173 };
174 
175 std::size_t DataSequence2D<Cpu,bool>::fast_axis_length() const { return this->_fast_axis_length;}
176 
177 std::size_t DataSequence2D<Cpu,bool>::slow_axis_length() const { return this->_slow_axis_length;}
178 
179 std::size_t DataSequence2D<Cpu,bool>::size() const { return this->_data.size();}
180 
181 } // namespace data
182 } // namespace cheetah
183 } // namespace ska
184 
185 
186 
Some limits and constants for FLDO.
Definition: Brdz.h:35
A 2-dimensional sequencial data of type T.