00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <ppl-config.h>
00024
00025 #include "NNC_Polyhedron.defs.hh"
00026 #include "C_Polyhedron.defs.hh"
00027 #include "Grid.defs.hh"
00028 #include "algorithms.hh"
00029
00030 namespace PPL = Parma_Polyhedra_Library;
00031
00032 PPL::NNC_Polyhedron::NNC_Polyhedron(const C_Polyhedron& y, Complexity_Class)
00033 : Polyhedron(NOT_NECESSARILY_CLOSED, y.space_dimension(), UNIVERSE) {
00034 add_constraints(y.constraints());
00035 assert(OK());
00036 }
00037
00038 PPL::NNC_Polyhedron::NNC_Polyhedron(const Congruence_System& cgs)
00039 : Polyhedron(NOT_NECESSARILY_CLOSED,
00040 cgs.space_dimension() <= max_space_dimension()
00041 ? cgs.space_dimension()
00042 : (throw_space_dimension_overflow(NOT_NECESSARILY_CLOSED,
00043 "NNC_Polyhedron(cgs)",
00044 "the space dimension of cgs "
00045 "exceeds the maximum allowed "
00046 "space dimension"), 0),
00047 UNIVERSE) {
00048 add_congruences(cgs);
00049 assert(OK());
00050 }
00051
00052 PPL::NNC_Polyhedron::NNC_Polyhedron(Congruence_System& cgs, Recycle_Input)
00053 : Polyhedron(NOT_NECESSARILY_CLOSED,
00054 cgs.space_dimension() <= max_space_dimension()
00055 ? cgs.space_dimension()
00056 : (throw_space_dimension_overflow(NOT_NECESSARILY_CLOSED,
00057 "NNC_Polyhedron"
00058 "(cgs, recycle)",
00059 "the space dimension of cgs "
00060 "exceeds the maximum allowed "
00061 "space dimension"), 0),
00062 UNIVERSE) {
00063 add_congruences(cgs);
00064 assert(OK());
00065 }
00066
00067 PPL::NNC_Polyhedron::NNC_Polyhedron(const Grid& grid, Complexity_Class)
00068 : Polyhedron(NOT_NECESSARILY_CLOSED,
00069 grid.space_dimension() <= max_space_dimension()
00070 ? grid.space_dimension()
00071 : (throw_space_dimension_overflow(NOT_NECESSARILY_CLOSED,
00072 "C_Polyhedron(grid)",
00073 "the space dimension of grid "
00074 "exceeds the maximum allowed "
00075 "space dimension"), 0),
00076 UNIVERSE) {
00077 add_constraints(grid.constraints());
00078 }
00079
00080 bool
00081 PPL::NNC_Polyhedron::poly_hull_assign_if_exact(const NNC_Polyhedron& y) {
00082 return PPL::poly_hull_assign_if_exact(*this, y);
00083 }