PPL  0.12.1
Poly_Con_Relation.inlines.hh
Go to the documentation of this file.
00001 /* Poly_Con_Relation class implementation: inline functions.
00002    Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
00003    Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com)
00004 
00005 This file is part of the Parma Polyhedra Library (PPL).
00006 
00007 The PPL is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 The PPL is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software Foundation,
00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
00020 
00021 For the most up-to-date information see the Parma Polyhedra Library
00022 site: http://bugseng.com/products/ppl/ . */
00023 
00024 #ifndef PPL_Poly_Con_Relation_inlines_hh
00025 #define PPL_Poly_Con_Relation_inlines_hh 1
00026 
00027 namespace Parma_Polyhedra_Library {
00028 
00029 inline
00030 Poly_Con_Relation::Poly_Con_Relation(flags_t mask)
00031   : flags(mask) {
00032 }
00033 
00034 inline Poly_Con_Relation::flags_t
00035 Poly_Con_Relation::get_flags() const {
00036   return flags;
00037 }
00038 
00039 inline Poly_Con_Relation
00040 Poly_Con_Relation::nothing() {
00041   return Poly_Con_Relation(NOTHING);
00042 }
00043 
00044 inline Poly_Con_Relation
00045 Poly_Con_Relation::is_disjoint() {
00046   return Poly_Con_Relation(IS_DISJOINT);
00047 }
00048 
00049 inline Poly_Con_Relation
00050 Poly_Con_Relation::strictly_intersects() {
00051   return Poly_Con_Relation(STRICTLY_INTERSECTS);
00052 }
00053 
00054 inline Poly_Con_Relation
00055 Poly_Con_Relation::is_included() {
00056   return Poly_Con_Relation(IS_INCLUDED);
00057 }
00058 
00059 inline Poly_Con_Relation
00060 Poly_Con_Relation::saturates() {
00061   return Poly_Con_Relation(SATURATES);
00062 }
00063 
00064 inline bool
00065 Poly_Con_Relation::implies(flags_t x, flags_t y) {
00066   return (x & y) == y;
00067 }
00068 
00069 inline bool
00070 Poly_Con_Relation::implies(const Poly_Con_Relation& y) const {
00071   return implies(flags, y.flags);
00072 }
00073 
00075 inline bool
00076 operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
00077   return x.flags == y.flags;
00078 }
00079 
00081 inline bool
00082 operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
00083   return x.flags != y.flags;
00084 }
00085 
00087 inline Poly_Con_Relation
00088 operator&&(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
00089   return Poly_Con_Relation(x.flags | y.flags);
00090 }
00091 
00093 inline Poly_Con_Relation
00094 operator-(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
00095   return Poly_Con_Relation(x.flags & ~y.flags);
00096 }
00097 
00098 } // namespace Parma_Polyhedra_Library
00099 
00100 #endif // !defined(PPL_Poly_Con_Relation_inlines_hh)