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