LCOV - code coverage report
Current view: top level - Tools - DerivativeFilter.cpp (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 12 12 100.0 %
Date: 2021-02-18 20:07:22 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /**
       2             :  * \file DerivativeFilter.cpp
       3             :  */
       4             : 
       5             : #include "DerivativeFilter.h"
       6             : 
       7             : #include <cassert>
       8             : #include <cmath>
       9             : #include <complex>
      10             : #include <cstdint>
      11             : 
      12             : namespace ATK
      13             : {
      14             :   template<typename DataType_>
      15           1 :   DerivativeFilter<DataType_>::DerivativeFilter(gsl::index nb_channels)
      16           1 :   :Parent(nb_channels, nb_channels)
      17             :   {
      18           1 :     input_delay = 1;
      19           1 :   }
      20             : 
      21             :   template<typename DataType_>
      22           1 :   void DerivativeFilter<DataType_>::process_impl(gsl::index size) const
      23             :   {
      24           1 :     assert(nb_input_ports == nb_output_ports);
      25             : 
      26           2 :     for(gsl::index channel = 0; channel < nb_input_ports; ++channel)
      27             :     {
      28           1 :       const DataType* ATK_RESTRICT input = converted_inputs[channel];
      29           1 :       DataType* ATK_RESTRICT output = outputs[channel];
      30        1001 :       for(gsl::index i = 0; i < size; ++i)
      31             :       {
      32        1000 :         output[i] = input[i] - input[i-1];
      33             :       }
      34             :     }
      35           1 :   }
      36             : 
      37             : #if ATK_ENABLE_INSTANTIATION
      38             :   template class DerivativeFilter<std::int16_t>;
      39             :   template class DerivativeFilter<std::int32_t>;
      40             :   template class DerivativeFilter<std::int64_t>;
      41             :   template class DerivativeFilter<float>;
      42             :   template class DerivativeFilter<std::complex<float>>;
      43             :   template class DerivativeFilter<std::complex<double>>;
      44             : #endif
      45             :   template class DerivativeFilter<double>;
      46             : }

Generated by: LCOV version TK-3.3.0-4-gdba42eea