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_C_Polyhedron_inlines_hh
00024 #define PPL_C_Polyhedron_inlines_hh 1
00025
00026 #include <algorithm>
00027 #include <stdexcept>
00028
00029 namespace Parma_Polyhedra_Library {
00030
00031 inline
00032 C_Polyhedron::~C_Polyhedron() {
00033 }
00034
00035 inline
00036 C_Polyhedron::C_Polyhedron(dimension_type num_dimensions,
00037 Degenerate_Element kind)
00038 : Polyhedron(NECESSARILY_CLOSED,
00039 num_dimensions <= max_space_dimension()
00040 ? num_dimensions
00041 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00042 "C_Polyhedron(n, k)",
00043 "n exceeds the maximum "
00044 "allowed space dimension"),
00045 num_dimensions),
00046 kind) {
00047 }
00048
00049 inline
00050 C_Polyhedron::C_Polyhedron(const Constraint_System& cs)
00051 : Polyhedron(NECESSARILY_CLOSED,
00052 cs.space_dimension() <= max_space_dimension()
00053 ? cs
00054 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00055 "C_Polyhedron(cs)",
00056 "the space dimension of cs "
00057 "exceeds the maximum allowed "
00058 "space dimension"), cs)) {
00059 }
00060
00061 inline
00062 C_Polyhedron::C_Polyhedron(Constraint_System& cs, Recycle_Input)
00063 : Polyhedron(NECESSARILY_CLOSED,
00064 cs.space_dimension() <= max_space_dimension()
00065 ? cs
00066 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00067 "C_Polyhedron(cs, recycle)",
00068 "the space dimension of cs "
00069 "exceeds the maximum allowed "
00070 "space dimension"), cs),
00071 Recycle_Input()) {
00072 }
00073
00074 inline
00075 C_Polyhedron::C_Polyhedron(const Generator_System& gs)
00076 : Polyhedron(NECESSARILY_CLOSED,
00077 gs.space_dimension() <= max_space_dimension()
00078 ? gs
00079 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00080 "C_Polyhedron(gs)",
00081 "the space dimension of gs "
00082 "exceeds the maximum allowed "
00083 "space dimension"), gs)) {
00084 }
00085
00086 inline
00087 C_Polyhedron::C_Polyhedron(Generator_System& gs, Recycle_Input)
00088 : Polyhedron(NECESSARILY_CLOSED,
00089 gs.space_dimension() <= max_space_dimension()
00090 ? gs
00091 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00092 "C_Polyhedron(gs, recycle)",
00093 "the space dimension of gs "
00094 "exceeds the maximum allowed "
00095 "space dimension"), gs),
00096 Recycle_Input()) {
00097 }
00098
00099 template <typename Interval>
00100 inline
00101 C_Polyhedron::C_Polyhedron(const Box<Interval>& box, Complexity_Class)
00102 : Polyhedron(NECESSARILY_CLOSED,
00103 box.space_dimension() <= max_space_dimension()
00104 ? box
00105 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00106 "C_Polyhedron(box): ",
00107 "the space dimension of box "
00108 "exceeds the maximum allowed "
00109 "space dimension"), box)) {
00110 }
00111
00112 template <typename U>
00113 inline
00114 C_Polyhedron::C_Polyhedron(const BD_Shape<U>& bd, Complexity_Class)
00115 : Polyhedron(NECESSARILY_CLOSED,
00116 bd.space_dimension() <= max_space_dimension()
00117 ? bd.space_dimension()
00118 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00119 "C_Polyhedron(bd): ",
00120 "the space dimension of bd "
00121 "exceeds the maximum allowed "
00122 "space dimension"), 0),
00123 UNIVERSE) {
00124 add_constraints(bd.constraints());
00125 }
00126
00127 template <typename U>
00128 inline
00129 C_Polyhedron::C_Polyhedron(const Octagonal_Shape<U>& os, Complexity_Class)
00130 : Polyhedron(NECESSARILY_CLOSED,
00131 os.space_dimension() <= max_space_dimension()
00132 ? os.space_dimension()
00133 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00134 "C_Polyhedron(os): ",
00135 "the space dimension of os "
00136 "exceeds the maximum allowed "
00137 "space dimension"), 0),
00138 UNIVERSE) {
00139 add_constraints(os.constraints());
00140 }
00141
00142 inline
00143 C_Polyhedron::C_Polyhedron(const C_Polyhedron& y, Complexity_Class)
00144 : Polyhedron(y) {
00145 }
00146
00147 inline C_Polyhedron&
00148 C_Polyhedron::operator=(const C_Polyhedron& y) {
00149 Polyhedron::operator=(y);
00150 return *this;
00151 }
00152
00153 inline C_Polyhedron&
00154 C_Polyhedron::operator=(const NNC_Polyhedron& y) {
00155 C_Polyhedron c_y(y);
00156 swap(c_y);
00157 return *this;
00158 }
00159
00160 inline bool
00161 C_Polyhedron::upper_bound_assign_if_exact(const C_Polyhedron& y) {
00162 return poly_hull_assign_if_exact(y);
00163 }
00164
00165 }
00166
00167 #endif // !defined(PPL_C_Polyhedron_inlines_hh)