Skip to content
Snippets Groups Projects
Select Git revision
  • d8e81c08d8406bf46b0f525ec4209b5c31959be1
  • master default
  • library-names
  • fix_script_header
  • fix_libdir
  • fix_cmake_hdf5
  • partition
  • cgnsUnstructured
  • partitioning
  • HighOrderBLCurving
  • gmsh_3_0_5
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
30 results

VERSIONS

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    Range.h 1.08 KiB
    // Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    #ifndef RANGE_H
    #define RANGE_H
    
    // represents a range of values of the template type
    template <class T> class Range {
    private:
      T Low;
      T High;
    
    public:
      Range() {}
      Range(const T &low, const T &high) : Low(low), High(high) {}
      T low() const { return Low; }
      void low(const T &low) { Low = low; }
      T high() const { return High; }
      void high(const T &high) { High = high; }
      int contains(const T &value) const;
      int contains(const Range<T> &range) const;
      int operator==(const Range<T> &range) const;
    };
    
    template <class T> int Range<T>::contains(const T &value) const
    {
      return ((value >= Low) && (value <= High));
    }
    
    template <class T> int Range<T>::contains(const Range<T> &range) const
    {
      return ((range.low() >= Low) && (range.high() <= High));
    }
    
    template <class T> int Range<T>::operator==(const Range<T> &range) const
    {
      return ((range.low() == Low) && (range.high() == High));
    }
    
    #endif