00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PPL_Grid_Generator_inlines_hh
00024 #define PPL_Grid_Generator_inlines_hh 1
00025
00026 #include "Grid_Generator.defs.hh"
00027
00028 namespace Parma_Polyhedra_Library {
00029
00030 inline
00031 Grid_Generator::Grid_Generator(Generator g)
00032 : Generator(Generator::point()) {
00033 Generator::swap(g);
00034 }
00035
00036 inline dimension_type
00037 Grid_Generator::space_dimension() const {
00038 return Generator::space_dimension() - 1;
00039 }
00040
00041 inline Grid_Generator::Type
00042 Grid_Generator::type() const {
00043 switch (Generator::type()) {
00044 case Generator::POINT:
00045 return POINT;
00046 case Generator::RAY:
00047 return PARAMETER;
00048 case Generator::LINE:
00049 return LINE;
00050 case Generator::CLOSURE_POINT:
00051 default:
00052 assert(false);
00053 return POINT;
00054 }
00055 }
00056
00057 inline bool
00058 Grid_Generator::is_line() const {
00059 return Generator::is_line();
00060 }
00061
00062 inline bool
00063 Grid_Generator::is_parameter() const {
00064 return is_ray();
00065 }
00066
00067 inline bool
00068 Grid_Generator::is_line_or_parameter() const {
00069 return is_line_or_ray();
00070 }
00071
00072 inline bool
00073 Grid_Generator::is_point() const {
00074 return Generator::is_point();
00075 }
00076
00077 inline bool
00078 Grid_Generator::is_parameter_or_point() const {
00079 return is_ray_or_point_or_inequality();
00080 }
00081
00082 inline void
00083 Grid_Generator::set_is_line() {
00084 Generator::set_is_line();
00085 }
00086
00087 inline void
00088 Grid_Generator::set_is_parameter_or_point() {
00089 Generator::set_is_ray_or_point();
00090 }
00091
00092 inline Grid_Generator&
00093 Grid_Generator::operator=(const Grid_Generator& g) {
00094 Generator::operator=(g);
00095 return *this;
00096 }
00097
00098 inline Grid_Generator&
00099 Grid_Generator::operator=(const Generator& g) {
00100 Generator::operator=(g);
00101 return *this;
00102 }
00103
00104 inline void
00105 Grid_Generator::negate(dimension_type start, dimension_type end) {
00106 while (start <= end)
00107 neg_assign(operator[](start++));
00108 }
00109
00110 inline Coefficient&
00111 Grid_Generator::divisor() {
00112 if (is_line())
00113 throw_invalid_argument("divisor()", "*this is a line");
00114 if (is_line_or_parameter())
00115 return Generator::operator[](size() - 1);
00116 return Generator::operator[](0);
00117 }
00118
00119 inline Coefficient_traits::const_reference
00120 Grid_Generator::divisor() const {
00121 if (is_line())
00122 throw_invalid_argument("divisor()", "*this is a line");
00123 if (is_line_or_parameter())
00124 return Generator::operator[](size() - 1);
00125 return Generator::operator[](0);
00126 }
00127
00128 inline memory_size_type
00129 Grid_Generator::total_memory_in_bytes() const {
00130 return Generator::total_memory_in_bytes();
00131 }
00132
00133 inline memory_size_type
00134 Grid_Generator::external_memory_in_bytes() const {
00135 return Generator::external_memory_in_bytes();
00136 }
00137
00138 inline void
00139 Grid_Generator::strong_normalize() {
00140 Generator::strong_normalize();
00141 }
00142
00143 inline dimension_type
00144 Grid_Generator::size() const {
00145 return Generator::size();
00146 }
00147
00148 inline void
00149 Grid_Generator::swap(Grid_Generator& y) {
00150 Generator::swap(y);
00151 }
00152
00153 inline void
00154 Grid_Generator::ascii_dump(std::ostream& s) const {
00155 Generator::ascii_dump(s);
00156 }
00157
00158 inline bool
00159 Grid_Generator::ascii_load(std::istream& s) {
00160 return Generator::ascii_load(s);
00161 }
00162
00163 inline Coefficient&
00164 Grid_Generator::operator[](dimension_type k) {
00165 return Generator::operator[](k);
00166 }
00167
00168 inline Coefficient_traits::const_reference
00169 Grid_Generator::operator[](dimension_type k) const {
00170 return Generator::operator[](k);
00171 }
00172
00174 inline bool
00175 operator==(const Grid_Generator& x, const Grid_Generator& y) {
00176 return x.is_equivalent_to(y);
00177 }
00178
00180 inline bool
00181 operator!=(const Grid_Generator& x, const Grid_Generator& y) {
00182 return !(x == y);
00183 }
00184
00186 inline Grid_Generator
00187 grid_line(const Linear_Expression& e) {
00188 return Grid_Generator::line(e);
00189 }
00190
00192 inline Grid_Generator
00193 parameter(const Linear_Expression& e,
00194 Coefficient_traits::const_reference d) {
00195 return Grid_Generator::parameter(e, d);
00196 }
00197
00199 inline Grid_Generator
00200 grid_point(const Linear_Expression& e,
00201 Coefficient_traits::const_reference d) {
00202 return Grid_Generator::point(e, d);
00203 }
00204
00205 }
00206
00207 namespace std {
00208
00210 inline void
00211 swap(Parma_Polyhedra_Library::Grid_Generator& x,
00212 Parma_Polyhedra_Library::Grid_Generator& y) {
00213 x.swap(y);
00214 }
00215
00216 }
00217
00218 #endif // !defined(PPL_Grid_Generator_inlines_hh)