00001 /* Polyhedron::Status 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_Status_inlines_hh 00025 #define PPL_Status_inlines_hh 1 00026 00027 namespace Parma_Polyhedra_Library { 00028 00029 inline 00030 Polyhedron::Status::Status(flags_t mask) 00031 : flags(mask) { 00032 } 00033 00034 inline 00035 Polyhedron::Status::Status() 00036 : flags(ZERO_DIM_UNIV) { 00037 } 00038 00039 inline bool 00040 Polyhedron::Status::test_all(flags_t mask) const { 00041 return (flags & mask) == mask; 00042 } 00043 00044 inline bool 00045 Polyhedron::Status::test_any(flags_t mask) const { 00046 return flags & mask; 00047 } 00048 00049 inline void 00050 Polyhedron::Status::set(flags_t mask) { 00051 flags |= mask; 00052 } 00053 00054 inline void 00055 Polyhedron::Status::reset(flags_t mask) { 00056 flags &= ~mask; 00057 } 00058 00059 inline bool 00060 Polyhedron::Status::test_zero_dim_univ() const { 00061 return flags == ZERO_DIM_UNIV; 00062 } 00063 00064 inline void 00065 Polyhedron::Status::reset_zero_dim_univ() { 00066 // This is a no-op if the current status is not zero-dim. 00067 if (flags == ZERO_DIM_UNIV) 00068 // In the zero-dim space, if it is not the universe it is empty. 00069 flags = EMPTY; 00070 } 00071 00072 inline void 00073 Polyhedron::Status::set_zero_dim_univ() { 00074 // Zero-dim universe is incompatible with anything else. 00075 flags = ZERO_DIM_UNIV; 00076 } 00077 00078 inline bool 00079 Polyhedron::Status::test_empty() const { 00080 return test_any(EMPTY); 00081 } 00082 00083 inline void 00084 Polyhedron::Status::reset_empty() { 00085 reset(EMPTY); 00086 } 00087 00088 inline void 00089 Polyhedron::Status::set_empty() { 00090 flags = EMPTY; 00091 } 00092 00093 inline bool 00094 Polyhedron::Status::test_c_up_to_date() const { 00095 return test_any(C_UP_TO_DATE); 00096 } 00097 00098 inline void 00099 Polyhedron::Status::reset_c_up_to_date() { 00100 reset(C_UP_TO_DATE); 00101 } 00102 00103 inline void 00104 Polyhedron::Status::set_c_up_to_date() { 00105 set(C_UP_TO_DATE); 00106 } 00107 00108 inline bool 00109 Polyhedron::Status::test_g_up_to_date() const { 00110 return test_any(G_UP_TO_DATE); 00111 } 00112 00113 inline void 00114 Polyhedron::Status::reset_g_up_to_date() { 00115 reset(G_UP_TO_DATE); 00116 } 00117 00118 inline void 00119 Polyhedron::Status::set_g_up_to_date() { 00120 set(G_UP_TO_DATE); 00121 } 00122 00123 inline bool 00124 Polyhedron::Status::test_c_minimized() const { 00125 return test_any(C_MINIMIZED); 00126 } 00127 00128 inline void 00129 Polyhedron::Status::reset_c_minimized() { 00130 reset(C_MINIMIZED); 00131 } 00132 00133 inline void 00134 Polyhedron::Status::set_c_minimized() { 00135 set(C_MINIMIZED); 00136 } 00137 00138 inline bool 00139 Polyhedron::Status::test_g_minimized() const { 00140 return test_any(G_MINIMIZED); 00141 } 00142 00143 inline void 00144 Polyhedron::Status::reset_g_minimized() { 00145 reset(G_MINIMIZED); 00146 } 00147 00148 inline void 00149 Polyhedron::Status::set_g_minimized() { 00150 set(G_MINIMIZED); 00151 } 00152 00153 00154 inline bool 00155 Polyhedron::Status::test_c_pending() const { 00156 return test_any(CS_PENDING); 00157 } 00158 00159 inline void 00160 Polyhedron::Status::reset_c_pending() { 00161 reset(CS_PENDING); 00162 } 00163 00164 inline void 00165 Polyhedron::Status::set_c_pending() { 00166 set(CS_PENDING); 00167 } 00168 00169 inline bool 00170 Polyhedron::Status::test_g_pending() const { 00171 return test_any(GS_PENDING); 00172 } 00173 00174 inline void 00175 Polyhedron::Status::reset_g_pending() { 00176 reset(GS_PENDING); 00177 } 00178 00179 inline void 00180 Polyhedron::Status::set_g_pending() { 00181 set(GS_PENDING); 00182 } 00183 00184 00185 inline bool 00186 Polyhedron::Status::test_sat_c_up_to_date() const { 00187 return test_any(SAT_C_UP_TO_DATE); 00188 } 00189 00190 inline void 00191 Polyhedron::Status::reset_sat_c_up_to_date() { 00192 reset(SAT_C_UP_TO_DATE); 00193 } 00194 00195 inline void 00196 Polyhedron::Status::set_sat_c_up_to_date() { 00197 set(SAT_C_UP_TO_DATE); 00198 } 00199 00200 inline bool 00201 Polyhedron::Status::test_sat_g_up_to_date() const { 00202 return test_any(SAT_G_UP_TO_DATE); 00203 } 00204 00205 inline void 00206 Polyhedron::Status::reset_sat_g_up_to_date() { 00207 reset(SAT_G_UP_TO_DATE); 00208 } 00209 00210 inline void 00211 Polyhedron::Status::set_sat_g_up_to_date() { 00212 set(SAT_G_UP_TO_DATE); 00213 } 00214 00215 } // namespace Parma_Polyhedra_Library 00216 00217 #endif // !defined(PPL_Status_inlines_hh)
1.6.3