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(dimension_type num_dimensions,
00033 Degenerate_Element kind)
00034 : Polyhedron(NECESSARILY_CLOSED,
00035 num_dimensions <= max_space_dimension()
00036 ? num_dimensions
00037 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00038 "C_Polyhedron(n, k)",
00039 "n exceeds the maximum "
00040 "allowed space dimension"),
00041 num_dimensions),
00042 kind) {
00043 }
00044
00045 inline
00046 C_Polyhedron::C_Polyhedron(const Constraint_System& cs)
00047 : Polyhedron(NECESSARILY_CLOSED,
00048 cs.space_dimension() <= max_space_dimension()
00049 ? cs
00050 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00051 "C_Polyhedron(cs)",
00052 "the space dimension of cs "
00053 "exceeds the maximum allowed "
00054 "space dimension"), cs)) {
00055 }
00056
00057 inline
00058 C_Polyhedron::C_Polyhedron(Constraint_System& cs)
00059 : Polyhedron(NECESSARILY_CLOSED,
00060 cs.space_dimension() <= max_space_dimension()
00061 ? cs
00062 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00063 "C_Polyhedron(cs)",
00064 "the space dimension of cs "
00065 "exceeds the maximum allowed "
00066 "space dimension"), cs)) {
00067 }
00068
00069 inline
00070 C_Polyhedron::C_Polyhedron(const Generator_System& gs)
00071 : Polyhedron(NECESSARILY_CLOSED,
00072 gs.space_dimension() <= max_space_dimension()
00073 ? gs
00074 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00075 "C_Polyhedron(cs)",
00076 "the space dimension of gs "
00077 "exceeds the maximum allowed "
00078 "space dimension"), gs)){
00079 }
00080
00081 inline
00082 C_Polyhedron::C_Polyhedron(Generator_System& gs)
00083 : Polyhedron(NECESSARILY_CLOSED,
00084 gs.space_dimension() <= max_space_dimension()
00085 ? gs
00086 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00087 "C_Polyhedron(cs)",
00088 "the space dimension of gs "
00089 "exceeds the maximum allowed "
00090 "space dimension"), gs)){
00091 }
00092
00093 template <typename Box>
00094 inline
00095 C_Polyhedron::C_Polyhedron(const Box& box, From_Bounding_Box)
00096 : Polyhedron(NECESSARILY_CLOSED,
00097 box.space_dimension() <= max_space_dimension()
00098 ? box
00099 : (throw_space_dimension_overflow(NECESSARILY_CLOSED,
00100 "C_Polyhedron(box): ",
00101 "the space dimension of box "
00102 "exceeds the maximum allowed "
00103 "space dimension"), box)) {
00104 }
00105
00106 inline
00107 C_Polyhedron::C_Polyhedron(const C_Polyhedron& y)
00108 : Polyhedron(y) {
00109 }
00110
00111 inline C_Polyhedron&
00112 C_Polyhedron::operator=(const C_Polyhedron& y) {
00113 Polyhedron::operator=(y);
00114 return *this;
00115 }
00116
00117 inline C_Polyhedron&
00118 C_Polyhedron::operator=(const NNC_Polyhedron& y) {
00119 C_Polyhedron c_y(y);
00120 swap(c_y);
00121 return *this;
00122 }
00123
00124 inline
00125 C_Polyhedron::~C_Polyhedron() {
00126 }
00127
00128 inline bool
00129 C_Polyhedron::upper_bound_assign_if_exact(const C_Polyhedron& y) {
00130 return poly_hull_assign_if_exact(y);
00131 }
00132
00133 }
00134
00135 #endif // !defined(PPL_C_Polyhedron_inlines_hh)