update copyright notice and renamed axis_iterator

This commit is contained in:
Hans Dembinski 2017-11-28 22:21:03 +01:00
parent f44ed7d709
commit 739625e531
32 changed files with 45 additions and 45 deletions

View File

@ -1,4 +1,4 @@
# Copyright Hans P. Dembinski 2016-2017
# Copyright Hans Dembinski 2016-2017
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
# Copyright (c) 2016-2017 Klemens D. Morgenstern, Hans P. Dembinski
# Copyright (c) 2016-2017 Klemens D. Morgenstern, Hans Dembinski
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
@ -93,7 +93,7 @@ public:
using types = typename base_type::types;
using value_type = double;
using bin_type = interval<double>;
using const_iterator = axis_iterator<any>;
using const_iterator = iterator_over<any>;
any() = default;
any(const any &t) = default;

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
@ -180,7 +180,7 @@ class regular : public axis_base_uoflow, Transform {
public:
using value_type = RealType;
using bin_type = interval<value_type>;
using const_iterator = axis_iterator<regular>;
using const_iterator = iterator_over<regular>;
/** Construct axis with n bins over real range [lower, upper).
*
@ -262,7 +262,7 @@ template <typename RealType> class circular : public axis_base {
public:
using value_type = RealType;
using bin_type = interval<value_type>;
using const_iterator = axis_iterator<circular>;
using const_iterator = iterator_over<circular>;
/** Constructor for n bins with an optional offset.
*
@ -326,7 +326,7 @@ template <typename RealType> class variable : public axis_base_uoflow {
public:
using value_type = RealType;
using bin_type = interval<value_type>;
using const_iterator = axis_iterator<variable>;
using const_iterator = iterator_over<variable>;
/** Construct an axis from bin edges.
*
@ -416,7 +416,7 @@ template <typename IntType> class integer : public axis_base_uoflow {
public:
using value_type = IntType;
using bin_type = interval<value_type>;
using const_iterator = axis_iterator<integer>;
using const_iterator = iterator_over<integer>;
/** Construct axis over a semi-open integer interval [lower, upper).
*
@ -487,7 +487,7 @@ template <typename T> class category : public axis_base {
public:
using value_type = T;
using bin_type = T;
using const_iterator = axis_iterator<category<T>>;
using const_iterator = iterator_over<category<T>>;
category() = default;
category(const category &rhs)

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
@ -15,25 +15,25 @@ namespace histogram {
namespace axis {
template <typename Axis>
class axis_iterator
: public iterator_facade<axis_iterator<Axis>,
class iterator_over
: public iterator_facade<iterator_over<Axis>,
std::pair<int, typename Axis::bin_type>,
random_access_traversal_tag,
std::pair<int, typename Axis::bin_type>> {
public:
explicit axis_iterator(const Axis &axis, int idx) : axis_(axis), idx_(idx) {}
explicit iterator_over(const Axis &axis, int idx) : axis_(axis), idx_(idx) {}
axis_iterator(const axis_iterator &) = default;
axis_iterator &operator=(const axis_iterator &) = default;
iterator_over(const iterator_over &) = default;
iterator_over &operator=(const iterator_over &) = default;
private:
void increment() noexcept { ++idx_; }
void decrement() noexcept { --idx_; }
void advance(int n) noexcept { idx_ += n; }
int distance_to(const axis_iterator &other) const noexcept {
int distance_to(const iterator_over &other) const noexcept {
return other.idx_ - idx_;
}
bool equal(const axis_iterator &other) const noexcept {
bool equal(const iterator_over &other) const noexcept {
return idx_ == other.idx_;
}
std::pair<int, typename Axis::bin_type> dereference() const {

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Demsizeki
// Copyright 2015-2017 Hans Demsizeki
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Hans Dembinski
// Copyright 2015-2017 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt