[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/boostorg/geometry/develop/test/algorithms/maximum_gap.cpp [Back]  [Original]

// Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test

// Copyright (c) 2015, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html

#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_maximum_gap
#endif

#include 

#include 

#include 
#include 
#include 

#include 

namespace bg = boost::geometry;

class uint_interval
{
public:
    typedef unsigned value_type;
    typedef int difference_type;

    uint_interval(unsigned left, unsigned right)
        : m_left(left)
        , m_right(right)
    {}

    template 
    value_type get() const
    {
        return (Index == 0) ? m_left : m_right;
    }

    difference_type length() const
    {
        return static_cast(m_right) - static_cast(m_left);
    }

private:
    unsigned m_left, m_right;
};

struct uint_intervals
    : public std::vector
{
    uint_intervals()
    {}

    uint_intervals(unsigned left, unsigned right)
    {
        this->push_back(uint_interval(left, right));
    }

    uint_intervals & operator()(unsigned left, unsigned right)
    {
        this->push_back(uint_interval(left, right));
        return *this;
    }
};

std::ostream& operator

Web Proxy Viewer  |  New URL  |  Original Page