From 16528df5bac1dfa847ba092ebf8adbd061713a71 Mon Sep 17 00:00:00 2001 From: Samuel Li Date: Tue, 19 Jul 2016 10:06:48 -0600 Subject: [PATCH] remove redundent files --- vtkm/worklet/CMakeLists.txt | 1 - vtkm/worklet/wavelet/CMakeLists.txt | 28 ----- vtkm/worklet/wavelet/FilterBanks.h | 63 ---------- vtkm/worklet/wavelet/WaveletBase.h | 175 --------------------------- vtkm/worklet/wavelet/WaveletFilter.h | 169 -------------------------- 5 files changed, 436 deletions(-) delete mode 100644 vtkm/worklet/wavelet/CMakeLists.txt delete mode 100644 vtkm/worklet/wavelet/FilterBanks.h delete mode 100644 vtkm/worklet/wavelet/WaveletBase.h delete mode 100644 vtkm/worklet/wavelet/WaveletFilter.h diff --git a/vtkm/worklet/CMakeLists.txt b/vtkm/worklet/CMakeLists.txt index 70f94b1ab..de0d70fb4 100644 --- a/vtkm/worklet/CMakeLists.txt +++ b/vtkm/worklet/CMakeLists.txt @@ -50,7 +50,6 @@ set(headers #----------------------------------------------------------------------------- add_subdirectory(internal) add_subdirectory(splatkernels) -# add_subdirectory(wavelet) vtkm_declare_headers(${headers}) diff --git a/vtkm/worklet/wavelet/CMakeLists.txt b/vtkm/worklet/wavelet/CMakeLists.txt deleted file mode 100644 index 311ace610..000000000 --- a/vtkm/worklet/wavelet/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -##============================================================================ -## Copyright (c) Kitware, Inc. -## All rights reserved. -## See LICENSE.txt for details. -## This software is distributed WITHOUT ANY WARRANTY; without even -## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -## PURPOSE. See the above copyright notice for more information. -## -## Copyright 2016 Sandia Corporation. -## Copyright 2016 UT-Battelle, LLC. -## Copyright 2016 Los Alamos National Security. -## -## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -## the U.S. Government retains certain rights in this software. -## -## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National -## Laboratory (LANL), the U.S. Government retains certain rights in -## this software. -##============================================================================ - -set(headers - FilterBanks.h - WaveletFilter.h - WaveletBase.h - ) - -#----------------------------------------------------------------------------- -vtkm_declare_headers(${headers}) diff --git a/vtkm/worklet/wavelet/FilterBanks.h b/vtkm/worklet/wavelet/FilterBanks.h deleted file mode 100644 index 3b3e932e1..000000000 --- a/vtkm/worklet/wavelet/FilterBanks.h +++ /dev/null @@ -1,63 +0,0 @@ -//============================================================================= -// -// Copyright (c) Kitware, Inc. -// All rights reserved. -// See LICENSE.txt for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -// Copyright 2015 Sandia Corporation. -// Copyright 2015 UT-Battelle, LLC. -// Copyright 2015 Los Alamos National Security. -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National -// Laboratory (LANL), the U.S. Government retains certain rights in -// this software. -// -//============================================================================= - -#ifndef vtk_m_worklet_wavelet_filterbanks_h -#define vtk_m_worklet_wavelet_filterbanks_h - - -#include - -namespace vtkm { -namespace worklet { - -namespace wavelet { - - const vtkm::Float64 hm4_44[9] = { - 0.037828455507264, - -0.023849465019557, - -0.110624404418437, - 0.377402855612831, - 0.852698679008894, - 0.377402855612831, - -0.110624404418437, - -0.023849465019557, - 0.037828455507264 - }; - - const vtkm::Float64 h4[9] = { - 0.0, - -0.064538882628697, - -0.040689417609164, - 0.418092273221617, - 0.788485616405583, - 0.418092273221617, - -0.0406894176091641, - -0.0645388826286971, - 0.0 - }; - -}; - -} -} - -#endif diff --git a/vtkm/worklet/wavelet/WaveletBase.h b/vtkm/worklet/wavelet/WaveletBase.h deleted file mode 100644 index 32894b297..000000000 --- a/vtkm/worklet/wavelet/WaveletBase.h +++ /dev/null @@ -1,175 +0,0 @@ -//============================================================================ -// Copyright (c) Kitware, Inc. -// All rights reserved. -// See LICENSE.txt for details. -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -// Copyright 2014 Sandia Corporation. -// Copyright 2014 UT-Battelle, LLC. -// Copyright 2014 Los Alamos National Security. -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National -// Laboratory (LANL), the U.S. Government retains certain rights in -// this software. -//============================================================================ - -#ifndef vtk_m_worklet_wavelet_waveletbase_h -#define vtk_m_worklet_wavelet_waveletbase_h - -#include - -#include - -#include - -namespace vtkm { -namespace worklet { - -namespace wavelet { - -// protected: -enum DWTMode { // boundary extension modes - INVALID = -1, - ZPD, - SYMH, - SYMW, - ASYMH, ASYMW, SP0, SP1, PPD, PER -}; - -// Functionalities are similar to MatWaveBase in VAPoR. -class WaveletBase -{ -public: - // Constructor - WaveletBase( const std::string &w_name ) - { - this->filter = NULL; - this->wmode = PER; - this->wname = w_name; - if( wname.compare("CDF9/7") == 0 ) - { - this->wmode = SYMW; // Default extension mode, see MatWaveBase.cpp - this->filter = new vtkm::worklet::wavelet::WaveletFilter( wname ); - } - } - - // Destructor - virtual ~WaveletBase() - { - if( filter ) - delete filter; - filter = NULL; - } - - // Get the wavelet filter - const WaveletFilter* GetWaveletFilter() - { - if( this->filter == NULL ) - { - // throw an error - } - return filter; - } - - // Returns length of approximation coefficients from a decompostition pass. - vtkm::Id GetApproxLength( vtkm::Id sigInLen ) - { - vtkm::Id filterLen = this->filter->GetFilterLength(); - - if (this->wmode == PER) - return static_cast(vtkm::Ceil( (static_cast(sigInLen)) / 2.0 )); - else if (this->filter->isSymmetric()) - { - if ( (this->wmode == SYMW && (filterLen % 2 != 0)) || - (this->wmode == SYMH && (filterLen % 2 == 0)) ) - { - if (sigInLen % 2 != 0) - return((sigInLen+1) / 2); - else - return((sigInLen) / 2); - } - } - - return static_cast( vtkm::Floor( - static_cast(sigInLen + filterLen - 1) / 2.0 ) ); - } - - // Returns length of detail coefficients from a decompostition pass - vtkm::Id GetDetailLength( vtkm::Id sigInLen ) - { - vtkm::Id filterLen = this->filter->GetFilterLength(); - - if (this->wmode == PER) - return static_cast(vtkm::Ceil( (static_cast(sigInLen)) / 2.0 )); - else if (this->filter->isSymmetric()) - { - if ( (this->wmode == SYMW && (filterLen % 2 != 0)) || - (this->wmode == SYMH && (filterLen % 2 == 0)) ) - { - if (sigInLen % 2 != 0) - return((sigInLen-1) / 2); - else - return((sigInLen) / 2); - } - } - - return static_cast( vtkm::Floor( - static_cast(sigInLen + filterLen - 1) / 2.0 ) ); - } - - // Returns length of coefficients generated in a decompostition pass - vtkm::Id GetCoeffLength( vtkm::Id sigInLen ) - { - return( GetApproxLength( sigInLen ) + GetDetailLength( sigInLen ) ); - } - vtkm::Id GetCoeffLength2( vtkm::Id sigInX, vtkm::Id sigInY ) - { - return( GetCoeffLength( sigInX) * GetCoeffLength( sigInY ) ); - } - vtkm::Id GetCoeffLength3( vtkm::Id sigInX, vtkm::Id sigInY, vtkm::Id sigInZ) - { - return( GetCoeffLength( sigInX) * GetCoeffLength( sigInY ) * GetCoeffLength( sigInZ ) ); - } - - // Returns maximum wavelet decompostion level - vtkm::Id GetWaveletMaxLevel( vtkm::Id sigInLen ) - { - if( ! this->filter ) - return 0; - else { - vtkm::Id filterLen = this->filter->GetFilterLength(); - vtkm::Id level; - this->WaveLengthValidate( sigInLen, filterLen, level ); - return level; - } - } - -protected: - DWTMode wmode; - WaveletFilter* filter; - std::string wname; - - void WaveLengthValidate( vtkm::Id sigInLen, vtkm::Id filterLength, vtkm::Id &level) - { - // *lev = (int) (log((double) sigInLen / (double) (waveLength)) / log(2.0)) + 1; - if( sigInLen < filterLength ) - level = 0; - else - level = static_cast( vtkm::Floor( - vtkm::Log2( static_cast(sigInLen) / - static_cast(filterLength) ) + 1.0 ) ); - } -}; // Finish class WaveletBase. - - -} // Finish namespace wavelet - -} // Finish namespace worlet -} // Finish namespace vtkm - -#endif diff --git a/vtkm/worklet/wavelet/WaveletFilter.h b/vtkm/worklet/wavelet/WaveletFilter.h deleted file mode 100644 index 823b5147a..000000000 --- a/vtkm/worklet/wavelet/WaveletFilter.h +++ /dev/null @@ -1,169 +0,0 @@ -//============================================================================ -// Copyright (c) Kitware, Inc. -// All rights reserved. -// See LICENSE.txt for details. -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -// Copyright 2014 Sandia Corporation. -// Copyright 2014 UT-Battelle, LLC. -// Copyright 2014 Los Alamos National Security. -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National -// Laboratory (LANL), the U.S. Government retains certain rights in -// this software. -//============================================================================ - -#ifndef vtk_m_worklet_wavelet_waveletfilter_h -#define vtk_m_worklet_wavelet_waveletfilter_h - -#include - -#include - -#include - -namespace vtkm { -namespace worklet { - -namespace wavelet { - -// Wavelet filter class; -// functionally equivalent to WaveFiltBase and its subclasses in VAPoR. -class WaveletFilter -{ -public: - // constructor - WaveletFilter( const std::string &wname ) - { - lowDecomposeFilter = highDecomposeFilter = - lowReconstructFilter = highReconstructFilter = NULL; - this->filterLength = 0; - if( wname.compare("CDF9/7") == 0 ) - { - this->symmetricity= true; - this->filterLength = 9; - AllocateFilterMemory(); - wrev( vtkm::worklet::wavelet::hm4_44, lowDecomposeFilter, filterLength ); - qmf_wrev( vtkm::worklet::wavelet::h4, highDecomposeFilter, filterLength ); - verbatim_copy( vtkm::worklet::wavelet::h4, lowReconstructFilter, filterLength ); - qmf_even( vtkm::worklet::wavelet::hm4_44, highReconstructFilter, filterLength ); - } - else - { - // throw an error here - } - } - - // destructor - virtual ~WaveletFilter() - { - if( lowDecomposeFilter ) delete[] lowDecomposeFilter; - if( highDecomposeFilter ) delete[] highDecomposeFilter; - if( lowReconstructFilter ) delete[] lowReconstructFilter; - if( highReconstructFilter ) delete[] highReconstructFilter; - } - - vtkm::Id GetFilterLength() { return this->filterLength; } - bool isSymmetric() { return this->symmetricity; } - - const vtkm::Float64* GetLowDecomposeFilter() const - { - return lowDecomposeFilter; - } - const vtkm::Float64* GetHighDecomposeFilter() const - { - return highDecomposeFilter; - } - const vtkm::Float64* GetLowReconstructFilter() const - { - return lowReconstructFilter; - } - const vtkm::Float64* GetHighReconstructFilter() const - { - return highReconstructFilter; - } -protected: - bool symmetricity; - vtkm::Id filterLength; - vtkm::Float64* lowDecomposeFilter; - vtkm::Float64* highDecomposeFilter; - vtkm::Float64* lowReconstructFilter; - vtkm::Float64* highReconstructFilter; - - void AllocateFilterMemory() - { - lowDecomposeFilter = new vtkm::Float64[ this->filterLength ]; - highDecomposeFilter = new vtkm::Float64[ this->filterLength ]; - lowReconstructFilter = new vtkm::Float64[ this->filterLength ]; - highReconstructFilter = new vtkm::Float64[ this->filterLength ]; - } - - // Flipping operation; helper function to initialize a filter. - void wrev( const vtkm::Float64* sigIn, vtkm::Float64* sigOut, vtkm::Id sigLength ) - { - for( vtkm::Id count = 0; count < sigLength; count++) - sigOut[count] = sigIn[sigLength - count - 1]; - } - - // Quadrature mirror filtering operation: helper function to initialize a filter. - void qmf_even ( const vtkm::Float64* sigIn, vtkm::Float64* sigOut, vtkm::Id sigLength ) - { - for (vtkm::Id count = 0; count < sigLength; count++) - { - sigOut[count] = sigIn[sigLength - count - 1]; - - if (sigLength % 2 == 0) { - if (count % 2 != 0) - sigOut[count] = -1.0 * sigOut[count]; - } - else { - if (count % 2 == 0) - sigOut[count] = -1.0 * sigOut[count]; - } - } - } - - // Flipping and QMF at the same time: helper function to initialize a filter. - void qmf_wrev ( const vtkm::Float64* sigIn, vtkm::Float64* sigOut, vtkm::Id sigLength ) - { - for (vtkm::Id count = 0; count < sigLength; count++) { - sigOut[count] = sigIn[sigLength - count - 1]; - - if (sigLength % 2 == 0) { - if (count % 2 != 0) - sigOut[count] = -1 * sigOut[count]; - } - else { - if (count % 2 == 0) - sigOut[count] = -1 * sigOut[count]; - } - } - - vtkm::Float64 tmp; - for (vtkm::Id count = 0; count < sigLength/2; count++) { - tmp = sigOut[count]; - sigOut[count] = sigOut[sigLength - count - 1]; - sigOut[sigLength - count - 1] = tmp; - } - } - - // Verbatim Copying: helper function to initialize a filter. - void verbatim_copy ( const vtkm::Float64* sigIn, vtkm::Float64* sigOut, vtkm::Id sigLength ) - { - for (vtkm::Id count = 0; count < sigLength; count++) - sigOut[count] = sigIn[count]; - } -}; // Finish class WaveletFilter. - -} // Finish namespace wavelet. - - -} // Finish namespace worlet -} // Finish namespace vtkm - -#endif