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