Skip to content
Snippets Groups Projects
Select Git revision
  • 2559ed60b0725b4304eb7ccac26aea7cb82cca9c
  • master default protected
  • enxhi_issue460_remove_TOAR-I_access
  • michael_issue459_preprocess_german_stations
  • sh_pollutants
  • develop protected
  • release_v2.4.0
  • michael_issue450_feat_load-ifs-data
  • lukas_issue457_feat_set-config-paths-as-parameter
  • lukas_issue454_feat_use-toar-statistics-api-v2
  • lukas_issue453_refac_advanced-retry-strategy
  • lukas_issue452_bug_update-proj-version
  • lukas_issue449_refac_load-era5-data-from-toar-db
  • lukas_issue451_feat_robust-apriori-estimate-for-short-timeseries
  • lukas_issue448_feat_load-model-from-path
  • lukas_issue447_feat_store-and-load-local-clim-apriori-data
  • lukas_issue445_feat_data-insight-plot-monthly-distribution
  • lukas_issue442_feat_bias-free-evaluation
  • lukas_issue444_feat_choose-interp-method-cams
  • 414-include-crps-analysis-and-other-ens-verif-methods-or-plots
  • lukas_issue384_feat_aqw-data-handler
  • v2.4.0 protected
  • v2.3.0 protected
  • v2.2.0 protected
  • v2.1.0 protected
  • Kleinert_etal_2022_initial_submission
  • v2.0.0 protected
  • v1.5.0 protected
  • v1.4.0 protected
  • v1.3.0 protected
  • v1.2.1 protected
  • v1.2.0 protected
  • v1.1.0 protected
  • IntelliO3-ts-v1.0_R1-submit
  • v1.0.0 protected
  • v0.12.2 protected
  • v0.12.1 protected
  • v0.12.0 protected
  • v0.11.0 protected
  • v0.10.0 protected
  • IntelliO3-ts-v1.0_initial-submit
41 results

test_partition_check.py

Blame
  • gen_bit_ops.hpp 3.75 KiB
    /*
    
       Copyright (C) 2019-2020, Forschungszentrum Juelich
    
       Author(s): Bine Brank, b.brank@fz-juelich.de
    
       Redistribution and use in source and binary forms, with or without
       modification, are permitted provided that the following conditions are
       met:
        - Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
        - Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
        - Neither the name(s) of the copyright holder(s) nor the names of its
          contributors may be used to endorse or promote products derived
          from this software without specific prior written permission.
    
       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
       A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
       HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
       OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
    */
    
    #ifndef GEN_BIT_OPS_HPP
    #define GEN_BIT_OPS_HPP
    
    
    #include "gen_bitwise.hpp"
    
    
    #define VECTOR_FOR(i, w, inc) \
    for (unsigned int i = 0; i < w; i += inc)
    
    // bitwise and two vectors
    struct bitwise_and_vector_vector{
      template <typename T>
      inline vector_t<T> operator()(const vector_t<T> &a, const vector_t<T> &b)
      {
        assert(a.size == b.size);
    
        vector_t<T> vres(a.size);
    
        std::cout << "[Generic vector (bitwise and) used]" << endl;
    
        VECTOR_FOR(i, vres.size, 1)
        {
          vres.elem[i] = a.elem[i] & b.elem[i];
        }
      	return vres;
      }
    };
    
    // bitwise or two vectors
    struct bitwise_or_vector_vector{
      template <typename T>
      inline vector_t<T> operator()(const vector_t<T> &a, const vector_t<T> &b)
      {
        assert(a.size == b.size);
    
        vector_t<T> vres(a.size);
    
        std::cout << "[Generic vector (bitwise or) used]" << endl;
    
        VECTOR_FOR(i, vres.size, 1)
        {
          vres.elem[i] = a.elem[i] | b.elem[i];
        }
      	return vres;
      }
    };
    
    // bitwise xor two vectors
    struct bitwise_xor_vector_vector{
      template <typename T>
      inline vector_t<T> operator()(const vector_t<T> &a, const vector_t<T> &b)
      {
        assert(a.size == b.size);
    
        vector_t<T> vres(a.size);
    
        std::cout << "[Generic vector (bitwise xor) used]" << endl;
    
        VECTOR_FOR(i, vres.size, 1)
        {
          vres.elem[i] = a.elem[i] ^ b.elem[i];
        }
      	return vres;
      }
    };
    
    // bitwise not two vectors
    struct bitwise_not_vector_vector{
      template <typename T>
      inline vector_t<T> operator()(const vector_t<T> &a, const vector_t<T> &b)
      {
        assert(a.size == b.size);
    
        vector_t<T> vres(a.size);
    
        std::cout << "[Generic vector (bitwise not) used]" << endl;
    
        VECTOR_FOR(i, vres.size, 1)
        {
          vres.elem[i] = a.elem[i] ~ b.elem[i];
        }
      	return vres;
      }
    };
    
    // bitwise logical shift left two vectors
    struct bitwise_logical_shift_left_vector_vector{ template <typename T>
      inline vector_t<T> operator()(const vector_t<T> &a, const int &b)
      {
        assert(a.size == b.size);
    
        vector_t<T> vres(a.size);
    
        std::cout << "[Generic vector (bitwise not) used]" << endl;
    
        VECTOR_FOR(i, vres.size, 1)
        {
          vres.elem[i] = a.elem[i] << b;
        }
      	return vres;
      }
    };
    
    
    
    
    #endif // GEN_BIT_OPS_HPP