Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DataSequence2D.h
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 #ifndef SKA_CHEETAH_DATA_DATASEQUENCE2D_H
25 #define SKA_CHEETAH_DATA_DATASEQUENCE2D_H
26 
27 #include <cstddef>
28 #include <vector>
29 #include <panda/DataChunk.h>
30 
31 #include "cheetah/utils/Architectures.h"
32 #include "cheetah/data/DataSequence2DIterator.h"
33 
34 namespace ska {
35 namespace cheetah {
36 namespace data {
37 
45 template <typename Arch, typename T>
47 {
48 };
49 
50 }
51 }
52 }
53 
54 #include "cheetah/data/DataSequence2DFastIterator.h"
55 #include "cheetah/data/DataSequence2DPartialIterator.h"
56 
57 namespace ska {
58 namespace cheetah {
59 namespace data {
60 
79 template <typename T>
80 class DataSequence2D<Cpu,T> {
81  public:
82  typedef T DataType;
86 
87  public:
88 
93 
101  DataSequence2D(std::size_t fast_axis_length, std::size_t slow_axis_length);
102 
111  DataSequence2D(std::size_t fast_axis_length, std::size_t slow_axis_length, const T &fill);
112 
116  ~DataSequence2D();
117 
121  inline std::size_t fast_axis_length() const;
122 
126  inline std::size_t slow_axis_length() const;
127 
131  inline std::size_t size() const;
132 
140  void resize(std::size_t fast_axis_length, std::size_t slow_axis_length, const T &fill);
141 
152  void resize(std::size_t fast_axis_length, std::size_t slow_axis_length);
153 
157  T const* data() const;
158 
163  T* data();
164 
169  Iterator begin();
170 
175  ConstIterator begin() const;
176 
181  ConstIterator cbegin() const;
182 
187  Iterator end();
188 
193  ConstIterator end() const;
194 
199  ConstIterator cend() const;
200 
213  PartialIterator slice(
214  std::size_t fbegin,
215  std::size_t fend,
216  std::size_t sbegin,
217  std::size_t send);
218 
219  private:
220  std::size_t _fast_axis_length = 0;
221  std::size_t _slow_axis_length = 0;
222  std::vector<T> _data;
223 };
224 
225 template<typename Arch, typename DataType>
226 bool operator==(DataSequence2D<Arch, DataType> const&, DataSequence2D<Arch, DataType> const&);
227 
228 } // namespace data
229 } // namespace cheetah
230 } // namespace ska
231 
232 #include "cheetah/data/detail/DataSequence2D.cpp"
233 #include "cheetah/data/detail/DataSequence2D_bool.cpp"
234 
235 #endif // SKA_CHEETAH_DATA_DATASEQUENCE2D_H
Iterator over DataSequence2D types, over "fast" axis. Generic type.
Some limits and constants for FLDO.
Definition: Brdz.h:35
A 2-dimensional sequencial data of type T.
Iterator over partial ranges of DataSequence2D types, "fast" axis. Generic type.