00001 /* Poly_Gen_Relation class implementation: inline functions. 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2011 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://www.cs.unipr.it/ppl/ . */ 00023 00024 #ifndef PPL_Poly_Gen_Relation_inlines_hh 00025 #define PPL_Poly_Gen_Relation_inlines_hh 1 00026 00027 namespace Parma_Polyhedra_Library { 00028 00029 inline 00030 Poly_Gen_Relation::Poly_Gen_Relation(flags_t mask) 00031 : flags(mask) { 00032 } 00033 00034 inline Poly_Gen_Relation::flags_t 00035 Poly_Gen_Relation::get_flags() const { 00036 return flags; 00037 } 00038 00039 inline Poly_Gen_Relation 00040 Poly_Gen_Relation::nothing() { 00041 return Poly_Gen_Relation(NOTHING); 00042 } 00043 00044 inline Poly_Gen_Relation 00045 Poly_Gen_Relation::subsumes() { 00046 return Poly_Gen_Relation(SUBSUMES); 00047 } 00048 00049 inline bool 00050 Poly_Gen_Relation::implies(flags_t x, flags_t y) { 00051 return (x & y) == y; 00052 } 00053 00054 inline bool 00055 Poly_Gen_Relation::implies(const Poly_Gen_Relation& y) const { 00056 return implies(flags, y.flags); 00057 } 00058 00060 inline bool 00061 operator==(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) { 00062 return x.flags == y.flags; 00063 } 00064 00066 inline bool 00067 operator!=(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) { 00068 return x.flags != y.flags; 00069 } 00070 00072 inline Poly_Gen_Relation 00073 operator&&(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) { 00074 return Poly_Gen_Relation(x.flags | y.flags); 00075 } 00076 00078 inline Poly_Gen_Relation 00079 operator-(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) { 00080 return Poly_Gen_Relation(x.flags & ~y.flags); 00081 } 00082 00083 } // namespace Parma_Polyhedra_Library 00084 00085 #endif // !defined(PPL_Poly_Gen_Relation_inlines_hh)
1.6.3