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