interval.h revision 7bda77e763c0af49270427593108b66455dfd125
2N/A * \brief Simple closed interval class 2N/A * Copyright 2007 Michael Sloan <mgsloan@gmail.com> 2N/A * Lauris Kaplinski <lauris@kaplinski.com> 2N/A * Nathan Hurst <njh@mail.csse.monash.edu.au> 2N/A * bulia byak <buliabyak@users.sf.net> 2N/A * MenTaLguY <mental@rydia.net> 2N/A * This library is free software; you can redistribute it and/or 2N/A * modify it either under the terms of the GNU Lesser General Public 2N/A * License version 2.1 as published by the Free Software Foundation 2N/A * (the "LGPL") or, at your option, under the terms of the Mozilla 2N/A * Public License Version 1.1 (the "MPL"). If you do not alter this 2N/A * notice, a recipient may use your version of this file under either 2N/A * the MPL or the LGPL. 2N/A * You should have received a copy of the LGPL along with this library 2N/A * in the file COPYING-LGPL-2.1; if not, output to the Free Software 2N/A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 2N/A * You should have received a copy of the MPL along with this library 2N/A * in the file COPYING-MPL-1.1 2N/A * The contents of this file are subject to the Mozilla Public License 2N/A * Version 1.1 (the "License"); you may not use this file except in 2N/A * compliance with the License. You may obtain a copy of the License at 2N/A * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY 2N/A * OF ANY KIND, either express or implied. See the LGPL or the MPL for 2N/A * the specific language governing rights and limitations. 2N/A * @brief Range of real numbers that is never empty. 2N/A * Intervals are closed ranges \f$[a, b]\f$, which means they include their endpoints. 2N/A * To use them as open ranges, you can use the interiorContains() methods. 2N/A * @ingroup Primitives 2N/A /// @name Create intervals. 2N/A /** @brief Create an interval that contains only zero. */ 2N/A /** @brief Create an interval that contains a single point. */ 2N/A /** @brief Create an interval that contains all points between @c u and @c v. */ 2N/A /** @brief Convert from integer interval */ 2N/A /** @brief Create an interval containing a range of values. 2N/A * The resulting interval will contain all values from the given range. 2N/A * The return type of iterators must be convertible to Coord. The given range 2N/A * must not be empty. For potentially empty ranges, see OptInterval. 2N/A * @param start Beginning of the range 2N/A * @param end End of the range 2N/A * @return Interval that contains all values from [start, end). */ 2N/A /** @brief Create an interval from a C-style array of values it should contain. */ /// @name Inspect endpoints. /** @brief Access endpoints by value. * @deprecated Use min() and max() instead */ /** @brief Access endpoints by reference. * @deprecated Use min() and max() instead * @todo Remove Interval index operator, which can be used to break the invariant */ /// @name Test coordinates and other intervals for inclusion. /** @brief Check whether the interior of the interval includes this number. * Interior means all numbers in the interval except its ends. */ /** @brief Check whether the interior of the interval includes the given interval. * Interior means all numbers in the interval except its ends. */ /** @brief Check whether the interiors of the intervals have any common elements. */ /** @brief Scale an interval */ /** @brief Scale an interval by the inverse of the specified value */ /** @brief Multiply two intervals. * Product is defined as the set of points that can be obtained by multiplying * any value from the second operand by any value from the first operand: * \f$S = \{x \in A, y \in B: x * y\}\f$ */ // TODO implement properly /// @name Rounding to integer values /** @brief Return the smallest integer interval which contains this one. */ /** @brief Return the largest integer interval which is contained in this one. */ * @brief Range of real numbers that can be empty. /// @name Create optionally empty intervals. /** @brief Create an empty interval. */ /** @brief Wrap an existing interval. */ /** @brief Create an interval containing a single point. */ /** @brief Create an interval containing a range of numbers. */ /** @brief Promote from IntInterval. */ /** @brief Promote from OptIntInterval. */ // functions required for Python bindings c-file-style:"stroustrup" c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :