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