Go to the documentation of this file.
11 #ifndef vtk_m_worklet_wavelets_waveletbase_h
12 #define vtk_m_worklet_wavelets_waveletbase_h
51 if (sigInLen % 2 != 0)
53 return ((sigInLen + 1) / 2);
57 return ((sigInLen) / 2);
64 if (sigInLen % 2 != 0)
66 return ((sigInLen - 1) / 2);
70 return ((sigInLen) / 2);
98 template <
typename ArrayType1,
typename ArrayType2>
102 CopyType cp(startIdx);
104 dispatcher.Invoke(srcArray, dstArray);
108 template <
typename ArrayType>
112 ZeroWorklet worklet(index);
114 dispatcher.Invoke(array);
118 template <
typename ArrayType>
125 AssignZero2DType zeroWorklet(dimX, dimY, -1, rowIdx);
127 dispatcher.Invoke(array);
131 template <
typename ArrayType>
138 AssignZero2DType zeroWorklet(dimX, dimY, colIdx, -1);
140 dispatcher.Invoke(array);
144 template <
typename ArrayType>
152 AssignZero3DType zeroWorklet(dimX, dimY, dimZ, zeroX, -1, -1);
154 dispatcher.Invoke(array);
158 template <
typename ArrayType>
166 AssignZero3DType zeroWorklet(dimX, dimY, dimZ, -1, zeroY, -1);
168 dispatcher.Invoke(array);
172 template <
typename ArrayType>
180 AssignZero3DType zeroWorklet(dimX, dimY, dimZ, -1, -1, zeroZ);
182 dispatcher.Invoke(array);
188 template <
typename T>
191 return vtkm::Abs(x) < vtkm::Abs(y);
194 template <
typename ArrayType>
201 template <
typename ArrayType>
202 typename ArrayType::ValueType
DeviceSum(
const ArrayType& array)
210 template <
typename FieldType>
218 template <
typename FieldType>
221 return vtkm::Max(x, y);
226 template <
typename ArrayType>
227 typename ArrayType::ValueType
DeviceMax(
const ArrayType& array)
232 template <
typename ArrayType>
233 typename ArrayType::ValueType
DeviceMin(
const ArrayType& array)
242 template <
typename FieldType>
245 return vtkm::Max(vtkm::Abs(x), vtkm::Abs(y));
248 template <
typename ArrayType>
251 typename ArrayType::ValueType initVal = array.ReadPortal().Get(0);
256 template <
typename ArrayType>
268 dispatcher.Invoke(array, squaredDeviation);
277 template <
typename SmallArrayType,
typename BigArrayType>
281 BigArrayType& bigRect,
288 CopyToWorklet cp(smallX, smallY, bigX, bigY, startX, startY);
290 dispatcher.Invoke(smallRect, bigRect);
294 template <
typename SmallArrayType,
typename BigArrayType>
299 BigArrayType& bigCube,
308 CopyToWorklet cp(smallX, smallY, smallZ, bigX, bigY, bigZ, startX, startY, startZ);
310 dispatcher.Invoke(smallCube, bigCube);
313 template <
typename ArrayType>
316 std::cerr << str << std::endl;
317 auto portal = arr.ReadPortal();
318 for (
vtkm::Id i = 0; i < arr.GetNumberOfValues(); i++)
320 std::cerr << portal.Get(i) <<
" ";
321 if (i % dimX == dimX - 1)
323 std::cerr << std::endl;
335 if (sigInLen < filterLength)
void DeviceSort(ArrayType &array)
Definition: WaveletBase.h:195
vtkm::Id GetDetailLength(vtkm::Id sigInLen)
Definition: WaveletBase.h:62
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
Definition: WaveletTransforms.h:3585
void Print2DArray(const std::string &str, const ArrayType &arr, vtkm::Id dimX)
Definition: WaveletBase.h:314
@ BIOR2_2
Definition: WaveletFilter.h:36
#define VTKM_EXEC
Definition: ExportMacros.h:51
void DeviceCubeCopyTo(const SmallArrayType &smallCube, vtkm::Id smallX, vtkm::Id smallY, vtkm::Id smallZ, BigArrayType &bigCube, vtkm::Id bigX, vtkm::Id bigY, vtkm::Id bigZ, vtkm::Id startX, vtkm::Id startY, vtkm::Id startZ)
Definition: WaveletBase.h:295
Groups connected points that have the same field value.
Definition: Atomic.h:19
Definition: WaveletFilter.h:42
Definition: WaveletTransforms.h:3639
Definition: WaveletBase.h:240
@ CDF8_4
Definition: WaveletFilter.h:32
VTKM_EXEC FieldType operator()(const FieldType &x, const FieldType &y) const
Definition: WaveletBase.h:243
vtkm::Id GetCoeffLength(vtkm::Id sigInLen)
Definition: WaveletBase.h:75
Definition: WaveletBase.h:30
Definition: WaveletTransforms.h:3450
@ CDF9_7
Definition: WaveletFilter.h:30
Definition: WaveletBase.h:186
@ HAAR
Definition: WaveletFilter.h:33
static VTKM_CONT void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:965
Definition: WaveletTransforms.h:3478
Definition: WaveletTransforms.h:3526
VTKM_CONT T ArrayGetValue(vtkm::Id id, const vtkm::cont::ArrayHandle< T, S > &data)
Obtain a small set of values from an ArrayHandle with minimal device transfers.
Definition: ArrayGetValues.h:264
vtkm::Id GetFilterLength()
Definition: WaveletFilter.h:108
vtkm::Id GetCoeffLength3(vtkm::Id sigInX, vtkm::Id sigInY, vtkm::Id sigInZ)
Definition: WaveletBase.h:83
ArrayType::ValueType DeviceSum(const ArrayType &array)
Definition: WaveletBase.h:202
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
void DeviceAssignZero3DPlaneY(ArrayType &array, vtkm::Id dimX, vtkm::Id dimY, vtkm::Id dimZ, vtkm::Id zeroY)
Definition: WaveletBase.h:159
ArrayType::ValueType DeviceMax(const ArrayType &array)
Definition: WaveletBase.h:227
VTKM_EXEC_CONT vtkm::Float32 Log2(vtkm::Float32 x)
Computes the logarithm base 2 of x.
Definition: Math.h:1514
VTKM_EXEC_CONT vtkm::Float32 Floor(vtkm::Float32 x)
Round x to the largest integer value not greater than x.
Definition: Math.h:2204
void DeviceRectangleCopyTo(const SmallArrayType &smallRect, vtkm::Id smallX, vtkm::Id smallY, BigArrayType &bigRect, vtkm::Id bigX, vtkm::Id bigY, vtkm::Id startX, vtkm::Id startY)
Definition: WaveletBase.h:278
vtkm::Id GetApproxLength(vtkm::Id sigInLen)
Definition: WaveletBase.h:49
Dispatcher for worklets that inherit from WorkletMapField.
Definition: DispatcherMapField.h:25
vtkm::Id GetCoeffLength2(vtkm::Id sigInX, vtkm::Id sigInY)
Definition: WaveletBase.h:79
void DeviceAssignZero2DRow(ArrayType &array, vtkm::Id dimX, vtkm::Id dimY, vtkm::Id rowIdx)
Definition: WaveletBase.h:119
void DeviceAssignZero(ArrayType &array, vtkm::Id index)
Definition: WaveletBase.h:109
@ CDF5_3
Definition: WaveletFilter.h:31
@ SYMH
Definition: WaveletTransforms.h:28
@ SYMW
Definition: WaveletTransforms.h:29
vtkm::Float64 DeviceCalculateVariance(ArrayType &array)
Definition: WaveletBase.h:257
DWTMode wmode
Definition: WaveletBase.h:330
DWTMode
Definition: WaveletTransforms.h:26
ArrayType::ValueType DeviceMaxAbs(const ArrayType &array)
Definition: WaveletBase.h:249
Definition: WaveletBase.h:208
WaveletName
Definition: WaveletFilter.h:28
WaveletName wname
Definition: WaveletBase.h:329
@ BIOR3_3
Definition: WaveletFilter.h:35
void DeviceAssignZero2DColumn(ArrayType &array, vtkm::Id dimX, vtkm::Id dimY, vtkm::Id colIdx)
Definition: WaveletBase.h:132
ArrayType::ValueType DeviceMin(const ArrayType &array)
Definition: WaveletBase.h:233
void DeviceAssignZero3DPlaneX(ArrayType &array, vtkm::Id dimX, vtkm::Id dimY, vtkm::Id dimZ, vtkm::Id zeroX)
Definition: WaveletBase.h:145
WaveletBase(WaveletName name)
Definition: WaveletBase.h:34
VTKM_EXEC bool operator()(const T &x, const T &y) const
Definition: WaveletBase.h:189
static VTKM_CONT U Reduce(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: Algorithm.h:656
double Float64
Definition: Types.h:155
void WaveLengthValidate(vtkm::Id sigInLen, vtkm::Id filterLength, vtkm::Id &level)
Definition: WaveletBase.h:333
Definition: WaveletTransforms.h:3148
@ BIOR1_1
Definition: WaveletFilter.h:37
WaveletFilter filter
Definition: WaveletBase.h:331
Definition: WaveletTransforms.h:3202
VTKM_EXEC FieldType operator()(const FieldType &x, const FieldType &y) const
Definition: WaveletBase.h:211
Definition: WaveletBase.h:216
vtkm::Id GetWaveletMaxLevel(vtkm::Id sigInLen)
Definition: WaveletBase.h:89
void DeviceCopyStartX(const ArrayType1 &srcArray, ArrayType2 &dstArray, vtkm::Id startIdx)
Definition: WaveletBase.h:99
void DeviceAssignZero3DPlaneZ(ArrayType &array, vtkm::Id dimX, vtkm::Id dimY, vtkm::Id dimZ, vtkm::Id zeroZ)
Definition: WaveletBase.h:173
VTKM_EXEC FieldType operator()(const FieldType &x, const FieldType &y) const
Definition: WaveletBase.h:219
@ BIOR4_4
Definition: WaveletFilter.h:34