Jet  v1.3.3
array_utils.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_ARRAY_UTILS_H_
8 #define INCLUDE_JET_ARRAY_UTILS_H_
9 
10 #include <jet/array_accessor2.h>
11 #include <jet/array_accessor3.h>
12 #include <jet/array1.h>
13 #include <jet/array2.h>
14 #include <jet/array3.h>
15 
16 namespace jet {
17 
24 template <typename ArrayType, typename T>
25 void setRange1(
26  size_t size,
27  const T& value,
28  ArrayType* output);
29 
36 template <typename ArrayType, typename T>
37 void setRange1(
38  size_t begin,
39  size_t end,
40  const T& value,
41  ArrayType* output);
42 
49 template <typename ArrayType1, typename ArrayType2>
51  const ArrayType1& input,
52  size_t size,
53  ArrayType2* output);
54 
61 template <typename ArrayType1, typename ArrayType2>
63  const ArrayType1& input,
64  size_t begin,
65  size_t end,
66  ArrayType2* output);
67 
76 template <typename ArrayType1, typename ArrayType2>
78  const ArrayType1& input,
79  size_t sizeX,
80  size_t sizeY,
81  ArrayType2* output);
82 
91 template <typename ArrayType1, typename ArrayType2>
93  const ArrayType1& input,
94  size_t beginX,
95  size_t endX,
96  size_t beginY,
97  size_t endY,
98  ArrayType2* output);
99 
108 template <typename ArrayType1, typename ArrayType2>
110  const ArrayType1& input,
111  size_t sizeX,
112  size_t sizeY,
113  size_t sizeZ,
114  ArrayType2* output);
115 
124 template <typename ArrayType1, typename ArrayType2>
126  const ArrayType1& input,
127  size_t beginX,
128  size_t endX,
129  size_t beginY,
130  size_t endY,
131  size_t beginZ,
132  size_t endZ,
133  ArrayType2* output);
134 
149 template <typename T>
151  const ConstArrayAccessor2<T>& input,
152  const ConstArrayAccessor2<char>& valid,
153  unsigned int numberOfIterations,
154  ArrayAccessor2<T> output);
155 
170 template <typename T>
172  const ConstArrayAccessor3<T>& input,
173  const ConstArrayAccessor3<char>& valid,
174  unsigned int numberOfIterations,
175  ArrayAccessor3<T> output);
176 
183 template <typename ArrayType>
184 void convertToCsv(const ArrayType& data, std::ostream* strm);
185 
186 } // namespace jet
187 
188 #include "detail/array_utils-inl.h"
189 
190 #endif // INCLUDE_JET_ARRAY_UTILS_H_
jet::ConstArrayAccessor< T, 3 >
3-D read-only array accessor class.
Definition: array_accessor3.h:270
array2.h
array_accessor2.h
jet::convertToCsv
void convertToCsv(const ArrayType &data, std::ostream *strm)
Converts 2-D array to Comma Separated Value (CSV) stream.
jet::copyRange3
void copyRange3(const ArrayType1 &input, size_t sizeX, size_t sizeY, size_t sizeZ, ArrayType2 *output)
Copies 3-D input array to output array with sizeX and sizeY.
jet::copyRange1
void copyRange1(const ArrayType1 &input, size_t size, ArrayType2 *output)
Copies input array to output array with size.
jet
Definition: advection_solver2.h:18
jet::ConstArrayAccessor< T, 2 >
2-D read-only array accessor class.
Definition: array_accessor2.h:261
jet::setRange1
void setRange1(size_t size, const T &value, ArrayType *output)
Assigns value to 1-D array output with size.
array3.h
jet::ArrayAccessor< T, 3 >
3-D array accessor class.
Definition: array_accessor3.h:31
jet::ArrayAccessor< T, 2 >
2-D array accessor class.
Definition: array_accessor2.h:31
array_accessor3.h
jet::copyRange2
void copyRange2(const ArrayType1 &input, size_t sizeX, size_t sizeY, ArrayType2 *output)
Copies 2-D input array to output array with sizeX and sizeY.
jet::extrapolateToRegion
void extrapolateToRegion(const ConstArrayAccessor2< T > &input, const ConstArrayAccessor2< char > &valid, unsigned int numberOfIterations, ArrayAccessor2< T > output)
Extrapolates 2-D input data from 'valid' (1) to 'invalid' (0) region.
array1.h