diff --git a/src/amuse_simplex/Makefile b/src/amuse_simplex/Makefile index bf72b7808d..bf52058d03 100644 --- a/src/amuse_simplex/Makefile +++ b/src/amuse_simplex/Makefile @@ -1,84 +1,76 @@ -# standard amuse configuration include -# config.mk will be made after ./configure has run -ifeq ($(origin AMUSE_DIR), undefined) - AMUSE_DIR := $(shell amusifier --get-amuse-dir) +ifneq (,$(filter-out clean distclean, $(MAKECMDGOALS))) +include support/config.mk endif --include $(AMUSE_DIR)/config.mk -MPICXX ?= mpicxx -export MPICXX +# Detecting dependencies +support/config.mk: + cd support && ./configure -SRCDIR = src -OBJDIR = $(SRCDIR)/obj -APP = $(SRCDIR)/bin/SimpleX -PLUGINS = $(SRCDIR)/plugins -OBJS = $(OBJDIR)/amuse_interface.o $(OBJDIR)/SimpleX.o \ - $(OBJDIR)/Structs.o $(OBJDIR)/rates.o $(OBJDIR)/Common.o $(OBJDIR)/h5w_serial.o \ - $(OBJDIR)/keyValue.o $(OBJDIR)/tree_structures.o $(OBJDIR)/hilbert.o +# Building the code into a static library +DEPFLAGS += $(GSL_FLAGS) $(HDF5_CFLAGS) $(HEALPIX_CXX_CFLAGS) $(QHULL_FLAGS) -GLOBJS = $(OBJDIR)/amuse_interface_gl.o +CFLAGS += $(DEPFLAGS) -HEALPIX_PATH = $(PLUGINS)/HEALPix/ -QHULL_PATH = $(PLUGINS)/qhull-2012.1/ +LDFLAGS += $(HDF5_LDFLAGS) -HDF5_FLAGS ?= -I$(HDF5_PATH)/include -HDF5_LIBS ?= -L$(HDF5_PATH)/lib -lhdf5 -lz +LDLIBS += $(GSL_LIBS) $(HDF5_LIBS) $(HEALPIX_CXX_LIBS) $(QHULL_LIBS) -GSL_PATH = /usr/local/scisoft +CODELIB = libsimplex.a -# here we use ?= to allow amuse configure to override these -# variables -GSL_FLAGS ?= -I$(GSL_PATH)/include -GSL_LIBS ?= -L$(GSL_PATH)/lib -lgsl -lgslcblas +CODEOBJS = amuse_interface.o SimpleX.o Structs.o rates.o Common.o h5w_serial.o +CODEOBJS += keyValue.o tree_structures.o hilbert.o +CODEOBJS := $(patsubst %,src/obj/%,$(CODEOBJS)) -LIBS = $(HDF5_LIBS) \ - $(GSL_LIBS) \ - -L$(QHULL_PATH)/lib -lqhullstatic \ - -L$(HEALPIX_PATH)/lib -lhealpix_cxx +.PHONY: $(CODELIB) +$(CODELIB): + $(MAKE) -C src amuse MPICXX=$(MPICXX) HDF5_FLAGS="$(HDF5_CFLAGS) $(HDF5_CPPFLAGS)" HDF5_LIBS="$(HDF5_LDFLAGS) $(HDF5_LIBS)" + $(AR) ruv $@ $(CODEOBJS) + $(RANLIB) $@ -GLINCLUDE = -I/usr/include/GL -I$(GL_PATH)/include/GL/ -GLLIB = -L$(GL_PATH)/lib -lf90GLU -lf90GL -lf90glut -lGLU -lGL -lglut #-lguide -GLLIBS= $(GLLIB) -lGL -lGLU -L/home/inti/libraries/freeglut-2.4.0/src/.libs -lglut \ --L/usr/X11R6/lib -lXaw -lXt -lXmu -lXi -lXext -lX11 -ltiff -all: compile simplex_worker +# Building the workers +simplex_worker.h: interface.py + amusifier --type=h interface.py SimpleXInterface -o $@ -compile: $(APP) +simplex_worker.cc: interface.py + amusifier --type=c interface.py SimpleXInterface -o $@ -$(APP): - cd $(SRCDIR) && $(MAKE) CC="$(CC) $(CFLAGS)" CXX="$(CXX) $(CXXFLAGS)" +simplex_worker.o: simplex_worker.cc simplex_worker.h + $(MPICXX) -c -o $@ $(CFLAGS) $< -clean: - $(RM) *.so *.o *.pyc worker.cc worker.h worker_gl.cc worker_gl.h - $(RM) worker_code.cc worker_code.h worker_code_gl.cc worker_code_gl.h - $(RM) simplex_worker simplex_worker_gl *~ - cd $(SRCDIR) && $(MAKE) clean +simplex_worker: simplex_worker.o $(CODELIB) + $(MPICXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) + + +# Which packages contain which workers? +amuse-simplex_contains: simplex_worker -distclean: clean - cd $(SRCDIR) && $(MAKE) veryclean - -worker_code.cc: interface.py - $(CODE_GENERATOR) --type=c $< SimpleXInterface -o $@ -worker_code.h: interface.py - $(CODE_GENERATOR) --type=h $< SimpleXInterface -o $@ +# Building and installing packages +develop-%: %_contains + support/shared/uninstall.sh $* + python -m pip install -e packages/$* -worker_code-gl.cc: interface.py - $(CODE_GENERATOR) --type=c $< GlSimpleXInterface -o $@ +install-%: %_contains + support/shared/uninstall.sh $* + python -m pip install packages/$* -worker_code-gl.h: interface.py - $(CODE_GENERATOR) --type=h $< GlSimpleXInterface -o $@ +package-%: %_contains + python3 -m pip install -vv --no-cache-dir --no-deps --no-build-isolation --prefix ${PREFIX} packages/$* -simplex_worker: worker_code.cc worker_code.h $(OBJS) - $(MPICXX) $(LDFLAGS) $< $(OBJS) -o $@ $(LIBS) +test-%: + cd packages/$* && pytest -#simplex_worker_gl: worker_code-gl.cc worker_code-gl.h $(OBJS) $(GLOBJS) -# $(MPICXX) $^ -o $@ $(LIBS) $(GLLIBS) -$(OBJDIR)/amuse_interface.o: $(SRCDIR)/src/amuse_interface.cpp $(SRCDIR)/src/amuse_interface.h - cd $(SRCDIR) && $(MAKE) amuse_interface - -$(OBJDIR)/amuse_interface_gl.o: $(SRCDIR)/src/amuse_interface_gl.cpp - cd $(SRCDIR) && $(MAKE) amuse_interface_gl +# Cleaning up +.PHONY: clean +clean: + $(MAKE) -C src clean + rm -rf *.o *worker* + +.PHONY: distclean +distclean: clean + rm -f support/config.mk support/config.log support/config.status + rm -rf support/autom4te.cache diff --git a/src/amuse_simplex/interface.py b/src/amuse_simplex/interface.py index 65d36b7265..5a568f1c02 100644 --- a/src/amuse_simplex/interface.py +++ b/src/amuse_simplex/interface.py @@ -5,26 +5,26 @@ from amuse.datamodel import Particles -class SimpleXInterface(CodeInterface, CommonCodeInterface, LiteratureReferencesMixIn, +class SimpleXInterface(CodeInterface, CommonCodeInterface, LiteratureReferencesMixIn, CodeWithDataDirectories): """ - SimpleX(2.5) is a method for radiative transfer on an unstructured Delaunay - grid. The grid samples the medium through which photons are transported in + SimpleX(2.5) is a method for radiative transfer on an unstructured Delaunay + grid. The grid samples the medium through which photons are transported in an optimal way for fast radiative transfer calculations. - + The relevant references are: .. [#] ADS:2011PhDT........13K (Kruip, C.J.H., Ph. D. thesis, University of Leiden (2011)) .. [#] ADS:2010PhDT........63P (Paardekooper, J.-P., Ph. D. thesis, University of Leiden (2010)) .. [#] ADS:2010A&A...515A..79P (Paardekooper, J.-P., Kruip, C.J.H., Icke, V. 2010, A&A, 515, A79 (SimpleX2)) .. [#] ADS:2006PhRvE..74b6704R (Ritzerveld, J., & Icke, V. 2006, Phys. Rev. E, 74, 26704 (SimpleX)) """ - include_headers=['worker_code.h'] - + include_headers=['simplex_worker.h'] + def __init__(self, **kwargs): CodeInterface.__init__(self, name_of_the_worker = "simplex_worker", **kwargs) LiteratureReferencesMixIn.__init__(self) CodeWithDataDirectories.__init__(self) - + @legacy_function def set_simplex_output_directory(): function = LegacyFunctionSpecification() @@ -32,13 +32,13 @@ def set_simplex_output_directory(): description = "Name of the output directory") function.result_type = 'int32' return function - + @legacy_function def set_simplex_data_directory(): """ Update the path to the SimpleX database. """ - function = LegacyFunctionSpecification() + function = LegacyFunctionSpecification() function.addParameter('data_directory', dtype='string', direction=function.IN, description = "Name of the SimpleX data directory") function.result_type = 'int32' @@ -49,13 +49,13 @@ def set_simplex_data_directory(): Directory does not exist """ return function - + @legacy_function def get_simplex_data_directory(): """ Retrieve the path to the SimpleX database currently used. """ - function = LegacyFunctionSpecification() + function = LegacyFunctionSpecification() function.addParameter('data_directory', dtype='string', direction=function.OUT, description = "Name of the SimpleX data directory") function.result_type = 'int32' @@ -66,7 +66,7 @@ def get_simplex_data_directory(): Could not retrieve value """ return function - + @legacy_function def commit_particles(): """ @@ -90,7 +90,7 @@ def recommit_particles(): function = LegacyFunctionSpecification() function.result_type = 'int32' return function - + @legacy_function def new_particle(): function = LegacyFunctionSpecification() @@ -101,7 +101,7 @@ def new_particle(): function.addParameter('metallicity', dtype='float64',direction=function.IN, default=0.0 ) function.result_type = 'int32' return function - + @legacy_function def delete_particle(): function = LegacyFunctionSpecification() @@ -109,7 +109,7 @@ def delete_particle(): function.addParameter('index_of_the_particle', dtype='int32', direction=function.IN) function.result_type = 'int32' return function - + @legacy_function def get_state(): function = LegacyFunctionSpecification() @@ -117,10 +117,10 @@ def get_state(): function.addParameter('index_of_the_particle', dtype='int32', direction=function.IN) for x in ['x','y','z','rho','flux','xion','u']: function.addParameter(x, dtype='float64', direction=function.OUT) - function.addParameter('metallicity', dtype='float64', direction=function.OUT) + function.addParameter('metallicity', dtype='float64', direction=function.OUT) function.result_type = 'int32' return function - + @legacy_function def get_position(): function = LegacyFunctionSpecification() @@ -138,7 +138,7 @@ def get_position(): particle could not be found """ return function - + @legacy_function def get_flux(): function = LegacyFunctionSpecification() @@ -155,7 +155,7 @@ def get_flux(): """ return function - + @legacy_function def get_mean_intensity(): function = LegacyFunctionSpecification() @@ -188,8 +188,8 @@ def get_diffuse_intensity(): particle could not be found """ return function - - + + @legacy_function def get_density(): function = LegacyFunctionSpecification() @@ -239,7 +239,7 @@ def get_dinternal_energy_dt(): """ return function - + @legacy_function def get_ionisation(): function = LegacyFunctionSpecification() @@ -272,7 +272,7 @@ def get_metallicity(): particle could not be found """ return function - + @legacy_function def set_state(): function = LegacyFunctionSpecification() @@ -280,10 +280,10 @@ def set_state(): function.addParameter('index_of_the_particle', dtype='int32', direction=function.IN) for x in ['x','y','z','rho','flux','xion','u']: function.addParameter(x, dtype='float64', direction=function.IN) - function.addParameter('metallicity',dtype='float64',direction=function.IN,default=0.0) + function.addParameter('metallicity',dtype='float64',direction=function.IN,default=0.0) function.result_type = 'int32' return function - + @legacy_function def set_position(): function = LegacyFunctionSpecification() @@ -301,7 +301,7 @@ def set_position(): particle could not be found """ return function - + @legacy_function def set_flux(): function = LegacyFunctionSpecification() @@ -317,7 +317,7 @@ def set_flux(): particle could not be found """ return function - + @legacy_function def set_density(): function = LegacyFunctionSpecification() @@ -367,7 +367,7 @@ def set_dinternal_energy_dt(): """ return function - + @legacy_function def set_ionisation(): function = LegacyFunctionSpecification() @@ -383,8 +383,8 @@ def set_ionisation(): particle could not be found """ return function - - + + @legacy_function def set_metallicity(): function = LegacyFunctionSpecification() @@ -400,7 +400,7 @@ def set_metallicity(): particle could not be found """ return function - + @legacy_function def evolve_model(): function = LegacyFunctionSpecification() @@ -408,8 +408,8 @@ def evolve_model(): # function.addParameter('synchronize', dtype='int32', direction=function.IN) function.result_type = 'int32' return function - - + + @legacy_function def set_box_size(): function = LegacyFunctionSpecification() @@ -445,7 +445,7 @@ def set_timestep(): function.result_type = 'int32' return function - + @legacy_function def get_timestep(): function = LegacyFunctionSpecification() @@ -496,7 +496,7 @@ def get_number_frequency_bins(): function.addParameter('number_of_freq_bins', dtype='int32', direction=function.OUT) function.result_type = 'int32' return function - + @legacy_function def set_number_of_border_sites(): function = LegacyFunctionSpecification() @@ -510,7 +510,7 @@ def get_number_of_border_sites(): function.addParameter('number_of_border_sites', dtype='int32', direction=function.OUT) function.result_type = 'int32' return function - + @legacy_function def set_thermal_evolution(): function = LegacyFunctionSpecification() @@ -554,7 +554,7 @@ def get_metal_cooling(): function.result_type = 'int32' return function - + @legacy_function def set_recombination_radiation(): function = LegacyFunctionSpecification() @@ -568,8 +568,8 @@ def get_recombination_radiation(): function.addParameter('recombination_radiation_flag', dtype='int32', direction=function.OUT) function.result_type = 'int32' return function - - + + @legacy_function def set_collisional_ionization(): function = LegacyFunctionSpecification() @@ -583,34 +583,34 @@ def get_collisional_ionization(): function.addParameter('collisional_ionisation_flag', dtype='int32', direction=function.OUT) function.result_type = 'int32' return function - + def synchronize_model(self): pass - + def auto_go_to_run(self): pass - + class GlSimpleXInterface(SimpleXInterface): include_headers=['worker_gl.h'] - + def __init__(self, **kwargs): CodeInterface.__init__(self,debug_with_gdb=False, name_of_the_worker = 'simplex_worker_gl', **kwargs) - + @legacy_function def start_viewer(): function = LegacyFunctionSpecification() function.result_type = 'int32' return function - + @legacy_function def stop_viewer(): function = LegacyFunctionSpecification() function.result_type = 'int32' return function - + class SimpleXDoc(object): @@ -619,9 +619,9 @@ def __get__(self, instance, owner): class SimpleX(CommonCode): - + __doc__ = SimpleXDoc() - + def __init__(self, **options): InCodeComponentImplementation.__init__(self, SimpleXInterface(**options)) self.set_simplex_output_directory(self.output_directory) @@ -629,105 +629,105 @@ def __init__(self, **options): def define_properties(self, handler): handler.add_property('get_time', public_name = "model_time") - + def define_parameters(self, handler): - + handler.add_method_parameter( "get_timestep", - "set_timestep", - "timestep", - "timestep for radiative transfer sweeps", + "set_timestep", + "timestep", + "timestep for radiative transfer sweeps", default_value = 0.05 | units.Myr ) - + handler.add_method_parameter( "get_source_Teff", - "set_source_Teff", - "source_effective_T", - "effective temperature for sources", + "set_source_Teff", + "source_effective_T", + "effective temperature for sources", default_value = 1.e5 | units.K ) handler.add_method_parameter( "get_hilbert_order", - "set_hilbert_order", - "hilbert_order", - "hilbert_order for domain decomposition", + "set_hilbert_order", + "hilbert_order", + "hilbert_order for domain decomposition", default_value = 1 ) handler.add_method_parameter( "get_number_frequency_bins", - "set_number_frequency_bins", - "number_of_freq_bins", - "the number of bins of frequency", + "set_number_frequency_bins", + "number_of_freq_bins", + "the number of bins of frequency", default_value = 1 ) handler.add_method_parameter( "get_thermal_evolution", - "set_thermal_evolution", - "thermal_evolution_flag", - "solve full thermal evolution if 1", + "set_thermal_evolution", + "thermal_evolution_flag", + "solve full thermal evolution if 1", default_value = 0 ) handler.add_method_parameter( "get_metal_cooling", - "set_metal_cooling", - "metal_cooling_flag", - "include cooling from metals if 1, not if zero", + "set_metal_cooling", + "metal_cooling_flag", + "include cooling from metals if 1, not if zero", default_value = 0 ) handler.add_method_parameter( "get_recombination_radiation", - "set_recombination_radiation", - "recombination_radiation_flag", - "include recombination radiation if 1, not if zero", + "set_recombination_radiation", + "recombination_radiation_flag", + "include recombination radiation if 1, not if zero", default_value = 0 ) handler.add_method_parameter( "get_blackbody_spectrum", - "set_blackbody_spectrum", - "blackbody_spectrum_flag", - "monochromatic if 0, blackbody_spectrum if 1", + "set_blackbody_spectrum", + "blackbody_spectrum_flag", + "monochromatic if 0, blackbody_spectrum if 1", default_value = 0 ) handler.add_method_parameter( "get_collisional_ionization", - "set_collisional_ionization", - "collisional_ionization_flag", - "not use collisional ionization if 0, do if 1", + "set_collisional_ionization", + "collisional_ionization_flag", + "not use collisional ionization if 0, do if 1", default_value = 0 ) handler.add_method_parameter( "get_box_size", - "set_box_size", - "box_size", - "boxsize for radiative transfer particle distribution", + "set_box_size", + "box_size", + "boxsize for radiative transfer particle distribution", default_value = 13200. | units.parsec ) handler.add_method_parameter( - "get_simplex_data_directory", + "get_simplex_data_directory", "set_simplex_data_directory", - "simplex_data_directory", - "Name of the SimpleX data directory", + "simplex_data_directory", + "Name of the SimpleX data directory", default_value = "." ) handler.add_method_parameter( - "get_number_of_border_sites", + "get_number_of_border_sites", "set_number_of_border_sites", - "number_of_border_sites", - "Number of border sites to generate on the boundary, needs to be a large number. These sites will be placed randomly outside the problem domain and will culled to create a closed boundary", + "number_of_border_sites", + "Number of border sites to generate on the boundary, needs to be a large number. These sites will be placed randomly outside the problem domain and will culled to create a closed boundary", default_value = 25000 ) - + def define_methods(self, handler): CommonCode.define_methods(self, handler) handler.add_method('evolve_model', (units.Myr,), ( handler.ERROR_CODE, )) @@ -748,7 +748,7 @@ def define_methods(self, handler): handler.ERROR_CODE, ) ) - + handler.add_method( "delete_particle", ( @@ -915,7 +915,7 @@ def define_methods(self, handler): 1.0e48 / units.s, handler.ERROR_CODE ) - ) + ) handler.add_method( "set_ionisation", ( @@ -966,13 +966,13 @@ def define_methods(self, handler): (), (handler.ERROR_CODE) ) - + handler.add_method( "get_timestep", (), (units.Myr, handler.ERROR_CODE,) ) - + handler.add_method( "set_timestep", (units.Myr, ), @@ -984,26 +984,26 @@ def define_methods(self, handler): (), (units.K, handler.ERROR_CODE,) ) - + handler.add_method( "set_source_Teff", (units.K, ), (handler.ERROR_CODE,) ) - + handler.add_method( "get_hilbert_order", (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_hilbert_order", (handler.NO_UNIT, ), (handler.ERROR_CODE,) ) - + handler.add_method( "set_blackbody_spectrum", (handler.NO_UNIT, ), @@ -1022,7 +1022,7 @@ def define_methods(self, handler): (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_thermal_evolution", (handler.NO_UNIT, ), @@ -1034,7 +1034,7 @@ def define_methods(self, handler): (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_collisional_ionization", (handler.NO_UNIT, ), @@ -1046,7 +1046,7 @@ def define_methods(self, handler): (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_number_frequency_bins", (handler.NO_UNIT, ), @@ -1059,32 +1059,32 @@ def define_methods(self, handler): (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_metal_cooling", (handler.NO_UNIT, ), (handler.ERROR_CODE,) ) - + handler.add_method( "get_recombination_radiation", (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_recombination_radiation", (handler.NO_UNIT, ), (handler.ERROR_CODE,) ) - + handler.add_method( "get_box_size", (), (units.parsec, handler.ERROR_CODE,) ) - + handler.add_method( "set_box_size", (units.parsec, ), @@ -1107,13 +1107,13 @@ def define_methods(self, handler): (), (handler.NO_UNIT, handler.ERROR_CODE,) ) - + handler.add_method( "set_simplex_data_directory", (handler.NO_UNIT,), (handler.ERROR_CODE,) ) - + def define_particle_sets(self, handler): handler.define_set('particles', 'index_of_the_particle') handler.set_new('particles', 'new_particle') @@ -1137,7 +1137,7 @@ def define_particle_sets(self, handler): handler.add_setter('particles', 'set_dinternal_energy_dt') handler.add_getter('particles', 'get_dinternal_energy_dt') - + def define_state(self, handler): CommonCode.define_state(self, handler) handler.add_transition('INITIALIZED','EDIT','commit_parameters') @@ -1147,11 +1147,11 @@ def define_state(self, handler): handler.add_transition('CHANGE_PARAMETERS_RUN','RUN','recommit_parameters') handler.add_transition('CHANGE_PARAMETERS_EDIT','EDIT','recommit_parameters') handler.add_transition('CHANGE_PARAMETERS_UPDATE','UPDATE','recommit_parameters') - + handler.add_method('CHANGE_PARAMETERS_RUN', 'before_set_parameter') handler.add_method('CHANGE_PARAMETERS_EDIT', 'before_set_parameter') handler.add_method('CHANGE_PARAMETERS_UPDATE','before_set_parameter') - + handler.add_method('CHANGE_PARAMETERS_RUN', 'before_get_parameter') handler.add_method('CHANGE_PARAMETERS_EDIT', 'before_get_parameter') handler.add_method('CHANGE_PARAMETERS_UPDATE','before_get_parameter') @@ -1159,8 +1159,8 @@ def define_state(self, handler): handler.add_method('EDIT', 'before_get_parameter') handler.add_method('UPDATE','before_get_parameter') handler.add_method('EVOLVED','before_get_parameter') - - + + handler.add_method('EDIT', 'new_particle') handler.add_method('EDIT', 'delete_particle') handler.add_transition('EDIT', 'RUN', 'commit_particles') @@ -1196,16 +1196,16 @@ def define_state(self, handler): handler.add_method('INITIALIZED', 'set_collisional_ionization') - + class SimpleXSplitSet(SimpleX): - + def __init__(self,**options): SimpleX.__init__(self,**options) self.gas_particles=Particles() self.src_particles=Particles() def commit_particles(self): - + sites=self.gas_particles.copy() sites.flux=0. | units.s**-1 @@ -1214,19 +1214,19 @@ def commit_particles(self): nearest.flux+=p.luminosity self.particles.add_particles(sites) - + self.simplex_to_gas_channel=self.particles.new_channel_to(self.gas_particles) self.overridden().commit_particles() - + if hasattr(sites,"du_dt"): attributes=["du_dt"] channel=sites.new_channel_to(self.particles) channel.copy_attributes(attributes) del sites - - def recommit_particles(self): + + def recommit_particles(self): sites=self.gas_particles.copy() sites.flux=0. | units.s**-1 @@ -1241,14 +1241,14 @@ def recommit_particles(self): if len(remove_set)>0: self.particles.remove_particles(remove_set) if len(add_set)>0: self.particles.add_particles(add_set) - self.overridden().recommit_particles() + self.overridden().recommit_particles() channel=sites.new_channel_to(self.particles) attributes=["x","y","z","rho","xion","u","flux"] if hasattr(sites,"metallicity"): - attributes.append("metallicity") + attributes.append("metallicity") if hasattr(sites,"du_dt"): - attributes.append("du_dt") + attributes.append("du_dt") channel.copy_attributes(attributes) del sites @@ -1257,10 +1257,10 @@ def recommit_particles(self): def evolve_model(self,tend): self.overridden().evolve_model(tend) self.simplex_to_gas_channel.copy_attributes(["xion","u","metallicity"]) - + def define_state(self, handler): CommonCode.define_state(self, handler) - + handler.add_transition('INITIALIZED','EDIT','commit_parameters') handler.add_transition('RUN','CHANGE_PARAMETERS_RUN','before_set_parameter', False) handler.add_transition('EDIT','CHANGE_PARAMETERS_EDIT','before_set_parameter', False) @@ -1268,11 +1268,11 @@ def define_state(self, handler): handler.add_transition('CHANGE_PARAMETERS_RUN','RUN','recommit_parameters') handler.add_transition('CHANGE_PARAMETERS_EDIT','EDIT','recommit_parameters') handler.add_transition('CHANGE_PARAMETERS_UPDATE','UPDATE','recommit_parameters') - + handler.add_method('CHANGE_PARAMETERS_RUN', 'before_set_parameter') handler.add_method('CHANGE_PARAMETERS_EDIT', 'before_set_parameter') handler.add_method('CHANGE_PARAMETERS_UPDATE','before_set_parameter') - + handler.add_method('CHANGE_PARAMETERS_RUN', 'before_get_parameter') handler.add_method('CHANGE_PARAMETERS_EDIT', 'before_get_parameter') handler.add_method('CHANGE_PARAMETERS_UPDATE','before_get_parameter') @@ -1281,9 +1281,9 @@ def define_state(self, handler): handler.add_method('UPDATE','before_get_parameter') handler.add_method('EVOLVED','before_get_parameter') handler.add_method('RUNCOMMIT','before_get_parameter') - - - + + + handler.add_method('EDIT', 'new_particle') handler.add_method('EDIT', 'delete_particle') handler.add_transition('EDIT', 'RUNCOMMIT', 'commit_particles') diff --git a/src/amuse_simplex/packages/amuse-simplex.amuse_deps b/src/amuse_simplex/packages/amuse-simplex.amuse_deps index c76c6e2b27..537c9b810f 100644 --- a/src/amuse_simplex/packages/amuse-simplex.amuse_deps +++ b/src/amuse_simplex/packages/amuse-simplex.amuse_deps @@ -1 +1 @@ -issue_1111 +c++ mpi gsl hdf5 qhull healpix-cxx diff --git a/src/amuse_simplex/packages/amuse-simplex/amuse_simplex b/src/amuse_simplex/packages/amuse-simplex/amuse_simplex new file mode 120000 index 0000000000..c25bddb6dd --- /dev/null +++ b/src/amuse_simplex/packages/amuse-simplex/amuse_simplex @@ -0,0 +1 @@ +../.. \ No newline at end of file diff --git a/src/amuse_simplex/packages/amuse-simplex/pyproject.toml b/src/amuse_simplex/packages/amuse-simplex/pyproject.toml new file mode 100644 index 0000000000..399d959546 --- /dev/null +++ b/src/amuse_simplex/packages/amuse-simplex/pyproject.toml @@ -0,0 +1,41 @@ +[project] +name = "amuse-simplex" +dynamic = ["version"] +requires-python = ">=3.7" +dependencies = [ + "amuse-framework" +] + +[build-system] +requires = ["hatchling", "versioningit"] +build-backend = "hatchling.build" + +[tool.hatch.version] +source = "versioningit" + +[tool.versioningit.next-version] +method = "smallest" + +[tool.versioningit.format] +distance = "{next_version}.dev{distance}+{vcs}{rev}" +dirty = "{base_version}+d{build_date:%Y%m%d}" +distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}" + +[tool.hatch.build] +skip-excluded-dirs = true + +[tool.hatch.build.targets.wheel] +include = ["amuse_simplex/**/*.py"] +exclude = [ + "amuse_simplex/packages", + "amuse_simplex/support", + "amuse_simplex/src", + "amuse_simplex/tests" + ] +artifacts = ["amuse_simplex/simplex_worker", "amuse_simplex/data"] + +[tool.pytest.ini_options] +pythonpath = ["amuse_simplex/tests/"] + +testpaths = ["amuse_simplex/tests"] + diff --git a/src/amuse_simplex/src/Makefile b/src/amuse_simplex/src/Makefile index 737c1a5b03..7e18302d2f 100644 --- a/src/amuse_simplex/src/Makefile +++ b/src/amuse_simplex/src/Makefile @@ -5,8 +5,6 @@ use_healpix = yes PLUGINS = ./plugins KEYVALUE_PATH = $(PLUGINS)/keyValue -HEALPIX_PATH = $(PLUGINS)/HEALPix/ -QHULL_PATH = $(PLUGINS)/qhull-2012.1/ HDF5_PLUGIN = $(PLUGINS)/hdf5 @@ -32,8 +30,8 @@ CXXCFLAGS := $(CXXCFLAGS_NO_C) -c export CXXCFLAGS MACRODEFS = -DH5_USE_16_API -MYLIBS = -L$(QHULL_PATH)/lib -lqhull $(GSL_LIBS) $(HDF5_LIBS) -MYINCLUDE = -I$(KEYVALUE_PATH) -I$(QHULL_PATH)/src/libqhull $(HDF5_PLUGIN_FLAGS) $(HDF5_FLAGS) \ +MYLIBS = -lqhull_r $(GSL_LIBS) $(HDF5_LIBS) +MYINCLUDE = -I$(KEYVALUE_PATH) $(HDF5_PLUGIN_FLAGS) $(HDF5_FLAGS) \ -I$(PLUGINS)/octree -I$(PLUGINS)/hilbert -I$(SRC) \ -I$(PLUGINS)/unit_sphere_tess/include $(GSL_FLAGS) ifeq ($(use_parallel_hdf5),yes) @@ -45,8 +43,7 @@ endif ifeq ($(use_healpix),yes) MACRODEFS += -DHEAL_PIX - MYINCLUDE += -I$(HEALPIX_PATH)/include - MYLIBS += -L$(HEALPIX_PATH)/lib -lhealpix_cxx + MYLIBS += -lhealpix_cxx endif @@ -54,25 +51,18 @@ OBJS += $(OBJ)SimpleX.o $(OBJ)Structs.o $(OBJ)Common.o $(OBJ)rates.o \ $(OBJ)keyValue.o $(OBJ)hilbert.o $(OBJ)tree_structures.o $(OBJ)Main.o -all: HEALPix QHull SimpleX +all: SimpleX -amuse: HEALPix QHull SimpleX amuse_interface +amuse: SimpleX amuse_interface obj: mkdir obj -HEALPix: - @cd $(HEALPIX_PATH)/src ; \ - make all - -QHull: - make -C $(QHULL_PATH) all - -SimpleX: HEALPix $(OBJS) +SimpleX: $(OBJS) $(MPICXX) $(OBJS) -o $(BIN)SimpleX $(CXXCFLAGS_NO_C) -lm $(MYLIBS) $(OBJ)keyValue.o: $(KEYVALUE_PATH)/configfile.cpp $(KEYVALUE_PATH)/configfile.h - $(MPICXX) -o$(OBJ)keyValue.o -c $(KEYVALUE_PATH)/configfile.cpp $(CXXCFLAGS) + $(MPICXX) -o$(OBJ)keyValue.o -c $(KEYVALUE_PATH)/configfile.cpp $(CXXCFLAGS) $(OBJ)tree_structures.o: $(PLUGINS)/octree/tree_structures.cpp $(PLUGINS)/octree/tree_structures.h $(SRC)Structs.h $(MPICXX) -o$(OBJ)tree_structures.o $(MACRODEFS) -c $(PLUGINS)/octree/tree_structures.cpp $(CXXCFLAGS) $(MYINCLUDE) @@ -90,7 +80,7 @@ $(OBJ)rates.o: $(SRC)rates.h $(SRC)rates.cpp $(MPICXX) -o$(OBJ)rates.o -c $(SRC)rates.cpp $(CXXCFLAGS) $(OBJ)SimpleX.o: $(SRC)SimpleX.cpp $(SRC)SimpleX.h $(SRC)Structs.h $(SRC)Common.h $(SRC)rates.h - $(MPICXX) -o$(OBJ)SimpleX.o $(MYINCLUDE) $(MACRODEFS) -c $(SRC)SimpleX.cpp $(CXXCFLAGS) + $(MPICXX) -o$(OBJ)SimpleX.o $(MYINCLUDE) $(MACRODEFS) -c $(SRC)SimpleX.cpp $(CXXCFLAGS) $(OBJ)Main.o: $(SRC)Main.cpp $(SRC)Main.h $(SRC)SimpleX.h $(SRC)Common.h $(MPICXX) -o$(OBJ)Main.o $(MYINCLUDE) -c $(SRC)Main.cpp $(CXXCFLAGS) $(MACRODEFS) @@ -101,8 +91,8 @@ $(OBJ)h5w_parallel.o: $(HDF5_PLUGIN)/h5w_parallel.cpp $(HDF5_PLUGIN)/h5w_paralle $(OBJ)h5w_serial.o: $(HDF5_PLUGIN)/h5w_serial.cpp $(HDF5_PLUGIN)/h5w_serial.h $(HDF5_PLUGIN)/array_class.h $(MPICXX) -o$(OBJ)h5w_serial.o -c $(HDF5_PLUGIN)/h5w_serial.cpp $(CXXCFLAGS) $(MACRODEFS) $(HDF5_FLAGS) $(HDF5_PLUGIN_FLAGS) -amuse_interface: $(OBJ)amuse_interface.o -amuse_interface_gl: $(OBJ)amuse_interface_gl.o +amuse_interface: $(OBJ)amuse_interface.o +amuse_interface_gl: $(OBJ)amuse_interface_gl.o $(OBJ)amuse_interface.o: $(SRC)amuse_interface.cpp $(SRC)amuse_interface.h $(SRC)SimpleX.cpp $(SRC)SimpleX.h $(SRC)Structs.h $(SRC)Common.h $(PLUGINS)/octree/tree_structures.cpp $(MPICXX) -o$(OBJ)amuse_interface.o $(MYINCLUDE) $(MACRODEFS) -c $(SRC)amuse_interface.cpp $(CXXCFLAGS) @@ -114,9 +104,5 @@ clean: rm -rf $(OBJ)*.o $(BIN)SimpleX $(BIN)SimpleX.exe veryclean: clean - @cd $(HEALPIX_PATH)/src ; \ - make clean - @cd $(QHULL_PATH) ; \ - make clean -distclean: clean veryclean +distclean: clean diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/alm.h b/src/amuse_simplex/src/plugins/HEALPix/include/alm.h deleted file mode 100644 index 23cb4c89e5..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/alm.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm.h - * Class for storing spherical harmonic coefficients. - * - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_H -#define PLANCK_ALM_H - -#include "arr.h" - -/*! Class for storing spherical harmonic coefficients. */ -template class Alm - { - private: - int lmax, mmax, tval; - arr alm; - - public: - /*! Returns the number of coefficients in an Alm object with maximum - quantum numbers \a l and \a m. */ - static long Num_Alms (int l, int m) - { - planck_assert(m<=l,"mmax must not be larger than lmax"); - return ((m+1)*(m+2))/2 + (m+1)*(l-m); - } - - /*! Constructs an Alm object with given \a lmax and \a mmax. */ - Alm (int lmax_=0, int mmax_=0) - : lmax(lmax_), mmax(mmax_), tval(2*lmax+1), - alm (Num_Alms(lmax,mmax)) - {} - - /*! Deletes the old coefficients and allocates storage according to - \a lmax and \a mmax. */ - void Set (int lmax_, int mmax_) - { - lmax=lmax_; - mmax=mmax_; - tval=2*lmax+1; - alm.alloc(Num_Alms(lmax,mmax)); - } - - /*! Deallocates the old coefficients and uses the content of \a data - for storage. \a data is deallocated during the call. */ - void Set (arr &data, int lmax_, int mmax_) - { - planck_assert (Num_Alms(lmax_,mmax_)==data.size(),"wrong array size"); - lmax=lmax_; - mmax=mmax_; - tval=2*lmax+1; - alm.transfer(data); - } - - /*! Sets all coefficients to zero. */ - void SetToZero () - { alm.fill (0); } - - /*! Multiplies all coefficients by \a factor. */ - template void Scale (const T2 &factor) - { for (int m=0; m void ScaleL (const arr &factor) - { - planck_assert(factor.size()>lmax, "alm.ScaleL: factor array too short"); - for (int m=0; m<=mmax; ++m) - for (int l=m; l<=lmax; ++l) - operator()(l,m)*=factor[l]; - } - /*! Adds \a num to a_00. */ - template void Add (const T2 &num) - { alm[0]+=num; } - - /*! Returns a reference to the specified coefficient. */ - T &operator() (int l, int m) - { return alm[((m*(tval-m))>>1) + l]; } - /*! Returns a constant reference to the specified coefficient. */ - const T &operator() (int l, int m) const - { return alm[((m*(tval-m))>>1) + l]; } - - /*! Returns a pointer for a given m, from which the address of a_lm - can be obtained by adding l. */ - T *mstart (int m) - { return &alm[(m*(tval-m))>>1]; } - /*! Returns a pointer for a given m, from which the address of a_lm - can be obtained by adding l. */ - const T *mstart (int m) const - { return &alm[(m*(tval-m))>>1]; } - - /*! Returns the maximum \a l */ - int Lmax() const { return lmax; } - /*! Returns the maximum \a m */ - int Mmax() const { return mmax; } - - /*! Returns a constant reference to the a_lm data. */ - const arr &Alms () const { return alm; } - - /*! Swaps the contents of two A_lm objects. */ - void swap (Alm &other) - { - std::swap(lmax, other.lmax); - std::swap(mmax, other.mmax); - std::swap(tval, other.tval); - alm.swap(other.alm); - } - - /*! Returns \a true, if both objects have the same \a lmax and \a mmax, - else \a false. */ - bool conformable (const Alm &other) const - { return ((lmax==other.lmax) && (mmax==other.mmax)); } - - /*! Adds all coefficients from \a other to the own coefficients. */ - void Add (const Alm &other) - { - planck_assert (conformable(other), "A_lm are not conformable"); - for (int m=0; m -#include "xcomplex.h" -class fitshandle; - -template class Alm; - -/*! \defgroup alm_fitsio_group FITS-based I/O of a_lm */ -/*! \{ */ - -/*! Returns the maximum \a l and \a m multipole moments found in the FITS HDU - pointed to be \a inp in \a lmax and \a mmax. */ -void get_almsize(fitshandle &inp, int &lmax, int &mmax); -/*! Returns the maximum \a l and \a m multipole moments found in the HDU - \a hdunum of file \a filename in \a lmax and \a mmax. */ -void get_almsize(const std::string &filename, int &lmax, int &mmax, - int hdunum=2); -/*! Returns the maximum \a l and \a m multipole moments found in the HDUs - 2, 3 and 4 of file \a filename in \a lmax and \a mmax. */ -void get_almsize_pol(const std::string &filename, int &lmax, int &mmax); - -/*! Reads the a_lm of the FITS binary table pointed to by \a inp into - \a alms. \a alms is reallocated with the parameters \a lmax and \a mmax. - Values not present in the FITS table are set to zero; values outside - the requested (l,m) range are ignored. */ -template void read_Alm_from_fits - (fitshandle &inp, Alm > &alms, int lmax, int mmax); -/*! Opens the FITS file \a filename, jumps to the HDU \a hdunum, then reads - the a_lm from the FITS binary table there into \a alms. \a alms is - reallocated with the parameters \a lmax and \a mmax. - Values not present in the FITS table are set to zero; values outside - the requested \a (l,m) range are ignored. */ -template void read_Alm_from_fits - (const std::string &filename, Alm > &alms, - int lmax, int mmax, int hdunum=2); - -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type TINT32BIT, \a datatype and \a datatype, respectively. - The data in \a alms is written into this table; values outside - the requested (\a lmax, \a mmax) range are omitted. */ -template void write_Alm_to_fits - (fitshandle &out, const Alm > &alms, - int lmax, int mmax, int datatype); - -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type TINT32BIT, \a datatype and \a datatype, respectively. - The data in \a alms is written into this table; values outside - the requested (\a lmax, \a mmax) range are omitted. Values with an absolute - magnitude of zero are not written. */ -template void write_compressed_Alm_to_fits - (fitshandle &out, const Alm > &alms, - int lmax, int mmax, int datatype); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/alm_healpix_tools.h b/src/amuse_simplex/src/plugins/HEALPix/include/alm_healpix_tools.h deleted file mode 100644 index 7c296879d7..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/alm_healpix_tools.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_healpix_tools.h - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_ALM_HEALPIX_TOOLS_H -#define HEALPIX_ALM_HEALPIX_TOOLS_H - -#include "xcomplex.h" -#include "arr.h" - -template class Alm; -template class Healpix_Map; - -/*! \defgroup alm_healpix_group Conversions between a_lm and HEALPix maps */ -/*! \{ */ - -/*! Converts a Healpix map to a set of a_lms. - \param map the input map, which must have RING ordering - \param alm the output a_lms. l_max and m_max of the conversion are - determined from this object. - \param weight array containing the weights for the individual rings of - the map. It must have at least 2*\a map.Nside() entries. - \param add_alm If this is \a true, then the computed a_lm are added - to the values already residing in \a alm. */ -template void map2alm (const Healpix_Map &map, - Alm > &alm, const arr &weight, - bool add_alm=false); - -/*! Converts a Healpix map to a set of a_lms, using an iterative scheme - which is more accurate than plain map2alm(). - \param map the input map, which must have RING ordering. - \param alm the output a_lms. l_max and m_max of the conversion are - determined from this object. - \param num_iter the number of iterations (0 is identical to map2alm()). - \param weight array containing the weights for the individual rings of - the map. It must have at least 2*\a map.Nside() entries. */ -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter, const arr &weight); - -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter) - { - arr wgt(2*map.Nside()); - wgt.fill(1); - map2alm_iter(map,alm,num_iter,wgt); - } - -template void map2alm_iter2 (const Healpix_Map &map, - Alm > &alm, double err_abs, double err_rel); - -/*! Converts Healpix maps containing the I, Q and U Stokes parameters - to sets of a_lms. - \param mapT the I-Stokes parameter input map - \param mapQ the Q-Stokes parameter input map - \param mapU the U-Stokes parameter input map - \note All maps must have the same nside, and must be in RING scheme. - \param almT the output temperature a_lms - \param almG the output gradient a_lms - \param almC the output curl a_lms - \note all a_lm sets must have the the same lmax and mmax. - \param weight ring weights for the maps. - \param add_alm If this is \a true, then the computed a_lm are added - to the values already residing in \a alm. - \note The weight array must have at least 2*\a mapT.Nside() entries. */ -template void map2alm_pol - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - const arr &weight, - bool add_alm=false); -/*! Converts Healpix maps containing the I, Q and U Stokes parameters - to sets of a_lms, using an iterative scheme which is more accurate than - plain map2alm_pol(). - \param mapT the I-Stokes parameter input map - \param mapQ the Q-Stokes parameter input map - \param mapU the U-Stokes parameter input map - \note All maps must have the same nside, and must be in RING scheme. - \param almT the output temperature a_lms - \param almG the output gradient a_lms - \param almC the output curl a_lms - \note all a_lm sets must have the the same lmax and mmax. - \param num_iter the number of iterations (0 is identical to map2alm_pol()). - \param weight ring weights for the maps. - \note The weight array must have at least 2*\a mapT.Nside() entries. */ -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter, - const arr &weight); - -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter) - { - arr wgt(2*mapT.Nside()); - wgt.fill(1); - map2alm_pol_iter(mapT,mapQ,mapU,almT,almG,almC,num_iter,wgt); - } - -template void map2alm_pol_iter2 - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - double err_abs, double err_rel); - -/*! Converts a a set of a_lm to a HEALPix map. - \param alm the input a_lms. l_max and m_max of the conversion are - determined from this object. - \param map the output map, which must have RING ordering. */ -template void alm2map (const Alm > &alm, - Healpix_Map &map); - -/*! Converts a a set of polarised a_lm to a HEALPix map. - \param almT the input temperature a_lms - \param almG the input gradient a_lms - \param almC the input curl a_lms - \param mapT the I-Stokes parameter output map - \param mapQ the Q-Stokes parameter output map - \param mapU the U-Stokes parameter output map */ -template void alm2map_pol - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - Healpix_Map &mapT, - Healpix_Map &mapQ, - Healpix_Map &mapU); - -/*! Converts a a set of a_lm to a HEALPix map and its first derivatives. - \param alm the input a_lms. l_max and m_max of the conversion are - determined from this object. - \param map the output map, which must have RING ordering. - \param mapdth an output map containing \f$d (\mbox{map})/d\vartheta\f$, - which must have RING ordering. - \param mapdph an output map containing - \f$(\sin\vartheta)^{-1}d(\mbox{map})/d\varphi\f$, - which must have RING ordering. */ -template void alm2map_der1 - (const Alm > &alm, - Healpix_Map &map, - Healpix_Map &mapdth, - Healpix_Map &mapdph); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/alm_map_tools.h b/src/amuse_simplex/src/plugins/HEALPix/include/alm_map_tools.h deleted file mode 100644 index 23306c345e..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/alm_map_tools.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_map_tools.h - * Copyright (C) 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_MAP_TOOLS_H -#define PLANCK_ALM_MAP_TOOLS_H - -#include -#include "cxxutils.h" -#include "alm.h" -#include "xcomplex.h" - -/*! A class holding information about a ring of pixels in a spherical map. */ -class ringinfo - { - public: - double theta, phi0, weight, cth, sth; - int nph, ofs; - - ringinfo() - : nph(0) {} - /*! Constructs a \a ringinfo object. - \param theta_ colatitude of the ring (in radian) - \param phi0_ longitude of the first pixel in the ring (in radian) - \param weight_ weighting factor for all pixels in the ring. This - is typically the surface of a pixel in sterad. - \note \a weight_ is only needed for map analysis, not synthesis. - \param nph_ number of pixels in the ring - \param ofs_ index of the first ring pixel in the total map array - (counting from zero) */ - ringinfo (double theta_, double phi0_, double weight_, int nph_, int ofs_) - : theta(theta_), phi0(phi0_), weight(weight_), - cth(cos(theta)), sth(sin(theta)), nph(nph_), ofs(ofs_) - {} - }; - -/*! A class holding information about a ring pair in a spherical map. */ -class ringpair - { - public: - ringinfo r1, r2; - - /*! Initialize the object with the ring described by \a info. - The second ring is left empty. */ - ringpair (const ringinfo &info) - : r1(info) {} - /*! Initialize the object with the rings described by \a info1 - and \a info2. - \note The colatitude of \a info2 must be \f$\pi\f$ minus the colatitude - of \a info1. */ - ringpair (const ringinfo &info1,const ringinfo &info2) - : r1(info1), r2(info2) - { - planck_assert(approx(r1.theta,pi-r2.theta,1e-10), "invalid ringpair"); - } - }; - -void info2pair(const std::vector &info, std::vector &pair); - -template void map2alm (const std::vector &pair, - const T *map, Alm > &alm, bool add_alm); - -template void map2alm_pol - (const std::vector &pair, const T *mapT, const T *mapQ, - const T *mapU, Alm > &almT, Alm > &almG, - Alm > &almC, bool add_alm); - -template void map2alm_pol - (const std::vector &pairT, const T *mapT, - const std::vector &pairQ, const T *mapQ, - const std::vector &pairU, const T *mapU, - Alm > &almT, Alm > &almG, - Alm > &almC, bool add_alm); - -template void alm2map (const Alm > &alm, - const std::vector &pair, T *map); - -template void alm2map_pol - (const Alm > &almT, const Alm > &almG, - const Alm > &almC, const std::vector &pair, - T *mapT, T *mapQ, T *mapU); - -template void alm2map_der1 (const Alm > &alm, - const std::vector &pair, T *map, T *dth, T *dph); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/alm_powspec_tools.h b/src/amuse_simplex/src/plugins/HEALPix/include/alm_powspec_tools.h deleted file mode 100644 index be3d0ca7dc..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/alm_powspec_tools.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_powspec_tools.h - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_POWSPEC_TOOLS_H -#define PLANCK_ALM_POWSPEC_TOOLS_H - -#include "xcomplex.h" - -template class Alm; -class PowSpec; -class planck_rng; -class rotmatrix; - -/*! \defgroup alm_ps_group Conversions between a_lm and power spectra */ -/*! \{ */ - -/*! Creates a Gaussian realisation of the input power spectrum \a powspec, - using the random number generator \a rng, and returns the result - in \a alm. */ -template void create_alm (const PowSpec &powspec, - Alm > &alm, planck_rng &rng); - -/*! Creates a Gaussian realisation of the polarised input power spectrum - \a powspec, using the random number generator \a rng, and returns the - result in \a almT, \a almG and \a almC. */ -template void create_alm_pol - (const PowSpec &powspec, - Alm > &almT, - Alm > &almG, - Alm > &almC, - planck_rng &rng); - -/*! Returns the unpolarised power spectrum of \a alm in \a powspec. */ -template void extract_powspec - (const Alm > &alm, PowSpec &powspec); -/*! Returns the cross power spectrum of \a alm1 and \a alm2 in \a powspec. */ -template void extract_crosspowspec - (const Alm > &alm1, - const Alm > &alm2, PowSpec &powspec); -/*! Returns the polarised power spectrum of \a almT, \a almG and \a almC - in \a powspec. */ -template void extract_powspec - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - PowSpec &powspec); - -/*! \} */ - -/*! Applies a convolution with a Gaussian beam with an FWHM of - \a fwhm_arcmin arcmin to \a alm. - \note If \a fwhm_arcmin<0, a deconvolution with \a -fwhm_arcmin - is performed. - \relates Alm */ -template void smooth_with_Gauss - (Alm > &alm, double fwhm_arcmin); -/*! Applies a convolution with a Gaussian beam with an FWHM of - \a fwhm_arcmin arcmin to \a almT, \a almG and \a almC. - \note If \a fwhm_arcmin<0, a deconvolution with \a -fwhm_arcmin - is performed. - \relates Alm */ -template void smooth_with_Gauss - (Alm > &almT, - Alm > &almG, - Alm > &almC, - double fwhm_arcmin); - -/*! Rotates \a alm through the Euler angles \a psi, \a theta and \a phi. - The Euler angle convention is right handed, rotations are active. - - \a psi is the first rotation about the z-axis (vertical) - - then \a theta about the ORIGINAL (unrotated) y-axis - - then \a phi about the ORIGINAL (unrotated) z-axis (vertical) - \relates Alm */ -template void rotate_alm (Alm > &alm, - double psi, double theta, double phi); - -/*! Rotates \a almT, \a almG and \a almC through the Euler angles - \a psi, \a theta and \a phi. - The Euler angle convention is right handed, rotations are active. - - \a psi is the first rotation about the z-axis (vertical) - - then \a theta about the ORIGINAL (unrotated) y-axis - - then \a phi about the ORIGINAL (unrotated) z-axis (vertical) - \relates Alm */ -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - double psi, double theta, double phi); - -/*! Rotates \a alm through the rotation matrix \a mat. - \relates Alm */ -template void rotate_alm (Alm > &alm, - const rotmatrix &mat); - -/*! Rotates \a almT, \a almG and \a almC through the rotation matrix \a mat. - \relates Alm */ -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - const rotmatrix &mat); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/arr.h b/src/amuse_simplex/src/plugins/HEALPix/include/arr.h deleted file mode 100644 index e41c1712cb..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/arr.h +++ /dev/null @@ -1,447 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file arr.h - * Various high-performance array classes used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ARR_H -#define PLANCK_ARR_H - -#include "cxxutils.h" -#include - -/*! \defgroup arraygroup Array classes */ -/*! \{ */ - -/*! An array whose size is known at compile time. Very useful for storing - small arrays on the stack, without need for \a new and \a delete(). */ -template class fix_arr - { - private: - T d[sz]; - - public: - /*! Returns the size of the array. */ - long size() const { return sz; } - - /*! Returns a reference to element \a #n */ - template T &operator[] (T2 n) {return d[n];} - /*! Returns a constant reference to element \a #n */ - template const T &operator[] (T2 n) const {return d[n];} - }; - - -/*! One-dimensional array type. */ -template class arr - { - private: - long s; - T *d; - bool own; - -#if defined(PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s)) throw Message_error - ("arr: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s-1)); - } -#endif - - void reset() - { s=0; d=0; own=true; } - - public: - /*! Creates a zero-sized array. */ - arr() : s(0), d(0), own(true) {} - /*! Creates an array with \a sz entries. */ - arr(long sz) : s(sz), d (s>0 ? new T[s] : 0), own(true) {} - /*! Creates an array with \a sz entries, and initializes them with - \a inival. */ - arr(long sz, const T &inival) : s(sz), d (s>0 ? new T[s] : 0), own(true) - { fill(inival); } - /*! Creates an array with \a sz entries, which uses the memory pointed - to by \a ptr. - \note \a ptr will not be deallocated by the destructor. - \warning Only use this if you REALLY know what you are doing. - In particular, this is only safely usable if -
    -
  • \a T is a POD type
  • -
  • \a ptr survives during the lifetime of the array object
  • -
  • \a ptr is not subject to garbage collection
  • -
- Other restrictions may apply. You have been warned. */ - arr (T *ptr, long sz): s(sz), d(ptr), own(false) {} - /*! Creates an array which is a copy of \a orig. The data in \a orig - is duplicated. */ - arr (const arr &orig): s(orig.s), d (s>0 ? new T[s] : 0), own(true) - { for (long m=0; m0 ? new T[sz] : 0; - own = true; - } - /*! Deallocates the memory held by the array, and sets the array size - to 0. */ - void dealloc () {if (own) delete[] d; reset();} - - /*! Writes \a val into every element of the array. */ - void fill (const T &val) - { for (long m=0; m T &operator[] (T2 n) {check_range(n); return d[n];} - template const T &operator[] (T2 n) const - {check_range(n); return d[n];} -#else - /*! Returns a reference to element \a #n */ - template T &operator[] (T2 n) {return d[n];} - /*! Returns a constant reference to element \a #n */ - template const T &operator[] (T2 n) const {return d[n];} -#endif - - T *begin() { return d; } - T *end() { return d+s; } - - /*! Sorts the elements in the array, in ascending order. */ - void sort() - { std::sort (d,d+s); } - - /*! Returns the minimum and maximum entry in \a minv and \a maxv, - respectively. Throws an exception if the array is zero-sized. */ - void minmax (T &minv, T &maxv) const - { - planck_assert(s>0,"trying to find min and max of a zero-sized array"); - minv=maxv=d[0]; - for (int m=1; mmaxv) maxv=d[m]; - } - } - - /*! Assigns the contents and size of \a other to the array. On exit, - \a other is yero-sized. */ - void transfer (arr &other) - { if (own) delete[] d; d=other.d; s=other.s; own=other.own; other.reset(); } - /*! Swaps contents and size with \a other. */ - void swap (arr &other) - { std::swap(d,other.d); std::swap(s,other.s); std::swap(own,other.own);} - }; - -/*! Two-dimensional array type. The storage ordering is the same as in C. - An entry is located by address arithmetic, not by double dereferencing. - The indices start at zero. */ -template class arr2 - { - private: - long s1, s2; - arr d; - -#if defined (PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s1)) throw Message_error - ("arr2: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s1-1)); - } -#endif - - public: - /*! Creates a zero-sized array. */ - arr2() : s1(0), s2(0) {} - /*! Creates an array with the dimensions \a sz1 and \a sz2. */ - arr2(long sz1, long sz2) - : s1(sz1), s2(sz2), d(s1*s2) {} - /*! Creates the array as a copy of \a orig. */ - arr2(const arr2 &orig) - : s1(orig.s1), s2(orig.s2), d(orig.d) {} - /*! Frees the memory associated with the array. */ - ~arr2() {} - - /*! Returns the first array dimension. */ - long size1() const { return s1; } - /*! Returns the second array dimension. */ - long size2() const { return s2; } - /*! Returns the total array size, i.e. the product of both dimensions. */ - long size () const { return s1*s2; } - - /*! Allocates space for an array with \a sz1*sz2 elements. - The content of the array is undefined on exit. - \a sz1 or \a sz2 can be 0. If \a sz1*sz2 is the same as the - currently allocated space, no reallocation is performed. */ - void alloc (long sz1, long sz2) - { - if (sz1*sz2 != d.size()) - d.alloc(sz1*sz2); - s1=sz1; s2=sz2; - } - /*! Allocates space for an array with \a sz1*sz2 elements. - The content of the array is undefined on exit. - \a sz1 or \a sz2 can be 0. If \a sz1*sz2 is smaller than the - currently allocated space, no reallocation is performed. */ - void fast_alloc (long sz1, long sz2) - { - if (sz1*sz2<=d.size()) - { s1=sz1; s2=sz2; } - else - alloc(sz1,sz2); - } - /*! Deallocates the space and makes the array zero-sized. */ - void dealloc () {d.dealloc(); s1=0; s2=0;} - - /*! Sets all array elements to \a val. */ - void fill (const T &val) - { d.fill(val); } - - /*! Changes the array to be a copy of \a orig. */ - arr2 &operator= (const arr2 &orig) - { - if (this==&orig) return *this; - alloc (orig.s1, orig.s2); - d = orig.d; - return *this; - } - -#if defined (PLANCK_CHECKS) - template T *operator[] (T2 n) - {check_range(n);return &d[n*s2];} - template const T *operator[] (T2 n) const - {check_range(n);return &d[n*s2];} -#else - /*! Returns a pointer to the beginning of slice \a #n. */ - template T *operator[] (T2 n) {return &d[n*s2];} - /*! Returns a constant pointer to the beginning of slice \a #n. */ - template const T *operator[] (T2 n) const {return &d[n*s2];} -#endif - - /*! Returns the minimum and maximum entry in \a minv and \a maxv, - respectively. Throws an exception if the array is zero-sized. */ - void minmax (T &minv, T &maxv) const - { - planck_assert(s1*s2>0, - "trying to find min and max of a zero-sized array"); - minv=maxv=d[0]; - for (int m=1; mmaxv) maxv=d[m]; - } - } - - /*! Swaps contents and sizes with \a other. */ - void swap (arr2 &other) - { - d.swap(other.d); - std::swap(s1,other.s1); - std::swap(s2,other.s2); - } - }; - -/*! Two-dimensional array type. An entry is located by double dereferencing, - i.e. via an array of pointers. The indices start at zero. */ -template class arr2b - { - private: - long s1, s2; - arr d; - arr d1; - -#if defined (PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s1)) throw Message_error - ("arr: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s1-1)); - } -#endif - - void fill_d1() - { for (long m=0; m T *operator[] (T2 n) {check_range(n); return d1[n];} - template const T *operator[] (T2 n) const - {check_range(n); return d1[n];} -#else - /*! Returns a pointer to the beginning of slice \a #n. */ - template T *operator[] (T2 n) {return d1[n];} - /*! Returns a constant pointer to the beginning of slice \a #n. */ - template const T *operator[] (T2 n) const {return d1[n];} -#endif - /*! Returns a pointer to the beginning of the pointer array. */ - T **p0() {return &d1[0];} - }; - - -/*! Three-dimensional array type. The storage ordering is the same as in C. - An entry is located by address arithmetic, not by multiple dereferencing. - The indices start at zero. */ -template class arr3 - { - private: - long s1, s2, s3, s2s3; - arr d; - - public: - /*! Creates a zero-sized array. */ - arr3() : s1(0), s2(0), s3(0), s2s3(0), d(0) {} - /*! Creates an array with the dimensions \a sz1, \a sz2 and \a sz3. */ - arr3(long sz1, long sz2, long sz3) - : s1(sz1), s2(sz2), s3(sz3), s2s3(s2*s3), d(s1*s2*s3) {} - /*! Creates the array as a copy of \a orig. */ - arr3(const arr3 &orig) - : s1(orig.s1), s2(orig.s2), s3(orig.s3), s2s3(orig.s2s3), d(orig.d) {} - /*! Frees the memory associated with the array. */ - ~arr3() {} - - /*! Returns the first array dimension. */ - long size1() const { return s1; } - /*! Returns the second array dimension. */ - long size2() const { return s2; } - /*! Returns the third array dimension. */ - long size3() const { return s3; } - /*! Returns the total array size, i.e. the product of all dimensions. */ - long size () const { return s1*s2*s3; } - - /*! Allocates space for an array with \a sz1*sz2*sz3 elements. - The content of the array is undefined on exit. */ - void alloc (long sz1, long sz2, long sz3) - { - d.alloc(sz1*sz2*sz3); - s1=sz1; s2=sz2; s3=sz3; s2s3=s2*s3; - } - /*! Deallocates the space and makes the array zero-sized. */ - void dealloc () {d.dealloc(); s1=0; s2=0; s3=0; s2s3=0;} - - /*! Sets all array elements to \a val. */ - void fill (const T &val) - { d.fill(val); } - - /*! Changes the array to be a copy of \a orig. */ - arr3 &operator= (const arr3 &orig) - { - if (this==&orig) return *this; - alloc (orig.s1, orig.s2, orig.s3); - d = orig.d; - return *this; - } - - /*! Returns a reference to the element with the indices - \a n1, \a n2 and \a n3. */ - template T &operator() (T2 n1, T2 n2, T2 n3) - {return d[n1*s2s3 + n2*s3 + n3];} - /*! Returns a constant reference to the element with the indices - \a n1, \a n2 and \a n3. */ - template const T &operator() (T2 n1, T2 n2, T2 n3) const - {return d[n1*s2s3 + n2*s3 + n3];} - - /*! Swaps contents and sizes with \a other. */ - void swap (arr3 &other) - { - d.swap(other.d); - std::swap(s1,other.s1); - std::swap(s2,other.s2); - std::swap(s3,other.s3); - std::swap(s2s3,other.s2s3); - } - }; - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/cxxutils.h b/src/amuse_simplex/src/plugins/HEALPix/include/cxxutils.h deleted file mode 100644 index 353aab6917..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/cxxutils.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file cxxutils.h - * Various convenience functions used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke \author Reinhard Hell - */ - -#ifndef PLANCK_CXXUTILS_H -#define PLANCK_CXXUTILS_H - -#include -#include -#include -#include -#include "message_error.h" -#include "lsconstants.h" - -/*! \defgroup mathutilsgroup Mathematical helper functions */ -/*! \{ */ - -//! Returns \e true if | \a a-b | < \a epsilon * | \a b |, else \e false. -template inline bool approx (F a, F b, F epsilon=1e-5) - { - using namespace std; - return abs(a-b) < (epsilon*abs(b)); - } - -//! Returns \e true if | \a a-b | < \a epsilon, else \e false. -template inline bool abs_approx (F a, F b, F epsilon=1e-5) - { - using namespace std; - return abs(a-b) < epsilon; - } - -//! Returns the largest integer which is smaller than (or equal to) \a arg. -template inline I ifloor (F arg) - { - return (arg>=0) ? I(arg) : I(arg)-1; - } - -//! Returns the integer which is nearest to \a arg. -template inline I nearest (F arg) - { - arg += 0.5; - return (arg>=0) ? I(arg) : I(arg)-1; - } - -//! Returns \a v1+v2 if \a v1<0, \a v1-v2 if \a v1>=v2, else \a v1. -/*! \a v1 can be positive or negative; \a v2 must be positive. */ -template inline T weak_modulo (T v1, T v2) - { return (v1>=0) ? ((v1=0) ? ((v1 inline I imodulo (I v1, I v2) - { return (v1>=0) ? ((v1 inline T sign (const T& signvalue) - { return (signvalue>=0) ? 1 : -1; } - -//! Returns the integer \a n, which fulfills \a n*n<=arg<(n+1)*(n+1). -template inline unsigned int isqrt (I arg) - { - using namespace std; - if (sizeof(I)<=4) - return unsigned (sqrt(arg+0.5)); - long double arg2 = arg; - return unsigned (sqrt(arg2+0.5)); - } - -//! Returns the largest integer \a n that fulfills \a 2^n<=arg. -template inline unsigned int ilog2 (I arg) - { - unsigned int res=0; - while (arg > 0x0000FFFF) { res+=16; arg>>=16; } - if (arg > 0x000000FF) { res|=8; arg>>=8; } - if (arg > 0x0000000F) { res|=4; arg>>=4; } - if (arg > 0x00000003) { res|=2; arg>>=2; } - if (arg > 0x00000001) { res|=1; } - return res; - } - -//! Returns \a atan2(y,x) if \a x!=0 or \a y!=0; else returns 0. -inline double safe_atan2 (double y, double x) - { - using namespace std; - return ((x==0.) && (y==0.)) ? 0.0 : atan2(y,x); - } - -//! Returns an index to the left of two interpolation values. -/*! \a begin points to an array containing a sequence of values - sorted in ascending order. The length of the array is \a len. - If \a val is lower than the first element, 0 is returned. - If \a val is higher than the last element, \a len-2 - is returned. Else, the index of the largest element smaller - than \a val is returned. */ -template inline int interpol_left - (const T *begin, int len, const T &val) - { - const T *end = begin+len; - const T *iter = std::lower_bound (begin, end, val); - if (iter==begin) return 0; - if (iter==end) return len-2; - return (iter-begin)-1; - } - -//! Returns an index to the nearest interpolation value. -/*! \a begin points to an array containing a sequence of values - sorted in ascending order. The length of the array is \a len. - If \a val is lower than the first element, 0 is returned. - If \a val is higher than the last element, \a len-1 is returned. - Else, the index of the nearest element within the sequence of - values is returned. */ -template inline int interpol_nearest - (const T *begin, int len, const T &val) - { - int left = interpol_left(begin, len, val); - T delleft = val-(*(begin+left)); - T delright = (*(begin+left+1))-val; - if (delright<0) return left+1; - return (delright std::string dataToString(const T &x); -template<> std::string dataToString (const bool &x); -template<> std::string dataToString (const std::string &x); -template<> std::string dataToString (const float &x); -template<> std::string dataToString (const double &x); - -/*! Returns a string containing the text representation of \a x, padded - with leading zeroes to \a width characters. */ -std::string intToString(int x, int width); - -//! Reads a value of a given datatype from a string -template void stringToData (const std::string &x, T &value); -template<> void stringToData (const std::string &x, std::string &value); -template<> void stringToData (const std::string &x, bool &value); - -//! Reads a value of a given datatype from a string -template inline T stringToData (const std::string &x) - { T result; stringToData(x,result); return result; } - -//! Parses the file \a filename and returns the key/value pairs in \a dict. -void parse_file (const std::string &filename, - std::map &dict); - -//! Case-insensitive string comparison -/*! Returns \a true, if \a a and \a b differ only in capitalisation, - else \a false. */ -bool equal_nocase (const std::string &a, const std::string &b); - -//! Returns lowercase version of \a input. -std::string tolower(const std::string &input); - -/*! \} */ - -//! Indicates progress by printing the percentage of \a now/total. -/*! A message is only printed if it has changed since \a now-1/total. - The output is followed by a carriage return, not a newline. */ -void announce_progress (int now, int total); -//! Indicates progress by printing the percentage of \a now/total. -/*! A message is only printed if it has changed since \a last/total. - The output is followed by a carriage return, not a newline. */ -void announce_progress (double now, double last, double total); -/*! This function should be called after a sequence of announce_progress() - calls has finished. */ -void end_announce_progress (); - -//! Prints a banner containing \a name. Useful for displaying program names. -void announce (const std::string &name); - -/*! Prints a banner containing \a name and checks if \a argc==argc_expected. - If not, a usage description is given and the program is terminated. */ -void module_startup (const std::string &name, int argc, const char **argv, - int argc_expected, const std::string &argv_expected); - -//! Returns an appropriate FITS repetition count for a map with \a npix pixels. -inline unsigned int healpix_repcount (int npix) - { - if (npix<1024) return 1; - if ((npix%1024)==0) return 1024; - return isqrt (npix/12); - } -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/datatypes.h b/src/amuse_simplex/src/plugins/HEALPix/include/datatypes.h deleted file mode 100644 index 7e98de725a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/datatypes.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * This file defines various platform-independent data types. - * If any of the requested types is not available, compilation aborts - * with an error (unfortunately a rather obscure one). - * - * Copyright (C) 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef PLANCK_DATATYPES_H -#define PLANCK_DATATYPES_H - -#include -#include "message_error.h" - -// Template magic to select the proper data types. These templates -// should not be used outside this file. - -template struct sizeChooserHelper - { typedef void TYPE; }; - -template struct sizeChooserHelper - { typedef T TYPE; }; - -template struct sizeChooserHelper2 - { typedef T1 TYPE; }; - -template struct sizeChooserHelper2 - { typedef T2 TYPE; }; - -template struct sizeChooserHelper2 - { typedef T3 TYPE; }; - -template <> struct sizeChooserHelper2 - { }; - -template - struct sizeChooser - { - typedef typename sizeChooserHelper2 - ::TYPE, - typename sizeChooserHelper::TYPE, - typename sizeChooserHelper::TYPE >::TYPE TYPE; - }; - -typedef signed char int8; -typedef unsigned char uint8; - -typedef sizeChooser<2, short, int>::TYPE - int16; -typedef sizeChooser<2, unsigned short, unsigned int>::TYPE - uint16; - -typedef sizeChooser<4, int, long, short>::TYPE - int32; -typedef sizeChooser<4, unsigned int, unsigned long, unsigned short>::TYPE - uint32; - -typedef sizeChooser<8, long, long long>::TYPE - int64; -typedef sizeChooser<8, unsigned long, unsigned long long>::TYPE - uint64; - -typedef sizeChooser<4, float, double>::TYPE - float32; -typedef sizeChooser<8, double, long double>::TYPE - float64; - -// mapping of types to integer constants -enum { PLANCK_INT8 = 0, - PLANCK_UINT8 = 1, - PLANCK_INT16 = 2, - PLANCK_UINT16 = 3, - PLANCK_INT32 = 4, - PLANCK_UINT32 = 5, - PLANCK_INT64 = 6, - PLANCK_UINT64 = 7, - PLANCK_FLOAT32 = 8, - PLANCK_FLOAT64 = 9, - PLANCK_BOOL = 10, - PLANCK_STRING = 11 }; - -template struct typehelper {}; - -template<> struct typehelper - { enum { id=PLANCK_INT8 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT8 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT16 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT16 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_FLOAT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_FLOAT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_BOOL }; }; -template<> struct typehelper - { enum { id=PLANCK_STRING }; }; - -inline int type2size (int type) - { - switch (type) - { - case PLANCK_INT8 : return 1; - case PLANCK_UINT8 : return 1; - case PLANCK_INT16 : return 2; - case PLANCK_UINT16 : return 2; - case PLANCK_INT32 : return 4; - case PLANCK_UINT32 : return 4; - case PLANCK_INT64 : return 8; - case PLANCK_UINT64 : return 8; - case PLANCK_FLOAT32: return 4; - case PLANCK_FLOAT64: return 8; - case PLANCK_BOOL : return 1; - case PLANCK_STRING : return 1; - default: throw Message_error ("unsupported data type"); - } - } - -inline int string2type(const std::string &type) - { - if (type=="FLOAT64") return PLANCK_FLOAT64; - if (type=="FLOAT32") return PLANCK_FLOAT32; - if (type=="INT8") return PLANCK_INT8; - if (type=="UINT8") return PLANCK_UINT8; - if (type=="INT16") return PLANCK_INT16; - if (type=="UINT16") return PLANCK_UINT16; - if (type=="INT32") return PLANCK_INT32; - if (type=="UINT32") return PLANCK_UINT32; - if (type=="INT64") return PLANCK_INT64; - if (type=="UINT64") return PLANCK_UINT64; - if (type=="BOOL") return PLANCK_BOOL; - if (type=="STRING") return PLANCK_STRING; - throw Message_error ("unknown data type "+type); - } - -inline const char *type2string (int type) - { - switch (type) - { - case PLANCK_INT8 : return "INT8"; - case PLANCK_UINT8 : return "UINT8"; - case PLANCK_INT16 : return "INT16"; - case PLANCK_UINT16 : return "UINT16"; - case PLANCK_INT32 : return "INT32"; - case PLANCK_UINT32 : return "UINT32"; - case PLANCK_INT64 : return "INT64"; - case PLANCK_UINT64 : return "UINT64"; - case PLANCK_FLOAT32: return "FLOAT32"; - case PLANCK_FLOAT64: return "FLOAT64"; - case PLANCK_BOOL : return "BOOL"; - case PLANCK_STRING : return "STRING"; - default: throw Message_error ("unsupported data type"); - } - } - -template inline const char *type2typename () - { return "unknown type"; } -template<> inline const char *type2typename () - { return "signed char"; } -template<> inline const char *type2typename () - { return "unsigned char"; } -template<> inline const char *type2typename () - { return "short"; } -template<> inline const char *type2typename () - { return "unsigned short"; } -template<> inline const char *type2typename () - { return "int"; } -template<> inline const char *type2typename () - { return "unsigned int"; } -template<> inline const char *type2typename () - { return "long"; } -template<> inline const char *type2typename () - { return "unsigned long"; } -template<> inline const char *type2typename () - { return "long long"; } -template<> inline const char *type2typename () - { return "unsigned long long"; } -template<> inline const char *type2typename () - { return "float"; } -template<> inline const char *type2typename () - { return "double"; } -template<> inline const char *type2typename () - { return "bool"; } -template<> inline const char *type2typename () - { return "std::string"; } - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/fftpack_support.h b/src/amuse_simplex/src/plugins/HEALPix/include/fftpack_support.h deleted file mode 100644 index 4f3a821dee..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/fftpack_support.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_FFTPACK_SUPPORT_H -#define PLANCK_FFTPACK_SUPPORT_H - -#include "ls_fft.h" -#include "arr.h" -#include "xcomplex.h" - -class cfft - { - private: - int n; - complex_plan plan; - - public: - cfft () : n(-1), plan(0) {} - cfft (int size_) - : n(size_), plan(make_complex_plan(size_)) {} - ~cfft () - { if (plan!=0) kill_complex_plan (plan); } - void Set (int size_) - { - if (plan!=0) kill_complex_plan (plan); - n=size_; - plan=make_complex_plan(size_); - } - - int size() const - { return n; } - - void forward (double *data) - { complex_plan_forward(plan,data); } - void backward (double *data) - { complex_plan_backward(plan,data); } - void forward (arr >&data) - { forward(&(data[0].re)); } - void backward (arr >&data) - { backward(&(data[0].re)); } - }; - -class rfft - { - private: - int n; - real_plan plan; - - public: - rfft () : n(-1), plan(0) {} - rfft (int size_) - : n(size_), plan(make_real_plan(size_)) {} - ~rfft () - { if (plan!=0) kill_real_plan (plan); } - void Set (int size_) - { - if (plan!=0) kill_real_plan (plan); - n=size_; - plan=make_real_plan(size_); - } - - int size() const - { return n; } - - void forward_fftpack (double *data) - { real_plan_forward_fftpack(plan,data); } - void backward_fftpack (double *data) - { real_plan_backward_fftpack(plan,data); } - void forward_fftpack (arr &data) - { forward_fftpack(&(data[0])); } - void backward_fftpack (arr &data) - { backward_fftpack(&(data[0])); } - void forward_c (arr >&data) - { real_plan_forward_c(plan,&(data[0].re)); } - void backward_c (arr >&data) - { real_plan_backward_c(plan,&(data[0].re)); } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/fitshandle.h b/src/amuse_simplex/src/plugins/HEALPix/include/fitshandle.h deleted file mode 100644 index 07bd4166ca..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/fitshandle.h +++ /dev/null @@ -1,444 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file fitshandle.h - * Declaration of the FITS I/O helper class used by LevelS - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_FITSHANDLE_H -#define PLANCK_FITSHANDLE_H - -#include -#include -#include "fitsio.h" -#include "arr.h" -#include "datatypes.h" - -/*! \defgroup fitsgroup FITS-related functionality */ -/*! \{ */ - -template struct FITSUTIL {}; - -template<> struct FITSUTIL - { enum { DTYPE=TBYTE }; }; -template<> struct FITSUTIL - { enum { DTYPE=TSHORT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TINT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TLONG }; }; -template<> struct FITSUTIL - { enum { DTYPE=TLONGLONG }; }; -template<> struct FITSUTIL - { enum { DTYPE=TFLOAT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TDOUBLE }; }; - -/*! Converts a FITS type code (i.e. the data type of a FITS column) to the - corresponding Planck type code. */ -inline int ftc2type (int ftc) - { - switch (ftc) - { - case TLOGICAL : return PLANCK_BOOL; - case TBYTE : return PLANCK_INT8; - case TSHORT : return PLANCK_INT16; - case TINT32BIT: return PLANCK_INT32; - case TLONGLONG: return PLANCK_INT64; - case TFLOAT : return PLANCK_FLOAT32; - case TDOUBLE : return PLANCK_FLOAT64; - case TSTRING : return PLANCK_STRING; - default: throw Message_error ("ftc2type: unsupported component type"); - } - } - -/*! Converts a Planck type code to the corresponding FITS type code - (i.e. the data type of a FITS column). */ -inline int type2ftc (int type) - { - switch (type) - { - case PLANCK_BOOL : return TLOGICAL; - case PLANCK_INT8 : return TBYTE; - case PLANCK_INT16 : return TSHORT; - case PLANCK_INT32 : return TINT32BIT; - case PLANCK_INT64 : return TLONGLONG; - case PLANCK_FLOAT32: return TFLOAT; - case PLANCK_FLOAT64: return TDOUBLE; - case PLANCK_STRING : return TSTRING; - default: throw Message_error ("type2ftc: unsupported component type"); - } - } - -/*! Class containing information about a single column in a FITS table. */ -class fitscolumn - { - private: - std::string name_, unit_; - int64 repcount_; - int type_; - - public: - fitscolumn() - : repcount_(0), type_(-1) {} - /*! Creates a \a fitscolumn with name \a nm, unit \a un, a repetition - count of \a rc, and a FITS type code of \a tp. */ - fitscolumn (const std::string &nm, const std::string &un, int64 rc, - int tp) - : name_(nm), unit_(un), repcount_(rc), type_(tp) {} - - /*! Returns the column name. */ - const std::string &name() const {return name_;} - /*! Returns the column unit string. */ - const std::string &unit() const {return unit_;} - /*! Returns the repetition count of the column. */ - int64 repcount() const {return repcount_;} - /*! Returns the FITS type code of the column. */ - int type() const {return type_;} - }; - -/*! Class for performing I/O from/to FITS files. */ -class fitshandle - { - private: - enum { INVALID = -4711 }; - - mutable int status; - fitsfile *fptr; - int hdutype_, bitpix_; - std::vector axes_; - std::vector columns_; - int64 nrows_; - - void check_errors() const; - - void clean_data(); - void clean_all(); - - void assert_connected (const std::string &func) const - { - planck_assert (hdutype_!=INVALID, - func + ": not connected to a HDU"); - } - void assert_table_hdu (const std::string &func, unsigned int col) const - { - planck_assert ((hdutype_==ASCII_TBL) || (hdutype_==BINARY_TBL), - func + ": HDU is not a table"); - planck_assert (col>0 && col<=columns_.size(), - func + ": column number out of range"); - } - void assert_image_hdu (const std::string &func) const - { - planck_assert ((hdutype_==IMAGE_HDU), func + ": HDU is not an image"); - } - - void init_image(); - void init_asciitab(); - void init_bintab(); - void init_data(); - - void check_key_present(const std::string &name)const ; - - void read_col (int colnum, void *data, int64 ndata, int dtype, - int64 offset) const; - void write_col (int colnum, const void *data, int64 ndata, int dtype, - int64 offset); - - public: - /*! the list of modes in which a \a fitshandle can be opened. */ - typedef enum { CREATE, /*!< the file must not yet exist */ - OPEN /*!< the file must already exist */ - } openmethod; - - /*! \name File-level access and manipulation. */ - /*! \{ */ - - /*! Creates an unconnected \a fitshandle. */ - fitshandle () - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) {} - /*! Creates a \a fitshandle connected to file \a fname. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - fitshandle (const std::string &fname, openmethod mode=OPEN, - int rwmode=READONLY) - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) - { - if (mode==OPEN) - open (fname, rwmode); - else - create (fname); - } - /*! Creates a \a fitshandle connected to file \a fname and jumps directly - to the HDU with the number \a hdunum. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - fitshandle (const std::string &fname, int hdunum, int rwmode=READONLY) - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) - { - open (fname, rwmode); - goto_hdu (hdunum); - } - - /*! Performs all necessary cleanups. */ - ~fitshandle() { clean_all(); } - - /*! Connects to the file \a fname. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - void open (const std::string &fname, int rwmode=READONLY); - /*! Creates the file \a fname and connects to it. */ - void create (const std::string &fname); - /*! Closes the current file. */ - void close () { clean_all(); } - /*! Deletes the file with name \a name. */ - static void delete_file (const std::string &name); - /*! Jumps to the HDU with the absolute number \a hdu. */ - void goto_hdu (int hdu); - /*! Returns the number of HDUs in the file. */ - int num_hdus () const; - /*! Asserts that the PDMTYPE of the current HDU is \a pdmtype. */ - void assert_pdmtype (const std::string &pdmtype) const; - /*! Inserts a binary table described by \a cols. - The HDU has the name \a extname. */ - void insert_bintab (const std::vector &cols, - const std::string &extname="xtension"); - /*! Inserts an ASCII table described by \a cols. The width of the - columns is chosen automatically, in a way that avoids truncation. - The HDU has the name \a extname. */ - void insert_asctab (const std::vector &cols, - const std::string &extname="xtension"); - /*! Inserts a FITS image with the type given by \a btpx and dimensions - given by \a Axes. */ - void insert_image (int btpx, const std::vector &Axes); - /*! Inserts a 2D FITS image with the type given by \a btpx, whose - contents are given in \a data. */ - template - void insert_image (int btpx, const arr2 &data); - - /*! Computes the checksum for the current HDU and writes it into the - header. */ - void write_checksum(); - - /*! \} */ - - /*! \name Information about the current HDU */ - /*! \{ */ - - /*! If the current HDU is an image, returns the BITPIX parameter of that - image, else throws an exception. */ - int bitpix() const - { - assert_image_hdu ("fitshandle::bitpix()"); - return bitpix_; - } - /*! Returns the FITS type code for the current HDU. */ - int hdutype() const {return hdutype_;} - /*! Returns the dimensions of the current image. */ - const std::vector &axes() const - { - assert_image_hdu ("fitshandle::axes()"); - return axes_; - } - /*! Returns the name of column \a #i. */ - const std::string &colname(int i) const - { - assert_table_hdu("fitshandle::colname()",i); - return columns_[i-1].name(); - } - /*! Returns the unit of column \a #i. */ - const std::string &colunit(int i) const - { - assert_table_hdu("fitshandle::colunit()",i); - return columns_[i-1].unit(); - } - /*! Returns repetition count of column \a #i. */ - int64 repcount(int i) const - { - assert_table_hdu("fitshandle::repcount()",i); - return columns_[i-1].repcount(); - } - /*! Returns the FITS type code for column \a #i. */ - int coltype(int i) const - { - assert_table_hdu("fitshandle::coltype()",i); - return columns_[i-1].type(); - } - /*! Returns the number of columns in the current table. */ - int ncols() const - { - assert_table_hdu("fitshandle::ncols()",1); - return columns_.size(); - } - /*! Returns the number of rows in the current table. */ - int64 nrows() const - { - assert_table_hdu("fitshandle::nrows()",1); - return nrows_; - } - /*! Returns the total number of elements (nrows*repcount) - in column \a #i. */ - int64 nelems(int i) const - { - assert_table_hdu("fitshandle::nelems()",i); - if (columns_[i-1].type()==TSTRING) return nrows_; - return nrows_*columns_[i-1].repcount(); - } - - /*! \} */ - - /*! \name Keyword-handling methods */ - /*! \{ */ - - /*! Copies all header keywords from the current HDU of \a orig to - the current HDU of \a *this. */ - void copy_header (const fitshandle &orig); - /*! Copies all header keywords from the current HDU of \a orig to - the current HDU of \a *this, prepending a HISTORY keyword to - every line. */ - void copy_historified_header (const fitshandle &orig); - - /*! Returns a list of all user-defined keys in the current HDU - in \a keys. */ - void get_all_keys (std::vector &keys) const; - - /*! Adds a new header line consisting of \a key, \a value and - \a comment. */ - template void add_key (const std::string &name, const T &value, - const std::string &comment=""); - /*! Updates \a key with \a value and \a comment. */ - template void update_key (const std::string &name, - const T &value, const std::string &comment=""); - /*! Deletes \a key from the header. */ - void delete_key (const std::string &name); - /*! Adds \a comment as a comment line. */ - void add_comment (const std::string &comment); - /*! Reads the value belonging to \a key and returns it in \a value. */ - template void get_key (const std::string &name, T &value) const; - /*! Returms the value belonging to \a key. */ - template T get_key (const std::string &name) const - { T tmp; get_key(name, tmp); return tmp; } - /*! Returns \a true if \a key is present, else \a false. */ - bool key_present (const std::string &name) const; - /*! Returns the Planck type code for the key \a name. */ - int get_key_type(const std::string &name) const; - - /*! \} */ - - /*! \name Methods for table data I/O */ - /*! \{ */ - - void read_column_raw_void - (int colnum, void *data, int type, int64 num, int64 offset=0) const; - /*! Copies \a num elements from column \a colnum to the memory pointed - to by \a data, starting at offset \a offset in the column. */ - template void read_column_raw - (int colnum, T *data, int64 num, int64 offset=0) const - { read_column_raw_void (colnum, data, typehelper::id, num, offset); } - /*! Fills \a data with elements from column \a colnum, - starting at offset \a offset in the column. */ - template void read_column - (int colnum, arr &data, int64 offset=0) const - { read_column_raw (colnum, &(data[0]), data.size(), offset); } - /*! Reads the element \a #offset from column \a colnum into \a data. */ - template void read_column - (int colnum, T &data, int64 offset=0) const - { read_column_raw (colnum, &data, 1, offset); } - /* Reads the whole column \a colnum into \a data (which is resized - accordingly). */ - template void read_entire_column - (int colnum, arr &data) const - { data.alloc(nelems(colnum)); read_column (colnum, data); } - - - void write_column_raw_void - (int colnum, const void *data, int type, int64 num, int64 offset=0); - /*! Copies \a num elements from the memory pointed to by \a data to the - column \a colnum, starting at offset \a offset in the column. */ - template void write_column_raw - (int colnum, const T *data, int64 num, int64 offset=0) - { write_column_raw_void (colnum, data, typehelper::id, num, offset); } - /*! Copies all elements from \a data to the - column \a colnum, starting at offset \a offset in the column. */ - template void write_column - (int colnum, const arr &data, int64 offset=0) - { write_column_raw (colnum, &(data[0]), data.size(), offset); } - /*! Copies \a data to the column \a colnum, at the position \a offset. */ - template void write_column - (int colnum, const T &data, int64 offset=0) - { write_column_raw (colnum, &data, 1, offset); } - - /*! \} */ - - /*! \name Methods for image data I/O */ - /*! \{ */ - - /*! Reads the current image into \a data, which is resized accordingly. */ - template void read_image (arr2 &data) const; - /*! Reads the current image into \a data, which is resized accordingly. */ - template void read_image (arr3 &data) const; - /*! Reads a partial image, whose dimensions are given by the dimensions - of \a data, into data. The starting pixel indices are given by - \a xl and \a yl. */ - template void read_subimage - (arr2 &data, int xl, int yl) const; - /*! Fills \a data with values from the image, starting at the offset - \a offset in the image. The image is treated as a one-dimensional - array. */ - template void read_subimage (arr &data, int64 offset=0) - const; - /*! Writes \a data into the current image. \a data must have the same - dimensions as specified in the HDU. */ - template void write_image (const arr2 &data); - /*! Copies \a data to the image, starting at the offset - \a offset in the image. The image is treated as a one-dimensional - array. */ - template void write_subimage (const arr &data, - int64 offset=0); - - /*! \} */ - - void add_healpix_keys (int datasize); - }; - -/*! \} */ - -// announce the specialisations -template<> void fitshandle::add_key(const std::string &name, - const bool &value, const std::string &comment); -template<> void fitshandle::add_key (const std::string &name, - const std::string &value, const std::string &comment); -template<> void fitshandle::update_key(const std::string &name, - const bool &value, const std::string &comment); -template<> void fitshandle::update_key (const std::string &name, - const std::string &value, const std::string &comment); -template<> void fitshandle::get_key(const std::string &name,bool &value) const; -template<> void fitshandle::get_key (const std::string &name, - std::string &value) const; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/include/fitsio.h deleted file mode 100644 index 0a231c74a3..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/fitsio.h +++ /dev/null @@ -1,1880 +0,0 @@ -/* The FITSIO software was written by William Pence at the High Energy */ -/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ -/* Goddard Space Flight Center. */ -/* - -Copyright (Unpublished--all rights reserved under the copyright laws of -the United States), U.S. Government as represented by the Administrator -of the National Aeronautics and Space Administration. No copyright is -claimed in the United States under Title 17, U.S. Code. - -Permission to freely use, copy, modify, and distribute this software -and its documentation without fee is hereby granted, provided that this -copyright notice and disclaimer of warranty appears in all copies. - -DISCLAIMER: - -THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, -EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, -ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY -IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE -DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE -SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NASA BE LIABLE FOR ANY -DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR -CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY -CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, -CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY -PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED -FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR -SERVICES PROVIDED HEREUNDER." - -*/ - -#ifndef _FITSIO_H -#define _FITSIO_H - -#define CFITSIO_VERSION 3.13 - -#include - -/* the following was provided by Michael Greason (GSFC) to fix a */ -/* C/Fortran compatibility problem on an SGI Altix system running */ -/* SGI ProPack 4 [this is a Novell SuSE Enterprise 9 derivative] */ -/* and using the Intel C++ and Fortran compilers (version 9.1) */ -#if defined(__INTEL_COMPILER) && defined(__itanium__) -# define mipsFortran 1 -# define _MIPS_SZLONG 64 -#endif - -#if defined(linux) || defined(__APPLE__) || defined(__sgi) -# include /* apparently needed on debian linux systems */ -#endif /* to define off_t */ - -#include /* apparently needed to define size_t with gcc 2.8.1 */ -#include /* needed for LLONG_MAX and INT64_MAX definitions */ - -/* Define the datatype for variables which store file offset values. */ -/* The newer 'off_t' datatype should be used for this purpose, but some */ -/* older compilers do not recognize this type, in which case we use 'long' */ -/* instead. Note that _OFF_T is defined (or not) in stdio.h depending */ -/* on whether _LARGEFILE_SOURCE is defined in sys/feature_tests.h */ -/* (at least on Solaris platforms using cc) */ - -/* Debian systems require the 2nd test, below, */ -/* i.e, "(defined(linux) && defined(__off_t_defined))" */ -#if defined(_OFF_T) || (defined(linux) && defined(__off_t_defined)) || defined(_MIPS_SZLONG) || defined(__APPLE__) || defined(_AIX) -# define OFF_T off_t -#else -# define OFF_T long -#endif - -/* this block determines if the the string function name is - strtol or strtoll, and whether to use %ld or %lld in printf statements */ - -/* - The following 2 cases for that Athon64 were removed on 4 Jan 2006; - they appear to be incorrect now that LONGLONG is always typedef'ed - to 'long long' - || defined(__ia64__) \ - || defined(__x86_64__) \ -*/ -#if (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \ - || defined(__sparcv9) \ - || defined(__powerpc64__) || defined(__64BIT__) \ - || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) \ - || defined( _MSC_VER)|| defined(__BORLANDC__) - -# define USE_LL_SUFFIX 0 -#else -# define USE_LL_SUFFIX 1 -#endif - -/* - Determine what 8-byte integer data type is available. - 'long long' is now supported by most compilers, but - older MS Visual C++ compilers before V7.0 use '__int64' instead. -*/ - -#ifndef LONGLONG_TYPE /* this may have been previously defined */ -#if defined(_MSC_VER) /* Microsoft Visual C++ */ - -#if (_MSC_VER < 1300) /* versions earlier than V7.0 do not have 'long long' */ - typedef __int64 LONGLONG; -#else /* newer versions do support 'long long' */ - typedef long long LONGLONG; -#endif - -#elif defined( __BORLANDC__) /* for the Borland 5.5 compiler, in particular */ - typedef __int64 LONGLONG; -#else - typedef long long LONGLONG; -#endif - -#define LONGLONG_TYPE -#endif - -#ifndef LONGLONG_MAX - -#ifdef LLONG_MAX -/* Linux and Solaris definition */ -#define LONGLONG_MAX LLONG_MAX -#define LONGLONG_MIN LLONG_MIN - -#elif defined(LONG_LONG_MAX) -#define LONGLONG_MAX LONG_LONG_MAX -#define LONGLONG_MIN LONG_LONG_MIN - -#elif defined(__LONG_LONG_MAX__) -/* Mac OS X & CYGWIN defintion */ -#define LONGLONG_MAX __LONG_LONG_MAX__ -#define LONGLONG_MIN (-LONGLONG_MAX -1LL) - -#elif defined(INT64_MAX) -/* windows definition */ -#define LONGLONG_MAX INT64_MAX -#define LONGLONG_MIN INT64_MIN - -#elif defined(_I64_MAX) -/* windows definition */ -#define LONGLONG_MAX _I64_MAX -#define LONGLONG_MIN _I64_MIN - -#elif (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \ - || defined(__sparcv9) \ - || defined(__ia64__) \ - || defined(__x86_64__) \ - || defined(_SX) \ - || defined(__powerpc64__) || defined(__64BIT__) \ - || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) -/* sizeof(long) = 64 */ -#define LONGLONG_MAX 9223372036854775807L /* max 64-bit integer */ -#define LONGLONG_MIN (-LONGLONG_MAX -1L) /* min 64-bit integer */ - -#else -/* define a default value, even if it is never used */ -#define LONGLONG_MAX 9223372036854775807LL /* max 64-bit integer */ -#define LONGLONG_MIN (-LONGLONG_MAX -1LL) /* min 64-bit integer */ - -#endif -#endif /* end of ndef LONGLONG_MAX section */ - - -/* ================================================================= */ - - -/* The following exclusion if __CINT__ is defined is needed for ROOT */ -#ifndef __CINT__ -#include "longnam.h" -#endif - -/* global variables */ - -#define FLEN_FILENAME 1025 /* max length of a filename */ -#define FLEN_KEYWORD 72 /* max length of a keyword (HIERARCH convention) */ -#define FLEN_CARD 81 /* length of a FITS header card */ -#define FLEN_VALUE 71 /* max length of a keyword value string */ -#define FLEN_COMMENT 73 /* max length of a keyword comment string */ -#define FLEN_ERRMSG 81 /* max length of a FITSIO error message */ -#define FLEN_STATUS 31 /* max length of a FITSIO status text string */ - -#define TBIT 1 /* codes for FITS table data types */ -#define TBYTE 11 -#define TSBYTE 12 -#define TLOGICAL 14 -#define TSTRING 16 -#define TUSHORT 20 -#define TSHORT 21 -#define TUINT 30 -#define TINT 31 -#define TULONG 40 -#define TLONG 41 -#define TINT32BIT 41 /* used when returning datatype of a column */ -#define TFLOAT 42 -#define TLONGLONG 81 -#define TDOUBLE 82 -#define TCOMPLEX 83 -#define TDBLCOMPLEX 163 - -#define TYP_STRUC_KEY 10 -#define TYP_CMPRS_KEY 20 -#define TYP_SCAL_KEY 30 -#define TYP_NULL_KEY 40 -#define TYP_DIM_KEY 50 -#define TYP_RANG_KEY 60 -#define TYP_UNIT_KEY 70 -#define TYP_DISP_KEY 80 -#define TYP_HDUID_KEY 90 -#define TYP_CKSUM_KEY 100 -#define TYP_WCS_KEY 110 -#define TYP_REFSYS_KEY 120 -#define TYP_COMM_KEY 130 -#define TYP_CONT_KEY 140 -#define TYP_USER_KEY 150 - - -#define INT32BIT int /* 32-bit integer datatype. Currently this */ - /* datatype is an 'int' on all useful platforms */ - /* however, it is possible that that are cases */ - /* where 'int' is a 2-byte integer, in which case */ - /* INT32BIT would need to be defined as 'long'. */ - -#define BYTE_IMG 8 /* BITPIX code values for FITS image types */ -#define SHORT_IMG 16 -#define LONG_IMG 32 -#define LONGLONG_IMG 64 -#define FLOAT_IMG -32 -#define DOUBLE_IMG -64 - /* The following 2 codes are not true FITS */ - /* datatypes; these codes are only used internally */ - /* within cfitsio to make it easier for users */ - /* to deal with unsigned integers. */ -#define SBYTE_IMG 10 -#define USHORT_IMG 20 -#define ULONG_IMG 40 - -#define IMAGE_HDU 0 /* Primary Array or IMAGE HDU */ -#define ASCII_TBL 1 /* ASCII table HDU */ -#define BINARY_TBL 2 /* Binary table HDU */ -#define ANY_HDU -1 /* matches any HDU type */ - -#define READONLY 0 /* options when opening a file */ -#define READWRITE 1 - -/* adopt a hopefully obscure number to use as a null value flag */ -/* could be problems if the FITS files contain data with these values */ -#define FLOATNULLVALUE -9.11912E-36F -#define DOUBLENULLVALUE -9.1191291391491E-36 - -/* Image compression algorithm types */ -#define MAX_COMPRESS_DIM 6 -#define RICE_1 11 -#define GZIP_1 21 -#define PLIO_1 31 -#define HCOMPRESS_1 41 -#define NOCOMPRESS 0 - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#define CASESEN 1 /* do case-sensitive string match */ -#define CASEINSEN 0 /* do case-insensitive string match */ - -#define GT_ID_ALL_URI 0 /* hierarchical grouping parameters */ -#define GT_ID_REF 1 -#define GT_ID_POS 2 -#define GT_ID_ALL 3 -#define GT_ID_REF_URI 11 -#define GT_ID_POS_URI 12 - -#define OPT_RM_GPT 0 -#define OPT_RM_ENTRY 1 -#define OPT_RM_MBR 2 -#define OPT_RM_ALL 3 - -#define OPT_GCP_GPT 0 -#define OPT_GCP_MBR 1 -#define OPT_GCP_ALL 2 - -#define OPT_MCP_ADD 0 -#define OPT_MCP_NADD 1 -#define OPT_MCP_REPL 2 -#define OPT_MCP_MOV 3 - -#define OPT_MRG_COPY 0 -#define OPT_MRG_MOV 1 - -#define OPT_CMT_MBR 1 -#define OPT_CMT_MBR_DEL 11 - -typedef struct /* structure used to store table column information */ -{ - char ttype[70]; /* column name = FITS TTYPEn keyword; */ - LONGLONG tbcol; /* offset in row to first byte of each column */ - int tdatatype; /* datatype code of each column */ - LONGLONG trepeat; /* repeat count of column; number of elements */ - double tscale; /* FITS TSCALn linear scaling factor */ - double tzero; /* FITS TZEROn linear scaling zero point */ - LONGLONG tnull; /* FITS null value for int image or binary table cols */ - char strnull[20]; /* FITS null value string for ASCII table columns */ - char tform[10]; /* FITS tform keyword value */ - long twidth; /* width of each ASCII table column */ -}tcolumn; - -#define VALIDSTRUC 555 /* magic value used to identify if structure is valid */ - -typedef struct /* structure used to store basic FITS file information */ -{ - int filehandle; /* handle returned by the file open function */ - int driver; /* defines which set of I/O drivers should be used */ - int open_count; /* number of opened 'fitsfiles' using this structure */ - char *filename; /* file name */ - int validcode; /* magic value used to verify that structure is valid */ - int only_one; /* flag meaning only copy the specified extension */ - LONGLONG filesize; /* current size of the physical disk file in bytes */ - LONGLONG logfilesize; /* logical size of file, including unflushed buffers */ - int lasthdu; /* is this the last HDU in the file? 0 = no, else yes */ - LONGLONG bytepos; /* current logical I/O pointer position in file */ - LONGLONG io_pos; /* current I/O pointer position in the physical file */ - int curbuf; /* number of I/O buffer currently in use */ - int curhdu; /* current HDU number; 0 = primary array */ - int hdutype; /* 0 = primary array, 1 = ASCII table, 2 = binary table */ - int writemode; /* 0 = readonly, 1 = readwrite */ - int maxhdu; /* highest numbered HDU known to exist in the file */ - int MAXHDU; /* dynamically allocated dimension of headstart array */ - LONGLONG *headstart; /* byte offset in file to start of each HDU */ - LONGLONG headend; /* byte offest in file to end of the current HDU header */ - LONGLONG ENDpos; /* byte offest to where the END keyword was last written */ - LONGLONG nextkey; /* byte offset in file to beginning of next keyword */ - LONGLONG datastart; /* byte offset in file to start of the current data unit */ - int imgdim; /* dimension of image; cached for fast access */ - LONGLONG imgnaxis[99]; /* length of each axis; cached for fast access */ - int tfield; /* number of fields in the table (primary array has 2 */ - LONGLONG origrows; /* original number of rows (value of NAXIS2 keyword) */ - LONGLONG numrows; /* number of rows in the table (dynamically updated) */ - LONGLONG rowlength; /* length of a table row or image size (bytes) */ - tcolumn *tableptr; /* pointer to the table structure */ - LONGLONG heapstart; /* heap start byte relative to start of data unit */ - LONGLONG heapsize; /* size of the heap, in bytes */ - - /* the following elements are related to compressed images */ - int request_compress_type; /* requested image compression algorithm */ - long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */ - - float request_hcomp_scale; /* requested HCOMPRESS scale factor */ - int request_hcomp_smooth; /* requested HCOMPRESS smooth parameter */ - - int compressimg; /* 1 if HDU contains a compressed image, else 0 */ - char zcmptype[12]; /* compression type string */ - int compress_type; /* type of compression algorithm */ - int zbitpix; /* FITS data type of image (BITPIX) */ - int zndim; /* dimension of image */ - long znaxis[MAX_COMPRESS_DIM]; /* length of each axis */ - long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */ - long maxtilelen; /* max number of pixels in each image tile */ - long maxelem; /* maximum length of variable length arrays */ - - int cn_compressed; /* column number for COMPRESSED_DATA column */ - int cn_uncompressed; /* column number for UNCOMPRESSED_DATA column */ - int cn_zscale; /* column number for ZSCALE column */ - int cn_zzero; /* column number for ZZERO column */ - int cn_zblank; /* column number for the ZBLANK column */ - - double zscale; /* scaling value, if same for all tiles */ - double zzero; /* zero pt, if same for all tiles */ - double cn_bscale; /* value of the BSCALE keyword in header */ - double cn_bzero; /* value of the BZERO keyword in header */ - int zblank; /* value for null pixels, if not a column */ - - int rice_blocksize; /* first compression parameter: pixels/block */ - int rice_bytepix; /* 2nd compression parameter: bytes/pixel */ - float quantize_level; /* floating point quantization level */ - float hcomp_scale; /* 1st hcompress compression parameter */ - int hcomp_smooth; /* 2nd hcompress compression parameter */ - - int tilerow; /* row number of the uncompressed tiledata */ - long tiledatasize; /* length of the tile data in bytes */ - int tiletype; /* datatype of the tile (TINT, TSHORT, etc) */ - void *tiledata; /* uncompressed tile of data, for row tilerow */ - char *tilenullarray; /* optional array of null value flags */ - int tileanynull; /* anynulls in this tile? */ -} FITSfile; - -typedef struct /* structure used to store basic HDU information */ -{ - int HDUposition; /* HDU position in file; 0 = first HDU */ - FITSfile *Fptr; /* pointer to FITS file structure */ -}fitsfile; - -typedef struct /* structure for the iterator function column information */ -{ - /* elements required as input to fits_iterate_data: */ - - fitsfile *fptr; /* pointer to the HDU containing the column */ - int colnum; /* column number in the table (use name if < 1) */ - char colname[70]; /* name (= TTYPEn value) of the column (optional) */ - int datatype; /* output datatype (converted if necessary */ - int iotype; /* = InputCol, InputOutputCol, or OutputCol */ - - /* output elements that may be useful for the work function: */ - - void *array; /* pointer to the array (and the null value) */ - long repeat; /* binary table vector repeat value */ - long tlmin; /* legal minimum data value */ - long tlmax; /* legal maximum data value */ - char tunit[70]; /* physical unit string */ - char tdisp[70]; /* suggested display format */ - -} iteratorCol; - -#define InputCol 0 /* flag for input only iterator column */ -#define InputOutputCol 1 /* flag for input and output iterator column */ -#define OutputCol 2 /* flag for output only iterator column */ - -/*============================================================================= -* -* The following wtbarr typedef is used in the fits_read_wcstab() routine, -* which is intended for use with the WCSLIB library written by Mark -* Calabretta, http://www.atnf.csiro.au/~mcalabre/index.html -* -* In order to maintain WCSLIB and CFITSIO as independent libraries it -* was not permissible for any CFITSIO library code to include WCSLIB -* header files, or vice versa. However, the CFITSIO function -* fits_read_wcstab() accepts an array of structs defined by wcs.h within -* WCSLIB. The problem then was to define this struct within fitsio.h -* without including wcs.h, especially noting that wcs.h will often (but -* not always) be included together with fitsio.h in an applications -* program that uses fits_read_wcstab(). -* -* Of the various possibilities, the solution adopted was for WCSLIB to -* define "struct wtbarr" while fitsio.h defines "typedef wtbarr", a -* untagged struct with identical members. This allows both wcs.h and -* fitsio.h to define a wtbarr data type without conflict by virtue of -* the fact that structure tags and typedef names share different -* namespaces in C. Therefore, declarations within WCSLIB look like -* -* struct wtbarr *w; -* -* while within CFITSIO they are simply -* -* wtbarr *w; -* -* but as suggested by the commonality of the names, these are really the -* same aggregate data type. However, in passing a (struct wtbarr *) to -* fits_read_wcstab() a cast to (wtbarr *) is formally required. -*===========================================================================*/ - -#ifndef WCSLIB_GETWCSTAB -#define WCSLIB_GETWCSTAB - -typedef struct { - int i; /* Image axis number. */ - int m; /* Array axis number for index vectors. */ - int kind; /* Array type, 'c' (coord) or 'i' (index). */ - char extnam[72]; /* EXTNAME of binary table extension. */ - int extver; /* EXTVER of binary table extension. */ - int extlev; /* EXTLEV of binary table extension. */ - char ttype[72]; /* TTYPEn of column containing the array. */ - long row; /* Table row number. */ - int ndim; /* Expected array dimensionality. */ - int *dimlen; /* Where to write the array axis lengths. */ - double **arrayp; /* Where to write the address of the array */ - /* allocated to store the array. */ -} wtbarr; - -int fits_read_wcstab(fitsfile *fptr, int nwtb, wtbarr *wtb, int *status); - -#endif /* WCSLIB_GETWCSTAB */ - -/* error status codes */ - -#define CREATE_DISK_FILE -106 /* create disk file, without extended filename syntax */ -#define OPEN_DISK_FILE -105 /* open disk file, without extended filename syntax */ -#define SKIP_TABLE -104 /* move to 1st image when opening file */ -#define SKIP_IMAGE -103 /* move to 1st table when opening file */ -#define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */ -#define USE_MEM_BUFF -101 /* use memory buffer when opening file */ -#define OVERFLOW_ERR -11 /* overflow during datatype conversion */ -#define PREPEND_PRIMARY -9 /* used in ffiimg to insert new primary array */ -#define SAME_FILE 101 /* input and output files are the same */ -#define TOO_MANY_FILES 103 /* tried to open too many FITS files */ -#define FILE_NOT_OPENED 104 /* could not open the named file */ -#define FILE_NOT_CREATED 105 /* could not create the named file */ -#define WRITE_ERROR 106 /* error writing to FITS file */ -#define END_OF_FILE 107 /* tried to move past end of file */ -#define READ_ERROR 108 /* error reading from FITS file */ -#define FILE_NOT_CLOSED 110 /* could not close the file */ -#define ARRAY_TOO_BIG 111 /* array dimensions exceed internal limit */ -#define READONLY_FILE 112 /* Cannot write to readonly file */ -#define MEMORY_ALLOCATION 113 /* Could not allocate memory */ -#define BAD_FILEPTR 114 /* invalid fitsfile pointer */ -#define NULL_INPUT_PTR 115 /* NULL input pointer to routine */ -#define SEEK_ERROR 116 /* error seeking position in file */ - -#define BAD_URL_PREFIX 121 /* invalid URL prefix on file name */ -#define TOO_MANY_DRIVERS 122 /* tried to register too many IO drivers */ -#define DRIVER_INIT_FAILED 123 /* driver initialization failed */ -#define NO_MATCHING_DRIVER 124 /* matching driver is not registered */ -#define URL_PARSE_ERROR 125 /* failed to parse input file URL */ -#define RANGE_PARSE_ERROR 126 /* failed to parse input file URL */ - -#define SHARED_ERRBASE (150) -#define SHARED_BADARG (SHARED_ERRBASE + 1) -#define SHARED_NULPTR (SHARED_ERRBASE + 2) -#define SHARED_TABFULL (SHARED_ERRBASE + 3) -#define SHARED_NOTINIT (SHARED_ERRBASE + 4) -#define SHARED_IPCERR (SHARED_ERRBASE + 5) -#define SHARED_NOMEM (SHARED_ERRBASE + 6) -#define SHARED_AGAIN (SHARED_ERRBASE + 7) -#define SHARED_NOFILE (SHARED_ERRBASE + 8) -#define SHARED_NORESIZE (SHARED_ERRBASE + 9) - -#define HEADER_NOT_EMPTY 201 /* header already contains keywords */ -#define KEY_NO_EXIST 202 /* keyword not found in header */ -#define KEY_OUT_BOUNDS 203 /* keyword record number is out of bounds */ -#define VALUE_UNDEFINED 204 /* keyword value field is blank */ -#define NO_QUOTE 205 /* string is missing the closing quote */ -#define BAD_INDEX_KEY 206 /* illegal indexed keyword name */ -#define BAD_KEYCHAR 207 /* illegal character in keyword name or card */ -#define BAD_ORDER 208 /* required keywords out of order */ -#define NOT_POS_INT 209 /* keyword value is not a positive integer */ -#define NO_END 210 /* couldn't find END keyword */ -#define BAD_BITPIX 211 /* illegal BITPIX keyword value*/ -#define BAD_NAXIS 212 /* illegal NAXIS keyword value */ -#define BAD_NAXES 213 /* illegal NAXISn keyword value */ -#define BAD_PCOUNT 214 /* illegal PCOUNT keyword value */ -#define BAD_GCOUNT 215 /* illegal GCOUNT keyword value */ -#define BAD_TFIELDS 216 /* illegal TFIELDS keyword value */ -#define NEG_WIDTH 217 /* negative table row size */ -#define NEG_ROWS 218 /* negative number of rows in table */ -#define COL_NOT_FOUND 219 /* column with this name not found in table */ -#define BAD_SIMPLE 220 /* illegal value of SIMPLE keyword */ -#define NO_SIMPLE 221 /* Primary array doesn't start with SIMPLE */ -#define NO_BITPIX 222 /* Second keyword not BITPIX */ -#define NO_NAXIS 223 /* Third keyword not NAXIS */ -#define NO_NAXES 224 /* Couldn't find all the NAXISn keywords */ -#define NO_XTENSION 225 /* HDU doesn't start with XTENSION keyword */ -#define NOT_ATABLE 226 /* the CHDU is not an ASCII table extension */ -#define NOT_BTABLE 227 /* the CHDU is not a binary table extension */ -#define NO_PCOUNT 228 /* couldn't find PCOUNT keyword */ -#define NO_GCOUNT 229 /* couldn't find GCOUNT keyword */ -#define NO_TFIELDS 230 /* couldn't find TFIELDS keyword */ -#define NO_TBCOL 231 /* couldn't find TBCOLn keyword */ -#define NO_TFORM 232 /* couldn't find TFORMn keyword */ -#define NOT_IMAGE 233 /* the CHDU is not an IMAGE extension */ -#define BAD_TBCOL 234 /* TBCOLn keyword value < 0 or > rowlength */ -#define NOT_TABLE 235 /* the CHDU is not a table */ -#define COL_TOO_WIDE 236 /* column is too wide to fit in table */ -#define COL_NOT_UNIQUE 237 /* more than 1 column name matches template */ -#define BAD_ROW_WIDTH 241 /* sum of column widths not = NAXIS1 */ -#define UNKNOWN_EXT 251 /* unrecognizable FITS extension type */ -#define UNKNOWN_REC 252 /* unrecognizable FITS record */ -#define END_JUNK 253 /* END keyword is not blank */ -#define BAD_HEADER_FILL 254 /* Header fill area not blank */ -#define BAD_DATA_FILL 255 /* Data fill area not blank or zero */ -#define BAD_TFORM 261 /* illegal TFORM format code */ -#define BAD_TFORM_DTYPE 262 /* unrecognizable TFORM datatype code */ -#define BAD_TDIM 263 /* illegal TDIMn keyword value */ -#define BAD_HEAP_PTR 264 /* invalid BINTABLE heap address */ - -#define BAD_HDU_NUM 301 /* HDU number < 1 or > MAXHDU */ -#define BAD_COL_NUM 302 /* column number < 1 or > tfields */ -#define NEG_FILE_POS 304 /* tried to move before beginning of file */ -#define NEG_BYTES 306 /* tried to read or write negative bytes */ -#define BAD_ROW_NUM 307 /* illegal starting row number in table */ -#define BAD_ELEM_NUM 308 /* illegal starting element number in vector */ -#define NOT_ASCII_COL 309 /* this is not an ASCII string column */ -#define NOT_LOGICAL_COL 310 /* this is not a logical datatype column */ -#define BAD_ATABLE_FORMAT 311 /* ASCII table column has wrong format */ -#define BAD_BTABLE_FORMAT 312 /* Binary table column has wrong format */ -#define NO_NULL 314 /* null value has not been defined */ -#define NOT_VARI_LEN 317 /* this is not a variable length column */ -#define BAD_DIMEN 320 /* illegal number of dimensions in array */ -#define BAD_PIX_NUM 321 /* first pixel number greater than last pixel */ -#define ZERO_SCALE 322 /* illegal BSCALE or TSCALn keyword = 0 */ -#define NEG_AXIS 323 /* illegal axis length < 1 */ - -#define NOT_GROUP_TABLE 340 -#define HDU_ALREADY_MEMBER 341 -#define MEMBER_NOT_FOUND 342 -#define GROUP_NOT_FOUND 343 -#define BAD_GROUP_ID 344 -#define TOO_MANY_HDUS_TRACKED 345 -#define HDU_ALREADY_TRACKED 346 -#define BAD_OPTION 347 -#define IDENTICAL_POINTERS 348 -#define BAD_GROUP_ATTACH 349 -#define BAD_GROUP_DETACH 350 - -#define BAD_I2C 401 /* bad int to formatted string conversion */ -#define BAD_F2C 402 /* bad float to formatted string conversion */ -#define BAD_INTKEY 403 /* can't interprete keyword value as integer */ -#define BAD_LOGICALKEY 404 /* can't interprete keyword value as logical */ -#define BAD_FLOATKEY 405 /* can't interprete keyword value as float */ -#define BAD_DOUBLEKEY 406 /* can't interprete keyword value as double */ -#define BAD_C2I 407 /* bad formatted string to int conversion */ -#define BAD_C2F 408 /* bad formatted string to float conversion */ -#define BAD_C2D 409 /* bad formatted string to double conversion */ -#define BAD_DATATYPE 410 /* bad keyword datatype code */ -#define BAD_DECIM 411 /* bad number of decimal places specified */ -#define NUM_OVERFLOW 412 /* overflow during datatype conversion */ - -# define DATA_COMPRESSION_ERR 413 /* error in imcompress routines */ -# define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */ -# define NO_COMPRESSED_TILE 415 /* compressed tile doesn't exist */ - -#define BAD_DATE 420 /* error in date or time conversion */ - -#define PARSE_SYNTAX_ERR 431 /* syntax error in parser expression */ -#define PARSE_BAD_TYPE 432 /* expression did not evaluate to desired type */ -#define PARSE_LRG_VECTOR 433 /* vector result too large to return in array */ -#define PARSE_NO_OUTPUT 434 /* data parser failed not sent an out column */ -#define PARSE_BAD_COL 435 /* bad data encounter while parsing column */ -#define PARSE_BAD_OUTPUT 436 /* Output file not of proper type */ - -#define ANGLE_TOO_BIG 501 /* celestial angle too large for projection */ -#define BAD_WCS_VAL 502 /* bad celestial coordinate or pixel value */ -#define WCS_ERROR 503 /* error in celestial coordinate calculation */ -#define BAD_WCS_PROJ 504 /* unsupported type of celestial projection */ -#define NO_WCS_KEY 505 /* celestial coordinate keywords not found */ -#define APPROX_WCS_KEY 506 /* approximate WCS keywords were calculated */ - -#define NO_CLOSE_ERROR 999 /* special value used internally to switch off */ - /* the error message from ffclos and ffchdu */ - -/*------- following error codes are used in the grparser.c file -----------*/ -#define NGP_ERRBASE (360) /* base chosen so not to interfere with CFITSIO */ -#define NGP_OK (0) -#define NGP_NO_MEMORY (NGP_ERRBASE + 0) /* malloc failed */ -#define NGP_READ_ERR (NGP_ERRBASE + 1) /* read error from file */ -#define NGP_NUL_PTR (NGP_ERRBASE + 2) /* null pointer passed as argument */ -#define NGP_EMPTY_CURLINE (NGP_ERRBASE + 3) /* line read seems to be empty */ -#define NGP_UNREAD_QUEUE_FULL (NGP_ERRBASE + 4) /* cannot unread more then 1 line (or single line twice) */ -#define NGP_INC_NESTING (NGP_ERRBASE + 5) /* too deep include file nesting (inf. loop ?) */ -#define NGP_ERR_FOPEN (NGP_ERRBASE + 6) /* fopen() failed, cannot open file */ -#define NGP_EOF (NGP_ERRBASE + 7) /* end of file encountered */ -#define NGP_BAD_ARG (NGP_ERRBASE + 8) /* bad arguments passed */ -#define NGP_TOKEN_NOT_EXPECT (NGP_ERRBASE + 9) /* token not expected here */ - -/* The following exclusion if __CINT__ is defined is needed for ROOT */ -#ifndef __CINT__ -/* the following 3 lines are needed to support C++ compilers */ -#ifdef __cplusplus -extern "C" { -#endif -#endif - -int CFITS2Unit( fitsfile *fptr ); -fitsfile* CUnit2FITS(int unit); - -/*---------------- FITS file URL parsing routines -------------*/ -int fits_get_token(char **ptr, char *delimiter, char *token, int *isanumber); -char *fits_split_names(char *list); -int ffiurl( char *url, char *urltype, char *infile, - char *outfile, char *extspec, char *rowfilter, - char *binspec, char *colspec, int *status); -int ffifile (char *url, char *urltype, char *infile, - char *outfile, char *extspec, char *rowfilter, - char *binspec, char *colspec, char *pixfilter, int *status); -int ffrtnm(char *url, char *rootname, int *status); -int ffexist(const char *infile, int *exists, int *status); -int ffexts(char *extspec, int *extnum, char *extname, int *extvers, - int *hdutype, char *colname, char *rowexpress, int *status); -int ffextn(char *url, int *extension_num, int *status); -int ffurlt(fitsfile *fptr, char *urlType, int *status); -int ffbins(char *binspec, int *imagetype, int *haxis, - char colname[4][FLEN_VALUE], double *minin, - double *maxin, double *binsizein, - char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], - char binname[4][FLEN_VALUE], double *weight, char *wtname, - int *recip, int *status); -int ffbinr(char **binspec, char *colname, double *minin, - double *maxin, double *binsizein, char *minname, - char *maxname, char *binname, int *status); -int fits_copy_cell2image(fitsfile *fptr, fitsfile *newptr, char *colname, - long rownum, int *status); -int fits_copy_image2cell(fitsfile *fptr, fitsfile *newptr, char *colname, - long rownum, int copykeyflag, int *status); -int fits_copy_pixlist2image(fitsfile *infptr, fitsfile *outfptr, int firstkey, /* I - first HDU record number to start with */ - int naxis, int *colnum, int *status); -int ffimport_file( char *filename, char **contents, int *status ); -int ffrwrg( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges, - long *minrow, long *maxrow, int *status); -int ffrwrgll( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges, - LONGLONG *minrow, LONGLONG *maxrow, int *status); -/*---------------- FITS file I/O routines -------------*/ -int ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr, - size_t *buffsize, size_t deltasize, - void *(*mem_realloc)(void *p, size_t newsize), - int *status); -int ffopen(fitsfile **fptr, const char *filename, int iomode, int *status); -int ffopentest(double version, fitsfile **fptr, const char *filename, int iomode, int *status); - -int ffdopn(fitsfile **fptr, const char *filename, int iomode, int *status); -int fftopn(fitsfile **fptr, const char *filename, int iomode, int *status); -int ffiopn(fitsfile **fptr, const char *filename, int iomode, int *status); -int ffdkopn(fitsfile **fptr, const char *filename, int iomode, int *status); -int ffreopen(fitsfile *openfptr, fitsfile **newfptr, int *status); -int ffinit( fitsfile **fptr, const char *filename, int *status); -int ffdkinit(fitsfile **fptr, const char *filename, int *status); -int ffimem(fitsfile **fptr, void **buffptr, - size_t *buffsize, size_t deltasize, - void *(*mem_realloc)(void *p, size_t newsize), - int *status); -int fftplt(fitsfile **fptr, const char *filename, const char *tempname, - int *status); -int ffflus(fitsfile *fptr, int *status); -int ffflsh(fitsfile *fptr, int clearbuf, int *status); -int ffclos(fitsfile *fptr, int *status); -int ffdelt(fitsfile *fptr, int *status); -int ffflnm(fitsfile *fptr, char *filename, int *status); -int ffflmd(fitsfile *fptr, int *filemode, int *status); - -/*---------------- utility routines -------------*/ - -float ffvers(float *version); -void ffupch(char *string); -void ffgerr(int status, char *errtext); -void ffpmsg(const char *err_message); -void ffpmrk(void); -int ffgmsg(char *err_message); -void ffcmsg(void); -void ffcmrk(void); -void ffrprt(FILE *stream, int status); -void ffcmps(char *templt, char *colname, int casesen, int *match, - int *exact); -int fftkey(const char *keyword, int *status); -int fftrec(char *card, int *status); -int ffnchk(fitsfile *fptr, int *status); -int ffkeyn(const char *keyroot, int value, char *keyname, int *status); -int ffnkey(int value, char *keyroot, char *keyname, int *status); -int ffgkcl(char *card); -int ffdtyp(char *cval, char *dtype, int *status); -int ffpsvc(char *card, char *value, char *comm, int *status); -int ffgknm(char *card, char *name, int *length, int *status); -int ffgthd(char *tmplt, char *card, int *hdtype, int *status); -int fits_translate_keyword(char *inrec, char *outrec, char *patterns[][2], - int npat, int n_value, int n_offset, int n_range, int *pat_num, - int *i, int *j, int *m, int *n, int *status); -int fits_translate_keywords(fitsfile *infptr, fitsfile *outfptr, - int firstkey, char *patterns[][2], - int npat, int n_value, int n_offset, int n_range, int *status); -int ffasfm(char *tform, int *datacode, long *width, int *decim, int *status); -int ffbnfm(char *tform, int *datacode, long *repeat, long *width, int *status); -int ffbnfmll(char *tform, int *datacode, LONGLONG *repeat, long *width, int *status); -int ffgabc(int tfields, char **tform, int space, long *rowlen, long *tbcol, - int *status); -int fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre, - int *status); -/* ffmbyt should not normally be used in application programs, but it is - defined here as a publicly available routine because there are a few - rare cases where it is needed -*/ -int ffmbyt(fitsfile *fptr, LONGLONG bytpos, int ignore_err, int *status); -/*----------------- write single keywords --------------*/ -int ffpky(fitsfile *fptr, int datatype, const char *keyname, void *value, - const char *comm, int *status); -int ffprec(fitsfile *fptr, const char *card, int *status); -int ffpcom(fitsfile *fptr, const char *comm, int *status); -int ffpunt(fitsfile *fptr, const char *keyname, char *unit, int *status); -int ffphis(fitsfile *fptr, const char *history, int *status); -int ffpdat(fitsfile *fptr, int *status); -int ffverifydate(int year, int month, int day, int *status); -int ffgstm(char *timestr, int *timeref, int *status); -int ffgsdt(int *day, int *month, int *year, int *status); -int ffdt2s(int year, int month, int day, char *datestr, int *status); -int fftm2s(int year, int month, int day, int hour, int minute, double second, - int decimals, char *datestr, int *status); -int ffs2dt(char *datestr, int *year, int *month, int *day, int *status); -int ffs2tm(char *datestr, int *year, int *month, int *day, int *hour, - int *minute, double *second, int *status); -int ffpkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status); -int ffpkys(fitsfile *fptr, const char *keyname, char *value, const char *comm,int *status); -int ffpkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); -int ffplsw(fitsfile *fptr, int *status); -int ffpkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status); -int ffpkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status); -int ffpkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, - int *status); -int ffpkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, - int *status); -int ffpkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, - int *status); -int ffpkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, - int *status); -int ffpkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, - int *status); -int ffpkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, - int *status); -int ffpkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, - int *status); -int ffpkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, - int *status); -int ffpkyt(fitsfile *fptr, const char *keyname, long intval, double frac, const char *comm, - int *status); -int ffptdm( fitsfile *fptr, int colnum, int naxis, long naxes[], int *status); -int ffptdmll( fitsfile *fptr, int colnum, int naxis, LONGLONG naxes[], int *status); - -/*----------------- write array of keywords --------------*/ -int ffpkns(fitsfile *fptr, const char *keyroot, int nstart, int nkey, char *value[], - char *comm[], int *status); -int ffpknl(fitsfile *fptr, const char *keyroot, int nstart, int nkey, int *value, - char *comm[], int *status); -int ffpknj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, long *value, - char *comm[], int *status); -int ffpknjj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, LONGLONG *value, - char *comm[], int *status); -int ffpknf(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value, - int decim, char *comm[], int *status); -int ffpkne(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value, - int decim, char *comm[], int *status); -int ffpkng(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value, - int decim, char *comm[], int *status); -int ffpknd(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value, - int decim, char *comm[], int *status); -int ffcpky(fitsfile *infptr,fitsfile *outfptr,int incol,int outcol, - char *rootname, int *status); - -/*----------------- write required header keywords --------------*/ -int ffphps( fitsfile *fptr, int bitpix, int naxis, long naxes[], int *status); -int ffphpsll( fitsfile *fptr, int bitpix, int naxis, LONGLONG naxes[], int *status); -int ffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], - LONGLONG pcount, LONGLONG gcount, int extend, int *status); -int ffphprll( fitsfile *fptr, int simple, int bitpix, int naxis, LONGLONG naxes[], - LONGLONG pcount, LONGLONG gcount, int extend, int *status); -int ffphtb(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype, - long *tbcol, char **tform, char **tunit, const char *extname, int *status); -int ffphbn(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, - char **tform, char **tunit, const char *extname, LONGLONG pcount, int *status); -int ffphext( fitsfile *fptr, const char *xtension, int bitpix, int naxis, long naxes[], - LONGLONG pcount, LONGLONG gcount, int *status); -/*----------------- write template keywords --------------*/ -int ffpktp(fitsfile *fptr, const char *filename, int *status); - -/*------------------ get header information --------------*/ -int ffghsp(fitsfile *fptr, int *nexist, int *nmore, int *status); -int ffghps(fitsfile *fptr, int *nexist, int *position, int *status); - -/*------------------ move position in header -------------*/ -int ffmaky(fitsfile *fptr, int nrec, int *status); -int ffmrky(fitsfile *fptr, int nrec, int *status); - -/*------------------ read single keywords -----------------*/ -int ffgnxk(fitsfile *fptr, char **inclist, int ninc, char **exclist, - int nexc, char *card, int *status); -int ffgrec(fitsfile *fptr, int nrec, char *card, int *status); -int ffgcrd(fitsfile *fptr, const char *keyname, char *card, int *status); -int ffgunt(fitsfile *fptr, const char *keyname, char *unit, int *status); -int ffgkyn(fitsfile *fptr, int nkey, char *keyname, char *keyval, char *comm, - int *status); -int ffgkey(fitsfile *fptr, const char *keyname, char *keyval, char *comm, - int *status); - -int ffgky( fitsfile *fptr, int datatype, const char *keyname, void *value, - char *comm, int *status); -int ffgkys(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status); -int ffgkls(fitsfile *fptr, const char *keyname, char **value, char *comm, int *status) -; -int ffgkyl(fitsfile *fptr, const char *keyname, int *value, char *comm, int *status); -int ffgkyj(fitsfile *fptr, const char *keyname, long *value, char *comm, int *status); -int ffgkyjj(fitsfile *fptr, const char *keyname, LONGLONG *value, char *comm, int *status); -int ffgkye(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status); -int ffgkyd(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status); -int ffgkyc(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status); -int ffgkym(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status); -int ffgkyt(fitsfile *fptr, const char *keyname, long *ivalue, double *dvalue, - char *comm, int *status); -int ffgtdm(fitsfile *fptr, int colnum, int maxdim, int *naxis, long naxes[], - int *status); -int ffgtdmll(fitsfile *fptr, int colnum, int maxdim, int *naxis, LONGLONG naxes[], - int *status); -int ffdtdm(fitsfile *fptr, char *tdimstr, int colnum, int maxdim, - int *naxis, long naxes[], int *status); -int ffdtdmll(fitsfile *fptr, char *tdimstr, int colnum, int maxdim, - int *naxis, LONGLONG naxes[], int *status); - -/*------------------ read array of keywords -----------------*/ -int ffgkns(fitsfile *fptr, const char *keyname, int nstart, int nmax, char *value[], - int *nfound, int *status); -int ffgknl(fitsfile *fptr, const char *keyname, int nstart, int nmax, int *value, - int *nfound, int *status); -int ffgknj(fitsfile *fptr, const char *keyname, int nstart, int nmax, long *value, - int *nfound, int *status); -int ffgknjj(fitsfile *fptr, const char *keyname, int nstart, int nmax, LONGLONG *value, - int *nfound, int *status); -int ffgkne(fitsfile *fptr, const char *keyname, int nstart, int nmax, float *value, - int *nfound, int *status); -int ffgknd(fitsfile *fptr, const char *keyname, int nstart, int nmax, double *value, - int *nfound, int *status); -int ffh2st(fitsfile *fptr, char **header, int *status); -int ffhdr2str( fitsfile *fptr, int exclude_comm, char **exclist, - int nexc, char **header, int *nkeys, int *status); - -/*----------------- read required header keywords --------------*/ -int ffghpr(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, - long naxes[], long *pcount, long *gcount, int *extend, int *status); - -int ffghprll(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, - LONGLONG naxes[], long *pcount, long *gcount, int *extend, int *status); - -int ffghtb(fitsfile *fptr,int maxfield, long *naxis1, long *naxis2, - int *tfields, char **ttype, long *tbcol, char **tform, char **tunit, - char *extname, int *status); - -int ffghtbll(fitsfile *fptr,int maxfield, LONGLONG *naxis1, LONGLONG *naxis2, - int *tfields, char **ttype, LONGLONG *tbcol, char **tform, char **tunit, - char *extname, int *status); - - -int ffghbn(fitsfile *fptr, int maxfield, long *naxis2, int *tfields, - char **ttype, char **tform, char **tunit, char *extname, - long *pcount, int *status); - -int ffghbnll(fitsfile *fptr, int maxfield, LONGLONG *naxis2, int *tfields, - char **ttype, char **tform, char **tunit, char *extname, - LONGLONG *pcount, int *status); - -/*--------------------- update keywords ---------------*/ -int ffuky(fitsfile *fptr, int datatype, const char *keyname, void *value, - char *comm, int *status); -int ffucrd(fitsfile *fptr, const char *keyname, char *card, int *status); -int ffukyu(fitsfile *fptr, const char *keyname, char *comm, int *status); -int ffukys(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status); -int ffukls(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status); -int ffukyl(fitsfile *fptr, const char *keyname, int value, char *comm, int *status); -int ffukyj(fitsfile *fptr, const char *keyname, LONGLONG value, char *comm, int *status); -int ffukyf(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffukye(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffukyg(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffukyd(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffukyc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffukym(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); -int ffukfc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffukfm(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); - -/*--------------------- modify keywords ---------------*/ -int ffmrec(fitsfile *fptr, int nkey, char *card, int *status); -int ffmcrd(fitsfile *fptr, const char *keyname, char *card, int *status); -int ffmnam(fitsfile *fptr, const char *oldname, const char *newname, int *status); -int ffmcom(fitsfile *fptr, const char *keyname, char *comm, int *status); -int ffmkyu(fitsfile *fptr, const char *keyname, char *comm, int *status); -int ffmkys(fitsfile *fptr, const char *keyname, char *value, char *comm,int *status); -int ffmkls(fitsfile *fptr, const char *keyname, char *value, char *comm,int *status); -int ffmkyl(fitsfile *fptr, const char *keyname, int value, char *comm, int *status); -int ffmkyj(fitsfile *fptr, const char *keyname, LONGLONG value, char *comm, int *status); -int ffmkyf(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffmkye(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffmkyg(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffmkyd(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffmkyc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffmkym(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); -int ffmkfc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffmkfm(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); - -/*--------------------- insert keywords ---------------*/ -int ffirec(fitsfile *fptr, int nkey, char *card, int *status); -int ffikey(fitsfile *fptr, char *card, int *status); -int ffikyu(fitsfile *fptr, const char *keyname, char *comm, int *status); -int ffikys(fitsfile *fptr, const char *keyname, char *value, char *comm,int *status); -int ffikls(fitsfile *fptr, const char *keyname, char *value, char *comm,int *status); -int ffikyl(fitsfile *fptr, const char *keyname, int value, char *comm, int *status); -int ffikyj(fitsfile *fptr, const char *keyname, LONGLONG value, char *comm, int *status); -int ffikyf(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffikye(fitsfile *fptr, const char *keyname, float value, int decim, char *comm, - int *status); -int ffikyg(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffikyd(fitsfile *fptr, const char *keyname, double value, int decim, char *comm, - int *status); -int ffikyc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffikym(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); -int ffikfc(fitsfile *fptr, const char *keyname, float *value, int decim, char *comm, - int *status); -int ffikfm(fitsfile *fptr, const char *keyname, double *value, int decim, char *comm, - int *status); - -/*--------------------- delete keywords ---------------*/ -int ffdkey(fitsfile *fptr, const char *keyname, int *status); -int ffdrec(fitsfile *fptr, int keypos, int *status); - -/*--------------------- get HDU information -------------*/ -int ffghdn(fitsfile *fptr, int *chdunum); -int ffghdt(fitsfile *fptr, int *exttype, int *status); -int ffghad(fitsfile *fptr, long *headstart, long *datastart, long *dataend, - int *status); -int ffghadll(fitsfile *fptr, LONGLONG *headstart, LONGLONG *datastart, - LONGLONG *dataend, int *status); -int ffghof(fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend, - int *status); -int ffgipr(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis, - long *naxes, int *status); -int ffgiprll(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis, - LONGLONG *naxes, int *status); -int ffgidt(fitsfile *fptr, int *imgtype, int *status); -int ffgiet(fitsfile *fptr, int *imgtype, int *status); -int ffgidm(fitsfile *fptr, int *naxis, int *status); -int ffgisz(fitsfile *fptr, int nlen, long *naxes, int *status); -int ffgiszll(fitsfile *fptr, int nlen, LONGLONG *naxes, int *status); - -/*--------------------- HDU operations -------------*/ -int ffmahd(fitsfile *fptr, int hdunum, int *exttype, int *status); -int ffmrhd(fitsfile *fptr, int hdumov, int *exttype, int *status); -int ffmnhd(fitsfile *fptr, int exttype, char *hduname, int hduvers, - int *status); -int ffthdu(fitsfile *fptr, int *nhdu, int *status); -int ffcrhd(fitsfile *fptr, int *status); -int ffcrim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); -int ffcrimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); -int ffcrtb(fitsfile *fptr, int tbltype, LONGLONG naxis2, int tfields, char **ttype, - char **tform, char **tunit, const char *extname, int *status); -int ffiimg(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); -int ffiimgll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); -int ffitab(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype, - long *tbcol, char **tform, char **tunit, const char *extname, int *status); -int ffibin(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, char **tform, - char **tunit, const char *extname, LONGLONG pcount, int *status); -int ffrsim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); -int ffrsimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); -int ffdhdu(fitsfile *fptr, int *hdutype, int *status); -int ffcopy(fitsfile *infptr, fitsfile *outfptr, int morekeys, int *status); -int ffcpfl(fitsfile *infptr, fitsfile *outfptr, int prev, int cur, int follow, - int *status); -int ffcphd(fitsfile *infptr, fitsfile *outfptr, int *status); -int ffcpdt(fitsfile *infptr, fitsfile *outfptr, int *status); -int ffchfl(fitsfile *fptr, int *status); -int ffcdfl(fitsfile *fptr, int *status); -int ffwrhdu(fitsfile *fptr, FILE *outstream, int *status); - -int ffrdef(fitsfile *fptr, int *status); -int ffhdef(fitsfile *fptr, int morekeys, int *status); -int ffpthp(fitsfile *fptr, long theap, int *status); - -int ffcsum(fitsfile *fptr, long nrec, unsigned long *sum, int *status); -void ffesum(unsigned long sum, int complm, char *ascii); -unsigned long ffdsum(char *ascii, int complm, unsigned long *sum); -int ffpcks(fitsfile *fptr, int *status); -int ffupck(fitsfile *fptr, int *status); -int ffvcks(fitsfile *fptr, int *datastatus, int *hdustatus, int *status); -int ffgcks(fitsfile *fptr, unsigned long *datasum, unsigned long *hdusum, - int *status); - -/*--------------------- define scaling or null values -------------*/ -int ffpscl(fitsfile *fptr, double scale, double zero, int *status); -int ffpnul(fitsfile *fptr, LONGLONG nulvalue, int *status); -int fftscl(fitsfile *fptr, int colnum, double scale, double zero, int *status); -int fftnul(fitsfile *fptr, int colnum, LONGLONG nulvalue, int *status); -int ffsnul(fitsfile *fptr, int colnum, char *nulstring, int *status); - -/*--------------------- get column information -------------*/ -int ffgcno(fitsfile *fptr, int casesen, char *templt, int *colnum, - int *status); -int ffgcnn(fitsfile *fptr, int casesen, char *templt, char *colname, - int *colnum, int *status); - -int ffgtcl(fitsfile *fptr, int colnum, int *typecode, long *repeat, - long *width, int *status); -int ffgtclll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, - LONGLONG *width, int *status); -int ffeqty(fitsfile *fptr, int colnum, int *typecode, long *repeat, - long *width, int *status); -int ffeqtyll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, - LONGLONG *width, int *status); -int ffgncl(fitsfile *fptr, int *ncols, int *status); -int ffgnrw(fitsfile *fptr, long *nrows, int *status); -int ffgnrwll(fitsfile *fptr, LONGLONG *nrows, int *status); -int ffgacl(fitsfile *fptr, int colnum, char *ttype, long *tbcol, - char *tunit, char *tform, double *tscal, double *tzero, - char *tnull, char *tdisp, int *status); -int ffgbcl(fitsfile *fptr, int colnum, char *ttype, char *tunit, - char *dtype, long *repeat, double *tscal, double *tzero, - long *tnull, char *tdisp, int *status); -int ffgbclll(fitsfile *fptr, int colnum, char *ttype, char *tunit, - char *dtype, LONGLONG *repeat, double *tscal, double *tzero, - LONGLONG *tnull, char *tdisp, int *status); -int ffgrsz(fitsfile *fptr, long *nrows, int *status); -int ffgcdw(fitsfile *fptr, int colnum, int *width, int *status); - -/*--------------------- read primary array or image elements -------------*/ -int ffgpxv(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, - void *nulval, void *array, int *anynul, int *status); -int ffgpxvll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, - void *nulval, void *array, int *anynul, int *status); -int ffgpxf(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, - void *array, char *nullarray, int *anynul, int *status); -int ffgpxfll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, - void *array, char *nullarray, int *anynul, int *status); -int ffgsv(fitsfile *fptr, int datatype, long *blc, long *trc, long *inc, - void *nulval, void *array, int *anynul, int *status); - -int ffgpv(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, - void *nulval, void *array, int *anynul, int *status); -int ffgpf(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, - void *array, char *nullarray, int *anynul, int *status); -int ffgpvb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, unsigned - char nulval, unsigned char *array, int *anynul, int *status); -int ffgpvsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, signed - char nulval, signed char *array, int *anynul, int *status); -int ffgpvui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned short nulval, unsigned short *array, int *anynul, - int *status); -int ffgpvi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - short nulval, short *array, int *anynul, int *status); -int ffgpvuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned long nulval, unsigned long *array, int *anynul, - int *status); -int ffgpvj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - long nulval, long *array, int *anynul, int *status); -int ffgpvjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - LONGLONG nulval, LONGLONG *array, int *anynul, int *status); -int ffgpvuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned int nulval, unsigned int *array, int *anynul, int *status); -int ffgpvk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - int nulval, int *array, int *anynul, int *status); -int ffgpve(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - float nulval, float *array, int *anynul, int *status); -int ffgpvd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - double nulval, double *array, int *anynul, int *status); - -int ffgpfb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned char *array, char *nularray, int *anynul, int *status); -int ffgpfsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - signed char *array, char *nularray, int *anynul, int *status); -int ffgpfui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned short *array, char *nularray, int *anynul, int *status); -int ffgpfi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - short *array, char *nularray, int *anynul, int *status); -int ffgpfuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned long *array, char *nularray, int *anynul, int *status); -int ffgpfj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - long *array, char *nularray, int *anynul, int *status); -int ffgpfjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - LONGLONG *array, char *nularray, int *anynul, int *status); -int ffgpfuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned int *array, char *nularray, int *anynul, int *status); -int ffgpfk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - int *array, char *nularray, int *anynul, int *status); -int ffgpfe(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - float *array, char *nularray, int *anynul, int *status); -int ffgpfd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - double *array, char *nularray, int *anynul, int *status); - -int ffg2db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, unsigned char *array, - int *anynul, int *status); -int ffg2dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, signed char *array, - int *anynul, int *status); -int ffg2dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, unsigned short *array, - int *anynul, int *status); -int ffg2di(fitsfile *fptr, long group, short nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, short *array, - int *anynul, int *status); -int ffg2duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, unsigned long *array, - int *anynul, int *status); -int ffg2dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, long *array, - int *anynul, int *status); -int ffg2djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, LONGLONG *array, - int *anynul, int *status); -int ffg2duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, unsigned int *array, - int *anynul, int *status); -int ffg2dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, int *array, - int *anynul, int *status); -int ffg2de(fitsfile *fptr, long group, float nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, float *array, - int *anynul, int *status); -int ffg2dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols, - LONGLONG naxis1, LONGLONG naxis2, double *array, - int *anynul, int *status); - -int ffg3db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - unsigned char *array, int *anynul, int *status); -int ffg3dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - signed char *array, int *anynul, int *status); -int ffg3dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - unsigned short *array, int *anynul, int *status); -int ffg3di(fitsfile *fptr, long group, short nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - short *array, int *anynul, int *status); -int ffg3duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - unsigned long *array, int *anynul, int *status); -int ffg3dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - long *array, int *anynul, int *status); -int ffg3djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - LONGLONG *array, int *anynul, int *status); -int ffg3duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - unsigned int *array, int *anynul, int *status); -int ffg3dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - int *array, int *anynul, int *status); -int ffg3de(fitsfile *fptr, long group, float nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - float *array, int *anynul, int *status); -int ffg3dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols, - LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, - double *array, int *anynul, int *status); - -int ffgsvb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned char nulval, unsigned char *array, - int *anynul, int *status); -int ffgsvsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, signed char nulval, signed char *array, - int *anynul, int *status); -int ffgsvui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned short nulval, unsigned short *array, - int *anynul, int *status); -int ffgsvi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, short nulval, short *array, int *anynul, int *status); -int ffgsvuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned long nulval, unsigned long *array, - int *anynul, int *status); -int ffgsvj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, long nulval, long *array, int *anynul, int *status); -int ffgsvjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, LONGLONG nulval, LONGLONG *array, int *anynul, - int *status); -int ffgsvuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned int nulval, unsigned int *array, - int *anynul, int *status); -int ffgsvk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, int nulval, int *array, int *anynul, int *status); -int ffgsve(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, float nulval, float *array, int *anynul, int *status); -int ffgsvd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, double nulval, double *array, int *anynul, - int *status); - -int ffgsfb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned char *array, char *flagval, - int *anynul, int *status); -int ffgsfsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, signed char *array, char *flagval, - int *anynul, int *status); -int ffgsfui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned short *array, char *flagval, int *anynul, - int *status); -int ffgsfi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, short *array, char *flagval, int *anynul, int *status); -int ffgsfuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned long *array, char *flagval, int *anynul, - int *status); -int ffgsfj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, long *array, char *flagval, int *anynul, int *status); -int ffgsfjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, LONGLONG *array, char *flagval, int *anynul, - int *status); -int ffgsfuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, unsigned int *array, char *flagval, int *anynul, - int *status); -int ffgsfk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, int *array, char *flagval, int *anynul, int *status); -int ffgsfe(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, float *array, char *flagval, int *anynul, int *status); -int ffgsfd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, - long *trc, long *inc, double *array, char *flagval, int *anynul, - int *status); - -int ffggpb(fitsfile *fptr, long group, long firstelem, long nelem, - unsigned char *array, int *status); -int ffggpsb(fitsfile *fptr, long group, long firstelem, long nelem, - signed char *array, int *status); -int ffggpui(fitsfile *fptr, long group, long firstelem, long nelem, - unsigned short *array, int *status); -int ffggpi(fitsfile *fptr, long group, long firstelem, long nelem, - short *array, int *status); -int ffggpuj(fitsfile *fptr, long group, long firstelem, long nelem, - unsigned long *array, int *status); -int ffggpj(fitsfile *fptr, long group, long firstelem, long nelem, - long *array, int *status); -int ffggpjj(fitsfile *fptr, long group, long firstelem, long nelem, - LONGLONG *array, int *status); -int ffggpuk(fitsfile *fptr, long group, long firstelem, long nelem, - unsigned int *array, int *status); -int ffggpk(fitsfile *fptr, long group, long firstelem, long nelem, - int *array, int *status); -int ffggpe(fitsfile *fptr, long group, long firstelem, long nelem, - float *array, int *status); -int ffggpd(fitsfile *fptr, long group, long firstelem, long nelem, - double *array, int *status); - -/*--------------------- read column elements -------------*/ -int ffgcv( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, - LONGLONG firstelem, LONGLONG nelem, void *nulval, void *array, int *anynul, - int *status); -int ffgcf( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, - LONGLONG firstelem, LONGLONG nelem, void *array, char *nullarray, - int *anynul, int *status); -int ffgcvs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char *nulval, char **array, int *anynul, int *status); -int ffgcl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char *array, int *status); -int ffgcvl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char nulval, char *array, int *anynul, int *status); -int ffgcvb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned char nulval, unsigned char *array, - int *anynul, int *status); -int ffgcvsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, signed char nulval, signed char *array, - int *anynul, int *status); -int ffgcvui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned short nulval, unsigned short *array, - int *anynul, int *status); -int ffgcvi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, short nulval, short *array, int *anynul, int *status); -int ffgcvuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned long nulval, unsigned long *array, int *anynul, - int *status); -int ffgcvj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, long nulval, long *array, int *anynul, int *status); -int ffgcvjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, LONGLONG nulval, LONGLONG *array, int *anynul, - int *status); -int ffgcvuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned int nulval, unsigned int *array, int *anynul, - int *status); -int ffgcvk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, int nulval, int *array, int *anynul, int *status); -int ffgcve(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float nulval, float *array, int *anynul, int *status); -int ffgcvd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double nulval, double *array, int *anynul, int *status); -int ffgcvc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float nulval, float *array, int *anynul, int *status); -int ffgcvm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double nulval, double *array, int *anynul, int *status); - -int ffgcx(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstbit, - LONGLONG nbits, char *larray, int *status); -int ffgcxui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, - long firstbit, int nbits, unsigned short *array, int *status); -int ffgcxuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, - long firstbit, int nbits, unsigned int *array, int *status); - -int ffgcfs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char **array, char *nularray, int *anynul, int *status); -int ffgcfl(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char *array, char *nularray, int *anynul, int *status); -int ffgcfb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned char *array, char *nularray, int *anynul, int *status); -int ffgcfsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, signed char *array, char *nularray, int *anynul, int *status); -int ffgcfui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned short *array, char *nularray, int *anynul, - int *status); -int ffgcfi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, short *array, char *nularray, int *anynul, int *status); -int ffgcfuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned long *array, char *nularray, int *anynul, - int *status); -int ffgcfj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, long *array, char *nularray, int *anynul, int *status); -int ffgcfjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, LONGLONG *array, char *nularray, int *anynul, int *status); -int ffgcfuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned int *array, char *nularray, int *anynul, - int *status); -int ffgcfk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, int *array, char *nularray, int *anynul, int *status); -int ffgcfe(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float *array, char *nularray, int *anynul, int *status); -int ffgcfd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double *array, char *nularray, int *anynul, int *status); -int ffgcfc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float *array, char *nularray, int *anynul, int *status); -int ffgcfm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double *array, char *nularray, int *anynul, int *status); - -int ffgdes(fitsfile *fptr, int colnum, LONGLONG rownum, long *length, - long *heapaddr, int *status); -int ffgdesll(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG *length, - LONGLONG *heapaddr, int *status); -int ffgdess(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, long *length, - long *heapaddr, int *status); -int ffgdessll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, LONGLONG *length, - LONGLONG *heapaddr, int *status); -int ffpdes(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG length, - LONGLONG heapaddr, int *status); -int fftheap(fitsfile *fptr, LONGLONG *heapsize, LONGLONG *unused, LONGLONG *overlap, - int *valid, int *status); -int ffcmph(fitsfile *fptr, int *status); - -int ffgtbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars, - unsigned char *values, int *status); - -int ffgextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status); -int ffpextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status); - -/*------------ write primary array or image elements -------------*/ -int ffppx(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, - void *array, int *status); -int ffppxll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, - void *array, int *status); -int ffppxn(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, - void *array, void *nulval, int *status); -int ffppxnll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, - void *array, void *nulval, int *status); -int ffppr(fitsfile *fptr, int datatype, LONGLONG firstelem, - LONGLONG nelem, void *array, int *status); -int ffpprb(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, unsigned char *array, int *status); -int ffpprsb(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, signed char *array, int *status); -int ffpprui(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, unsigned short *array, int *status); -int ffppri(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, short *array, int *status); -int ffppruj(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, unsigned long *array, int *status); -int ffpprj(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, long *array, int *status); -int ffppruk(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, unsigned int *array, int *status); -int ffpprk(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, int *array, int *status); -int ffppre(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, float *array, int *status); -int ffpprd(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, double *array, int *status); -int ffpprjj(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, LONGLONG *array, int *status); - -int ffppru(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - int *status); -int ffpprn(fitsfile *fptr, LONGLONG firstelem, LONGLONG nelem, int *status); - -int ffppn(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, - void *array, void *nulval, int *status); -int ffppnb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned char *array, unsigned char nulval, int *status); -int ffppnsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - signed char *array, signed char nulval, int *status); -int ffppnui(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, unsigned short *array, unsigned short nulval, - int *status); -int ffppni(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, short *array, short nulval, int *status); -int ffppnj(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, long *array, long nulval, int *status); -int ffppnuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned long *array, unsigned long nulval, int *status); -int ffppnuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, - unsigned int *array, unsigned int nulval, int *status); -int ffppnk(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, int *array, int nulval, int *status); -int ffppne(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, float *array, float nulval, int *status); -int ffppnd(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, double *array, double nulval, int *status); -int ffppnjj(fitsfile *fptr, long group, LONGLONG firstelem, - LONGLONG nelem, LONGLONG *array, LONGLONG nulval, int *status); - -int ffp2db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, unsigned char *array, int *status); -int ffp2dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, signed char *array, int *status); -int ffp2dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, unsigned short *array, int *status); -int ffp2di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, short *array, int *status); -int ffp2duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, unsigned long *array, int *status); -int ffp2dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, long *array, int *status); -int ffp2duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, unsigned int *array, int *status); -int ffp2dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, int *array, int *status); -int ffp2de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, float *array, int *status); -int ffp2dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, double *array, int *status); -int ffp2djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG *array, int *status); - -int ffp3db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, unsigned char *array, int *status); -int ffp3dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, signed char *array, int *status); -int ffp3dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, unsigned short *array, int *status); -int ffp3di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, short *array, int *status); -int ffp3duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, unsigned long *array, int *status); -int ffp3dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, long *array, int *status); -int ffp3duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, unsigned int *array, int *status); -int ffp3dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, int *array, int *status); -int ffp3de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, float *array, int *status); -int ffp3dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, double *array, int *status); -int ffp3djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, - LONGLONG naxis2, LONGLONG naxis3, LONGLONG *array, int *status); - -int ffpss(fitsfile *fptr, int datatype, - long *fpixel, long *lpixel, void *array, int *status); -int ffpssb(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, unsigned char *array, int *status); -int ffpsssb(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, signed char *array, int *status); -int ffpssui(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, unsigned short *array, int *status); -int ffpssi(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, short *array, int *status); -int ffpssuj(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, unsigned long *array, int *status); -int ffpssj(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, long *array, int *status); -int ffpssuk(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, unsigned int *array, int *status); -int ffpssk(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, int *array, int *status); -int ffpsse(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, float *array, int *status); -int ffpssd(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, double *array, int *status); -int ffpssjj(fitsfile *fptr, long group, long naxis, long *naxes, - long *fpixel, long *lpixel, LONGLONG *array, int *status); - -int ffpgpb(fitsfile *fptr, long group, long firstelem, - long nelem, unsigned char *array, int *status); -int ffpgpsb(fitsfile *fptr, long group, long firstelem, - long nelem, signed char *array, int *status); -int ffpgpui(fitsfile *fptr, long group, long firstelem, - long nelem, unsigned short *array, int *status); -int ffpgpi(fitsfile *fptr, long group, long firstelem, - long nelem, short *array, int *status); -int ffpgpuj(fitsfile *fptr, long group, long firstelem, - long nelem, unsigned long *array, int *status); -int ffpgpj(fitsfile *fptr, long group, long firstelem, - long nelem, long *array, int *status); -int ffpgpuk(fitsfile *fptr, long group, long firstelem, - long nelem, unsigned int *array, int *status); -int ffpgpk(fitsfile *fptr, long group, long firstelem, - long nelem, int *array, int *status); -int ffpgpe(fitsfile *fptr, long group, long firstelem, - long nelem, float *array, int *status); -int ffpgpd(fitsfile *fptr, long group, long firstelem, - long nelem, double *array, int *status); -int ffpgpjj(fitsfile *fptr, long group, long firstelem, - long nelem, LONGLONG *array, int *status); - -/*--------------------- iterator functions -------------*/ -int fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr, char *colname, - int datatype, int iotype); -int fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr, int colnum, - int datatype, int iotype); -int fits_iter_set_file(iteratorCol *col, fitsfile *fptr); -int fits_iter_set_colname(iteratorCol *col, char *colname); -int fits_iter_set_colnum(iteratorCol *col, int colnum); -int fits_iter_set_datatype(iteratorCol *col, int datatype); -int fits_iter_set_iotype(iteratorCol *col, int iotype); - -fitsfile * fits_iter_get_file(iteratorCol *col); -char * fits_iter_get_colname(iteratorCol *col); -int fits_iter_get_colnum(iteratorCol *col); -int fits_iter_get_datatype(iteratorCol *col); -int fits_iter_get_iotype(iteratorCol *col); -void * fits_iter_get_array(iteratorCol *col); -long fits_iter_get_tlmin(iteratorCol *col); -long fits_iter_get_tlmax(iteratorCol *col); -long fits_iter_get_repeat(iteratorCol *col); -char * fits_iter_get_tunit(iteratorCol *col); -char * fits_iter_get_tdisp(iteratorCol *col); - -int ffiter(int ncols, iteratorCol *data, long offset, long nPerLoop, - int (*workFn)( long totaln, long offset, long firstn, - long nvalues, int narrays, iteratorCol *data, void *userPointer), - void *userPointer, int *status); - -/*--------------------- write column elements -------------*/ -int ffpcl(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, - LONGLONG firstelem, LONGLONG nelem, void *array, int *status); -int ffpcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char **array, int *status); -int ffpcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char *array, int *status); -int ffpclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned char *array, int *status); -int ffpclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, signed char *array, int *status); -int ffpclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned short *array, int *status); -int ffpcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, short *array, int *status); -int ffpcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned long *array, int *status); -int ffpclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, long *array, int *status); -int ffpcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned int *array, int *status); -int ffpclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, int *array, int *status); -int ffpcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float *array, int *status); -int ffpcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double *array, int *status); -int ffpclc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float *array, int *status); -int ffpclm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double *array, int *status); -int ffpclu(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, int *status); -int ffprwu(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); -int ffpcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, LONGLONG *array, int *status); -int ffpclx(fitsfile *fptr, int colnum, LONGLONG frow, long fbit, long nbit, - char *larray, int *status); - -int ffpcn(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, void *array, void *nulval, int *status); -int ffpcns( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char **array, char *nulvalue, int *status); -int ffpcnl( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, char *array, char nulvalue, int *status); -int ffpcnb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned char *array, unsigned char nulvalue, - int *status); -int ffpcnsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, signed char *array, signed char nulvalue, - int *status); -int ffpcnui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned short *array, unsigned short nulvalue, - int *status); -int ffpcni(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, short *array, short nulvalue, int *status); -int ffpcnuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned long *array, unsigned long nulvalue, - int *status); -int ffpcnj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, long *array, long nulvalue, int *status); -int ffpcnuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, unsigned int *array, unsigned int nulvalue, - int *status); -int ffpcnk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, int *array, int nulvalue, int *status); -int ffpcne(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, float *array, float nulvalue, int *status); -int ffpcnd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, double *array, double nulvalue, int *status); -int ffpcnjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, - LONGLONG nelem, LONGLONG *array, LONGLONG nulvalue, int *status); -int ffptbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars, - unsigned char *values, int *status); - -int ffirow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); -int ffdrow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); -int ffdrrg(fitsfile *fptr, char *ranges, int *status); -int ffdrws(fitsfile *fptr, long *rownum, long nrows, int *status); -int ffdrwsll(fitsfile *fptr, LONGLONG *rownum, LONGLONG nrows, int *status); -int fficol(fitsfile *fptr, int numcol, char *ttype, char *tform, int *status); -int fficls(fitsfile *fptr, int firstcol, int ncols, char **ttype, - char **tform, int *status); -int ffmvec(fitsfile *fptr, int colnum, LONGLONG newveclen, int *status); -int ffdcol(fitsfile *fptr, int numcol, int *status); -int ffcpcl(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol, - int create_col, int *status); - -/*--------------------- WCS Utilities ------------------*/ -int ffgics(fitsfile *fptr, double *xrval, double *yrval, double *xrpix, - double *yrpix, double *xinc, double *yinc, double *rot, - char *type, int *status); -int ffgtcs(fitsfile *fptr, int xcol, int ycol, double *xrval, - double *yrval, double *xrpix, double *yrpix, double *xinc, - double *yinc, double *rot, char *type, int *status); -int ffwldp(double xpix, double ypix, double xref, double yref, - double xrefpix, double yrefpix, double xinc, double yinc, - double rot, char *type, double *xpos, double *ypos, int *status); -int ffxypx(double xpos, double ypos, double xref, double yref, - double xrefpix, double yrefpix, double xinc, double yinc, - double rot, char *type, double *xpix, double *ypix, int *status); - -/* WCS support routines (provide interface to Doug Mink's WCS library */ -int ffgiwcs(fitsfile *fptr, char **header, int *status); -int ffgtwcs(fitsfile *fptr, int xcol, int ycol, char **header, int *status); - -/*--------------------- lexical parsing routines ------------------*/ -int fftexp( fitsfile *fptr, char *expr, int maxdim, - int *datatype, long *nelem, int *naxis, - long *naxes, int *status ); - -int fffrow( fitsfile *infptr, char *expr, - long firstrow, long nrows, - long *n_good_rows, char *row_status, int *status); - -int ffffrw( fitsfile *fptr, char *expr, long *rownum, int *status); - -int fffrwc( fitsfile *fptr, char *expr, char *timeCol, - char *parCol, char *valCol, long ntimes, - double *times, char *time_status, int *status ); - -int ffsrow( fitsfile *infptr, fitsfile *outfptr, char *expr, - int *status); - -int ffcrow( fitsfile *fptr, int datatype, char *expr, - long firstrow, long nelements, void *nulval, - void *array, int *anynul, int *status ); - -int ffcalc_rng( fitsfile *infptr, char *expr, fitsfile *outfptr, - char *parName, char *parInfo, int nRngs, - long *start, long *end, int *status ); - -int ffcalc( fitsfile *infptr, char *expr, fitsfile *outfptr, - char *parName, char *parInfo, int *status ); - - /* ffhist is not really intended as a user-callable routine */ - /* but it may be useful for some specialized applications */ - /* ffhist2 is a newer version which is strongly recommended instead of ffhist */ - -int ffhist(fitsfile **fptr, char *outfile, int imagetype, int naxis, - char colname[4][FLEN_VALUE], - double *minin, double *maxin, double *binsizein, - char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], - char binname[4][FLEN_VALUE], - double weightin, char wtcol[FLEN_VALUE], - int recip, char *rowselect, int *status); -int ffhist2(fitsfile **fptr, char *outfile, int imagetype, int naxis, - char colname[4][FLEN_VALUE], - double *minin, double *maxin, double *binsizein, - char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], - char binname[4][FLEN_VALUE], - double weightin, char wtcol[FLEN_VALUE], - int recip, char *rowselect, int *status); - -int fits_select_image_section(fitsfile **fptr, char *outfile, - char *imagesection, int *status); -int fits_copy_image_section(fitsfile *infptr, fitsfile *outfile, - char *imagesection, int *status); - -int fits_calc_binning(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE], - double *minin, double *maxin, double *binsizein, - char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], - char binname[4][FLEN_VALUE], int *colnum, long *haxes, float *amin, - float *amax, float *binsize, int *status); - -int fits_write_keys_histo(fitsfile *fptr, fitsfile *histptr, - int naxis, int *colnum, int *status); -int fits_rebin_wcs( fitsfile *fptr, int naxis, float *amin, float *binsize, - int *status); -int fits_make_hist(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis, - long *naxes, int *colnum, float *amin, float *amax, float *binsize, - float weight, int wtcolnum, int recip, char *selectrow, int *status); - -typedef struct -{ - /* input(s) */ - int count; - char ** path; - char ** tag; - fitsfile ** ifptr; - - char * expression; - - /* output control */ - int bitpix; - long blank; - fitsfile * ofptr; - char keyword[FLEN_KEYWORD]; - char comment[FLEN_COMMENT]; -} PixelFilter; - - -int fits_pixel_filter (PixelFilter * filter, int * status); - - -/*--------------------- grouping routines ------------------*/ - -int ffgtcr(fitsfile *fptr, char *grpname, int grouptype, int *status); -int ffgtis(fitsfile *fptr, char *grpname, int grouptype, int *status); -int ffgtch(fitsfile *gfptr, int grouptype, int *status); -int ffgtrm(fitsfile *gfptr, int rmopt, int *status); -int ffgtcp(fitsfile *infptr, fitsfile *outfptr, int cpopt, int *status); -int ffgtmg(fitsfile *infptr, fitsfile *outfptr, int mgopt, int *status); -int ffgtcm(fitsfile *gfptr, int cmopt, int *status); -int ffgtvf(fitsfile *gfptr, long *firstfailed, int *status); -int ffgtop(fitsfile *mfptr,int group,fitsfile **gfptr,int *status); -int ffgtam(fitsfile *gfptr, fitsfile *mfptr, int hdupos, int *status); -int ffgtnm(fitsfile *gfptr, long *nmembers, int *status); -int ffgmng(fitsfile *mfptr, long *nmembers, int *status); -int ffgmop(fitsfile *gfptr, long member, fitsfile **mfptr, int *status); -int ffgmcp(fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt, - int *status); -int ffgmtf(fitsfile *infptr, fitsfile *outfptr, long member, int tfopt, - int *status); -int ffgmrm(fitsfile *fptr, long member, int rmopt, int *status); - -/*--------------------- group template parser routines ------------------*/ - -int fits_execute_template(fitsfile *ff, char *ngp_template, int *status); - -int fits_img_stats_short(short *array,long nx, long ny, int nullcheck, - short nullvalue,long *ngoodpix, short *minvalue, short *maxvalue, double *mean, - double *sigma, double *noise1, double *noise3, int *status); -int fits_img_stats_int(int *array,long nx, long ny, int nullcheck, - int nullvalue,long *ngoodpix, int *minvalue, int *maxvalue, double *mean, - double *sigma, double *noise1, double *noise3, int *status); -int fits_img_stats_float(float *array, long nx, long ny, int nullcheck, - float nullvalue,long *ngoodpix, float *minvalue, float *maxvalue, double *mean, - double *sigma, double *noise1, double *noise3, int *status); - -/*--------------------- image compression routines ------------------*/ - -int fits_set_compression_type(fitsfile *fptr, int ctype, int *status); -int fits_set_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status); -int fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status); -int fits_set_quantize_level(fitsfile *fptr, float qlevel, int *status); -int fits_set_hcomp_scale(fitsfile *fptr, float scale, int *status); -int fits_set_hcomp_smooth(fitsfile *fptr, int smooth, int *status); - -int fits_get_compression_type(fitsfile *fptr, int *ctype, int *status); -int fits_get_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status); -int fits_get_quantize_level(fitsfile *fptr, float *qlevel, int *status); -int fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status); -int fits_get_hcomp_scale(fitsfile *fptr, float *scale, int *status); -int fits_get_hcomp_smooth(fitsfile *fptr, int *smooth, int *status); - -int fits_img_compress(fitsfile *infptr, fitsfile *outfptr, int *status); -int fits_compress_img(fitsfile *infptr, fitsfile *outfptr, int compress_type, - long *tilesize, int parm1, int parm2, int *status); -int fits_is_compressed_image(fitsfile *fptr, int *status); -int fits_decompress_img (fitsfile *infptr, fitsfile *outfptr, int *status); -int fits_img_decompress (fitsfile *infptr, fitsfile *outfptr, int *status); - -/* H-compress routines */ -int fits_hcompress(int *a, int nx, int ny, int scale, char *output, - long *nbytes, int *status); -int fits_hcompress64(LONGLONG *a, int nx, int ny, int scale, char *output, - long *nbytes, int *status); -int fits_hdecompress(unsigned char *input, int smooth, int *a, int *nx, - int *ny, int *scale, int *status); -int fits_hdecompress64(unsigned char *input, int smooth, LONGLONG *a, int *nx, - int *ny, int *scale, int *status); - -/* The following exclusion if __CINT__ is defined is needed for ROOT */ -#ifndef __CINT__ -#ifdef __cplusplus -} -#endif -#endif - -#endif - diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/geom_utils.h b/src/amuse_simplex/src/plugins/HEALPix/include/geom_utils.h deleted file mode 100644 index 67b61ba604..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/geom_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file geom_utils.h - * Geometric utility functions. - * - * Copyright (C) 2003, 2006 Max-Planck-Society - * \author Martin Reinecke - * \author Reinhard Hell - */ - -#include "cxxutils.h" -#include "vec3.h" - -/*! Returns the orientation when looking from point \a loc on the unit - sphere in the direction \a dir. \a loc must be normalized. The result - ranges from -pi to pi, is 0 for North and pi/2 for West, i.e. the angle - is given in mathematically positive sense. - - If \a loc is the North or South pole, the returned angle is - \a atan2(dir.y,dir.x). */ -inline double orientation (const vec3 &loc, const vec3 &dir) - { -// FIXME: here is still optimization potential - if (loc.x==0 && loc.y==0) - { - if (loc.z>0) return safe_atan2(dir.y,-dir.x); - else return safe_atan2(dir.y,dir.x); - } - vec3 east (-loc.y, loc.x, 0); - vec3 north = crossprod(loc,east); - double y = dotprod(dir,east); - double x = dotprod(dir,north); - return safe_atan2(-y,x); - } - -/*! Returns the angle between \a v1 and \a v2 in radians. */ -inline double v_angle (const vec3 &v1, const vec3 &v2) - { - return atan2 (crossprod(v1,v2).Length(), dotprod(v1,v2)); - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base.h b/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base.h deleted file mode 100644 index ae0e0c8982..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_base.h - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_BASE_H -#define HEALPIX_BASE_H - -#include -#include "cxxutils.h" -#include "lsconstants.h" -#include "pointing.h" -template class fix_arr; - -/*! The two possible ordering schemes of a HEALPix map. */ -typedef enum { RING, /*!< RING scheme */ - NEST /*!< NESTED scheme */ - } Healpix_Ordering_Scheme; - -class nside_dummy {}; -extern const nside_dummy SET_NSIDE; - -/*! Functionality related to the HEALPix pixelisation. */ -class Healpix_Base - { - protected: - enum { order_max=13 }; - - class Tablefiller - { - public: - Tablefiller(); - }; - static Tablefiller Filler; - friend class Tablefiller; - - static short ctab[0x100], utab[0x100]; - - static const int jrll[]; - static const int jpll[]; - - /*! The order of the map; -1 for nonhierarchical map. */ - int order_; - /*! The N_side parameter of the map; 0 if not allocated. */ - int nside_; - int npface_, ncap_, npix_; - double fact1_, fact2_; - /*! The map's ordering scheme. */ - Healpix_Ordering_Scheme scheme_; - - inline int ring_above (double z) const; - void in_ring (int iz, double phi0, double dphi, - std::vector &listir) const; - - int xyf2nest(int ix, int iy, int face_num) const; - void nest2xyf(int pix, int &ix, int &iy, int &face_num) const; - int xyf2ring(int ix, int iy, int face_num) const; - void ring2xyf(int pix, int &ix, int &iy, int &face_num) const; - - typedef int (Healpix_Base::*swapfunc)(int pix) const; - typedef void (Healpix_Base::*pix2xyf) - (int pix, int &x, int &y, int &f) const; - typedef int (Healpix_Base::*xyf2pix) (int x, int y, int f) const; - - public: - /*! Calculates the map order from its \a N_side parameter. - Returns -1 if \a nside is not a power of 2. - \param nside the \a N_side parameter */ - static int nside2order (int nside) - { - planck_assert (nside>0, "invalid value for Nside"); - if ((nside)&(nside-1)) return -1; - return ilog2(nside); - } - /*! Calculates the \a N_side parameter from the number of pixels. - \param npix the number of pixels */ - static int npix2nside (int npix); - /*! Constructs an unallocated object. */ - Healpix_Base () - : order_(-1), nside_(0), npface_(0), ncap_(0), npix_(0), - fact1_(0), fact2_(0), scheme_(RING) {} - /*! Constructs an object with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Base (int order, Healpix_Ordering_Scheme scheme) - { Set (order, scheme); } - /*! Constructs an object with a given \a nside and the ordering - scheme \a scheme. The \a nside_dummy parameter must be set to - SET_NSIDE. */ - Healpix_Base (int nside, Healpix_Ordering_Scheme scheme, const nside_dummy) - { SetNside (nside, scheme); } - - /* Adjusts the object to \a order and \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - planck_assert ((order>=0)&&(order<=order_max), "bad order"); - order_ = order; - nside_ = 1<=0), - "SetNside: nside must be power of 2 for nested maps"); - nside_ = nside; - npface_ = nside_*nside_; - ncap_ = (npface_-nside_)<<1; - npix_ = 12*npface_; - fact2_ = 4./npix_; - fact1_ = (nside_<<1)*fact2_; - scheme_ = scheme; - } - - /*! Returns the z-coordinate of the ring \a ring. This also works - for the (not really existing) rings 0 and 4*nside. */ - double ring2z (int ring) const; - /*! Returns the number of the ring in which \a pix lies. */ - int pix2ring (int pix) const; - - /*! Translates a pixel number from NEST to RING. */ - int nest2ring (int pix) const; - /*! Translates a pixel number from RING to NEST. */ - int ring2nest (int pix) const; - /*! Translates a pixel number from NEST to its Peano index. */ - int nest2peano (int pix) const; - /*! Translates a pixel number from its Peano index to NEST. */ - int peano2nest (int pix) const; - - int ang2pix_z_phi (double z, double phi) const; - - /*! Returns the number of the pixel which contains the angular coordinates - \a ang. */ - int ang2pix (const pointing &ang) const - { return ang2pix_z_phi (cos(ang.theta), ang.phi); } - /*! Returns the number of the pixel which contains the vector \a vec - (\a vec is normalized if necessary). */ - int vec2pix (const vec3 &vec) const - { return ang2pix_z_phi (vec.z/vec.Length(), safe_atan2(vec.y,vec.x)); } - - void pix2ang_z_phi (int pix, double &z, double &phi) const; - - /*! Returns the angular coordinates of the center of the pixel with - number \a pix. */ - pointing pix2ang (int pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - return pointing(acos(z),phi); - } - /*! Returns the vector to the center of the pixel with number \a pix. */ - vec3 pix2vec (int pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - vec3 res; - res.set_z_phi (z, phi); - return res; - } - - /*! Returns the numbers of all pixels whose centers lie within \a radius - of \a dir in \a listpix. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method is more efficient in the RING scheme. */ - void query_disc (const pointing &dir, double radius, - std::vector &listpix) const; - /*! Returns the numbers of all pixels that lie at least partially within - \a radius of \a dir in \a listpix. It may also return a few pixels - which do not lie in the disk at all. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void query_disc_inclusive (const pointing &dir, double radius, - std::vector &listpix) const - { query_disc (dir,radius+1.362*pi/(4*nside_),listpix); } - - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param costheta the cosine of the colatitude (in radians) of the ring - \param sintheta the sine of the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info (int ring, int &startpix, int &ringpix, - double &costheta, double &sintheta, bool &shifted) const; - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param theta the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info2 (int ring, int &startpix, int &ringpix, - double &theta, bool &shifted) const; - - /*! Returns the neighboring pixels of \a pix in \a result. - On exit, \a result contains (in this order) - the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor - of \a pix. If a neighbor does not exist (this can only be the case - for the W, N, E and S neighbors), its entry is set to -1. - - \note This method works in both RING and NEST schemes, but is - considerably faster in the NEST scheme. */ - void neighbors (int pix, fix_arr &result) const; - /*! Returns interpolation information for the direction \a ptg. - The surrounding pixels are returned in \a pix, their corresponding - weights in \a wgt. - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void get_interpol (const pointing &ptg, fix_arr &pix, - fix_arr &wgt) const; - - /*! Returns the order parameter of the object. */ - int Order() const { return order_; } - /*! Returns the \a N_side parameter of the object. */ - int Nside() const { return nside_; } - /*! Returns the number of pixels of the object. */ - int Npix() const { return npix_; } - /*! Returns the ordering scheme of the object. */ - Healpix_Ordering_Scheme Scheme() const { return scheme_; } - - /*! Returns \a true, if both objects have the same nside and scheme, - else \a false. */ - bool conformable (const Healpix_Base &other) const - { return ((nside_==other.nside_) && (scheme_==other.scheme_)); } - - /*! Swaps the contents of two Healpix_Base objects. */ - void swap (Healpix_Base &other) - { - std::swap(order_,other.order_); - std::swap(nside_,other.nside_); - std::swap(npface_,other.npface_); - std::swap(ncap_,other.ncap_); - std::swap(npix_,other.npix_); - std::swap(fact1_,other.fact1_); - std::swap(fact2_,other.fact2_); - std::swap(scheme_,other.scheme_); - } - - /*! Returns the maximum angular distance (in radian) between any pixel - center and its corners. */ - double max_pixrad() const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base2.h b/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base2.h deleted file mode 100644 index a2f94b24e3..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_base2.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_base2.h - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_BASE2_H -#define HEALPIX_BASE2_H - -#include "healpix_base.h" -#include "datatypes.h" - -/*! Functionality related to the HEALPix pixelisation. Supports resolutions up to - N_side = 2^29. */ -class Healpix_Base2 - { - protected: - enum { order_max=29 }; - - class Tablefiller - { - public: - Tablefiller(); - }; - static Tablefiller Filler; - friend class Tablefiller; - - static short ctab[0x100], utab[0x100]; - - static const int jrll[]; - static const int jpll[]; - - /*! The order of the map; -1 for nonhierarchical map. */ - int order_; - /*! The N_side parameter of the map; 0 if not allocated. */ - int64 nside_; - int64 npface_, ncap_, npix_; - double fact1_, fact2_; - /*! The map's ordering scheme. */ - Healpix_Ordering_Scheme scheme_; - - inline int64 ring_above (double z) const; - void in_ring (int64 iz, double phi0, double dphi, - std::vector &listir) const; - - int64 xyf2nest(int ix, int iy, int face_num) const; - void nest2xyf(int64 pix, int &ix, int &iy, int &face_num) const; - int64 xyf2ring(int ix, int iy, int face_num) const; - void ring2xyf(int64 pix, int &ix, int &iy, int &face_num) const; - - typedef int64 (Healpix_Base2::*swapfunc)(int64 pix) const; - typedef void (Healpix_Base2::*pix2xyf) - (int64 pix, int &x, int &y, int &f) const; - typedef int64 (Healpix_Base2::*xyf2pix) (int x, int y, int f) const; - - public: - /*! Calculates the map order from its \a N_side parameter. - Returns -1 if \a nside is not a power of 2. - \param nside the \a N_side parameter */ - static int nside2order (int64 nside) - { - planck_assert (nside>0, "invalid value for Nside"); - if ((nside)&(nside-1)) return -1; - return ilog2(nside); - } - /*! Calculates the \a N_side parameter from the number of pixels. - \param npix the number of pixels */ - static int64 npix2nside (int64 npix); - /*! Constructs an unallocated object. */ - Healpix_Base2 () - : order_(-1), nside_(0), npface_(0), ncap_(0), npix_(0), - fact1_(0), fact2_(0), scheme_(RING) {} - /*! Constructs an object with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Base2 (int order, Healpix_Ordering_Scheme scheme) - { Set (order, scheme); } - /*! Constructs an object with a given \a nside and the ordering - scheme \a scheme. The \a nside_dummy parameter must be set to - SET_NSIDE. */ - Healpix_Base2 (int64 nside, Healpix_Ordering_Scheme scheme, - const nside_dummy) - { SetNside (nside, scheme); } - - /* Adjusts the object to \a order and \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - planck_assert ((order>=0)&&(order<=order_max), "bad order"); - order_ = order; - nside_ = int64(1)<=0), - "SetNside: nside must be power of 2 for nested maps"); - nside_ = nside; - npface_ = nside_*nside_; - ncap_ = (npface_-nside_)<<1; - npix_ = 12*npface_; - fact2_ = 4./npix_; - fact1_ = (nside_<<1)*fact2_; - scheme_ = scheme; - } - - /*! Returns the z-coordinate of the ring \a ring. This also works - for the (not really existing) rings 0 and 4*nside. */ - double ring2z (int64 ring) const; - /*! Returns the number of the ring in which \a pix lies. */ - int64 pix2ring (int64 pix) const; - - /*! Translates a pixel number from NEST to RING. */ - int64 nest2ring (int64 pix) const; - /*! Translates a pixel number from RING to NEST. */ - int64 ring2nest (int64 pix) const; - /*! Translates a pixel number from NEST to its Peano index. */ - int64 nest2peano (int64 pix) const; - /*! Translates a pixel number from its Peano index to NEST. */ - int64 peano2nest (int64 pix) const; - - int64 ang2pix_z_phi (double z, double phi) const; - - /*! Returns the number of the pixel which contains the angular coordinates - \a ang. */ - int64 ang2pix (const pointing &ang) const - { return ang2pix_z_phi (cos(ang.theta), ang.phi); } - /*! Returns the number of the pixel which contains the vector \a vec - (\a vec is normalized if necessary). */ - int64 vec2pix (const vec3 &vec) const - { return ang2pix_z_phi (vec.z/vec.Length(), safe_atan2(vec.y,vec.x)); } - - void pix2ang_z_phi (int64 pix, double &z, double &phi) const; - - /*! Returns the angular coordinates of the center of the pixel with - number \a pix. */ - pointing pix2ang (int64 pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - return pointing(acos(z),phi); - } - /*! Returns the vector to the center of the pixel with number \a pix. */ - vec3 pix2vec (int64 pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - vec3 res; - res.set_z_phi (z, phi); - return res; - } - - /*! Returns the numbers of all pixels whose centers lie within \a radius - of \a dir in \a listpix. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method is more efficient in the RING scheme. */ - void query_disc (const pointing &dir, double radius, - std::vector &listpix) const; - /*! Returns the numbers of all pixels that lie at least partially within - \a radius of \a dir in \a listpix. It may also return a few pixels - which do not lie in the disk at all. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ -//FIXME: factor 1.362 not OK! - void query_disc_inclusive (const pointing &dir, double radius, - std::vector &listpix) const - { query_disc (dir,radius+1.362*pi/(4*nside_),listpix); } - - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param costheta the cosine of the colatitude (in radians) of the ring - \param sintheta the sine of the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info (int64 ring, int64 &startpix, int64 &ringpix, - double &costheta, double &sintheta, bool &shifted) const; - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param theta the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info2 (int64 ring, int64 &startpix, int64 &ringpix, - double &theta, bool &shifted) const; - - /*! Returns the neighboring pixels of \a pix in \a result. - On exit, \a result contains (in this order) - the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor - of \a pix. If a neighbor does not exist (this can only be the case - for the W, N, E and S neighbors), its entry is set to -1. - - \note This method works in both RING and NEST schemes, but is - considerably faster in the NEST scheme. */ - void neighbors (int64 pix, fix_arr &result) const; - /*! Returns interpolation information for the direction \a ptg. - The surrounding pixels are returned in \a pix, their corresponding - weights in \a wgt. - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void get_interpol (const pointing &ptg, fix_arr &pix, - fix_arr &wgt) const; - - /*! Returns the order parameter of the object. */ - int Order() const { return order_; } - /*! Returns the \a N_side parameter of the object. */ - int64 Nside() const { return nside_; } - /*! Returns the number of pixels of the object. */ - int64 Npix() const { return npix_; } - /*! Returns the ordering scheme of the object. */ - Healpix_Ordering_Scheme Scheme() const { return scheme_; } - - /*! Returns \a true, if both objects have the same nside and scheme, - else \a false. */ - bool conformable (const Healpix_Base2 &other) const - { return ((nside_==other.nside_) && (scheme_==other.scheme_)); } - - /*! Swaps the contents of two Healpix_Base objects. */ - void swap (Healpix_Base2 &other) - { - std::swap(order_,other.order_); - std::swap(nside_,other.nside_); - std::swap(npface_,other.npface_); - std::swap(ncap_,other.ncap_); - std::swap(npix_,other.npix_); - std::swap(fact1_,other.fact1_); - std::swap(fact2_,other.fact2_); - std::swap(scheme_,other.scheme_); - } - - /*! Returns the maximum angular distance (in radian) between any pixel - center and its corners. */ - double max_pixrad() const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_data_io.h b/src/amuse_simplex/src/plugins/HEALPix/include/healpix_data_io.h deleted file mode 100644 index 6c16108ac9..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_data_io.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef HEALPIX_DATA_IO_H -#define HEALPIX_DATA_IO_H - -#include - -class paramfile; -class simparams; -template class arr; - -void read_weight_ring (const std::string &dir, int nside, - arr &weight); -void get_ring_weights (paramfile ¶ms, simparams &par, int nside, - arr &weight); - -void read_pixwin (const std::string &dir, int nside, arr &temp); -void read_pixwin (const std::string &dir, int nside, arr &temp, - arr &pol); - -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin); -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin, arr &pixwin_pol); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map.h b/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map.h deleted file mode 100644 index 7603d84378..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_map.h - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_MAP_H -#define HEALPIX_MAP_H - -#include "arr.h" -#include "healpix_base.h" - -/*! A HEALPix map of a given datatype */ -template class Healpix_Map: public Healpix_Base - { - private: - arr map; - - public: - /*! Constructs an unallocated map. */ - Healpix_Map () {} - /*! Constructs a map with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Map (int order, Healpix_Ordering_Scheme scheme) - : Healpix_Base (order, scheme), map(npix_) {} - /*! Constructs a map with a given \a nside and the ordering - scheme \a scheme. */ - Healpix_Map (int nside, Healpix_Ordering_Scheme scheme, const nside_dummy) - : Healpix_Base (nside, scheme, SET_NSIDE), map(npix_) {} - /*! Constructs a map from the contents of \a data and sets the ordering - scheme to \a Scheme. The size of \a data must be a valid HEALPix - map size. */ - Healpix_Map (const arr &data, Healpix_Ordering_Scheme scheme) - : Healpix_Base (npix2nside(data.size()), scheme, SET_NSIDE), map(data) {} - - /*! Deletes the old map, creates a map from the contents of \a data and - sets the ordering scheme to \a scheme. The size of \a data must be a - valid HEALPix map size. */ - void Set (arr &data, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::SetNside(npix2nside (data.size()), scheme); - map.transfer(data); - } - - /*! Deletes the old map and creates a new map with a given \a order - and the ordering scheme \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::Set(order, scheme); - map.alloc(npix_); - } - /*! Deletes the old map and creates a new map with a given \a nside - and the ordering scheme \a scheme. */ - void SetNside (int nside, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::SetNside(nside, scheme); - map.alloc(npix_); - } - - /*! Fills the map with \a val. */ - void fill (const T &val) - { map.fill(val); } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme. \a orig must have the same resolution as the - current map. */ - void Import_nograde (const Healpix_Map &orig) - { - planck_assert (nside_==orig.nside_, - "Import_nograde: maps have different nside"); - if (orig.scheme_ == scheme_) - for (int m=0; m*swapper)(m)] = orig.map[m]; -} - } - } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution. \a orig must have higher - resolution than the current map. */ - void Import_upgrade (const Healpix_Map &orig) - { - planck_assert(nside_>orig.nside_,"Import_upgrade: this is no upgrade"); - int fact = nside_/orig.nside_; - planck_assert (nside_==orig.nside_*fact, - "the larger Nside must be a multiple of the smaller one"); - pix2xyf to_xyf = (orig.scheme_==RING) ? - &Healpix_Map::ring2xyf : &Healpix_Map::nest2xyf; - xyf2pix from_xyf = (scheme_==RING) ? - &Healpix_Map::xyf2ring : &Healpix_Map::xyf2nest; - -#pragma omp parallel -{ - int m; -#pragma omp for schedule (dynamic,5000) - for (m=0; m*from_xyf)(i,j,f); - map[mypix] = orig.map[m]; - } - } -} - } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution. \a orig must have higher - resolution than the current map. - \a pessimistic determines whether or not - pixels are set to \a Healpix_undef when not all of the corresponding - high-resolution pixels are defined. - - This method is instantiated for \a float and \a double only. */ - void Import_degrade (const Healpix_Map &orig, bool pessimistic=false); - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution if necessary. - When downgrading, \a pessimistic determines whether or not - pixels are set to \a Healpix_undef when not all of the corresponding - high-resolution pixels are defined. - - This method is instantiated for \a float and \a double only. */ - void Import (const Healpix_Map &orig, bool pessimistic=false) - { - if (orig.nside_ == nside_) // no up/degrading - Import_nograde(orig); - else if (orig.nside_ < nside_) // upgrading - Import_upgrade(orig); - else - Import_degrade(orig,pessimistic); - } - - /*! Returns a constant reference to the pixel with the number \a pix. */ - const T &operator[] (int pix) const { return map[pix]; } - /*! Returns a reference to the pixel with the number \a pix. */ - T &operator[] (int pix) { return map[pix]; } - - /*! Swaps the map ordering from RING to NEST and vice versa. - This is done in-place (i.e. with negligible space overhead). */ - void swap_scheme() - { - static const int clen[] = { 0,7,5,4,12,10,13,18,14,19,18,17,27,21 }; - static const int cycle[][30] = { - { }, - { 0,1,8,12,16,21,40 }, - { 0,1,2,40,114 }, - { 0,4,160,263 }, - { 0,4,30,49,51,87,526,1027,1105,1387,1807,2637 }, - { 0,8,10,18,39,74,146,307,452,4737 }, - { 0,1,2,7,9,17,80,410,1526,1921,32859,33566,38931 }, - { 0,5,6,10,12,24,27,95,372,494,924,1409,3492,4248,9137,66043,103369, - 156899 }, - { 0,1,2,3,4,45,125,351,697,24337,102940,266194,341855,419857 }, - { 0,1,2,3,9,16,1705,2082,2126,8177,12753,15410,52642,80493,83235, - 88387,99444,1675361,2495125 }, - { 0,2,6,8,9,11,20,50,93,152,183,2137,13671,44794,486954,741908, - 4803258,5692573 }, - { 0,1,5,6,44,53,470,2847,3433,4906,13654,14710,400447,1797382, - 2744492,18775974,23541521 }, - { 0,4,9,10,16,33,83,117,318,451,5759,10015,128975,171834,211256, - 347608,1278690,2154097,2590798,3427694,5581717,21012301,27023976, - 72522811,95032729,139166747,171822389 }, - { 0,5,10,267,344,363,2968,3159,9083,18437,76602,147614,1246902, - 1593138,2035574,6529391,9511830,11340287,29565945,281666026, - 677946848 } }; - - swapfunc swapper = (scheme_ == NEST) ? - &Healpix_Base::ring2nest : &Healpix_Base::nest2ring; - - planck_assert (order_>=0, "swap_scheme(): need hierarchical map"); - - for (int m=0; m*swapper)(istart); - while (inew != istart) - { - map[iold] = map[inew]; - iold = inew; - inew = (this->*swapper)(inew); - } - map[iold] = pixbuf; - } - scheme_ = (scheme_==RING) ? NEST : RING; - } - - /*! performs the actual interpolation using \a pix and \a wgt. */ - T interpolation (const fix_arr &pix, - const fix_arr &wgt) const - { - return map[pix[0]]*wgt[0] + map[pix[1]]*wgt[1] - + map[pix[2]]*wgt[2] + map[pix[3]]*wgt[3]; - } - /*! Returns the interpolated map value at \a ptg */ - T interpolated_value (const pointing &ptg) const - { - fix_arr pix; - fix_arr wgt; - get_interpol (ptg, pix, wgt); - return interpolation (pix, wgt); - } - - /*! Returns a constant reference to the map data. */ - const arr &Map() const { return map; } - - /*! Returns the minimum and maximum value of the map in - \a Min and \a Max. - - This method is instantiated for \a float and \a double only. */ - void minmax (T &Min, T &Max) const; - - /*! Swaps the contents of two Healpix_Map objects. */ - void swap (Healpix_Map &other) - { - Healpix_Base::swap(other); - map.swap(other.map); - } - - /*! Returns the average of all defined map pixels. */ - double average() const - { - double avg=0; - int pix=0; - for (int m=0; m(map[m],Healpix_undef)) - { ++pix; avg+=map[m]; } - return avg/pix; - } - - /*! Adds \a val to all defined map pixels. */ - void add (T val) - { - for (int m=0; m(map[m],Healpix_undef)) - { map[m]+=val; } - } - - /*! Returns the root mean square of the map, not counting undefined - pixels. */ - double rms() const - { - using namespace std; - - double result=0; - int pix=0; - for (int m=0; m(map[m],Healpix_undef)) - { ++pix; result+=map[m]*map[m]; } - return sqrt(result/pix); - } - /*! Returns the maximum absolute value in the map, ignoring undefined - pixels. */ - T absmax() const - { - using namespace std; - - T result=0; - for (int m=0; m(map[m],Healpix_undef)) - { result = max(result,abs(map[m])); } - return result; - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map_fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map_fitsio.h deleted file mode 100644 index d073adccb6..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/healpix_map_fitsio.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_map_fitsio.h - * Copyright (C) 2003, 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_MAP_FITSIO_H -#define HEALPIX_MAP_FITSIO_H - -#include - -class fitshandle; -class Healpix_Base; - -template class arr; -template class Healpix_Map; - -/*! \defgroup healpix_map_fitsio_group FITS-based I/O of HEALPix maps */ -/*! \{ */ - -/*! Reads the map stored in column \a colnum of the FITS binary table - pointed to by \a inp into \a map. */ -template void read_Healpix_map_from_fits - (fitshandle &inp, Healpix_Map &map, int colnum=1); -/*! Opens the FITS file \a filename, jumps to the HDU \a hdunum, - and reads the column \a colnum into \a map. */ -template void read_Healpix_map_from_fits - (const std::string &filename, Healpix_Map &map, int colnum=1, - int hdunum=2); - -/*! Inserts a new binary table into \a out, which contains one column - of FITS type \a datatype with the name \a name, and writes all HEALPix - specific keywords based on the information in \a base. */ -void prepare_Healpix_fitsmap - (fitshandle &out, const Healpix_Base &base, int datatype, - const arr &colname); - -/*! Inserts a new binary table into \a out, which contains one column - of FITS type \a datatype, and stores \a map into this column. */ -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype); -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type \a datatype, and stores \a mapT, \a mapQ and \a mapU - into these columns. */ -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &mapT, - const Healpix_Map &mapQ, const Healpix_Map &mapU, int datatype); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/longnam.h b/src/amuse_simplex/src/plugins/HEALPix/include/longnam.h deleted file mode 100644 index f838ac79df..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/longnam.h +++ /dev/null @@ -1,585 +0,0 @@ -#ifndef _LONGNAME_H -#define _LONGNAME_H - -#define fits_parse_input_url ffiurl -#define fits_parse_input_filename ffifile -#define fits_parse_rootname ffrtnm -#define fits_file_exists ffexist -#define fits_parse_output_url ffourl -#define fits_parse_extspec ffexts -#define fits_parse_extnum ffextn -#define fits_parse_binspec ffbins -#define fits_parse_binrange ffbinr -#define fits_parse_range ffrwrg -#define fits_parse_rangell ffrwrgll -#define fits_open_memfile ffomem - -/* - use the following special macro to test that the fitsio.h include - file that was used to build the CFITSIO library is the same version - as included when compiling the application program -*/ -#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_VERSION, A, B, C, D) - -#define fits_open_data ffdopn -#define fits_open_table fftopn -#define fits_open_image ffiopn -#define fits_open_diskfile ffdkopn -#define fits_reopen_file ffreopen -#define fits_create_file ffinit -#define fits_create_diskfile ffdkinit -#define fits_create_memfile ffimem -#define fits_create_template fftplt -#define fits_flush_file ffflus -#define fits_flush_buffer ffflsh -#define fits_close_file ffclos -#define fits_delete_file ffdelt -#define fits_file_name ffflnm -#define fits_file_mode ffflmd -#define fits_url_type ffurlt - -#define fits_get_version ffvers -#define fits_uppercase ffupch -#define fits_get_errstatus ffgerr -#define fits_write_errmsg ffpmsg -#define fits_write_errmark ffpmrk -#define fits_read_errmsg ffgmsg -#define fits_clear_errmsg ffcmsg -#define fits_clear_errmark ffcmrk -#define fits_report_error ffrprt -#define fits_compare_str ffcmps -#define fits_test_keyword fftkey -#define fits_test_record fftrec -#define fits_null_check ffnchk -#define fits_make_keyn ffkeyn -#define fits_make_nkey ffnkey -#define fits_get_keyclass ffgkcl -#define fits_get_keytype ffdtyp -#define fits_parse_value ffpsvc -#define fits_get_keyname ffgknm -#define fits_parse_template ffgthd -#define fits_ascii_tform ffasfm -#define fits_binary_tform ffbnfm -#define fits_binary_tformll ffbnfmll -#define fits_get_tbcol ffgabc -#define fits_get_rowsize ffgrsz -#define fits_get_col_display_width ffgcdw - -#define fits_write_record ffprec -#define fits_write_key ffpky -#define fits_write_key_unit ffpunt -#define fits_write_comment ffpcom -#define fits_write_history ffphis -#define fits_write_date ffpdat -#define fits_get_system_time ffgstm -#define fits_get_system_date ffgsdt -#define fits_date2str ffdt2s -#define fits_time2str fftm2s -#define fits_str2date ffs2dt -#define fits_str2time ffs2tm -#define fits_write_key_longstr ffpkls -#define fits_write_key_longwarn ffplsw -#define fits_write_key_null ffpkyu -#define fits_write_key_str ffpkys -#define fits_write_key_log ffpkyl -#define fits_write_key_lng ffpkyj -#define fits_write_key_fixflt ffpkyf -#define fits_write_key_flt ffpkye -#define fits_write_key_fixdbl ffpkyg -#define fits_write_key_dbl ffpkyd -#define fits_write_key_fixcmp ffpkfc -#define fits_write_key_cmp ffpkyc -#define fits_write_key_fixdblcmp ffpkfm -#define fits_write_key_dblcmp ffpkym -#define fits_write_key_triple ffpkyt -#define fits_write_tdim ffptdm -#define fits_write_tdimll ffptdmll -#define fits_write_keys_str ffpkns -#define fits_write_keys_log ffpknl -#define fits_write_keys_lng ffpknj -#define fits_write_keys_fixflt ffpknf -#define fits_write_keys_flt ffpkne -#define fits_write_keys_fixdbl ffpkng -#define fits_write_keys_dbl ffpknd -#define fits_copy_key ffcpky -#define fits_write_imghdr ffphps -#define fits_write_imghdrll ffphpsll -#define fits_write_grphdr ffphpr -#define fits_write_grphdrll ffphprll -#define fits_write_atblhdr ffphtb -#define fits_write_btblhdr ffphbn -#define fits_write_exthdr ffphext -#define fits_write_key_template ffpktp - -#define fits_get_hdrspace ffghsp -#define fits_get_hdrpos ffghps -#define fits_movabs_key ffmaky -#define fits_movrel_key ffmrky -#define fits_find_nextkey ffgnxk - -#define fits_read_record ffgrec -#define fits_read_card ffgcrd -#define fits_read_key_unit ffgunt -#define fits_read_keyn ffgkyn -#define fits_read_key ffgky -#define fits_read_keyword ffgkey -#define fits_read_key_str ffgkys -#define fits_read_key_log ffgkyl -#define fits_read_key_lng ffgkyj -#define fits_read_key_lnglng ffgkyjj -#define fits_read_key_flt ffgkye -#define fits_read_key_dbl ffgkyd -#define fits_read_key_cmp ffgkyc -#define fits_read_key_dblcmp ffgkym -#define fits_read_key_triple ffgkyt -#define fits_read_key_longstr ffgkls -#define fits_read_tdim ffgtdm -#define fits_read_tdimll ffgtdmll -#define fits_decode_tdim ffdtdm -#define fits_decode_tdimll ffdtdmll -#define fits_read_keys_str ffgkns -#define fits_read_keys_log ffgknl -#define fits_read_keys_lng ffgknj -#define fits_read_keys_lnglng ffgknjj -#define fits_read_keys_flt ffgkne -#define fits_read_keys_dbl ffgknd -#define fits_read_imghdr ffghpr -#define fits_read_imghdrll ffghprll -#define fits_read_atblhdr ffghtb -#define fits_read_btblhdr ffghbn -#define fits_read_atblhdrll ffghtbll -#define fits_read_btblhdrll ffghbnll -#define fits_hdr2str ffhdr2str - -#define fits_update_card ffucrd -#define fits_update_key ffuky -#define fits_update_key_null ffukyu -#define fits_update_key_str ffukys -#define fits_update_key_longstr ffukls -#define fits_update_key_log ffukyl -#define fits_update_key_lng ffukyj -#define fits_update_key_fixflt ffukyf -#define fits_update_key_flt ffukye -#define fits_update_key_fixdbl ffukyg -#define fits_update_key_dbl ffukyd -#define fits_update_key_fixcmp ffukfc -#define fits_update_key_cmp ffukyc -#define fits_update_key_fixdblcmp ffukfm -#define fits_update_key_dblcmp ffukym - -#define fits_modify_record ffmrec -#define fits_modify_card ffmcrd -#define fits_modify_name ffmnam -#define fits_modify_comment ffmcom -#define fits_modify_key_null ffmkyu -#define fits_modify_key_str ffmkys -#define fits_modify_key_longstr ffmkls -#define fits_modify_key_log ffmkyl -#define fits_modify_key_lng ffmkyj -#define fits_modify_key_fixflt ffmkyf -#define fits_modify_key_flt ffmkye -#define fits_modify_key_fixdbl ffmkyg -#define fits_modify_key_dbl ffmkyd -#define fits_modify_key_fixcmp ffmkfc -#define fits_modify_key_cmp ffmkyc -#define fits_modify_key_fixdblcmp ffmkfm -#define fits_modify_key_dblcmp ffmkym - -#define fits_insert_record ffirec -#define fits_insert_card ffikey -#define fits_insert_key_null ffikyu -#define fits_insert_key_str ffikys -#define fits_insert_key_longstr ffikls -#define fits_insert_key_log ffikyl -#define fits_insert_key_lng ffikyj -#define fits_insert_key_fixflt ffikyf -#define fits_insert_key_flt ffikye -#define fits_insert_key_fixdbl ffikyg -#define fits_insert_key_dbl ffikyd -#define fits_insert_key_fixcmp ffikfc -#define fits_insert_key_cmp ffikyc -#define fits_insert_key_fixdblcmp ffikfm -#define fits_insert_key_dblcmp ffikym - -#define fits_delete_key ffdkey -#define fits_delete_record ffdrec -#define fits_get_hdu_num ffghdn -#define fits_get_hdu_type ffghdt -#define fits_get_hduaddr ffghad -#define fits_get_hduaddrll ffghadll -#define fits_get_hduoff ffghof - -#define fits_get_img_param ffgipr -#define fits_get_img_paramll ffgiprll - -#define fits_get_img_type ffgidt -#define fits_get_img_equivtype ffgiet -#define fits_get_img_dim ffgidm -#define fits_get_img_size ffgisz -#define fits_get_img_sizell ffgiszll - -#define fits_movabs_hdu ffmahd -#define fits_movrel_hdu ffmrhd -#define fits_movnam_hdu ffmnhd -#define fits_get_num_hdus ffthdu -#define fits_create_img ffcrim -#define fits_create_imgll ffcrimll -#define fits_create_tbl ffcrtb -#define fits_create_hdu ffcrhd -#define fits_insert_img ffiimg -#define fits_insert_imgll ffiimgll -#define fits_insert_atbl ffitab -#define fits_insert_btbl ffibin -#define fits_resize_img ffrsim -#define fits_resize_imgll ffrsimll - -#define fits_delete_hdu ffdhdu -#define fits_copy_hdu ffcopy -#define fits_copy_file ffcpfl -#define fits_copy_header ffcphd -#define fits_copy_data ffcpdt -#define fits_write_hdu ffwrhdu - -#define fits_set_hdustruc ffrdef -#define fits_set_hdrsize ffhdef -#define fits_write_theap ffpthp - -#define fits_encode_chksum ffesum -#define fits_decode_chksum ffdsum -#define fits_write_chksum ffpcks -#define fits_update_chksum ffupck -#define fits_verify_chksum ffvcks -#define fits_get_chksum ffgcks - -#define fits_set_bscale ffpscl -#define fits_set_tscale fftscl -#define fits_set_imgnull ffpnul -#define fits_set_btblnull fftnul -#define fits_set_atblnull ffsnul - -#define fits_get_colnum ffgcno -#define fits_get_colname ffgcnn -#define fits_get_coltype ffgtcl -#define fits_get_coltypell ffgtclll -#define fits_get_eqcoltype ffeqty -#define fits_get_eqcoltypell ffeqtyll -#define fits_get_num_rows ffgnrw -#define fits_get_num_rowsll ffgnrwll -#define fits_get_num_cols ffgncl -#define fits_get_acolparms ffgacl -#define fits_get_bcolparms ffgbcl -#define fits_get_bcolparmsll ffgbclll - -#define fits_iterate_data ffiter - -#define fits_read_grppar_byt ffggpb -#define fits_read_grppar_sbyt ffggpsb -#define fits_read_grppar_usht ffggpui -#define fits_read_grppar_ulng ffggpuj -#define fits_read_grppar_sht ffggpi -#define fits_read_grppar_lng ffggpj -#define fits_read_grppar_lnglng ffggpjj -#define fits_read_grppar_int ffggpk -#define fits_read_grppar_uint ffggpuk -#define fits_read_grppar_flt ffggpe -#define fits_read_grppar_dbl ffggpd - -#define fits_read_pix ffgpxv -#define fits_read_pixll ffgpxvll -#define fits_read_pixnull ffgpxf -#define fits_read_pixnullll ffgpxfll -#define fits_read_img ffgpv -#define fits_read_imgnull ffgpf -#define fits_read_img_byt ffgpvb -#define fits_read_img_sbyt ffgpvsb -#define fits_read_img_usht ffgpvui -#define fits_read_img_ulng ffgpvuj -#define fits_read_img_sht ffgpvi -#define fits_read_img_lng ffgpvj -#define fits_read_img_lnglng ffgpvjj -#define fits_read_img_uint ffgpvuk -#define fits_read_img_int ffgpvk -#define fits_read_img_flt ffgpve -#define fits_read_img_dbl ffgpvd - -#define fits_read_imgnull_byt ffgpfb -#define fits_read_imgnull_sbyt ffgpfsb -#define fits_read_imgnull_usht ffgpfui -#define fits_read_imgnull_ulng ffgpfuj -#define fits_read_imgnull_sht ffgpfi -#define fits_read_imgnull_lng ffgpfj -#define fits_read_imgnull_lnglng ffgpfjj -#define fits_read_imgnull_uint ffgpfuk -#define fits_read_imgnull_int ffgpfk -#define fits_read_imgnull_flt ffgpfe -#define fits_read_imgnull_dbl ffgpfd - -#define fits_read_2d_byt ffg2db -#define fits_read_2d_sbyt ffg2dsb -#define fits_read_2d_usht ffg2dui -#define fits_read_2d_ulng ffg2duj -#define fits_read_2d_sht ffg2di -#define fits_read_2d_lng ffg2dj -#define fits_read_2d_lnglng ffg2djj -#define fits_read_2d_uint ffg2duk -#define fits_read_2d_int ffg2dk -#define fits_read_2d_flt ffg2de -#define fits_read_2d_dbl ffg2dd - -#define fits_read_3d_byt ffg3db -#define fits_read_3d_sbyt ffg3dsb -#define fits_read_3d_usht ffg3dui -#define fits_read_3d_ulng ffg3duj -#define fits_read_3d_sht ffg3di -#define fits_read_3d_lng ffg3dj -#define fits_read_3d_lnglng ffg3djj -#define fits_read_3d_uint ffg3duk -#define fits_read_3d_int ffg3dk -#define fits_read_3d_flt ffg3de -#define fits_read_3d_dbl ffg3dd - -#define fits_read_subset ffgsv -#define fits_read_subset_byt ffgsvb -#define fits_read_subset_sbyt ffgsvsb -#define fits_read_subset_usht ffgsvui -#define fits_read_subset_ulng ffgsvuj -#define fits_read_subset_sht ffgsvi -#define fits_read_subset_lng ffgsvj -#define fits_read_subset_lnglng ffgsvjj -#define fits_read_subset_uint ffgsvuk -#define fits_read_subset_int ffgsvk -#define fits_read_subset_flt ffgsve -#define fits_read_subset_dbl ffgsvd - -#define fits_read_subsetnull_byt ffgsfb -#define fits_read_subsetnull_sbyt ffgsfsb -#define fits_read_subsetnull_usht ffgsfui -#define fits_read_subsetnull_ulng ffgsfuj -#define fits_read_subsetnull_sht ffgsfi -#define fits_read_subsetnull_lng ffgsfj -#define fits_read_subsetnull_lnglng ffgsfjj -#define fits_read_subsetnull_uint ffgsfuk -#define fits_read_subsetnull_int ffgsfk -#define fits_read_subsetnull_flt ffgsfe -#define fits_read_subsetnull_dbl ffgsfd - -#define ffcpimg fits_copy_image_section -#define fits_compress_img fits_comp_img -#define fits_decompress_img fits_decomp_img - -#define fits_read_col ffgcv -#define fits_read_colnull ffgcf -#define fits_read_col_str ffgcvs -#define fits_read_col_log ffgcvl -#define fits_read_col_byt ffgcvb -#define fits_read_col_sbyt ffgcvsb -#define fits_read_col_usht ffgcvui -#define fits_read_col_ulng ffgcvuj -#define fits_read_col_sht ffgcvi -#define fits_read_col_lng ffgcvj -#define fits_read_col_lnglng ffgcvjj -#define fits_read_col_uint ffgcvuk -#define fits_read_col_int ffgcvk -#define fits_read_col_flt ffgcve -#define fits_read_col_dbl ffgcvd -#define fits_read_col_cmp ffgcvc -#define fits_read_col_dblcmp ffgcvm -#define fits_read_col_bit ffgcx -#define fits_read_col_bit_usht ffgcxui -#define fits_read_col_bit_uint ffgcxuk - -#define fits_read_colnull_str ffgcfs -#define fits_read_colnull_log ffgcfl -#define fits_read_colnull_byt ffgcfb -#define fits_read_colnull_sbyt ffgcfsb -#define fits_read_colnull_usht ffgcfui -#define fits_read_colnull_ulng ffgcfuj -#define fits_read_colnull_sht ffgcfi -#define fits_read_colnull_lng ffgcfj -#define fits_read_colnull_lnglng ffgcfjj -#define fits_read_colnull_uint ffgcfuk -#define fits_read_colnull_int ffgcfk -#define fits_read_colnull_flt ffgcfe -#define fits_read_colnull_dbl ffgcfd -#define fits_read_colnull_cmp ffgcfc -#define fits_read_colnull_dblcmp ffgcfm - -#define fits_read_descript ffgdes -#define fits_read_descriptll ffgdesll -#define fits_read_descripts ffgdess -#define fits_read_descriptsll ffgdessll -#define fits_read_tblbytes ffgtbb - -#define fits_write_grppar_byt ffpgpb -#define fits_write_grppar_sbyt ffpgpsb -#define fits_write_grppar_usht ffpgpui -#define fits_write_grppar_ulng ffpgpuj -#define fits_write_grppar_sht ffpgpi -#define fits_write_grppar_lng ffpgpj -#define fits_write_grppar_lnglng ffpgpjj -#define fits_write_grppar_uint ffpgpuk -#define fits_write_grppar_int ffpgpk -#define fits_write_grppar_flt ffpgpe -#define fits_write_grppar_dbl ffpgpd - -#define fits_write_pix ffppx -#define fits_write_pixll ffppxll -#define fits_write_pixnull ffppxn -#define fits_write_pixnullll ffppxnll -#define fits_write_img ffppr -#define fits_write_img_byt ffpprb -#define fits_write_img_sbyt ffpprsb -#define fits_write_img_usht ffpprui -#define fits_write_img_ulng ffppruj -#define fits_write_img_sht ffppri -#define fits_write_img_lng ffpprj -#define fits_write_img_lnglng ffpprjj -#define fits_write_img_uint ffppruk -#define fits_write_img_int ffpprk -#define fits_write_img_flt ffppre -#define fits_write_img_dbl ffpprd - -#define fits_write_imgnull ffppn -#define fits_write_imgnull_byt ffppnb -#define fits_write_imgnull_sbyt ffppnsb -#define fits_write_imgnull_usht ffppnui -#define fits_write_imgnull_ulng ffppnuj -#define fits_write_imgnull_sht ffppni -#define fits_write_imgnull_lng ffppnj -#define fits_write_imgnull_lnglng ffppnjj -#define fits_write_imgnull_uint ffppnuk -#define fits_write_imgnull_int ffppnk -#define fits_write_imgnull_flt ffppne -#define fits_write_imgnull_dbl ffppnd - -#define fits_write_img_null ffppru -#define fits_write_null_img ffpprn - -#define fits_write_2d_byt ffp2db -#define fits_write_2d_sbyt ffp2dsb -#define fits_write_2d_usht ffp2dui -#define fits_write_2d_ulng ffp2duj -#define fits_write_2d_sht ffp2di -#define fits_write_2d_lng ffp2dj -#define fits_write_2d_lnglng ffp2djj -#define fits_write_2d_uint ffp2duk -#define fits_write_2d_int ffp2dk -#define fits_write_2d_flt ffp2de -#define fits_write_2d_dbl ffp2dd - -#define fits_write_3d_byt ffp3db -#define fits_write_3d_sbyt ffp3dsb -#define fits_write_3d_usht ffp3dui -#define fits_write_3d_ulng ffp3duj -#define fits_write_3d_sht ffp3di -#define fits_write_3d_lng ffp3dj -#define fits_write_3d_lnglng ffp3djj -#define fits_write_3d_uint ffp3duk -#define fits_write_3d_int ffp3dk -#define fits_write_3d_flt ffp3de -#define fits_write_3d_dbl ffp3dd - -#define fits_write_subset ffpss -#define fits_write_subset_byt ffpssb -#define fits_write_subset_sbyt ffpsssb -#define fits_write_subset_usht ffpssui -#define fits_write_subset_ulng ffpssuj -#define fits_write_subset_sht ffpssi -#define fits_write_subset_lng ffpssj -#define fits_write_subset_lnglng ffpssjj -#define fits_write_subset_uint ffpssuk -#define fits_write_subset_int ffpssk -#define fits_write_subset_flt ffpsse -#define fits_write_subset_dbl ffpssd - -#define fits_write_col ffpcl -#define fits_write_col_str ffpcls -#define fits_write_col_log ffpcll -#define fits_write_col_byt ffpclb -#define fits_write_col_sbyt ffpclsb -#define fits_write_col_usht ffpclui -#define fits_write_col_ulng ffpcluj -#define fits_write_col_sht ffpcli -#define fits_write_col_lng ffpclj -#define fits_write_col_lnglng ffpcljj -#define fits_write_col_uint ffpcluk -#define fits_write_col_int ffpclk -#define fits_write_col_flt ffpcle -#define fits_write_col_dbl ffpcld -#define fits_write_col_cmp ffpclc -#define fits_write_col_dblcmp ffpclm -#define fits_write_col_null ffpclu -#define fits_write_col_bit ffpclx -#define fits_write_nulrows ffprwu -#define fits_write_nullrows ffprwu - -#define fits_write_colnull ffpcn -#define fits_write_colnull_str ffpcns -#define fits_write_colnull_log ffpcnl -#define fits_write_colnull_byt ffpcnb -#define fits_write_colnull_sbyt ffpcnsb -#define fits_write_colnull_usht ffpcnui -#define fits_write_colnull_ulng ffpcnuj -#define fits_write_colnull_sht ffpcni -#define fits_write_colnull_lng ffpcnj -#define fits_write_colnull_lnglng ffpcnjj -#define fits_write_colnull_uint ffpcnuk -#define fits_write_colnull_int ffpcnk -#define fits_write_colnull_flt ffpcne -#define fits_write_colnull_dbl ffpcnd - -#define fits_write_ext ffpextn -#define fits_read_ext ffgextn - -#define fits_write_descript ffpdes -#define fits_compress_heap ffcmph -#define fits_test_heap fftheap - -#define fits_write_tblbytes ffptbb -#define fits_insert_rows ffirow -#define fits_delete_rows ffdrow -#define fits_delete_rowrange ffdrrg -#define fits_delete_rowlist ffdrws -#define fits_delete_rowlistll ffdrwsll -#define fits_insert_col fficol -#define fits_insert_cols fficls -#define fits_delete_col ffdcol -#define fits_copy_col ffcpcl -#define fits_modify_vector_len ffmvec - -#define fits_read_img_coord ffgics -#define fits_read_tbl_coord ffgtcs -#define fits_pix_to_world ffwldp -#define fits_world_to_pix ffxypx - -#define fits_get_image_wcs_keys ffgiwcs -#define fits_get_table_wcs_keys ffgtwcs - -#define fits_find_rows fffrow -#define fits_find_first_row ffffrw -#define fits_find_rows_cmp fffrwc -#define fits_select_rows ffsrow -#define fits_calc_rows ffcrow -#define fits_calculator ffcalc -#define fits_calculator_rng ffcalc_rng -#define fits_test_expr fftexp - -#define fits_create_group ffgtcr -#define fits_insert_group ffgtis -#define fits_change_group ffgtch -#define fits_remove_group ffgtrm -#define fits_copy_group ffgtcp -#define fits_merge_groups ffgtmg -#define fits_compact_group ffgtcm -#define fits_verify_group ffgtvf -#define fits_open_group ffgtop -#define fits_add_group_member ffgtam -#define fits_get_num_members ffgtnm - -#define fits_get_num_groups ffgmng -#define fits_open_member ffgmop -#define fits_copy_member ffgmcp -#define fits_transfer_member ffgmtf -#define fits_remove_member ffgmrm - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/ls_fft.h b/src/amuse_simplex/src/plugins/HEALPix/include/ls_fft.h deleted file mode 100644 index e300a64267..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/ls_fft.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file ls_fft.h - * Interface for the LevelS FFT package. - * - * Copyright (C) 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_LS_FFT_H -#define PLANCK_LS_FFT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*!\defgroup fftgroup FFT interface -This package is intended to calculate one-dimensional real or complex FFTs -with high accuracy and good efficiency even for lengths containing large -prime factors. -The code is written in C, but a Fortran wrapper exists as well. - -Before any FFT is executed, a plan must be generated for it. Plan creation -is designed to be fast, so that there is no significant overhead if the -plan is only used once or a few times. - -The main component of the code is a C port of Swarztrauber's FFTPACK -(http://www.netlib.org/fftpack/), which was originally done by Pekka Janhunen -and reformatted by Joerg Arndt. - -I added a few digits to the floating-point constants to achieve higher -precision, split the complex transforms into separate routines for forward -and backward transforms (to increase performance a bit), and replaced -the iterative twiddling factor calculation in radfg() and radbg() by an exact -calculation of the factors. - -Since FFTPACK becomes quite slow for FFT lengths with large prime factors -(in the worst case of prime lengths it reaches O(n*n) complexity), I -implemented Bluestein's algorithm, which computes a FFT of length n by -several FFTs of length n2>=2*n and a convolution. Since n2 can be chosen -to be highly composite, this algorithm is more efficient if n has large -prime factors. The longer FFTs themselves are then computed using the FFTPACK -routines. -Bluestein's algorithm was implemented according to the description at -Wikipedia. - -\b Thread-safety: -All routines can be called concurrently; all information needed by ls_fft -is stored in the plan variable. However, using the same plan variable on -multiple threads simultaneously is not supported and will lead to data -corruption. -*/ -/*! \{ */ - -typedef struct - { - double *work; - int length; - int bluestein; - } complex_plan_i; - -/*! The opaque handle type for complex-FFT plans. */ -typedef complex_plan_i * complex_plan; - -/*! Returns a plan for a complex FFT with \a length elements. */ -complex_plan make_complex_plan (int length); -/*! Destroys a plan for a complex FFT. */ -void kill_complex_plan (complex_plan plan); -/*! Computes a complex forward FFT on \a data, using \a plan. - \a Data has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. */ -void complex_plan_forward (complex_plan plan, double *data); -/*! Computes a complex backward FFT on \a data, using \a plan. - \a Data has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. */ -void complex_plan_backward (complex_plan plan, double *data); - -typedef struct - { - double *work; - int length; - int bluestein; - } real_plan_i; - -/*! The opaque handle type for real-FFT plans. */ -typedef real_plan_i * real_plan; - -/*! Returns a plan for a real FFT with \a length elements. */ -real_plan make_real_plan (int length); -/*! Destroys a plan for a real FFT. */ -void kill_real_plan (real_plan plan); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTPACK storage scheme: - - on entry, \a data has the form r0, r1, ..., r[length-1]; - - on exit, it has the form r0, r1, i1, r2, i2, ... - (a total of \a length values). */ -void real_plan_forward_fftpack (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTPACK storage scheme: - - on entry, \a data has the form r0, r1, i1, r2, i2, ... - (a total of \a length values); - - on exit, it has the form r0, r1, ..., r[length-1]. */ -void real_plan_backward_fftpack (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTW halfcomplex storage scheme: - - on entry, \a data has the form r0, r1, ..., r[length-1]; - - on exit, it has the form r0, r1, r2, ..., i2, i1. */ -void real_plan_forward_fftw (real_plan plan, double *data); -/*! Computes a real backward FFT on \a data, using \a plan - and assuming the FFTW halfcomplex storage scheme: - - on entry, \a data has the form r0, r1, r2, ..., i2, i1. - - on exit, it has the form r0, r1, ..., r[length-1]. */ -void real_plan_backward_fftw (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming a full-complex storage scheme: - - on entry, \a data has the form r0, [ignored], r1, [ignored], ..., - r[length-1], [ignored]; - - on exit, it has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. - */ -void real_plan_forward_c (real_plan plan, double *data); -/*! Computes a real backward FFT on \a data, using \a plan - and assuming a full-complex storage scheme: - - on entry, \a data has the form r0, i0, r1, i1, ..., - r[length-1], i[length-1]; - - on exit, it has the form r0, 0, r1, 0, ..., r[length-1], 0. */ -void real_plan_backward_c (real_plan plan, double *data); - -/*! \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/lsconstants.h b/src/amuse_simplex/src/plugins/HEALPix/include/lsconstants.h deleted file mode 100644 index c26d1b6899..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/lsconstants.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file lsconstants.h - * Mathematical, physical and technical constants for LevelS. - */ - -#ifndef PLANCK_CONSTANTS_H -#define PLANCK_CONSTANTS_H - -#include - -/*! \defgroup mathconstgroup Mathematical constants */ -/*! \{ */ - -const double pi=3.141592653589793238462643383279502884197; -const double twopi=6.283185307179586476925286766559005768394; -const double inv_twopi=1.0/twopi; -const double fourpi=12.56637061435917295385057353311801153679; -const double halfpi=1.570796326794896619231321691639751442099; -const double inv_halfpi=0.6366197723675813430755350534900574; -const double inv_sqrt4pi = 0.2820947917738781434740397257803862929220; - -const double ln2 = 0.6931471805599453094172321214581766; -const double inv_ln2 = 1.4426950408889634073599246810018921; -const double ln10 = 2.3025850929940456840179914546843642; - -const double onethird=1.0/3.0; -const double twothird=2.0/3.0; -const double fourthird=4.0/3.0; - -const double degr2rad=pi/180.0; -const double rad2degr=180.0/pi; - -//! Ratio between FWHM and sigma of a Gauss curve (\f$\sqrt{8\ln2}\f$). -const double sigma2fwhm=2.3548200450309493; // sqrt(8*log(2.)) -const double fwhm2sigma=1/sigma2fwhm; - -/*! \} */ - -/*! \defgroup physconstgroup Physical constants */ -/*! \{ */ - -const double Jansky2SI=1.0e-26; -const double SI2Jansky=1.0e+26; - -//! Light speed in m/s. -const double speedOfLight=2.99792458e8; - -//! Boltzmann's constant in J/K -const double kBoltzmann=1.380658e-23; - -//! Stefan-Boltzmann constant in W/m^2/K^4 -const double sigmaStefanBoltzmann=5.67051e-8; - -//! Planck's constant in J s -const double hPlanck=6.6260755e-34; - -//! Astronomical unit in m -const double astronomicalUnit=1.49597893e11; - -//! Solar constant in W/m^2 -const double solarConstant=1368.0; - -//! Tropical year in s -const double tropicalYear=3.15569259747e7; - -//! Average CMB temperature in K -const double tcmb = 2.726; - -//! Colatitude of the solar system motion relative to CMB -//! (ecliptical coordinates). -const double solsysdir_ecl_theta = 1.7678013480275747; - -//! Longitude of the solar system motion relative to CMB -//! (ecliptical coordinates). -const double solsysdir_ecl_phi = 3.0039153062803194; - -//! Speed of the solar system motion relative to CMB in m/s. -const double solsysspeed = 371000.0; - -/*! \} */ - -// technical constants - -//! Healpix value representing "undefined" -const double Healpix_undef=-1.6375e30; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/message_error.h b/src/amuse_simplex/src/plugins/HEALPix/include/message_error.h deleted file mode 100644 index 39bc39bfda..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/message_error.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for error reporting - * - * Copyright (C) 2003, 2004 Max-Planck-Society - * Authors: Reinhard Hell, Martin Reinecke - */ - -#ifndef PLANCK_MESSAGE_ERROR_H -#define PLANCK_MESSAGE_ERROR_H - -#include -#include -#include - -#if defined (PLANCK_STACKTRACE) -#include -#endif - -inline void show_stackframe() - { -#if defined (PLANCK_STACKTRACE) - void *trace[16]; - int trace_size = backtrace(trace, 16); - char **messages = backtrace_symbols(trace, trace_size); - std::cerr << "[bt] Execution path:" << std::endl; - for (int i=0; i -#endif - -inline bool openmp_enabled() - { -#ifdef _OPENMP - return true; -#else - return false; -#endif - } - -inline int openmp_max_threads () - { -#ifdef _OPENMP - return omp_get_max_threads(); -#else - return 1; -#endif - } - -inline int openmp_thread_num () - { -#ifdef _OPENMP - return omp_get_thread_num(); -#else - return 0; -#endif - } - -/*! Calculates the range of indices between \a glo and \a ghi which - must be processed by this thread and returns it in \a lo and \a hi. - - The indices \a ghi and \a hi are "one past the last real index", - in analogy to the STL iterators. */ -inline void openmp_calc_share (int glo, int ghi, int &lo, int &hi) - { -#ifdef _OPENMP - int nwork = ghi-glo; - int nproc = omp_get_num_threads(); - int me = omp_get_thread_num(); - int nbase = nwork/nproc; - int additional = nwork%nproc; - lo = glo+me*nbase + ((me -#include -#include -#include -#include "simparams.h" -#include "cxxutils.h" - -class paramfile - { - private: - typedef std::map params_type; - params_type params; - mutable std::set read_params; - bool verbose; - - std::string get_valstr(const std::string &key) const - { - params_type::const_iterator loc=params.find(key); - if (loc!=params.end()) return loc->second; - throw Message_error ("Error: Cannot find the key \"" + key + "\"."); - } - - public: - paramfile (const std::string &filename, bool verbose_=true) - : verbose(verbose_) - { parse_file (filename, params); } - - paramfile (const params_type &par) - : params (par), verbose(true) - {} - - ~paramfile () - { - if (verbose) - for (params_type::const_iterator loc=params.begin(); - loc!=params.end(); ++loc) - if (read_params.find(loc->first)==read_params.end()) - std::cout << "Parser warning: unused parameter " - << loc->first << std::endl; - } - - bool param_present(const std::string &key) const - { return (params.find(key)!=params.end()); } - - template T find (const std::string &key) const - { - T result; - stringToData(get_valstr(key),result); - if (verbose) - std::cout << "Parser: " << key << " = " << dataToString(result) - << std::endl; - read_params.insert(key); - return result; - } - template T find - (const std::string &key, const T &deflt) - { - if (param_present(key)) return find(key); - if (verbose) - std::cout << "Parser: " << key << " = " << dataToString(deflt) - << " " << std::endl; - params[key]=dataToString(deflt); - read_params.insert(key); - return deflt; - } - - const params_type &getParams() const - { return params; } - - template void findParam - (const std::string &key, T &value) const - { value = find(key); } - - template void findHeaderParam(const std::string& key, - T& value, simparams& headerParams, const std::string& headerKey, - const std::string& headerComment) const - { - findParam(key, value); - headerParams.add(key, headerKey, dataToString(value), headerComment); - } - void findSourceParam(const std::string& key, std::string& value, - simparams& headerParams) const - { - findParam(key, value); - headerParams.add_source_file(value); - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/planck_rng.h b/src/amuse_simplex/src/plugins/HEALPix/include/planck_rng.h deleted file mode 100644 index 9231daab01..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/planck_rng.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file planck_rng.h - * This file contains the random number generator - * used by the Planck LevelS package. - * The generator is a C++ port of the xorshift generator xor128() described - * in Marsaglia, Journal of Statistical Software 2003, vol 8. - * It has a period of 2^128 - 1. - * - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_RNG_H -#define PLANCK_RNG_H - -#include -#include "cxxutils.h" - -/*! C++ port of the xorshift generator xor128() described in Marsaglia, - Journal of Statistical Software 2003, vol 8. - It has a period of 2^128 - 1. */ -class planck_rng - { - private: - unsigned int x,y,z,w; - double small, gset; - bool empty; - - void twiddle (unsigned int &v) - { - for (int i=0; i<9; ++i) - { - v ^= v<<13; - v ^= v>>17; - v ^= v<<5; - } - } - - void init_rng () - { - // avoid zero seeds - if (x==0) x = 123456789; - if (y==0) y = 362436069; - if (z==0) z = 521288629; - if (w==0) w = 88675123; - - // shuffle the bits of the seeds - twiddle(x); twiddle(y); twiddle(z); twiddle(w); - - // burn in the RNG - for (int i=0; i<16; ++i) - int_rand_uni(); - } - - public: - /*! Initializes the generator with 0 to 4 seed values. */ - planck_rng (unsigned int x1=123456789, unsigned int y1=362436069, - unsigned int z1=521288629, unsigned int w1=88675123) - : x(x1), y(y1), z(z1), w(w1), - small(1./(1.+double(0xFFFFFFFF))), empty(true) - { - planck_assert (sizeof(unsigned int)==4, "wrong integer size for RNG"); - init_rng(); - } - - /*! Re-initializes the generator with 0 to 4 seed values. */ - void seed (unsigned int x1=123456789, unsigned int y1=362436069, - unsigned int z1=521288629, unsigned int w1=88675123) - { - x = x1; y = y1; z = z1; w = w1; - empty = true; - init_rng(); - } - - /*! Returns uniformly distributed random integer numbers from the - interval [0;0xFFFFFFFF]. */ - unsigned int int_rand_uni() - { - unsigned int t = x^(x<<11); - x = y; - y = z; - z = w; - - return w=(w^(w>>19))^(t^(t>>8)); - } - - //! Returns uniformly distributed random numbers from the interval [0;1[. - double rand_uni() - { - return small*int_rand_uni(); - } - - //! Returns random numbers with Gaussian distribution (mean=0, sigma=1). - /*! Uses rand_uni() internally. */ - double rand_gauss() - { - using namespace std; - if (empty) - { - double v1,v2,rsq; - do - { - v1=2*rand_uni()-1.; - v2=2*rand_uni()-1.; - rsq=v1*v1+v2*v2; - } - while ((rsq>=1) || (rsq==0)); - double fac=sqrt(-2*log(rsq)/rsq); - gset=v1*fac; - empty=false; - return v2*fac; - } - else - { - empty=true; - return gset; - } - } - - //! Returns exponentially distributed random numbers (mean=1, nonnegative) - /*! Uses rand_uni() internally. */ - double rand_exp() - { - using namespace std; - double val=rand_uni(); - if (val==0.) val=1.; - return -log(val); - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/pointing.h b/src/amuse_simplex/src/plugins/HEALPix/include/pointing.h deleted file mode 100644 index e32a32525a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/pointing.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file pointing.h - * Class representing a direction in 3D space - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_POINTING_H -#define PLANCK_POINTING_H - -#include -#include "vec3.h" -#include "cxxutils.h" - -/*! \defgroup pointinggroup Pointings */ -/*! \{ */ - -/*! Class representing a direction in 3D space or a location on the - unit sphere. */ -class pointing - { - public: - /*! Colatitude of the pointing (i.e. the North pole is at \a theta=0). */ - double theta; - /*! Longitude of the pointing. */ - double phi; - - /*! Default constructor. \a theta and \a phi are not initialized. */ - pointing() {} - /*! Creates a pointing with \a Theta and \a Phi. */ - pointing (double Theta, double Phi) : theta(Theta), phi(Phi) {} - -// FIXME: should become "explicit" some time - /*! Creates a pointing from the vector \a inp. \a inp need not be - normalized. */ - pointing (const vec3 &inp) - { - using namespace std; - theta = atan2(sqrt(inp.x*inp.x+inp.y*inp.y),inp.z); - phi = safe_atan2 (inp.y,inp.x); - if (phi<0) phi += twopi; - } -// FIXME: should be removed some time - /*! Returns a normalized vector pointing in the same direction. */ - operator vec3() const - { - double st=sin(theta); - return vec3 (st*cos(phi), st*sin(phi), cos(theta)); - } - /*! Returns a normalized vector pointing in the same direction. */ - vec3 to_vec3() const - { - double st=sin(theta); - return vec3 (st*cos(phi), st*sin(phi), cos(theta)); - } - /*! Changes the angles so that \a 0<=theta<=pi and \a 0<=phi<2*pi. */ - void normalize() - { - theta=fmodulo(theta,twopi); - if (theta>pi) - { - phi+=pi; - theta=twopi-theta; - } - phi=fmodulo(phi,twopi); - } - }; - -/*! Converts \a vec to \a ptg. \a vec need not be normalized. - \relates pointing */ -inline void vec2pnt(const vec3 &vec, pointing &ptg) - { - using namespace std; - ptg.theta = atan2(sqrt(vec.x*vec.x+vec.y*vec.y),vec.z); - ptg.phi = safe_atan2 (vec.y,vec.x); - if (ptg.phi<0) ptg.phi += twopi; - } - -/*! Writes \a p to \a os. - \relates pointing */ -inline std::ostream &operator<< (std::ostream &os, const pointing &p) - { - os << p.theta << ", " << p.phi << std::endl; - return os; - } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/powspec.h b/src/amuse_simplex/src/plugins/HEALPix/include/powspec.h deleted file mode 100644 index d75f8a76a6..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/powspec.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef POWSPEC_H -#define POWSPEC_H - -#include "arr.h" - -/*! Class for storing unpolarised and polarised power spectra. */ -class PowSpec - { - private: - arr tt_, gg_, cc_, tg_, tc_, gc_; - int num_specs; - - void dealloc(); - - public: - /*! */ - PowSpec() {} - /*! Constructs a \a PowSpec with \a nspec components and a maximum - multipole of \a lmax. \a nspec can be 1 (TT), 4 (TT,GG,CC,TG) or - 6 (TT,GG,CC,TG,TC,GC). */ - PowSpec(int nspec, int lmax) - : num_specs(nspec) - { - planck_assert ((num_specs==1) || (num_specs==4) || (num_specs==6), - "wrong number of spectrums"); - tt_.alloc(lmax+1); - if (num_specs>1) - { - gg_.alloc(lmax+1); - cc_.alloc(lmax+1); - tg_.alloc(lmax+1); - } - if (num_specs>4) - { - tc_.alloc(lmax+1); - gc_.alloc(lmax+1); - } - } - - /*! Returns the number of spectral components. */ - int Num_specs() const { return num_specs; } - /*! Returns the maximum \a l. */ - int Lmax() const { return tt_.size()-1; } - /*! Returns the TT array (read-only). */ - const arr &tt() const { return tt_; } - /*! Returns the GG array (read-only). */ - const arr &gg() const { return gg_; } - /*! Returns the CC array (read-only). */ - const arr &cc() const { return cc_; } - /*! Returns the TG array (read-only). */ - const arr &tg() const { return tg_; } - /*! Returns the TC array (read-only). */ - const arr &tc() const { return tc_; } - /*! Returns the GC array (read-only). */ - const arr &gc() const { return gc_; } - /*! Returns TT(l) (read-write). */ - double &tt (int l) { return tt_[l]; } - /*! Returns GG(l) (read-write). */ - double &gg (int l) { return gg_[l]; } - /*! Returns CC(l) (read-write). */ - double &cc (int l) { return cc_[l]; } - /*! Returns TG(l) (read-write). */ - double &tg (int l) { return tg_[l]; } - /*! Returns TC(l) (read-write). */ - double &tc (int l) { return tc_[l]; } - /*! Returns GC(l) (read-write). */ - double &gc (int l) { return gc_[l]; } - /*! Returns TT(l) (read-only). */ - const double &tt (int l) const { return tt_[l]; } - /*! Returns GG(l) (read-only). */ - const double &gg (int l) const { return gg_[l]; } - /*! Returns CC(l) (read-only). */ - const double &cc (int l) const { return cc_[l]; } - /*! Returns TG(l) (read-only). */ - const double &tg (int l) const { return tg_[l]; } - /*! Returns TC(l) (read-only). */ - const double &tc (int l) const { return tc_[l]; } - /*! Returns GC(l) (read-only). */ - const double &gc (int l) const { return gc_[l]; } - - /*! Sets the whole TT array. */ - void Set(arr &tt_new); - /*! Sets all components. */ - void Set(arr &tt_new, arr &gg_new, - arr &cc_new, arr &tg_new); - /* Smooths the spectrum with a Gaussian beam. - \a fwhm is given in radian. - \note This is only implememted for 1 and 4 spectra so far. */ - void Smooth_with_Gauss (double fwhm); - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/powspec_fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/include/powspec_fitsio.h deleted file mode 100644 index 6297c331af..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/powspec_fitsio.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file powspec_fitsio.h - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef POWSPEC_FITSIO_H -#define POWSPEC_FITSIO_H - -#include -class fitshandle; - -class PowSpec; - -/*! \defgroup powspec_fitsio_group FITS-based I/O of power spectra */ -/*! \{ */ - -/*! Opens the FITS file \a filename, jumpd to HDU 2, and reads \a nspecs - columns into \a powspec. \a nspecs must be 1 or 4. */ -void read_powspec_from_fits (const std::string &infile, - PowSpec &powspec, int nspecs, int lmax); -/*! Inserts a new binary table into \a out, which contains one or four columns - of FITS type TDOUBLE, and writes the components of \a powspec into it. */ -void write_powspec_to_fits (fitshandle &out, - const PowSpec &powspec, int nspecs); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/rotmatrix.h b/src/amuse_simplex/src/plugins/HEALPix/include/rotmatrix.h deleted file mode 100644 index 2db8b7d37e..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/rotmatrix.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file rotmatrix.h - * Class for rotation transforms in 3D space - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ROTMATRIX_H -#define PLANCK_ROTMATRIX_H - -#include -#include "cxxutils.h" -#include "vec3.h" - -/*! \defgroup rotmatrixgroup Rotation matrices */ -/*! \{ */ - -/*! Class for rotation transforms in 3D space */ -class rotmatrix - { - public: - double entry[3][3]; - - rotmatrix () {} - - /*! Constructs a rotation matrix from its nine entries */ - rotmatrix (double a00, double a01, double a02, - double a10, double a11, double a12, - double a20, double a21, double a22) - { - entry[0][0]=a00; entry[0][1]=a01; entry[0][2]=a02; - entry[1][0]=a10; entry[1][1]=a11; entry[1][2]=a12; - entry[2][0]=a20; entry[2][1]=a21; entry[2][2]=a22; - } - - /*! Constructs a rotation matrix so that \a a is the first column, - \a b is the second column and \a c is the third column. - \note The vectors \a a, \a b and \a c must form an orthonormal system! - */ - rotmatrix (const vec3 &a, const vec3 &b, const vec3 &c); - - /*! Sets the matrix to the identity matrix. */ - void SetToIdentity (); - /*! Sets all matrix elements to zero. */ - void SetToZero (); - /*! Transposes the matrix. */ - void Transpose (); - - /*! Extracts a unit-length rotation axis \a axis and a rotation angle - \a angle from the matrix. */ - void toAxisAngle (vec3 &axis, double &angle) const; - - /*! Constructs a matrix which causes a rotation by \a angle around - \a axis. \a axis must have unit length. */ - void Make_Axis_Rotation_Transform (const vec3 &axis, double angle) - { - double sa=sin(angle), ca=cos(angle); - double ica=1-ca; - entry[0][0] = axis.x*axis.x*ica + ca; - entry[1][1] = axis.y*axis.y*ica + ca; - entry[2][2] = axis.z*axis.z*ica + ca; - double t1 = axis.x*axis.y*ica, t2 = axis.z*sa; - entry[1][0] = t1 + t2; - entry[0][1] = t1 - t2; - t1 = axis.x*axis.z*ica; t2 = axis.y*sa; - entry[2][0] = t1 - t2; - entry[0][2] = t1 + t2; - t1 = axis.y*axis.z*ica; t2 = axis.x*sa; - entry[1][2] = t1 - t2; - entry[2][1] = t1 + t2; - } - - /*! Creates a rotation matrix \a A, which performs the following operations - on a vector \a v, when \a Av is calculated: - -# rotate \a v around the z-axis by \a gamma, - -# rotate \a v' around the y-axis by \a beta, - -# rotate \a v'' around the z-axis by \a alpha. - - \note \a alpha, \a beta and \a gamma are given in radians, - the rotations are right handed. - - \note This transformation rotates the \e vectors, not the coordinate - axes! */ - void Make_CPAC_Euler_Matrix (double alpha, double beta, double gamma); - - /*! Extracts the Euler angles \a alpha, \a beta and \a gamma from the - matrix. For their definition see Make_CPAC_Euler_Matrix(). - - \note In case of ambiguity \a alpha will be 0. */ - void Extract_CPAC_Euler_Angles - (double &alpha, double &beta, double &gamma) const; - - /*! Returns the vector \a vec, transformed by the matrix. */ - vec3 Transform (const vec3 &vec) const - { - return vec3 - (vec.x*entry[0][0] + vec.y*entry[0][1] + vec.z*entry[0][2], - vec.x*entry[1][0] + vec.y*entry[1][1] + vec.z*entry[1][2], - vec.x*entry[2][0] + vec.y*entry[2][1] + vec.z*entry[2][2]); - } - /*! Returns the vector \a vec, transformed by the matrix, in \a vec2. */ - void Transform (const vec3 &vec, vec3 &vec2) const - { - vec2.x = vec.x*entry[0][0] + vec.y*entry[0][1] + vec.z*entry[0][2]; - vec2.y = vec.x*entry[1][0] + vec.y*entry[1][1] + vec.z*entry[1][2]; - vec2.z = vec.x*entry[2][0] + vec.y*entry[2][1] + vec.z*entry[2][2]; - } - }; - -/*! Returns \a a * \a b. - \relates rotmatrix */ -rotmatrix operator* (const rotmatrix &a, const rotmatrix &b); -/*! Returns \a a * \a b in \a res. - \relates rotmatrix */ -inline void matmult (const rotmatrix &a, const rotmatrix &b, rotmatrix &res) - { - for (int i=0; i<3; ++i) - for (int j=0; j<3; ++j) - res.entry[i][j] = a.entry[i][0] * b.entry[0][j] - + a.entry[i][1] * b.entry[1][j] - + a.entry[i][2] * b.entry[2][j]; - } - -/*! Returns \a a^T * \a b in \a res. - \relates rotmatrix */ -void TransposeTimes (const rotmatrix &a, const rotmatrix &b, rotmatrix &res); - -/*! Writes \a mat to \a os. - \relates rotmatrix */ -std::ostream &operator<< (std::ostream &os, const rotmatrix &mat); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/simparams.h b/src/amuse_simplex/src/plugins/HEALPix/include/simparams.h deleted file mode 100644 index f9be3ead94..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/simparams.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for storing parameter information for later use - * - * Copyright (C) 2003 Max-Planck-Society - * Authors: Reinhard Hell, Martin Reinecke - */ - -#ifndef PLANCK_SIMPARAMS_H -#define PLANCK_SIMPARAMS_H - -#include -#include -#include -#include "cxxutils.h" -class fitshandle; - -class simparams - { - private: - class Param - { - public: - std::string key, shortkey, value, comment; - - Param (const std::string &Key, const std::string &Shortkey, - const std::string &Value, const std::string &Comment) - : key(Key), shortkey(Shortkey), value(Value), comment(Comment) {} - }; - - std::vector paramMap; - std::vector source_files; - std::vector hdus; - - public: - void add_comment (const std::string &comment) - { paramMap.push_back(Param("","","",comment)); } - template void add(const std::string &key, - const std::string &shortkey, const T &value, const std::string &comment) - { - paramMap.push_back(Param(key, shortkey, dataToString(value), comment)); - } - template void add(const std::string &key, - const std::string &shortkey, const T &value) - { - paramMap.push_back(Param(key, shortkey, dataToString(value), "")); - } - - void add_source_file (const std::string &filename, int hdu=2) - { - source_files.push_back(filename); - hdus.push_back(hdu); - } - - void add_keys (std::ostream &os) const; - void add_keys (fitshandle &out) const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/tga_image.h b/src/amuse_simplex/src/plugins/HEALPix/include/tga_image.h deleted file mode 100644 index 0946b6c0a2..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/tga_image.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file tga_image.h - * Classes for creation and output of TGA image files - * - * Copyright (C) 2003, 2006 Max-Planck-Society - * \author Martin Reinecke, David Larson - */ - -#ifndef PLANCK_TGA_IMAGE_H -#define PLANCK_TGA_IMAGE_H - -#include -#include -#include -#include "arr.h" - -/*! \defgroup imagegroup Image creation */ -/*! \{ */ - -/*! A very simple class for storing RGB colours. */ -class Colour - { - public: - float r, /*!< the red component */ - g, /*!< the green component */ - b; /*!< the blue component */ - - /*! Default constructor. Does not initialize \a r, \a g and \a b. */ - Colour() {} - /*! Initializes the colour with \a R, \a G and \a B. */ - Colour (float R, float G, float B) : r(R), g(G), b(B) {} - /*! Multiplies all components with \a fact. */ - const Colour &operator*= (float fact) - { r*=fact; g*=fact; b*=fact; return *this; } - /*! Returns the sum colour of \a *this and \a c2. */ - const Colour operator+ (const Colour &c2) const - { return Colour(r+c2.r, g+c2.g, b+c2.b); } - /*! Returns \a *this, scaled by \a f. */ - const Colour operator* (double f) const - { return Colour(r*f, g*f, b*f); } - }; - -/*! A class for mapping floting-point values into colours. */ -class Palette - { - private: - std::vector cv; - std::vector fv; - - public: - /*! Adds a new data point \a f, with the corresponding colour \a c. - The additions must be done in the order of ascending \a f. */ - void add (float f, const Colour &c) - { - fv.push_back(f); - cv.push_back(c); - } - /*! Sets the palette to the predefined palette \a num. */ - void setPredefined(int num); - /*! Returns the colour corresponding to the value \a f. The colour is - determined by linear interpolation between neighbouring data points. */ - Colour Get_Colour (float f) const - { - if (f<=fv[0]) return cv[0]; - if (f>=fv[fv.size()-1]) return cv[cv.size()-1]; - int i=0; - while (f>fv[i]) ++i; - return cv[i-1]*((fv[i]-f)/(fv[i]-fv[i-1])) - + cv[i]*((f-fv[i-1])/(fv[i]-fv[i-1])); - } - }; - -class Colour8 - { - private: - void import (const Colour &col) - { - using namespace std; - r = max(0,min(255,int(col.r*256))); - g = max(0,min(255,int(col.g*256))); - b = max(0,min(255,int(col.b*256))); - } - - public: - char r,g,b; - - Colour8() {} - Colour8 (unsigned char R, unsigned char G, unsigned char B) - : r(R), g(G), b(B) {} - Colour8 (const Colour &col) - { import (col); } - const Colour8 &operator= (const Colour &col) - { import (col); return *this; } - bool operator== (const Colour8 &that) - { return (r == that.r) && (g == that.g) && (b == that.b); } - bool operator!= (const Colour8 &that) - { return (r != that.r) || (g != that.g) || (b != that.b); } - }; - -class Font - { - public: - int offset, num_chars, xpix, ypix; - const char *data; - }; - -extern const Font medium_bold_font; -extern const Font giant_font; - -/*! Class for creating and storing TGA image files. */ -class TGA_Image - { - private: - Font font; - arr2 pixel; - - void write_char (int xpos, int ypos, const Colour &col, char c, - int scale=1); - - public: - /*! */ - TGA_Image (); - /*! Creates an image object with a resolution of \a xres by \a yres. */ - TGA_Image (int xres, int yres); - /*! */ - ~TGA_Image () {} - - /*! Fills the entire image with colour \a col. */ - void fill (const Colour &col) { pixel.fill(col); } - /*! Sets the font used for annotations to \a fnt. */ - void set_font (const Font &fnt); - /*! Outputs the string \a text in colour \a col. - \a xpos, \a ypos is the lower left corner; - the font is scaled by \a scale. */ - void annotate (int xpos, int ypos, const Colour &col, - const std::string &text, int scale=1); - /*! Outputs the string \a text centered at position \a xpos, \a ypos - in colour \a col. The font is scaled by \a scale. */ - void annotate_centered (int xpos, int ypos, const Colour &col, - const std::string &text, int scale=1); - /*! Sets the pixel \a i, \a j, to the colour \a col. */ - void put_pixel (int i, int j, const Colour &col) - { - if ((i>=0) && (i=0) && (j=0) && (i=0) && (j -#include - -/*! \defgroup vec3group 3D vectors */ -/*! \{ */ - -/*! Class representing a 3D cartesian vector. */ -class vec3 - { - public: - double x, /*!< x-coordinate */ - y, /*!< y-coordinate */ - z; /*!< z-coordinate */ - - /*! Default constructor. Does not initialize \a x, \a y, and \a z. */ - vec3 () {} - /*! Creates a vector with the coordinates \a xc, \a yc, and \a zc. */ - vec3 (double xc, double yc, double zc) - : x(xc), y(yc), z(zc) {} - - /*! Creates a unit vector from a z coordinate and an azimuthal angle. */ - void set_z_phi (double z_, double phi) - { - using namespace std; - double sintheta = sqrt((1.-z_)*(1.+z_)); - x = sintheta*cos(phi); - y = sintheta*sin(phi); - z = z_; - } - - /*! Normalizes the vector to length 1. */ - void Normalize () - { - using namespace std; - double l = 1.0/sqrt (x*x + y*y + z*z); - x*=l; y*=l; z*=l; - } - - /*! Returns the length of the vector. */ - double Length () const - { return sqrt (x*x + y*y + z*z); } - - /*! Returns the squared length of the vector. */ - double SquaredLength () const - { return (x*x + y*y + z*z); } - /*! Returns the vector with the signs of all coordinates flipped. */ - const vec3 operator- () const - { return vec3 (-x, -y, -z); } - /*! Flips the signs of all coordinates. */ - void Flip () - { x=-x; y=-y; z=-z; } - /*! Subtracts \a vec from the vector. */ - const vec3 operator- (const vec3 &vec) const - { return vec3 (x-vec.x, y-vec.y, z-vec.z); } - /*! Adds \a vec to the vector. */ - const vec3 operator+ (const vec3 &vec) const - { return vec3 (x+vec.x, y+vec.y, z+vec.z); } - /*! Returns the vector scaled by \a fact. */ - const vec3 operator* (double fact) const - { return vec3 (x*fact, y*fact, z*fact); } - /*! Returns the vector scaled by \a 1/fact. */ - const vec3 operator/ (double fact) const - { double xfact = 1./fact; return vec3 (x*xfact, y*xfact, z*xfact); } - /*! Scales the vector by \a fact. */ - vec3 &operator*= (double fact) - { x*=fact; y*=fact; z*=fact; return *this; } - }; - -/*! Returns the dot product of \a v1 and \a v2. - \relates vec3 */ -inline double dotprod(const vec3 &v1, const vec3 &v2) - { return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; } - -/*! Returns the cross product of \a a and \a b. - \relates vec3 */ -inline vec3 crossprod(const vec3 &a, const vec3 &b) - { return vec3 (a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x); } - -/*! Writes \a v to \a os. - \relates vec3 */ -inline std::ostream &operator<< (std::ostream &os, const vec3 &v) - { - os << v.x << ", " << v.y << ", " << v.z << std::endl; - return os; - } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/xcomplex.h b/src/amuse_simplex/src/plugins/HEALPix/include/xcomplex.h deleted file mode 100644 index ff6ebc06f2..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/xcomplex.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file xcomplex.h - * Class for representing complex numbers, strongly inspired by C++'s - * std::complex - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_XCOMPLEX_H -#define PLANCK_XCOMPLEX_H - -#include - -/*! \defgroup complexgroup Complex number support */ -/*! \{ */ - -/*! A class for representing complex numbers. - - This template is intended as an (under-encapsulated) replacement for - the (over-encapsulated) std::complex<>. The goal is to include the - whole functionality of std::complex<>, with some additional methods - that allow higher performance. - - The (known and intentional) differences between xcomplex<> and - std::complex<> are: - - the default constructor of xcomplex<> does nothing, in contrast to - std::complex<>, which initialises its members to zero. - - xcomplex<> implements the methods real() and imag() according - to defect report DR387 -*/ -template class xcomplex - { - public: - T re, /*!< real part */ - im; /*!< imaginary part */ - - /*! Default constructor. \a re and \a im are not initialised. */ - xcomplex () {} - /*! Creates the complex number (\a re_, \a im_). */ - xcomplex (const T &re_, const T &im_) - : re(re_), im(im_) {} - /*! Creates the complex number (\a re_, 0). */ - xcomplex (const T &re_) - : re(re_), im(0) {} - /*! Creates a complex number as a copy of \a orig. */ - template xcomplex (const xcomplex &orig) - : re(orig.re), im(orig.im) {} - - /*! Returns the real part as lvalue. */ - T &real() { return re; } - /*! Returns the real part. */ - const T &real() const { return re; } - /*! Returns the imaginary part as lvalue. */ - T &imag() { return im; } - /*! Returns the imaginary part. */ - const T &imag() const { return im; } - - /*! Sets the number to (\a re_, \a im_). */ - void Set (const T &re_, const T &im_) - { re = re_; im = im_; } - - /*! Sets the number to \a orig. */ - template xcomplex &operator= (const xcomplex &orig) - { re=orig.re; im=orig.im; return *this; } - /*! Sets the number to (\a orig, 0). */ - xcomplex &operator= (const T &orig) - { re=orig; im=0; return *this; } - /*! Adds \a orig to \a *this. */ - xcomplex &operator+= (const xcomplex &orig) - { re+=orig.re; im+=orig.im; return *this; } - /*! Subtracts \a orig from \a *this. */ - xcomplex &operator-= (const xcomplex &orig) - { re-=orig.re; im-=orig.im; return *this; } - /*! Multiplies \a *this by \a orig. */ - xcomplex &operator*= (const xcomplex &orig) - { - T tmp=re; - re=re*orig.re-im*orig.im; im=tmp*orig.im+im*orig.re; - return *this; - } - /*! Multiplies \a *this by \a fact. */ - xcomplex &operator*= (const T &fact) - { re*=fact; im*=fact; return *this; } - /*! Returns \a *this * \a fact. */ - xcomplex operator* (const T &fact) const - { return xcomplex (re*fact,im*fact); } - /*! Returns \a *this * \a b. */ - xcomplex operator* (const xcomplex &b) const - { return xcomplex (re*b.re-im*b.im, re*b.im+im*b.re); } - /*! Returns \a *this + \a b. */ - xcomplex operator+ (const xcomplex &b) const - { return xcomplex (re+b.re, im+b.im); } - /*! Returns \a *this - \a b. */ - xcomplex operator- (const xcomplex &b) const - { return xcomplex (re-b.re, im-b.im); } - /*! Returns \a -(*this) */ - xcomplex operator- () const - { return xcomplex (-re,-im); } - - /*! Flips the signs of both components. */ - void Negate() - { re=-re; im=-im; } - /*! Flips the signs of the imaginary component. */ - void Conjugate() - { im=-im; } - /*! Returns the complex conjugate of \a *this. */ - xcomplex conj() const - { return xcomplex (re,-im); } - - /*! Returns the norm of \a *this. */ - T norm() const - { return re*re + im*im; } - }; - -/*! Returns the complex conjugate of \a num. - \relates xcomplex */ -template inline xcomplex conj (const xcomplex &num) - { return xcomplex (num.re, -num.im); } -/*! Returns the norm of \a num. - \relates xcomplex */ -template inline T norm (const xcomplex &num) - { return num.re*num.re + num.im*num.im; } -/*! Returns \a f1*f2. - \relates xcomplex */ -template inline xcomplex operator* - (const T &f1, const xcomplex &f2) - { return xcomplex (f1*f2.re, f1*f2.im); } -/*! Writes \a val to \a os. - \relates xcomplex */ -template - inline std::ostream &operator<< (std::ostream &os, const xcomplex &val) - { os << "(" << val.re << "," << val.im << ")"; return os; } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/include/ylmgen.h b/src/amuse_simplex/src/plugins/HEALPix/include/ylmgen.h deleted file mode 100644 index 3a5ee695d7..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/include/ylmgen.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Code for efficient calculation of Y_lm(theta,phi=0) - * - * Copyright (C) 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef PLANCK_YLMGEN_H -#define PLANCK_YLMGEN_H - -#include -#include "arr.h" -#include "lsconstants.h" - -/*! Class for efficient calculation of Y_lm(theta,phi=0) */ -class Ylmgen - { - private: - double fsmall, fbig, eps, cth_crit; - int lmax, mmax, m_last, m_crit; - arr cf; - arr recfac; - arr mfac; - arr t1fac, t2fac; - - enum { large_exponent2 = 90, minscale=-4 }; - - void recalc_recfac (int m) - { - using namespace std; - - if (m_last==m) return; - - double f_old=1; - for (int l=m; llmax, all - absolute values are smaller than \a epsilon. - \a result[l] is undefined for all \a l &result, - int &firstl) - { - using namespace std; - - planck_assert (m<=mmax, "get_Ylm: m larger than mmax"); - - if (((m>=m_crit)&&(abs(cth)>=cth_crit)) || ((m>0)&&(sth==0))) - { firstl=lmax+1; return; } - - recalc_recfac(m); - result.alloc(lmax+1); - - double logval = mfac[m]; - if (m>0) logval += m*inv_ln2*log(sth); - int scale = int (logval/large_exponent2)-minscale; - double corfac = (scale<0) ? 0. : cf[scale]; - double lam_1 = 0; - double lam_2 = exp(ln2*(logval-(scale+minscale)*large_exponent2)); - if (m&1) lam_2 = -lam_2; - - int l=m; - while (true) - { - if (abs(lam_2*corfac)>eps) break; - if (++l>lmax) break; - double lam_0 = cth*lam_2*recfac[l-1][0] - lam_1*recfac[l-1][1]; - if (abs(lam_0*corfac)>eps) { lam_1=lam_2; lam_2=lam_0; break; } - if (++l>lmax) break; - lam_1 = cth*lam_0*recfac[l-1][0] - lam_2*recfac[l-1][1]; - if (abs(lam_1*corfac)>eps) { lam_2=lam_1; lam_1=lam_0; break; } - if (++l>lmax) break; - lam_2 = cth*lam_1*recfac[l-1][0] - lam_0*recfac[l-1][1]; - - while (abs(lam_2)>fbig) - { - lam_1 *= fsmall; - lam_2 *= fsmall; - ++scale; - corfac = (scale<0) ? 0. : cf[scale]; - } - } - - firstl=l; - if (l>lmax) - { m_crit=m; cth_crit=abs(cth); return; } - - lam_1*=corfac; - lam_2*=corfac; - - for (;llmax) break; - double lam_0 = cth*lam_2*recfac[l-1][0] - lam_1*recfac[l-1][1]; - result[l] = lam_0; - if (++l>lmax) break; - lam_1 = cth*lam_0*recfac[l-1][0] - lam_2*recfac[l-1][1]; - result[l] = lam_1; - if (++l>lmax) break; - lam_2 = cth*lam_1*recfac[l-1][0] - lam_0*recfac[l-1][1]; - } - } - - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/lib/empty_dir.txt b/src/amuse_simplex/src/plugins/HEALPix/lib/empty_dir.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/Healpix_cxx.dox b/src/amuse_simplex/src/plugins/HEALPix/src/Healpix_cxx.dox deleted file mode 100644 index 19ae9937bd..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/Healpix_cxx.dox +++ /dev/null @@ -1,133 +0,0 @@ -/*! \mainpage HEALPix C++ documentation -
    -
  • \ref components "Programming interface" -
  • \ref facilities "Facilities" -
- */ - -/*! \page components Code components - - Classes: - - Healpix_Base contains all functionality related to the HEALPix - pixelisation which does not require actual map data. - - Healpix_Base2 is analogous to Healpix_Base, but allows for much - higher resolutions. - - Healpix_Map is derived from Healpix_Base and implements - additional functionality like change of the ordering scheme, up- and - degrading and interpolation. - - Alm is used to store spherical harmonic coefficients. - - PowSpec is used to store \f$C_l\f$ coefficients. - - Conversions between different data types: - - \ref alm_healpix_group "HEALPix maps <-> a_lm". - - \ref alm_ps_group "power spectra <-> a_lm". - - FITS I/O: - - for \ref healpix_map_fitsio_group "HEALPix Maps" - - for \ref alm_fitsio_group "spherical harmonic coefficients" - - for \ref powspec_fitsio_group "power spectra" -*/ - -/*! \page facilities HEALPix C++ facilities - - \section syn_alm_cxx - This program reads a set of \f$C_l\f$ from disk and converts it to - a set of \f$a_{lm}\f$. - - \verbinclude syn_alm_cxx.par.txt - - \section alm2map_cxx - This program reads a set of \f$a_{lm}\f$ from disk and converts them to - a HEALPix map. - - \verbinclude alm2map_cxx.par.txt - - \section anafast_cxx - This program performs harmonic analysis of a HEALPix map up to a - user-specified maximum spherical harmonic order \f$l_{\mbox{max}}\f$. - The integrals are computed on the whole sphere. - Scalar, or scalar and tensor, spherical harmonic coefficients are evaluated - from the map(s) if the input provides, respectively, only the temperature, - or temperature and polarisation maps. - The total operation count scales as \f${\cal {O}}(N_{\mbox{pix}}^{3/2})\f$ - with a prefactor depending on \f$l_{\mbox{max}}\f$. - - Anafast_cxx reads a file containing the map(s) and produces a file - containing the temperature power spectrum \f$C^T_l\f$ and, if requested, - also the polarisation power spectra \f$C^E_l\f$, \f$C^B_l\f$ and - \f$C^{T\times E}_l\f$. The \f$a_{lm}\f$ coefficients computed during the - execution also can be written to a file if requested. - - Anafast_cxx executes an approximate, discrete point-set quadrature on - a sphere sampled at the HEALPix pixel centers. - Spherical harmonic transforms are computed using recurrence relations for - Legendre polynomials on co-latitude (\f$\vartheta\f$) and Fast Fourier - transforms on longitude (\f$\varphi\f$). - - Anafast permits two execution options which allow a significant - improvement of accuracy of the approximate quadrature performed by - this facility: - - - An improved analysis using the provided ring weights, which correct the - quadrature on latitude, and/or - - An iterative scheme using in succession several backward and forward - harmonic transforms of the maps. - - \verbinclude anafast_cxx.par.txt - - \section map2tga - This program reads in a HEALPix sky map in FITS format and generates an - image in TGA format. map2tga allows the selection of the projection - scheme (Mollweide or Gnomonic for small patches of the sky), color - table, color bar inclusion, linear or log scaling, maximum and - minimum range for the plot and plot-title. The facility provides - a command-line interface, but can also read a parameter file. - - \verbinclude map2tga.par.txt - - \section rotalm_cxx - Performs a coordinate transformation on a set of \f$a_{lm}\f$. - - \verbatim -Usage: rotalm_cxx -Transform 1: Equatorial (2000) -> Galactic (2000) - 2: Galactic (2000) -> Equatorial (2000) - 3: Equatorial (2000) -> Ecliptic (2000) - 4: Ecliptic (2000) -> Equatorial (2000) - 5: Ecliptic (2000) -> Galactic (2000) - 6: Galactic (2000) -> Ecliptic (2000) - 7: Equatorial (1950) -> Galactic (1950) - 8: Galactic (1950) -> Equatorial (1950) - 9: Equatorial (1950) -> Ecliptic (1950) - 10: Ecliptic (1950) -> Equatorial (1950) - 11: Ecliptic (1950) -> Galactic (1950) - 12: Galactic (1950) -> Ecliptic (1950) - \endverbatim - - \section mult_alm - This program reads a set of (unpolarised or polarised) \f$a_{lm}\f$, - removes pixel window functions and/or Gaussian beams, applies different - pixel window functions or Gaussian beams, and outputs the result. - - \verbinclude mult_alm.par.txt - - \section smoothing_cxx - This program reads a (unpolarised or polarised) HEALPix map, converts it - to \f$a_{lm}\f$, performs a smoothing operation with a Gaussian beam, - converts the \f$a_{lm}\f$ back to a map and outputs the result. - - \verbinclude smoothing_cxx.par.txt - - \section calc_powspec - This program reads one or two sets of \f$a_{lm}\f$, extracts the - (unpolarised or polarised) power spectrum or the unpolarised cross power - spectrum, and outputs the result. - - \verbatim Usage: calc_powspec [] \endverbatim - - \section median_filter - This program inputs a HEALPix map, runs a median filter with the desired - radius on it and saves the result to another file. - - \verbatim Usage: median_filter \endverbatim -*/ diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/Makefile b/src/amuse_simplex/src/plugins/HEALPix/src/Makefile deleted file mode 100644 index 191cf27334..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -MPICXX ?= mpicxx - -SPHERE_HEADERS= alm.h alm_fitsio.h \ - alm_powspec_tools.h powspec.h \ - powspec_fitsio.h \ - ylmgen.h alm_map_tools.h - -HEADERS= healpix_base.h healpix_map.h \ - healpix_map_fitsio.h alm_healpix_tools.h \ - healpix_data_io.h healpix_base2.h \ - $(SPHERE_HEADERS) - -SPHERE_OBJ= alm_fitsio.o powspec_fitsio.o alm_powspec_tools.o powspec.o \ - alm_map_tools.o - -HEALPIX_OBJ= healpix_base.o healpix_map.o healpix_map_fitsio.o \ - alm_healpix_tools.o healpix_data_io.o healpix_base2.o $(SPHERE_OBJ) - -#include $(PARAMFILE) -INCDIR = ../include -LIBDIR = ../lib - -INCLUDE = -I$(INCDIR) -ARCREATE= ar crv -export ARCREATE - - -all: libhealpix_cxx.a - -libcxxsupport.a: - @cd cxxsupport ; \ - make all - cp -f cxxsupport/libcxxsupport.a $(LIBDIR)/libcxxsupport.a - cp -f cxxsupport/libcxxsupport.a libcxxsupport.a - -libfftpack.a: - @cd libfftpack ; \ - make all - cp -f libfftpack/libfftpack.a $(LIBDIR)/libfftpack.a - cp -f libfftpack/libfftpack.a libfftpack.a - -libhealpix_cxx.a: $(HEALPIX_OBJ) $(HEADERS) - $(ARCREATE) libhealpix_cxx.a $(HEALPIX_OBJ) - cp -f libhealpix_cxx.a $(LIBDIR)/libhealpix_cxx.a - -%.o : %.cc - $(MPICXX) $(CXXCFLAGS) -o $@ -c $< $(INCLUDE) - -clean: - $(RM) *.o *.a $(LIBDIR)/*.a - @cd cxxsupport ; \ - make clean - @cd libfftpack ; \ - make clean - -healpix_base.o: healpix_base.h libcxxsupport.a -healpix_base2.o: healpix_base.h healpix_base2.h libcxxsupport.a -healpix_map.o: healpix_base.h healpix_map.h libcxxsupport.a -healpix_map_fitsio.o: healpix_map_fitsio.h healpix_map.h healpix_base.h \ - libcxxsupport.a -alm_fitsio.o: alm_fitsio.h alm.h \ - libcxxsupport.a -healpix_data_io.o: healpix_data_io.h libcxxsupport.a -powspec_fitsio.o: powspec.h libcxxsupport.a -powspec.o: powspec.h libcxxsupport.a -alm_healpix_tools.o: healpix_base.h healpix_map.h alm.h \ - ylmgen.h alm_healpix_tools.h alm_map_tools.h \ - libfftpack.a libcxxsupport.a -alm_map_tools.o: alm.h ylmgen.h alm_map_tools.h libfftpack.a libcxxsupport.a -alm_powspec_tools.o: powspec.h alm.h alm_powspec_tools.h libcxxsupport.a - diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm.h b/src/amuse_simplex/src/plugins/HEALPix/src/alm.h deleted file mode 100644 index 23cb4c89e5..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm.h - * Class for storing spherical harmonic coefficients. - * - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_H -#define PLANCK_ALM_H - -#include "arr.h" - -/*! Class for storing spherical harmonic coefficients. */ -template class Alm - { - private: - int lmax, mmax, tval; - arr alm; - - public: - /*! Returns the number of coefficients in an Alm object with maximum - quantum numbers \a l and \a m. */ - static long Num_Alms (int l, int m) - { - planck_assert(m<=l,"mmax must not be larger than lmax"); - return ((m+1)*(m+2))/2 + (m+1)*(l-m); - } - - /*! Constructs an Alm object with given \a lmax and \a mmax. */ - Alm (int lmax_=0, int mmax_=0) - : lmax(lmax_), mmax(mmax_), tval(2*lmax+1), - alm (Num_Alms(lmax,mmax)) - {} - - /*! Deletes the old coefficients and allocates storage according to - \a lmax and \a mmax. */ - void Set (int lmax_, int mmax_) - { - lmax=lmax_; - mmax=mmax_; - tval=2*lmax+1; - alm.alloc(Num_Alms(lmax,mmax)); - } - - /*! Deallocates the old coefficients and uses the content of \a data - for storage. \a data is deallocated during the call. */ - void Set (arr &data, int lmax_, int mmax_) - { - planck_assert (Num_Alms(lmax_,mmax_)==data.size(),"wrong array size"); - lmax=lmax_; - mmax=mmax_; - tval=2*lmax+1; - alm.transfer(data); - } - - /*! Sets all coefficients to zero. */ - void SetToZero () - { alm.fill (0); } - - /*! Multiplies all coefficients by \a factor. */ - template void Scale (const T2 &factor) - { for (int m=0; m void ScaleL (const arr &factor) - { - planck_assert(factor.size()>lmax, "alm.ScaleL: factor array too short"); - for (int m=0; m<=mmax; ++m) - for (int l=m; l<=lmax; ++l) - operator()(l,m)*=factor[l]; - } - /*! Adds \a num to a_00. */ - template void Add (const T2 &num) - { alm[0]+=num; } - - /*! Returns a reference to the specified coefficient. */ - T &operator() (int l, int m) - { return alm[((m*(tval-m))>>1) + l]; } - /*! Returns a constant reference to the specified coefficient. */ - const T &operator() (int l, int m) const - { return alm[((m*(tval-m))>>1) + l]; } - - /*! Returns a pointer for a given m, from which the address of a_lm - can be obtained by adding l. */ - T *mstart (int m) - { return &alm[(m*(tval-m))>>1]; } - /*! Returns a pointer for a given m, from which the address of a_lm - can be obtained by adding l. */ - const T *mstart (int m) const - { return &alm[(m*(tval-m))>>1]; } - - /*! Returns the maximum \a l */ - int Lmax() const { return lmax; } - /*! Returns the maximum \a m */ - int Mmax() const { return mmax; } - - /*! Returns a constant reference to the a_lm data. */ - const arr &Alms () const { return alm; } - - /*! Swaps the contents of two A_lm objects. */ - void swap (Alm &other) - { - std::swap(lmax, other.lmax); - std::swap(mmax, other.mmax); - std::swap(tval, other.tval); - alm.swap(other.alm); - } - - /*! Returns \a true, if both objects have the same \a lmax and \a mmax, - else \a false. */ - bool conformable (const Alm &other) const - { return ((lmax==other.lmax) && (mmax==other.mmax)); } - - /*! Adds all coefficients from \a other to the own coefficients. */ - void Add (const Alm &other) - { - planck_assert (conformable(other), "A_lm are not conformable"); - for (int m=0; m void alm2map_cxx (paramfile ¶ms, simparams &par) - { - par.add_comment("-----------------------"); - par.add_comment(" ** alm2map_cxx 1.0 **"); - par.add_comment("-----------------------"); - - int nlmax = params.template find("nlmax"); - par.add("nlmax","NLMAX",nlmax,"maximum l of the alms"); - int nmmax = params.template find("nmmax",nlmax); - par.add("nmmax","NMMAX",nmmax,"maximum m of the alms"); - planck_assert(nmmax<=nlmax,"nmmax must not be larger than nlmax"); - string infile = params.template find("infile"); - par.add_source_file (infile, 2); - string outfile = params.template find("outfile"); - int nside = params.template find("nside"); - double fwhm_arcmin = params.template find("fwhm_arcmin",0); - - arr temp, pol; - get_pixwin (params,par,nlmax,nside,temp,pol); - - bool deriv = params.template find("derivatives",false); - if (deriv) - { - Alm > alm; - read_Alm_from_fits(infile,alm,nlmax,nmmax,2); - if (fwhm_arcmin>0) smooth_with_Gauss (alm, fwhm_arcmin); - Healpix_Map map(nside,RING,SET_NSIDE), - mapdth(nside,RING,SET_NSIDE), - mapdph(nside,RING,SET_NSIDE); - alm.ScaleL(temp); - - double offset = alm(0,0).real()/sqrt(fourpi); - alm(0,0) = 0; - alm2map_der1(alm,map,mapdth,mapdph); - for (int m=0; m::DTYPE); - par.add_keys(out); - return; - } - - bool polarisation = params.template find("polarisation"); - if (!polarisation) - { - Alm > alm; - read_Alm_from_fits(infile,alm,nlmax,nmmax,2); - if (fwhm_arcmin>0) smooth_with_Gauss (alm, fwhm_arcmin); - Healpix_Map map(nside,RING,SET_NSIDE); - alm.ScaleL(temp); - - double offset = alm(0,0).real()/sqrt(fourpi); - alm(0,0) = 0; - alm2map(alm,map); - map.add(offset); - fitshandle out; - out.create (outfile); - write_Healpix_map_to_fits (out,map,FITSUTIL::DTYPE); - par.add_keys(out); - } - else - { - Alm > almT, almG, almC; - read_Alm_from_fits(infile,almT,nlmax,nmmax,2); - read_Alm_from_fits(infile,almG,nlmax,nmmax,3); - read_Alm_from_fits(infile,almC,nlmax,nmmax,4); - if (fwhm_arcmin>0) smooth_with_Gauss (almT, almG, almC, fwhm_arcmin); - Healpix_Map mapT(nside,RING,SET_NSIDE), mapQ(nside,RING,SET_NSIDE), - mapU(nside,RING,SET_NSIDE); - almT.ScaleL(temp); - almG.ScaleL(pol); almC.ScaleL(pol); - - double offset = almT(0,0).real()/sqrt(fourpi); - almT(0,0) = 0; - alm2map_pol(almT,almG,almC,mapT,mapQ,mapU); - mapT.add(offset); - fitshandle out; - out.create (outfile); - write_Healpix_map_to_fits (out,mapT,mapQ,mapU,FITSUTIL::DTYPE); - par.add_keys(out); - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("alm2map_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? alm2map_cxx(params,par) : alm2map_cxx(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm2map_cxx.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/alm2map_cxx.par.txt deleted file mode 100644 index afbffa8272..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm2map_cxx.par.txt +++ /dev/null @@ -1,36 +0,0 @@ -Parameters read by alm2map_cxx: - -nlmax (integer): - maximum order of l - -nmmax (integer): - maximum order of m (must not be larger than nlmax, default=nlmax) - -infile (string): - input file containing the a_lm - -outfile (string): - output file name for the Healpix map(s) - -nside (integer): - nside parameter for the output map(s) - -polarisation (bool): - if false, only the intensity map is generated, - if true, maps for I, Q and U are generated - -fwhm_arcmin (double, default=0): - FWHM in arc minutes of a Gaussian beam, which is used to smooth - the a_lm - -pixel_window (bool, default=false): - if true, the a_lm are multiplied by the appropriate pixel window function - -if (pixel_window) - healpix_data (string): - directory containing the Healpix data files -endif - -double_precision (bool, default=false): - if false, a_lm and maps are read/written in single precision, - otherwise in double precision. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.cc b/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.cc deleted file mode 100644 index 3775eaa060..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.cc +++ /dev/null @@ -1,260 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include -#include "alm_fitsio.h" -#include "alm.h" -#include "fitshandle.h" -#include "xcomplex.h" - -using namespace std; - -void get_almsize(fitshandle &inp, int &lmax, int &mmax) - { - if (inp.key_present("MAX-LPOL") && inp.key_present("MAX-MPOL")) - { - inp.get_key ("MAX-LPOL",lmax); - inp.get_key ("MAX-MPOL",mmax); - return; - } - - int n_alms = inp.nelems(1); - arr index; - const int chunksize=1024*256; - int offset=0; - lmax=-1; - mmax=-1; - while (offsetlmax) lmax=l; - if (m>mmax) mmax=m; - } - offset+=chunksize; - } - } - -void get_almsize(const string &filename, int &lmax, int &mmax, int hdunum) - { - fitshandle inp; - inp.open (filename); - inp.goto_hdu(hdunum); - get_almsize (inp, lmax, mmax); - } - -void get_almsize_pol(const string &filename, int &lmax, int &mmax) - { - int tlmax, tmmax; - fitshandle inp; - inp.open (filename); - lmax=mmax=0; - for (int hdu=2; hdu<=4; ++hdu) - { - inp.goto_hdu(hdu); - get_almsize (inp,tlmax,tmmax); - if (tlmax>lmax) lmax=tlmax; - if (tmmax>mmax) mmax=tmmax; - } - } - -template void read_Alm_from_fits - (fitshandle &inp, Alm >&alms, int lmax, int mmax) - { - int n_alms = inp.nelems(1); - arr index; - arr re, im; - - alms.Set(lmax, mmax); - alms.SetToZero(); - int max_index = lmax*lmax + lmax + mmax + 1; - const int chunksize=1024*256; - int offset=0; - while (offsetmax_index) return; - - int l = isqrt(index[i]-1); - int m = index[i] - l*l - l - 1; - planck_assert(m>=0,"negative m encountered"); - planck_assert(l>=m, "wrong l,m combination"); - if ((l<=lmax) && (m<=mmax)) - alms(l,m).Set (re[i], im[i]); - } - offset+=chunksize; - } - } - -template void read_Alm_from_fits (fitshandle &inp, - Alm > &alms, int lmax, int mmax); -template void read_Alm_from_fits (fitshandle &inp, - Alm > &alms, int lmax, int mmax); - - -template void read_Alm_from_fits - (const string &filename, Alm >&alms, int lmax, int mmax, - int hdunum) - { - fitshandle inp; - inp.open (filename); - inp.goto_hdu(hdunum); - read_Alm_from_fits(inp,alms,lmax,mmax); - } - -template void read_Alm_from_fits (const string &filename, - Alm > &alms, int lmax, int mmax, int hdunum); -template void read_Alm_from_fits (const string &filename, - Alm > &alms, int lmax, int mmax, int hdunum); - - -template void write_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, int mmax, - int datatype) - { - vector cols; - cols.push_back (fitscolumn("index","l*l+l+m+1",1,TINT32BIT)); - cols.push_back (fitscolumn("real","unknown",1,datatype)); - cols.push_back (fitscolumn("imag","unknown",1,datatype)); - out.insert_bintab(cols); - arr index; - arr re, im; - - int lm=alms.Lmax(), mm=alms.Mmax(); - int n_alms = ((mmax+1)*(mmax+2))/2 + (mmax+1)*(lmax-mmax); - - int l=0, m=0; - const int chunksize=1024*256; - int offset=0; - while (offsetl) || (m>mmax)) { ++l; m=0; } - } - out.write_column(1,index,offset); - out.write_column(2,re,offset); - out.write_column(3,im,offset); - - offset+=chunksize; - } - out.add_key("MAX-LPOL",lmax,"highest l in the table"); - out.add_key("MAX-MPOL",mmax,"highest m in the table"); - } - -template void write_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, - int mmax, int datatype); -template void write_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, - int mmax, int datatype); - - -template void write_compressed_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, int mmax, - int datatype) - { - vector cols; - cols.push_back (fitscolumn("index","l*l+l+m+1",1,TINT32BIT)); - cols.push_back (fitscolumn("real","unknown",1,datatype)); - cols.push_back (fitscolumn("imag","unknown",1,datatype)); - out.insert_bintab(cols); - arr index; - arr re, im; - - int n_alms = 0; - for (int m=0; m<=mmax; ++m) - for (int l=m; l<=lmax; ++l) - if (alms(l,m).norm()>0) ++n_alms; - - int l=0, m=0; - const int chunksize=1024*256; - int real_lmax=0, real_mmax=0; - int offset=0; - while (offsetl) || (m>mmax)) { ++l; m=0; } - } - index[i] = l*l + l + m + 1; - re[i] = alms(l,m).re; - im[i] = alms(l,m).im; - if (l>real_lmax) real_lmax=l; - if (m>real_mmax) real_mmax=m; - ++m; - if ((m>l) || (m>mmax)) { ++l; m=0; } - } - out.write_column(1,index,offset); - out.write_column(2,re,offset); - out.write_column(3,im,offset); - - offset+=chunksize; - } - out.add_key("MAX-LPOL",real_lmax,"highest l in the table"); - out.add_key("MAX-MPOL",real_mmax,"highest m in the table"); - } - -template void write_compressed_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, - int mmax, int datatype); -template void write_compressed_Alm_to_fits - (fitshandle &out, const Alm > &alms, int lmax, - int mmax, int datatype); diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.h deleted file mode 100644 index 90fc8e0e0f..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_fitsio.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_fitsio.h - * FITS I/O for spherical harmonic coefficients - * - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_FITSIO_H -#define PLANCK_ALM_FITSIO_H - -#include -#include "xcomplex.h" -class fitshandle; - -template class Alm; - -/*! \defgroup alm_fitsio_group FITS-based I/O of a_lm */ -/*! \{ */ - -/*! Returns the maximum \a l and \a m multipole moments found in the FITS HDU - pointed to be \a inp in \a lmax and \a mmax. */ -void get_almsize(fitshandle &inp, int &lmax, int &mmax); -/*! Returns the maximum \a l and \a m multipole moments found in the HDU - \a hdunum of file \a filename in \a lmax and \a mmax. */ -void get_almsize(const std::string &filename, int &lmax, int &mmax, - int hdunum=2); -/*! Returns the maximum \a l and \a m multipole moments found in the HDUs - 2, 3 and 4 of file \a filename in \a lmax and \a mmax. */ -void get_almsize_pol(const std::string &filename, int &lmax, int &mmax); - -/*! Reads the a_lm of the FITS binary table pointed to by \a inp into - \a alms. \a alms is reallocated with the parameters \a lmax and \a mmax. - Values not present in the FITS table are set to zero; values outside - the requested (l,m) range are ignored. */ -template void read_Alm_from_fits - (fitshandle &inp, Alm > &alms, int lmax, int mmax); -/*! Opens the FITS file \a filename, jumps to the HDU \a hdunum, then reads - the a_lm from the FITS binary table there into \a alms. \a alms is - reallocated with the parameters \a lmax and \a mmax. - Values not present in the FITS table are set to zero; values outside - the requested \a (l,m) range are ignored. */ -template void read_Alm_from_fits - (const std::string &filename, Alm > &alms, - int lmax, int mmax, int hdunum=2); - -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type TINT32BIT, \a datatype and \a datatype, respectively. - The data in \a alms is written into this table; values outside - the requested (\a lmax, \a mmax) range are omitted. */ -template void write_Alm_to_fits - (fitshandle &out, const Alm > &alms, - int lmax, int mmax, int datatype); - -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type TINT32BIT, \a datatype and \a datatype, respectively. - The data in \a alms is written into this table; values outside - the requested (\a lmax, \a mmax) range are omitted. Values with an absolute - magnitude of zero are not written. */ -template void write_compressed_Alm_to_fits - (fitshandle &out, const Alm > &alms, - int lmax, int mmax, int datatype); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.cc b/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.cc deleted file mode 100644 index 9491f19335..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.cc +++ /dev/null @@ -1,353 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "alm_healpix_tools.h" -#include "alm_map_tools.h" -#include "alm.h" -#include "healpix_map.h" -#include "xcomplex.h" - -using namespace std; - -namespace { - -void healpix2ringpairs (const Healpix_Base &base, - const arr &weight, vector &pair) - { - pair.clear(); - int startpix, ringpix; - double theta, wgt, phi0; - bool shifted; - int nside = base.Nside(); - for (int m=0; m<2*nside-1; ++m) - { - base.get_ring_info2 (m+1, startpix, ringpix, theta, shifted); - wgt = weight[m]*fourpi/base.Npix(); - phi0 = shifted ? pi/ringpix : 0; - pair.push_back (ringpair( - ringinfo(theta, phi0, wgt, ringpix, startpix), - ringinfo(pi-theta, phi0, wgt, ringpix, base.Npix()-startpix-ringpix))); - } - base.get_ring_info2 (2*nside, startpix, ringpix, theta, shifted); - wgt = weight[2*nside-1]*fourpi/base.Npix(); - phi0 = shifted ? pi/ringpix : 0; - pair.push_back (ringpair(ringinfo(theta, phi0, wgt, ringpix, startpix))); - } - -void healpix2ringpairs (const Healpix_Base &base, vector &pair) - { - arr wgt(2*base.Nside()); - wgt.fill(1); - healpix2ringpairs(base,wgt,pair); - } - -} // namespace - - -template void map2alm (const Healpix_Map &map, - Alm > &alm, const arr &weight, bool add_alm) - { - planck_assert (map.Scheme()==RING, "map2alm: map must be in RING scheme"); - planck_assert (weight.size()>=2*map.Nside(), - "map2alm: weight array has too few entries"); - - vector pair; - healpix2ringpairs(map,weight,pair); - map2alm(pair,&map[0],alm,add_alm); - } - -template void map2alm (const Healpix_Map &map, - Alm > &alm, const arr &weight, - bool add_alm); -template void map2alm (const Healpix_Map &map, - Alm > &alm, const arr &weight, - bool add_alm); - -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter, const arr &weight) - { - map2alm(map,alm,weight); - for (int iter=1; iter<=num_iter; ++iter) - { - Healpix_Map map2(map.Nside(),map.Scheme(),SET_NSIDE); - alm2map(alm,map2); - for (int m=0; m &map, - Alm > &alm, int num_iter, - const arr &weight); -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter, - const arr &weight); - -template void map2alm_iter2 (const Healpix_Map &map, - Alm > &alm, double err_abs, double err_rel) - { - double x_err_abs=1./err_abs, x_err_rel=1./err_rel; - arr wgt(2*map.Nside()); - wgt.fill(1); - Healpix_Map map2(map); - alm.SetToZero(); - while(true) - { - map2alm(map2,alm,wgt,true); - alm2map(alm,map2); - double errmeasure=0; - for (int m=0; m &map, - Alm > &alm, double err_abs, double err_rel); - - -template void map2alm_pol - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - const arr &weight, - bool add_alm) - { - planck_assert (mapT.Scheme()==RING, - "map2alm_pol: maps must be in RING scheme"); - planck_assert (mapT.conformable(mapQ) && mapT.conformable(mapU), - "map2alm_pol: maps are not conformable"); - planck_assert (weight.size()>=2*mapT.Nside(), - "map2alm_pol: at least one weight array has too few entries"); - - vector pair; - healpix2ringpairs(mapT,weight,pair); - map2alm_pol(pair,&mapT[0],&mapQ[0],&mapU[0],almT,almG,almC,add_alm); - } - -template void map2alm_pol - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - const arr &weight, - bool add_alm); -template void map2alm_pol - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - const arr &weight, - bool add_alm); - -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter, - const arr &weight) - { - map2alm_pol(mapT,mapQ,mapU,almT,almG,almC,weight); - for (int iter=1; iter<=num_iter; ++iter) - { - Healpix_Map mapT2(mapT.Nside(),mapT.Scheme(),SET_NSIDE), - mapQ2(mapT.Nside(),mapT.Scheme(),SET_NSIDE), - mapU2(mapT.Nside(),mapT.Scheme(),SET_NSIDE); - - alm2map_pol(almT,almG,almC,mapT2,mapQ2,mapU2); - for (int m=0; m &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter, - const arr &weight); -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter, - const arr &weight); - -template void map2alm_pol_iter2 - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - double err_abs, double err_rel) - { - arr wgt(2*mapT.Nside()); - wgt.fill(1); - Healpix_Map mapT2(mapT), mapQ2(mapQ), mapU2(mapU); - almT.SetToZero(); almG.SetToZero(); almC.SetToZero(); - while(true) - { - map2alm_pol(mapT2,mapQ2,mapU2,almT,almG,almC,wgt,true); - alm2map_pol(almT,almG,almC,mapT2,mapQ2,mapU2); - double errmeasure=0; - for (int m=0; m &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - double err_abs, double err_rel); - - -template void alm2map (const Alm > &alm, - Healpix_Map &map) - { - planck_assert (map.Scheme()==RING, "alm2map: map must be in RING scheme"); - - vector pair; - healpix2ringpairs(map,pair); - alm2map(alm,pair,&map[0]); - } - -template void alm2map (const Alm > &alm, - Healpix_Map &map); -template void alm2map (const Alm > &alm, - Healpix_Map &map); - - -template void alm2map_pol - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - Healpix_Map &mapT, - Healpix_Map &mapQ, - Healpix_Map &mapU) - { - planck_assert (mapT.Scheme()==RING, - "alm2map_pol: maps must be in RING scheme"); - planck_assert (mapT.conformable(mapQ) && mapT.conformable(mapU), - "alm2map_pol: maps are not conformable"); - - vector pair; - healpix2ringpairs(mapT,pair); - alm2map_pol(almT,almG,almC,pair,&mapT[0],&mapQ[0],&mapU[0]); - } - -template void alm2map_pol (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - Healpix_Map &mapT, - Healpix_Map &mapQ, - Healpix_Map &mapU); - -template void alm2map_pol (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - Healpix_Map &mapT, - Healpix_Map &mapQ, - Healpix_Map &mapU); - - -template void alm2map_der1 - (const Alm > &alm, - Healpix_Map &map, - Healpix_Map &mapdth, - Healpix_Map &mapdph) - { - planck_assert (map.Scheme()==RING, - "alm2map_der1: maps must be in RING scheme"); - planck_assert (map.conformable(mapdth) && map.conformable(mapdph), - "alm2map_der1: maps are not conformable"); - - vector pair; - healpix2ringpairs(map,pair); - alm2map_der1(alm,pair,&map[0],&mapdth[0],&mapdph[0]); - } - -template void alm2map_der1 (const Alm > &alm, - Healpix_Map &map, - Healpix_Map &map_dth, - Healpix_Map &map_dph); - -template void alm2map_der1 (const Alm > &alm, - Healpix_Map &map, - Healpix_Map &map_dth, - Healpix_Map &map_dph); diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.h b/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.h deleted file mode 100644 index 7c296879d7..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_healpix_tools.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_healpix_tools.h - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_ALM_HEALPIX_TOOLS_H -#define HEALPIX_ALM_HEALPIX_TOOLS_H - -#include "xcomplex.h" -#include "arr.h" - -template class Alm; -template class Healpix_Map; - -/*! \defgroup alm_healpix_group Conversions between a_lm and HEALPix maps */ -/*! \{ */ - -/*! Converts a Healpix map to a set of a_lms. - \param map the input map, which must have RING ordering - \param alm the output a_lms. l_max and m_max of the conversion are - determined from this object. - \param weight array containing the weights for the individual rings of - the map. It must have at least 2*\a map.Nside() entries. - \param add_alm If this is \a true, then the computed a_lm are added - to the values already residing in \a alm. */ -template void map2alm (const Healpix_Map &map, - Alm > &alm, const arr &weight, - bool add_alm=false); - -/*! Converts a Healpix map to a set of a_lms, using an iterative scheme - which is more accurate than plain map2alm(). - \param map the input map, which must have RING ordering. - \param alm the output a_lms. l_max and m_max of the conversion are - determined from this object. - \param num_iter the number of iterations (0 is identical to map2alm()). - \param weight array containing the weights for the individual rings of - the map. It must have at least 2*\a map.Nside() entries. */ -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter, const arr &weight); - -template void map2alm_iter (const Healpix_Map &map, - Alm > &alm, int num_iter) - { - arr wgt(2*map.Nside()); - wgt.fill(1); - map2alm_iter(map,alm,num_iter,wgt); - } - -template void map2alm_iter2 (const Healpix_Map &map, - Alm > &alm, double err_abs, double err_rel); - -/*! Converts Healpix maps containing the I, Q and U Stokes parameters - to sets of a_lms. - \param mapT the I-Stokes parameter input map - \param mapQ the Q-Stokes parameter input map - \param mapU the U-Stokes parameter input map - \note All maps must have the same nside, and must be in RING scheme. - \param almT the output temperature a_lms - \param almG the output gradient a_lms - \param almC the output curl a_lms - \note all a_lm sets must have the the same lmax and mmax. - \param weight ring weights for the maps. - \param add_alm If this is \a true, then the computed a_lm are added - to the values already residing in \a alm. - \note The weight array must have at least 2*\a mapT.Nside() entries. */ -template void map2alm_pol - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - const arr &weight, - bool add_alm=false); -/*! Converts Healpix maps containing the I, Q and U Stokes parameters - to sets of a_lms, using an iterative scheme which is more accurate than - plain map2alm_pol(). - \param mapT the I-Stokes parameter input map - \param mapQ the Q-Stokes parameter input map - \param mapU the U-Stokes parameter input map - \note All maps must have the same nside, and must be in RING scheme. - \param almT the output temperature a_lms - \param almG the output gradient a_lms - \param almC the output curl a_lms - \note all a_lm sets must have the the same lmax and mmax. - \param num_iter the number of iterations (0 is identical to map2alm_pol()). - \param weight ring weights for the maps. - \note The weight array must have at least 2*\a mapT.Nside() entries. */ -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter, - const arr &weight); - -template void map2alm_pol_iter - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - int num_iter) - { - arr wgt(2*mapT.Nside()); - wgt.fill(1); - map2alm_pol_iter(mapT,mapQ,mapU,almT,almG,almC,num_iter,wgt); - } - -template void map2alm_pol_iter2 - (const Healpix_Map &mapT, - const Healpix_Map &mapQ, - const Healpix_Map &mapU, - Alm > &almT, - Alm > &almG, - Alm > &almC, - double err_abs, double err_rel); - -/*! Converts a a set of a_lm to a HEALPix map. - \param alm the input a_lms. l_max and m_max of the conversion are - determined from this object. - \param map the output map, which must have RING ordering. */ -template void alm2map (const Alm > &alm, - Healpix_Map &map); - -/*! Converts a a set of polarised a_lm to a HEALPix map. - \param almT the input temperature a_lms - \param almG the input gradient a_lms - \param almC the input curl a_lms - \param mapT the I-Stokes parameter output map - \param mapQ the Q-Stokes parameter output map - \param mapU the U-Stokes parameter output map */ -template void alm2map_pol - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - Healpix_Map &mapT, - Healpix_Map &mapQ, - Healpix_Map &mapU); - -/*! Converts a a set of a_lm to a HEALPix map and its first derivatives. - \param alm the input a_lms. l_max and m_max of the conversion are - determined from this object. - \param map the output map, which must have RING ordering. - \param mapdth an output map containing \f$d (\mbox{map})/d\vartheta\f$, - which must have RING ordering. - \param mapdph an output map containing - \f$(\sin\vartheta)^{-1}d(\mbox{map})/d\varphi\f$, - which must have RING ordering. */ -template void alm2map_der1 - (const Alm > &alm, - Healpix_Map &map, - Healpix_Map &mapdth, - Healpix_Map &mapdph); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.cc b/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.cc deleted file mode 100644 index 89a37d8a2f..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.cc +++ /dev/null @@ -1,770 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "alm_map_tools.h" -#include "alm.h" -#include "fftpack_support.h" -#include "ylmgen.h" -#include "xcomplex.h" - -using namespace std; - -namespace { - -struct info_comparator - { - inline bool operator()(const ringinfo &a, const ringinfo &b) - { return a.sth &lam_fact) - { - for (int l=m; l &lam_fact) - { - lam_fact[m]=0; - for (int l=m+1; l &normal_l) - { - for (int l=0; l > shiftarr, work; - rfft plan; - bool norot; - - void update(int nph, int mmax, double phi0) - { - norot = (abs(phi0)<1e-14); - if (!norot) - { - if ((mmax!=shiftarr.size()-1) || (!approx(phi0,phi0_,1e-12))) - { - shiftarr.alloc(mmax+1); - phi0_=phi0; - for (int m=0; m<=mmax; ++m) - shiftarr[m].Set (cos(m*phi0),sin(m*phi0)); - } - } - if (nph!=plan.size()) - plan.Set(nph); - if (nph>work.size()) - work.alloc(2*nph); - } - - public: - ringhelper() : phi0_(0), norot(true) {} - - template void phase2ring (int nph, int mmax, double phi0, - const xcomplex *phase, T *ring) - { - update (nph, mmax, phi0); - - for (int m=1; m tmp = phase[m]*shiftarr[m]; - work[m%nph] += tmp; - work[nph-1-((m-1)%nph)] += conj(tmp); - } - - plan.backward_c(work); - for (int m=0; m void phase2ring (int mmax, - const xcomplex *phase, const ringinfo &info, T *data) - { - if (info.nph>0) - phase2ring (info.nph, mmax, info.phi0, phase, data+info.ofs); - } - template void phase2pair (int mmax, - const xcomplex *phase1, const xcomplex *phase2, - const ringpair &pair, T *data) - { - phase2ring (mmax, phase1, pair.r1, data); - phase2ring (mmax, phase2, pair.r2, data); - } - - template void ring2phase (int nph, int mmax, double phi0, - double weight, const T *ring, xcomplex *phase) - { - update (nph, mmax, -phi0); - for (int m=0; m void ring2phase (int mmax, const ringinfo &info, - const T *data, xcomplex *phase) - { - if (info.nph>0) - ring2phase (info.nph, mmax, info.phi0, info.weight, data+info.ofs, - phase); - } - template void pair2phase (int mmax, const ringpair &pair, - const T *data, xcomplex *phase1, xcomplex *phase2) - { - ring2phase (mmax, pair.r1, data, phase1); - ring2phase (mmax, pair.r2, data, phase2); - } - }; - -} // namespace - - -void info2pair(const vector &info, vector &pair) - { - pair.clear(); - vector info2=info; - sort(info2.begin(),info2.end(),info_comparator()); - unsigned int pos=0; - while (pos void map2alm (const vector &pair, - const T *map, Alm > &alm, bool add_alm) - { - int lmax = alm.Lmax(), mmax = alm.Mmax(); - - int nchunks, chunksize; - get_chunk_info(pair.size(),nchunks,chunksize); - arr2 > phas1(chunksize,mmax+1), phas2(chunksize,mmax+1); - - if (!add_alm) alm.SetToZero(); - - for (int chunk=0; chunk Ylm; - arr > alm_tmp(lmax+1); - int m; -#pragma omp for schedule(dynamic,1) - for (m=0; m<=mmax; ++m) - { - for (int l=m; l<=lmax; ++l) alm_tmp[l].Set(0.,0.); - for (int ith=0; ith0) - { - xcomplex p1 = phas1[ith][m]+phas2[ith][m], - p2 = phas1[ith][m]-phas2[ith][m]; - - if ((l-m)&1) - MAP2ALM_MACRO(p2) - for (;l p1 = phas1[ith][m]; - for (;l<=lmax;) - MAP2ALM_MACRO(p1) - } - } - } - xcomplex *palm = alm.mstart(m); - for (int l=m; l<=lmax; ++l) - { palm[l].re += alm_tmp[l].re; palm[l].im += alm_tmp[l].im; } - } -} // end of parallel region - } - } - -template void map2alm (const vector &pair, - const float *map, Alm > &alm, bool add_alm); -template void map2alm (const vector &pair, - const double *map, Alm > &alm, bool add_alm); - -#define SETUP_LAMBDA \ - const double t1 = lam_lm1m*lam_fact[l]; \ - const double a_w = (l-m2)*two_on_s2 + l*(l-1); \ - const double a_x = twocth*(l-1)*lam_lm; \ - const double lambda_w = a_w*lam_lm - t1*c_on_s2; \ - const double lambda_x = m_on_s2 * (a_x-t1); - -#define MAP2ALM_POL_MACRO(Tx,Qx,Qy,Ux,Uy) \ - { \ - double lam_lm1m=lam_lm; \ - lam_lm=Ylm[l]; \ - alm_tmp[l][0].re += Tx.re*lam_lm; alm_tmp[l][0].im += Tx.im*lam_lm; \ - SETUP_LAMBDA \ - alm_tmp[l][1].re += Qx.re*lambda_w - Uy.im*lambda_x; \ - alm_tmp[l][1].im += Qx.im*lambda_w + Uy.re*lambda_x; \ - alm_tmp[l][2].re += Ux.re*lambda_w + Qy.im*lambda_x; \ - alm_tmp[l][2].im += Ux.im*lambda_w - Qy.re*lambda_x; \ - ++l; \ - } - -template void map2alm_pol - (const vector &pair, const T *mapT, const T *mapQ, const T *mapU, - Alm > &almT, Alm > &almG, Alm > &almC, - bool add_alm) - { - planck_assert (almT.conformable(almG) && almT.conformable(almC), - "map2alm_pol: a_lm are not conformable"); - - int lmax = almT.Lmax(), mmax = almT.Mmax(); - - arr normal_l (lmax+1); - init_normal_l (normal_l); - - int nchunks, chunksize; - get_chunk_info(pair.size(),nchunks,chunksize); - - arr2 > phas1T(chunksize,mmax+1),phas2T(chunksize,mmax+1), - phas1Q(chunksize,mmax+1),phas2Q(chunksize,mmax+1), - phas1U(chunksize,mmax+1),phas2U(chunksize,mmax+1); - - if (!add_alm) - { almT.SetToZero(); almG.SetToZero(); almC.SetToZero(); } - - for (int chunk=0; chunk Ylm; - arr lam_fact(lmax+1); - arr[3] > alm_tmp(lmax+1); - int m; -#pragma omp for schedule(dynamic,1) - for (m=0; m<=mmax; ++m) - { - init_lam_fact_1d (m,lam_fact); - - for (int l=m; l0) - { - xcomplex T1 = phas1T[ith][m]+phas2T[ith][m], - T2 = phas1T[ith][m]-phas2T[ith][m], - Q1 = phas1Q[ith][m]+phas2Q[ith][m], - Q2 = phas1Q[ith][m]-phas2Q[ith][m], - U1 = phas1U[ith][m]+phas2U[ith][m], - U2 = phas1U[ith][m]-phas2U[ith][m]; - - double lam_lm = 0; - if ((l-m)&1) - MAP2ALM_POL_MACRO(T2,Q2,Q1,U2,U1) - for (;l T1 = phas1T[ith][m], - Q1 = phas1Q[ith][m], - U1 = phas1U[ith][m]; - double lam_lm = 0; - for (;l<=lmax;) - MAP2ALM_POL_MACRO(T1,Q1,Q1,U1,U1) - } - } - } - xcomplex *palmT=almT.mstart(m), *palmG=almG.mstart(m), - *palmC=almC.mstart(m); - for (int l=m;l<=lmax;++l) - { - palmT[l].re += alm_tmp[l][0].re; - palmT[l].im += alm_tmp[l][0].im; - palmG[l].re += alm_tmp[l][1].re*normal_l[l]; - palmG[l].im += alm_tmp[l][1].im*normal_l[l]; - palmC[l].re += alm_tmp[l][2].re*normal_l[l]; - palmC[l].im += alm_tmp[l][2].im*normal_l[l]; - } - } -} // end of parallel region - } - } - -template void map2alm_pol (const vector &pair, const float *mapT, - const float *mapQ, const float *mapU, Alm > &almT, - Alm > &almG, Alm > &almC, bool add_alm); -template void map2alm_pol (const vector &pair, const double *mapT, - const double *mapQ, const double *mapU, Alm > &almT, - Alm > &almG, Alm > &almC, bool add_alm); - - -#define ALM2MAP_MACRO(px) \ - { \ - px.re += alm_tmp[l].re*Ylm[l]; \ - px.im += alm_tmp[l].im*Ylm[l]; \ - ++l; \ - } - -template void alm2map (const Alm > &alm, - const vector &pair, T *map) - { - int lmax = alm.Lmax(), mmax = alm.Mmax(); - - int nchunks, chunksize; - get_chunk_info(pair.size(),nchunks,chunksize); - - arr2 > phas1(chunksize,mmax+1), phas2(chunksize,mmax+1); - - for (int chunk=0; chunk Ylm; - arr > alm_tmp(lmax+1); - int m; -#pragma omp for schedule(dynamic,1) - for (m=0; m<=mmax; ++m) - { - for (int l=m; l<=lmax; ++l) - alm_tmp[l]=alm(l,m); - - for (int ith=0; ithlmax) - phas1[ith][m] = phas2[ith][m] = 0; - else - { - if (pair[ith+llim].r2.nph>0) - { - xcomplex p1=0, p2=0; - - if ((l-m)&1) - ALM2MAP_MACRO(p2) - for (;l p1=0; - for (;l<=lmax;) - ALM2MAP_MACRO(p1) - phas1[ith][m] = p1; - } - } - } - } -} // end of parallel region - -#pragma omp parallel -{ - ringhelper helper; - int ith; -#pragma omp for schedule(dynamic,1) - for (ith=llim; ith > &alm, - const vector &pair, float *map); -template void alm2map (const Alm > &alm, - const vector &pair, double *map); - -#define ALM2MAP_POL_MACRO(Tx,Qx,Qy,Ux,Uy) \ - { \ - double lam_lm1m = lam_lm; \ - lam_lm = Ylm[l]; \ - Tx.re+=alm_tmp[l][0].re*lam_lm; Tx.im+=alm_tmp[l][0].im*lam_lm; \ - SETUP_LAMBDA \ - Qx.re+=alm_tmp[l][1].re*lambda_w; Qx.im+=alm_tmp[l][1].im*lambda_w; \ - Ux.re-=alm_tmp[l][2].re*lambda_w; Ux.im-=alm_tmp[l][2].im*lambda_w; \ - Qy.re-=alm_tmp[l][2].im*lambda_x; Qy.im+=alm_tmp[l][2].re*lambda_x; \ - Uy.re-=alm_tmp[l][1].im*lambda_x; Uy.im+=alm_tmp[l][1].re*lambda_x; \ - ++l; \ - } - -template void alm2map_pol (const Alm > &almT, - const Alm > &almG, const Alm > &almC, - const vector &pair, T *mapT, T *mapQ, T *mapU) - { - int lmax = almT.Lmax(), mmax = almT.Mmax(); - - planck_assert (almT.conformable(almG) && almT.conformable(almC), - "alm2map_pol: a_lm are not conformable"); - - arr normal_l (lmax+1); - init_normal_l (normal_l); - - int nchunks, chunksize; - get_chunk_info(pair.size(),nchunks,chunksize); - - arr2 > - phas1T(chunksize,mmax+1), phas2T(chunksize,mmax+1), - phas1Q(chunksize,mmax+1), phas2Q(chunksize,mmax+1), - phas1U(chunksize,mmax+1), phas2U(chunksize,mmax+1); - - for (int chunk=0; chunk Ylm; - arr lam_fact (lmax+1); - arr[3]> alm_tmp(lmax+1); - int m; -#pragma omp for schedule(dynamic,1) - for (m=0; m<=mmax; ++m) - { - int m2 = m*m; - init_lam_fact_1d (m,lam_fact); - for (int l=m; l<=lmax; ++l) - { - alm_tmp[l][0] = almT(l,m); - alm_tmp[l][1] = almG(l,m)*(-normal_l[l]); - alm_tmp[l][2] = almC(l,m)*(-normal_l[l]); - } - for (int ith=0; ith0) - { - xcomplex T1=0, T2=0, Q1=0, Q2=0, U1=0, U2=0; - double lam_lm = 0; - if ((l-m)&1) - ALM2MAP_POL_MACRO(T2,Q2,Q1,U2,U1) - for (;l T1=0, Q1=0, U1=0; - double lam_lm = 0; - for (;l<=lmax;) - { ALM2MAP_POL_MACRO(T1,Q1,Q1,U1,U1) } - phas1T[ith][m] = T1; - phas1Q[ith][m] =-Q1; - phas1U[ith][m] = U1; - } - } - else - { - phas1T[ith][m] = phas2T[ith][m] = 0; - phas1Q[ith][m] = phas2Q[ith][m] = 0; - phas1U[ith][m] = phas2U[ith][m] = 0; - } - } - } -} // end of parallel region - -#pragma omp parallel -{ - ringhelper helper; - int ith; -#pragma omp for schedule(dynamic,1) - for (ith=llim; ith > &almT, - const Alm > &almG, const Alm > &almC, - const vector &pair, float *mapT, float *mapQ, float *mapU); -template void alm2map_pol (const Alm > &almT, - const Alm > &almG, const Alm > &almC, - const vector &pair, double *mapT, double *mapQ, double *mapU); - -#define ALM2MAP_DER1_MACRO(px,pdthx,pdphx) \ - { \ - double lam_lm1m = lam_lm; \ - lam_lm = Ylm[l]; \ - const double t1 = alm_tmp[l].re*lam_lm; \ - const double t2 = alm_tmp[l].im*lam_lm; \ - const double t3 = l*cotanth; \ - const double t4 = one_on_s*lam_lm1m*lam_fact[l]; \ - px.re+=t1; px.im+=t2; \ - pdthx.re+=t3*t1-t4*alm_tmp[l].re; pdthx.im+=t3*t2-t4*alm_tmp[l].im; \ - pdphx.re-=m*t2; pdphx.im+=m*t1; \ - ++l; \ - } - -template void alm2map_der1 (const Alm > &alm, - const vector &pair, T *map, T *dth, T *dph) - { - int lmax = alm.Lmax(), mmax = alm.Mmax(); - - int nchunks, chunksize; - get_chunk_info(pair.size(),nchunks,chunksize); - - arr2 > - phas1(chunksize,mmax+1), phas2(chunksize,mmax+1), - phas1dth(chunksize,mmax+1), phas2dth(chunksize,mmax+1), - phas1dph(chunksize,mmax+1), phas2dph(chunksize,mmax+1); - - for (int chunk=0; chunk Ylm; - arr lam_fact (lmax+1); - int m; -#pragma omp for schedule(dynamic,1) - for (m=0; m<=mmax; ++m) - { - const xcomplex *alm_tmp=alm.mstart(m); - init_lam_fact_deriv_1d (m,lam_fact); - for (int ith=0; ith0) - { - xcomplex p1=0, p2=0, pth1=0, pth2=0, pph1=0, pph2=0; - - double lam_lm = 0; - if ((l-m)&1) - ALM2MAP_DER1_MACRO(p2,pth2,pph2) - for(;l p1=0, pth1=0, pph1=0; - - double lam_lm = 0; - for(;l<=lmax;) - ALM2MAP_DER1_MACRO(p1,pth1,pph1) - - phas1[ith][m] = p1; - phas1dth[ith][m] = pth1; - phas1dph[ith][m] = pph1*one_on_s; - } - } - else - { - phas1[ith][m] = phas2[ith][m] = 0; - phas1dth[ith][m] = phas2dth[ith][m] = 0; - phas1dph[ith][m] = phas2dph[ith][m] = 0; - } - } - } -} // end of parallel region - -#pragma omp parallel -{ - ringhelper helper; - int ith; -#pragma omp for schedule(dynamic,1) - for (ith=llim; ith > &alm, - const vector &pair, float *map, float *dth, float *dph); -template void alm2map_der1 (const Alm > &alm, - const vector &pair, double *map, double *dth, double *dph); diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.h b/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.h deleted file mode 100644 index 23306c345e..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_map_tools.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_map_tools.h - * Copyright (C) 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_MAP_TOOLS_H -#define PLANCK_ALM_MAP_TOOLS_H - -#include -#include "cxxutils.h" -#include "alm.h" -#include "xcomplex.h" - -/*! A class holding information about a ring of pixels in a spherical map. */ -class ringinfo - { - public: - double theta, phi0, weight, cth, sth; - int nph, ofs; - - ringinfo() - : nph(0) {} - /*! Constructs a \a ringinfo object. - \param theta_ colatitude of the ring (in radian) - \param phi0_ longitude of the first pixel in the ring (in radian) - \param weight_ weighting factor for all pixels in the ring. This - is typically the surface of a pixel in sterad. - \note \a weight_ is only needed for map analysis, not synthesis. - \param nph_ number of pixels in the ring - \param ofs_ index of the first ring pixel in the total map array - (counting from zero) */ - ringinfo (double theta_, double phi0_, double weight_, int nph_, int ofs_) - : theta(theta_), phi0(phi0_), weight(weight_), - cth(cos(theta)), sth(sin(theta)), nph(nph_), ofs(ofs_) - {} - }; - -/*! A class holding information about a ring pair in a spherical map. */ -class ringpair - { - public: - ringinfo r1, r2; - - /*! Initialize the object with the ring described by \a info. - The second ring is left empty. */ - ringpair (const ringinfo &info) - : r1(info) {} - /*! Initialize the object with the rings described by \a info1 - and \a info2. - \note The colatitude of \a info2 must be \f$\pi\f$ minus the colatitude - of \a info1. */ - ringpair (const ringinfo &info1,const ringinfo &info2) - : r1(info1), r2(info2) - { - planck_assert(approx(r1.theta,pi-r2.theta,1e-10), "invalid ringpair"); - } - }; - -void info2pair(const std::vector &info, std::vector &pair); - -template void map2alm (const std::vector &pair, - const T *map, Alm > &alm, bool add_alm); - -template void map2alm_pol - (const std::vector &pair, const T *mapT, const T *mapQ, - const T *mapU, Alm > &almT, Alm > &almG, - Alm > &almC, bool add_alm); - -template void map2alm_pol - (const std::vector &pairT, const T *mapT, - const std::vector &pairQ, const T *mapQ, - const std::vector &pairU, const T *mapU, - Alm > &almT, Alm > &almG, - Alm > &almC, bool add_alm); - -template void alm2map (const Alm > &alm, - const std::vector &pair, T *map); - -template void alm2map_pol - (const Alm > &almT, const Alm > &almG, - const Alm > &almC, const std::vector &pair, - T *mapT, T *mapQ, T *mapU); - -template void alm2map_der1 (const Alm > &alm, - const std::vector &pair, T *map, T *dth, T *dph); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.cc b/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.cc deleted file mode 100644 index 538f9b25dd..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.cc +++ /dev/null @@ -1,580 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "alm_powspec_tools.h" -#include "alm.h" -#include "planck_rng.h" -#include "powspec.h" -#include "xcomplex.h" -#include "rotmatrix.h" -#include "openmp_support.h" - -using namespace std; -template void create_alm - (const PowSpec &powspec, Alm > &alm, planck_rng &rng) - { - int lmax = alm.Lmax(); - int mmax = alm.Mmax(); - const double hsqrt2 = 1/sqrt(2.); - - for (int l=0; l<=lmax; ++l) - { - double rms_tt = sqrt(powspec.tt(l)); - double zeta1_r = rng.rand_gauss(); - alm(l,0) = zeta1_r * rms_tt; - for (int m=1; m<=min(l,mmax); ++m) - { - zeta1_r = rng.rand_gauss()*hsqrt2; - double zeta1_i = rng.rand_gauss()*hsqrt2; - alm(l,m).Set (zeta1_r*rms_tt, zeta1_i*rms_tt); - } - } - } - -template void create_alm (const PowSpec &powspec, - Alm > &alm, planck_rng &rng); -template void create_alm (const PowSpec &powspec, - Alm > &alm, planck_rng &rng); - - -template void create_alm_pol - (const PowSpec &powspec, - Alm > &almT, - Alm > &almG, - Alm > &almC, - planck_rng &rng) - { - int lmax = almT.Lmax(); - int mmax = almT.Mmax(); - const double hsqrt2 = 1/sqrt(2.); - - for (int l=0; l<=lmax; ++l) - { - double rms_tt=0, rms_g1=0; - if (powspec.tt(l) != 0) - { - rms_tt = sqrt(powspec.tt(l)); - rms_g1 = powspec.tg(l)/rms_tt; - } - - double zeta1_r = rng.rand_gauss(); - almT(l,0) = zeta1_r * rms_tt; - almG(l,0) = zeta1_r * rms_g1; - for (int m=1; m<=min(l,mmax); ++m) - { - zeta1_r = rng.rand_gauss()*hsqrt2; - double zeta1_i = rng.rand_gauss()*hsqrt2; - almT(l,m).Set (zeta1_r*rms_tt, zeta1_i*rms_tt); - almG(l,m).Set (zeta1_r*rms_g1, zeta1_i*rms_g1); - } - } - - for (int l=0; l<=lmax; ++l) - { - double rms_g2 = 0; - double rms_cc = 0; - if (powspec.tt(l) != 0) - { - rms_g2 = powspec.gg(l) - (powspec.tg(l)/powspec.tt(l))*powspec.tg(l); - if (rms_g2 <= 0) - { - planck_assert (abs(rms_g2) <= 1e-8*abs(powspec.gg(l)), - "Inconsistent TT, GG and TG spectra at l="+dataToString(l)); - rms_g2 = 0; - } - rms_g2 = sqrt(rms_g2); - rms_cc = sqrt(powspec.cc(l)); - } - almG(l,0) += rng.rand_gauss()*rms_g2; - almC(l,0) = rng.rand_gauss()*rms_cc; - - for (int m=1; m<=min(l,mmax); ++m) - { - double zeta2_r = rng.rand_gauss()*hsqrt2; - double zeta2_i = rng.rand_gauss()*hsqrt2; - double zeta3_r = rng.rand_gauss()*hsqrt2; - double zeta3_i = rng.rand_gauss()*hsqrt2; - - almG(l,m) += xcomplex (zeta2_r*rms_g2,zeta2_i*rms_g2); - almC(l,m).Set (zeta3_r*rms_cc,zeta3_i*rms_cc); - } - } - } - -template void create_alm_pol - (const PowSpec &powspec, - Alm > &almT, - Alm > &almG, - Alm > &almC, - planck_rng &rng); -template void create_alm_pol - (const PowSpec &powspec, - Alm > &almT, - Alm > &almG, - Alm > &almC, - planck_rng &rng); - - -template void extract_powspec - (const Alm > &alm, PowSpec &powspec) - { - arr tt(alm.Lmax()+1); - for (int l=0; l<=alm.Lmax(); ++l) - { - tt[l] = norm(alm(l,0)); - int limit = min(l,alm.Mmax()); - for (int m=1; m<=limit; ++m) - tt[l] += 2*norm(alm(l,m)); - tt[l] /= (2*l+1); - } - powspec.Set(tt); - } - -template void extract_powspec - (const Alm > &alm, PowSpec &powspec); -template void extract_powspec - (const Alm > &alm, PowSpec &powspec); - - -template void extract_crosspowspec - (const Alm > &alm1, - const Alm > &alm2,PowSpec &powspec) - { - planck_assert (alm1.conformable(alm2), - "extract_crosspowspec: a_lms are not conformable"); - arr tt(alm1.Lmax()+1); - for (int l=0; l<=alm1.Lmax(); ++l) - { - tt[l] = alm1(l,0).re*alm2(l,0).re; - int limit = min(l,alm1.Mmax()); - for (int m=1; m<=limit; ++m) - tt[l] += 2 * (alm1(l,m).re*alm2(l,m).re + alm1(l,m).im*alm2(l,m).im); - tt[l] /= (2*l+1); - } - powspec.Set(tt); - } - -template void extract_crosspowspec - (const Alm > &alm1, - const Alm > &alm2, PowSpec &powspec); -template void extract_crosspowspec - (const Alm > &alm1, - const Alm > &alm2, PowSpec &powspec); - - -template void extract_powspec - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - PowSpec &powspec) - { - planck_assert (almT.conformable(almG) && almT.conformable(almC), - "extract_powspec: a_lms are not conformable"); - int lmax = almT.Lmax(); - arr tt(lmax+1), gg(lmax+1), cc(lmax+1), tg(lmax+1); - for (int l=0; l<=lmax; ++l) - { - tt[l] = norm(almT(l,0)); - gg[l] = norm(almG(l,0)); - cc[l] = norm(almC(l,0)); - tg[l] = (almT(l,0)*conj(almG(l,0))).re; - int limit = min(l,almT.Mmax()); - for (int m=1; m<=limit; ++m) - { - tt[l] += 2*norm(almT(l,m)); - gg[l] += 2*norm(almG(l,m)); - cc[l] += 2*norm(almC(l,m)); - tg[l] += 2*(almT(l,m)*conj(almG(l,m))).re; - } - tt[l] /= (2*l+1); - gg[l] /= (2*l+1); - cc[l] /= (2*l+1); - tg[l] /= (2*l+1); - } - powspec.Set(tt,gg,cc,tg); - } - -template void extract_powspec - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - PowSpec &powspec); -template void extract_powspec - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - PowSpec &powspec); - - -template void smooth_with_Gauss - (Alm > &alm, double fwhm_arcmin) - { - int fct = (fwhm_arcmin>=0) ? 1 : -1; - double sigma = fwhm_arcmin/60*degr2rad*fwhm2sigma; - arr gb(alm.Lmax()+1); - for (int l=0; l<=alm.Lmax(); ++l) - gb[l] = exp(-.5*fct*l*(l+1)*sigma*sigma); - alm.ScaleL(gb); - } - -template void smooth_with_Gauss - (Alm > &alm, double fwhm_arcmin); -template void smooth_with_Gauss - (Alm > &alm, double fwhm_arcmin); - - -template void smooth_with_Gauss - (Alm > &almT, - Alm > &almG, - Alm > &almC, - double fwhm_arcmin) - { - int fct = (fwhm_arcmin>=0) ? 1 : -1; - double sigma = fwhm_arcmin/60*degr2rad*fwhm2sigma; - double fact_pol = exp(2*fct*sigma*sigma); - arr gb(almT.Lmax()+1); - for (int l=0; l<=almT.Lmax(); ++l) - gb[l] = exp(-.5*fct*l*(l+1)*sigma*sigma); - almT.ScaleL(gb); - for (int l=0; l<=almT.Lmax(); ++l) - gb[l] *= fact_pol; - almG.ScaleL(gb); almC.ScaleL(gb); - } - -template void smooth_with_Gauss - (Alm > &almT, - Alm > &almG, - Alm > &almC, - double fwhm_arcmin); -template void smooth_with_Gauss - (Alm > &almT, - Alm > &almG, - Alm > &almC, - double fwhm_arcmin); - -namespace { - -#if 0 - -class wigner_d - { - private: - double p,q; - arr sqt; - arr2 d; - int n; - - void do_line0 (double *l1, int j) - { - double xj = 1./j; - l1[j] = -p*l1[j-1]; - for (int i=j-1; i>=1; --i) - l1[i] = xj*sqt[j]*(q*sqt[j-i]*l1[i] - p*sqt[i]*l1[i-1]); - l1[0] = q*l1[0]; - } - void do_line (const double *l1, double *l2, int j, int k) - { - double xj = 1./j; - double t1 = xj*sqt[j-k]*q, t2 = xj*sqt[j-k]*p; - double t3 = xj*sqt[k]*p, t4 = xj*sqt[k]*q; - l2[j] = sqt[j] * (t4*l1[j-1]-t2*l2[j-1]); - for (int i=j-1; i>=1; --i) - l2[i] = t1*sqt[j-i]*l2[i] - t2*sqt[i]*l2[i-1] - +t3*sqt[j-i]*l1[i] + t4*sqt[i]*l1[i-1]; - l2[0] = sqt[j] * (t3*l1[0]+t1*l2[0]); - } - - public: - wigner_d(int lmax, double ang) - : p(sin(ang/2)), q(cos(ang/2)), sqt(2*lmax+1), d(lmax+1,2*lmax+1), n(-1) - { for (int m=0; m &recurse () - { - ++n; - if (n==0) - d[0][0] = 1; - else if (n==1) - { - d[0][0] = q*q; d[0][1] = -p*q*sqt[2]; d[0][2] = p*p; - d[1][0] = -d[0][1]; d[1][1] = q*q-p*p; d[1][2] = d[0][1]; - } - else - { - // padding - int sign = (n&1)? -1 : 1; - for (int i=0; i<=2*n-2; ++i) - { - d[n][i] = sign*d[n-2][2*n-2-i]; - sign=-sign; - } - do_line (d[n-1],d[n],2*n-1,n); - for (int k=n; k>=2; --k) - { - do_line (d[k-2],d[k-1],2*n-1,k-1); - do_line (d[k-1],d[k],2*n,k); - } - do_line0 (d[0],2*n-1); - do_line (d[0],d[1],2*n,1); - do_line0 (d[0],2*n); - } - return d; - } - }; - -#else - -class wigner_d - { - private: - double p,q; - arr sqt; - arr2 d, dd; - int n; - - public: - wigner_d(int lmax, double ang) - : p(sin(ang/2)), q(cos(ang/2)), sqt(2*lmax+1), d(lmax+1,2*lmax+1), - dd(lmax+1,2*lmax+1), n(-1) - { for (int m=0; m &recurse () - { - ++n; - if (n==0) - d[0][0] = 1; - else if (n==1) - { - d[0][0] = q*q; d[0][1] = -p*q*sqt[2]; d[0][2] = p*p; - d[1][0] = -d[0][1]; d[1][1] = q*q-p*p; d[1][2] = d[0][1]; - } - else - { - // padding - int sign = (n&1)? -1 : 1; - for (int i=0; i<=2*n-2; ++i) - { - d[n][i] = sign*d[n-2][2*n-2-i]; - sign=-sign; - } - for (int j=2*n-1; j<=2*n; ++j) - { - double xj = 1./j; - dd[0][0] = q*d[0][0]; - for (int i=1;i void rotate_alm (Alm > &alm, - double psi, double theta, double phi) - { - planck_assert (alm.Lmax()==alm.Mmax(), - "rotate_alm: lmax must be equal to mmax"); - int lmax=alm.Lmax(); - arr > exppsi(lmax+1), expphi(lmax+1); - for (int m=0; m<=lmax; ++m) - { - exppsi[m].Set (cos(psi*m),-sin(psi*m)); - expphi[m].Set (cos(phi*m),-sin(phi*m)); - } - - wigner_d rec(lmax,theta); - - arr > almtmp(lmax+1); - - for (int l=0; l<=lmax; ++l) - { - announce_progress (pow(double(l),3),pow(l-1.,3),pow(double(lmax),3)); - const arr2 &d(rec.recurse()); - - for (int m=0; m<=l; ++m) - almtmp[m] = alm(l,0)*d[l][l+m]; - -#pragma omp parallel -{ - int lo,hi; - openmp_calc_share(0,l+1,lo,hi); - - bool flip = true; - for (int mm=1; mm<=l; ++mm) - { - xcomplex t1 = alm(l,mm)*exppsi[mm]; - bool flip2 = ((mm+lo)&1) ? true : false; - for (int m=lo; m > &alm, - double psi, double theta, double phi); -template void rotate_alm (Alm > &alm, - double psi, double theta, double phi); - -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - double psi, double theta, double phi) - { - planck_assert (almT.Lmax()==almT.Mmax(), - "rotate_alm: lmax must be equal to mmax"); - planck_assert (almG.conformable(almT) && almC.conformable(almT), - "rotate_alm: a_lm are not conformable"); - int lmax=almT.Lmax(); - arr > exppsi(lmax+1), expphi(lmax+1); - for (int m=0; m<=lmax; ++m) - { - exppsi[m].Set (cos(psi*m),-sin(psi*m)); - expphi[m].Set (cos(phi*m),-sin(phi*m)); - } - - wigner_d rec(lmax,theta); - - arr > almtmpT(lmax+1), almtmpG(lmax+1), almtmpC(lmax+1); - - for (int l=0; l<=lmax; ++l) - { - announce_progress (pow(double(l),3),pow(l-1.,3),pow(double(lmax),3)); - const arr2 &d(rec.recurse()); - - for (int m=0; m<=l; ++m) - { - almtmpT[m] = almT(l,0)*d[l][m+l]; - almtmpG[m] = almG(l,0)*d[l][m+l]; - almtmpC[m] = almC(l,0)*d[l][m+l]; - } - -#pragma omp parallel -{ - int lo,hi; - openmp_calc_share(0,l+1,lo,hi); - - bool flip = true; - for (int mm=1; mm<=l; ++mm) - { - xcomplex t1T = almT(l,mm)*exppsi[mm]; - xcomplex t1G = almG(l,mm)*exppsi[mm]; - xcomplex t1C = almC(l,mm)*exppsi[mm]; - bool flip2 = ((mm+lo)&1) ? true : false; - for (int m=lo; m > &almT, - Alm > &almG, Alm > &almC, - double psi, double theta, double phi); -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - double psi, double theta, double phi); - - -template void rotate_alm (Alm > &alm, - const rotmatrix &mat) - { - double a1, a2, a3; - mat.Extract_CPAC_Euler_Angles (a1, a2, a3); - rotate_alm (alm, a3, a2, a1); - } - -template void rotate_alm (Alm > &alm, const rotmatrix &mat); -template void rotate_alm (Alm > &alm, const rotmatrix &mat); - -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - const rotmatrix &mat) - { - double a1, a2, a3; - mat.Extract_CPAC_Euler_Angles (a1, a2, a3); - rotate_alm (almT, almG, almC, a3, a2, a1); - } - -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - const rotmatrix &mat); -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - const rotmatrix &mat); diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.h b/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.h deleted file mode 100644 index be3d0ca7dc..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/alm_powspec_tools.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file alm_powspec_tools.h - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ALM_POWSPEC_TOOLS_H -#define PLANCK_ALM_POWSPEC_TOOLS_H - -#include "xcomplex.h" - -template class Alm; -class PowSpec; -class planck_rng; -class rotmatrix; - -/*! \defgroup alm_ps_group Conversions between a_lm and power spectra */ -/*! \{ */ - -/*! Creates a Gaussian realisation of the input power spectrum \a powspec, - using the random number generator \a rng, and returns the result - in \a alm. */ -template void create_alm (const PowSpec &powspec, - Alm > &alm, planck_rng &rng); - -/*! Creates a Gaussian realisation of the polarised input power spectrum - \a powspec, using the random number generator \a rng, and returns the - result in \a almT, \a almG and \a almC. */ -template void create_alm_pol - (const PowSpec &powspec, - Alm > &almT, - Alm > &almG, - Alm > &almC, - planck_rng &rng); - -/*! Returns the unpolarised power spectrum of \a alm in \a powspec. */ -template void extract_powspec - (const Alm > &alm, PowSpec &powspec); -/*! Returns the cross power spectrum of \a alm1 and \a alm2 in \a powspec. */ -template void extract_crosspowspec - (const Alm > &alm1, - const Alm > &alm2, PowSpec &powspec); -/*! Returns the polarised power spectrum of \a almT, \a almG and \a almC - in \a powspec. */ -template void extract_powspec - (const Alm > &almT, - const Alm > &almG, - const Alm > &almC, - PowSpec &powspec); - -/*! \} */ - -/*! Applies a convolution with a Gaussian beam with an FWHM of - \a fwhm_arcmin arcmin to \a alm. - \note If \a fwhm_arcmin<0, a deconvolution with \a -fwhm_arcmin - is performed. - \relates Alm */ -template void smooth_with_Gauss - (Alm > &alm, double fwhm_arcmin); -/*! Applies a convolution with a Gaussian beam with an FWHM of - \a fwhm_arcmin arcmin to \a almT, \a almG and \a almC. - \note If \a fwhm_arcmin<0, a deconvolution with \a -fwhm_arcmin - is performed. - \relates Alm */ -template void smooth_with_Gauss - (Alm > &almT, - Alm > &almG, - Alm > &almC, - double fwhm_arcmin); - -/*! Rotates \a alm through the Euler angles \a psi, \a theta and \a phi. - The Euler angle convention is right handed, rotations are active. - - \a psi is the first rotation about the z-axis (vertical) - - then \a theta about the ORIGINAL (unrotated) y-axis - - then \a phi about the ORIGINAL (unrotated) z-axis (vertical) - \relates Alm */ -template void rotate_alm (Alm > &alm, - double psi, double theta, double phi); - -/*! Rotates \a almT, \a almG and \a almC through the Euler angles - \a psi, \a theta and \a phi. - The Euler angle convention is right handed, rotations are active. - - \a psi is the first rotation about the z-axis (vertical) - - then \a theta about the ORIGINAL (unrotated) y-axis - - then \a phi about the ORIGINAL (unrotated) z-axis (vertical) - \relates Alm */ -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - double psi, double theta, double phi); - -/*! Rotates \a alm through the rotation matrix \a mat. - \relates Alm */ -template void rotate_alm (Alm > &alm, - const rotmatrix &mat); - -/*! Rotates \a almT, \a almG and \a almC through the rotation matrix \a mat. - \relates Alm */ -template void rotate_alm (Alm > &almT, - Alm > &almG, Alm > &almC, - const rotmatrix &mat); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.cc deleted file mode 100644 index 8c0c8c977e..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.cc +++ /dev/null @@ -1,140 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "xcomplex.h" -#include "cxxutils.h" -#include "paramfile.h" -#include "simparams.h" -#include "healpix_data_io.h" -#include "alm.h" -#include "alm_fitsio.h" -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "powspec.h" -#include "powspec_fitsio.h" -#include "alm_healpix_tools.h" -#include "alm_powspec_tools.h" -#include "fitshandle.h" - -using namespace std; - -template void anafast_cxx (paramfile ¶ms, simparams &par) - { - int nlmax = params.template find("nlmax"); - int nmmax = params.template find("nmmax",nlmax); - string infile = params.template find("infile"); - string outfile = params.template find("outfile",""); - string outfile_alms = params.template find("outfile_alms",""); - planck_assert ((outfile!="") || (outfile_alms!=""), - "no output specified, nothing done"); - bool polarisation = params.template find("polarisation"); - int num_iter = params.template find("iter_order",0); - - if (!polarisation) - { - Healpix_Map map; - read_Healpix_map_from_fits(infile,map,1,2); - arr weight; - get_ring_weights (params,par,map.Nside(),weight); - - Alm > alm(nlmax,nmmax); - double avg=map.average(); - map.add(-avg); - if (map.Scheme()==NEST) map.swap_scheme(); - map2alm_iter(map,alm,num_iter,weight); - - alm(0,0) += avg*sqrt(fourpi); - - if (outfile!="") - { - PowSpec powspec; - extract_powspec (alm,powspec); - fitshandle out; - out.create (outfile); - write_powspec_to_fits (out,powspec,1); - } - if (outfile_alms!="") - { - fitshandle out; - out.create (outfile_alms); - write_Alm_to_fits (out,alm,alm.Lmax(),alm.Mmax(),FITSUTIL::DTYPE); - } - } - else - { - Healpix_Map mapT, mapQ, mapU; - read_Healpix_map_from_fits(infile,mapT,1,2); - read_Healpix_map_from_fits(infile,mapQ,2,2); - read_Healpix_map_from_fits(infile,mapU,3,2); - arr weight; - get_ring_weights (params,par,mapT.Nside(),weight); - - Alm > almT(nlmax,nmmax), almG(nlmax,nmmax), almC(nlmax,nmmax); - double avg=mapT.average(); - mapT.add(-avg); - if (mapT.Scheme()==NEST) mapT.swap_scheme(); - if (mapQ.Scheme()==NEST) mapQ.swap_scheme(); - if (mapU.Scheme()==NEST) mapU.swap_scheme(); - map2alm_pol_iter - (mapT,mapQ,mapU,almT,almG,almC,num_iter,weight); - - almT(0,0) += avg*sqrt(fourpi); - - if (outfile!="") - { - PowSpec powspec; - extract_powspec (almT,almG,almC,powspec); - fitshandle out; - out.create (outfile); - write_powspec_to_fits (out,powspec,4); - } - if (outfile_alms!="") - { - fitshandle out; - out.create (outfile_alms); - write_Alm_to_fits (out,almT,almT.Lmax(),almT.Mmax(),FITSUTIL::DTYPE); - write_Alm_to_fits (out,almG,almG.Lmax(),almG.Mmax(),FITSUTIL::DTYPE); - write_Alm_to_fits (out,almC,almC.Lmax(),almC.Mmax(),FITSUTIL::DTYPE); - } - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("anafast_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? anafast_cxx(params,par) : anafast_cxx(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.par.txt deleted file mode 100644 index afc72d9b22..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/anafast_cxx.par.txt +++ /dev/null @@ -1,35 +0,0 @@ -Parameters read by anafast_cxx: - -nlmax (integer): - maximum order of l - -nmmax (integer): - maximum order of m (must not be larger than nlmax, default=nlmax) - -infile (string): - input file containing the Healpix map - -outfile (string, default=""): - output file name for power spectrum; if empty, no spectrum is written - -outfile_alms (string, default=""): - output file name for the a_lm; if empty, no a_lm are written - -polarisation (bool): - if false, only the intensity a_lm are generated, - if true, a_lm for T, G and C component are generated - -weighted (bool, default=false): - if true, weighted quadrature is used - -if (weighted) - healpix_data (string): - directory containing the Healpix data files -endif - -iter_order (integer, default=0) - number of iterations for the analysis (0: standard analysis) - -double_precision (bool, default=false): - if false, maps and a_lm are read/written in single precision, - otherwise in double precision. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/calc_powspec.cc b/src/amuse_simplex/src/plugins/HEALPix/src/calc_powspec.cc deleted file mode 100644 index 6c5b9d4730..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/calc_powspec.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "fitshandle.h" -#include "alm.h" -#include "alm_fitsio.h" -#include "powspec.h" -#include "powspec_fitsio.h" -#include "alm_powspec_tools.h" - -using namespace std; - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - announce ("calc_powspec"); - planck_assert (argc==3||argc==4, - "usage: calc_powspec [] "); - - if (argc==3) - { - fitshandle inp; - inp.open(argv[1]); - inp.goto_hdu(2); - int lmax,mmax; - get_almsize(inp,lmax,mmax); - Alm > alm; - read_Alm_from_fits (inp,alm,lmax,mmax); - PowSpec powspec; - extract_powspec (alm,powspec); - fitshandle out; - out.create (argv[2]); - write_powspec_to_fits (out,powspec,1); - } - else - { - fitshandle inp; - inp.open(argv[1]); - inp.goto_hdu(2); - int lmax,mmax; - get_almsize(inp,lmax,mmax); - Alm > alm1; - read_Alm_from_fits (inp,alm1,lmax,mmax); - inp.close(); - inp.open(argv[2]); - inp.goto_hdu(2); - get_almsize(inp,lmax,mmax); - Alm > alm2; - read_Alm_from_fits (inp,alm2,lmax,mmax); - inp.close(); - PowSpec powspec; - extract_crosspowspec (alm1,alm2,powspec); - fitshandle out; - out.create (argv[3]); - write_powspec_to_fits (out,powspec,1); - } -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/Makefile b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/Makefile deleted file mode 100644 index 80fc0f2c7d..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -MPICXX ?= mpicxx - -VPATH = $(INCDIR) -HEADERS=cxxutils.h arr.h paramfile.h \ - fitshandle.h message_error.h vec3.h \ - lsconstants.h rotmatrix.h pointing.h \ - planck_rng.h geom_utils.h simparams.h \ - tga_image.h xcomplex.h trafos.h \ - fftpack_support.h datatypes.h \ - openmp_support.h - -#include $(PARAMFILE) -INCDIR = ../../include -LIBDIR = ../../lib - -INCLUDE = -I$(INCDIR) - -all: libcxxsupport.a - -%.o : %.cc - $(MPICXX) $(CXXCFLAGS) -o $@ -c $< $(INCLUDE) - -clean: - $(RM) *.o *.a - -MESSAGE_ERROR_H := message_error.h -LSCONSTANTS_H := lsconstants.h -DATATYPES_H := datatypes.h $(MESSAGE_ERROR_H) -CXXUTILS_H := cxxutils.h $(MESSAGE_ERROR_H) $(LSCONSTANTS_H) -SIMPARAMS_H := simparams.h $(CXXUTILS_H) -PARAMFILE_H := paramfile.h $(SIMPARAMS_H) $(CXXUTILS_H) -ARR_H := arr.h $(CXXUTILS_H) -FITSHANDLE_H := fitshandle.h fitsio.h $(ARR_H) $(DATATYPES_H) -VEC3_H := vec3.h -ROTMATRIX_H := rotmatrix.h $(CXXUTILS_H) $(VEC3_H) -POINTING_H := pointing.h $(VEC3_H) $(CXXUTILS_H) -PLANCK_RNG_H := planck_rng.h $(CXXUTILS_H) -GEOM_UTILS_H := geom_utils.h $(CXXUTILS_H) $(VEC3_H) -TGA_IMAGE_H := tga_image.h $(ARR_H) -XCOMPLEX_H := xcomplex.h -TRAFOS_H := trafos.h $(ROTMATRIX_H) $(GEOM_UTILS_H) $(POINTING_H) -FFTPACK_SUPPORT_H := fftpack_support.h $(ARR_H) $(XCOMPLEX_H) - -SUPPORT_OBJ= cxxutils.o fitshandle.o rotmatrix.o simparams.o tga_image.o \ - trafos.o - -cxxutils.o: $(CXXUTILS_H) -fitshandle.o: $(FITSHANDLE_H) $(CXXUTILS_H) -rotmatrix.o: $(ROTMATRIX_H) $(VEC3_H) $(LSCONSTANTS_H) -simparams.o: $(SIMPARAMS_H) $(FITSHANDLE_H) -tga_image.o: $(TGA_IMAGE_H) font_data.inc -trafos.o: $(TRAFOS_H) $(LSCONSTANTS_H) - -libcxxsupport.a: $(SUPPORT_OBJ) $(HEADERS) - $(ARCREATE) libcxxsupport.a $(SUPPORT_OBJ) diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/arr.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/arr.h deleted file mode 100644 index e41c1712cb..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/arr.h +++ /dev/null @@ -1,447 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file arr.h - * Various high-performance array classes used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ARR_H -#define PLANCK_ARR_H - -#include "cxxutils.h" -#include - -/*! \defgroup arraygroup Array classes */ -/*! \{ */ - -/*! An array whose size is known at compile time. Very useful for storing - small arrays on the stack, without need for \a new and \a delete(). */ -template class fix_arr - { - private: - T d[sz]; - - public: - /*! Returns the size of the array. */ - long size() const { return sz; } - - /*! Returns a reference to element \a #n */ - template T &operator[] (T2 n) {return d[n];} - /*! Returns a constant reference to element \a #n */ - template const T &operator[] (T2 n) const {return d[n];} - }; - - -/*! One-dimensional array type. */ -template class arr - { - private: - long s; - T *d; - bool own; - -#if defined(PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s)) throw Message_error - ("arr: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s-1)); - } -#endif - - void reset() - { s=0; d=0; own=true; } - - public: - /*! Creates a zero-sized array. */ - arr() : s(0), d(0), own(true) {} - /*! Creates an array with \a sz entries. */ - arr(long sz) : s(sz), d (s>0 ? new T[s] : 0), own(true) {} - /*! Creates an array with \a sz entries, and initializes them with - \a inival. */ - arr(long sz, const T &inival) : s(sz), d (s>0 ? new T[s] : 0), own(true) - { fill(inival); } - /*! Creates an array with \a sz entries, which uses the memory pointed - to by \a ptr. - \note \a ptr will not be deallocated by the destructor. - \warning Only use this if you REALLY know what you are doing. - In particular, this is only safely usable if -
    -
  • \a T is a POD type
  • -
  • \a ptr survives during the lifetime of the array object
  • -
  • \a ptr is not subject to garbage collection
  • -
- Other restrictions may apply. You have been warned. */ - arr (T *ptr, long sz): s(sz), d(ptr), own(false) {} - /*! Creates an array which is a copy of \a orig. The data in \a orig - is duplicated. */ - arr (const arr &orig): s(orig.s), d (s>0 ? new T[s] : 0), own(true) - { for (long m=0; m0 ? new T[sz] : 0; - own = true; - } - /*! Deallocates the memory held by the array, and sets the array size - to 0. */ - void dealloc () {if (own) delete[] d; reset();} - - /*! Writes \a val into every element of the array. */ - void fill (const T &val) - { for (long m=0; m T &operator[] (T2 n) {check_range(n); return d[n];} - template const T &operator[] (T2 n) const - {check_range(n); return d[n];} -#else - /*! Returns a reference to element \a #n */ - template T &operator[] (T2 n) {return d[n];} - /*! Returns a constant reference to element \a #n */ - template const T &operator[] (T2 n) const {return d[n];} -#endif - - T *begin() { return d; } - T *end() { return d+s; } - - /*! Sorts the elements in the array, in ascending order. */ - void sort() - { std::sort (d,d+s); } - - /*! Returns the minimum and maximum entry in \a minv and \a maxv, - respectively. Throws an exception if the array is zero-sized. */ - void minmax (T &minv, T &maxv) const - { - planck_assert(s>0,"trying to find min and max of a zero-sized array"); - minv=maxv=d[0]; - for (int m=1; mmaxv) maxv=d[m]; - } - } - - /*! Assigns the contents and size of \a other to the array. On exit, - \a other is yero-sized. */ - void transfer (arr &other) - { if (own) delete[] d; d=other.d; s=other.s; own=other.own; other.reset(); } - /*! Swaps contents and size with \a other. */ - void swap (arr &other) - { std::swap(d,other.d); std::swap(s,other.s); std::swap(own,other.own);} - }; - -/*! Two-dimensional array type. The storage ordering is the same as in C. - An entry is located by address arithmetic, not by double dereferencing. - The indices start at zero. */ -template class arr2 - { - private: - long s1, s2; - arr d; - -#if defined (PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s1)) throw Message_error - ("arr2: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s1-1)); - } -#endif - - public: - /*! Creates a zero-sized array. */ - arr2() : s1(0), s2(0) {} - /*! Creates an array with the dimensions \a sz1 and \a sz2. */ - arr2(long sz1, long sz2) - : s1(sz1), s2(sz2), d(s1*s2) {} - /*! Creates the array as a copy of \a orig. */ - arr2(const arr2 &orig) - : s1(orig.s1), s2(orig.s2), d(orig.d) {} - /*! Frees the memory associated with the array. */ - ~arr2() {} - - /*! Returns the first array dimension. */ - long size1() const { return s1; } - /*! Returns the second array dimension. */ - long size2() const { return s2; } - /*! Returns the total array size, i.e. the product of both dimensions. */ - long size () const { return s1*s2; } - - /*! Allocates space for an array with \a sz1*sz2 elements. - The content of the array is undefined on exit. - \a sz1 or \a sz2 can be 0. If \a sz1*sz2 is the same as the - currently allocated space, no reallocation is performed. */ - void alloc (long sz1, long sz2) - { - if (sz1*sz2 != d.size()) - d.alloc(sz1*sz2); - s1=sz1; s2=sz2; - } - /*! Allocates space for an array with \a sz1*sz2 elements. - The content of the array is undefined on exit. - \a sz1 or \a sz2 can be 0. If \a sz1*sz2 is smaller than the - currently allocated space, no reallocation is performed. */ - void fast_alloc (long sz1, long sz2) - { - if (sz1*sz2<=d.size()) - { s1=sz1; s2=sz2; } - else - alloc(sz1,sz2); - } - /*! Deallocates the space and makes the array zero-sized. */ - void dealloc () {d.dealloc(); s1=0; s2=0;} - - /*! Sets all array elements to \a val. */ - void fill (const T &val) - { d.fill(val); } - - /*! Changes the array to be a copy of \a orig. */ - arr2 &operator= (const arr2 &orig) - { - if (this==&orig) return *this; - alloc (orig.s1, orig.s2); - d = orig.d; - return *this; - } - -#if defined (PLANCK_CHECKS) - template T *operator[] (T2 n) - {check_range(n);return &d[n*s2];} - template const T *operator[] (T2 n) const - {check_range(n);return &d[n*s2];} -#else - /*! Returns a pointer to the beginning of slice \a #n. */ - template T *operator[] (T2 n) {return &d[n*s2];} - /*! Returns a constant pointer to the beginning of slice \a #n. */ - template const T *operator[] (T2 n) const {return &d[n*s2];} -#endif - - /*! Returns the minimum and maximum entry in \a minv and \a maxv, - respectively. Throws an exception if the array is zero-sized. */ - void minmax (T &minv, T &maxv) const - { - planck_assert(s1*s2>0, - "trying to find min and max of a zero-sized array"); - minv=maxv=d[0]; - for (int m=1; mmaxv) maxv=d[m]; - } - } - - /*! Swaps contents and sizes with \a other. */ - void swap (arr2 &other) - { - d.swap(other.d); - std::swap(s1,other.s1); - std::swap(s2,other.s2); - } - }; - -/*! Two-dimensional array type. An entry is located by double dereferencing, - i.e. via an array of pointers. The indices start at zero. */ -template class arr2b - { - private: - long s1, s2; - arr d; - arr d1; - -#if defined (PLANCK_CHECKS) - void check_range(long n) const - { - if ((n<0) || (n>=s1)) throw Message_error - ("arr: index "+dataToString(n)+" is out of range. Max index is " - +dataToString(s1-1)); - } -#endif - - void fill_d1() - { for (long m=0; m T *operator[] (T2 n) {check_range(n); return d1[n];} - template const T *operator[] (T2 n) const - {check_range(n); return d1[n];} -#else - /*! Returns a pointer to the beginning of slice \a #n. */ - template T *operator[] (T2 n) {return d1[n];} - /*! Returns a constant pointer to the beginning of slice \a #n. */ - template const T *operator[] (T2 n) const {return d1[n];} -#endif - /*! Returns a pointer to the beginning of the pointer array. */ - T **p0() {return &d1[0];} - }; - - -/*! Three-dimensional array type. The storage ordering is the same as in C. - An entry is located by address arithmetic, not by multiple dereferencing. - The indices start at zero. */ -template class arr3 - { - private: - long s1, s2, s3, s2s3; - arr d; - - public: - /*! Creates a zero-sized array. */ - arr3() : s1(0), s2(0), s3(0), s2s3(0), d(0) {} - /*! Creates an array with the dimensions \a sz1, \a sz2 and \a sz3. */ - arr3(long sz1, long sz2, long sz3) - : s1(sz1), s2(sz2), s3(sz3), s2s3(s2*s3), d(s1*s2*s3) {} - /*! Creates the array as a copy of \a orig. */ - arr3(const arr3 &orig) - : s1(orig.s1), s2(orig.s2), s3(orig.s3), s2s3(orig.s2s3), d(orig.d) {} - /*! Frees the memory associated with the array. */ - ~arr3() {} - - /*! Returns the first array dimension. */ - long size1() const { return s1; } - /*! Returns the second array dimension. */ - long size2() const { return s2; } - /*! Returns the third array dimension. */ - long size3() const { return s3; } - /*! Returns the total array size, i.e. the product of all dimensions. */ - long size () const { return s1*s2*s3; } - - /*! Allocates space for an array with \a sz1*sz2*sz3 elements. - The content of the array is undefined on exit. */ - void alloc (long sz1, long sz2, long sz3) - { - d.alloc(sz1*sz2*sz3); - s1=sz1; s2=sz2; s3=sz3; s2s3=s2*s3; - } - /*! Deallocates the space and makes the array zero-sized. */ - void dealloc () {d.dealloc(); s1=0; s2=0; s3=0; s2s3=0;} - - /*! Sets all array elements to \a val. */ - void fill (const T &val) - { d.fill(val); } - - /*! Changes the array to be a copy of \a orig. */ - arr3 &operator= (const arr3 &orig) - { - if (this==&orig) return *this; - alloc (orig.s1, orig.s2, orig.s3); - d = orig.d; - return *this; - } - - /*! Returns a reference to the element with the indices - \a n1, \a n2 and \a n3. */ - template T &operator() (T2 n1, T2 n2, T2 n3) - {return d[n1*s2s3 + n2*s3 + n3];} - /*! Returns a constant reference to the element with the indices - \a n1, \a n2 and \a n3. */ - template const T &operator() (T2 n1, T2 n2, T2 n3) const - {return d[n1*s2s3 + n2*s3 + n3];} - - /*! Swaps contents and sizes with \a other. */ - void swap (arr3 &other) - { - d.swap(other.d); - std::swap(s1,other.s1); - std::swap(s2,other.s2); - std::swap(s3,other.s3); - std::swap(s2s3,other.s2s3); - } - }; - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxsupport.dox b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxsupport.dox deleted file mode 100644 index f84f0adee8..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxsupport.dox +++ /dev/null @@ -1,4 +0,0 @@ -/*! \mainpage LevelS C++ support library documentation - Please refer to the Modules page for an overview - of the supplied functionality. - */ diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.cc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.cc deleted file mode 100644 index 04c6bdf562..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.cc +++ /dev/null @@ -1,297 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * This file contains the implementation of various convenience functions - * used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * Authors: Martin Reinecke, Reinhard Hell - */ - -// if we are using g++, check for version 3.0 or higher -#ifdef __GNUC__ -#if (__GNUC__<3) -#error your C++ compiler is too old. g++ version 3.0 or higher is required. -#endif -#endif - -#include -#include -#include -#include -#include -#include -#include -#include "cxxutils.h" -#include "datatypes.h" -#include "openmp_support.h" - -using namespace std; - -bool file_present (const string &filename) - { - ifstream dummy(filename.c_str()); - return dummy; - } - -void assert_present (const string &filename) - { - if (file_present(filename)) return; - throw Message_error ("Error: file " + filename + " does not exist!"); - } - -void assert_not_present (const string &filename) - { - if (!file_present(filename)) return; - throw Message_error ("Error: file " + filename + " already exists!"); - } - -void remove_file (const string &filename) - { - remove (filename.c_str()); - } - -string trim (const string &orig) - { - string::size_type p1=orig.find_first_not_of(" \t"); - if (p1==string::npos) return ""; - string::size_type p2=orig.find_last_not_of(" \t"); - return orig.substr(p1,p2-p1+1); - } - -template string dataToString (const T &x) - { - ostringstream strstrm; - strstrm << x; - return trim(strstrm.str()); - } - -template<> string dataToString (const bool &x) - { return x ? "T" : "F"; } -template<> string dataToString (const string &x) - { return trim(x); } -template<> string dataToString (const float &x) - { - ostringstream strstrm; - strstrm << setprecision(8) << x; - return trim(strstrm.str()); - } -template<> string dataToString (const double &x) - { - ostringstream strstrm; - strstrm << setprecision(16) << x; - return trim(strstrm.str()); - } - -template string dataToString (const signed char &x); -template string dataToString (const unsigned char &x); -template string dataToString (const short &x); -template string dataToString (const unsigned short &x); -template string dataToString (const int &x); -template string dataToString (const unsigned int &x); -template string dataToString (const long &x); -template string dataToString (const unsigned long &x); -template string dataToString (const long long &x); -template string dataToString (const unsigned long long &x); - -string intToString(int x, int width) - { - ostringstream strstrm; - strstrm << setw(width) << setfill('0') << x; - return trim(strstrm.str()); - } - -template void stringToData (const string &x, T &value) - { - string error = string("conversion error in stringToData<") - + type2typename() - +">(\""+x+"\")"; - istringstream strstrm(x); - strstrm >> value; - if (!strstrm) - throw Message_error(error); - - string rest; - strstrm >> rest; -// rest=trim(rest); - if (rest.length()>0) throw Message_error(error); - } - -template<> void stringToData (const string &x, string &value) - { value = trim(x); } - -template<> void stringToData (const string &x, bool &value) - { - if ( x=="F" || x=="f" || x=="n" || x=="N" || x=="false" || x==".false." - || x=="FALSE" || x==".FALSE.") - value=false; - else if (x=="T" || x=="t" || x=="y" || x=="Y" || x=="true" || x==".true." - || x=="TRUE" || x==".TRUE.") - value=true; - else - { - string error = string("conversion error in stringToData(\"")+x+"\")"; - throw Message_error (error); - } - } - -template void stringToData (const string &x, signed char &value); -template void stringToData (const string &x, unsigned char &value); -template void stringToData (const string &x, short &value); -template void stringToData (const string &x, unsigned short &value); -template void stringToData (const string &x, int &value); -template void stringToData (const string &x, unsigned int &value); -template void stringToData (const string &x, long &value); -template void stringToData (const string &x, unsigned long &value); -template void stringToData (const string &x, long long &value); -template void stringToData (const string &x, unsigned long long &value); -template void stringToData (const string &x, float &value); -template void stringToData (const string &x, double &value); - -bool equal_nocase (const string &a, const string &b) - { - if (a.size()!=b.size()) return false; - for (unsigned int m=0; mlastpercent) - cout << "\r " << setw(3) << nowpercent << "% done\r" << flush; - } - -void end_announce_progress () - { cout << endl; } - -#endif - -static void openmp_status() - { - if (openmp_enabled()) - { - cout << "Application was compiled with OpenMP support," << endl; - if (openmp_max_threads() == 1) - cout << "but running with one process only." << endl; - else - cout << "running with up to " << openmp_max_threads() - << " processes." << endl; - } - else - cout << "Application was compiled without OpenMP support;" << endl - << "running in scalar mode." << endl; - } - -void announce (const string &name) - { - cout << endl << "+-"; - for (unsigned int m=0; m &dict) - { - int lineno=0; - dict.clear(); - ifstream inp(filename.c_str()); - planck_assert (inp,"Could not open parameter file "+filename); - while (inp) - { - string line; - getline(inp, line); - ++lineno; - // remove potential carriage returns at the end of the line - line=line.substr(0,line.find_first_of("\r")); - line=line.substr(0,line.find_first_of("#")); - line=trim(line); - if (line.size()>0) - { - string::size_type eqpos=line.find("="); - if (eqpos!=string::npos) - { - string key=trim(line.substr(0,eqpos)), - value=trim(line.substr(eqpos+1,string::npos)); - if (key=="") - cerr << "Warning: empty key in " << filename << ", line " - << lineno << endl; - else - { - if (dict.find(key)!=dict.end()) - cerr << "Warning: key " << key << " multiply defined in " - << filename << ", line " << lineno << endl; - dict[key]=value; - } - } - else - cerr << "Warning: unrecognized format in " << filename << ", line " - << lineno << ":\n" << line << endl; - } - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.h deleted file mode 100644 index 353aab6917..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/cxxutils.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file cxxutils.h - * Various convenience functions used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke \author Reinhard Hell - */ - -#ifndef PLANCK_CXXUTILS_H -#define PLANCK_CXXUTILS_H - -#include -#include -#include -#include -#include "message_error.h" -#include "lsconstants.h" - -/*! \defgroup mathutilsgroup Mathematical helper functions */ -/*! \{ */ - -//! Returns \e true if | \a a-b | < \a epsilon * | \a b |, else \e false. -template inline bool approx (F a, F b, F epsilon=1e-5) - { - using namespace std; - return abs(a-b) < (epsilon*abs(b)); - } - -//! Returns \e true if | \a a-b | < \a epsilon, else \e false. -template inline bool abs_approx (F a, F b, F epsilon=1e-5) - { - using namespace std; - return abs(a-b) < epsilon; - } - -//! Returns the largest integer which is smaller than (or equal to) \a arg. -template inline I ifloor (F arg) - { - return (arg>=0) ? I(arg) : I(arg)-1; - } - -//! Returns the integer which is nearest to \a arg. -template inline I nearest (F arg) - { - arg += 0.5; - return (arg>=0) ? I(arg) : I(arg)-1; - } - -//! Returns \a v1+v2 if \a v1<0, \a v1-v2 if \a v1>=v2, else \a v1. -/*! \a v1 can be positive or negative; \a v2 must be positive. */ -template inline T weak_modulo (T v1, T v2) - { return (v1>=0) ? ((v1=0) ? ((v1 inline I imodulo (I v1, I v2) - { return (v1>=0) ? ((v1 inline T sign (const T& signvalue) - { return (signvalue>=0) ? 1 : -1; } - -//! Returns the integer \a n, which fulfills \a n*n<=arg<(n+1)*(n+1). -template inline unsigned int isqrt (I arg) - { - using namespace std; - if (sizeof(I)<=4) - return unsigned (sqrt(arg+0.5)); - long double arg2 = arg; - return unsigned (sqrt(arg2+0.5)); - } - -//! Returns the largest integer \a n that fulfills \a 2^n<=arg. -template inline unsigned int ilog2 (I arg) - { - unsigned int res=0; - while (arg > 0x0000FFFF) { res+=16; arg>>=16; } - if (arg > 0x000000FF) { res|=8; arg>>=8; } - if (arg > 0x0000000F) { res|=4; arg>>=4; } - if (arg > 0x00000003) { res|=2; arg>>=2; } - if (arg > 0x00000001) { res|=1; } - return res; - } - -//! Returns \a atan2(y,x) if \a x!=0 or \a y!=0; else returns 0. -inline double safe_atan2 (double y, double x) - { - using namespace std; - return ((x==0.) && (y==0.)) ? 0.0 : atan2(y,x); - } - -//! Returns an index to the left of two interpolation values. -/*! \a begin points to an array containing a sequence of values - sorted in ascending order. The length of the array is \a len. - If \a val is lower than the first element, 0 is returned. - If \a val is higher than the last element, \a len-2 - is returned. Else, the index of the largest element smaller - than \a val is returned. */ -template inline int interpol_left - (const T *begin, int len, const T &val) - { - const T *end = begin+len; - const T *iter = std::lower_bound (begin, end, val); - if (iter==begin) return 0; - if (iter==end) return len-2; - return (iter-begin)-1; - } - -//! Returns an index to the nearest interpolation value. -/*! \a begin points to an array containing a sequence of values - sorted in ascending order. The length of the array is \a len. - If \a val is lower than the first element, 0 is returned. - If \a val is higher than the last element, \a len-1 is returned. - Else, the index of the nearest element within the sequence of - values is returned. */ -template inline int interpol_nearest - (const T *begin, int len, const T &val) - { - int left = interpol_left(begin, len, val); - T delleft = val-(*(begin+left)); - T delright = (*(begin+left+1))-val; - if (delright<0) return left+1; - return (delright std::string dataToString(const T &x); -template<> std::string dataToString (const bool &x); -template<> std::string dataToString (const std::string &x); -template<> std::string dataToString (const float &x); -template<> std::string dataToString (const double &x); - -/*! Returns a string containing the text representation of \a x, padded - with leading zeroes to \a width characters. */ -std::string intToString(int x, int width); - -//! Reads a value of a given datatype from a string -template void stringToData (const std::string &x, T &value); -template<> void stringToData (const std::string &x, std::string &value); -template<> void stringToData (const std::string &x, bool &value); - -//! Reads a value of a given datatype from a string -template inline T stringToData (const std::string &x) - { T result; stringToData(x,result); return result; } - -//! Parses the file \a filename and returns the key/value pairs in \a dict. -void parse_file (const std::string &filename, - std::map &dict); - -//! Case-insensitive string comparison -/*! Returns \a true, if \a a and \a b differ only in capitalisation, - else \a false. */ -bool equal_nocase (const std::string &a, const std::string &b); - -//! Returns lowercase version of \a input. -std::string tolower(const std::string &input); - -/*! \} */ - -//! Indicates progress by printing the percentage of \a now/total. -/*! A message is only printed if it has changed since \a now-1/total. - The output is followed by a carriage return, not a newline. */ -void announce_progress (int now, int total); -//! Indicates progress by printing the percentage of \a now/total. -/*! A message is only printed if it has changed since \a last/total. - The output is followed by a carriage return, not a newline. */ -void announce_progress (double now, double last, double total); -/*! This function should be called after a sequence of announce_progress() - calls has finished. */ -void end_announce_progress (); - -//! Prints a banner containing \a name. Useful for displaying program names. -void announce (const std::string &name); - -/*! Prints a banner containing \a name and checks if \a argc==argc_expected. - If not, a usage description is given and the program is terminated. */ -void module_startup (const std::string &name, int argc, const char **argv, - int argc_expected, const std::string &argv_expected); - -//! Returns an appropriate FITS repetition count for a map with \a npix pixels. -inline unsigned int healpix_repcount (int npix) - { - if (npix<1024) return 1; - if ((npix%1024)==0) return 1024; - return isqrt (npix/12); - } -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/datatypes.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/datatypes.h deleted file mode 100644 index 7e98de725a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/datatypes.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * This file defines various platform-independent data types. - * If any of the requested types is not available, compilation aborts - * with an error (unfortunately a rather obscure one). - * - * Copyright (C) 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef PLANCK_DATATYPES_H -#define PLANCK_DATATYPES_H - -#include -#include "message_error.h" - -// Template magic to select the proper data types. These templates -// should not be used outside this file. - -template struct sizeChooserHelper - { typedef void TYPE; }; - -template struct sizeChooserHelper - { typedef T TYPE; }; - -template struct sizeChooserHelper2 - { typedef T1 TYPE; }; - -template struct sizeChooserHelper2 - { typedef T2 TYPE; }; - -template struct sizeChooserHelper2 - { typedef T3 TYPE; }; - -template <> struct sizeChooserHelper2 - { }; - -template - struct sizeChooser - { - typedef typename sizeChooserHelper2 - ::TYPE, - typename sizeChooserHelper::TYPE, - typename sizeChooserHelper::TYPE >::TYPE TYPE; - }; - -typedef signed char int8; -typedef unsigned char uint8; - -typedef sizeChooser<2, short, int>::TYPE - int16; -typedef sizeChooser<2, unsigned short, unsigned int>::TYPE - uint16; - -typedef sizeChooser<4, int, long, short>::TYPE - int32; -typedef sizeChooser<4, unsigned int, unsigned long, unsigned short>::TYPE - uint32; - -typedef sizeChooser<8, long, long long>::TYPE - int64; -typedef sizeChooser<8, unsigned long, unsigned long long>::TYPE - uint64; - -typedef sizeChooser<4, float, double>::TYPE - float32; -typedef sizeChooser<8, double, long double>::TYPE - float64; - -// mapping of types to integer constants -enum { PLANCK_INT8 = 0, - PLANCK_UINT8 = 1, - PLANCK_INT16 = 2, - PLANCK_UINT16 = 3, - PLANCK_INT32 = 4, - PLANCK_UINT32 = 5, - PLANCK_INT64 = 6, - PLANCK_UINT64 = 7, - PLANCK_FLOAT32 = 8, - PLANCK_FLOAT64 = 9, - PLANCK_BOOL = 10, - PLANCK_STRING = 11 }; - -template struct typehelper {}; - -template<> struct typehelper - { enum { id=PLANCK_INT8 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT8 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT16 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT16 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_INT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_UINT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_FLOAT32 }; }; -template<> struct typehelper - { enum { id=PLANCK_FLOAT64 }; }; -template<> struct typehelper - { enum { id=PLANCK_BOOL }; }; -template<> struct typehelper - { enum { id=PLANCK_STRING }; }; - -inline int type2size (int type) - { - switch (type) - { - case PLANCK_INT8 : return 1; - case PLANCK_UINT8 : return 1; - case PLANCK_INT16 : return 2; - case PLANCK_UINT16 : return 2; - case PLANCK_INT32 : return 4; - case PLANCK_UINT32 : return 4; - case PLANCK_INT64 : return 8; - case PLANCK_UINT64 : return 8; - case PLANCK_FLOAT32: return 4; - case PLANCK_FLOAT64: return 8; - case PLANCK_BOOL : return 1; - case PLANCK_STRING : return 1; - default: throw Message_error ("unsupported data type"); - } - } - -inline int string2type(const std::string &type) - { - if (type=="FLOAT64") return PLANCK_FLOAT64; - if (type=="FLOAT32") return PLANCK_FLOAT32; - if (type=="INT8") return PLANCK_INT8; - if (type=="UINT8") return PLANCK_UINT8; - if (type=="INT16") return PLANCK_INT16; - if (type=="UINT16") return PLANCK_UINT16; - if (type=="INT32") return PLANCK_INT32; - if (type=="UINT32") return PLANCK_UINT32; - if (type=="INT64") return PLANCK_INT64; - if (type=="UINT64") return PLANCK_UINT64; - if (type=="BOOL") return PLANCK_BOOL; - if (type=="STRING") return PLANCK_STRING; - throw Message_error ("unknown data type "+type); - } - -inline const char *type2string (int type) - { - switch (type) - { - case PLANCK_INT8 : return "INT8"; - case PLANCK_UINT8 : return "UINT8"; - case PLANCK_INT16 : return "INT16"; - case PLANCK_UINT16 : return "UINT16"; - case PLANCK_INT32 : return "INT32"; - case PLANCK_UINT32 : return "UINT32"; - case PLANCK_INT64 : return "INT64"; - case PLANCK_UINT64 : return "UINT64"; - case PLANCK_FLOAT32: return "FLOAT32"; - case PLANCK_FLOAT64: return "FLOAT64"; - case PLANCK_BOOL : return "BOOL"; - case PLANCK_STRING : return "STRING"; - default: throw Message_error ("unsupported data type"); - } - } - -template inline const char *type2typename () - { return "unknown type"; } -template<> inline const char *type2typename () - { return "signed char"; } -template<> inline const char *type2typename () - { return "unsigned char"; } -template<> inline const char *type2typename () - { return "short"; } -template<> inline const char *type2typename () - { return "unsigned short"; } -template<> inline const char *type2typename () - { return "int"; } -template<> inline const char *type2typename () - { return "unsigned int"; } -template<> inline const char *type2typename () - { return "long"; } -template<> inline const char *type2typename () - { return "unsigned long"; } -template<> inline const char *type2typename () - { return "long long"; } -template<> inline const char *type2typename () - { return "unsigned long long"; } -template<> inline const char *type2typename () - { return "float"; } -template<> inline const char *type2typename () - { return "double"; } -template<> inline const char *type2typename () - { return "bool"; } -template<> inline const char *type2typename () - { return "std::string"; } - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fftpack_support.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fftpack_support.h deleted file mode 100644 index 4f3a821dee..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fftpack_support.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_FFTPACK_SUPPORT_H -#define PLANCK_FFTPACK_SUPPORT_H - -#include "ls_fft.h" -#include "arr.h" -#include "xcomplex.h" - -class cfft - { - private: - int n; - complex_plan plan; - - public: - cfft () : n(-1), plan(0) {} - cfft (int size_) - : n(size_), plan(make_complex_plan(size_)) {} - ~cfft () - { if (plan!=0) kill_complex_plan (plan); } - void Set (int size_) - { - if (plan!=0) kill_complex_plan (plan); - n=size_; - plan=make_complex_plan(size_); - } - - int size() const - { return n; } - - void forward (double *data) - { complex_plan_forward(plan,data); } - void backward (double *data) - { complex_plan_backward(plan,data); } - void forward (arr >&data) - { forward(&(data[0].re)); } - void backward (arr >&data) - { backward(&(data[0].re)); } - }; - -class rfft - { - private: - int n; - real_plan plan; - - public: - rfft () : n(-1), plan(0) {} - rfft (int size_) - : n(size_), plan(make_real_plan(size_)) {} - ~rfft () - { if (plan!=0) kill_real_plan (plan); } - void Set (int size_) - { - if (plan!=0) kill_real_plan (plan); - n=size_; - plan=make_real_plan(size_); - } - - int size() const - { return n; } - - void forward_fftpack (double *data) - { real_plan_forward_fftpack(plan,data); } - void backward_fftpack (double *data) - { real_plan_backward_fftpack(plan,data); } - void forward_fftpack (arr &data) - { forward_fftpack(&(data[0])); } - void backward_fftpack (arr &data) - { backward_fftpack(&(data[0])); } - void forward_c (arr >&data) - { real_plan_forward_c(plan,&(data[0].re)); } - void backward_c (arr >&data) - { real_plan_backward_c(plan,&(data[0].re)); } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.cc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.cc deleted file mode 100644 index aa9f858091..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.cc +++ /dev/null @@ -1,848 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * This file contains the implementation of the FITS I/O helper class - * used by the Planck LevelS package. - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "fitsio.h" -#include "fitshandle.h" -#include "cxxutils.h" - -using namespace std; - -namespace { - -string ftc2char (int type) - { - switch (type) - { - case TLOGICAL : return "L"; - case TFLOAT : return "E"; - case TDOUBLE : return "D"; - case TBYTE : return "B"; - case TSHORT : return "I"; - case TINT32BIT: return "J"; - case TLONGLONG: return "K"; - case TSTRING : return "A"; - default: throw Message_error("wrong datatype in ftc2char()"); - } - } - -string ftc2asciiform (int type) - { - switch (type) - { - case TFLOAT: return "E14.7"; - case TDOUBLE: return "D23.15"; - case TBYTE: return "I4"; - case TSHORT: return "I6"; - case TINT32BIT: return "I11"; - case TLONGLONG: return "I22"; - default: throw Message_error("wrong datatype in ftc2asciiform()"); - } - } - -string fixkey (const string &key) - { - for (unsigned int m=0; m naxes(naxis); - fits_get_img_sizell (fptr, naxis, &naxes[0], &status); - for (long m=0; m(data), &status); - nrows_ = max(nrows_,offset+ndata); - check_errors(); - } - -void fitshandle::open (const string &fname, int rwmode) - { - clean_all(); - fits_open_file(&fptr, fname.c_str(), rwmode, &status); - check_errors(); - init_data(); - } - -void fitshandle::create (const string &fname) - { - clean_all(); - fits_create_file(&fptr, fname.c_str(), &status); - fits_write_imghdr(fptr, 8, 0, 0, &status); // insert empty PHDU - fits_write_date(fptr, &status); - check_errors(); - init_data(); - } - -// static -void fitshandle::delete_file (const string &name) - { - fitsfile *ptr; - int status = 0; - fits_open_file(&ptr, name.c_str(), READWRITE, &status); - fits_delete_file(ptr, &status); - if (status==0) return; - - char msg[81]; - fits_get_errstatus (status, msg); - cerr << msg << endl; - while (fits_read_errmsg(msg)) cerr << msg << endl; - throw Message_error("FITS error"); - } - -void fitshandle::goto_hdu (int hdu) - { - int curhdu; - fits_get_hdu_num(fptr,&curhdu); - if (curhdu!=hdu) - { - fits_movabs_hdu(fptr, hdu, &hdutype_, &status); - check_errors(); - init_data(); - } - } - -int fitshandle::num_hdus () const - { - int result; - fits_get_num_hdus (fptr, &result, &status); - check_errors(); - return result; - } - -void fitshandle::insert_bintab (const vector &cols, - const string &extname) - { - clean_data(); - int ncol=cols.size(); - arr2b ttype(ncol,81), tform(ncol,81), tunit(ncol,81); - - for (long m=0; m(extname.c_str()), 0, &status); - check_errors(); - init_data(); - } - -void fitshandle::insert_asctab (const vector &cols, - const string &extname) - { - clean_data(); - int ncol=cols.size(); - arr2b ttype(ncol,81), tform(ncol,81), tunit(ncol,81); - - for (long m=0; m(extname.c_str()), &status); - check_errors(); - init_data(); - } - -void fitshandle::insert_image (int btpx, const vector &Axes) - { - clean_data(); - arr tmpax(Axes.size()); - for (long m=0; m - void fitshandle::insert_image (int btpx, const arr2 &data) - { - clean_data(); - arr tmpax(2); - tmpax[0] = data.size2(); tmpax[1] = data.size1(); - fits_insert_imgll (fptr, btpx, 2, &tmpax[0], &status); - arr2 &tmparr = const_cast &> (data); - fits_write_img (fptr, FITSUTIL::DTYPE, 1, tmpax[0]*tmpax[1], - &tmparr[0][0], &status); - check_errors(); - init_data(); - } - -template void fitshandle::insert_image (int btpx, const arr2 &data); -template void fitshandle::insert_image (int btpx, const arr2 &data); -template void fitshandle::insert_image (int btpx, const arr2 &data); - -void fitshandle::write_checksum() - { - assert_connected("fitshandle::write_checksum()"); - fits_write_chksum (fptr, &status); - check_errors(); - } - -void fitshandle::copy_historified_header (const fitshandle &orig) - { - const char *inclist[] = { "*" }; - const char *exclist[] = { - "SIMPLE","BITPIX","NAXIS","NAXIS#","PCOUNT","GCOUNT", - "EXTEND","ORIGIN","DATE*","TFIELDS","TTYPE#","TFORM#", - "TUNIT#","EXTNAME","CTYPE#","CRVAL#","CRPIX#","CDELT#", - "XTENSION","INSTRUME","TELESCOP","PDMTYPE","TBCOL#" }; - char card[81]; - string card2; - orig.assert_connected("fitshandle::copy_historified_header()"); - assert_connected("fitshandle::copy_historified_header()"); - fits_read_record (orig.fptr, 0, card, &status); - check_errors(); - while (true) - { - fits_find_nextkey (orig.fptr, const_cast(inclist), 1, - const_cast(exclist), 23, card, &status); - if (status!=0) break; - card2=trim(card); - if (card2!="END" && card2!="COMMENT" && card2!="HISTORY") - { - if (card2.find("COMMENT")==0) - card2.replace(0,7,"HISTORY"); - if (card2.find("HISTORY")!=0) - card2.insert(0,"HISTORY "); - if (card2.length()<=80) - fits_write_record (fptr, card2.c_str(), &status); - else - { - fits_write_record (fptr, card2.substr(0,80).c_str(), &status); - card2=card2.substr(80,string::npos); - card2.insert(0,"HISTORY "); - fits_write_record (fptr, card2.c_str(),&status); - } - } - check_errors(); - } - if (status==KEY_NO_EXIST) { fits_clear_errmsg(); status=0; } - check_errors(); - } - -void fitshandle::copy_header (const fitshandle &orig) - { - const char *inclist[] = { "*" }; - const char *exclist[] = { - "SIMPLE","BITPIX","NAXIS","NAXIS#","PCOUNT","GCOUNT", - "EXTEND","ORIGIN","DATE*","TFIELDS","TTYPE#","TFORM#", - "TUNIT#","EXTNAME","CTYPE#","CRVAL#","CRPIX#","CDELT#", - "XTENSION","INSTRUME","TELESCOP","PDMTYPE","TBCOL#" }; - char card[81]; - string card2; - orig.assert_connected("fitshandle::copy_header()"); - assert_connected("fitshandle::copy_header()"); - fits_read_record (orig.fptr, 0, card, &status); - check_errors(); - while (true) - { - fits_find_nextkey (orig.fptr, const_cast(inclist), 1, - const_cast(exclist), 23, card, &status); - if (status!=0) break; - card2=trim(card); - if (card2!="END" && card2!="COMMENT" && card2!="HISTORY") - fits_write_record (fptr, card, &status); - check_errors(); - } - if (status==KEY_NO_EXIST) { fits_clear_errmsg(); status=0; } - check_errors(); - } - -void fitshandle::get_all_keys(vector &keys) const - { - keys.clear(); - char card[81]; - const char *inclist[] = { "*" }; - assert_connected("fitshandle::get_all_keys()"); - fits_read_record (fptr, 0, card, &status); - check_errors(); - while (true) - { - fits_find_nextkey (fptr, const_cast(inclist), 1, - 0, 0, card, &status); - if (status!=0) break; - if (fits_get_keyclass(card)==TYP_USER_KEY) - { - char keyname[80]; - int dummy; - fits_get_keyname(card, keyname, &dummy, &status); - check_errors(); - keys.push_back(keyname); - } - check_errors(); - } - if (status==KEY_NO_EXIST) { fits_clear_errmsg(); status=0; } - check_errors(); - } - -void fitshandle::check_key_present(const string &name) const - { - char card[81]; - fits_read_card(fptr, const_cast(name.c_str()), card, &status); - if (status==KEY_NO_EXIST) - { fits_clear_errmsg(); status=0; return; } - check_errors(); -// FIXME: disabled for now; but this issue needs to be resolved! -// cerr << "Warning: key " << name << " set more than once!" << endl; - } - -template void fitshandle::add_key (const string &name, - const T &value, const string &comment) - { - assert_connected("fitshandle::add_key()"); - string name2 = fixkey(name); - check_key_present (name); - fits_write_key (fptr, FITSUTIL::DTYPE, const_cast(name2.c_str()), - const_cast(&value), const_cast(comment.c_str()), &status); - check_errors(); - } - -template void fitshandle::add_key(const string &name, - const signed char &value, const string &comment); -template void fitshandle::add_key(const string &name, - const short &value, const string &comment); -template void fitshandle::add_key(const string &name, - const int &value, const string &comment); -template void fitshandle::add_key(const string &name, - const long &value, const string &comment); -template void fitshandle::add_key(const string &name, - const long long &value, const string &comment); -template void fitshandle::add_key(const string &name, - const float &value, const string &comment); -template void fitshandle::add_key(const string &name, - const double &value, const string &comment); -template<> void fitshandle::add_key(const string &name, - const bool &value, const string &comment) - { - assert_connected("fitshandle::add_key()"); - string name2 = fixkey(name); - check_key_present (name); - int val=value; - fits_write_key (fptr, TLOGICAL, const_cast(name2.c_str()), - &val, const_cast(comment.c_str()), - &status); - check_errors(); - } -template<> void fitshandle::add_key (const string &name, - const string &value, const string &comment) - { - assert_connected("fitshandle::add_key()"); - string name2 = fixkey(name); - check_key_present (name); - fits_write_key_longstr (fptr, const_cast(name2.c_str()), - const_cast(value.c_str()), const_cast(comment.c_str()), - &status); - check_errors(); - } - -template void fitshandle::update_key (const string &name, - const T &value, const string &comment) - { - assert_connected("fitshandle::update_key()"); - string name2 = fixkey(name); - fits_update_key (fptr, FITSUTIL::DTYPE, const_cast(name2.c_str()), - const_cast(&value), const_cast(comment.c_str()), &status); - check_errors(); - } - -template void fitshandle::update_key(const string &name, - const signed char &value, const string &comment); -template void fitshandle::update_key(const string &name, - const short &value, const string &comment); -template void fitshandle::update_key(const string &name, - const int &value, const string &comment); -template void fitshandle::update_key(const string &name, - const long &value, const string &comment); -template void fitshandle::update_key(const string &name, - const long long &value, const string &comment); -template void fitshandle::update_key(const string &name, - const float &value, const string &comment); -template void fitshandle::update_key(const string &name, - const double &value, const string &comment); -template<> void fitshandle::update_key(const string &name, - const bool &value, const string &comment) - { - assert_connected("fitshandle::update_key()"); - string name2 = fixkey(name); - int val=value; - fits_update_key (fptr, TLOGICAL, const_cast(name2.c_str()), - &val, const_cast(comment.c_str()), - &status); - check_errors(); - } -template<> void fitshandle::update_key (const string &name, - const string &value, const string &comment) - { - assert_connected("fitshandle::update_key()"); - string name2 = fixkey(name); - fits_update_key_longstr (fptr, const_cast(name2.c_str()), - const_cast(value.c_str()), const_cast(comment.c_str()), - &status); - check_errors(); - } - -void fitshandle::delete_key (const string &name) - { - assert_connected("fitshandle::delete_key()"); - fits_delete_key (fptr, const_cast(name.c_str()), &status); - check_errors(); - } - -void fitshandle::add_comment(const string &comment) - { - assert_connected("fitshandle::add_comment()"); - fits_write_comment(fptr,const_cast(comment.c_str()),&status); - check_errors(); - } - -template void fitshandle::get_key - (const string &name, T &value) const - { - assert_connected("fitshandle::get_key()"); - fits_read_key (fptr, FITSUTIL::DTYPE, const_cast(name.c_str()), - &value, 0, &status); - if (status==KEY_NO_EXIST) throw Message_error - ("Fitshandle::get_key(): key "+name+" not found"); - check_errors(); - } -template void fitshandle::get_key(const string &name,signed char &value) const; -template void fitshandle::get_key(const string &name,short &value) const; -template void fitshandle::get_key(const string &name,int &value) const; -template void fitshandle::get_key(const string &name,long &value) const; -template void fitshandle::get_key(const string &name,long long &value) const; -template void fitshandle::get_key(const string &name,float &value) const; -template void fitshandle::get_key(const string &name,double &value) const; -template<> void fitshandle::get_key(const string &name,bool &value) const - { - assert_connected("fitshandle::get_key()"); - int val; - fits_read_key (fptr, TLOGICAL, const_cast(name.c_str()), &val, 0, - &status); - if (status==KEY_NO_EXIST) throw Message_error - ("Fitshandle::get_key(): key "+name+" not found"); - check_errors(); - value=val; - } -template<> void fitshandle::get_key (const string &name,string &value) const - { - char *tmp=0; - assert_connected("fitshandle::get_key()"); - fits_read_key_longstr (fptr, const_cast(name.c_str()), &tmp, 0, - &status); - if (status==KEY_NO_EXIST) throw Message_error - ("Fitshandle::get_key(): key "+name+" not found"); - check_errors(); - value=tmp; - if (tmp) free(tmp); - } - -bool fitshandle::key_present(const string &name) const - { - char card[81]; - assert_connected("fitshandle::key_present()"); - fits_read_card(fptr, const_cast(name.c_str()), card, &status); - if (status==KEY_NO_EXIST) - { fits_clear_errmsg(); status=0; return false; } - check_errors(); - return true; - } - -int fitshandle::get_key_type(const string &name) const - { - char card[81],value[81],dtype[10]; - assert_connected("fitshandle::get_key_type()"); - fits_read_card(fptr, const_cast(name.c_str()), card, &status); - check_errors(); - fits_parse_value(card,value,0,&status); - fits_get_keytype(value,dtype,&status); - check_errors(); - switch(dtype[0]) - { - case 'C' : return PLANCK_STRING; - case 'L' : return PLANCK_BOOL; - case 'I' : return PLANCK_INT64; - case 'F' : return PLANCK_FLOAT64; - default : throw Message_error ("unknown key type"); - } - } - -void fitshandle::assert_pdmtype (const string &pdmtype) const - { - string type; - get_key("PDMTYPE",type); - if (pdmtype==type) return; - cerr << "PDMTYPE " << pdmtype << " expected, but found " << type << endl; - } - -void fitshandle::read_column_raw_void - (int colnum, void *data, int type, int64 num, int64 offset) const - { - switch (type) - { - case PLANCK_INT8: - read_col (colnum, data, num, TBYTE, offset); break; - case PLANCK_INT16: - read_col (colnum, data, num, TSHORT, offset); break; - case PLANCK_INT32: - read_col (colnum, data, num, TINT, offset); break; - case PLANCK_INT64: - read_col (colnum, data, num, TLONGLONG, offset); break; - case PLANCK_FLOAT32: - read_col (colnum, data, num, TFLOAT, offset); break; - case PLANCK_FLOAT64: - read_col (colnum, data, num, TDOUBLE, offset); break; - case PLANCK_BOOL: - read_col (colnum, data, num, TLOGICAL, offset); break; - case PLANCK_STRING: - { - string *data2 = static_cast (data); - assert_table_hdu("fitshandle::read_column()",colnum); - planck_assert (num<=(nrows_-offset), - "read_column(): array too large"); - arr2b tdata(num, columns_[colnum-1].repcount()+1); - fits_read_col (fptr, TSTRING, colnum, offset+1, 1, num, - 0, tdata.p0(), 0, &status); - check_errors(); - for (long m=0;m (data); - assert_table_hdu("fitshandle::write_column()",colnum); - int stringlen = columns_[colnum-1].repcount()+1; - arr2b tdata(num, stringlen); - for (long m=0;m void fitshandle::write_image (const arr2 &data) - { - assert_image_hdu("fitshandle::write_image()"); - planck_assert (axes_.size()==2, "wrong number of dimensions"); - planck_assert (axes_[0]==data.size1(), "wrong size of dimension 1"); - planck_assert (axes_[1]==data.size2(), "wrong size of dimension 2"); - - fits_write_img (fptr, FITSUTIL::DTYPE, 1, axes_[0]*axes_[1], - const_cast(&data[0][0]), &status); - check_errors(); - } - -template void fitshandle::write_image (const arr2 &data); -template void fitshandle::write_image (const arr2 &data); -template void fitshandle::write_image (const arr2 &data); - -template void fitshandle::write_subimage - (const arr &data, int64 offset) - { - assert_image_hdu("fitshandle::write_subimage()"); - fits_write_img (fptr, FITSUTIL::DTYPE, 1+offset, - data.size(), const_cast(&data[0]), &status); - check_errors(); - } - -template void fitshandle::write_subimage (const arr &data, int64 offset); -template void fitshandle::write_subimage - (const arr &data, int64 offset); -template void fitshandle::write_subimage (const arr &data, int64 offset); - -template void fitshandle::read_image (arr2 &data) const - { - assert_image_hdu("fitshandle::read_image()"); - planck_assert (axes_.size()==2, "wrong number of dimensions"); - data.alloc(axes_[0], axes_[1]); - fits_read_img (fptr, FITSUTIL::DTYPE, 1, axes_[0]*axes_[1], 0, - &data[0][0], 0, &status); - check_errors(); - } - -template void fitshandle::read_image (arr2 &data) const; -template void fitshandle::read_image (arr2 &data) const; -template void fitshandle::read_image (arr2 &data) const; - -template void fitshandle::read_image (arr3 &data) const - { - assert_image_hdu("fitshandle::read_image()"); - planck_assert (axes_.size()==3, "wrong number of dimensions"); - data.alloc(axes_[0], axes_[1], axes_[2]); - fits_read_img (fptr, FITSUTIL::DTYPE, 1, axes_[0]*axes_[1]*axes_[2], - 0, &data(0,0,0), 0, &status); - check_errors(); - } - -template void fitshandle::read_image (arr3 &data) const; -template void fitshandle::read_image (arr3 &data) const; -template void fitshandle::read_image (arr3 &data) const; - -template void fitshandle::read_subimage - (arr2 &data, int xl, int yl) const - { - assert_image_hdu("fitshandle::read_subimage()"); - planck_assert (axes_.size()==2, "wrong number of dimensions"); - for (int m=0; m::DTYPE, (xl+m)*axes_[1]+yl+1, - data.size2(), 0, &data[m][0], 0, &status); - check_errors(); - } - -template void fitshandle::read_subimage - (arr2 &data, int xl, int yl) const; -template void fitshandle::read_subimage - (arr2 &data, int xl, int yl) const; -template void fitshandle::read_subimage - (arr2 &data, int xl, int yl) const; - -template void fitshandle::read_subimage - (arr &data, int64 offset) const - { - assert_image_hdu("fitshandle::read_subimage()"); - fits_read_img (fptr, FITSUTIL::DTYPE, 1+offset, - data.size(), 0, &data[0], 0, &status); - check_errors(); - } - -template void fitshandle::read_subimage (arr &data, int64 offset) const; -template void fitshandle::read_subimage (arr &data, int64 offset) const; -template void fitshandle::read_subimage (arr &data, int64 offset) const; - -void fitshandle::add_healpix_keys (int datasize) - { - int nside = isqrt(datasize/12); - planck_assert (12*nside*nside==datasize, "Wrong Healpix map size"); - - update_key ("PIXTYPE",string("HEALPIX"),"HEALPIX pixelisation"); - update_key ("ORDERING",string("RING"), - "Pixel ordering scheme, either RING or NESTED"); - update_key ("NSIDE",nside,"Resolution parameter for HEALPIX"); - update_key ("FIRSTPIX",0,"First pixel # (0 based)"); - update_key ("LASTPIX",datasize-1,"Last pixel # (0 based)"); - update_key ("INDXSCHM",string("IMPLICIT"), - "Indexing : IMPLICIT or EXPLICIT"); - update_key ("GRAIN",0,"Grain of pixel indexing"); - } - -namespace { - -class cfitsio_checker - { - public: - cfitsio_checker() - { - float fitsversion; - planck_assert(fits_get_version(&fitsversion), - "error calling fits_get_version()"); - planck_assert (approx(CFITSIO_VERSION,fitsversion), - "mismatch between CFITSIO header and library"); - } - }; - -static cfitsio_checker Cfitsio_Checker; - -} // namespace diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.h deleted file mode 100644 index 07bd4166ca..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/fitshandle.h +++ /dev/null @@ -1,444 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file fitshandle.h - * Declaration of the FITS I/O helper class used by LevelS - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_FITSHANDLE_H -#define PLANCK_FITSHANDLE_H - -#include -#include -#include "fitsio.h" -#include "arr.h" -#include "datatypes.h" - -/*! \defgroup fitsgroup FITS-related functionality */ -/*! \{ */ - -template struct FITSUTIL {}; - -template<> struct FITSUTIL - { enum { DTYPE=TBYTE }; }; -template<> struct FITSUTIL - { enum { DTYPE=TSHORT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TINT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TLONG }; }; -template<> struct FITSUTIL - { enum { DTYPE=TLONGLONG }; }; -template<> struct FITSUTIL - { enum { DTYPE=TFLOAT }; }; -template<> struct FITSUTIL - { enum { DTYPE=TDOUBLE }; }; - -/*! Converts a FITS type code (i.e. the data type of a FITS column) to the - corresponding Planck type code. */ -inline int ftc2type (int ftc) - { - switch (ftc) - { - case TLOGICAL : return PLANCK_BOOL; - case TBYTE : return PLANCK_INT8; - case TSHORT : return PLANCK_INT16; - case TINT32BIT: return PLANCK_INT32; - case TLONGLONG: return PLANCK_INT64; - case TFLOAT : return PLANCK_FLOAT32; - case TDOUBLE : return PLANCK_FLOAT64; - case TSTRING : return PLANCK_STRING; - default: throw Message_error ("ftc2type: unsupported component type"); - } - } - -/*! Converts a Planck type code to the corresponding FITS type code - (i.e. the data type of a FITS column). */ -inline int type2ftc (int type) - { - switch (type) - { - case PLANCK_BOOL : return TLOGICAL; - case PLANCK_INT8 : return TBYTE; - case PLANCK_INT16 : return TSHORT; - case PLANCK_INT32 : return TINT32BIT; - case PLANCK_INT64 : return TLONGLONG; - case PLANCK_FLOAT32: return TFLOAT; - case PLANCK_FLOAT64: return TDOUBLE; - case PLANCK_STRING : return TSTRING; - default: throw Message_error ("type2ftc: unsupported component type"); - } - } - -/*! Class containing information about a single column in a FITS table. */ -class fitscolumn - { - private: - std::string name_, unit_; - int64 repcount_; - int type_; - - public: - fitscolumn() - : repcount_(0), type_(-1) {} - /*! Creates a \a fitscolumn with name \a nm, unit \a un, a repetition - count of \a rc, and a FITS type code of \a tp. */ - fitscolumn (const std::string &nm, const std::string &un, int64 rc, - int tp) - : name_(nm), unit_(un), repcount_(rc), type_(tp) {} - - /*! Returns the column name. */ - const std::string &name() const {return name_;} - /*! Returns the column unit string. */ - const std::string &unit() const {return unit_;} - /*! Returns the repetition count of the column. */ - int64 repcount() const {return repcount_;} - /*! Returns the FITS type code of the column. */ - int type() const {return type_;} - }; - -/*! Class for performing I/O from/to FITS files. */ -class fitshandle - { - private: - enum { INVALID = -4711 }; - - mutable int status; - fitsfile *fptr; - int hdutype_, bitpix_; - std::vector axes_; - std::vector columns_; - int64 nrows_; - - void check_errors() const; - - void clean_data(); - void clean_all(); - - void assert_connected (const std::string &func) const - { - planck_assert (hdutype_!=INVALID, - func + ": not connected to a HDU"); - } - void assert_table_hdu (const std::string &func, unsigned int col) const - { - planck_assert ((hdutype_==ASCII_TBL) || (hdutype_==BINARY_TBL), - func + ": HDU is not a table"); - planck_assert (col>0 && col<=columns_.size(), - func + ": column number out of range"); - } - void assert_image_hdu (const std::string &func) const - { - planck_assert ((hdutype_==IMAGE_HDU), func + ": HDU is not an image"); - } - - void init_image(); - void init_asciitab(); - void init_bintab(); - void init_data(); - - void check_key_present(const std::string &name)const ; - - void read_col (int colnum, void *data, int64 ndata, int dtype, - int64 offset) const; - void write_col (int colnum, const void *data, int64 ndata, int dtype, - int64 offset); - - public: - /*! the list of modes in which a \a fitshandle can be opened. */ - typedef enum { CREATE, /*!< the file must not yet exist */ - OPEN /*!< the file must already exist */ - } openmethod; - - /*! \name File-level access and manipulation. */ - /*! \{ */ - - /*! Creates an unconnected \a fitshandle. */ - fitshandle () - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) {} - /*! Creates a \a fitshandle connected to file \a fname. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - fitshandle (const std::string &fname, openmethod mode=OPEN, - int rwmode=READONLY) - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) - { - if (mode==OPEN) - open (fname, rwmode); - else - create (fname); - } - /*! Creates a \a fitshandle connected to file \a fname and jumps directly - to the HDU with the number \a hdunum. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - fitshandle (const std::string &fname, int hdunum, int rwmode=READONLY) - : status(0), fptr(0), hdutype_(INVALID), bitpix_(INVALID), nrows_(0) - { - open (fname, rwmode); - goto_hdu (hdunum); - } - - /*! Performs all necessary cleanups. */ - ~fitshandle() { clean_all(); } - - /*! Connects to the file \a fname. - If \a rwmode == READONLY, no writing access is permitted; if it is - READWRITE, reading and writing can be performed. */ - void open (const std::string &fname, int rwmode=READONLY); - /*! Creates the file \a fname and connects to it. */ - void create (const std::string &fname); - /*! Closes the current file. */ - void close () { clean_all(); } - /*! Deletes the file with name \a name. */ - static void delete_file (const std::string &name); - /*! Jumps to the HDU with the absolute number \a hdu. */ - void goto_hdu (int hdu); - /*! Returns the number of HDUs in the file. */ - int num_hdus () const; - /*! Asserts that the PDMTYPE of the current HDU is \a pdmtype. */ - void assert_pdmtype (const std::string &pdmtype) const; - /*! Inserts a binary table described by \a cols. - The HDU has the name \a extname. */ - void insert_bintab (const std::vector &cols, - const std::string &extname="xtension"); - /*! Inserts an ASCII table described by \a cols. The width of the - columns is chosen automatically, in a way that avoids truncation. - The HDU has the name \a extname. */ - void insert_asctab (const std::vector &cols, - const std::string &extname="xtension"); - /*! Inserts a FITS image with the type given by \a btpx and dimensions - given by \a Axes. */ - void insert_image (int btpx, const std::vector &Axes); - /*! Inserts a 2D FITS image with the type given by \a btpx, whose - contents are given in \a data. */ - template - void insert_image (int btpx, const arr2 &data); - - /*! Computes the checksum for the current HDU and writes it into the - header. */ - void write_checksum(); - - /*! \} */ - - /*! \name Information about the current HDU */ - /*! \{ */ - - /*! If the current HDU is an image, returns the BITPIX parameter of that - image, else throws an exception. */ - int bitpix() const - { - assert_image_hdu ("fitshandle::bitpix()"); - return bitpix_; - } - /*! Returns the FITS type code for the current HDU. */ - int hdutype() const {return hdutype_;} - /*! Returns the dimensions of the current image. */ - const std::vector &axes() const - { - assert_image_hdu ("fitshandle::axes()"); - return axes_; - } - /*! Returns the name of column \a #i. */ - const std::string &colname(int i) const - { - assert_table_hdu("fitshandle::colname()",i); - return columns_[i-1].name(); - } - /*! Returns the unit of column \a #i. */ - const std::string &colunit(int i) const - { - assert_table_hdu("fitshandle::colunit()",i); - return columns_[i-1].unit(); - } - /*! Returns repetition count of column \a #i. */ - int64 repcount(int i) const - { - assert_table_hdu("fitshandle::repcount()",i); - return columns_[i-1].repcount(); - } - /*! Returns the FITS type code for column \a #i. */ - int coltype(int i) const - { - assert_table_hdu("fitshandle::coltype()",i); - return columns_[i-1].type(); - } - /*! Returns the number of columns in the current table. */ - int ncols() const - { - assert_table_hdu("fitshandle::ncols()",1); - return columns_.size(); - } - /*! Returns the number of rows in the current table. */ - int64 nrows() const - { - assert_table_hdu("fitshandle::nrows()",1); - return nrows_; - } - /*! Returns the total number of elements (nrows*repcount) - in column \a #i. */ - int64 nelems(int i) const - { - assert_table_hdu("fitshandle::nelems()",i); - if (columns_[i-1].type()==TSTRING) return nrows_; - return nrows_*columns_[i-1].repcount(); - } - - /*! \} */ - - /*! \name Keyword-handling methods */ - /*! \{ */ - - /*! Copies all header keywords from the current HDU of \a orig to - the current HDU of \a *this. */ - void copy_header (const fitshandle &orig); - /*! Copies all header keywords from the current HDU of \a orig to - the current HDU of \a *this, prepending a HISTORY keyword to - every line. */ - void copy_historified_header (const fitshandle &orig); - - /*! Returns a list of all user-defined keys in the current HDU - in \a keys. */ - void get_all_keys (std::vector &keys) const; - - /*! Adds a new header line consisting of \a key, \a value and - \a comment. */ - template void add_key (const std::string &name, const T &value, - const std::string &comment=""); - /*! Updates \a key with \a value and \a comment. */ - template void update_key (const std::string &name, - const T &value, const std::string &comment=""); - /*! Deletes \a key from the header. */ - void delete_key (const std::string &name); - /*! Adds \a comment as a comment line. */ - void add_comment (const std::string &comment); - /*! Reads the value belonging to \a key and returns it in \a value. */ - template void get_key (const std::string &name, T &value) const; - /*! Returms the value belonging to \a key. */ - template T get_key (const std::string &name) const - { T tmp; get_key(name, tmp); return tmp; } - /*! Returns \a true if \a key is present, else \a false. */ - bool key_present (const std::string &name) const; - /*! Returns the Planck type code for the key \a name. */ - int get_key_type(const std::string &name) const; - - /*! \} */ - - /*! \name Methods for table data I/O */ - /*! \{ */ - - void read_column_raw_void - (int colnum, void *data, int type, int64 num, int64 offset=0) const; - /*! Copies \a num elements from column \a colnum to the memory pointed - to by \a data, starting at offset \a offset in the column. */ - template void read_column_raw - (int colnum, T *data, int64 num, int64 offset=0) const - { read_column_raw_void (colnum, data, typehelper::id, num, offset); } - /*! Fills \a data with elements from column \a colnum, - starting at offset \a offset in the column. */ - template void read_column - (int colnum, arr &data, int64 offset=0) const - { read_column_raw (colnum, &(data[0]), data.size(), offset); } - /*! Reads the element \a #offset from column \a colnum into \a data. */ - template void read_column - (int colnum, T &data, int64 offset=0) const - { read_column_raw (colnum, &data, 1, offset); } - /* Reads the whole column \a colnum into \a data (which is resized - accordingly). */ - template void read_entire_column - (int colnum, arr &data) const - { data.alloc(nelems(colnum)); read_column (colnum, data); } - - - void write_column_raw_void - (int colnum, const void *data, int type, int64 num, int64 offset=0); - /*! Copies \a num elements from the memory pointed to by \a data to the - column \a colnum, starting at offset \a offset in the column. */ - template void write_column_raw - (int colnum, const T *data, int64 num, int64 offset=0) - { write_column_raw_void (colnum, data, typehelper::id, num, offset); } - /*! Copies all elements from \a data to the - column \a colnum, starting at offset \a offset in the column. */ - template void write_column - (int colnum, const arr &data, int64 offset=0) - { write_column_raw (colnum, &(data[0]), data.size(), offset); } - /*! Copies \a data to the column \a colnum, at the position \a offset. */ - template void write_column - (int colnum, const T &data, int64 offset=0) - { write_column_raw (colnum, &data, 1, offset); } - - /*! \} */ - - /*! \name Methods for image data I/O */ - /*! \{ */ - - /*! Reads the current image into \a data, which is resized accordingly. */ - template void read_image (arr2 &data) const; - /*! Reads the current image into \a data, which is resized accordingly. */ - template void read_image (arr3 &data) const; - /*! Reads a partial image, whose dimensions are given by the dimensions - of \a data, into data. The starting pixel indices are given by - \a xl and \a yl. */ - template void read_subimage - (arr2 &data, int xl, int yl) const; - /*! Fills \a data with values from the image, starting at the offset - \a offset in the image. The image is treated as a one-dimensional - array. */ - template void read_subimage (arr &data, int64 offset=0) - const; - /*! Writes \a data into the current image. \a data must have the same - dimensions as specified in the HDU. */ - template void write_image (const arr2 &data); - /*! Copies \a data to the image, starting at the offset - \a offset in the image. The image is treated as a one-dimensional - array. */ - template void write_subimage (const arr &data, - int64 offset=0); - - /*! \} */ - - void add_healpix_keys (int datasize); - }; - -/*! \} */ - -// announce the specialisations -template<> void fitshandle::add_key(const std::string &name, - const bool &value, const std::string &comment); -template<> void fitshandle::add_key (const std::string &name, - const std::string &value, const std::string &comment); -template<> void fitshandle::update_key(const std::string &name, - const bool &value, const std::string &comment); -template<> void fitshandle::update_key (const std::string &name, - const std::string &value, const std::string &comment); -template<> void fitshandle::get_key(const std::string &name,bool &value) const; -template<> void fitshandle::get_key (const std::string &name, - std::string &value) const; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/font_data.inc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/font_data.inc deleted file mode 100644 index 576ab57f1c..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/font_data.inc +++ /dev/null @@ -1,3848 +0,0 @@ -#ifndef PLANCK_FONT_DATA_INC -#define PLANCK_FONT_DATA_INC - -const char medium_bold_font_data[] = { -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -1,1,1,1,1,1,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,1,1,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,1,1,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -1,1,0,1,1,0,0, -1,1,0,1,1,0,0, -1,1,1,1,1,0,0, -1,1,0,1,1,0,0, -1,1,0,1,1,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,1,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -1,1,1,1,0,0,0, -1,1,0,0,0,0,0, -1,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,1,0, -0,0,1,1,1,0,0, -0,0,1,1,0,1,0, -0,0,1,1,0,1,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,1,0,1,1,0, -1,1,1,1,1,1,0, -1,1,0,1,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,1,1,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,0,0,1,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,1,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,0,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,0,0,0, -1,1,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,0,0,0, -1,1,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,1,1, -0,0,1,1,1,1,1, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,1,1,1, -0,0,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,1,1,1, -0,0,1,1,1,1,1, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,0,0,0, -1,1,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,1, -1,1,1,1,1,1,1, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,0,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,0,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,1,1,0,1,1,0, -0,1,1,0,1,1,0, -0,1,1,0,1,1,0, -1,1,1,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,1,0, -0,0,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,0,0,0, -1,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,1,1,0,1,1,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -1,1,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,1,1,0, -1,0,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,0,1,1,0, -0,1,1,0,1,1,0, -0,1,1,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,0,1,0,0, -0,0,1,0,1,0,0, -0,1,1,1,1,1,0, -0,1,1,1,1,1,0, -0,0,1,0,1,0,0, -0,1,1,1,1,1,0, -0,1,1,1,1,1,0, -0,0,1,0,1,0,0, -0,0,1,0,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -1,0,1,1,0,1,0, -1,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,1,0, -1,0,1,1,0,1,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,0,0,1,0, -1,0,1,0,1,1,0, -1,1,1,0,1,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,0,1,1,1,0, -1,1,0,1,0,1,0, -1,0,0,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -1,1,0,1,1,0,0, -1,1,0,1,1,0,0, -1,1,0,1,1,0,0, -0,1,1,1,0,0,0, -1,1,0,1,0,1,0, -1,1,0,1,1,1,0, -1,1,0,1,1,0,0, -0,1,1,1,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,0,0,1,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -0,1,0,0,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,0,0,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,0,0,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,0,0,0, -1,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,1,1,1,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,1,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,1,1,1,0, -0,0,1,1,1,1,0, -0,1,1,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,0,0,0,1,1,0, -1,0,0,0,1,1,0, -1,0,1,1,1,1,0, -1,0,1,0,1,1,0, -1,0,1,1,1,1,0, -1,0,0,0,0,0,0, -1,0,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,1,0, -1,1,0,0,1,1,0, -1,1,0,1,1,0,0, -1,1,1,1,0,0,0, -1,1,1,0,0,0,0, -1,1,1,1,0,0,0, -1,1,0,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,0,0,0,0,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,0,1,1,0, -1,1,1,0,1,1,0, -1,1,1,1,1,1,0, -1,1,0,1,1,1,0, -1,1,0,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,0,1,1,0, -1,1,0,1,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -1,1,1,1,0,0,0, -1,1,0,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,0,0,1,0,0, -0,1,0,0,1,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,0,0,0,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,0,0,0,0,1,0, -1,1,0,0,1,1,0, -0,1,0,0,1,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -0,1,0,0,1,0,0, -1,1,0,0,1,1,0, -1,0,0,0,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,0,0,0,0,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -0,1,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -0,0,0,0,1,1,0, -0,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,1,1,0,1,1,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -1,1,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -1,1,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,1,1,0,0, -1,1,1,1,0,0,0, -1,1,1,1,0,0,0, -1,1,0,1,1,0,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,1,1,0,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, -0,0,0,0,1,1,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -0,1,1,0,0,0,0, -0,0,0,1,1,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,0,0,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,1,1,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,1,1,1,1,0, -1,1,1,1,1,1,0, -0,1,0,0,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, -0,1,1,1,1,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,1,0, -0,0,0,0,1,1,0, -1,1,0,0,1,1,0, -0,1,1,1,1,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,1,1,0, -0,0,0,1,1,0,0, -0,1,1,0,0,0,0, -1,1,0,0,0,0,0, -1,1,1,1,1,1,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,1,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,0,0,0, -0,1,1,0,0,0,0, -0,1,1,0,0,0,0, -0,0,1,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,1,1,0,0,0, -0,0,0,1,1,0,0, -0,0,0,1,1,0,0, -0,1,1,1,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,1,1,0,0,1,0, -1,1,1,1,1,1,0, -1,0,0,1,1,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, -0,0,0,0,0,0,0, - -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0, -0,0,1,0,1,0,0, -0,1,0,1,0,1,0 -}; - -const char giant_font_data[] = { -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,1,1,1,1,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,1,1,0,1,1, -0,0,1,1,0,0,1,1,0, -0,1,1,0,1,1,0,1,1, -0,0,1,1,0,0,1,1,0, -0,1,1,0,1,1,0,1,1, -0,0,1,1,0,0,1,1,0, -0,1,1,0,1,1,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,1,1,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,1,1, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,0,0, -0,1,1,0,0,0,1,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,1,0,0, -0,0,1,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,0,1,1,0,0,1,1, -0,0,0,1,1,1,1,1,0, -0,0,0,1,1,0,0,1,1, -0,0,0,1,1,0,0,1,1, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,1,0,1,1,0,0, -0,1,1,1,1,1,1,0,0, -0,1,1,0,1,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,0,1,1,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,1,1, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -1,1,1,1,1,1,0,0,0, -1,1,1,1,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,0,0,0, -1,1,1,1,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -1,1,1,1,1,1,0,0,0, -1,1,1,1,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,1,1,1, -0,0,0,0,1,1,1,0,0, -0,0,1,1,1,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,0,0,0,0, -0,0,0,0,1,1,1,0,0, -0,0,0,0,0,0,1,1,1, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,0,0,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,0,0,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,1,1,1,0, -0,0,0,1,1,1,0,0,0, -0,1,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,1,0,0,1,1,0, -0,0,0,1,0,0,1,1,0, -0,0,0,1,0,0,1,1,0, -0,1,1,1,0,0,1,1,0, -0,1,1,1,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,0,1,1,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,1,1,0,0,1,1, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,1,1,1,1,1,0,0,0, -0,1,0,1,1,1,1,1,1, -0,1,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,0,1,1,0, -0,0,0,1,1,0,1,1,0, -0,0,0,1,1,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,0,1,1,0,0, -0,0,1,1,0,1,1,0,0, -0,1,1,1,1,1,1,1,0, -0,0,1,1,0,1,1,0,0, -0,0,1,1,0,1,1,0,0, -0,1,1,1,1,1,1,1,0, -0,0,1,1,0,1,1,0,0, -0,0,1,1,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,1,1,0,1,0,1,1, -0,0,1,1,0,1,0,0,0, -0,0,1,1,1,1,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,0,0,0,1,1,1,1, -0,0,0,0,0,1,0,1,1, -0,0,1,1,0,1,0,1,1, -0,0,0,1,1,1,1,1,0, -0,0,0,0,0,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,0,0,0,1,1, -0,1,1,1,1,0,1,1,0, -0,1,1,1,1,0,1,1,0, -0,0,1,1,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,1,1,0, -0,0,1,1,0,1,1,1,1, -0,0,1,1,0,1,1,1,1, -0,1,1,0,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,0,0, -0,0,1,1,1,1,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,1,1,1,1, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,1,1,1,0, -0,0,1,1,1,1,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,0,1,1,1,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,0,0,0,0, -0,1,1,0,1,0,1,1,0, -0,0,1,1,1,1,1,0,0, -0,0,0,1,1,1,0,0,0, -0,1,1,1,0,1,1,1,0, -0,0,0,1,1,1,0,0,0, -0,0,1,1,1,1,1,0,0, -0,1,1,0,1,0,1,1,0, -0,0,0,0,1,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,1,1,1,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,1,1,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,1,1,1,0,0,0, -0,0,1,1,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,1,0, -0,0,0,0,1,1,1,1,0, -0,0,0,1,1,0,1,1,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,1,1,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,1,1,1, -0,0,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,1,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,1,1,1,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,1,1,1,1,1, -0,1,1,1,1,0,0,1,1, -0,1,1,1,1,0,1,1,1, -0,1,1,0,1,1,1,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,1,1,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,1,1,1,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,1,1,1,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,1,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,1,1,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,0,1,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,1,1,0,0,0, -0,1,1,1,1,0,0,0,0, -0,1,1,1,1,0,0,0,0, -0,1,1,0,1,1,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,0,0,1,1,1, -0,1,1,1,1,1,1,1,1, -0,1,1,1,1,1,1,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,0,0,0,1,1, -0,1,1,1,1,0,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,0,1,1,1,1, -0,1,1,0,0,0,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,0,1,1,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,1,1,0,1,1,0,0,0, -0,1,1,0,0,1,1,0,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,1,1,0,0,1,1,0, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,1,1,1,1,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,1,1,0,0, -0,0,1,1,1,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -1,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,1,1,1, -0,0,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,1, -0,1,1,0,0,0,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,1,1,1, -0,0,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,1,1,1,1,1, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,1,1,0,0,1,1, -0,0,0,1,1,0,0,1,1, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,1,1,1,1,1,1,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,1, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,0,1,1,1,1,1,0,0, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,0,1,1,1,1,1,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,1,1,1,0, -0,1,1,1,1,1,0,0,0, -0,1,1,1,0,0,0,0,0, -0,1,1,1,1,1,0,0,0, -0,1,1,0,0,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,1,1,1,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,1,0,0,0,1,1, -0,1,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, -0,1,1,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,1, -0,1,1,0,0,0,1,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,1,1,1, -0,0,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, -0,0,0,0,0,0,0,1,1, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,1,1,1,1,0, -0,0,1,1,1,0,0,1,1, -0,0,1,1,0,0,0,1,1, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,0,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,1,1,1,1,1,1,1,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,1,1,0,0,1,1, -0,0,0,0,1,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,0,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,1,1,0,0,0,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,1,1,1,1,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,0,1,1, -0,0,1,1,0,0,1,1,0, -0,0,0,1,1,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,1,1,0,0, -0,0,1,1,0,0,1,1,0, -0,1,1,0,0,0,0,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,1,1,0,0,1,1,1,0, -0,0,1,1,1,1,1,1,0, -0,0,0,0,0,0,1,1,0, -0,1,1,0,0,0,1,1,0, -0,0,1,1,1,1,1,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,1,1,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,1,1,0,0,0,0,0, -0,1,1,1,1,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1,1,1,1, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,1,1,1,0,0,0, -0,0,0,0,0,1,1,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,1,1,1,1, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,1,1,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,1,0,0, -0,0,0,0,1,1,1,0,0, -0,0,0,1,1,0,0,0,0, -0,0,0,0,1,1,0,0,0, -0,0,0,0,1,1,0,0,0, -0,1,1,1,1,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,1,1,1,0,0,1,1, -0,1,1,0,1,1,0,1,1, -0,1,1,0,0,1,1,1,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, - -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0 -}; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/geom_utils.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/geom_utils.h deleted file mode 100644 index 67b61ba604..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/geom_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file geom_utils.h - * Geometric utility functions. - * - * Copyright (C) 2003, 2006 Max-Planck-Society - * \author Martin Reinecke - * \author Reinhard Hell - */ - -#include "cxxutils.h" -#include "vec3.h" - -/*! Returns the orientation when looking from point \a loc on the unit - sphere in the direction \a dir. \a loc must be normalized. The result - ranges from -pi to pi, is 0 for North and pi/2 for West, i.e. the angle - is given in mathematically positive sense. - - If \a loc is the North or South pole, the returned angle is - \a atan2(dir.y,dir.x). */ -inline double orientation (const vec3 &loc, const vec3 &dir) - { -// FIXME: here is still optimization potential - if (loc.x==0 && loc.y==0) - { - if (loc.z>0) return safe_atan2(dir.y,-dir.x); - else return safe_atan2(dir.y,dir.x); - } - vec3 east (-loc.y, loc.x, 0); - vec3 north = crossprod(loc,east); - double y = dotprod(dir,east); - double x = dotprod(dir,north); - return safe_atan2(-y,x); - } - -/*! Returns the angle between \a v1 and \a v2 in radians. */ -inline double v_angle (const vec3 &v1, const vec3 &v2) - { - return atan2 (crossprod(v1,v2).Length(), dotprod(v1,v2)); - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/lsconstants.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/lsconstants.h deleted file mode 100644 index c26d1b6899..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/lsconstants.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file lsconstants.h - * Mathematical, physical and technical constants for LevelS. - */ - -#ifndef PLANCK_CONSTANTS_H -#define PLANCK_CONSTANTS_H - -#include - -/*! \defgroup mathconstgroup Mathematical constants */ -/*! \{ */ - -const double pi=3.141592653589793238462643383279502884197; -const double twopi=6.283185307179586476925286766559005768394; -const double inv_twopi=1.0/twopi; -const double fourpi=12.56637061435917295385057353311801153679; -const double halfpi=1.570796326794896619231321691639751442099; -const double inv_halfpi=0.6366197723675813430755350534900574; -const double inv_sqrt4pi = 0.2820947917738781434740397257803862929220; - -const double ln2 = 0.6931471805599453094172321214581766; -const double inv_ln2 = 1.4426950408889634073599246810018921; -const double ln10 = 2.3025850929940456840179914546843642; - -const double onethird=1.0/3.0; -const double twothird=2.0/3.0; -const double fourthird=4.0/3.0; - -const double degr2rad=pi/180.0; -const double rad2degr=180.0/pi; - -//! Ratio between FWHM and sigma of a Gauss curve (\f$\sqrt{8\ln2}\f$). -const double sigma2fwhm=2.3548200450309493; // sqrt(8*log(2.)) -const double fwhm2sigma=1/sigma2fwhm; - -/*! \} */ - -/*! \defgroup physconstgroup Physical constants */ -/*! \{ */ - -const double Jansky2SI=1.0e-26; -const double SI2Jansky=1.0e+26; - -//! Light speed in m/s. -const double speedOfLight=2.99792458e8; - -//! Boltzmann's constant in J/K -const double kBoltzmann=1.380658e-23; - -//! Stefan-Boltzmann constant in W/m^2/K^4 -const double sigmaStefanBoltzmann=5.67051e-8; - -//! Planck's constant in J s -const double hPlanck=6.6260755e-34; - -//! Astronomical unit in m -const double astronomicalUnit=1.49597893e11; - -//! Solar constant in W/m^2 -const double solarConstant=1368.0; - -//! Tropical year in s -const double tropicalYear=3.15569259747e7; - -//! Average CMB temperature in K -const double tcmb = 2.726; - -//! Colatitude of the solar system motion relative to CMB -//! (ecliptical coordinates). -const double solsysdir_ecl_theta = 1.7678013480275747; - -//! Longitude of the solar system motion relative to CMB -//! (ecliptical coordinates). -const double solsysdir_ecl_phi = 3.0039153062803194; - -//! Speed of the solar system motion relative to CMB in m/s. -const double solsysspeed = 371000.0; - -/*! \} */ - -// technical constants - -//! Healpix value representing "undefined" -const double Healpix_undef=-1.6375e30; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/message_error.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/message_error.h deleted file mode 100644 index 39bc39bfda..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/message_error.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for error reporting - * - * Copyright (C) 2003, 2004 Max-Planck-Society - * Authors: Reinhard Hell, Martin Reinecke - */ - -#ifndef PLANCK_MESSAGE_ERROR_H -#define PLANCK_MESSAGE_ERROR_H - -#include -#include -#include - -#if defined (PLANCK_STACKTRACE) -#include -#endif - -inline void show_stackframe() - { -#if defined (PLANCK_STACKTRACE) - void *trace[16]; - int trace_size = backtrace(trace, 16); - char **messages = backtrace_symbols(trace, trace_size); - std::cerr << "[bt] Execution path:" << std::endl; - for (int i=0; i -#endif - -inline bool openmp_enabled() - { -#ifdef _OPENMP - return true; -#else - return false; -#endif - } - -inline int openmp_max_threads () - { -#ifdef _OPENMP - return omp_get_max_threads(); -#else - return 1; -#endif - } - -inline int openmp_thread_num () - { -#ifdef _OPENMP - return omp_get_thread_num(); -#else - return 0; -#endif - } - -/*! Calculates the range of indices between \a glo and \a ghi which - must be processed by this thread and returns it in \a lo and \a hi. - - The indices \a ghi and \a hi are "one past the last real index", - in analogy to the STL iterators. */ -inline void openmp_calc_share (int glo, int ghi, int &lo, int &hi) - { -#ifdef _OPENMP - int nwork = ghi-glo; - int nproc = omp_get_num_threads(); - int me = omp_get_thread_num(); - int nbase = nwork/nproc; - int additional = nwork%nproc; - lo = glo+me*nbase + ((me -#include -#include -#include -#include "simparams.h" -#include "cxxutils.h" - -class paramfile - { - private: - typedef std::map params_type; - params_type params; - mutable std::set read_params; - bool verbose; - - std::string get_valstr(const std::string &key) const - { - params_type::const_iterator loc=params.find(key); - if (loc!=params.end()) return loc->second; - throw Message_error ("Error: Cannot find the key \"" + key + "\"."); - } - - public: - paramfile (const std::string &filename, bool verbose_=true) - : verbose(verbose_) - { parse_file (filename, params); } - - paramfile (const params_type &par) - : params (par), verbose(true) - {} - - ~paramfile () - { - if (verbose) - for (params_type::const_iterator loc=params.begin(); - loc!=params.end(); ++loc) - if (read_params.find(loc->first)==read_params.end()) - std::cout << "Parser warning: unused parameter " - << loc->first << std::endl; - } - - bool param_present(const std::string &key) const - { return (params.find(key)!=params.end()); } - - template T find (const std::string &key) const - { - T result; - stringToData(get_valstr(key),result); - if (verbose) - std::cout << "Parser: " << key << " = " << dataToString(result) - << std::endl; - read_params.insert(key); - return result; - } - template T find - (const std::string &key, const T &deflt) - { - if (param_present(key)) return find(key); - if (verbose) - std::cout << "Parser: " << key << " = " << dataToString(deflt) - << " " << std::endl; - params[key]=dataToString(deflt); - read_params.insert(key); - return deflt; - } - - const params_type &getParams() const - { return params; } - - template void findParam - (const std::string &key, T &value) const - { value = find(key); } - - template void findHeaderParam(const std::string& key, - T& value, simparams& headerParams, const std::string& headerKey, - const std::string& headerComment) const - { - findParam(key, value); - headerParams.add(key, headerKey, dataToString(value), headerComment); - } - void findSourceParam(const std::string& key, std::string& value, - simparams& headerParams) const - { - findParam(key, value); - headerParams.add_source_file(value); - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/planck_rng.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/planck_rng.h deleted file mode 100644 index 9231daab01..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/planck_rng.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file planck_rng.h - * This file contains the random number generator - * used by the Planck LevelS package. - * The generator is a C++ port of the xorshift generator xor128() described - * in Marsaglia, Journal of Statistical Software 2003, vol 8. - * It has a period of 2^128 - 1. - * - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_RNG_H -#define PLANCK_RNG_H - -#include -#include "cxxutils.h" - -/*! C++ port of the xorshift generator xor128() described in Marsaglia, - Journal of Statistical Software 2003, vol 8. - It has a period of 2^128 - 1. */ -class planck_rng - { - private: - unsigned int x,y,z,w; - double small, gset; - bool empty; - - void twiddle (unsigned int &v) - { - for (int i=0; i<9; ++i) - { - v ^= v<<13; - v ^= v>>17; - v ^= v<<5; - } - } - - void init_rng () - { - // avoid zero seeds - if (x==0) x = 123456789; - if (y==0) y = 362436069; - if (z==0) z = 521288629; - if (w==0) w = 88675123; - - // shuffle the bits of the seeds - twiddle(x); twiddle(y); twiddle(z); twiddle(w); - - // burn in the RNG - for (int i=0; i<16; ++i) - int_rand_uni(); - } - - public: - /*! Initializes the generator with 0 to 4 seed values. */ - planck_rng (unsigned int x1=123456789, unsigned int y1=362436069, - unsigned int z1=521288629, unsigned int w1=88675123) - : x(x1), y(y1), z(z1), w(w1), - small(1./(1.+double(0xFFFFFFFF))), empty(true) - { - planck_assert (sizeof(unsigned int)==4, "wrong integer size for RNG"); - init_rng(); - } - - /*! Re-initializes the generator with 0 to 4 seed values. */ - void seed (unsigned int x1=123456789, unsigned int y1=362436069, - unsigned int z1=521288629, unsigned int w1=88675123) - { - x = x1; y = y1; z = z1; w = w1; - empty = true; - init_rng(); - } - - /*! Returns uniformly distributed random integer numbers from the - interval [0;0xFFFFFFFF]. */ - unsigned int int_rand_uni() - { - unsigned int t = x^(x<<11); - x = y; - y = z; - z = w; - - return w=(w^(w>>19))^(t^(t>>8)); - } - - //! Returns uniformly distributed random numbers from the interval [0;1[. - double rand_uni() - { - return small*int_rand_uni(); - } - - //! Returns random numbers with Gaussian distribution (mean=0, sigma=1). - /*! Uses rand_uni() internally. */ - double rand_gauss() - { - using namespace std; - if (empty) - { - double v1,v2,rsq; - do - { - v1=2*rand_uni()-1.; - v2=2*rand_uni()-1.; - rsq=v1*v1+v2*v2; - } - while ((rsq>=1) || (rsq==0)); - double fac=sqrt(-2*log(rsq)/rsq); - gset=v1*fac; - empty=false; - return v2*fac; - } - else - { - empty=true; - return gset; - } - } - - //! Returns exponentially distributed random numbers (mean=1, nonnegative) - /*! Uses rand_uni() internally. */ - double rand_exp() - { - using namespace std; - double val=rand_uni(); - if (val==0.) val=1.; - return -log(val); - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/pointing.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/pointing.h deleted file mode 100644 index e32a32525a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/pointing.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file pointing.h - * Class representing a direction in 3D space - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_POINTING_H -#define PLANCK_POINTING_H - -#include -#include "vec3.h" -#include "cxxutils.h" - -/*! \defgroup pointinggroup Pointings */ -/*! \{ */ - -/*! Class representing a direction in 3D space or a location on the - unit sphere. */ -class pointing - { - public: - /*! Colatitude of the pointing (i.e. the North pole is at \a theta=0). */ - double theta; - /*! Longitude of the pointing. */ - double phi; - - /*! Default constructor. \a theta and \a phi are not initialized. */ - pointing() {} - /*! Creates a pointing with \a Theta and \a Phi. */ - pointing (double Theta, double Phi) : theta(Theta), phi(Phi) {} - -// FIXME: should become "explicit" some time - /*! Creates a pointing from the vector \a inp. \a inp need not be - normalized. */ - pointing (const vec3 &inp) - { - using namespace std; - theta = atan2(sqrt(inp.x*inp.x+inp.y*inp.y),inp.z); - phi = safe_atan2 (inp.y,inp.x); - if (phi<0) phi += twopi; - } -// FIXME: should be removed some time - /*! Returns a normalized vector pointing in the same direction. */ - operator vec3() const - { - double st=sin(theta); - return vec3 (st*cos(phi), st*sin(phi), cos(theta)); - } - /*! Returns a normalized vector pointing in the same direction. */ - vec3 to_vec3() const - { - double st=sin(theta); - return vec3 (st*cos(phi), st*sin(phi), cos(theta)); - } - /*! Changes the angles so that \a 0<=theta<=pi and \a 0<=phi<2*pi. */ - void normalize() - { - theta=fmodulo(theta,twopi); - if (theta>pi) - { - phi+=pi; - theta=twopi-theta; - } - phi=fmodulo(phi,twopi); - } - }; - -/*! Converts \a vec to \a ptg. \a vec need not be normalized. - \relates pointing */ -inline void vec2pnt(const vec3 &vec, pointing &ptg) - { - using namespace std; - ptg.theta = atan2(sqrt(vec.x*vec.x+vec.y*vec.y),vec.z); - ptg.phi = safe_atan2 (vec.y,vec.x); - if (ptg.phi<0) ptg.phi += twopi; - } - -/*! Writes \a p to \a os. - \relates pointing */ -inline std::ostream &operator<< (std::ostream &os, const pointing &p) - { - os << p.theta << ", " << p.phi << std::endl; - return os; - } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.cc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.cc deleted file mode 100644 index ccedc4f4f0..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.cc +++ /dev/null @@ -1,179 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for rotation transforms in 3D space - * - * Copyright (C) 2003 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "rotmatrix.h" -#include "vec3.h" -#include "lsconstants.h" -#include - -using namespace std; - -rotmatrix::rotmatrix (const vec3 &a, const vec3 &b, const vec3 &c) - { - entry[0][0]=a.x; entry[0][1]=b.x; entry[0][2]=c.x; - entry[1][0]=a.y; entry[1][1]=b.y; entry[1][2]=c.y; - entry[2][0]=a.z; entry[2][1]=b.z; entry[2][2]=c.z; - } - -void rotmatrix::SetToIdentity () - { - entry[0][0] = entry[1][1] = entry[2][2] = 1.; - entry[0][1] = entry[1][0] = entry[0][2] = - entry[2][0] = entry[1][2] = entry[2][1] = 0.; - } - -void rotmatrix::SetToZero () - { - for (int m=0; m<3; ++m) - entry[m][0] = entry[m][1] = entry[m][2] = 0; - } - -void rotmatrix::Transpose () - { - swap(entry[0][1], entry[1][0]); - swap(entry[0][2], entry[2][0]); - swap(entry[1][2], entry[2][1]); - } - -void rotmatrix::toAxisAngle (vec3 &axis, double &angle) const - { - double c2 = entry[0][0] + entry[1][1] + entry[2][2] - 1; - axis.x = entry[2][1] - entry[1][2]; - axis.y = entry[0][2] - entry[2][0]; - axis.z = entry[1][0] - entry[0][1]; - - double s2 = axis.Length(); - - if (s2>0) - { - angle = atan2(s2,c2); - axis *= 1/s2; - return; - } - - if (c2>=2) // angle is 0 - { - axis = vec3(1,0,0); - angle = 0; - return; - } - - angle = pi; - - int choice = 0; // assume entry[0][0] is the largest - if ((entry[1][1]>entry[0][0]) && (entry[1][1]>entry[2][2])) choice=1; - if ((entry[2][2]>entry[0][0]) && (entry[2][2]>entry[1][1])) choice=2; - - if (choice==0) - { - axis.x = 0.5*sqrt(entry[0][0]-entry[1][1]-entry[2][2]+1); - double half_inv = 0.5/axis.x; - axis.y = half_inv*entry[0][1]; - axis.z = half_inv*entry[0][2]; - return; - } - if (choice==1) - { - axis.y = 0.5*sqrt(entry[1][1]-entry[0][0]-entry[2][2]+1); - double half_inv = 0.5/axis.y; - axis.x = half_inv*entry[0][1]; - axis.z = half_inv*entry[1][2]; - return; - } - - axis.z = 0.5*sqrt(entry[2][2]-entry[0][0]-entry[1][1]+1); - double half_inv = 0.5/axis.z; - axis.x = half_inv*entry[0][2]; - axis.y = half_inv*entry[1][2]; - } - -void rotmatrix::Make_CPAC_Euler_Matrix - (double alpha, double beta, double gamma) - { - double ca=cos(alpha), cb=cos(beta), cg=cos(gamma); - double sa=sin(alpha), sb=sin(beta), sg=sin(gamma); - - entry[0][0]= ca*cb*cg-sa*sg; entry[0][1]=-ca*cb*sg-sa*cg; entry[0][2]= ca*sb; - entry[1][0]= sa*cb*cg+ca*sg; entry[1][1]=-sa*cb*sg+ca*cg; entry[1][2]= sa*sb; - entry[2][0]=-sb*cg; entry[2][1]= sb*sg; entry[2][2]= cb; - } - -void rotmatrix::Extract_CPAC_Euler_Angles - (double &alpha, double &beta, double &gamma) const - { - double cb = entry[2][2]; - double sb = sqrt(entry[0][2]*entry[0][2] + entry[1][2]*entry[1][2]); - beta=atan2(sb,cb); - if (abs(sb)<=1e-6) - { - alpha=0; - if (cb>0) - gamma=atan2(entry[1][0],entry[0][0]); - else - gamma=atan2(entry[0][1],-entry[0][0]); - } - else - { - alpha=atan2(entry[1][2],entry[0][2]); - gamma=atan2(entry[2][1],-entry[2][0]); - } - } - -rotmatrix operator* (const rotmatrix &a, const rotmatrix &b) - { - rotmatrix res; - for (int i=0; i<3; ++i) - for (int j=0; j<3; ++j) - res.entry[i][j] = a.entry[i][0] * b.entry[0][j] - + a.entry[i][1] * b.entry[1][j] - + a.entry[i][2] * b.entry[2][j]; - return res; - } - -void TransposeTimes (const rotmatrix &a, const rotmatrix &b, rotmatrix &res) - { - for (int i=0; i<3; ++i) - for (int j=0; j<3; ++j) - res.entry[i][j] = a.entry[0][i] * b.entry[0][j] - + a.entry[1][i] * b.entry[1][j] - + a.entry[2][i] * b.entry[2][j]; - } - -ostream &operator<< (ostream &os, const rotmatrix &mat) - { - for (int i=0;i<3;++i) - os << mat.entry[i][0] << ' ' - << mat.entry[i][1] << ' ' - << mat.entry[i][2] << endl; - return os; - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.h deleted file mode 100644 index 2db8b7d37e..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/rotmatrix.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file rotmatrix.h - * Class for rotation transforms in 3D space - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_ROTMATRIX_H -#define PLANCK_ROTMATRIX_H - -#include -#include "cxxutils.h" -#include "vec3.h" - -/*! \defgroup rotmatrixgroup Rotation matrices */ -/*! \{ */ - -/*! Class for rotation transforms in 3D space */ -class rotmatrix - { - public: - double entry[3][3]; - - rotmatrix () {} - - /*! Constructs a rotation matrix from its nine entries */ - rotmatrix (double a00, double a01, double a02, - double a10, double a11, double a12, - double a20, double a21, double a22) - { - entry[0][0]=a00; entry[0][1]=a01; entry[0][2]=a02; - entry[1][0]=a10; entry[1][1]=a11; entry[1][2]=a12; - entry[2][0]=a20; entry[2][1]=a21; entry[2][2]=a22; - } - - /*! Constructs a rotation matrix so that \a a is the first column, - \a b is the second column and \a c is the third column. - \note The vectors \a a, \a b and \a c must form an orthonormal system! - */ - rotmatrix (const vec3 &a, const vec3 &b, const vec3 &c); - - /*! Sets the matrix to the identity matrix. */ - void SetToIdentity (); - /*! Sets all matrix elements to zero. */ - void SetToZero (); - /*! Transposes the matrix. */ - void Transpose (); - - /*! Extracts a unit-length rotation axis \a axis and a rotation angle - \a angle from the matrix. */ - void toAxisAngle (vec3 &axis, double &angle) const; - - /*! Constructs a matrix which causes a rotation by \a angle around - \a axis. \a axis must have unit length. */ - void Make_Axis_Rotation_Transform (const vec3 &axis, double angle) - { - double sa=sin(angle), ca=cos(angle); - double ica=1-ca; - entry[0][0] = axis.x*axis.x*ica + ca; - entry[1][1] = axis.y*axis.y*ica + ca; - entry[2][2] = axis.z*axis.z*ica + ca; - double t1 = axis.x*axis.y*ica, t2 = axis.z*sa; - entry[1][0] = t1 + t2; - entry[0][1] = t1 - t2; - t1 = axis.x*axis.z*ica; t2 = axis.y*sa; - entry[2][0] = t1 - t2; - entry[0][2] = t1 + t2; - t1 = axis.y*axis.z*ica; t2 = axis.x*sa; - entry[1][2] = t1 - t2; - entry[2][1] = t1 + t2; - } - - /*! Creates a rotation matrix \a A, which performs the following operations - on a vector \a v, when \a Av is calculated: - -# rotate \a v around the z-axis by \a gamma, - -# rotate \a v' around the y-axis by \a beta, - -# rotate \a v'' around the z-axis by \a alpha. - - \note \a alpha, \a beta and \a gamma are given in radians, - the rotations are right handed. - - \note This transformation rotates the \e vectors, not the coordinate - axes! */ - void Make_CPAC_Euler_Matrix (double alpha, double beta, double gamma); - - /*! Extracts the Euler angles \a alpha, \a beta and \a gamma from the - matrix. For their definition see Make_CPAC_Euler_Matrix(). - - \note In case of ambiguity \a alpha will be 0. */ - void Extract_CPAC_Euler_Angles - (double &alpha, double &beta, double &gamma) const; - - /*! Returns the vector \a vec, transformed by the matrix. */ - vec3 Transform (const vec3 &vec) const - { - return vec3 - (vec.x*entry[0][0] + vec.y*entry[0][1] + vec.z*entry[0][2], - vec.x*entry[1][0] + vec.y*entry[1][1] + vec.z*entry[1][2], - vec.x*entry[2][0] + vec.y*entry[2][1] + vec.z*entry[2][2]); - } - /*! Returns the vector \a vec, transformed by the matrix, in \a vec2. */ - void Transform (const vec3 &vec, vec3 &vec2) const - { - vec2.x = vec.x*entry[0][0] + vec.y*entry[0][1] + vec.z*entry[0][2]; - vec2.y = vec.x*entry[1][0] + vec.y*entry[1][1] + vec.z*entry[1][2]; - vec2.z = vec.x*entry[2][0] + vec.y*entry[2][1] + vec.z*entry[2][2]; - } - }; - -/*! Returns \a a * \a b. - \relates rotmatrix */ -rotmatrix operator* (const rotmatrix &a, const rotmatrix &b); -/*! Returns \a a * \a b in \a res. - \relates rotmatrix */ -inline void matmult (const rotmatrix &a, const rotmatrix &b, rotmatrix &res) - { - for (int i=0; i<3; ++i) - for (int j=0; j<3; ++j) - res.entry[i][j] = a.entry[i][0] * b.entry[0][j] - + a.entry[i][1] * b.entry[1][j] - + a.entry[i][2] * b.entry[2][j]; - } - -/*! Returns \a a^T * \a b in \a res. - \relates rotmatrix */ -void TransposeTimes (const rotmatrix &a, const rotmatrix &b, rotmatrix &res); - -/*! Writes \a mat to \a os. - \relates rotmatrix */ -std::ostream &operator<< (std::ostream &os, const rotmatrix &mat); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.cc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.cc deleted file mode 100644 index 2b075205d6..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.cc +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for storing parameter information for later use - * - * Copyright (C) 2003 Max-Planck-Society - * Authors: Reinhard Hell, Martin Reinecke - */ - -#include "fitshandle.h" -#include "simparams.h" - -using namespace std; - -void simparams::add_keys (ostream &os) const - { - for (unsigned int m=0; mcomment << endl; - if (iter->key != "") - os << iter->key << "=" << iter->value << endl; - ++iter; - } - } - -void simparams::add_keys (fitshandle &out) const - { - fitshandle inp; - for (unsigned int m=0; m::const_iterator iter = paramMap.begin(); - while (iter!=paramMap.end()) - { - if (iter->shortkey != "") - out.add_key (iter->shortkey, iter->value, iter->comment); - else - out.add_comment (iter->comment); - ++iter; - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.h deleted file mode 100644 index f9be3ead94..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/simparams.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Class for storing parameter information for later use - * - * Copyright (C) 2003 Max-Planck-Society - * Authors: Reinhard Hell, Martin Reinecke - */ - -#ifndef PLANCK_SIMPARAMS_H -#define PLANCK_SIMPARAMS_H - -#include -#include -#include -#include "cxxutils.h" -class fitshandle; - -class simparams - { - private: - class Param - { - public: - std::string key, shortkey, value, comment; - - Param (const std::string &Key, const std::string &Shortkey, - const std::string &Value, const std::string &Comment) - : key(Key), shortkey(Shortkey), value(Value), comment(Comment) {} - }; - - std::vector paramMap; - std::vector source_files; - std::vector hdus; - - public: - void add_comment (const std::string &comment) - { paramMap.push_back(Param("","","",comment)); } - template void add(const std::string &key, - const std::string &shortkey, const T &value, const std::string &comment) - { - paramMap.push_back(Param(key, shortkey, dataToString(value), comment)); - } - template void add(const std::string &key, - const std::string &shortkey, const T &value) - { - paramMap.push_back(Param(key, shortkey, dataToString(value), "")); - } - - void add_source_file (const std::string &filename, int hdu=2) - { - source_files.push_back(filename); - hdus.push_back(hdu); - } - - void add_keys (std::ostream &os) const; - void add_keys (fitshandle &out) const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/tga_image.cc b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/tga_image.cc deleted file mode 100644 index d9a5266c76..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/tga_image.cc +++ /dev/null @@ -1,134 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Classes for creation and output of TGA image files - * - * Copyright (C) 2003 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "tga_image.h" -#include -#include "font_data.inc" - -using namespace std; - -const Font medium_bold_font = { 0, 128, 7, 13, medium_bold_font_data }; -const Font giant_font = { 0, 128, 9, 15, giant_font_data }; - -void Palette::setPredefined (int num) - { - fv.clear(); cv.clear(); - switch(num) - { - case 0: - add(0,Colour(0,0,0)); - add(1,Colour(1,1,1)); - break; - case 1: - add(0,Colour(0,0,0)); - add(0.4,Colour(0,0,0.5)); - add(0.75,Colour(0,0.6,1)); - add(1,Colour(1,1,1)); - break; - case 4: - add(0,Colour(0,0,.5)); - add(0.15,Colour(0,0,1)); - add(0.4,Colour(0,1,1)); - add(0.7,Colour(1,1,0)); - add(0.9,Colour(1,.33,0)); - add(1,Colour(.5,0,0)); - break; - default: - throw Message_error("Palette #"+dataToString(num)+" not yet supported."); - } - } - -void TGA_Image::write_char (int xpos, int ypos, const Colour &col, char c, - int scale) - { - for (int i=0; i0) - for (int m=0; m -#include -#include -#include "arr.h" - -/*! \defgroup imagegroup Image creation */ -/*! \{ */ - -/*! A very simple class for storing RGB colours. */ -class Colour - { - public: - float r, /*!< the red component */ - g, /*!< the green component */ - b; /*!< the blue component */ - - /*! Default constructor. Does not initialize \a r, \a g and \a b. */ - Colour() {} - /*! Initializes the colour with \a R, \a G and \a B. */ - Colour (float R, float G, float B) : r(R), g(G), b(B) {} - /*! Multiplies all components with \a fact. */ - const Colour &operator*= (float fact) - { r*=fact; g*=fact; b*=fact; return *this; } - /*! Returns the sum colour of \a *this and \a c2. */ - const Colour operator+ (const Colour &c2) const - { return Colour(r+c2.r, g+c2.g, b+c2.b); } - /*! Returns \a *this, scaled by \a f. */ - const Colour operator* (double f) const - { return Colour(r*f, g*f, b*f); } - }; - -/*! A class for mapping floting-point values into colours. */ -class Palette - { - private: - std::vector cv; - std::vector fv; - - public: - /*! Adds a new data point \a f, with the corresponding colour \a c. - The additions must be done in the order of ascending \a f. */ - void add (float f, const Colour &c) - { - fv.push_back(f); - cv.push_back(c); - } - /*! Sets the palette to the predefined palette \a num. */ - void setPredefined(int num); - /*! Returns the colour corresponding to the value \a f. The colour is - determined by linear interpolation between neighbouring data points. */ - Colour Get_Colour (float f) const - { - if (f<=fv[0]) return cv[0]; - if (f>=fv[fv.size()-1]) return cv[cv.size()-1]; - int i=0; - while (f>fv[i]) ++i; - return cv[i-1]*((fv[i]-f)/(fv[i]-fv[i-1])) - + cv[i]*((f-fv[i-1])/(fv[i]-fv[i-1])); - } - }; - -class Colour8 - { - private: - void import (const Colour &col) - { - using namespace std; - r = max(0,min(255,int(col.r*256))); - g = max(0,min(255,int(col.g*256))); - b = max(0,min(255,int(col.b*256))); - } - - public: - char r,g,b; - - Colour8() {} - Colour8 (unsigned char R, unsigned char G, unsigned char B) - : r(R), g(G), b(B) {} - Colour8 (const Colour &col) - { import (col); } - const Colour8 &operator= (const Colour &col) - { import (col); return *this; } - bool operator== (const Colour8 &that) - { return (r == that.r) && (g == that.g) && (b == that.b); } - bool operator!= (const Colour8 &that) - { return (r != that.r) || (g != that.g) || (b != that.b); } - }; - -class Font - { - public: - int offset, num_chars, xpix, ypix; - const char *data; - }; - -extern const Font medium_bold_font; -extern const Font giant_font; - -/*! Class for creating and storing TGA image files. */ -class TGA_Image - { - private: - Font font; - arr2 pixel; - - void write_char (int xpos, int ypos, const Colour &col, char c, - int scale=1); - - public: - /*! */ - TGA_Image (); - /*! Creates an image object with a resolution of \a xres by \a yres. */ - TGA_Image (int xres, int yres); - /*! */ - ~TGA_Image () {} - - /*! Fills the entire image with colour \a col. */ - void fill (const Colour &col) { pixel.fill(col); } - /*! Sets the font used for annotations to \a fnt. */ - void set_font (const Font &fnt); - /*! Outputs the string \a text in colour \a col. - \a xpos, \a ypos is the lower left corner; - the font is scaled by \a scale. */ - void annotate (int xpos, int ypos, const Colour &col, - const std::string &text, int scale=1); - /*! Outputs the string \a text centered at position \a xpos, \a ypos - in colour \a col. The font is scaled by \a scale. */ - void annotate_centered (int xpos, int ypos, const Colour &col, - const std::string &text, int scale=1); - /*! Sets the pixel \a i, \a j, to the colour \a col. */ - void put_pixel (int i, int j, const Colour &col) - { - if ((i>=0) && (i=0) && (j=0) && (i=0) && (j -#include - -/*! \defgroup vec3group 3D vectors */ -/*! \{ */ - -/*! Class representing a 3D cartesian vector. */ -class vec3 - { - public: - double x, /*!< x-coordinate */ - y, /*!< y-coordinate */ - z; /*!< z-coordinate */ - - /*! Default constructor. Does not initialize \a x, \a y, and \a z. */ - vec3 () {} - /*! Creates a vector with the coordinates \a xc, \a yc, and \a zc. */ - vec3 (double xc, double yc, double zc) - : x(xc), y(yc), z(zc) {} - - /*! Creates a unit vector from a z coordinate and an azimuthal angle. */ - void set_z_phi (double z_, double phi) - { - using namespace std; - double sintheta = sqrt((1.-z_)*(1.+z_)); - x = sintheta*cos(phi); - y = sintheta*sin(phi); - z = z_; - } - - /*! Normalizes the vector to length 1. */ - void Normalize () - { - using namespace std; - double l = 1.0/sqrt (x*x + y*y + z*z); - x*=l; y*=l; z*=l; - } - - /*! Returns the length of the vector. */ - double Length () const - { return sqrt (x*x + y*y + z*z); } - - /*! Returns the squared length of the vector. */ - double SquaredLength () const - { return (x*x + y*y + z*z); } - /*! Returns the vector with the signs of all coordinates flipped. */ - const vec3 operator- () const - { return vec3 (-x, -y, -z); } - /*! Flips the signs of all coordinates. */ - void Flip () - { x=-x; y=-y; z=-z; } - /*! Subtracts \a vec from the vector. */ - const vec3 operator- (const vec3 &vec) const - { return vec3 (x-vec.x, y-vec.y, z-vec.z); } - /*! Adds \a vec to the vector. */ - const vec3 operator+ (const vec3 &vec) const - { return vec3 (x+vec.x, y+vec.y, z+vec.z); } - /*! Returns the vector scaled by \a fact. */ - const vec3 operator* (double fact) const - { return vec3 (x*fact, y*fact, z*fact); } - /*! Returns the vector scaled by \a 1/fact. */ - const vec3 operator/ (double fact) const - { double xfact = 1./fact; return vec3 (x*xfact, y*xfact, z*xfact); } - /*! Scales the vector by \a fact. */ - vec3 &operator*= (double fact) - { x*=fact; y*=fact; z*=fact; return *this; } - }; - -/*! Returns the dot product of \a v1 and \a v2. - \relates vec3 */ -inline double dotprod(const vec3 &v1, const vec3 &v2) - { return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; } - -/*! Returns the cross product of \a a and \a b. - \relates vec3 */ -inline vec3 crossprod(const vec3 &a, const vec3 &b) - { return vec3 (a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x); } - -/*! Writes \a v to \a os. - \relates vec3 */ -inline std::ostream &operator<< (std::ostream &os, const vec3 &v) - { - os << v.x << ", " << v.y << ", " << v.z << std::endl; - return os; - } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/xcomplex.h b/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/xcomplex.h deleted file mode 100644 index ff6ebc06f2..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/cxxsupport/xcomplex.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file xcomplex.h - * Class for representing complex numbers, strongly inspired by C++'s - * std::complex - * - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_XCOMPLEX_H -#define PLANCK_XCOMPLEX_H - -#include - -/*! \defgroup complexgroup Complex number support */ -/*! \{ */ - -/*! A class for representing complex numbers. - - This template is intended as an (under-encapsulated) replacement for - the (over-encapsulated) std::complex<>. The goal is to include the - whole functionality of std::complex<>, with some additional methods - that allow higher performance. - - The (known and intentional) differences between xcomplex<> and - std::complex<> are: - - the default constructor of xcomplex<> does nothing, in contrast to - std::complex<>, which initialises its members to zero. - - xcomplex<> implements the methods real() and imag() according - to defect report DR387 -*/ -template class xcomplex - { - public: - T re, /*!< real part */ - im; /*!< imaginary part */ - - /*! Default constructor. \a re and \a im are not initialised. */ - xcomplex () {} - /*! Creates the complex number (\a re_, \a im_). */ - xcomplex (const T &re_, const T &im_) - : re(re_), im(im_) {} - /*! Creates the complex number (\a re_, 0). */ - xcomplex (const T &re_) - : re(re_), im(0) {} - /*! Creates a complex number as a copy of \a orig. */ - template xcomplex (const xcomplex &orig) - : re(orig.re), im(orig.im) {} - - /*! Returns the real part as lvalue. */ - T &real() { return re; } - /*! Returns the real part. */ - const T &real() const { return re; } - /*! Returns the imaginary part as lvalue. */ - T &imag() { return im; } - /*! Returns the imaginary part. */ - const T &imag() const { return im; } - - /*! Sets the number to (\a re_, \a im_). */ - void Set (const T &re_, const T &im_) - { re = re_; im = im_; } - - /*! Sets the number to \a orig. */ - template xcomplex &operator= (const xcomplex &orig) - { re=orig.re; im=orig.im; return *this; } - /*! Sets the number to (\a orig, 0). */ - xcomplex &operator= (const T &orig) - { re=orig; im=0; return *this; } - /*! Adds \a orig to \a *this. */ - xcomplex &operator+= (const xcomplex &orig) - { re+=orig.re; im+=orig.im; return *this; } - /*! Subtracts \a orig from \a *this. */ - xcomplex &operator-= (const xcomplex &orig) - { re-=orig.re; im-=orig.im; return *this; } - /*! Multiplies \a *this by \a orig. */ - xcomplex &operator*= (const xcomplex &orig) - { - T tmp=re; - re=re*orig.re-im*orig.im; im=tmp*orig.im+im*orig.re; - return *this; - } - /*! Multiplies \a *this by \a fact. */ - xcomplex &operator*= (const T &fact) - { re*=fact; im*=fact; return *this; } - /*! Returns \a *this * \a fact. */ - xcomplex operator* (const T &fact) const - { return xcomplex (re*fact,im*fact); } - /*! Returns \a *this * \a b. */ - xcomplex operator* (const xcomplex &b) const - { return xcomplex (re*b.re-im*b.im, re*b.im+im*b.re); } - /*! Returns \a *this + \a b. */ - xcomplex operator+ (const xcomplex &b) const - { return xcomplex (re+b.re, im+b.im); } - /*! Returns \a *this - \a b. */ - xcomplex operator- (const xcomplex &b) const - { return xcomplex (re-b.re, im-b.im); } - /*! Returns \a -(*this) */ - xcomplex operator- () const - { return xcomplex (-re,-im); } - - /*! Flips the signs of both components. */ - void Negate() - { re=-re; im=-im; } - /*! Flips the signs of the imaginary component. */ - void Conjugate() - { im=-im; } - /*! Returns the complex conjugate of \a *this. */ - xcomplex conj() const - { return xcomplex (re,-im); } - - /*! Returns the norm of \a *this. */ - T norm() const - { return re*re + im*im; } - }; - -/*! Returns the complex conjugate of \a num. - \relates xcomplex */ -template inline xcomplex conj (const xcomplex &num) - { return xcomplex (num.re, -num.im); } -/*! Returns the norm of \a num. - \relates xcomplex */ -template inline T norm (const xcomplex &num) - { return num.re*num.re + num.im*num.im; } -/*! Returns \a f1*f2. - \relates xcomplex */ -template inline xcomplex operator* - (const T &f1, const xcomplex &f2) - { return xcomplex (f1*f2.re, f1*f2.im); } -/*! Writes \a val to \a os. - \relates xcomplex */ -template - inline std::ostream &operator<< (std::ostream &os, const xcomplex &val) - { os << "(" << val.re << "," << val.im << ")"; return os; } - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base.cc b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base.cc deleted file mode 100644 index 469e8c3f06..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base.cc +++ /dev/null @@ -1,783 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "healpix_base.h" -#include "cxxutils.h" -#include "pointing.h" -#include "arr.h" -#include "geom_utils.h" - -using namespace std; - -short Healpix_Base::ctab[]; -short Healpix_Base::utab[]; - -const nside_dummy SET_NSIDE=nside_dummy(); - -Healpix_Base::Tablefiller::Tablefiller() - { - for (int m=0; m<0x100; ++m) - { - ctab[m] = - (m&0x1 ) | ((m&0x2 ) << 7) | ((m&0x4 ) >> 1) | ((m&0x8 ) << 6) - | ((m&0x10) >> 2) | ((m&0x20) << 5) | ((m&0x40) >> 3) | ((m&0x80) << 4); - utab[m] = - (m&0x1 ) | ((m&0x2 ) << 1) | ((m&0x4 ) << 2) | ((m&0x8 ) << 3) - | ((m&0x10) << 4) | ((m&0x20) << 5) | ((m&0x40) << 6) | ((m&0x80) << 7); - } - } - -Healpix_Base::Tablefiller Healpix_Base::Filler; - -const int Healpix_Base::jrll[] = { 2,2,2,2,3,3,3,3,4,4,4,4 }; -const int Healpix_Base::jpll[] = { 1,3,5,7,0,2,4,6,1,3,5,7 }; - -int Healpix_Base::npix2nside (int npix) - { - int res=isqrt(npix/12); - planck_assert (npix==res*res*12, "npix2nside: invalid argument"); - return res; - } - -int Healpix_Base::ring_above (double z) const - { - double az=abs(z); - if (az>twothird) // polar caps - { - int iring = int(nside_*sqrt(3*(1-az))); - return (z>0) ? iring : 4*nside_-iring-1; - } - else // ----- equatorial region --------- - return int(nside_*(2-1.5*z)); - } - -void Healpix_Base::in_ring(int iz, double phi0, double dphi, - vector &listir) const - { - int nr, ir, ipix1; - double shift=0.5; - - if (iz(3*nside_)) // south pole - { - ir = 4*nside_ - iz; - nr = ir*4; - ipix1 = npix_ - 2*ir*(ir+1); // lowest pixel number in the ring - } - else // equatorial region - { - ir = iz - nside_ + 1; // within {1, 2*nside + 1} - nr = nside_*4; - if ((ir&1)==0) shift = 0; - ipix1 = ncap_ + (ir-1)*nr; // lowest pixel number in the ring - } - - int ipix2 = ipix1 + nr - 1; // highest pixel number in the ring - - // ----------- constructs the pixel list -------------- - if (dphi > (pi-1e-7)) - for (int i=ipix1; i<=ipix2; ++i) listir.push_back(i); - else - { - int ip_lo = ifloor(nr*inv_twopi*(phi0-dphi) - shift)+1; - int ip_hi = ifloor(nr*inv_twopi*(phi0+dphi) - shift); - int pixnum = ip_lo+ipix1; - if (pixnumipix2) pixnum -= nr; - listir.push_back(pixnum); - } - } - } - -void Healpix_Base::nest2xyf (int pix, int &ix, int &iy, int &face_num) const - { - face_num = pix>>(2*order_); - pix &= (npface_-1); - int raw = (pix&0x5555) | ((pix&0x55550000)>>15); - ix = ctab[raw&0xff] | (ctab[raw>>8]<<4); - pix >>= 1; - raw = (pix&0x5555) | ((pix&0x55550000)>>15); - iy = ctab[raw&0xff] | (ctab[raw>>8]<<4); - } - -int Healpix_Base::xyf2nest (int ix, int iy, int face_num) const - { - return (face_num<<(2*order_)) + - (utab[ix&0xff] | (utab[ix>>8]<<16) - | (utab[iy&0xff]<<1) | (utab[iy>>8]<<17)); - } - -void Healpix_Base::ring2xyf (int pix, int &ix, int &iy, int &face_num) const - { - int iring, iphi, kshift, nr; - - int nl2 = 2*nside_; - - if (pix=(2*iring)) - { - face_num=2; - tmp-=2*iring; - } - if (tmp>=iring) ++face_num; - } - else if (pix<(npix_-ncap_)) // Equatorial region - { - int ip = pix - ncap_; - if (order_>=0) - { - iring = (ip>>(order_+2)) + nside_; // counted from North pole - iphi = (ip&(4*nside_-1)) + 1; - } - else - { - iring = (ip/(4*nside_)) + nside_; // counted from North pole - iphi = (ip%(4*nside_)) + 1; - } - kshift = (iring+nside_)&1; - nr = nside_; - unsigned int ire = iring-nside_+1; - unsigned int irm = nl2+2-ire; - int ifm, ifp; - if (order_>=0) - { - ifm = (iphi - ire/2 + nside_ -1) >> order_; - ifp = (iphi - irm/2 + nside_ -1) >> order_; - } - else - { - ifm = (iphi - ire/2 + nside_ -1) / nside_; - ifp = (iphi - irm/2 + nside_ -1) / nside_; - } - if (ifp == ifm) // faces 4 to 7 - face_num = (ifp==4) ? 4 : ifp+4; - else if (ifp=(2*nr)) - { - face_num=10; - tmp-=2*nr; - } - if (tmp>=nr) ++face_num; - } - - int irt = iring - (jrll[face_num]*nside_) + 1; - int ipt = 2*iphi- jpll[face_num]*nr - kshift -1; - if (ipt>=nl2) ipt-=8*nside_; - - ix = (ipt-irt) >>1; - iy =(-(ipt+irt))>>1; - } - -int Healpix_Base::xyf2ring (int ix, int iy, int face_num) const - { - int nl4 = 4*nside_; - int jr = (jrll[face_num]*nside_) - ix - iy - 1; - - int nr, kshift, n_before; - if (jr 3*nside_) - { - nr = nl4-jr; - n_before = npix_ - 2*(nr+1)*nr; - kshift = 0; - } - else - { - nr = nside_; - n_before = ncap_ + (jr-nside_)*nl4; - kshift = (jr-nside_)&1; - } - - int jp = (jpll[face_num]*nr + ix - iy + 1 + kshift) / 2; - if (jp>nl4) - jp-=nl4; - else - if (jp<1) jp+=nl4; - - return n_before + jp - 1; - } - -double Healpix_Base::ring2z (int ring) const - { - if (ring=0, "nest2ring: need hierarchical map"); - int ix, iy, face_num; - nest2xyf (pix, ix, iy, face_num); - return xyf2ring (ix, iy, face_num); - } - -int Healpix_Base::ring2nest (int pix) const - { - planck_assert(order_>=0, "ring2nest: need hierarchical map"); - int ix, iy, face_num; - ring2xyf (pix, ix, iy, face_num); - return xyf2nest (ix, iy, face_num); - } - -int Healpix_Base::nest2peano (int pix) const - { - static const unsigned char subpix[8][4] = { - { 0, 1, 3, 2 }, { 3, 0, 2, 1 }, { 2, 3, 1, 0 }, { 1, 2, 0, 3 }, - { 0, 3, 1, 2 }, { 1, 0, 2, 3 }, { 2, 1, 3, 0 }, { 3, 2, 0, 1 } }; - const unsigned char subpath[8][4] = { - { 4, 0, 6, 0 }, { 7, 5, 1, 1 }, { 2, 4, 2, 6 }, { 3, 3, 7, 5 }, - { 0, 2, 4, 4 }, { 5, 1, 5, 3 }, { 6, 6, 0, 2 }, { 1, 7, 3, 7 } }; - static const unsigned char face2path[12] = { - 2, 5, 2, 5, 3, 6, 3, 6, 2, 3, 2, 3 }; - static const unsigned char face2peanoface[12] = { - 0, 5, 6, 11, 10, 1, 4, 7, 2, 3, 8, 9 }; - - int face = pix>>(2*order_); - unsigned char path = face2path[face]; - int result = 0; - - for (int shift=2*order_-2; shift>=0; shift-=2) - { - unsigned char spix = (pix>>shift) & 0x3; - result <<= 2; - result |= subpix[path][spix]; - path=subpath[path][spix]; - } - - return result + (int(face2peanoface[face])<<(2*order_)); - } - -int Healpix_Base::peano2nest (int pix) const - { - static const unsigned char subpix[8][4] = { - { 0, 1, 3, 2 }, { 1, 3, 2, 0 }, { 3, 2, 0, 1 }, { 2, 0, 1, 3 }, - { 0, 2, 3, 1 }, { 1, 0, 2, 3 }, { 3, 1, 0, 2 }, { 2, 3, 1, 0 } }; - static const unsigned char subpath[8][4] = { - { 4, 0, 0, 6 }, { 5, 1, 1, 7 }, { 6, 2, 2, 4 }, { 7, 3, 3, 5 }, - { 0, 4, 4, 2 }, { 1, 5, 5, 3 }, { 2, 6, 6, 0 }, { 3, 7, 7, 1 } }; - static const unsigned char face2path[12] = { - 2, 6, 2, 3, 3, 5, 2, 6, 2, 3, 3, 5 }; - static const unsigned char peanoface2face[12] = { - 0, 5, 8, 9, 6, 1, 2, 7, 10, 11, 4, 3 }; - - int face = pix>>(2*order_); - unsigned char path = face2path[face]; - int result = 0; - - for (int shift=2*order_-2; shift>=0; shift-=2) - { - unsigned char spix = (pix>>shift) & 0x3; - result <<= 2; - result |= subpix[path][spix]; - path=subpath[path][spix]; - } - - return result + (int(peanoface2face[face])<<(2*order_)); - } - -int Healpix_Base::ang2pix_z_phi (double z, double phi) const - { - double za = abs(z); - double tt = fmodulo(phi,twopi) * inv_halfpi; // in [0,4) - - if (scheme_==RING) - { - if (za<=twothird) // Equatorial region - { - double temp1 = nside_*(0.5+tt); - double temp2 = nside_*z*0.75; - int jp = int(temp1-temp2); // index of ascending edge line - int jm = int(temp1+temp2); // index of descending edge line - - // ring number counted from z=2/3 - int ir = nside_ + 1 + jp - jm; // in {1,2n+1} - int kshift = 1-(ir&1); // kshift=1 if ir even, 0 otherwise - - int ip = (jp+jm-nside_+kshift+1)/2; // in {0,4n-1} - ip = imodulo(ip,4*nside_); - - return ncap_ + (ir-1)*4*nside_ + ip; - } - else // North & South polar caps - { - double tp = tt-int(tt); - double tmp = nside_*sqrt(3*(1-za)); - - int jp = int(tp*tmp); // increasing edge line index - int jm = int((1.0-tp)*tmp); // decreasing edge line index - - int ir = jp+jm+1; // ring number counted from the closest pole - int ip = int(tt*ir); // in {0,4*ir-1} - ip = imodulo(ip,4*ir); - - if (z>0) - return 2*ir*(ir-1) + ip; - else - return npix_ - 2*ir*(ir+1) + ip; - } - } - else // scheme_ == NEST - { - int face_num, ix, iy; - - if (za<=twothird) // Equatorial region - { - double temp1 = nside_*(0.5+tt); - double temp2 = nside_*(z*0.75); - int jp = int(temp1-temp2); // index of ascending edge line - int jm = int(temp1+temp2); // index of descending edge line - int ifp = jp >> order_; // in {0,4} - int ifm = jm >> order_; - if (ifp == ifm) // faces 4 to 7 - face_num = (ifp==4) ? 4: ifp+4; - else if (ifp < ifm) // (half-)faces 0 to 3 - face_num = ifp; - else // (half-)faces 8 to 11 - face_num = ifm + 8; - - ix = jm & (nside_-1); - iy = nside_ - (jp & (nside_-1)) - 1; - } - else // polar region, za > 2/3 - { - int ntt = int(tt); - double tp = tt-ntt; - double tmp = nside_*sqrt(3*(1-za)); - - int jp = int(tp*tmp); // increasing edge line index - int jm = int((1.0-tp)*tmp); // decreasing edge line index - if (jp>=nside_) jp = nside_-1; // for points too close to the boundary - if (jm>=nside_) jm = nside_-1; - if (z >= 0) - { - face_num = ntt; // in {0,3} - ix = nside_ - jm - 1; - iy = nside_ - jp - 1; - } - else - { - face_num = ntt + 8; // in {8,11} - ix = jp; - iy = jm; - } - } - - return xyf2nest(ix,iy,face_num); - } - } - -void Healpix_Base::pix2ang_z_phi (int pix, double &z, double &phi) const - { - if (scheme_==RING) - { - if (pix 3*nside_) - { - nr = nl4-jr; - z = nr*nr*fact2_ - 1; - kshift = 0; - } - else - { - nr = nside_; - z = (2*nside_-jr)*fact1_; - kshift = (jr-nside_)&1; - } - - int jp = (jpll[face_num]*nr + ix -iy + 1 + kshift) / 2; - if (jp>nl4) jp-=nl4; - if (jp<1) jp+=nl4; - - phi = (jp-(kshift+1)*0.5)*(halfpi/nr); - } - } - -void Healpix_Base::query_disc (const pointing &ptg, double radius, - vector& listpix) const - { - listpix.clear(); - - double dth1 = fact2_; - double dth2 = fact1_; - double cosang = cos(radius); - - double z0 = cos(ptg.theta); - double xa = 1./sqrt((1-z0)*(1+z0)); - - double rlat1 = ptg.theta - radius; - double zmax = cos(rlat1); - int irmin = ring_above (zmax)+1; - - if (rlat1<=0) // north pole in the disc - for (int m=1; m=0, "error in query_disc()"); - double dphi=atan2(sqrt(ysq),x); - in_ring (iz, ptg.phi, dphi, listpix); - } - - if (rlat2>=pi) // south pole in the disc - for (int m=irmax+1; m<(4*nside_); ++m) // rings completely in the disc - in_ring (m, 0, pi, listpix); - - if (scheme_==NEST) - for (unsigned int m=0; m2*nside_) ? 4*nside_-ring : ring; - if (northring < nside_) - { - double tmp = northring*northring*fact2_; - costheta = 1 - tmp; - sintheta = sqrt(tmp*(2-tmp)); - ringpix = 4*northring; - shifted = true; - startpix = 2*northring*(northring-1); - } - else - { - costheta = (2*nside_-northring)*fact1_; - sintheta = sqrt((1+costheta)*(1-costheta)); - ringpix = 4*nside_; - shifted = ((northring-nside_) & 1) == 0; - startpix = ncap_ + (northring-nside_)*ringpix; - } - if (northring != ring) // southern hemisphere - { - costheta = -costheta; - startpix = npix_ - startpix - ringpix; - } - } - -void Healpix_Base::neighbors (int pix, fix_arr &result) const - { - static const int xoffset[] = { -1,-1, 0, 1, 1, 1, 0,-1 }; - static const int yoffset[] = { 0, 1, 1, 1, 0,-1,-1,-1 }; - static const int facearray[][12] = - { { 8, 9,10,11,-1,-1,-1,-1,10,11, 8, 9 }, // S - { 5, 6, 7, 4, 8, 9,10,11, 9,10,11, 8 }, // SE - { -1,-1,-1,-1, 5, 6, 7, 4,-1,-1,-1,-1 }, // E - { 4, 5, 6, 7,11, 8, 9,10,11, 8, 9,10 }, // SW - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }, // center - { 1, 2, 3, 0, 0, 1, 2, 3, 5, 6, 7, 4 }, // NE - { -1,-1,-1,-1, 7, 4, 5, 6,-1,-1,-1,-1 }, // W - { 3, 0, 1, 2, 3, 0, 1, 2, 4, 5, 6, 7 }, // NW - { 2, 3, 0, 1,-1,-1,-1,-1, 0, 1, 2, 3 } }; // N - static const int swaparray[][12] = - { { 0,0,0,0,0,0,0,0,3,3,3,3 }, // S - { 0,0,0,0,0,0,0,0,6,6,6,6 }, // SE - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // E - { 0,0,0,0,0,0,0,0,5,5,5,5 }, // SW - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // center - { 5,5,5,5,0,0,0,0,0,0,0,0 }, // NE - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // W - { 6,6,6,6,0,0,0,0,0,0,0,0 }, // NW - { 3,3,3,3,0,0,0,0,0,0,0,0 } }; // N - - int ix, iy, face_num; - (scheme_==RING) ? - ring2xyf(pix,ix,iy,face_num) : nest2xyf(pix,ix,iy,face_num); - - const int nsm1 = nside_-1; - if ((ix>0)&&(ix0)&&(iy=nside_) - { x-=nside_; nbnum+=1; } - if (y<0) - { y+=nside_; nbnum-=3; } - else if (y>=nside_) - { y-=nside_; nbnum+=3; } - - int f = facearray[nbnum][face_num]; - if (f>=0) - { - if (swaparray[nbnum][face_num]&1) x=nside_-x-1; - if (swaparray[nbnum][face_num]&2) y=nside_-y-1; - if (swaparray[nbnum][face_num]&4) std::swap(x,y); - result[i] = (scheme_==RING) ? xyf2ring(x,y,f) : xyf2nest(x,y,f); - } - else - result[i] = -1; - } - } - } - -void Healpix_Base::get_ring_info2 (int ring, int &startpix, int &ringpix, - double &theta, bool &shifted) const - { - int northring = (ring>2*nside_) ? 4*nside_-ring : ring; - if (northring < nside_) - { - double tmp = northring*northring*fact2_; - double costheta = 1 - tmp; - double sintheta = sqrt(tmp*(2-tmp)); - theta = atan2(sintheta,costheta); - ringpix = 4*northring; - shifted = true; - startpix = 2*northring*(northring-1); - } - else - { - theta = acos((2*nside_-northring)*fact1_); - ringpix = 4*nside_; - shifted = ((northring-nside_) & 1) == 0; - startpix = ncap_ + (northring-nside_)*ringpix; - } - if (northring != ring) // southern hemisphere - { - theta = pi-theta; - startpix = npix_ - startpix - ringpix; - } - } - -void Healpix_Base::get_interpol (const pointing &ptg, fix_arr &pix, - fix_arr &wgt) const - { - double z = cos (ptg.theta); - int ir1 = ring_above(z); - int ir2 = ir1+1; - double theta1, theta2, w1, tmp, dphi; - int sp,nr; - bool shift; - int i1,i2; - if (ir1>0) - { - get_ring_info2 (ir1, sp, nr, theta1, shift); - dphi = twopi/nr; - tmp = (ptg.phi/dphi - .5*shift); - i1 = (tmp<0) ? int(tmp)-1 : int(tmp); - w1 = (ptg.phi-(i1+.5*shift)*dphi)/dphi; - i2 = i1+1; - if (i1<0) i1 +=nr; - if (i2>=nr) i2 -=nr; - pix[0] = sp+i1; pix[1] = sp+i2; - wgt[0] = 1-w1; wgt[1] = w1; - } - if (ir2<(4*nside_)) - { - get_ring_info2 (ir2, sp, nr, theta2, shift); - dphi = twopi/nr; - tmp = (ptg.phi/dphi - .5*shift); - i1 = (tmp<0) ? int(tmp)-1 : int(tmp); - w1 = (ptg.phi-(i1+.5*shift)*dphi)/dphi; - i2 = i1+1; - if (i1<0) i1 +=nr; - if (i2>=nr) i2 -=nr; - pix[2] = sp+i1; pix[3] = sp+i2; - wgt[2] = 1-w1; wgt[3] = w1; - } - - if (ir1==0) - { - double wtheta = ptg.theta/theta2; - wgt[2] *= wtheta; wgt[3] *= wtheta; - double fac = (1-wtheta)*0.25; - wgt[0] = fac; wgt[1] = fac; wgt[2] += fac; wgt[3] +=fac; - pix[0] = (pix[2]+2)%4; - pix[1] = (pix[3]+2)%4; - } - else if (ir2==4*nside_) - { - double wtheta = (ptg.theta-theta1)/(pi-theta1); - wgt[0] *= (1-wtheta); wgt[1] *= (1-wtheta); - double fac = wtheta*0.25; - wgt[0] += fac; wgt[1] += fac; wgt[2] = fac; wgt[3] =fac; - pix[2] = ((pix[0]+2)&3)+npix_-4; - pix[3] = ((pix[1]+2)&3)+npix_-4; - } - else - { - double wtheta = (ptg.theta-theta1)/(theta2-theta1); - wgt[0] *= (1-wtheta); wgt[1] *= (1-wtheta); - wgt[2] *= wtheta; wgt[3] *= wtheta; - } - - if (scheme_==NEST) - for (int m=0; m -#include "cxxutils.h" -#include "lsconstants.h" -#include "pointing.h" -template class fix_arr; - -/*! The two possible ordering schemes of a HEALPix map. */ -typedef enum { RING, /*!< RING scheme */ - NEST /*!< NESTED scheme */ - } Healpix_Ordering_Scheme; - -class nside_dummy {}; -extern const nside_dummy SET_NSIDE; - -/*! Functionality related to the HEALPix pixelisation. */ -class Healpix_Base - { - protected: - enum { order_max=13 }; - - class Tablefiller - { - public: - Tablefiller(); - }; - static Tablefiller Filler; - friend class Tablefiller; - - static short ctab[0x100], utab[0x100]; - - static const int jrll[]; - static const int jpll[]; - - /*! The order of the map; -1 for nonhierarchical map. */ - int order_; - /*! The N_side parameter of the map; 0 if not allocated. */ - int nside_; - int npface_, ncap_, npix_; - double fact1_, fact2_; - /*! The map's ordering scheme. */ - Healpix_Ordering_Scheme scheme_; - - inline int ring_above (double z) const; - void in_ring (int iz, double phi0, double dphi, - std::vector &listir) const; - - int xyf2nest(int ix, int iy, int face_num) const; - void nest2xyf(int pix, int &ix, int &iy, int &face_num) const; - int xyf2ring(int ix, int iy, int face_num) const; - void ring2xyf(int pix, int &ix, int &iy, int &face_num) const; - - typedef int (Healpix_Base::*swapfunc)(int pix) const; - typedef void (Healpix_Base::*pix2xyf) - (int pix, int &x, int &y, int &f) const; - typedef int (Healpix_Base::*xyf2pix) (int x, int y, int f) const; - - public: - /*! Calculates the map order from its \a N_side parameter. - Returns -1 if \a nside is not a power of 2. - \param nside the \a N_side parameter */ - static int nside2order (int nside) - { - planck_assert (nside>0, "invalid value for Nside"); - if ((nside)&(nside-1)) return -1; - return ilog2(nside); - } - /*! Calculates the \a N_side parameter from the number of pixels. - \param npix the number of pixels */ - static int npix2nside (int npix); - /*! Constructs an unallocated object. */ - Healpix_Base () - : order_(-1), nside_(0), npface_(0), ncap_(0), npix_(0), - fact1_(0), fact2_(0), scheme_(RING) {} - /*! Constructs an object with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Base (int order, Healpix_Ordering_Scheme scheme) - { Set (order, scheme); } - /*! Constructs an object with a given \a nside and the ordering - scheme \a scheme. The \a nside_dummy parameter must be set to - SET_NSIDE. */ - Healpix_Base (int nside, Healpix_Ordering_Scheme scheme, const nside_dummy) - { SetNside (nside, scheme); } - - /* Adjusts the object to \a order and \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - planck_assert ((order>=0)&&(order<=order_max), "bad order"); - order_ = order; - nside_ = 1<=0), - "SetNside: nside must be power of 2 for nested maps"); - nside_ = nside; - npface_ = nside_*nside_; - ncap_ = (npface_-nside_)<<1; - npix_ = 12*npface_; - fact2_ = 4./npix_; - fact1_ = (nside_<<1)*fact2_; - scheme_ = scheme; - } - - /*! Returns the z-coordinate of the ring \a ring. This also works - for the (not really existing) rings 0 and 4*nside. */ - double ring2z (int ring) const; - /*! Returns the number of the ring in which \a pix lies. */ - int pix2ring (int pix) const; - - /*! Translates a pixel number from NEST to RING. */ - int nest2ring (int pix) const; - /*! Translates a pixel number from RING to NEST. */ - int ring2nest (int pix) const; - /*! Translates a pixel number from NEST to its Peano index. */ - int nest2peano (int pix) const; - /*! Translates a pixel number from its Peano index to NEST. */ - int peano2nest (int pix) const; - - int ang2pix_z_phi (double z, double phi) const; - - /*! Returns the number of the pixel which contains the angular coordinates - \a ang. */ - int ang2pix (const pointing &ang) const - { return ang2pix_z_phi (cos(ang.theta), ang.phi); } - /*! Returns the number of the pixel which contains the vector \a vec - (\a vec is normalized if necessary). */ - int vec2pix (const vec3 &vec) const - { return ang2pix_z_phi (vec.z/vec.Length(), safe_atan2(vec.y,vec.x)); } - - void pix2ang_z_phi (int pix, double &z, double &phi) const; - - /*! Returns the angular coordinates of the center of the pixel with - number \a pix. */ - pointing pix2ang (int pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - return pointing(acos(z),phi); - } - /*! Returns the vector to the center of the pixel with number \a pix. */ - vec3 pix2vec (int pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - vec3 res; - res.set_z_phi (z, phi); - return res; - } - - /*! Returns the numbers of all pixels whose centers lie within \a radius - of \a dir in \a listpix. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method is more efficient in the RING scheme. */ - void query_disc (const pointing &dir, double radius, - std::vector &listpix) const; - /*! Returns the numbers of all pixels that lie at least partially within - \a radius of \a dir in \a listpix. It may also return a few pixels - which do not lie in the disk at all. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void query_disc_inclusive (const pointing &dir, double radius, - std::vector &listpix) const - { query_disc (dir,radius+1.362*pi/(4*nside_),listpix); } - - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param costheta the cosine of the colatitude (in radians) of the ring - \param sintheta the sine of the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info (int ring, int &startpix, int &ringpix, - double &costheta, double &sintheta, bool &shifted) const; - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param theta the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info2 (int ring, int &startpix, int &ringpix, - double &theta, bool &shifted) const; - - /*! Returns the neighboring pixels of \a pix in \a result. - On exit, \a result contains (in this order) - the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor - of \a pix. If a neighbor does not exist (this can only be the case - for the W, N, E and S neighbors), its entry is set to -1. - - \note This method works in both RING and NEST schemes, but is - considerably faster in the NEST scheme. */ - void neighbors (int pix, fix_arr &result) const; - /*! Returns interpolation information for the direction \a ptg. - The surrounding pixels are returned in \a pix, their corresponding - weights in \a wgt. - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void get_interpol (const pointing &ptg, fix_arr &pix, - fix_arr &wgt) const; - - /*! Returns the order parameter of the object. */ - int Order() const { return order_; } - /*! Returns the \a N_side parameter of the object. */ - int Nside() const { return nside_; } - /*! Returns the number of pixels of the object. */ - int Npix() const { return npix_; } - /*! Returns the ordering scheme of the object. */ - Healpix_Ordering_Scheme Scheme() const { return scheme_; } - - /*! Returns \a true, if both objects have the same nside and scheme, - else \a false. */ - bool conformable (const Healpix_Base &other) const - { return ((nside_==other.nside_) && (scheme_==other.scheme_)); } - - /*! Swaps the contents of two Healpix_Base objects. */ - void swap (Healpix_Base &other) - { - std::swap(order_,other.order_); - std::swap(nside_,other.nside_); - std::swap(npface_,other.npface_); - std::swap(ncap_,other.ncap_); - std::swap(npix_,other.npix_); - std::swap(fact1_,other.fact1_); - std::swap(fact2_,other.fact2_); - std::swap(scheme_,other.scheme_); - } - - /*! Returns the maximum angular distance (in radian) between any pixel - center and its corners. */ - double max_pixrad() const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.cc b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.cc deleted file mode 100644 index e3ffedbd46..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.cc +++ /dev/null @@ -1,569 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "healpix_base2.h" -#include "cxxutils.h" -#include "pointing.h" -#include "arr.h" -#include "geom_utils.h" - -using namespace std; - -short Healpix_Base2::ctab[]; -short Healpix_Base2::utab[]; - -Healpix_Base2::Tablefiller::Tablefiller() - { - for (int m=0; m<0x100; ++m) - { - ctab[m] = - (m&0x1 ) | ((m&0x2 ) << 7) | ((m&0x4 ) >> 1) | ((m&0x8 ) << 6) - | ((m&0x10) >> 2) | ((m&0x20) << 5) | ((m&0x40) >> 3) | ((m&0x80) << 4); - utab[m] = - (m&0x1 ) | ((m&0x2 ) << 1) | ((m&0x4 ) << 2) | ((m&0x8 ) << 3) - | ((m&0x10) << 4) | ((m&0x20) << 5) | ((m&0x40) << 6) | ((m&0x80) << 7); - } - } - -Healpix_Base2::Tablefiller Healpix_Base2::Filler; - -const int Healpix_Base2::jrll[] = { 2,2,2,2,3,3,3,3,4,4,4,4 }; -const int Healpix_Base2::jpll[] = { 1,3,5,7,0,2,4,6,1,3,5,7 }; - -int64 Healpix_Base2::npix2nside (int64 npix) - { - int64 res=isqrt(npix/12); - planck_assert (npix==res*res*12, "npix2nside: invalid argument"); - return res; - } - -void Healpix_Base2::nest2xyf (int64 pix, int &ix, int &iy, int &face_num) - const - { - face_num = pix>>(2*order_); - pix &= (npface_-1); - int32 raw = ((pix&0x555500000000ull)>>16) - | ((pix&0x5555000000000000ull)>>31) - | (pix&0x5555) - | ((pix&0x55550000)>>15); - ix = ctab[raw&0xff] - | (ctab[(raw>>8)&0xff]<<4) - | (ctab[(raw>>16)&0xff]<<16) - | (ctab[(raw>>24)&0xff]<<20); - pix >>= 1; - raw = ((pix&0x555500000000ull)>>16) - | ((pix&0x5555000000000000ull)>>31) - | (pix&0x5555) - | ((pix&0x55550000)>>15); - iy = ctab[raw&0xff] - | (ctab[(raw>>8)&0xff]<<4) - | (ctab[(raw>>16)&0xff]<<16) - | (ctab[(raw>>24)&0xff]<<20); - } - -int64 Healpix_Base2::xyf2nest (int ix, int iy, int face_num) const - { - return (int64(face_num)<<(2*order_)) + - ( (int64(utab[ ix &0xff])) - | (int64(utab[(ix>> 8)&0xff])<<16) - | (int64(utab[(ix>>16)&0xff])<<32) - | (int64(utab[(ix>>24)&0xff])<<48) - | (int64(utab[ iy &0xff])<<1) - | (int64(utab[(iy>> 8)&0xff])<<17) - | (int64(utab[(iy>>16)&0xff])<<33) - | (int64(utab[(iy>>24)&0xff])<<49) ); - } - -void Healpix_Base2::ring2xyf (int64 pix, int &ix, int &iy, int &face_num) - const - { - int64 iring, iphi, kshift, nr; - - int64 nl2 = 2*nside_; - - if (pix=(2*iring)) - { - face_num=2; - tmp-=2*iring; - } - if (tmp>=iring) ++face_num; - } - else if (pix<(npix_-ncap_)) // Equatorial region - { - int64 ip = pix - ncap_; - if (order_>=0) - { - iring = (ip>>(order_+2)) + nside_; // counted from North pole - iphi = (ip&(4*nside_-1)) + 1; - } - else - { - iring = (ip/(4*nside_)) + nside_; // counted from North pole - iphi = (ip%(4*nside_)) + 1; - } - kshift = (iring+nside_)&1; - nr = nside_; - int64 ire = iring-nside_+1; - int64 irm = nl2+2-ire; - int64 ifm, ifp; - if (order_>=0) - { - ifm = (iphi - ire/2 + nside_ -1) >> order_; - ifp = (iphi - irm/2 + nside_ -1) >> order_; - } - else - { - ifm = (iphi - ire/2 + nside_ -1) / nside_; - ifp = (iphi - irm/2 + nside_ -1) / nside_; - } - if (ifp == ifm) // faces 4 to 7 - face_num = (ifp==4) ? 4 : ifp+4; - else if (ifp=(2*nr)) - { - face_num=10; - tmp-=2*nr; - } - if (tmp>=nr) ++face_num; - } - - int64 irt = iring - (jrll[face_num]*nside_) + 1; - int64 ipt = 2*iphi- jpll[face_num]*nr - kshift -1; - if (ipt>=nl2) ipt-=8*nside_; - - ix = (ipt-irt) >>1; - iy =(-(ipt+irt))>>1; - } - -int64 Healpix_Base2::xyf2ring (int ix, int iy, int face_num) const - { - int64 nl4 = 4*nside_; - int64 jr = (jrll[face_num]*nside_) - ix - iy - 1; - - int64 nr, kshift, n_before; - if (jr 3*nside_) - { - nr = nl4-jr; - n_before = npix_ - 2*(nr+1)*nr; - kshift = 0; - } - else - { - nr = nside_; - n_before = ncap_ + (jr-nside_)*nl4; - kshift = (jr-nside_)&1; - } - - int64 jp = (jpll[face_num]*nr + ix - iy + 1 + kshift) / 2; - if (jp>nl4) - jp-=nl4; - else - if (jp<1) jp+=nl4; - - return n_before + jp - 1; - } - -double Healpix_Base2::ring2z (int64 ring) const - { - if (ring=0, "nest2ring: need hierarchical map"); - int ix, iy, face_num; - nest2xyf (pix, ix, iy, face_num); - return xyf2ring (ix, iy, face_num); - } - -int64 Healpix_Base2::ring2nest (int64 pix) const - { - planck_assert(order_>=0, "ring2nest: need hierarchical map"); - int ix, iy, face_num; - ring2xyf (pix, ix, iy, face_num); - return xyf2nest (ix, iy, face_num); - } - -int64 Healpix_Base2::nest2peano (int64 pix) const - { - static const unsigned char subpix[8][4] = { - { 0, 1, 3, 2 }, { 3, 0, 2, 1 }, { 2, 3, 1, 0 }, { 1, 2, 0, 3 }, - { 0, 3, 1, 2 }, { 1, 0, 2, 3 }, { 2, 1, 3, 0 }, { 3, 2, 0, 1 } }; - const unsigned char subpath[8][4] = { - { 4, 0, 6, 0 }, { 7, 5, 1, 1 }, { 2, 4, 2, 6 }, { 3, 3, 7, 5 }, - { 0, 2, 4, 4 }, { 5, 1, 5, 3 }, { 6, 6, 0, 2 }, { 1, 7, 3, 7 } }; - static const unsigned char face2path[12] = { - 2, 5, 2, 5, 3, 6, 3, 6, 2, 3, 2, 3 }; - static const unsigned char face2peanoface[12] = { - 0, 5, 6, 11, 10, 1, 4, 7, 2, 3, 8, 9 }; - - int face = pix>>(2*order_); - unsigned char path = face2path[face]; - int64 result = 0; - - for (int shift=2*order_-2; shift>=0; shift-=2) - { - unsigned char spix = (pix>>shift) & 0x3; - result <<= 2; - result |= subpix[path][spix]; - path=subpath[path][spix]; - } - - return result + (int64(face2peanoface[face])<<(2*order_)); - } - -int64 Healpix_Base2::peano2nest (int64 pix) const - { - static const unsigned char subpix[8][4] = { - { 0, 1, 3, 2 }, { 1, 3, 2, 0 }, { 3, 2, 0, 1 }, { 2, 0, 1, 3 }, - { 0, 2, 3, 1 }, { 1, 0, 2, 3 }, { 3, 1, 0, 2 }, { 2, 3, 1, 0 } }; - static const unsigned char subpath[8][4] = { - { 4, 0, 0, 6 }, { 5, 1, 1, 7 }, { 6, 2, 2, 4 }, { 7, 3, 3, 5 }, - { 0, 4, 4, 2 }, { 1, 5, 5, 3 }, { 2, 6, 6, 0 }, { 3, 7, 7, 1 } }; - static const unsigned char face2path[12] = { - 2, 6, 2, 3, 3, 5, 2, 6, 2, 3, 3, 5 }; - static const unsigned char peanoface2face[12] = { - 0, 5, 8, 9, 6, 1, 2, 7, 10, 11, 4, 3 }; - - int face = pix>>(2*order_); - unsigned char path = face2path[face]; - int64 result = 0; - - for (int shift=2*order_-2; shift>=0; shift-=2) - { - unsigned char spix = (pix>>shift) & 0x3; - result <<= 2; - result |= subpix[path][spix]; - path=subpath[path][spix]; - } - - return result + (int64(peanoface2face[face])<<(2*order_)); - } - -int64 Healpix_Base2::ang2pix_z_phi (double z, double phi) const - { - double za = abs(z); - double tt = fmodulo(phi,twopi) * inv_halfpi; // in [0,4) - - if (scheme_==RING) - { - if (za<=twothird) // Equatorial region - { - double temp1 = nside_*(0.5+tt); - double temp2 = nside_*z*0.75; - int64 jp = int64(temp1-temp2); // index of ascending edge line - int64 jm = int64(temp1+temp2); // index of descending edge line - - // ring number counted from z=2/3 - int64 ir = nside_ + 1 + jp - jm; // in {1,2n+1} - int kshift = 1-(ir&1); // kshift=1 if ir even, 0 otherwise - - int64 ip = (jp+jm-nside_+kshift+1)/2; // in {0,4n-1} - ip = imodulo(ip,4*nside_); - - return ncap_ + (ir-1)*4*nside_ + ip; - } - else // North & South polar caps - { - double tp = tt-int(tt); - double tmp = nside_*sqrt(3*(1-za)); - - int64 jp = int64(tp*tmp); // increasing edge line index - int64 jm = int64((1.0-tp)*tmp); // decreasing edge line index - - int64 ir = jp+jm+1; // ring number counted from the closest pole - int64 ip = int64(tt*ir); // in {0,4*ir-1} - ip = imodulo(ip,4*ir); - - if (z>0) - return 2*ir*(ir-1) + ip; - else - return npix_ - 2*ir*(ir+1) + ip; - } - } - else // scheme_ == NEST - { - int face_num, ix, iy; - - if (za<=twothird) // Equatorial region - { - double temp1 = nside_*(0.5+tt); - double temp2 = nside_*(z*0.75); - int64 jp = int64(temp1-temp2); // index of ascending edge line - int64 jm = int64(temp1+temp2); // index of descending edge line - int64 ifp = jp >> order_; // in {0,4} - int64 ifm = jm >> order_; - if (ifp == ifm) // faces 4 to 7 - face_num = (ifp==4) ? 4: ifp+4; - else if (ifp < ifm) // (half-)faces 0 to 3 - face_num = ifp; - else // (half-)faces 8 to 11 - face_num = ifm + 8; - - ix = jm & (nside_-1); - iy = nside_ - (jp & (nside_-1)) - 1; - } - else // polar region, za > 2/3 - { - int ntt = int(tt); - double tp = tt-ntt; - double tmp = nside_*sqrt(3*(1-za)); - - int64 jp = int64(tp*tmp); // increasing edge line index - int64 jm = int64((1.0-tp)*tmp); // decreasing edge line index - if (jp>=nside_) jp = nside_-1; // for points too close to the boundary - if (jm>=nside_) jm = nside_-1; - if (z >= 0) - { - face_num = ntt; // in {0,3} - ix = nside_ - jm - 1; - iy = nside_ - jp - 1; - } - else - { - face_num = ntt + 8; // in {8,11} - ix = jp; - iy = jm; - } - } - - return xyf2nest(ix,iy,face_num); - } - } - -void Healpix_Base2::pix2ang_z_phi (int64 pix, double &z, double &phi) const - { - if (scheme_==RING) - { - if (pix 3*nside_) - { - nr = nl4-jr; - z = nr*nr*fact2_ - 1; - kshift = 0; - } - else - { - nr = nside_; - z = (2*nside_-jr)*fact1_; - kshift = (jr-nside_)&1; - } - - int64 jp = (jpll[face_num]*nr + ix -iy + 1 + kshift) / 2; - if (jp>nl4) jp-=nl4; - if (jp<1) jp+=nl4; - - phi = (jp-(kshift+1)*0.5)*(halfpi/nr); - } - } - -void Healpix_Base2::neighbors (int64 pix, fix_arr &result) const - { - static const int xoffset[] = { -1,-1, 0, 1, 1, 1, 0,-1 }; - static const int yoffset[] = { 0, 1, 1, 1, 0,-1,-1,-1 }; - static const int facearray[][12] = - { { 8, 9,10,11,-1,-1,-1,-1,10,11, 8, 9 }, // S - { 5, 6, 7, 4, 8, 9,10,11, 9,10,11, 8 }, // SE - { -1,-1,-1,-1, 5, 6, 7, 4,-1,-1,-1,-1 }, // E - { 4, 5, 6, 7,11, 8, 9,10,11, 8, 9,10 }, // SW - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }, // center - { 1, 2, 3, 0, 0, 1, 2, 3, 5, 6, 7, 4 }, // NE - { -1,-1,-1,-1, 7, 4, 5, 6,-1,-1,-1,-1 }, // W - { 3, 0, 1, 2, 3, 0, 1, 2, 4, 5, 6, 7 }, // NW - { 2, 3, 0, 1,-1,-1,-1,-1, 0, 1, 2, 3 } }; // N - static const int swaparray[][12] = - { { 0,0,0,0,0,0,0,0,3,3,3,3 }, // S - { 0,0,0,0,0,0,0,0,6,6,6,6 }, // SE - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // E - { 0,0,0,0,0,0,0,0,5,5,5,5 }, // SW - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // center - { 5,5,5,5,0,0,0,0,0,0,0,0 }, // NE - { 0,0,0,0,0,0,0,0,0,0,0,0 }, // W - { 6,6,6,6,0,0,0,0,0,0,0,0 }, // NW - { 3,3,3,3,0,0,0,0,0,0,0,0 } }; // N - - int ix, iy, face_num; - (scheme_==RING) ? - ring2xyf(pix,ix,iy,face_num) : nest2xyf(pix,ix,iy,face_num); - - const int64 nsm1 = nside_-1; - if ((ix>0)&&(ix0)&&(iy=nside_) - { x-=nside_; nbnum+=1; } - if (y<0) - { y+=nside_; nbnum-=3; } - else if (y>=nside_) - { y-=nside_; nbnum+=3; } - - int f = facearray[nbnum][face_num]; - if (f>=0) - { - if (swaparray[nbnum][face_num]&1) x=nside_-x-1; - if (swaparray[nbnum][face_num]&2) y=nside_-y-1; - if (swaparray[nbnum][face_num]&4) std::swap(x,y); - result[i] = (scheme_==RING) ? xyf2ring(x,y,f) : xyf2nest(x,y,f); - } - else - result[i] = -1; - } - } - } - -double Healpix_Base2::max_pixrad() const - { - vec3 va,vb; - va.set_z_phi (2./3., pi/(4*nside_)); - double t1 = 1.-1./nside_; - t1*=t1; - vb.set_z_phi (1-t1/3, 0); - return v_angle(va,vb); - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.h b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.h deleted file mode 100644 index a2f94b24e3..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_base2.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_base2.h - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_BASE2_H -#define HEALPIX_BASE2_H - -#include "healpix_base.h" -#include "datatypes.h" - -/*! Functionality related to the HEALPix pixelisation. Supports resolutions up to - N_side = 2^29. */ -class Healpix_Base2 - { - protected: - enum { order_max=29 }; - - class Tablefiller - { - public: - Tablefiller(); - }; - static Tablefiller Filler; - friend class Tablefiller; - - static short ctab[0x100], utab[0x100]; - - static const int jrll[]; - static const int jpll[]; - - /*! The order of the map; -1 for nonhierarchical map. */ - int order_; - /*! The N_side parameter of the map; 0 if not allocated. */ - int64 nside_; - int64 npface_, ncap_, npix_; - double fact1_, fact2_; - /*! The map's ordering scheme. */ - Healpix_Ordering_Scheme scheme_; - - inline int64 ring_above (double z) const; - void in_ring (int64 iz, double phi0, double dphi, - std::vector &listir) const; - - int64 xyf2nest(int ix, int iy, int face_num) const; - void nest2xyf(int64 pix, int &ix, int &iy, int &face_num) const; - int64 xyf2ring(int ix, int iy, int face_num) const; - void ring2xyf(int64 pix, int &ix, int &iy, int &face_num) const; - - typedef int64 (Healpix_Base2::*swapfunc)(int64 pix) const; - typedef void (Healpix_Base2::*pix2xyf) - (int64 pix, int &x, int &y, int &f) const; - typedef int64 (Healpix_Base2::*xyf2pix) (int x, int y, int f) const; - - public: - /*! Calculates the map order from its \a N_side parameter. - Returns -1 if \a nside is not a power of 2. - \param nside the \a N_side parameter */ - static int nside2order (int64 nside) - { - planck_assert (nside>0, "invalid value for Nside"); - if ((nside)&(nside-1)) return -1; - return ilog2(nside); - } - /*! Calculates the \a N_side parameter from the number of pixels. - \param npix the number of pixels */ - static int64 npix2nside (int64 npix); - /*! Constructs an unallocated object. */ - Healpix_Base2 () - : order_(-1), nside_(0), npface_(0), ncap_(0), npix_(0), - fact1_(0), fact2_(0), scheme_(RING) {} - /*! Constructs an object with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Base2 (int order, Healpix_Ordering_Scheme scheme) - { Set (order, scheme); } - /*! Constructs an object with a given \a nside and the ordering - scheme \a scheme. The \a nside_dummy parameter must be set to - SET_NSIDE. */ - Healpix_Base2 (int64 nside, Healpix_Ordering_Scheme scheme, - const nside_dummy) - { SetNside (nside, scheme); } - - /* Adjusts the object to \a order and \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - planck_assert ((order>=0)&&(order<=order_max), "bad order"); - order_ = order; - nside_ = int64(1)<=0), - "SetNside: nside must be power of 2 for nested maps"); - nside_ = nside; - npface_ = nside_*nside_; - ncap_ = (npface_-nside_)<<1; - npix_ = 12*npface_; - fact2_ = 4./npix_; - fact1_ = (nside_<<1)*fact2_; - scheme_ = scheme; - } - - /*! Returns the z-coordinate of the ring \a ring. This also works - for the (not really existing) rings 0 and 4*nside. */ - double ring2z (int64 ring) const; - /*! Returns the number of the ring in which \a pix lies. */ - int64 pix2ring (int64 pix) const; - - /*! Translates a pixel number from NEST to RING. */ - int64 nest2ring (int64 pix) const; - /*! Translates a pixel number from RING to NEST. */ - int64 ring2nest (int64 pix) const; - /*! Translates a pixel number from NEST to its Peano index. */ - int64 nest2peano (int64 pix) const; - /*! Translates a pixel number from its Peano index to NEST. */ - int64 peano2nest (int64 pix) const; - - int64 ang2pix_z_phi (double z, double phi) const; - - /*! Returns the number of the pixel which contains the angular coordinates - \a ang. */ - int64 ang2pix (const pointing &ang) const - { return ang2pix_z_phi (cos(ang.theta), ang.phi); } - /*! Returns the number of the pixel which contains the vector \a vec - (\a vec is normalized if necessary). */ - int64 vec2pix (const vec3 &vec) const - { return ang2pix_z_phi (vec.z/vec.Length(), safe_atan2(vec.y,vec.x)); } - - void pix2ang_z_phi (int64 pix, double &z, double &phi) const; - - /*! Returns the angular coordinates of the center of the pixel with - number \a pix. */ - pointing pix2ang (int64 pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - return pointing(acos(z),phi); - } - /*! Returns the vector to the center of the pixel with number \a pix. */ - vec3 pix2vec (int64 pix) const - { - double z, phi; - pix2ang_z_phi (pix,z,phi); - vec3 res; - res.set_z_phi (z, phi); - return res; - } - - /*! Returns the numbers of all pixels whose centers lie within \a radius - of \a dir in \a listpix. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method is more efficient in the RING scheme. */ - void query_disc (const pointing &dir, double radius, - std::vector &listpix) const; - /*! Returns the numbers of all pixels that lie at least partially within - \a radius of \a dir in \a listpix. It may also return a few pixels - which do not lie in the disk at all. - \param dir the angular coordinates of the disc center - \param radius the radius (in radians) of the disc - \param listpix a vector containing the numbers of all pixels within - the disc - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ -//FIXME: factor 1.362 not OK! - void query_disc_inclusive (const pointing &dir, double radius, - std::vector &listpix) const - { query_disc (dir,radius+1.362*pi/(4*nside_),listpix); } - - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param costheta the cosine of the colatitude (in radians) of the ring - \param sintheta the sine of the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info (int64 ring, int64 &startpix, int64 &ringpix, - double &costheta, double &sintheta, bool &shifted) const; - /*! Returns useful information about a given ring of the map. - \param ring the ring number (the number of the first ring is 1) - \param startpix the number of the first pixel in the ring - \param ringpix the number of pixels in the ring - \param theta the colatitude (in radians) of the ring - \param shifted if \a true, the center of the first pixel is not at - \a phi=0 */ - void get_ring_info2 (int64 ring, int64 &startpix, int64 &ringpix, - double &theta, bool &shifted) const; - - /*! Returns the neighboring pixels of \a pix in \a result. - On exit, \a result contains (in this order) - the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor - of \a pix. If a neighbor does not exist (this can only be the case - for the W, N, E and S neighbors), its entry is set to -1. - - \note This method works in both RING and NEST schemes, but is - considerably faster in the NEST scheme. */ - void neighbors (int64 pix, fix_arr &result) const; - /*! Returns interpolation information for the direction \a ptg. - The surrounding pixels are returned in \a pix, their corresponding - weights in \a wgt. - \note This method works in both RING and NEST schemes, but is - considerably faster in the RING scheme. */ - void get_interpol (const pointing &ptg, fix_arr &pix, - fix_arr &wgt) const; - - /*! Returns the order parameter of the object. */ - int Order() const { return order_; } - /*! Returns the \a N_side parameter of the object. */ - int64 Nside() const { return nside_; } - /*! Returns the number of pixels of the object. */ - int64 Npix() const { return npix_; } - /*! Returns the ordering scheme of the object. */ - Healpix_Ordering_Scheme Scheme() const { return scheme_; } - - /*! Returns \a true, if both objects have the same nside and scheme, - else \a false. */ - bool conformable (const Healpix_Base2 &other) const - { return ((nside_==other.nside_) && (scheme_==other.scheme_)); } - - /*! Swaps the contents of two Healpix_Base objects. */ - void swap (Healpix_Base2 &other) - { - std::swap(order_,other.order_); - std::swap(nside_,other.nside_); - std::swap(npface_,other.npface_); - std::swap(ncap_,other.ncap_); - std::swap(npix_,other.npix_); - std::swap(fact1_,other.fact1_); - std::swap(fact2_,other.fact2_); - std::swap(scheme_,other.scheme_); - } - - /*! Returns the maximum angular distance (in radian) between any pixel - center and its corners. */ - double max_pixrad() const; - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.cc b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.cc deleted file mode 100644 index 09241e3625..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "healpix_data_io.h" -#include "arr.h" -#include "fitshandle.h" -#include "paramfile.h" -#include "simparams.h" - -using namespace std; - -void read_weight_ring (const string &dir, int nside, arr &weight) - { - fitshandle inp; - inp.open(dir+"/weight_ring_n"+intToString(nside,5)+".fits"); - inp.goto_hdu(2); - weight.alloc (2*nside); - inp.read_column(1,weight); - } - -void get_ring_weights (paramfile ¶ms, simparams &par, int nside, - arr &weight) - { - bool weighted = params.find("weighted",false); - par.add ("weighted","WEIGHTED",weighted,"ring weights used?"); - weight.alloc (2*nside); - if (weighted) - { - string datadir = params.find("healpix_data"); - read_weight_ring (datadir, nside, weight); - for (int m=0; m &temp) - { - fitshandle inp; - inp.open(dir+"/pixel_window_n"+intToString(nside,4)+".fits"); - inp.goto_hdu(2); - if (temp.size()==0) - inp.read_entire_column(1,temp); - else - inp.read_column(1,temp); - } -void read_pixwin (const string &dir, int nside, arr &temp, - arr &pol) - { - fitshandle inp; - inp.open(dir+"/pixel_window_n"+intToString(nside,4)+".fits"); - inp.goto_hdu(2); - if (temp.size()==0) - inp.read_entire_column(1,temp); - else - inp.read_column(1,temp); - if (pol.size()==0) - inp.read_entire_column(2,pol); - else - inp.read_column(2,pol); - } - -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin) - { - bool do_pixwin = params.find("pixel_window",false); - par.add("pixel_window","PIXWIN",do_pixwin,"pixel window used?"); - pixwin.alloc(lmax+1); - pixwin.fill(1); - if (do_pixwin) - { - string datadir = params.find("healpix_data"); - read_pixwin (datadir,nside,pixwin); - } - } -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin, arr &pixwin_pol) - { - bool do_pixwin = params.find("pixel_window",false); - par.add("pixel_window","PIXWIN",do_pixwin,"pixel window used?"); - pixwin.alloc(lmax+1); - pixwin.fill(1); - pixwin_pol.alloc(lmax+1); - pixwin_pol.fill(1); - if (do_pixwin) - { - string datadir = params.find("healpix_data"); - read_pixwin (datadir,nside,pixwin,pixwin_pol); - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.h b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.h deleted file mode 100644 index 6c16108ac9..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_data_io.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef HEALPIX_DATA_IO_H -#define HEALPIX_DATA_IO_H - -#include - -class paramfile; -class simparams; -template class arr; - -void read_weight_ring (const std::string &dir, int nside, - arr &weight); -void get_ring_weights (paramfile ¶ms, simparams &par, int nside, - arr &weight); - -void read_pixwin (const std::string &dir, int nside, arr &temp); -void read_pixwin (const std::string &dir, int nside, arr &temp, - arr &pol); - -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin); -void get_pixwin (paramfile ¶ms, simparams &par, int lmax, - int nside, arr &pixwin, arr &pixwin_pol); - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.cc b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.cc deleted file mode 100644 index ef11b00129..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "healpix_map.h" - -using namespace std; - -template void Healpix_Map::Import_degrade - (const Healpix_Map &orig, bool pessimistic) - { - planck_assert(nside_*to_xyf)(m,x,y,f); - int hits = 0; - double sum = 0; - for (int j=fact*y; j(orig.map[opix],Healpix_undef)) - { - ++hits; - sum += orig.map[opix]; - } - } - map[m] = (hits::Import_degrade - (const Healpix_Map &orig, bool pessimistic); -template void Healpix_Map::Import_degrade - (const Healpix_Map &orig, bool pessimistic); - -template void Healpix_Map::minmax (T &Min, T &Max) const - { - Min = 1e30; Max = -1e30; - for (int m=0; m(val,Healpix_undef)) - { - if (val>Max) Max=val; - if (val::minmax (float &Min, float &Max) const; -template void Healpix_Map::minmax (double &Min, double &Max) const; diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.h b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.h deleted file mode 100644 index 7603d84378..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_map.h - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_MAP_H -#define HEALPIX_MAP_H - -#include "arr.h" -#include "healpix_base.h" - -/*! A HEALPix map of a given datatype */ -template class Healpix_Map: public Healpix_Base - { - private: - arr map; - - public: - /*! Constructs an unallocated map. */ - Healpix_Map () {} - /*! Constructs a map with a given \a order and the ordering - scheme \a scheme. */ - Healpix_Map (int order, Healpix_Ordering_Scheme scheme) - : Healpix_Base (order, scheme), map(npix_) {} - /*! Constructs a map with a given \a nside and the ordering - scheme \a scheme. */ - Healpix_Map (int nside, Healpix_Ordering_Scheme scheme, const nside_dummy) - : Healpix_Base (nside, scheme, SET_NSIDE), map(npix_) {} - /*! Constructs a map from the contents of \a data and sets the ordering - scheme to \a Scheme. The size of \a data must be a valid HEALPix - map size. */ - Healpix_Map (const arr &data, Healpix_Ordering_Scheme scheme) - : Healpix_Base (npix2nside(data.size()), scheme, SET_NSIDE), map(data) {} - - /*! Deletes the old map, creates a map from the contents of \a data and - sets the ordering scheme to \a scheme. The size of \a data must be a - valid HEALPix map size. */ - void Set (arr &data, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::SetNside(npix2nside (data.size()), scheme); - map.transfer(data); - } - - /*! Deletes the old map and creates a new map with a given \a order - and the ordering scheme \a scheme. */ - void Set (int order, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::Set(order, scheme); - map.alloc(npix_); - } - /*! Deletes the old map and creates a new map with a given \a nside - and the ordering scheme \a scheme. */ - void SetNside (int nside, Healpix_Ordering_Scheme scheme) - { - Healpix_Base::SetNside(nside, scheme); - map.alloc(npix_); - } - - /*! Fills the map with \a val. */ - void fill (const T &val) - { map.fill(val); } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme. \a orig must have the same resolution as the - current map. */ - void Import_nograde (const Healpix_Map &orig) - { - planck_assert (nside_==orig.nside_, - "Import_nograde: maps have different nside"); - if (orig.scheme_ == scheme_) - for (int m=0; m*swapper)(m)] = orig.map[m]; -} - } - } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution. \a orig must have higher - resolution than the current map. */ - void Import_upgrade (const Healpix_Map &orig) - { - planck_assert(nside_>orig.nside_,"Import_upgrade: this is no upgrade"); - int fact = nside_/orig.nside_; - planck_assert (nside_==orig.nside_*fact, - "the larger Nside must be a multiple of the smaller one"); - pix2xyf to_xyf = (orig.scheme_==RING) ? - &Healpix_Map::ring2xyf : &Healpix_Map::nest2xyf; - xyf2pix from_xyf = (scheme_==RING) ? - &Healpix_Map::xyf2ring : &Healpix_Map::xyf2nest; - -#pragma omp parallel -{ - int m; -#pragma omp for schedule (dynamic,5000) - for (m=0; m*from_xyf)(i,j,f); - map[mypix] = orig.map[m]; - } - } -} - } - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution. \a orig must have higher - resolution than the current map. - \a pessimistic determines whether or not - pixels are set to \a Healpix_undef when not all of the corresponding - high-resolution pixels are defined. - - This method is instantiated for \a float and \a double only. */ - void Import_degrade (const Healpix_Map &orig, bool pessimistic=false); - - /*! Imports the map \a orig into the current map, adjusting the - ordering scheme and the map resolution if necessary. - When downgrading, \a pessimistic determines whether or not - pixels are set to \a Healpix_undef when not all of the corresponding - high-resolution pixels are defined. - - This method is instantiated for \a float and \a double only. */ - void Import (const Healpix_Map &orig, bool pessimistic=false) - { - if (orig.nside_ == nside_) // no up/degrading - Import_nograde(orig); - else if (orig.nside_ < nside_) // upgrading - Import_upgrade(orig); - else - Import_degrade(orig,pessimistic); - } - - /*! Returns a constant reference to the pixel with the number \a pix. */ - const T &operator[] (int pix) const { return map[pix]; } - /*! Returns a reference to the pixel with the number \a pix. */ - T &operator[] (int pix) { return map[pix]; } - - /*! Swaps the map ordering from RING to NEST and vice versa. - This is done in-place (i.e. with negligible space overhead). */ - void swap_scheme() - { - static const int clen[] = { 0,7,5,4,12,10,13,18,14,19,18,17,27,21 }; - static const int cycle[][30] = { - { }, - { 0,1,8,12,16,21,40 }, - { 0,1,2,40,114 }, - { 0,4,160,263 }, - { 0,4,30,49,51,87,526,1027,1105,1387,1807,2637 }, - { 0,8,10,18,39,74,146,307,452,4737 }, - { 0,1,2,7,9,17,80,410,1526,1921,32859,33566,38931 }, - { 0,5,6,10,12,24,27,95,372,494,924,1409,3492,4248,9137,66043,103369, - 156899 }, - { 0,1,2,3,4,45,125,351,697,24337,102940,266194,341855,419857 }, - { 0,1,2,3,9,16,1705,2082,2126,8177,12753,15410,52642,80493,83235, - 88387,99444,1675361,2495125 }, - { 0,2,6,8,9,11,20,50,93,152,183,2137,13671,44794,486954,741908, - 4803258,5692573 }, - { 0,1,5,6,44,53,470,2847,3433,4906,13654,14710,400447,1797382, - 2744492,18775974,23541521 }, - { 0,4,9,10,16,33,83,117,318,451,5759,10015,128975,171834,211256, - 347608,1278690,2154097,2590798,3427694,5581717,21012301,27023976, - 72522811,95032729,139166747,171822389 }, - { 0,5,10,267,344,363,2968,3159,9083,18437,76602,147614,1246902, - 1593138,2035574,6529391,9511830,11340287,29565945,281666026, - 677946848 } }; - - swapfunc swapper = (scheme_ == NEST) ? - &Healpix_Base::ring2nest : &Healpix_Base::nest2ring; - - planck_assert (order_>=0, "swap_scheme(): need hierarchical map"); - - for (int m=0; m*swapper)(istart); - while (inew != istart) - { - map[iold] = map[inew]; - iold = inew; - inew = (this->*swapper)(inew); - } - map[iold] = pixbuf; - } - scheme_ = (scheme_==RING) ? NEST : RING; - } - - /*! performs the actual interpolation using \a pix and \a wgt. */ - T interpolation (const fix_arr &pix, - const fix_arr &wgt) const - { - return map[pix[0]]*wgt[0] + map[pix[1]]*wgt[1] - + map[pix[2]]*wgt[2] + map[pix[3]]*wgt[3]; - } - /*! Returns the interpolated map value at \a ptg */ - T interpolated_value (const pointing &ptg) const - { - fix_arr pix; - fix_arr wgt; - get_interpol (ptg, pix, wgt); - return interpolation (pix, wgt); - } - - /*! Returns a constant reference to the map data. */ - const arr &Map() const { return map; } - - /*! Returns the minimum and maximum value of the map in - \a Min and \a Max. - - This method is instantiated for \a float and \a double only. */ - void minmax (T &Min, T &Max) const; - - /*! Swaps the contents of two Healpix_Map objects. */ - void swap (Healpix_Map &other) - { - Healpix_Base::swap(other); - map.swap(other.map); - } - - /*! Returns the average of all defined map pixels. */ - double average() const - { - double avg=0; - int pix=0; - for (int m=0; m(map[m],Healpix_undef)) - { ++pix; avg+=map[m]; } - return avg/pix; - } - - /*! Adds \a val to all defined map pixels. */ - void add (T val) - { - for (int m=0; m(map[m],Healpix_undef)) - { map[m]+=val; } - } - - /*! Returns the root mean square of the map, not counting undefined - pixels. */ - double rms() const - { - using namespace std; - - double result=0; - int pix=0; - for (int m=0; m(map[m],Healpix_undef)) - { ++pix; result+=map[m]*map[m]; } - return sqrt(result/pix); - } - /*! Returns the maximum absolute value in the map, ignoring undefined - pixels. */ - T absmax() const - { - using namespace std; - - T result=0; - for (int m=0; m(map[m],Healpix_undef)) - { result = max(result,abs(map[m])); } - return result; - } - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.cc b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.cc deleted file mode 100644 index 0248b99f0b..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.cc +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "healpix_map_fitsio.h" -#include "healpix_map.h" -#include "fitshandle.h" - -using namespace std; - -template void read_Healpix_map_from_fits - (fitshandle &inp, Healpix_Map &map, int colnum) - { - string ordering; - inp.get_key ("ORDERING", ordering); - arr myarr; - inp.read_entire_column (colnum, myarr); - map.Set (myarr, ordering=="RING" ? RING : NEST); - } - -template void read_Healpix_map_from_fits (fitshandle &inp, - Healpix_Map &map, int colnum); -template void read_Healpix_map_from_fits (fitshandle &inp, - Healpix_Map &map, int colnum); -template void read_Healpix_map_from_fits (fitshandle &inp, - Healpix_Map &map, int colnum); - - -template void read_Healpix_map_from_fits - (const string &filename, Healpix_Map &map, int colnum, int hdunum) - { - fitshandle inp; - inp.open (filename); - inp.goto_hdu (hdunum); - read_Healpix_map_from_fits (inp,map,colnum); - } - -template void read_Healpix_map_from_fits (const string &filename, - Healpix_Map &map, int colnum, int hdunum); -template void read_Healpix_map_from_fits (const string &filename, - Healpix_Map &map, int colnum, int hdunum); -template void read_Healpix_map_from_fits (const string &filename, - Healpix_Map &map, int colnum, int hdunum); - - -void prepare_Healpix_fitsmap - (fitshandle &out, const Healpix_Base &base, int datatype, - const arr &colname) - { - vector cols; - int repcount = healpix_repcount (base.Npix()); - for (int m=0; m void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype) - { - arr colname(1); - colname[0] = "signal"; - prepare_Healpix_fitsmap (out, map, datatype, colname); - out.write_column(1,map.Map()); - } - -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype); -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype); -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype); - - -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &mapT, - const Healpix_Map &mapQ, const Healpix_Map &mapU, int datatype) - { - arr colname(3); - colname[0] = "signal"; - colname[1] = "Q-pol"; - colname[2] = "U-pol"; - prepare_Healpix_fitsmap (out, mapT, datatype, colname); - out.write_column(1,mapT.Map()); - out.write_column(2,mapQ.Map()); - out.write_column(3,mapU.Map()); - } - -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &mapT, - const Healpix_Map &mapQ, const Healpix_Map &mapU, - int datatype); -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &mapT, - const Healpix_Map &mapQ, const Healpix_Map &mapU, - int datatype); diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.h deleted file mode 100644 index d073adccb6..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/healpix_map_fitsio.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file healpix_map_fitsio.h - * Copyright (C) 2003, 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef HEALPIX_MAP_FITSIO_H -#define HEALPIX_MAP_FITSIO_H - -#include - -class fitshandle; -class Healpix_Base; - -template class arr; -template class Healpix_Map; - -/*! \defgroup healpix_map_fitsio_group FITS-based I/O of HEALPix maps */ -/*! \{ */ - -/*! Reads the map stored in column \a colnum of the FITS binary table - pointed to by \a inp into \a map. */ -template void read_Healpix_map_from_fits - (fitshandle &inp, Healpix_Map &map, int colnum=1); -/*! Opens the FITS file \a filename, jumps to the HDU \a hdunum, - and reads the column \a colnum into \a map. */ -template void read_Healpix_map_from_fits - (const std::string &filename, Healpix_Map &map, int colnum=1, - int hdunum=2); - -/*! Inserts a new binary table into \a out, which contains one column - of FITS type \a datatype with the name \a name, and writes all HEALPix - specific keywords based on the information in \a base. */ -void prepare_Healpix_fitsmap - (fitshandle &out, const Healpix_Base &base, int datatype, - const arr &colname); - -/*! Inserts a new binary table into \a out, which contains one column - of FITS type \a datatype, and stores \a map into this column. */ -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &map, int datatype); -/*! Inserts a new binary table into \a out, which contains three columns - of FITS type \a datatype, and stores \a mapT, \a mapQ and \a mapU - into these columns. */ -template void write_Healpix_map_to_fits - (fitshandle &out, const Healpix_Map &mapT, - const Healpix_Map &mapQ, const Healpix_Map &mapU, int datatype); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/hotspots_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/hotspots_cxx.cc deleted file mode 100644 index c6e91684a3..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/hotspots_cxx.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include -#include "cxxutils.h" -#include "paramfile.h" -#include "simparams.h" -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "fitshandle.h" - -using namespace std; - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("hotspots_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - string infile = params.find("infile"); - string mapfile = params.find("outmap",""); - bool have_mapfile = mapfile!=""; - string minfile = params.find("minfile",""); - bool have_minfile = minfile!=""; - string maxfile = params.find("maxfile",""); - bool have_maxfile = maxfile!=""; - planck_assert (have_mapfile || have_minfile || have_maxfile, - "no output file specified"); - - Healpix_Map inmap; - read_Healpix_map_from_fits(infile,inmap,1,2); - Healpix_Map outmap; - if (have_mapfile) outmap.Set(inmap.Order(),inmap.Scheme()); - - ofstream minout, maxout; - if (have_minfile) minout.open(minfile.c_str()); - if (have_maxfile) maxout.open(maxfile.c_str()); - - fix_arr nb; -// FIXME: This should be parallelized - for (int m=0; m(value, Healpix_undef)) - { - inmap.neighbors(m,nb); - bool ismax=true, ismin=true; - for (int n=0; n=0) - { - float nbval = inmap[nb[n]]; - if (!approx(nbval, Healpix_undef)) - { - if (nbval>=value) ismax=false; - if (nbval<=value) ismin=false; - } - } - } - if (have_mapfile) outmap[m] = (ismax||ismin) ? value : Healpix_undef; - if (have_minfile && ismin) minout << m << " " << value << endl; - if (have_maxfile && ismax) maxout << m << " " << value << endl; - } - } - if (have_mapfile) - { - fitshandle out; - out.create (mapfile); - write_Healpix_map_to_fits (out,outmap,TFLOAT); - } -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/hpxtest.cc b/src/amuse_simplex/src/plugins/HEALPix/src/hpxtest.cc deleted file mode 100644 index 4970504b6d..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/hpxtest.cc +++ /dev/null @@ -1,698 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2004, 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -/* - -Candidates for testing the validity of the Healpix routines: - -- done: ang2pix(pix2ang(i)) = i for all Healpix_Bases -- done: pix2ang(ang2pix(ptg)) dot ptg > 1-delta for all Healpix_Bases -- done: ring2nest(nest2ring(i)) = i for all hierarchical Healpix_Bases -- done: downgrade(upgrade(map)) = map for all maps -- done: map and downgraded map should have same average -- done: alm2map(map2alm(map)) approx map (same for pol) -- partly done: neighbor tests -- powspec -> alm -> powspec (should produce similar powspecs, also for pol) -- done: two swap_schemes() should produce original map -- done: query_disc tests (dot products etc.) -- a_lms: test Set(), Scale(), Add(), alm(l,m) = alm.mstart(m)[l], etc. - -*/ - -#include -#include "healpix_base.h" -#include "healpix_base2.h" -#include "healpix_map.h" -#include "arr.h" -#include "planck_rng.h" -#include "lsconstants.h" -#include "alm.h" -#include "alm_healpix_tools.h" -#include "alm_powspec_tools.h" -#include "geom_utils.h" - -using namespace std; - -const int nsamples = 1000000; - -planck_rng rng; - -void random_dir (pointing &ptg) - { - ptg.theta = acos(rng.rand_uni()*2-1); - ptg.phi = rng.rand_uni()*twopi; - } - -void check_ringnestring() - { - cout << "testing ring2nest(nest2ring(m))==m" << endl; - for (int order=0; order<=13; ++order) - { - cout << "order = " << order << endl; - Healpix_Base base (order,RING); - for (int m=0; m=0) && (v_angle(base2.pix2ang(nb[n]),pixpt)>maxang)) - cout << " PROBLEM2: order = " << order << ", pix = " << pix << endl; - } - } - for (int nside=3; nside<(1<<13); nside+=nside/2+1) - { - cout << "nside = " << nside << endl; - Healpix_Base base (nside,RING,SET_NSIDE); - double maxang = 2.01*base.max_pixrad(); - for (int m=0; m nb; - vec3 pixpt = base.pix2ang(pix); - base.neighbors(pix,nb); - for (int n=0; n<8; ++n) - if ((nb[n]>=0) && (v_angle(base.pix2ang(nb[n]),pixpt)>maxang)) - cout << " PROBLEM: nside = " << nside << ", pix = " << pix << endl; - } - } - } -void check_neighbors2() - { - cout << "testing neighbor function" << endl; - for (int order=0; order<=29; ++order) - { - cout << "order = " << order << endl; - Healpix_Base2 base (order,NEST), base2(order,RING); - double maxang = 2.01*base.max_pixrad(); - for (int m=0; m nb; - vec3 pixpt = base.pix2ang(pix); - base.neighbors(pix,nb); - sort(&nb[0],&nb[0]+8); - int check=0; - for (int n=0; n<8; ++n) - { - if (nb[n]<0) - { - ++check; - } - else - { - if (v_angle(base.pix2ang(nb[n]),pixpt)>maxang) - cout << " PROBLEM: order = " << order << ", pix = " << pix << endl; - if ((n>0) && (nb[n]==nb[n-1])) - cout << " PROBLEM: order = " << order << ", pix = " << pix << endl; - } - } - planck_assert((check<=1)||((order==0)&&(check<=2)),"too few neighbors"); - pixpt = base2.pix2ang(pix); - base2.neighbors(pix,nb); - for (int n=0; n<8; ++n) - if ((nb[n]>=0) && (v_angle(base2.pix2ang(nb[n]),pixpt)>maxang)) - cout << " PROBLEM2: order = " << order << ", pix = " << pix << endl; - } - } - for (int nside=3; nside<(1<<29); nside+=nside/2+1) - { - cout << "nside = " << nside << endl; - Healpix_Base2 base (nside,RING,SET_NSIDE); - double maxang = 2.01*base.max_pixrad(); - for (int m=0; m nb; - vec3 pixpt = base.pix2ang(pix); - base.neighbors(pix,nb); - for (int n=0; n<8; ++n) - if ((nb[n]>=0) && (v_angle(base.pix2ang(nb[n]),pixpt)>maxang)) - cout << " PROBLEM: nside = " << nside << ", pix = " << pix << endl; - } - } - } - -void check_swap_scheme() - { - cout << "testing whether double swap_scheme() returns the original map" - << endl << "(for orders 0 to 10)." << endl; - for (int order=0; order<=10; ++order) - { - cout << "order = " << order << endl; - Healpix_Map map(order,NEST); - for (int m=0; m >&almT, Alm >&almG, - Alm >&almC, int lmax, int mmax) - { - almT.Set(lmax,mmax); almG.Set(lmax,mmax); almC.Set(lmax,mmax); - - for (int l=0; l<=lmax; ++l) - { - almT(l,0).re=rng.rand_gauss(); almT(l,0).im=0.; - almG(l,0).re=rng.rand_gauss(); almG(l,0).im=0.; - almC(l,0).re=rng.rand_gauss(); almC(l,0).im=0.; - } - - for (int m=1; m<=mmax; ++m) - for (int l=m; l<=lmax; ++l) - { - almT(l,m).re=rng.rand_gauss(); almT(l,m).im=rng.rand_gauss(); - almG(l,m).re=rng.rand_gauss(); almG(l,m).im=rng.rand_gauss(); - almC(l,m).re=rng.rand_gauss(); almC(l,m).im=rng.rand_gauss(); - } - almG(0,0)=almC(0,0)=almG(1,0)=almC(1,0)=almG(1,1)=almC(1,1)=0; - } - -void random_alm (Alm >&alm, int lmax, int mmax) - { - alm.Set(lmax,mmax); - - for (int l=0; l<=lmax; ++l) - { alm(l,0).re=rng.rand_gauss(); alm(l,0).im=0.; } - - for (int m=1; m<=mmax; ++m) - for (int l=m; l<=lmax; ++l) - { alm(l,m).re=rng.rand_gauss(); alm(l,m).im=rng.rand_gauss(); } - } - -void check_alm (const Alm >&oalm, - const Alm >&alm, double epsilon) - { - for (int m=0; m<=alm.Mmax(); ++m) - for (int l=m; l<=alm.Lmax(); ++l) - { - if (!abs_approx(oalm(l,m).re,alm(l,m).re,epsilon)) - cout << "Problemr " << l << " " << m << endl; - if (!abs_approx(oalm(l,m).im,alm(l,m).im,epsilon)) - cout << "Problemi " << l << " " << m << endl; - } - } - -void check_alm2map2alm (int lmax, int mmax, int nside) - { - cout << "testing whether a_lm->map->a_lm returns original a_lm" << endl; - cout << "lmax=" << lmax <<", mmax=" << mmax << ", nside=" << nside << endl; - const double epsilon = 1e-8; - Alm > oalmT(lmax,mmax),almT(lmax,mmax), - oalmG(lmax,mmax),almG(lmax,mmax),oalmC(lmax,mmax),almC(lmax,mmax); - Healpix_Map mapT(nside,RING,SET_NSIDE), mapQ(nside,RING,SET_NSIDE), - mapU(nside,RING,SET_NSIDE); - - random_alm(oalmT,oalmG,oalmC,lmax,mmax); - alm2map(oalmT,mapT); - map2alm_iter2(mapT,almT,1e-12,1e-12); - check_alm (oalmT, almT, epsilon); - - alm2map_pol(oalmT,oalmG,oalmC,mapT,mapQ,mapU); - map2alm_pol_iter2(mapT,mapQ,mapU,almT,almG,almC,1e-12,1e-12); - check_alm (oalmT, almT, epsilon); - check_alm (oalmG, almG, epsilon); - check_alm (oalmC, almC, epsilon); - } - -void check_smooth_alm () - { - cout << "testing whether unsmooth(smooth(a_lm)) returns a_lm" << endl; - const double epsilon = 1e-14; - const double fwhm_arcmin = 100; - const int lmax=300, mmax=300; - Alm > oalmT(lmax,mmax),almT(lmax,mmax), - oalmG(lmax,mmax),almG(lmax,mmax),oalmC(lmax,mmax),almC(lmax,mmax); - - random_alm(oalmT,oalmG,oalmC,lmax,mmax); - - almT=oalmT; almG=oalmG; almC=oalmC; - smooth_with_Gauss (almT, fwhm_arcmin); - smooth_with_Gauss (almT, -fwhm_arcmin); - check_alm (oalmT, almT, epsilon); - almT=oalmT; - smooth_with_Gauss (almT, almG, almC, fwhm_arcmin); - smooth_with_Gauss (almT, almG, almC, -fwhm_arcmin); - check_alm (oalmT, almT, epsilon); - check_alm (oalmG, almG, epsilon); - check_alm (oalmC, almC, epsilon); - } - -void check_rot_alm () - { - cout << "testing whether rot^-1(rot(a_lm)) returns a_lm" << endl; - const double epsilon = 2e-13; - const int lmax=300; - Alm > oalm(lmax,lmax),alm(lmax,lmax); - - random_alm(oalm,lmax,lmax); - - alm=oalm; - rotate_alm (alm,3,4,5); - rotate_alm (alm,-5,-4,-3); - check_alm (oalm, alm, epsilon); - } - -int main() - { - check_smooth_alm(); - check_rot_alm(); - check_alm2map2alm(620,620,256); - check_alm2map2alm(620,2,256); - check_average(); - check_import(); - check_neighbors(); - check_neighbors2(); - check_pixangpix(); - check_pixangpix2(); - check_pixvecpix(); - check_pixvecpix2(); - check_angpixang(); - check_angpixang2(); - check_ringnestring(); - check_ringnestring2(); - check_nestpeanonest(); - check_nestpeanonest2(); - check_query_disc(); - check_swap_scheme(); - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/Makefile b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/Makefile deleted file mode 100644 index 10a317ab69..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -MPICXX ?= mpicxx - -HEADERS= ls_fft.h - -#include $(PARAMFILE) -INCDIR = ../../include -LIBDIR = ../../lib - -INCLUDE = -I$(INCDIR) - -all: libfftpack.a - -%.o : %.cc - $(MPICXX) $(CXXCFLAGS) -o $@ -c $< $(INCLUDE) - -clean: - $(RM) *.o *.a - - -FFTPACK_OBJ= fftpack.o bluestein.o ls_fft.o - -fftpack.o: fftpack.h -bluestein.o: bluestein.h fftpack.h -ls_fft.o: ls_fft.h bluestein.h fftpack.h - -libfftpack.a: $(FFTPACK_OBJ) $(HEADERS) - $(ARCREATE) libfftpack.a $(FFTPACK_OBJ) diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/README b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/README deleted file mode 100644 index d158364d51..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/README +++ /dev/null @@ -1,36 +0,0 @@ -ls_fft description: - -This package is intended to calculate one-dimensional real or complex FFTs -with high accuracy and good efficiency even for lengths containing large -prime factors. -The code is written in C, but a Fortran wrapper exists as well. - -Before any FFT is executed, a plan must be generated for it. Plan creation -is designed to be fast, so that there is no significant overhead if the -plan is only used once or a few times. - -The main component of the code is a C port of Swarztrauber's FFTPACK -(http://www.netlib.org/fftpack/), which was originally done by Pekka Janhunen -and reformatted by Joerg Arndt. - -I added a few digits to the floating-point constants to achieve higher -precision, split the complex transforms into separate routines for forward -and backward transforms (to increase performance a bit), and replaced -the iterative twiddling factor calculation in radfg() and radbg() by an exact -calculation of the factors. - -Since FFTPACK becomes quite slow for FFT lengths with large prime factors -(in the worst case of prime lengths it reaches O(n*n) complexity), I -implemented Bluestein's algorithm, which computes a FFT of length n by -several FFTs of length n2>=2*n and a convolution. Since n2 can be chosen -to be highly composite, this algorithm is more efficient if n has large -prime factors. The longer FFTs themselves are then computed using the FFTPACK -routines. -Bluestein's algorithm was implemented according to the description at -http://en.wikipedia.org/wiki/Bluestein's_FFT_algorithm. - -Thread-safety: -All routines can be called concurrently; all information needed by ls_fft -is stored in the plan variable. However, using the same plan variable on -multiple threads simultaneously is not supported and will lead to data -corruption. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.c b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.c deleted file mode 100644 index af78deb94a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005, 2006, 2007 Max-Planck-Society - * \author Martin Reinecke - */ - -#include -#include -#include "fftpack.h" -#include "bluestein.h" - -/* returns the sum of all prime factors of n */ -int prime_factor_sum (int n) - { - int result=0,x,limit,tmp; - while (((tmp=(n>>1))<<1)==n) - { result+=2; n=tmp; } - - limit=sqrt(n+0.01); - for (x=3; x<=limit; x+=2) - while ((tmp=(n/x))*x==n) - { - result+=x; - n=tmp; - limit=sqrt(n+0.01); - } - if (n>1) result+=n; - - return result; - } - -/* returns the smallest composite of 2, 3 and 5 which is >= n */ -static int good_size(int n) - { - int maxfactors=1, i, j, k, f2=1, f3, f5, bestfac, guessfac; - while ((n>>maxfactors)>0) - ++maxfactors; - bestfac=1<bestfac) break; - f5=1; - for (k=0; k=bestfac) break; - if ((guessfac>=n) && (guessfac=2*n) coeff-=2*n; - angle = pibyn*coeff; - bk[2*m] = cos(angle); - bk[2*m+1] = sin(angle); - } - -/* initialize the zero-padded, Fourier transformed b_k. Add normalisation. */ - xn2 = 1./n2; - bkf[0] = bk[0]*xn2; - bkf[1] = bk[1]*xn2; - for (m=2; m<2*n; m+=2) - { - bkf[m] = bkf[2*n2-m] = bk[m] *xn2; - bkf[m+1] = bkf[2*n2-m+1] = bk[m+1] *xn2; - } - for (m=2*n;m<=(2*n2-2*n+1);++m) - bkf[m]=0.; - cffti (n2,work); - cfftf (n2,bkf,work); - } - -void bluestein (int n, double *data, double *tstorage, int isign) - { - int n2=*((int *)tstorage); - int m; - double *bk, *bkf, *akf, *work; - bk = tstorage+1; - bkf = tstorage+1+2*n; - work= tstorage+1+2*(n+n2); - akf = tstorage+1+2*n+6*n2+15; - -/* initialize a_k and FFT it */ - if (isign>0) - for (m=0; m<2*n; m+=2) - { - akf[m] = data[m]*bk[m] - data[m+1]*bk[m+1]; - akf[m+1] = data[m]*bk[m+1] + data[m+1]*bk[m]; - } - else - for (m=0; m<2*n; m+=2) - { - akf[m] = data[m]*bk[m] + data[m+1]*bk[m+1]; - akf[m+1] =-data[m]*bk[m+1] + data[m+1]*bk[m]; - } - for (m=2*n; m<2*n2; ++m) - akf[m]=0; - - cfftf (n2,akf,work); - -/* do the convolution */ - if (isign>0) - for (m=0; m<2*n2; m+=2) - { - double im = -akf[m]*bkf[m+1] + akf[m+1]*bkf[m]; - akf[m ] = akf[m]*bkf[m] + akf[m+1]*bkf[m+1]; - akf[m+1] = im; - } - else - for (m=0; m<2*n2; m+=2) - { - double im = akf[m]*bkf[m+1] + akf[m+1]*bkf[m]; - akf[m ] = akf[m]*bkf[m] - akf[m+1]*bkf[m+1]; - akf[m+1] = im; - } - - -/* inverse FFT */ - cfftb (n2,akf,work); - -/* multiply by b_k* */ - if (isign>0) - for (m=0; m<2*n; m+=2) - { - data[m] = bk[m] *akf[m] - bk[m+1]*akf[m+1]; - data[m+1] = bk[m+1]*akf[m] + bk[m] *akf[m+1]; - } - else - for (m=0; m<2*n; m+=2) - { - data[m] = bk[m] *akf[m] + bk[m+1]*akf[m+1]; - data[m+1] =-bk[m+1]*akf[m] + bk[m] *akf[m+1]; - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.h b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.h deleted file mode 100644 index 0c9ab7db85..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/bluestein.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_BLUESTEIN_H -#define PLANCK_BLUESTEIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -int prime_factor_sum (int n); - -void bluestein_i (int n, double **tstorage); -void bluestein (int n, double *data, double *tstorage, int isign); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/fftpack.c b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/fftpack.c deleted file mode 100644 index 522afc5cc7..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/fftpack.c +++ /dev/null @@ -1,1827 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * This file was originally part of tela the Tensor Language. - * Copyright (C) 1994-1995 Pekka Janhunen - */ - -/* - fftpack.c : A set of FFT routines in C. - Algorithmically based on Fortran-77 FFTPACK by Paul N. Swarztrauber - (Version 4, 1985). - - Pekka Janhunen 23.2.1995 - - (reformatted by joerg arndt) - - reformatted and slightly enhanced by Martin Reinecke (2004) - */ - -#include -#include -#include -#include "fftpack.h" - -static void passf2(int ido, int l1, const double *cc, double *ch, - const double *wa1) - { - int i, k, ah, ac; - double ti2, tr2; - - if(ido<=2) - { - for(k=0; kidp) - idlj-=idp; - war=wa[idlj-2]; - wai=wa[idlj-1]; - for(ik=0; ikidp) - idlj-=idp; - war=wa[idlj-2]; - wai=wa[idlj-1]; - for(ik=0; ik=2*ip) aidx-=2*ip; - ar2=csarr[aidx]; - ai2=csarr[aidx+1]; - for(ik=0; ik=2*ip) aidx-=2*ip; - ar2=csarr[aidx]; - ai2=csarr[aidx+1]; - for(ik=0; ik5) - { - wa[i1-1]=wa[i-1]; - wa[i1]=wa[i]; - } - } - l1=l2; - } - } - -void cffti(int n, double wsave[]) - { - if (n!=1) - cffti1(n, wsave+2*n,(int*)(wsave+4*n)); - } - - -/*---------------------------------------------------------------------- - rfftf1, rfftb1, rfftf, rfftb, rffti1, rffti. Real FFTs. - ----------------------------------------------------------------------*/ - -static void rfftf1(int n, double c[], double ch[], const double wa[], - const int ifac[]) - { - int i, k1, l1, l2, na, kh, nf, ip, iw, ido, idl1; - double *p1, *p2; - - nf=ifac[1]; - na=1; - l2=n; - iw=n-1; - for(k1=1; k1<=nf;++k1) - { - kh=nf-k1; - ip=ifac[kh+2]; - l1=l2 / ip; - ido=n / l2; - idl1=ido*l1; - iw-=(ip-1)*ido; - na=1-na; - p1 = (na==0) ? c : ch; - p2 = (na==0) ? ch : c; - if(ip==4) - radf4(ido, l1, p1, p2, wa+iw, wa+iw+ido, wa+iw+2*ido); - else if(ip==2) - radf2(ido, l1, p1, p2, wa+iw); - else if(ip==3) - radf3(ido, l1, p1, p2, wa+iw, wa+iw+ido); - else if(ip==5) - radf5(ido, l1, p1, p2, wa+iw, wa+iw+ido, wa+iw+2*ido, wa+iw+3*ido); - else - { - if(ido==1) - na=1-na; - if(na==0) - radfg(ido, ip, l1, idl1, c, ch, wa+iw); - else - radfg(ido, ip, l1, idl1, ch, c, wa+iw); - na=1-na; - } - l2=l1; - } - if(na==1) - return; - for(i=0; i -
  • \ref fftgroup "Programming interface" - - */ diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.c b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.c deleted file mode 100644 index 3be8f6218a..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005 Max-Planck-Society - * \author Martin Reinecke - */ - -#include -#include -#include -#include "bluestein.h" -#include "fftpack.h" -#include "ls_fft.h" - -complex_plan make_complex_plan (int length) - { - complex_plan plan = (complex_plan) malloc(sizeof(complex_plan_i)); - int pfsum = prime_factor_sum(length); - double comp1 = length*pfsum; - double comp2 = 2*3*length*log(3.*length); - plan->length=length; - plan->bluestein = (comp2bluestein) - bluestein_i (length,&(plan->work)); - else - { - plan->work=(double *)malloc((4*length+15)*sizeof(double)); - cffti(length, plan->work); - } - return plan; - } - -void kill_complex_plan (complex_plan plan) - { - free(plan->work); - free(plan); - } - -void complex_plan_forward (complex_plan plan, double *data) - { - if (plan->bluestein) - bluestein (plan->length, data, plan->work, -1); - else - cfftf (plan->length, data, plan->work); - } - -void complex_plan_backward (complex_plan plan, double *data) - { - if (plan->bluestein) - bluestein (plan->length, data, plan->work, 1); - else - cfftb (plan->length, data, plan->work); - } - - -real_plan make_real_plan (int length) - { - real_plan plan = (real_plan) malloc(sizeof(real_plan_i)); - int pfsum = prime_factor_sum(length); - double comp1 = .5*length*pfsum; - double comp2 = 2*3*length*log(3.*length); - plan->length=length; - plan->bluestein = (comp2bluestein) - bluestein_i (length,&(plan->work)); - else - { - plan->work=(double *)malloc((2*length+15)*sizeof(double)); - rffti(length, plan->work); - } - return plan; - } - -void kill_real_plan (real_plan plan) - { - free(plan->work); - free(plan); - } - -void real_plan_forward_fftpack (real_plan plan, double *data) - { - if (plan->bluestein) - { - int m; - int n=plan->length; - double *tmp = (double *)malloc(2*n*sizeof(double)); - for (m=0; mwork,-1); - data[0] = tmp[0]; - memcpy (data+1, tmp+2, (n-1)*sizeof(double)); - free (tmp); - } - else - rfftf (plan->length, data, plan->work); - } - -static void fftpack2halfcomplex (double *data, int n) - { - int m; - double *tmp = (double *)malloc(n*sizeof(double)); - tmp[0]=data[0]; - for (m=1; m<(n+1)/2; ++m) - { - tmp[m]=data[2*m-1]; - tmp[n-m]=data[2*m]; - } - if (!(n&1)) - tmp[n/2]=data[n-1]; - memcpy (data,tmp,n*sizeof(double)); - free(tmp); - } - -static void halfcomplex2fftpack (double *data, int n) - { - int m; - double *tmp = (double *)malloc(n*sizeof(double)); - tmp[0]=data[0]; - for (m=1; m<(n+1)/2; ++m) - { - tmp[2*m-1]=data[m]; - tmp[2*m]=data[n-m]; - } - if (!(n&1)) - tmp[n-1]=data[n/2]; - memcpy (data,tmp,n*sizeof(double)); - free(tmp); - } - -void real_plan_forward_fftw (real_plan plan, double *data) - { - real_plan_forward_fftpack (plan, data); - fftpack2halfcomplex (data,plan->length); - } - -void real_plan_backward_fftpack (real_plan plan, double *data) - { - if (plan->bluestein) - { - int m; - int n=plan->length; - double *tmp = (double *)malloc(2*n*sizeof(double)); - tmp[0]=data[0]; - tmp[1]=0.; - memcpy (tmp+2,data+1, (n-1)*sizeof(double)); - if ((n&1)==0) tmp[n+1]=0.; - for (m=2; mwork, 1); - for (m=0; mlength, data, plan->work); - } - -void real_plan_backward_fftw (real_plan plan, double *data) - { - halfcomplex2fftpack (data,plan->length); - real_plan_backward_fftpack (plan, data); - } - -void real_plan_forward_c (real_plan plan, double *data) - { - int m; - int n=plan->length; - - if (plan->bluestein) - { - for (m=1; m<2*n; m+=2) - data[m]=0; - bluestein (plan->length, data, plan->work, -1); - data[1]=0; - for (m=2; mwork); - data[0] = data[1]; - data[1] = 0; - for (m=2; mlength; - - if (plan->bluestein) - { - data[1]=0; - for (m=2; mlength, data, plan->work, 1); - for (m=1; m<2*n; m+=2) - data[m]=0; - } - else - { - data[1] = data[0]; - rfftb (n, data+1, plan->work); - for (m=n-1; m>=0; --m) - { - data[2*m] = data[m+1]; - data[2*m+1] = 0.; - } - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.h b/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.h deleted file mode 100644 index e300a64267..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/libfftpack/ls_fft.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * This file is part of libfftpack. - * - * libfftpack is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * libfftpack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libfftpack; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * libfftpack is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file ls_fft.h - * Interface for the LevelS FFT package. - * - * Copyright (C) 2004 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef PLANCK_LS_FFT_H -#define PLANCK_LS_FFT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*!\defgroup fftgroup FFT interface -This package is intended to calculate one-dimensional real or complex FFTs -with high accuracy and good efficiency even for lengths containing large -prime factors. -The code is written in C, but a Fortran wrapper exists as well. - -Before any FFT is executed, a plan must be generated for it. Plan creation -is designed to be fast, so that there is no significant overhead if the -plan is only used once or a few times. - -The main component of the code is a C port of Swarztrauber's FFTPACK -(http://www.netlib.org/fftpack/), which was originally done by Pekka Janhunen -and reformatted by Joerg Arndt. - -I added a few digits to the floating-point constants to achieve higher -precision, split the complex transforms into separate routines for forward -and backward transforms (to increase performance a bit), and replaced -the iterative twiddling factor calculation in radfg() and radbg() by an exact -calculation of the factors. - -Since FFTPACK becomes quite slow for FFT lengths with large prime factors -(in the worst case of prime lengths it reaches O(n*n) complexity), I -implemented Bluestein's algorithm, which computes a FFT of length n by -several FFTs of length n2>=2*n and a convolution. Since n2 can be chosen -to be highly composite, this algorithm is more efficient if n has large -prime factors. The longer FFTs themselves are then computed using the FFTPACK -routines. -Bluestein's algorithm was implemented according to the description at -Wikipedia. - -\b Thread-safety: -All routines can be called concurrently; all information needed by ls_fft -is stored in the plan variable. However, using the same plan variable on -multiple threads simultaneously is not supported and will lead to data -corruption. -*/ -/*! \{ */ - -typedef struct - { - double *work; - int length; - int bluestein; - } complex_plan_i; - -/*! The opaque handle type for complex-FFT plans. */ -typedef complex_plan_i * complex_plan; - -/*! Returns a plan for a complex FFT with \a length elements. */ -complex_plan make_complex_plan (int length); -/*! Destroys a plan for a complex FFT. */ -void kill_complex_plan (complex_plan plan); -/*! Computes a complex forward FFT on \a data, using \a plan. - \a Data has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. */ -void complex_plan_forward (complex_plan plan, double *data); -/*! Computes a complex backward FFT on \a data, using \a plan. - \a Data has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. */ -void complex_plan_backward (complex_plan plan, double *data); - -typedef struct - { - double *work; - int length; - int bluestein; - } real_plan_i; - -/*! The opaque handle type for real-FFT plans. */ -typedef real_plan_i * real_plan; - -/*! Returns a plan for a real FFT with \a length elements. */ -real_plan make_real_plan (int length); -/*! Destroys a plan for a real FFT. */ -void kill_real_plan (real_plan plan); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTPACK storage scheme: - - on entry, \a data has the form r0, r1, ..., r[length-1]; - - on exit, it has the form r0, r1, i1, r2, i2, ... - (a total of \a length values). */ -void real_plan_forward_fftpack (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTPACK storage scheme: - - on entry, \a data has the form r0, r1, i1, r2, i2, ... - (a total of \a length values); - - on exit, it has the form r0, r1, ..., r[length-1]. */ -void real_plan_backward_fftpack (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming the FFTW halfcomplex storage scheme: - - on entry, \a data has the form r0, r1, ..., r[length-1]; - - on exit, it has the form r0, r1, r2, ..., i2, i1. */ -void real_plan_forward_fftw (real_plan plan, double *data); -/*! Computes a real backward FFT on \a data, using \a plan - and assuming the FFTW halfcomplex storage scheme: - - on entry, \a data has the form r0, r1, r2, ..., i2, i1. - - on exit, it has the form r0, r1, ..., r[length-1]. */ -void real_plan_backward_fftw (real_plan plan, double *data); -/*! Computes a real forward FFT on \a data, using \a plan - and assuming a full-complex storage scheme: - - on entry, \a data has the form r0, [ignored], r1, [ignored], ..., - r[length-1], [ignored]; - - on exit, it has the form r0, i0, r1, i1, ..., r[length-1], i[length-1]. - */ -void real_plan_forward_c (real_plan plan, double *data); -/*! Computes a real backward FFT on \a data, using \a plan - and assuming a full-complex storage scheme: - - on entry, \a data has the form r0, i0, r1, i1, ..., - r[length-1], i[length-1]; - - on exit, it has the form r0, 0, r1, 0, ..., r[length-1], 0. */ -void real_plan_backward_c (real_plan plan, double *data); - -/*! \} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.cc b/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.cc deleted file mode 100644 index 1da7a83c84..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.cc +++ /dev/null @@ -1,383 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include -#include -#include -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "rotmatrix.h" -#include "pointing.h" -#include "tga_image.h" -#include "paramfile.h" - -using namespace std; - -void histo_eq (arr2 &img, float &minv, float &maxv, arr &newpos) - { - const int nbins=100; - arr bincnt (nbins); - bincnt.fill(0); - int pixels=0; - - double fact = 1./(maxv-minv); - for (int i=0; i-1e30) - { - img[i][j] = (img[i][j]-minv)*fact; - int idx = int(img[i][j]*nbins); - idx=max(0,min(idx,nbins-1)); - ++bincnt[idx]; - ++pixels; - } - - newpos.alloc(nbins+1); - int accu=0; - for (int m=0; m-1e30) - { - int idx = int(img[i][j]*nbins); - idx=max(0,min(idx,nbins-1)); - double frac = nbins*img[i][j] - idx; - img[i][j] = (1-frac)*newpos[idx] + frac*newpos[idx+1]; - img[i][j] = minv+(maxv-minv)*img[i][j]; - } - } - -void pro_mollw (const Healpix_Map &map, double lon0, double lat0, - int xsize, arr2 &img, float &minv, float &maxv, bool smooth) - { - int ysize=xsize/2; - img.alloc(xsize,ysize); - img.fill(-1e35); - double xc=(xsize-1)/2., yc=(ysize-1)/2.; - double lon0rad = lon0*degr2rad; - double lat0rad = lat0*degr2rad; - - rotmatrix rot; - rot.Make_CPAC_Euler_Matrix(0,-lat0rad,-lon0rad); - - minv=1e30; - maxv=-1e30; - for (int i=0; i(img[i][j],Healpix_undef)) - { - if (img[i][j]maxv) maxv=img[i][j]; - } - } - } - } - -void pro_gno (const Healpix_Map &map, double lon0, double lat0, - int xsize, double resgrid, arr2 &img, float &minv, float &maxv, - bool smooth) - { - double lon0rad = lon0*degr2rad; - double lat0rad = lat0*degr2rad; - - rotmatrix rot; - rot.Make_CPAC_Euler_Matrix(lon0rad,-lat0rad,0); - - double delta=resgrid*degr2rad/60.; - double start=-(xsize/2.)*delta; - img.alloc(xsize,xsize); - minv=1e30; - maxv=-1e30; - for (int i=0; i(img[i][j],Healpix_undef)) - { - if (img[i][j]maxv) maxv=img[i][j]; - } - } - } - -void colorbar (TGA_Image &img, const Palette &pal, int xmin, int xmax, - int ymin, int ymax, bool flippal, const arr &newpos) - { - int nbins = newpos.size()-1; - for (int i=xmin; i<=xmax; ++i) - { - double val = (double(i)-xmin)/(xmax-xmin); - if (nbins>0) - { - int idx = int(val*nbins); - idx=max(0,min(idx,nbins-1)); - double frac = nbins*val - idx; - val = (1-frac)*newpos[idx] + frac*newpos[idx+1]; - } - if (flippal) val=1-val; - Colour c = pal.Get_Colour(val); - for (int j=ymin; j<=ymax; ++j) - img.put_pixel(i,j,c); - } - } - -string conv (double val) - { - ostringstream os; - if (abs(val)>100 || abs(val)<0.01) - { - os << setw(10) << setprecision(3) << scientific << val; - return os.str(); - } - os << setw(10) << setprecision(6) << fixed << val; - return trim(os.str()); - } - -void usage() - { - cout << - "\nUsage:\n" - " map2tga \n\n" - "or:\n" - " map2tga [-sig ] [-pal ]\n" - " [-xsz ] [-bar] [-log] [-asinh] [-lon ] [-lat ]\n" - " [-mul ] [-add ] [-min ] [-max ]\n" - " [-res ] [-title ] [-flippal] [-gnomonic]\n" - " [-interpol] [-equalize] [-viewer ]\n\n"; - throw Message_error(); - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - announce ("map2tga"); - if (argc<2) usage(); - - string infile = ""; - string outfile = ""; - string title = ""; - int xres = 1024; - bool bar = false, mollpro=true; - double lat0=0, lon0=0, res=1; - double usermin=-1e30, usermax=1e30, offset=0, factor=1; - bool min_supplied=false, max_supplied=false; - bool logflag=false, asinhflag=false, eqflag=false; - int palnr = 4; - int colnum=1; - bool flippal = false; - bool interpol = false; - string viewer = ""; - - if (argc>2) - { - infile = argv[1]; - outfile = argv[2]; - int m=3; - while (m("infile"); - outfile = params.find("outfile"); - colnum = params.find("sig",colnum); - palnr = params.find("pal",palnr); - flippal = params.find("flippal",flippal); - xres = params.find("xsz",xres); - bar = params.find("bar",bar); - logflag = params.find("log",logflag); - eqflag = params.find("equalize",eqflag); - asinhflag = params.find("asinh",asinhflag); - lon0 = params.find("lon",lon0); - lat0 = params.find("lat",lat0); - factor = params.find("mul",factor); - offset = params.find("add",offset); - usermin = params.find("min", usermin); - if (usermin>-1e29) min_supplied = true; - usermax = params.find("max", usermax); - if (usermax<1e29) max_supplied = true; - res = params.find("res",res); - title = params.find("title",""); - viewer = params.find("viewer",""); - string tmp = params.find("pro",""); - if (tmp == "gno") mollpro=false; - interpol = params.find("interpol"); - } - - Healpix_Map map(0,RING); - read_Healpix_map_from_fits(infile,map,colnum,2); - for (int m=0; m(map[m],Healpix_undef)) - { - map[m] = (map[m]+offset)*factor; - if (logflag) - { - if (map[m]<=0) - map[m] = Healpix_undef; - else - map[m] = log(double(map[m]))/ln10; - } - if (asinhflag) - { - if (map[m]>=0) - map[m] = log(double(map[m]+sqrt(map[m]*map[m]+1))); - else - map[m] = -log(double(-map[m]+sqrt(map[m]*map[m]+1))); - } - if (min_supplied) if (map[m] < usermin) map[m] = usermin; - if (max_supplied) if (map[m] > usermax) map[m] = usermax; - } - } - - arr2 imgarr; - float minv, maxv; - if (mollpro) - pro_mollw (map,lon0,lat0,xres,imgarr,minv,maxv,interpol); - else - pro_gno (map,lon0,lat0,xres,res,imgarr,minv,maxv,interpol); - - arr newpos; - if (eqflag) histo_eq(imgarr,minv,maxv,newpos); - - if (min_supplied) minv = usermin; - if (max_supplied) maxv = usermax; - if (maxv==minv) maxv=minv+1e-10; - - int xsz=imgarr.size1(); - int ysz=imgarr.size2(); - int yofs=ysz; - int scale = max(1,xsz/800); - if (bar) ysz+=60*scale; - if (title != "") { ysz+=50*scale; yofs+=50*scale; } - TGA_Image img(xsz,ysz); - img.fill(Colour(1,1,1)); - img.set_font (giant_font); - Palette pal; - pal.setPredefined(palnr); - if (title != "") - img.annotate_centered(xsz/2,25*scale,Colour(0,0,0),title,scale); - for (int i=0; i-1e32) - { - Colour c(0.5,0.5,0.5); - if (!approx(imgarr[i][j],Healpix_undef)) - { - int col = int((imgarr[i][j]-minv)/(maxv-minv)*256); - col = min(255,max(col,0)); - float colfrac = (imgarr[i][j]-minv)/(maxv-minv); - if (flippal) colfrac = 1-colfrac; - c = pal.Get_Colour(colfrac); - } - img.put_pixel(i,yofs-j-1,c); - } - } - - if (bar) - { - colorbar (img,pal,xsz/10,(xsz*9)/10,ysz-40*scale,ysz-20*scale,flippal, - newpos); - img.set_font (medium_bold_font); - img.annotate_centered (xsz/20,ysz-30*scale,Colour(0,0,0),conv(minv),scale); - img.annotate_centered ((xsz*19)/20,ysz-30*scale,Colour(0,0,0),conv(maxv), - scale); - } - img.write(outfile); - - if (viewer!="") - system ((viewer+" "+outfile).c_str()); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.par.txt deleted file mode 100644 index 1cfc2a34ca..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/map2tga.par.txt +++ /dev/null @@ -1,76 +0,0 @@ -Usage: - map2tga - -or: - map2tga [-sig ] [-pal ] - [-xsz ] [-bar] [-log] [-asinh] [-lon ] [-lat ] - [-mul ] [-add ] [-min ] [-max ] - [-res ] [-title ] [-flippal] [-gnomonic] - [-interpol] [-equalize] [-viewer ] - - -Parameters read by map2tga: - -infile (string): - input file containing the Healpix map - -outfile (string): - output TGA file - -sig (integer, default=1): - column number of the requested Healpix map - -pal (integer, default=4): - number of the color palette - -flippal (bool, default=false): - whether the palette should be flipped - -xsz (integer, default=1024): - number of image pixels in x direction - -bar (logical, default=false): - whether a color bar should be added to the image - -log (logical, default=false): - whether the logarithm of the map values should be displayed - -equalize (logical, default=false): - whether histogram equalisation should be performed - -asinh (logical, default=false): - whether the hyperbolic arcsine of the map values should be displayed - -lon (double, default=0): - the longitude (in degrees) of the image center - -lat (double, default=0): - the latitude (in degrees) of the image center - -mul (double, default=1): - scale factor applied to the data - -add (double, default=0): - offset added to the data (before multiplication) - -min (double, optional): - if specified, this value is used as minimum of the color scale - -max (double, optional): - if specified, this value is used as maximum of the color scale - -res (double, default=1): - only for gnomonic projection: the size (in arcmin) of an image pixel - -title (string, optional): - if specified, this value is used as the image title - -viewer (string, optional): - if specified, this executable is used to show the resulting image - -pro (string, default="mollw"): - if this is equal to "gno", gnomonic projection is used, else Mollweide - -interpol (bool, default=false): - false: no interpolation - true : bilinear interpolation diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/median_filter.cc b/src/amuse_simplex/src/plugins/HEALPix/src/median_filter.cc deleted file mode 100644 index bf68bf3dd9..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/median_filter.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "cxxutils.h" -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "fitshandle.h" - -using namespace std; - -template typename iterator_traits::value_type - median(Iterator first, Iterator last) - { - Iterator mid = first+(last-first-1)/2; - nth_element(first,mid,last); - if ((last-first)&1) return *mid; - return 0.5*((*mid)+(*min_element(mid+1,last))); - } - -int main (int argc, const char **argv) - { - module_startup ("median_filter", argc, argv, 4, - " "); - - double radius = stringToData(argv[3])/60*degr2rad; - - Healpix_Map inmap; - read_Healpix_map_from_fits(argv[1],inmap,1,2); - Healpix_Map outmap (inmap.Nside(), inmap.Scheme(), SET_NSIDE); - - vector list; - vector list2; - for (int m=0; m void mult_alm (paramfile ¶ms, simparams &par) - { - par.add_comment("----------------"); - par.add_comment(" ** mult_alm **"); - par.add_comment("----------------"); - - string infile = params.template find("infile"); - par.add_source_file (infile, 2); - string outfile = params.template find("outfile"); - int nside_pixwin_in = params.template find("nside_pixwin_in",0); - planck_assert (nside_pixwin_in>=0,"nside_pixwin_in must be >= 0"); - int nside_pixwin_out = params.template find("nside_pixwin_out",0); - planck_assert (nside_pixwin_out>=0,"nside_pixwin_out must be >= 0"); - double fwhm_arcmin_in = params.template find("fwhm_arcmin_in",0); - planck_assert (fwhm_arcmin_in>=0,"fwhm_arcmin_in must be >= 0"); - double fwhm_arcmin_out = params.template find("fwhm_arcmin_out",0); - planck_assert (fwhm_arcmin_out>=0,"fwhm_arcmin_out must be >= 0"); - - string datadir; - if ((nside_pixwin_in>0) || (nside_pixwin_out>0)) - datadir = params.template find("healpix_data"); - - bool polarisation = params.template find("polarisation"); - if (!polarisation) - { - int nlmax, nmmax; - get_almsize(infile, nlmax, nmmax, 2); - Alm > alm; - read_Alm_from_fits(infile,alm,nlmax,nmmax,2); - if (fwhm_arcmin_in>0) smooth_with_Gauss (alm, -fwhm_arcmin_in); - arr temp(nlmax+1); - if (nside_pixwin_in>0) - { - read_pixwin(datadir,nside_pixwin_in,temp); - for (int l=0; l<=nlmax; ++l) - temp[l] = 1/temp[l]; - alm.ScaleL (temp); - } - if (nside_pixwin_out>0) - { - read_pixwin(datadir,nside_pixwin_out,temp); - alm.ScaleL (temp); - } - if (fwhm_arcmin_out>0) smooth_with_Gauss (alm, fwhm_arcmin_out); - fitshandle out; - out.create (outfile); - write_Alm_to_fits (out,alm,nlmax,nmmax,FITSUTIL::DTYPE); - par.add_keys(out); - } - else - { - int nlmax, nmmax; - get_almsize_pol(infile, nlmax, nmmax); - Alm > almT, almG, almC; - read_Alm_from_fits(infile,almT,nlmax,nmmax,2); - read_Alm_from_fits(infile,almG,nlmax,nmmax,3); - read_Alm_from_fits(infile,almC,nlmax,nmmax,4); - if (fwhm_arcmin_in>0) - smooth_with_Gauss (almT, almG, almC, -fwhm_arcmin_in); - arr temp(nlmax+1), pol(nlmax+1); - if (nside_pixwin_in>0) - { - read_pixwin(datadir,nside_pixwin_in,temp,pol); - for (int l=0; l<=nlmax; ++l) - { temp[l] = 1/temp[l]; pol[l] = 1/pol[l]; } - almT.ScaleL(temp); almG.ScaleL(pol); almC.ScaleL(pol); - } - if (nside_pixwin_out>0) - { - read_pixwin(datadir,nside_pixwin_out,temp,pol); - almT.ScaleL(temp); almG.ScaleL(pol); almC.ScaleL(pol); - } - if (fwhm_arcmin_out>0) - smooth_with_Gauss (almT, almG, almC, fwhm_arcmin_out); - fitshandle out; - out.create (outfile); - write_Alm_to_fits (out,almT,nlmax,nmmax,FITSUTIL::DTYPE); - par.add_keys(out); - write_Alm_to_fits (out,almG,nlmax,nmmax,FITSUTIL::DTYPE); - par.add_keys(out); - write_Alm_to_fits (out,almC,nlmax,nmmax,FITSUTIL::DTYPE); - par.add_keys(out); - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("mult_alm", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? mult_alm(params,par) : mult_alm(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/mult_alm.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/mult_alm.par.txt deleted file mode 100644 index 55d43c9ba4..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/mult_alm.par.txt +++ /dev/null @@ -1,32 +0,0 @@ -Parameters read by mult_alm: - -infile (string): - input file containing the a_lm - -outfile (string): - output file name for the calculated a_lm - -fwhm_arcmin_in (real, default=0): - FWHM (in arcmin) of a Gaussian beam, which will be _removed_ from the - input a_lm - -fwhm_arcmin_out (real, default=0): - FWHM (in arcmin) of a Gaussian beam, which will be used to smoothe the - output a_lm - -nside_pixwin_in (integer, default=0): - If this is different from 0, the corresponding pixel window function - will be _removed_ from the input a_lm - -nside_pixwin_out (integer, default=0): - If this is different from 0, the corresponding pixel window function - will be applied to the output a_lm - -if ((nside_pixwin_in>0)||(nside_pixwin_out>0)) - healpix_data (string): - directory containing the Healpix data files -endif - -double_precision (bool, default=false): - if false, the a_lm are read/written in single precision, - otherwise in double precision. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/powspec.cc b/src/amuse_simplex/src/plugins/HEALPix/src/powspec.cc deleted file mode 100644 index 5a85ba22b5..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/powspec.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003,2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "powspec.h" - -using namespace std; - -void PowSpec::dealloc() - { - tt_.dealloc(); - gg_.dealloc(); - cc_.dealloc(); - tg_.dealloc(); - tc_.dealloc(); - gc_.dealloc(); - } - -void PowSpec::Set(arr &tt_new) - { - dealloc(); - num_specs = 1; - tt_.transfer(tt_new); -//FIXME: temporarily relaxed to allow cross-spectra - for (int l=0; l &tt_new, arr &gg_new, - arr &cc_new, arr &tg_new) - { - dealloc(); - num_specs = 4; - tt_.transfer(tt_new); - gg_.transfer(gg_new); - cc_.transfer(cc_new); - tg_.transfer(tg_new); - planck_assert((tt_.size()==gg_.size()) && (tt_.size()==cc_.size()) - && (tt_.size()==tg_.size()), "PowSpec::Set: size mismatch"); - for (int l=0; l=0, "negative TT spectrum at l="+dataToString(l)); - planck_assert (gg_[l]>=0, "negative GG spectrum at l="+dataToString(l)); - planck_assert (cc_[l]>=0, "negative CC spectrum at l="+dataToString(l)); - planck_assert (abs(tg_[l]<=sqrt(tt_[l]*gg_[l])), - "Inconsistent T, E and TxE terms at l="+dataToString(l)); - } - } - -void PowSpec::Smooth_with_Gauss (double fwhm) - { - planck_assert (num_specs<=4, "not yet implemented for num_specs>4"); - double sigma = fwhm*fwhm2sigma; - double fact_pol = exp(2*sigma*sigma); - for (int l=0; l1) - { - gg_[l] *= f2*f2; - cc_[l] *= f2*f2; - tg_[l] *= f1*f2; - } - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/powspec.h b/src/amuse_simplex/src/plugins/HEALPix/src/powspec.h deleted file mode 100644 index d75f8a76a6..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/powspec.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef POWSPEC_H -#define POWSPEC_H - -#include "arr.h" - -/*! Class for storing unpolarised and polarised power spectra. */ -class PowSpec - { - private: - arr tt_, gg_, cc_, tg_, tc_, gc_; - int num_specs; - - void dealloc(); - - public: - /*! */ - PowSpec() {} - /*! Constructs a \a PowSpec with \a nspec components and a maximum - multipole of \a lmax. \a nspec can be 1 (TT), 4 (TT,GG,CC,TG) or - 6 (TT,GG,CC,TG,TC,GC). */ - PowSpec(int nspec, int lmax) - : num_specs(nspec) - { - planck_assert ((num_specs==1) || (num_specs==4) || (num_specs==6), - "wrong number of spectrums"); - tt_.alloc(lmax+1); - if (num_specs>1) - { - gg_.alloc(lmax+1); - cc_.alloc(lmax+1); - tg_.alloc(lmax+1); - } - if (num_specs>4) - { - tc_.alloc(lmax+1); - gc_.alloc(lmax+1); - } - } - - /*! Returns the number of spectral components. */ - int Num_specs() const { return num_specs; } - /*! Returns the maximum \a l. */ - int Lmax() const { return tt_.size()-1; } - /*! Returns the TT array (read-only). */ - const arr &tt() const { return tt_; } - /*! Returns the GG array (read-only). */ - const arr &gg() const { return gg_; } - /*! Returns the CC array (read-only). */ - const arr &cc() const { return cc_; } - /*! Returns the TG array (read-only). */ - const arr &tg() const { return tg_; } - /*! Returns the TC array (read-only). */ - const arr &tc() const { return tc_; } - /*! Returns the GC array (read-only). */ - const arr &gc() const { return gc_; } - /*! Returns TT(l) (read-write). */ - double &tt (int l) { return tt_[l]; } - /*! Returns GG(l) (read-write). */ - double &gg (int l) { return gg_[l]; } - /*! Returns CC(l) (read-write). */ - double &cc (int l) { return cc_[l]; } - /*! Returns TG(l) (read-write). */ - double &tg (int l) { return tg_[l]; } - /*! Returns TC(l) (read-write). */ - double &tc (int l) { return tc_[l]; } - /*! Returns GC(l) (read-write). */ - double &gc (int l) { return gc_[l]; } - /*! Returns TT(l) (read-only). */ - const double &tt (int l) const { return tt_[l]; } - /*! Returns GG(l) (read-only). */ - const double &gg (int l) const { return gg_[l]; } - /*! Returns CC(l) (read-only). */ - const double &cc (int l) const { return cc_[l]; } - /*! Returns TG(l) (read-only). */ - const double &tg (int l) const { return tg_[l]; } - /*! Returns TC(l) (read-only). */ - const double &tc (int l) const { return tc_[l]; } - /*! Returns GC(l) (read-only). */ - const double &gc (int l) const { return gc_[l]; } - - /*! Sets the whole TT array. */ - void Set(arr &tt_new); - /*! Sets all components. */ - void Set(arr &tt_new, arr &gg_new, - arr &cc_new, arr &tg_new); - /* Smooths the spectrum with a Gaussian beam. - \a fwhm is given in radian. - \note This is only implememted for 1 and 4 spectra so far. */ - void Smooth_with_Gauss (double fwhm); - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.cc b/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.cc deleted file mode 100644 index 30668fd19f..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.cc +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "powspec_fitsio.h" -#include "powspec.h" -#include "fitshandle.h" - -using namespace std; - -void read_powspec_from_fits (const string &infile, PowSpec &powspec, - int nspecs, int lmax) - { - planck_assert ((nspecs==1)||(nspecs==4), "wrong number of spectra"); - fitshandle inp; - inp.open(infile); - inp.goto_hdu(2); - if (inp.key_present("PDMTYPE")) // official Planck format - { - inp.assert_pdmtype("POWERSPEC"); - arr tmp; - arr itmp; - if ((inp.coltype(1)==TINT)||(inp.coltype(1)==TLONG)) - inp.read_entire_column(1,itmp); - else - { - cerr << "Warning: column containing l values is not of integer type!" - << endl; - inp.read_entire_column(1,tmp); - itmp.alloc(tmp.size()); - for (int m=0; m(tmp[m]); - } - - if (nspecs==1) - { - arr tt(lmax+1); - tt.fill(0); - inp.read_entire_column(2,tmp); - for (int m=0; m tt(lmax+1), gg(lmax+1), cc(lmax+1), tg(lmax+1); - tt.fill(0); gg.fill(0); cc.fill(0); tg.fill(0); - inp.read_entire_column(2,tmp); - for (int m=0; m tt(lmax+1); - inp.read_column_raw (1,&tt[0],lmax_read+1); - for (int l=lmax_read+1; l<=lmax; ++l) - tt[l]=0; - powspec.Set(tt); - } - else - { - arr tt(lmax+1), gg(lmax+1), cc(lmax+1), tg(lmax+1); - inp.read_column_raw (1,&tt[0],lmax_read+1); - inp.read_column_raw (2,&gg[0],lmax_read+1); - inp.read_column_raw (3,&cc[0],lmax_read+1); - inp.read_column_raw (4,&tg[0],lmax_read+1); - for (int l=lmax_read+1; l<=lmax; ++l) - tt[l]=gg[l]=cc[l]=tg[l]=0; - powspec.Set(tt,gg,cc,tg); - } - } - } - -void write_powspec_to_fits (fitshandle &out, - const PowSpec &powspec, int nspecs) - { - planck_assert ((nspecs==1)||(nspecs==4), "wrong number of spectra"); - vector cols; - cols.push_back(fitscolumn("l","multipole order",1,TINT32BIT)); - cols.push_back(fitscolumn("Temperature C_l","Kelvin-squared",1,TDOUBLE)); - if (nspecs>1) - { - cols.push_back(fitscolumn("E-mode C_l","Kelvin-squared",1,TDOUBLE)); - cols.push_back(fitscolumn("B-mode C_l","Kelvin-squared",1,TDOUBLE)); - cols.push_back(fitscolumn("T-E cross-corr.","Kelvin-squared",1,TDOUBLE)); - } - out.insert_bintab(cols); - out.add_key("PDMTYPE",string("POWERSPEC"),"Planck data model type"); - arr tmparr(powspec.Lmax()+1); - for (int l=0; l<=powspec.Lmax(); ++l) tmparr[l]=l; - out.write_column(1,tmparr); - out.write_column(2,powspec.tt()); - if (nspecs>1) - { - out.write_column(3,powspec.gg()); - out.write_column(4,powspec.cc()); - out.write_column(5,powspec.tg()); - } - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.h b/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.h deleted file mode 100644 index 6297c331af..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/powspec_fitsio.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/*! \file powspec_fitsio.h - * Copyright (C) 2003 Max-Planck-Society - * \author Martin Reinecke - */ - -#ifndef POWSPEC_FITSIO_H -#define POWSPEC_FITSIO_H - -#include -class fitshandle; - -class PowSpec; - -/*! \defgroup powspec_fitsio_group FITS-based I/O of power spectra */ -/*! \{ */ - -/*! Opens the FITS file \a filename, jumpd to HDU 2, and reads \a nspecs - columns into \a powspec. \a nspecs must be 1 or 4. */ -void read_powspec_from_fits (const std::string &infile, - PowSpec &powspec, int nspecs, int lmax); -/*! Inserts a new binary table into \a out, which contains one or four columns - of FITS type TDOUBLE, and writes the components of \a powspec into it. */ -void write_powspec_to_fits (fitshandle &out, - const PowSpec &powspec, int nspecs); - -/*! \} */ - -#endif diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/rotalm_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/rotalm_cxx.cc deleted file mode 100644 index c439c5a499..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/rotalm_cxx.cc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "alm.h" -#include "alm_fitsio.h" -#include "fitshandle.h" -#include "alm_powspec_tools.h" -#include "trafos.h" - -using namespace std; - -Trafo maketrafo (int num) - { - switch (num) - { - case 1: return Trafo(2000,2000,Equatorial,Galactic); - case 2: return Trafo(2000,2000,Galactic,Equatorial); - case 3: return Trafo(2000,2000,Equatorial,Ecliptic); - case 4: return Trafo(2000,2000,Ecliptic,Equatorial); - case 5: return Trafo(2000,2000,Ecliptic,Galactic); - case 6: return Trafo(2000,2000,Galactic,Ecliptic); - case 7: return Trafo(1950,1950,Equatorial,Galactic); - case 8: return Trafo(1950,1950,Galactic,Equatorial); - case 9: return Trafo(1950,1950,Equatorial,Ecliptic); - case 10: return Trafo(1950,1950,Ecliptic,Equatorial); - case 11: return Trafo(1950,1950,Ecliptic,Galactic); - case 12: return Trafo(1950,1950,Galactic,Ecliptic); - default: throw Message_error ("Unsupported transformation"); - } - } - -int main(int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - announce ("rotalm_cxx"); - - if (argc!=5) - { - cout << "Usage: rotalm_cxx " - << endl - << "Transform 1: Equatorial (2000) -> Galactic (2000)" << endl - << " 2: Galactic (2000) -> Equatorial (2000)" << endl - << " 3: Equatorial (2000) -> Ecliptic (2000)" << endl - << " 4: Ecliptic (2000) -> Equatorial (2000)" << endl - << " 5: Ecliptic (2000) -> Galactic (2000)" << endl - << " 6: Galactic (2000) -> Ecliptic (2000)" << endl - << " 7: Equatorial (1950) -> Galactic (1950)" << endl - << " 8: Galactic (1950) -> Equatorial (1950)" << endl - << " 9: Equatorial (1950) -> Ecliptic (1950)" << endl - << " 10: Ecliptic (1950) -> Equatorial (1950)" << endl - << " 11: Ecliptic (1950) -> Galactic (1950)" << endl - << " 12: Galactic (1950) -> Ecliptic (1950)" << endl - << endl - << "pol: T or F" << endl << endl; - throw Message_error(); - } - - string infile = argv[1]; - string outfile = argv[2]; - int trafo = stringToData(argv[3]); - bool polarisation = stringToData(argv[4]); - - Trafo tr(maketrafo(trafo)); - - fitshandle out; - out.create (outfile); - - Alm > almT,almG,almC; - - if (!polarisation) - { - int lmax, dummy; - get_almsize (infile,lmax,dummy); - read_Alm_from_fits (infile, almT, lmax, lmax); - rotate_alm(almT,tr.Matrix()); - write_Alm_to_fits (out,almT,lmax,lmax,TFLOAT); - } - else - { - int lmax, dummy; - get_almsize_pol (infile,lmax,dummy); - read_Alm_from_fits (infile, almT, lmax, lmax, 2); - read_Alm_from_fits (infile, almG, lmax, lmax, 3); - read_Alm_from_fits (infile, almC, lmax, lmax, 4); - rotate_alm(almT,almG,almC,tr.Matrix()); - write_Alm_to_fits (out,almT,lmax,lmax,TDOUBLE); - write_Alm_to_fits (out,almG,lmax,lmax,TDOUBLE); - write_Alm_to_fits (out,almC,lmax,lmax,TDOUBLE); - } - -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.cc deleted file mode 100644 index 8110eb1526..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.cc +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "xcomplex.h" -#include "cxxutils.h" -#include "paramfile.h" -#include "simparams.h" -#include "healpix_data_io.h" -#include "alm.h" -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "alm_healpix_tools.h" -#include "alm_powspec_tools.h" -#include "fitshandle.h" - -using namespace std; - -template void smoothing_cxx (paramfile ¶ms, simparams &par) - { - int nlmax = params.template find("nlmax"); - string infile = params.template find("infile"); - string outfile = params.template find("outfile"); - bool polarisation = params.template find("polarisation"); - int num_iter = params.template find("iter_order",0); - double fwhm_arcmin = params.template find("fwhm_arcmin"); - - if (!polarisation) - { - Healpix_Map map; - read_Healpix_map_from_fits(infile,map,1,2); - arr weight_T; - get_ring_weights (params,par,map.Nside(),weight_T); - - Alm > alm(nlmax,nlmax); - double avg=map.average(); - map.add(-avg); - if (map.Scheme()==NEST) map.swap_scheme(); - - map2alm_iter(map,alm,num_iter,weight_T); - if (fwhm_arcmin>0) smooth_with_Gauss (alm, fwhm_arcmin); - alm2map(alm,map); - - map.add(avg); - fitshandle out; - out.create (outfile); - write_Healpix_map_to_fits (out,map,FITSUTIL::DTYPE); - par.add_keys(out); - } - else - { - Healpix_Map mapT, mapQ, mapU; - read_Healpix_map_from_fits(infile,mapT,1,2); - read_Healpix_map_from_fits(infile,mapQ,2,2); - read_Healpix_map_from_fits(infile,mapU,3,2); - arr weight; - get_ring_weights (params,par,mapT.Nside(),weight); - - Alm > almT(nlmax,nlmax), almG(nlmax,nlmax), almC(nlmax,nlmax); - double avg=mapT.average(); - mapT.add(-avg); - if (mapT.Scheme()==NEST) mapT.swap_scheme(); - if (mapQ.Scheme()==NEST) mapQ.swap_scheme(); - if (mapU.Scheme()==NEST) mapU.swap_scheme(); - - map2alm_pol_iter - (mapT,mapQ,mapU,almT,almG,almC,num_iter,weight); - if (fwhm_arcmin>0) smooth_with_Gauss (almT, almG, almC, fwhm_arcmin); - alm2map_pol(almT,almG,almC,mapT,mapQ,mapU); - - mapT.add(avg); - fitshandle out; - out.create (outfile); - write_Healpix_map_to_fits (out,mapT,mapQ,mapU,FITSUTIL::DTYPE); - par.add_keys(out); - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("smoothing_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? smoothing_cxx(params,par) : smoothing_cxx(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.par.txt deleted file mode 100644 index 4c5ad4d03f..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/smoothing_cxx.par.txt +++ /dev/null @@ -1,32 +0,0 @@ -Parameters read by smoothing_cxx: - -fwhm_arcmin (double): - FWHM (in arcmin) of the Gaussian beam used for smoothing - -nlmax (integer): - maximum order of l - -infile (string): - input file containing the Healpix map - -outfile (string, default=""): - output file for the smoothed Healpix map - -polarisation (bool): - if false, only an intensity map is smoothed - if true, an IQU map is smoothed - -weighted (bool, default=false): - if true, weighted quadrature is used - -if (weighted) - healpix_data (string): - directory containing the Healpix data files -endif - -iter_order (integer, default=0) - number of iterations for the analysis (0: standard analysis) - -double_precision (bool, default=false): - if false, a_lm are read/written in single precision, otherwise in - double precision. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.cc deleted file mode 100644 index 50362f2a6b..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.cc +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004, 2005 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "xcomplex.h" -#include "cxxutils.h" -#include "paramfile.h" -#include "simparams.h" -#include "planck_rng.h" -#include "alm.h" -#include "alm_fitsio.h" -#include "fitshandle.h" -#include "powspec.h" -#include "powspec_fitsio.h" -#include "alm_powspec_tools.h" - -using namespace std; - -template void syn_alm_cxx (paramfile ¶ms, simparams &par) - { - par.add_comment("-----------------------"); - par.add_comment(" ** syn_alm_cxx 1.0 **"); - par.add_comment("-----------------------"); - - int nlmax = params.template find("nlmax"); - par.add("nlmax","NLMAX",nlmax,"maximum l of the alms"); - int nmmax = params.template find("nmmax",nlmax); - par.add("nmmax","NMMAX",nmmax,"maximum m of the alms"); - planck_assert(nmmax<=nlmax,"nmmax must not be larger than nlmax"); - string infile = params.template find("infile"); - par.add_source_file (infile, 2); - string outfile = params.template find("outfile"); - int rand_seed = params.template find("rand_seed"); - par.add("rand_seed","RANDSEED",rand_seed,"random number seed"); - double fwhm = params.template find("fwhm_arcmin",0.); - par.add("fwhm","FWHM",fwhm,"[arcmin] Gaussian smoothing FWHM"); - fwhm *= degr2rad/60; - bool polarisation = params.template find("polarisation"); - - PowSpec powspec; - int nspecs = polarisation ? 4 : 1; - read_powspec_from_fits (infile, powspec, nspecs, nlmax); - powspec.Smooth_with_Gauss(fwhm); - - planck_rng rng(rand_seed); - - if (polarisation) - { - Alm > - almT(nlmax,nmmax), almG(nlmax,nmmax), almC(nlmax,nmmax); - create_alm_pol (powspec, almT, almG, almC, rng); - - fitshandle out; - out.create(outfile); - write_Alm_to_fits(out,almT,nlmax,nmmax,FITSUTIL::DTYPE); - out.add_key("PDMTYPE",string("MAPALM"),"Planck data model type"); - par.add_keys(out); - write_Alm_to_fits(out,almG,nlmax,nmmax,FITSUTIL::DTYPE); - out.add_key("PDMTYPE",string("MAPALM"),"Planck data model type"); - par.add_keys(out); - write_Alm_to_fits(out,almC,nlmax,nmmax,FITSUTIL::DTYPE); - out.add_key("PDMTYPE",string("MAPALM"),"Planck data model type"); - par.add_keys(out); - } - else - { - Alm > almT(nlmax,nmmax); - create_alm (powspec, almT, rng); - - fitshandle out; - out.create(outfile); - write_Alm_to_fits(out,almT,nlmax,nmmax,FITSUTIL::DTYPE); - out.add_key("PDMTYPE",string("MAPALM"),"Planck data model type"); - par.add_keys(out); - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("syn_alm_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? syn_alm_cxx(params,par) : syn_alm_cxx(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.par.txt b/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.par.txt deleted file mode 100644 index e0d02dc163..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/syn_alm_cxx.par.txt +++ /dev/null @@ -1,28 +0,0 @@ -Parameters read by syn_alm_cxx: - -nlmax (integer): - maximum order of l - -nmmax (integer): - maximum order of m (must not be larger than nlmax, default=nlmax) - -infile (string): - input file containing the CMB power spectrum - -outfile (string): - output file name for the calculated a_lm - -rand_seed (integer): - random-number seed - -fwhm_arcmin (real): - FWHM (in arcmin) of a Gaussian beam, which is used to smooth the - resulting sky a_lm (default=0) - -polarisation (bool): - if false, only the intensity a_lm are generated, - if true, T, G and C a_lm are generated - -double_precision (bool, default=false): - if false, the a_lm are created in single precision, - otherwise in double precision. diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/udgrade_cxx.cc b/src/amuse_simplex/src/plugins/HEALPix/src/udgrade_cxx.cc deleted file mode 100644 index 9d21916bb3..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/udgrade_cxx.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Copyright (C) 2003, 2004 Max-Planck-Society - * Author: Martin Reinecke - */ - -#include "cxxutils.h" -#include "paramfile.h" -#include "simparams.h" -#include "healpix_map.h" -#include "healpix_map_fitsio.h" -#include "fitshandle.h" - -using namespace std; - -template void udgrade_cxx (paramfile ¶ms, simparams &par) - { - par.add_comment("-------------------"); - par.add_comment(" ** udgrade_cxx **"); - par.add_comment("-------------------"); - - string infile = params.template find("infile"); - par.add_source_file (infile, 2); - string outfile = params.template find("outfile"); - int order = Healpix_Base::nside2order (params.template find("nside")); - bool polarisation = params.template find("polarisation",false); - bool pessimistic = params.template find("pessimistic",false); - - if (!polarisation) - { - Healpix_Map inmap; - read_Healpix_map_from_fits(infile,inmap,1,2); - Healpix_Map outmap (order, inmap.Scheme()); - - outmap.Import(inmap,pessimistic); - fitshandle out; - out.create(outfile); - write_Healpix_map_to_fits (out,outmap,FITSUTIL::DTYPE); - } - else - { - Healpix_Map inmap; - read_Healpix_map_from_fits(infile,inmap,1,2); - Healpix_Map outmapT (order, inmap.Scheme()), - outmapQ (order, inmap.Scheme()), - outmapU (order, inmap.Scheme()); - - outmapT.Import(inmap,pessimistic); - read_Healpix_map_from_fits(infile,inmap,2,2); - outmapQ.Import(inmap,pessimistic); - read_Healpix_map_from_fits(infile,inmap,3,2); - outmapU.Import(inmap,pessimistic); - fitshandle out; - out.create(outfile); - write_Healpix_map_to_fits (out,outmapT,outmapQ,outmapU,FITSUTIL::DTYPE); - } - } - -int main (int argc, const char **argv) - { -PLANCK_DIAGNOSIS_BEGIN - module_startup ("udgrade_cxx", argc, argv, 2, ""); - paramfile params (argv[1]); - simparams par; - - bool dp = params.find ("double_precision",false); - dp ? udgrade_cxx(params,par) : udgrade_cxx(params,par); -PLANCK_DIAGNOSIS_END - } diff --git a/src/amuse_simplex/src/plugins/HEALPix/src/ylmgen.h b/src/amuse_simplex/src/plugins/HEALPix/src/ylmgen.h deleted file mode 100644 index 3a5ee695d7..0000000000 --- a/src/amuse_simplex/src/plugins/HEALPix/src/ylmgen.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * This file is part of Healpix_cxx. - * - * Healpix_cxx is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Healpix_cxx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Healpix_cxx; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about HEALPix, see http://healpix.jpl.nasa.gov - */ - -/* - * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik - * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt - * (DLR). - */ - -/* - * Code for efficient calculation of Y_lm(theta,phi=0) - * - * Copyright (C) 2005, 2006 Max-Planck-Society - * Author: Martin Reinecke - */ - -#ifndef PLANCK_YLMGEN_H -#define PLANCK_YLMGEN_H - -#include -#include "arr.h" -#include "lsconstants.h" - -/*! Class for efficient calculation of Y_lm(theta,phi=0) */ -class Ylmgen - { - private: - double fsmall, fbig, eps, cth_crit; - int lmax, mmax, m_last, m_crit; - arr cf; - arr recfac; - arr mfac; - arr t1fac, t2fac; - - enum { large_exponent2 = 90, minscale=-4 }; - - void recalc_recfac (int m) - { - using namespace std; - - if (m_last==m) return; - - double f_old=1; - for (int l=m; llmax, all - absolute values are smaller than \a epsilon. - \a result[l] is undefined for all \a l &result, - int &firstl) - { - using namespace std; - - planck_assert (m<=mmax, "get_Ylm: m larger than mmax"); - - if (((m>=m_crit)&&(abs(cth)>=cth_crit)) || ((m>0)&&(sth==0))) - { firstl=lmax+1; return; } - - recalc_recfac(m); - result.alloc(lmax+1); - - double logval = mfac[m]; - if (m>0) logval += m*inv_ln2*log(sth); - int scale = int (logval/large_exponent2)-minscale; - double corfac = (scale<0) ? 0. : cf[scale]; - double lam_1 = 0; - double lam_2 = exp(ln2*(logval-(scale+minscale)*large_exponent2)); - if (m&1) lam_2 = -lam_2; - - int l=m; - while (true) - { - if (abs(lam_2*corfac)>eps) break; - if (++l>lmax) break; - double lam_0 = cth*lam_2*recfac[l-1][0] - lam_1*recfac[l-1][1]; - if (abs(lam_0*corfac)>eps) { lam_1=lam_2; lam_2=lam_0; break; } - if (++l>lmax) break; - lam_1 = cth*lam_0*recfac[l-1][0] - lam_2*recfac[l-1][1]; - if (abs(lam_1*corfac)>eps) { lam_2=lam_1; lam_1=lam_0; break; } - if (++l>lmax) break; - lam_2 = cth*lam_1*recfac[l-1][0] - lam_0*recfac[l-1][1]; - - while (abs(lam_2)>fbig) - { - lam_1 *= fsmall; - lam_2 *= fsmall; - ++scale; - corfac = (scale<0) ? 0. : cf[scale]; - } - } - - firstl=l; - if (l>lmax) - { m_crit=m; cth_crit=abs(cth); return; } - - lam_1*=corfac; - lam_2*=corfac; - - for (;llmax) break; - double lam_0 = cth*lam_2*recfac[l-1][0] - lam_1*recfac[l-1][1]; - result[l] = lam_0; - if (++l>lmax) break; - lam_1 = cth*lam_0*recfac[l-1][0] - lam_2*recfac[l-1][1]; - result[l] = lam_1; - if (++l>lmax) break; - lam_2 = cth*lam_1*recfac[l-1][0] - lam_0*recfac[l-1][1]; - } - } - - }; - -#endif diff --git a/src/amuse_simplex/src/plugins/hdf5/array_class.h b/src/amuse_simplex/src/plugins/hdf5/array_class.h index 4446f10f9d..2f4a0a7194 100644 --- a/src/amuse_simplex/src/plugins/hdf5/array_class.h +++ b/src/amuse_simplex/src/plugins/hdf5/array_class.h @@ -54,7 +54,7 @@ template arr_1D::arr_1D (unsigned long long int r, unsigned long rank = r; if (dims) delete [] dims; - dims = new int[rank]; + dims = new unsigned long long[rank]; for (i=0; i< d[i]; i++) dims[i] = d[i]; diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/Announce.txt b/src/amuse_simplex/src/plugins/qhull-2012.1/Announce.txt deleted file mode 100644 index ac8e052f99..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/Announce.txt +++ /dev/null @@ -1,51 +0,0 @@ - - Qhull 2012.1 2012/02/18 - - http://www.qhull.org - git@gitorious.org:qhull/qhull.git - http://packages.debian.org/sid/libqhull5 [out-of-date] - http://www6.uniovi.es/ftp/pub/mirrors/geom.umn.edu/software/ghindex.html - http://www.geomview.org - http://www.geom.uiuc.edu - -Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, -furthest-site Voronoi diagrams, and halfspace intersections about a point. -It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull algorithm -for computing convex hulls. Qhull handles round-off errors from floating -point arithmetic. It can approximate a convex hull. - -The program includes options for hull volume, facet area, partial hulls, -input transformations, randomization, tracing, multiple output formats, and -execution statistics. The program can be called from within your application. -You can view the results in 2-d, 3-d and 4-d with Geomview. - -To download Qhull: - http://www.qhull.org/download - git@gitorious.org:qhull/qhull.git - http://packages.debian.org/sid/libqhull5 [out-of-date] - -Download qhull-96.ps for: - - Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, "The - Quickhull Algorithm for Convex Hulls," ACM Trans. on - Mathematical Software, 22(4):469-483, Dec. 1996. - http://www.acm.org/pubs/citations/journals/toms/1996-22-4/p469-barber/ - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.117.405 - -Abstract: - -The convex hull of a set of points is the smallest convex set that contains -the points. This article presents a practical convex hull algorithm that -combines the two-dimensional Quickhull Algorithm with the general dimension -Beneath-Beyond Algorithm. It is similar to the randomized, incremental -algorithms for convex hull and Delaunay triangulation. We provide empirical -evidence that the algorithm runs faster when the input contains non-extreme -points, and that it uses less memory. - -Computational geometry algorithms have traditionally assumed that input sets -are well behaved. When an algorithm is implemented with floating point -arithmetic, this assumption can lead to serious errors. We briefly describe -a solution to this problem when computing the convex hull in two, three, or -four dimensions. The output is a set of "thick" facets that contain all -possible exact convex hulls of the input. A variation is effective in five -or more dimensions. diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/CMakeLists.txt b/src/amuse_simplex/src/plugins/qhull-2012.1/CMakeLists.txt deleted file mode 100644 index 98dbc705e2..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/CMakeLists.txt +++ /dev/null @@ -1,432 +0,0 @@ -# CMakeLists.txt -- CMake configuration file for qhull, qhull6, and related programs -# -# To build with MSYS/mingw -# cd build && cmake -G "MSYS Makefiles" .. && cmake .. -# make -# make install -# -# To uninstall on unix or MSYS/mingw -# xargs rm - - [out-of-date] - - News and a paper: - - - - Version 1 (simplicial only): - - - -Purpose - - Qhull is a general dimension convex hull program that reads a set - of points from stdin, and outputs the smallest convex set that contains - the points to stdout. It also generates Delaunay triangulations, Voronoi - diagrams, furthest-site Voronoi diagrams, and halfspace intersections - about a point. - - Rbox is a useful tool in generating input for Qhull; it generates - hypercubes, diamonds, cones, circles, simplices, spirals, - lattices, and random points. - - Qhull produces graphical output for Geomview. This helps with - understanding the output. - -Environment requirements - - Qhull and rbox should run on all 32-bit and 64-bit computers. Use - an ANSI C or C++ compiler to compile the program. The software is - self-contained. It comes with examples and test scripts. - - Qhull's C++ interface uses the STL. The C++ test program uses QTestLib - from Nokia's Qt Framework. Qhull's C++ interface may change without - notice. Eventually, it will move into the qhull shared library. - - Qhull is copyrighted software. Please read COPYING.txt and REGISTER.txt - before using or distributing Qhull. - -To cite Qhull, please use - - Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., "The Quickhull - algorithm for convex hulls," ACM Trans. on Mathematical Software, - 22(4):469-483, Dec 1996, http://www.qhull.org. - -To contribute to Qhull - - Qhull is on Gitorious (http://gitorious.org:qhull, git@gitorious.org:qhull/qhull.git) - - For internal documentation, see html/qh-code.htm - -To install Qhull - - Qhull is precompiled for Windows, otherwise it needs compilation. - - Besides makefiles for gcc, qhull includes CMakeLists.txt for CMake, - vcproj/sln files for Microsoft Visual Studio, and .pro files for Qt Creator. - It compiles with mingw. - - Install and build instructions follow. - - See the end of this document for a list of distributed files. - ------------------ -Installing Qhull on Windows - - The zip file contains rbox.exe, qhull.exe, qconvex.exe, qdelaunay.exe, - qhalf.exe, qvoronoi.exe, testqset.exe, user_eg*.exe, documentation files, - and source files. - - To install Qhull: - - Unzip the files into a directory. You may use WinZip32 - - Click on QHULL-GO or open a command window into Qhull's bin directory. - - To uninstall Qhull - - Delete the qhull directory - - To learn about Qhull: - - Execute 'qconvex' for a synopsis and examples. - - Execute 'rbox 10 | qconvex' to compute the convex hull of 10 random points. - - Execute 'rbox 10 | qconvex i TO file' to write results to 'file'. - - Browse the documentation: qhull\html\index.htm - - If an error occurs, Windows sends the error to stdout instead of stderr. - Use 'TO xxx' to send normal output to xxx and error output to stdout - - To improve the command window - - Double-click the window bar to increase the size of the window - - Right-click the window bar - - Select Properties - - Check QuickEdit Mode - Select text with right-click or Enter - Paste text with right-click - - Change Font to Lucinda Console - - Change Layout to Screen Buffer Height 999, Window Size Height 55 - - Change Colors to Screen Background White, Screen Text Black - - Click OK - - Select 'Modify shortcut that started this window', then OK - - If you use qhull a lot, install MSYS (www.mingw.org), - Road Bash (www.qhull.org/bash), or Cygwin (www.cygwin.com). - ------------------ -Installing Qhull on Unix with gcc - - To build Qhull, static libraries, shared library, and C++ interface - - Extract Qhull from qhull...tgz or qhull...zip - - make - - export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH - - Or, to build Qhull and libqhullstatic.a - - Extract Qhull from qhull...tgz or qhull...zip - - cd src/libqhull - - make - - The Makefiles may be edited for other compilers. - If 'testqset' exits with an error, qhull is broken - ------------------ -Installing Qhull with CMake 2.6 or later - - To build Qhull, static libraries, shared library, and C++ interface - - Extract Qhull from qhull...tgz or qhull...zip - - cd build - - cmake .. - - make - - make install - - On Windows, CMake installs to C:/Program Files/qhull - See CMakeLists.txt for further build instructions - ------------------ -Installing Qhull with Qt - - To build Qhull, static libraries, shared library, C++ interface, and C++ test - - Extract Qhull from qhull...tgz or qhull...zip - - cd src - - qmake - - make - ------------------ -Installing Qhull with Autoconf [WARNING out-of-date] - - The tar.gz tarball contains documentation, source files, - and a config directory [R. Laboissiere]. - - [Nov 2011] Qhull 2009.1.2 does not include the C++ interface - - To install Qhull - - Extract the files - - ./configure - - make - - make install - -------------------- -Working with Qhull's C++ interface - - Qhull's C++ interface is likely to change. Stay current with Gitorious. - - To clone Qhull's next branch from http://gitorious.org/qhull - git init - git clone git://gitorious.org/qhull/qhull.git - cd qhull - git checkout next - ... - git pull origin next - ------------------- -Compiling Qhull with Microsoft Visual C++ 2005 or later - - To compile Qhull with Microsoft Visual C++ - - Extract Qhull from Gitorious, qhull...tgz, or qhull...zip - - Load solution build/qhull.sln - - Build - - Project qhulltest requires Qt for DevStudio (http://qt.nokia.com/downloads) - Set the QTDIR environment variable to your Qt directory (e.g., c:/qt/4.7.4) - If incorrect, precompile will fail with 'Can not locate the file specified' - ------------------ -Compiling Qhull with Qt Creator - - Qt (http://qt.nokia.com) is a C++ framework for Windows, Linux, and Macintosh - - Qhull uses QTestLib to test qhull's C++ interface (qhulltest) - - To compile Qhull with Qt Creator - - Extract Qhull from Gitorious, qhull...tgz, or qhull...zip - - Download the Qt SDK from Nokia (http://qt.nokia.com/downloads) - - Start Qt Creator - - Load src/qhull-all.pro - - Build - ------------------ -Compiling Qhull with mingw on Windows - - To compile Qhull with MINGW - - Extract Qhull from Gitorious, qhull...tgz, or qhull...zip - - Install Road Bash (http://www.qhull.org/bash) - or install MSYS (http://www.mingw.org/wiki/msys) - - Install MINGW (http://www.mingw.org/). Mingw is included with Qt SDK. - - make - ------------------ -Compiling Qhull with cygwin on Windows - - To compile Qhull with cygwin - - Extract Qhull from Gitorious, qhull...tgz, or qhull...zip - - Install cygwin (http://www.cygwin.com) - - Include packages for gcc, make, ar, and ln - - make - ------------------ -Compiling from Makfile without gcc - - The file, qhull-src.tgz, contains documentation and source files for - qhull and rbox. - - To unpack the gzip file - - tar zxf qhull-src.tgz - - cd qhull - - Compiling qhull and rbox with Makefile - - in Makefile, check the CC, CCOPTS1, PRINTMAN, and PRINTC defines - - the defaults are gcc and enscript - - CCOPTS1 should include the ANSI flag. It defines __STDC__ - - in user.h, check the definitions of qh_SECticks and qh_CPUclock. - - use '#define qh_CLOCKtype 2' for timing runs longer than 1 hour - - type: make - - this builds: qhull qconvex qdelaunay qhalf qvoronoi rbox libqhull.a - - type: make doc - - this prints the man page - - See also qhull/html/index.htm - - if your compiler reports many errors, it is probably not a ANSI C compiler - - you will need to set the -ansi switch or find another compiler - - if your compiler warns about missing prototypes for fprintf() etc. - - this is ok, your compiler should have these in stdio.h - - if your compiler warns about missing prototypes for memset() etc. - - include memory.h in qhull_a.h - - if your compiler reports "global.c: storage size of 'qh_qh' isn't known" - - delete the initializer "={0}" in global.c, stat.c and mem.c - - if your compiler warns about "stat.c: improper initializer" - - this is ok, the initializer is not used - - if you have trouble building libqhull.a with 'ar' - - try 'make -f Makefile.txt qhullx' - - if the code compiles, the qhull test case will automatically execute - - if an error occurs, there's an incompatibility between machines - - If you can, try a different compiler - - You can turn off the Qhull memory manager with qh_NOmem in mem.h - - You can turn off compiler optimization (-O2 in Makefile) - - If you find the source of the problem, please let us know - - to install the programs and their man pages: - - define MANDIR and BINDIR - - type 'make install' - - - if you have Geomview (www.geomview.org) - - try 'rbox 100 | qconvex G >a' and load 'a' into Geomview - - run 'q_eg' for Geomview examples of Qhull output (see qh-eg.htm) - ------------------- -Compiling on other machines and compilers - - Qhull compiles with Borland C++ 5.0 bcc32. A Makefile is included. - Execute 'make -f Mborland'. If you use the Borland IDE, set the ANSI - option in Options:Project:Compiler:Source:Language-compliance. - - Qhull compiles with Borland C++ 4.02 for Win32 and DOS Power Pack. - Use 'make -f Mborland -D_DPMI'. Qhull 1.0 compiles with Borland - C++ 4.02. For rbox 1.0, use "bcc32 -WX -w- -O2-e -erbox -lc rbox.c". - Use the same options for Qhull 1.0. [D. Zwick] - - Qhull compiles with Metrowerks C++ 1.7 with the ANSI option. - If you turn on full warnings, the compiler will report a number of - unused variables, variables set but not used, and dead code. These are - intentional. For example, variables may be initialized (unnecessarily) - to prevent warnings about possible use of uninitialized variables. - - Qhull compiles on the Power Macintosh with Metrowerk's C compiler. - It uses the SIOUX interface to read point coordinates and return output. - There is no graphical output. For project files, see 'Compiling a - custom build'. Instead of using SIOUX, Qhull may be embedded within an - application. - - Some users have reported problems with compiling Qhull under Irix 5.1. It - compiles under other versions of Irix. - - If you have troubles with the memory manager, you can turn it off by - defining qh_NOmem in mem.h. - ------------------ -Distributed files - - README.txt // Instructions for installing Qhull - REGISTER.txt // Qhull registration - COPYING.txt // Copyright notice - QHULL-GO.lnk // Windows icon for eg/qhull-go.bat - Announce.txt // Announcement - CMakeLists.txt // CMake build file (2.6 or later) - File_id.diz // Package descriptor - index.htm // Home page - Makefile // Makefile for gcc and other compilers - qhull*.md5sum // md5sum for all files - - bin/* // Qhull executables and dll (.zip only) - build/qhull.sln // DevStudio solution and project files (2005 or later) - build/*.vcproj - config/* // Autoconf files for creating configure (Unix only) - eg/* // Test scripts and geomview files from q_eg - html/index.htm // Manual - html/qh-faq.htm // Frequently asked questions - html/qh-get.htm // Download page - html/qhull-cpp.xml // C++ style notes as a Road FAQ (www.qhull.org/road) - src/Changes.txt // Change history for Qhull and rbox - src/qhull-all.pro // Qt project - -eg/ - q_eg // shell script for Geomview examples (eg.01.cube) - q_egtest // shell script for Geomview test examples - q_test // shell script to test qhull - q_test-ok.txt // output from q_test - qhulltest-ok.txt // output from qhulltest (Qt only) - -rbox consists of (bin, html): - rbox.exe // Win32 executable (.zip only) - rbox.htm // html manual - rbox.man // Unix man page - rbox.txt - -qhull consists of (bin, html): - qhull.exe // Win32 executables and dlls (.zip only) - qconvex.exe - qdelaunay.exe - qhalf.exe - qvoronoi.exe - qhull.dll - qhull_p.dll - qhull-go.bat // command window - qconvex.htm // html manual - qdelaun.htm - qdelau_f.htm - qhalf.htm - qvoronoi.htm - qvoron_f.htm - qh-eg.htm - qh-code.htm - qh-impre.htm - index.htm - qh-opt*.htm - qh-quick.htm - qh--*.gif // images for manual - normal_voronoi_knauss_oesterle.jpg - qhull.man // Unix man page - qhull.txt - -bin/ - msvcr80.dll // Visual C++ redistributable file (.zip only) - -src/ - qhull/unix.c // Qhull and rbox applications - qconvex/qconvex.c - qhalf/qhalf.c - qdelaunay/qdelaunay.c - qvoronoi/qvoronoi.c - rbox/rbox.c - - user_eg/user_eg.c // example of using qhull_p.dll (requires -Dqh_QHpointer) - user_eg2/user_eg2.c // example of using qhull.dll from a user program - user_eg3/user_eg3.cpp // example of Qhull's C++ interface with libqhullstatic_p.a - qhulltest/qhulltest.cpp // Test of Qhull's C++ interface using Qt's QTestLib - qhull-*.pri // Include files for Qt projects - -src/libqhull - libqhull.pro // Qt project for shared library (qhull.dll) - index.htm // design documentation for libqhull - qh-*.htm - qhull-exports.def // Export Definition file for Visual C++ - Makefile // Simple gcc Makefile for qhull and libqhullstatic.a - Mborland // Makefile for Borland C++ 5.0 - - libqhull.h // header file for qhull - user.h // header file of user definable constants - libqhull.c // Quickhull algorithm with partitioning - user.c // user re-definable functions - usermem.c - userprintf.c - userprintf_rbox.c - - qhull_a.h // include files for libqhull/*.c - geom.c // geometric routines - geom2.c - geom.h - global.c // global variables - io.c // input-output routines - io.h - mem.c // memory routines, this is stand-alone code - mem.h - merge.c // merging of non-convex facets - merge.h - poly.c // polyhedron routines - poly2.c - poly.h - qset.c // set routines, this only depends on mem.c - qset.h - random.c // utilities w/ Park & Miller's random number generator - random.h - rboxlib.c // point set generator for rbox - stat.c // statistics - stat.h - -src/libqhullp - libqhullp.pro // Qt project for shared library (qhull_p.dll) - qhull_p-exports.def // Export Definition file for Visual C++ - -src/libqhullstatic/ - libqhullstatic.pro // Qt project for static library - -src/libqhullstaticp/ - libqhullstaticp.pro // Qt project for static library with qh_QHpointer - -src/libqhullcpp/ - libqhullcpp.pro // Qt project for static C++ library - Qhull.cpp // Call libqhull.c from C++ - Qhull.h - qt-qhull.cpp // Supporting methods for Qt - qhull_interface.cpp // Another approach to C++ - - Coordinates.cpp // input classes - Coordinates.h - PointCoordinates.cpp - PointCoordinates.h - RboxPoints.cpp // call rboxlib.c from C++ - RboxPoints.h - - QhullFacet.cpp // data structure classes - QhullFacet.h - QhullHyperplane.cpp - QhullHyperplane.h - QhullPoint.cpp - QhullPoint.h - QhullQh.cpp - QhullStat.cpp - QhullStat.h - QhullVertex.cpp - QhullVertex.h - - QhullFacetList.cpp // collection classes - QhullFacetList.h - QhullFacetSet.cpp - QhullFacetSet.h - QhullIterator.h - QhullLinkedList.h - QhullPoints.cpp - QhullPoints.h - QhullPointSet.cpp - QhullPointSet.h - QhullRidge.cpp - QhullRidge.h - QhullSet.cpp - QhullSet.h - QhullSets.h - QhullVertexSet.cpp - QhullVertexSet.h - - functionObjects.h // supporting classes - QhullError.cpp - QhullError.h - QhullQh.cpp - QhullQh.h - UsingLibQhull.cpp - UsingLibQhull.h - -src/qhulltest/ - qhulltest.pro // Qt project for test of C++ interface - Coordinates_test.cpp // Test of each class - PointCoordinates_test.cpp - Point_test.cpp - QhullFacetList_test.cpp - QhullFacetSet_test.cpp - QhullFacet_test.cpp - QhullHyperplane_test.cpp - QhullLinkedList_test.cpp - QhullPointSet_test.cpp - QhullPoints_test.cpp - QhullPoint_test.cpp - QhullRidge_test.cpp - QhullSet_test.cpp - QhullVertexSet_test.cpp - QhullVertex_test.cpp - Qhull_test.cpp - RboxPoints_test.cpp - UsingLibQhull_test.cpp - -src/road/ - RoadError.cpp // Supporting base classes - RoadError.h - RoadLogEvent.cpp - RoadLogEvent.h - RoadTest.cpp // Run multiple test files with QTestLib - RoadTest.h - -src/testqset/ - testqset.pro // Qt project for test qset.c with mem.c - testqset.c - ------------------ -Authors: - - C. Bradford Barber Hannu Huhdanpaa (Version 1.0) - bradb@shore.net hannu@qhull.org - - Qhull 1.0 and 2.0 were developed under NSF grants NSF/DMS-8920161 - and NSF-CCR-91-15793 750-7504 at the Geometry Center and Harvard - University. If you find Qhull useful, please let us know. diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/REGISTER.txt b/src/amuse_simplex/src/plugins/qhull-2012.1/REGISTER.txt deleted file mode 100644 index 16ccb1a58d..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/REGISTER.txt +++ /dev/null @@ -1,32 +0,0 @@ -Dear Qhull User - -We would like to find out how you are using our software. Think of -Qhull as a new kind of shareware: you share your science and successes -with us, and we share our software and support with you. - -If you use Qhull, please send us a note telling -us what you are doing with it. - -We need to know: - - (1) What you are working on - an abstract of your work would be - fine. - - (2) How Qhull has helped you, for example, by increasing your - productivity or allowing you to do things you could not do - before. If Qhull had a direct bearing on your work, please - tell us about this. - -We encourage you to cite Qhull in your publications. - -To cite Qhull, please use - - Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., "The Quickhull - algorithm for convex hulls," ACM Trans. on Mathematical Software, - 22(4):469-483, Dec 1996, http://www.qhull.org. - -Please send e-mail to - - bradb@shore.net - -Thank you! diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-eg b/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-eg deleted file mode 100644 index 539f26fd85..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-eg +++ /dev/null @@ -1,25 +0,0 @@ -### Makefile.am for the qhull package (eg) -### Author: Rafael Laboissiere -### Created: Mon Dec 3 21:36:21 CET 2001 -### Update for 2010.1: O. Lahaye, jun'10 -### Draft update for 2011.2: B. Barber, dec'11 - -### Documentation files - -# to: -docdir = $(prefix)/share/doc/$(PACKAGE) -examplesdir = $(docdir)/examples - -# which: -examples_DATA = \ - q_eg \ - q_egtest \ - q_test \ - q_test-ok.txt \ - q_test.bat \ - Qhull-go.bat \ - qhulltest-ok.txt - -### Extra files to be included in the tarball - -EXTRA_DIST = $(examples_DATA) diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-html b/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-html deleted file mode 100644 index 12cc44926d..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-html +++ /dev/null @@ -1,60 +0,0 @@ -### Makefile.am for the qhull package (html) -### Author: Rafael Laboissiere -### Created: Mon Dec 3 21:36:21 CET 2001 -### Update for 2010.1: O. Lahaye, jun'10 -### Draft update for 2011.2: B. Barber, dec'11 - -### Man pages (trick to get around .man extension) - -%.1: %.man - cp $< $@ -CLEANFILES = *.1 -man_MANS = rbox.1 qhull.1 - -### Documentation files - -# to: -docdir = $(prefix)/share/doc/$(PACKAGE) -htmldir = $(docdir)/html - -# which: -html_DATA = \ - index.htm \ - normal_voronoi_knauss_oesterle.jpg \ - qconvex.htm \ - qdelau_f.htm \ - qdelaun.htm \ - qhalf.htm \ - qhull.htm \ - qvoron_f.htm \ - qvoronoi.htm \ - rbox.htm \ - qh--4d.gif \ - qh--cone.gif \ - qh--dt.gif \ - qh--geom.gif \ - qh--half.gif \ - qh--rand.gif \ - qh-code.htm \ - qh-eg.htm \ - qh-faq.htm \ - qh-get.htm \ - qh-impre.htm \ - qh-optc.htm \ - qh-optf.htm \ - qh-optg.htm \ - qh-opto.htm \ - qh-optp.htm \ - qh-optq.htm \ - qh-optt.htm \ - qh-quick.htm - -### Extra files to be included in the tarball - -EXTRA_DIST = \ - $(html_DATA) \ - qhull.man \ - qhull.txt \ - qhull-cpp.xml\ - rbox.man \ - rbox.txt diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-libqhull b/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-libqhull deleted file mode 100644 index 86f73e4510..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-libqhull +++ /dev/null @@ -1,103 +0,0 @@ -### Makefile.am for the qhull package (src) -### Author: Rafael Laboissiere -### Created: Mon Dec 3 21:36:21 CET 2001 - -### Shared Library - -# to: -lib_LTLIBRARIES = libqhull.la - -# from: -libqhull_la_SOURCES = \ - rboxlib.c \ - user.c \ - global.c \ - stat.c \ - io.c \ - geom2.c \ - poly2.c \ - merge.c \ - libqhull.c \ - geom.c \ - poly.c \ - qset.c \ - mem.c \ - usermem.c \ - userprintf.c \ - userprintf_rbox.c \ - random.c - -# how: -libqhull_la_LDFLAGS = -version-info 6:3:1 -lm - -### Utility programs - -# to: -bin_PROGRAMS = qhull rbox qconvex qdelaunay qvoronoi qhalf testqset - -# from: -qhull_SOURCES = unix.c -rbox_SOURCES = rbox.c -qconvex_SOURCES = qconvex.c -qdelaunay_SOURCES = qdelaun.c -qvoronoi_SOURCES = qvoronoi.c -qhalf_SOURCES = qhalf.c -testqset_SOURCES = testqset.c qset.c mem.c - -# how: -qhull_LDADD = libqhull.la -rbox_LDADD = libqhull.la -qconvex_LDADD = libqhull.la -qdelaunay_LDADD = libqhull.la -qvoronoi_LDADD = libqhull.la -qhalf_LDADD = libqhull.la - -### Include files - -pkginclude_HEADERS = \ - geom.h \ - mem.h \ - poly.h \ - qhull_a.h \ - stat.h \ - io.h \ - merge.h \ - libqhull.h \ - random.h \ - qset.h \ - user.h - - -### Example programs - -# to: -docdir = $(prefix)/share/doc/$(PACKAGE) -examplesdir = $(docdir)/examples - -# which: -examples_DATA = \ - user_eg.c \ - user_eg2.c \ - Makefile \ - Mborland - -doc_DATA = \ - Changes.txt \ - index.htm \ - qh-geom.htm \ - qh-globa.htm \ - qh-io.htm \ - qh-mem.htm \ - qh-merge.htm \ - qh-poly.htm \ - qh-qhull.htm \ - qh-set.htm \ - qh-stat.htm \ - qh-user.htm - - -### Extra files to be included in the tarball - -EXTRA_DIST = \ - $(doc_DATA) \ - $(examples_DATA) diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-main b/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-main deleted file mode 100644 index 8ad265a896..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile-am-main +++ /dev/null @@ -1,29 +0,0 @@ -### Makefile.am for the qhull package (main) -### Author: Rafael Laboissiere -### Created: Mon Dec 3 21:36:21 CET 2001 - -### Documentation files - -# to: -docdir = $(prefix)/share/doc/$(PACKAGE) - -# which: -doc_DATA = \ - index.htm \ - Announce.txt \ - COPYING.txt \ - README.txt \ - REGISTER.txt - -### Extra files to be included in the tarball - -EXTRA_DIST = \ - $(doc_DATA) \ - .gitignore \ - CMakeLists.txt \ - File_id.diz \ - QHULL-GO.lnk - -### Subdirectories for Automaking - -SUBDIRS = src/libqhull html eg config diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile.am b/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile.am deleted file mode 100644 index f4792ca9be..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -### Makefile.am for the qhull package (config) -### Author: Rafael Laboissiere -### Created: Mon Dec 3 21:36:21 CET 2001 - -### Extra files to be included in the tarball - -EXTRA_DIST = \ - README \ - bootstrap.sh \ - Makefile-am-main \ - Makefile-am-eg \ - Makefile-am-html \ - Makefile-am-src - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/README b/src/amuse_simplex/src/plugins/qhull-2012.1/config/README deleted file mode 100644 index 758fe7160a..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/README +++ /dev/null @@ -1,30 +0,0 @@ -Autotools configuration for Qhull ---------------------------------- - -This directory contains all the files needed to bootstrap the Qhull package -for using Autoconf, Automake, and Libtool. - -See ../README.txt for instructions on building with make, cmake, qt, and Microsoft DevStudio - -WARNING -- Reworked for qhull-2012.1 but not tested. - Produces qhull.so - Ignores the C++ interface and libqhull_p.so - The patch subdirectory is out-of-date. - It was not used for Qhull 2009.1 - user.h sets qh_QHpointer=0 (static allocation of qh_qh) - Brad Barber , 2012-01-27 - -Go to the top source dir and type: - - config/bootstrap.sh - -And then the usual: - - ./configure --prefix=/your/preferred/path/here - make - make install - - - -- Rafael Laboissiere , Sun Feb 1 13:43:54 CET 2004 - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/bootstrap.sh b/src/amuse_simplex/src/plugins/qhull-2012.1/config/bootstrap.sh deleted file mode 100755 index c9296aaa61..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/bootstrap.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -run () { - echo -n Running `$1 --version | sed q`... - $* > /dev/null - echo " done" -} - - -if test ! -f config/configure.ac ; then - echo "$0: This script must be run from the Qhull top directory." - exit 1 -fi - -echo -n Copying autoconf and automake files... -cp config/configure.ac . -cp config/Makefile-am-main Makefile.am -for d in html eg ; do - cp config/Makefile-am-$d $d/Makefile.am -done -for d in libqhull ; do - cp config/Makefile-am-$d src/$d/Makefile.am -done -echo -en ' done\nCopying program sources to src/libqhull...' -sources="src/qconvex/qconvex.c src/qdelaunay/qdelaun.c src/qhalf/qhalf.c \ - src/qhull/unix.c src/qvoronoi/qvoronoi.c src/rbox/rbox.c src/testqset/testqset.c" -cp $sources src/libqhull -echo " done" - -run aclocal \ - && run libtoolize --force --copy \ - && run automake --foreign --add-missing --force-missing --copy \ - && run autoconf diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/changelog b/src/amuse_simplex/src/plugins/qhull-2012.1/config/changelog deleted file mode 100644 index eab5f2466e..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/changelog +++ /dev/null @@ -1,128 +0,0 @@ -Qhull 2012.1 2012/02/02 - - Add config to distribution - - Add testqset to config build - - config/bootstrap.sh copies program files into src/libqhull - -Qhull 2011.2 (qhull6) 2011/12/02 - - Removed Make-conf.sh (from the qhull 2003.1 release) - - The original changelog follows - - Adjusted the Makefiles for the new directory structure. - - Kept qh_QHpointer=0 (static global data structure, qh_qh). It is faster. - Qhull 2012 may have a new interface which passes qh_qh as a parameter. - -Qhull 2009.1.2 2011/11/21 - - Revert to LF line endings [P. Cheeseman] - - Remove out-of-date material from qhull-go.bat - - Replaced QHULL-GO with a lnk file - -qhull 2009.1.1 2010/01/09 -- Patch release of 2009.1. - qh_gethash allowed a negative result, causing overwrite or segfault - See git:qhull/project/patch/qhull-2003.1/poly.c-qh_gethash.patch - Compared results of q_test, q_eg, q_egtest with patched poly.c, qhull-2003.1 - -qhull (2009.1, qhull5) - -This is a maintenance release done by Rafael Laboissiere . - - src/rbox.c (main): Avoid problems of evaluation order when - pre-incrementing arguments of strtod - - src/io.c (qh_produce_output), src/stat.c (qh_initstatistics): Use %lu - instead of %d in the format string for arguments of type size_t - - html/qhull.man, html/rbox.man: Fix several syntax, macros, and hyphen - problems in man pages - - The Autotools files have been generated with modern version of autoconf (2.63), - automake/aclocal (1.10.2), and libtool (2.2.6) - - Some character issues in the man pages are fixed - -qhull (2003.1-1, qhull5) unstable; urgency=low - - * New upstream release. There are backward incompatibilities in the code - and the soversion was bumped to libqhull5. - * debian/rules: - - Major rewrite of build and install rules, since we are using now the - upstream tarball generated with "make dist". - - Added config rule. - - Use dpatch to patch src/user.h (enable qh_QHpointer). - * debian/control: - - Removed build-dependencies on autoconf, automake, and libtool. - - Build-depends on dpatch. - - Changed section of libqhull-dev package to libdevel. - * debian/libqhull-dev.files: Added usr/share/doc/libqhull5/src - directory. - - -- Rafael Laboissiere Sun, 1 Feb 2004 01:14:13 +0100 - -qhull (2002.1-4) unstable; urgency=low - - * src/Make-config.sh: Patched upstream file for proper initialization of - the Autotools. - * debian/install-src-html.sh: Added script for including src/*.htm - source documentation files into html doc dir. - * debian/control: - - Bumped Standards-Version to 3.6.1 (no changes needed). - - Changed build-dependencies to autoconf and automake1.7 (instead of - autoconf2.13 and automake1.6). Added eperl. - * debian/libqhull-dev.files: Added dir usr/share/doc/libqhull4/src. - * debian/manpage.in: Added template for missing man pages. - * debian/rules: - - Call debian/install-src-html.sh. - - Generate manpages for qconvex, qdelaunay, qhalf, and qvoronoi - commands. Lintian is happy now. - - -- Rafael Laboissiere Thu, 18 Dec 2003 21:20:14 +0100 - -qhull (2002.1-3) unstable; urgency=low - - * New maintainer (as per http://lists.debian.org/debian-devel/1999 - /debian-devel-199911/msg01061.html). - * debian/rules: Use the upstream script Make-config.sh, which sets up - the autoconf/automake/libtool files. Also, clean up all the generated - files in the clean rule. - * debian/control: Bumped Standards-Version to 3.5.7. Added - Build-Dependencies to autoconf/automake/libtool. - - -- Rafael Laboissiere Wed, 25 Sep 2002 10:39:30 +0200 - -qhull (2002.1-2) unstable; urgency=low - - * use shared char* qh_version in library - - -- Barak Pearlmutter Sat, 7 Sep 2002 10:34:13 -0600 - -qhull (2002.1-1) unstable; urgency=low - - * new upstream source - - -- Barak Pearlmutter Thu, 5 Sep 2002 20:51:10 -0600 - -qhull (3.1-5) unstable; urgency=low - - * rephrase descriptions (closes: #141027) - - -- Barak Pearlmutter Thu, 11 Apr 2002 22:12:33 -0600 - -qhull (3.1-4) unstable; urgency=low - - * include executables qconvex, qhalf, qvoronoi, qdelaunay - * break executables out into separate package qhull-bin - - -- Barak Pearlmutter Wed, 27 Mar 2002 20:26:44 -0700 - -qhull (3.1-3) unstable; urgency=low - - * rename executable qhull-rbox back to rbox - - -- Barak Pearlmutter Mon, 25 Mar 2002 09:13:57 -0700 - -qhull (3.1-2) unstable; urgency=low - - * src/qconvex.c did not belong in the library - * qh_version was multiply defined, now defined only in qhull.c - - -- Barak Pearlmutter Mon, 25 Mar 2002 08:55:45 -0700 - -qhull (3.1-1) unstable; urgency=low - - * Initial Release. (closes: #108115) - - -- Barak Pearlmutter Sun, 24 Mar 2002 21:53:13 -0700 diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/configure.ac b/src/amuse_simplex/src/plugins/qhull-2012.1/config/configure.ac deleted file mode 100644 index e68ed2b498..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/configure.ac +++ /dev/null @@ -1,25 +0,0 @@ -dnl configure.ac for the qhull package -dnl Author: Rafael Laboissiere -dnl Created: Mon Dec 3 21:36:21 CET 2001 -dnl Draft update for 2011.2: B. Barber, dec'11 - -AC_INIT(qhull, 6.3.1) -AC_CONFIG_SRCDIR(src/libqhull/libqhull.c) - -AC_CONFIG_AUX_DIR(config) -AC_CONFIG_MACRO_DIR(config) - -AM_INIT_AUTOMAKE - -AC_PROG_CC -AC_PROG_LIBTOOL - -AC_CONFIG_FILES([ - Makefile - src/libqhull/Makefile - html/Makefile - eg/Makefile - config/Makefile -]) - -AC_OUTPUT diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/00list b/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/00list deleted file mode 100644 index 895e71430a..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/00list +++ /dev/null @@ -1,2 +0,0 @@ -QHpointer.dpatch -make-new-msg.dpatch diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/QHpointer.dpatch b/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/QHpointer.dpatch deleted file mode 100755 index 16f04f5eaf..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/QHpointer.dpatch +++ /dev/null @@ -1,35 +0,0 @@ -#! /bin/sh -e -## QHpointer.dpatch by Rafael Laboissiere -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Access Qhull globals via a pointer to allocated memory - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) - patch $patch_opts -p1 < $0;; - -unpatch) - patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 ---- qhull-orig/src/user.h 2002-04-29 11:01:46.000000000 +0200 -+++ qhull/src/user.h 2004-02-02 11:04:47.000000000 +0100 -@@ -509,7 +509,7 @@ - see: - user_eg.c for an example - */ --#define qh_QHpointer 0 -+#define qh_QHpointer 1 - #if 0 /* sample code */ - qhT *oldqhA, *oldqhB; - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/make-new-msg.dpatch b/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/make-new-msg.dpatch deleted file mode 100755 index 8cb77cccdf..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/config/patches/make-new-msg.dpatch +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -e -## QHpointer.dpatch by Rafael Laboissiere -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Access Qhull globals via a pointer to allocated memory - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) - patch $patch_opts -p1 < $0;; - -unpatch) - patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 ---- qhull-orig/src/io.c 2004-01-31 12:00:15.000000000 +0100 -+++ qhull/src/io.c 2004-02-06 09:54:18.000000000 +0100 -@@ -4017,11 +4017,8 @@ - qh rbox_command[strlen(qh rbox_command)-1]= '\0'; - if (!strcmp (qh rbox_command, "./rbox D4")) - fprintf (qh ferr, "\n\ --This is the qhull test case. If any errors or core dumps occur,\n\ --recompile qhull with 'make new'. If errors still occur, there is\n\ --an incompatibility. You should try a different compiler. You can also\n\ --change the choices in user.h. If you discover the source of the problem,\n\ --please send mail to qhull_bug@qhull.org.\n\ -+This is the qhull test case. If any errors or core dumps occur,\n\ -+fill a bug report against the libqhull Debian package.\n\ - \n\ - Type 'qhull' for a short list of options.\n"); - } diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/Qhull-go.bat b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/Qhull-go.bat deleted file mode 100755 index 1ed404fef3..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/Qhull-go.bat +++ /dev/null @@ -1,18 +0,0 @@ -: Qhull-go.bat invoked as cmd.com from QHULL-GO -@echo off -echo. -echo ========= Qhull with rbox, qconvex, qdelaunay, qvoronoi, qhalf ============ -echo. -echo Use arrow keys to repeat and edit commands. -echo. -echo Double-click window bar for full height, or -echo "right-click > Properties > Layout > Window Size > Height > 50 " -echo. -echo Type 'qconvex' for synopsis and examples. -echo. -echo ========= -echo. - -title Qhull -cd bin -%comspec% diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/make-vcproj.sh b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/make-vcproj.sh deleted file mode 100755 index 90f3450c31..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/make-vcproj.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# make-vcproj.sh -- Make sln and vcproj files from CMakeLists.txt and qhull-all.pro -# -# [jan'12] Additional changes made by hand for qhull 2012.1. This file updated but not tested. -# -# $Id: //main/2011/qhull/eg/make-vcproj.sh#5 $$Change: 1476 $ -# $DateTime: 2012/01/28 09:37:56 $$Author: bbarber $ - -if [[ ! -f CMakeLists.txt || ! -f src/qhull-all.pro ]]; then - echo "Excute eg/make-vcproj.sh from qhull directory with CMakeLists.txt and src/qhull-all.pro" - exit -fi - -echo "Set up build directories..." -if [[ ! -d build-prev ]]; then - echo "Backup previous build" - cp -r build build-prev && rm -r build -fi -rm -r buildvc buildqt -mkdir -p build -mkdir -p buildvc -mkdir -p buildqt -echo "Create vcproj files with cmake and qmake..." -cd buildvc && cmake -G "Visual Studio 8 2005" .. && cmake .. -cd .. -cd buildqt && qmake -tp vc -r ../src/qhull-all.pro -cd .. -if [[ ! -f CMakeLists.txt || ! -f buildvc/qhull.vcproj || ! -f buildqt/qhulltest/qhulltest.vcproj ]]; then - echo "qmake and cmake did not build vcproj files in buildvc/ and buildqt" - exit -fi - - -for f in buildvc/*.vcproj buildqt/qhulltest/*.vcproj; do - echo $f - if [[ ! ${f##*INSTALL*} || ! ${f##*ALL_BUILD*} || ! ${f##*ZERO_CHECK*} ]]; then - continue - fi - dest=build/${f##*\/} - sed -r -e 's|[cC]:\\bash\\local\\qhull|..|g' \ - -e 's|[cC]:/bash/local/qhull|..|g' \ - -e '\|CMake| d' \ - -e 's/;CMAKE_INTDIR=..quot;[A-Za-z]*..quot;//' \ - -e 's/LinkIncremental="2"/LinkIncremental="1"/' \ - -e 's/RuntimeLibrary[=]/RuntimeTypeInfo="false" RuntimeLibrary=/' \ - -e 's/.*RuntimeTypeInfo."TRUE".*//' \ - -e 's/buildvc/build/g' \ - -e 's/buildqt/build/g' \ - -e 's/\.\.\\\.\./../g' \ - -e 's|\.\./\.\.|..|g' \ - -e 's/c:\\qt\\[0-9]\.[0-9]\.[0-9]/\$(QTDIR)/g' \ - -e 's|..\\build\\[a-zA-Z]*[\\/]([_a-z0-9]*.pdb)|..\\bin\\\1|g' \ - -e 's|..\\build\\[a-zA-Z]*[\\/]([_a-z0-9]*.exe)|..\\bin\\\1|g' \ - -e 's|..\\build\\[a-zA-Z]*[\\/]([_a-z0-9]*.lib)|..\\lib\\\1|g' \ - -e 's|..\\build\\[a-zA-Z]*[\\/]([_a-z0-9]*.dll)|..\\bin\\\1|g' \ - -e 's| [a-zA-Z]*[\\/]([_a-z0-9]*.lib)| ..\\lib\\\1|g' \ - -e 's/"([_a-z0-9]*.exe)/"..\\bin\\\1/g' \ - $f > $dest -done - -echo -e '\nExcept for qhulltest.vcproj,\n*.vcproj: delete empty File in Files section near end of vcproj' -echo -e '\nExcept for qhulltest.vcproj,\n*.vcproj: rename debug targets to qhull_d.dll, etc.' - -# If need to rebuild sln -sed -e '\|Project.*ALL_BUILD|,\|EndProject$| d' \ - -e '\|Project.*INSTALL|,\|EndProject$| d' \ - -e '\|Project.*ZERO_CHECK|,\|EndProject$| d' \ - buildvc/qhull.sln >build/qhull.sln - -echo -echo 'qhull.sln: Remove first line of each GUID list -- postProject\n.* > postProject' -echo 'qhull.sln: Remove four empty project sections' -echo 'qhull.sln: Remove first part of Global section.' -echo 'qhull.sln: Save as PC' -echo '*.vcproj: Remove libqhullcpp from AdditionalIncludeDirectories except for cpp' -echo -echo 'Open qhull.sln with DevStudio and add qhulltest.vcproj' -echo 'Add dependencies on libqhull libqhull6_p and qhullcpp' -echo 'Change Linker>OutputFile to qhulltest.exe' -echo 'Remove qhulltest via Configuration Manager from Release, Debug, etc.' - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_eg b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_eg deleted file mode 100755 index 4d8dd7435b..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_eg +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# writes examples to eg/ -# see html/qh_eg.htm -if ! qconvex >/dev/null 2>&1; then - if [ ! -d bin ]; then - echo Run eg/q_eg from the Qhull directory - exit - fi - if [ ! -e bin/qconvex -a ! -e bin/qconvex.exe ]; then - echo 'Build qhull first. qconvex is missing from bin/ directory and $PATH' - exit - fi - if ! qconvex >/dev/null 2>&1; then - PATH=$PWD/bin:$PATH - fi -fi -mkdir -p eg -set -v -rbox c D3 | qconvex s G >eg/eg.01.cube -rbox c d G2.0 | qconvex s G >eg/eg.02.diamond.cube -rbox s 100 D3 | qconvex s G >eg/eg.03.sphere -rbox s 100 D2 | qconvex s G >eg/eg.04.circle -rbox 10 l | qconvex s G >eg/eg.05.spiral -rbox 1000 D2 | qconvex s C-0.03 Qc Gapcv >eg/eg.06.merge.square -rbox 1000 D3 | qconvex s G >eg/eg.07.box -rbox c G0.4 s 500 | qconvex s G >eg/eg.08a.cube.sphere -rbox d G0.6 s 500 | qconvex s G >eg/eg.08b.diamond.sphere -rbox 100 L3 G0.5 s | qconvex s G >eg/eg.09.lens -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 >eg/eg.10a.sphere.visible -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG-0 >eg/eg.10b.sphere.beyond -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 PG >eg/eg.10c.sphere.horizon -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QV0 PgG >eg/eg.10d.sphere.cone -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga >eg/eg.10e.sphere.new -rbox 100 s P0.5,0.5,0.5 | qhull s Ga QV0g Q0 >eg/eg.14.sphere.corner -rbox 500 W0 | qconvex s QR0 Qc Gvp >eg/eg.15a.surface -rbox 500 W0 | qconvex s QR0 Qt Qc Gvp >eg/eg.15b.triangle -rbox 500 W0 | qconvex s QR0 QJ5e-2 Qc Gvp >eg/eg.15c.joggle -echo 2 = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 >eg/eg.data.17 -echo 25 >>eg/eg.data.17 -rbox 15 D2 B0.3 W0.25 c G0.5 | tail -n +3 >>eg/eg.data.17 -rbox 6 r s D2 B0.2 | tail -n +3 >>eg/eg.data.17 -qdelaunay s Qt eg/eg.17a.delaunay.2 -qdelaunay s eg/eg.17b.delaunay.2i -qdelaunay s eg/eg.17c.delaunay.2-3 -qvoronoi s QJ eg/eg.17d.voronoi.2 -qvoronoi s eg/eg.17e.voronoi.2i -rbox c G0.1 d | qdelaunay Gt Qz >eg/eg.17f.delaunay.3 -rbox 10 D2 d | qdelaunay s Qu G >eg/eg.18a.furthest.2-3 -rbox 10 D2 d | qdelaunay s Qu Pd2 G >eg/eg.18b.furthest-up.2-3 -rbox 10 D2 d | qvoronoi s Qu Gv >eg/eg.18c.furthest.2 -rbox 10 D3 | qvoronoi s FQ QV5 p | qconvex s G >eg/eg.19.voronoi.region.3 -rbox r s 20 Z1 G0.2 | qconvex s QR1 G >eg/eg.20.cone -rbox 200 s | qconvex s Qc R0.014 Gpav >eg/eg.21b.roundoff.fixed -rbox 1000 s| qconvex s C0.01 Qc Gcrp >eg/eg.22a.merge.sphere.01 -rbox 1000 s| qconvex s C-0.01 Qc Gcrp >eg/eg.22b.merge.sphere.-01 -rbox 1000 s| qconvex s C0.05 Qc Gcrpv >eg/eg.22c.merge.sphere.05 -rbox 1000 s| qconvex s C-0.05 Qc Gcrpv >eg/eg.22d.merge.sphere.-05 -rbox 1000 | qconvex s Gcprvah C0.1 Qc >eg/eg.23.merge.cube -rbox 5000 D4 | qconvex s GD0v Pd0:0.5 C-0.02 C0.1 >eg/eg.24.merge.cube.4d-in-3d -rbox 5000 D4 | qconvex s s C-0.02 C0.1 Gh >eg/eg.30.4d.merge.cube -rbox 20 D3 | qdelaunay s G >eg/eg.31.4d.delaunay -rbox 30 s D4 | qconvex s G Pd0d1d2D3 >eg/eg.32.4d.octant -rbox 10 r s Z1 G0.3 | qconvex G >eg/eg.33a.cone -rbox 10 r s Z1 G0.3 | qconvex FQ FV n | qhalf G >eg/eg.33b.cone.dual -rbox 10 r s Z1 G0.3 | qconvex FQ FV n | qhalf FQ s Fp | qconvex G >eg/eg.33c.cone.halfspace - -echo ==the following should generate flipped and concave facets== >/dev/null -rbox 200 s | qhull Q0 s R0.014 Gav Po >eg/eg.21a.roundoff.errors -echo ==the preceeding should report flipped and concave facets== >/dev/null - - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_egtest b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_egtest deleted file mode 100755 index e2649547b8..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_egtest +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# writes examples to eg/ -if ! qconvex >/dev/null 2>&1; then - if [ ! -d bin ]; then - echo Run eg/q_eg from the Qhull directory - exit - fi - if [ ! -e bin/qconvex -a ! -e bin/qconvex.exe ]; then - echo 'Build qhull first. qconvex is missing from bin/ directory and $PATH' - exit - fi - if ! qconvex >/dev/null 2>&1; then - PATH=$PWD/bin:$PATH - fi -fi -mkdir -p -set -v -rbox d D3 | qconvex s Gnrv Tc Tv >eg/eg.t01.spheres.3 -rbox d D2 | qconvex s Gnv Tc Tv >eg/eg.t02.spheres.2 -rbox d D3 | qconvex s Gnrp Tc Tv >eg/eg.t03.points.3 -rbox d D2 | qconvex s Gnp Tc Tv >eg/eg.t04.points.2 -rbox c D4 | qconvex s C0.05 GnpcD3 Pd3:0.5 Tc Tv >eg/eg.t05.centrum.points.4-3 -rbox d D3 | qconvex s Gnrc Tc Tv >eg/eg.t06.centrums.3.precise -rbox d D3 | qconvex s C0.05 Gnrc Tc Tv >eg/eg.t07.centrums.3 -rbox d D2 | qconvex s C0.05 Gc Tc Tv >eg/eg.t08.centrums.2 -rbox d D3 | qconvex s Gnha Tc Tv >eg/eg.t09.intersect.3 -rbox d D3 | qconvex s GaD0 Pd0 Tc Tv >eg/eg.t10.faces.3-2 -rbox d D3 | qconvex s GnrpD0 Pd0 Tc Tv >eg/eg.t11.points.3-2 -rbox d D3 | qconvex s C0.05 GnrcD0 Pd0 Tc Tv >eg/eg.t12.centrums.3-2 -rbox d D3 | qconvex s GnhaD0 Pd0 Tc Tv >eg/eg.t13.intersect.3-2 -rbox d D3 | qconvex s GnrvD0 Pd0 Tc Tv >eg/eg.t14.spheres.3-2 -rbox c D4 | qconvex s GvD0 Pd0:0.5 Tc Tv >eg/eg.t15.spheres.4-3 -rbox c D4 | qhull s Q0 C0 GpD0 Pd0:0.5 Tc Tv >eg/eg.t16.points.4-3 -rbox c D4 | qconvex s GahD0 Pd0:0.5 Tc Tv >eg/eg.t17.intersect.4-3 -rbox 100 s | qconvex s C-0.05 Qc Gicvprh Tc Tv >eg/eg.t18.imprecise.3 -rbox 30 s D4 | qconvex s GhD0 Pd0d1d2D3 Tc >eg/eg.t19.intersect.precise.4-3 -rbox 100 s P1,1,1 | qconvex s QG-0 Pgp Tc G >eg/eg.t20.notvisible -rbox 100 s | qconvex s QV-10 Pgp Tc G >eg/eg.t21.notvertex -rbox 100 r D2 P1,1 | qhull s Pd0:0.7 PD0:0.8 QgG0 G Tv >eg/eg.t22.split -rbox 100 D2 c G1.0 | qvoronoi s A-0.95 Gna Tv >eg/eg.t23.voronoi.imprecise -rbox 30 s D4 | qconvex s Gh Pd0d1d2D3 Tc >eg/eg.t24.intersect.precise.4d - -echo ==the following generates an error== >/dev/null -rbox 1000 D4 | qhull Q0 s Po R0.005 Ga Tc Tv >eg/eg.t25.neighbors.4d -echo ==the previous should generate an error== >/dev/null - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test deleted file mode 100755 index 7e8109a44f..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test +++ /dev/null @@ -1,403 +0,0 @@ -#!/bin/sh -# -# NOTE: all tests duplicated in q_test.bat -if ! qconvex >/dev/null 2>&1; then - if [ ! -d bin ]; then - echo Run eg/q_test from the Qhull directory - exit - fi - if [ ! -e bin/qconvex -a ! -e bin/qconvex.exe ]; then - echo 'Build qhull first. qconvex is missing from bin/ directory and $PATH' - exit - fi - if ! qconvex >/dev/null 2>&1; then - PATH=$PWD/bin:$PATH - fi -fi -if ! user_eg >/dev/null; then - echo user_eg failed to run. It uses the shared qhull library - echo 'On Linux, export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH' -fi -set -v -echo === errors if 'user_eg' and 'user_eg2' not found === -echo === check user_eg ${d:-`date`} ===================== -user_eg "QR1 p n Qt" "v p" Fp -user_eg2 "QR1 p" "v p" Fp -user_eg3 rbox "10 D2" "2 D2" qhull "p" -echo === check front ends ${d:-`date`} ================== -qconvex - -qconvex . -qconvex -rbox c D3 | qconvex s n Qt -rbox c D2 | qconvex s i -rbox c D2 | qconvex o -rbox 1000 s | qconvex s Tv FA -rbox c d D2 | qconvex s Qc Fx -rbox y 1000 W0 | qconvex s n -rbox y 1000 W0 | qconvex s QJ -rbox d G1 D12 | qconvex QR0 FA -rbox c D6 | qconvex FA TF500 -rbox c P0 d D2 | qconvex p Fa Fc FP FI Fn FN FS Fv Fx -rbox c d D2 | qconvex s i QV0 -rbox c | qconvex Q0 -qvoronoi - -qvoronoi . -qvoronoi -rbox c P0 D2 | qvoronoi s o -rbox c P0 D2 | qvoronoi Fi Tv -rbox c P0 D2 | qvoronoi Fo -rbox c P0 D2 | qvoronoi Fv -rbox c P0 D2 | qvoronoi s Qu Qt Fv -rbox c P0 D2 | qvoronoi Qu Fo -rbox c G1 d D2 | qvoronoi s p -rbox c G1 d D2 | qvoronoi QJ p -rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN -rbox P0 c D2 | qvoronoi s Fv QV0 -qdelaunay - -qdelaunay . -qdelaunay -rbox c P0 D2 | qdelaunay s o -rbox c P0 D2 | qdelaunay i -rbox c P0 D2 | qdelaunay Fv -rbox c P0 D2 | qdelaunay s Qu Qt Fv -rbox c G1 d D2 | qdelaunay s i -rbox c G1 d D2 | qhull d Qbb Ft -rbox c G1 d D2 | qhull d Qbb QJ s Ft -rbox M3,4 z 100 D2 | qdelaunay s -rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN -rbox P0 P0 c D2 | qdelaunay s FP QV0 -qhalf - -qhalf . -qhalf -rbox d | qhull FQ n | qhalf s Qt H0,0,0 Fp -rbox c | qhull FQ FV n | qhalf s i -rbox c | qhull FQ FV n | qhalf o -rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx -echo === check quality of Qhull for ${d:-`hostname`} ${d:-`date`} -rbox 1000 W0 | qhull QR2 QJ s Fs Tv -rbox 1000 W0 | qhull QR2 s Fs Tv -rbox 1000 s | qhull C0.02 Qc Tv -rbox 500 s D4 | qhull C0.01 Qc Tv -rbox 1000 s | qhull C-0.02 Qc Tv -rbox 1000 s D4 | qhull C-0.01 Qc Tv -rbox 200 s D5 | qhull C-0.01 Qx Qc Tv -rbox 100 s D6 | qhull C-0.001 Qx Qc Tv -rbox 1000 W1e-4 | qhull C-1e-6 Qc Tv -rbox 1000 W5e-4 D4 | qhull C-1e-5 Qc Tv -rbox 400 W1e-3 D5 | qhull C-1e-5 Qx Qc Tv -echo === check input format etc. ${d:-`date`} -qhull <eg/eg.01.cube - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: rbox c D3 | qconvex s G - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 84 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - -rbox c d G2.0 | qconvex s G >eg/eg.02.diamond.cube - -Convex hull of 14 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox c d G2.0 | qconvex s G - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 88 - Number of distance tests for merging: 45 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox s 100 D3 | qconvex s G >eg/eg.03.sphere - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox s 100 D3 | qconvex s G - - Number of points processed: 100 - Number of hyperplanes created: 503 - Number of distance tests for qhull: 1631 - CPU seconds to compute hull (after input): 0 - -rbox s 100 D2 | qconvex s G >eg/eg.04.circle - -Convex hull of 100 points in 2-d: - - Number of vertices: 100 - Number of facets: 100 - -Statistics for: rbox s 100 D2 | qconvex s G - - Number of points processed: 100 - Number of hyperplanes created: 198 - Number of distance tests for qhull: 891 - CPU seconds to compute hull (after input): 0 - -rbox 10 l | qconvex s G >eg/eg.05.spiral - -Convex hull of 10 points in 3-d: - - Number of vertices: 10 - Number of facets: 16 - -Statistics for: rbox 10 l | qconvex s G - - Number of points processed: 10 - Number of hyperplanes created: 26 - Number of distance tests for qhull: 40 - CPU seconds to compute hull (after input): 0 - -rbox 1000 D2 | qconvex s C-0.03 Qc Gapcv >eg/eg.06.merge.square - -Convex hull of 1000 points in 2-d: - - Number of vertices: 4 - Number of coplanar points: 103 - Number of facets: 4 - -Statistics for: rbox 1000 D2 | qconvex s C-0.03 Qc Gapcv - - Number of points processed: 6 - Number of hyperplanes created: 8 - Number of distance tests for qhull: 12111 - Number of distance tests for merging: 43 - Number of distance tests for checking: 3736 - Number of merged facets: 2 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.019 (0.3x) - Maximum distance of vertex below facet: -0.019 (0.3x) - -rbox 1000 D3 | qconvex s G >eg/eg.07.box - -Convex hull of 1000 points in 3-d: - - Number of vertices: 73 - Number of facets: 142 - -Statistics for: rbox 1000 D3 | qconvex s G - - Number of points processed: 81 - Number of hyperplanes created: 368 - Number of distance tests for qhull: 12884 - CPU seconds to compute hull (after input): 0 - -rbox c G0.4 s 500 | qconvex s G >eg/eg.08a.cube.sphere - -Convex hull of 508 points in 3-d: - - Number of vertices: 63 - Number of facets: 122 - -Statistics for: rbox c G0.4 s 500 | qconvex s G - - Number of points processed: 99 - Number of hyperplanes created: 443 - Number of distance tests for qhull: 9648 - CPU seconds to compute hull (after input): 0 - -rbox d G0.6 s 500 | qconvex s G >eg/eg.08b.diamond.sphere - -Convex hull of 506 points in 3-d: - - Number of vertices: 397 - Number of facets: 790 - -Statistics for: rbox d G0.6 s 500 | qconvex s G - - Number of points processed: 409 - Number of hyperplanes created: 2032 - Number of distance tests for qhull: 10055 - Number of distance tests for merging: 8153 - Number of distance tests for checking: 10136 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox 100 L3 G0.5 s | qconvex s G >eg/eg.09.lens - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox 100 L3 G0.5 s | qconvex s G - - Number of points processed: 100 - Number of hyperplanes created: 483 - Number of distance tests for qhull: 1642 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 >eg/eg.10a.sphere.visible - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - Number of 'good' facets: 44 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 - - Number of points processed: 100 - Number of hyperplanes created: 513 - Number of distance tests for qhull: 1704 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG-0 >eg/eg.10b.sphere.beyond - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - Number of 'good' facets: 152 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG-0 - - Number of points processed: 100 - Number of hyperplanes created: 513 - Number of distance tests for qhull: 1704 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 PG >eg/eg.10c.sphere.horizon - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - Number of 'good' facets: 44 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QG0 PG - - Number of points processed: 100 - Number of hyperplanes created: 513 - Number of distance tests for qhull: 1704 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QV0 PgG >eg/eg.10d.sphere.cone - -Convex hull of 101 points in 3-d: - - Number of vertices: 85 - Number of facets: 166 - Number of 'good' facets: 14 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qconvex s Ga QV0 PgG - - Number of points processed: 88 - Number of hyperplanes created: 429 - Number of distance tests for qhull: 1594 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qconvex s Ga >eg/eg.10e.sphere.new - -Convex hull of 101 points in 3-d: - - Number of vertices: 85 - Number of facets: 166 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qconvex s Ga - - Number of points processed: 88 - Number of hyperplanes created: 429 - Number of distance tests for qhull: 1594 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P0.5,0.5,0.5 | qhull s Ga QV0g Q0 >eg/eg.14.sphere.corner - -Convex hull of 101 points in 3-d: - - Number of vertices: 42 - Number of facets: 80 - Number of 'good' facets: 14 - -Statistics for: rbox 100 s P0.5,0.5,0.5 | qhull s Ga QV0g Q0 - - Number of points processed: 45 - Number of hyperplanes created: 194 - Number of distance tests for qhull: 1435 - CPU seconds to compute hull (after input): 0 - -rbox 500 W0 | qconvex s QR0 Qc Gvp >eg/eg.15a.surface - -Convex hull of 500 points in 3-d: - - Number of vertices: 66 - Number of coplanar points: 434 - Number of facets: 80 - Number of non-simplicial facets: 6 - -Statistics for: rbox 500 W0 | qconvex s QR0 Qc Gvp QR1327454200 - - Number of points processed: 70 - Number of hyperplanes created: 211 - Number of distance tests for qhull: 8277 - Number of distance tests for merging: 1884 - Number of distance tests for checking: 6765 - Number of merged facets: 56 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 2.3e-015 (0.3x) - -rbox 500 W0 | qconvex s QR0 Qt Qc Gvp >eg/eg.15b.triangle - -Convex hull of 500 points in 3-d: - - Number of vertices: 66 - Number of coplanar points: 434 - Number of facets: 128 - Number of triangulated facets: 6 - -Statistics for: rbox 500 W0 | qconvex s QR0 Qt Qc Gvp QR1327454200 - - Number of points processed: 70 - Number of hyperplanes created: 211 - Number of distance tests for qhull: 8277 - Number of distance tests for merging: 1950 - Number of distance tests for checking: 6765 - Number of merged facets: 56 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 2.3e-015 (0.3x) - -rbox 500 W0 | qconvex s QR0 QJ5e-2 Qc Gvp >eg/eg.15c.joggle - -Convex hull of 500 points in 3-d: - - Number of vertices: 78 - Number of coplanar points: 422 - Number of facets: 152 - -Statistics for: rbox 500 W0 | qconvex s QR0 QJ5e-2 Qc Gvp QR1327454200 - - Number of points processed: 89 - Number of hyperplanes created: 423 - Number of distance tests for qhull: 20845 - CPU seconds to compute hull (after input): 0.015 - Input joggled by: 0.05 - -echo 2 = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 >eg/eg.data.17 -echo 25 >>eg/eg.data.17 -rbox 15 D2 B0.3 W0.25 c G0.5 | tail -n +3 >>eg/eg.data.17 -rbox 6 r s D2 B0.2 | tail -n +3 >>eg/eg.data.17 -qdelaunay s Qt eg/eg.17a.delaunay.2 - -Delaunay triangulation by the convex hull of 25 points in 3-d: - - Number of input sites: 25 - Number of Delaunay regions: 44 - Number of triangulated facets: 1 - -Statistics for: = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 | qdelaunay s Qt GnraD2 - - Number of points processed: 25 - Number of hyperplanes created: 90 - Number of facets in hull: 46 - Number of distance tests for qhull: 289 - Number of distance tests for merging: 492 - Number of distance tests for checking: 307 - Number of merged facets: 4 - CPU seconds to compute hull (after input): 0 - -qdelaunay s eg/eg.17b.delaunay.2i - -Delaunay triangulation by the convex hull of 25 points in 3-d: - - Number of input sites: 25 - Number of Delaunay regions: 41 - Number of non-simplicial Delaunay regions: 1 - -Statistics for: = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 | qdelaunay s GnraD2 - - Number of points processed: 25 - Number of hyperplanes created: 90 - Number of facets in hull: 42 - Number of distance tests for qhull: 289 - Number of distance tests for merging: 482 - Number of distance tests for checking: 307 - Number of merged facets: 4 - CPU seconds to compute hull (after input): 0 - -qdelaunay s eg/eg.17c.delaunay.2-3 - -Delaunay triangulation by the convex hull of 25 points in 3-d: - - Number of input sites: 25 - Number of Delaunay regions: 0 - Number of non-simplicial Delaunay regions: 2 - -Statistics for: = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 | qdelaunay s C-0 Ga - - Number of points processed: 25 - Number of hyperplanes created: 90 - Number of facets in hull: 42 - Number of distance tests for qhull: 289 - Number of distance tests for merging: 482 - Number of distance tests for checking: 307 - Number of merged facets: 4 - CPU seconds to compute hull (after input): 0 - -qvoronoi s QJ eg/eg.17d.voronoi.2 - -Voronoi diagram by the convex hull of 25 points in 3-d: - - Number of Voronoi regions: 25 - Number of Voronoi vertices: 44 - -Statistics for: = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 | qvoronoi s QJ Gna - - Number of points processed: 25 - Number of hyperplanes created: 99 - Number of facets in hull: 46 - Number of distance tests for qhull: 283 - CPU seconds to compute hull (after input): 0 - Input joggled by: 4.2e-011 - -qvoronoi s eg/eg.17e.voronoi.2i - -Voronoi diagram by the convex hull of 25 points in 3-d: - - Number of Voronoi regions: 25 - Number of Voronoi vertices: 41 - Number of non-simplicial Voronoi vertices: 1 - -Statistics for: = rbox 6 r s D2, rbox 15 B0.3 W0.25, c G0.5 | qvoronoi s Gna - - Number of points processed: 25 - Number of hyperplanes created: 90 - Number of facets in hull: 42 - Number of distance tests for qhull: 289 - Number of distance tests for merging: 482 - Number of distance tests for checking: 307 - Number of merged facets: 4 - CPU seconds to compute hull (after input): 0 - -rbox c G0.1 d | qdelaunay Gt Qz >eg/eg.17f.delaunay.3 -rbox 10 D2 d | qdelaunay s Qu G >eg/eg.18a.furthest.2-3 - -Furthest-site Delaunay triangulation by the convex hull of 14 points in 3-d: - - Number of input sites: 14 - Number of Delaunay regions: 0 - -Statistics for: rbox 10 D2 d | qdelaunay s Qu G - - Number of points processed: 14 - Number of hyperplanes created: 46 - Number of facets in hull: 24 - Number of distance tests for qhull: 85 - Number of distance tests for merging: 213 - Number of distance tests for checking: 304 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox 10 D2 d | qdelaunay s Qu Pd2 G >eg/eg.18b.furthest-up.2-3 - -Furthest-site Delaunay triangulation by the convex hull of 14 points in 3-d: - - Number of input sites: 14 - Number of Delaunay regions: 7 - -Statistics for: rbox 10 D2 d | qdelaunay s Qu Pd2 G - - Number of points processed: 14 - Number of hyperplanes created: 46 - Number of facets in hull: 24 - Number of distance tests for qhull: 85 - Number of distance tests for merging: 213 - Number of distance tests for checking: 304 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox 10 D2 d | qvoronoi s Qu Gv >eg/eg.18c.furthest.2 - -Furthest-site Voronoi vertices by the convex hull of 14 points in 3-d: - - Number of Voronoi regions: 14 - Number of Voronoi vertices: 7 - -Statistics for: rbox 10 D2 d | qvoronoi s Qu Gv - - Number of points processed: 14 - Number of hyperplanes created: 46 - Number of facets in hull: 24 - Number of distance tests for qhull: 85 - Number of distance tests for merging: 213 - Number of distance tests for checking: 304 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox 10 D3 | qvoronoi s FQ QV5 p | qconvex s G >eg/eg.19.voronoi.region.3 - -Voronoi diagram by the convex hull of 10 points in 4-d: - - Number of Voronoi regions: 10 - Number of 'good' Voronoi vertices: 10 - -Statistics for: rbox 10 D3 | qvoronoi s FQ QV5 p - - Number of points processed: 10 - Number of hyperplanes created: 44 - Number of facets in hull: 27 - Number of distance tests for qhull: 67 - CPU seconds to compute hull (after input): 0 - - -Convex hull of 10 points in 3-d: - - Number of vertices: 10 - Number of facets: 9 - Number of non-simplicial facets: 5 - -Statistics for: rbox 10 D3 | qvoronoi s FQ QV5 p | qconvex s G - - Number of points processed: 10 - Number of hyperplanes created: 18 - Number of distance tests for qhull: 45 - Number of distance tests for merging: 130 - Number of distance tests for checking: 89 - Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 - -rbox r s 20 Z1 G0.2 | qconvex s QR1 G >eg/eg.20.cone - -Convex hull of 41 points in 3-d: - - Number of vertices: 41 - Number of facets: 41 - Number of non-simplicial facets: 21 - -Statistics for: rbox r s 20 Z1 G0.2 | qconvex s QR1 G QR1 - - Number of points processed: 41 - Number of hyperplanes created: 115 - Number of distance tests for qhull: 624 - Number of distance tests for merging: 1584 - Number of distance tests for checking: 721 - Number of merged facets: 61 - CPU seconds to compute hull (after input): 0 - -rbox 200 s | qconvex s Qc R0.014 Gpav >eg/eg.21b.roundoff.fixed - -Convex hull of 200 points in 3-d: - - Number of vertices: 65 - Number of coplanar points: 135 - Number of facets: 52 - Number of non-simplicial facets: 43 - -Statistics for: rbox 200 s | qconvex s Qc R0.014 Gpav - - Number of points processed: 73 - Number of hyperplanes created: 291 - Number of distance tests for qhull: 9744 - Number of distance tests for merging: 4407 - Number of distance tests for checking: 4026 - Number of merged facets: 176 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.048 (0.9x) - Maximum distance of vertex below facet: -0.098 (1.7x) - -rbox 1000 s| qconvex s C0.01 Qc Gcrp >eg/eg.22a.merge.sphere.01 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 223 - Number of coplanar points: 777 - Number of facets: 117 - Number of non-simplicial facets: 117 - -Statistics for: rbox 1000 s | qconvex s C0.01 Qc Gcrp - - Number of points processed: 1000 - Number of hyperplanes created: 5545 - Number of distance tests for qhull: 121035 - Number of distance tests for merging: 79123 - Number of distance tests for checking: 8141 - Number of merged facets: 1879 - CPU seconds to compute hull (after input): 0.016 - Maximum distance of vertex below facet: -0.04 (1.3x) - -rbox 1000 s| qconvex s C-0.01 Qc Gcrp >eg/eg.22b.merge.sphere.-01 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 102 - Number of coplanar points: 898 - Number of facets: 103 - Number of non-simplicial facets: 75 - -Statistics for: rbox 1000 s | qconvex s C-0.01 Qc Gcrp - - Number of points processed: 108 - Number of hyperplanes created: 467 - Number of distance tests for qhull: 71156 - Number of distance tests for merging: 6748 - Number of distance tests for checking: 31209 - Number of merged facets: 256 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.031 (1.0x) - Maximum distance of vertex below facet: -0.065 (2.2x) - -rbox 1000 s| qconvex s C0.05 Qc Gcrpv >eg/eg.22c.merge.sphere.05 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 48 - Number of coplanar points: 952 - Number of facets: 26 - Number of non-simplicial facets: 26 - -Statistics for: rbox 1000 s | qconvex s C0.05 Qc Gcrpv - - Number of points processed: 1000 - Number of hyperplanes created: 5545 - Number of distance tests for qhull: 55658 - Number of distance tests for merging: 83457 - Number of distance tests for checking: 7742 - Number of merged facets: 1970 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of vertex below facet: -0.21 (1.4x) - -rbox 1000 s| qconvex s C-0.05 Qc Gcrpv >eg/eg.22d.merge.sphere.-05 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 18 - Number of coplanar points: 982 - Number of facets: 15 - Number of non-simplicial facets: 13 - -Statistics for: rbox 1000 s | qconvex s C-0.05 Qc Gcrpv - - Number of points processed: 22 - Number of hyperplanes created: 69 - Number of distance tests for qhull: 44445 - Number of distance tests for merging: 1034 - Number of distance tests for checking: 13690 - Number of merged facets: 41 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.14 (0.9x) - Maximum distance of vertex below facet: -0.15 (1.0x) - -rbox 1000 | qconvex s Gcprvah C0.1 Qc >eg/eg.23.merge.cube - -Convex hull of 1000 points in 3-d: - - Number of vertices: 8 - Number of coplanar points: 741 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: rbox 1000 | qconvex s Gcprvah C0.1 Qc - - Number of points processed: 95 - Number of hyperplanes created: 453 - Number of distance tests for qhull: 60073 - Number of distance tests for merging: 5413 - Number of distance tests for checking: 6014 - Number of merged facets: 146 - CPU seconds to compute hull (after input): 0 - Maximum distance of vertex below facet: -0.18 (0.6x) - -rbox 5000 D4 | qconvex s GD0v Pd0:0.5 C-0.02 C0.1 >eg/eg.24.merge.cube.4d-in-3d - -Convex hull of 5000 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of 'good' facets: 1 - Number of 'good' non-simplicial facets: 1 - -Statistics for: rbox 5000 D4 | qconvex s GD0v Pd0:0.5 C-0.02 C0.1 - - Number of points processed: 30 - Number of hyperplanes created: 182 - Number of distance tests for qhull: 658286 - Number of distance tests for merging: 4770 - Number of distance tests for checking: 45000 - Number of merged facets: 188 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of point above facet: 0.14 (0.4x) - Maximum distance of vertex below facet: -0.31 (0.8x) - -rbox 5000 D4 | qconvex s s C-0.02 C0.1 Gh >eg/eg.30.4d.merge.cube - -Convex hull of 5000 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of non-simplicial facets: 8 - -Statistics for: rbox 5000 D4 | qconvex s s C-0.02 C0.1 Gh - - Number of points processed: 30 - Number of hyperplanes created: 182 - Number of distance tests for qhull: 658286 - Number of distance tests for merging: 4770 - Number of distance tests for checking: 45000 - Number of merged facets: 188 - CPU seconds to compute hull (after input): 0.032 - Maximum distance of point above facet: 0.14 (0.4x) - Maximum distance of vertex below facet: -0.31 (0.8x) - -rbox 20 D3 | qdelaunay s G >eg/eg.31.4d.delaunay - -Delaunay triangulation by the convex hull of 20 points in 4-d: - - Number of input sites: 20 - Number of Delaunay regions: 0 - -Statistics for: rbox 20 D3 | qdelaunay s G - - Number of points processed: 20 - Number of hyperplanes created: 162 - Number of facets in hull: 81 - Number of distance tests for qhull: 302 - CPU seconds to compute hull (after input): 0 - -rbox 30 s D4 | qconvex s G Pd0d1d2D3 >eg/eg.32.4d.octant - -Convex hull of 30 points in 4-d: - - Number of vertices: 30 - Number of facets: 138 - Number of 'good' facets: 9 - -Statistics for: rbox 30 s D4 | qconvex s G Pd0d1d2D3 - - Number of points processed: 30 - Number of hyperplanes created: 340 - Number of distance tests for qhull: 650 - CPU seconds to compute hull (after input): 0 - -rbox 10 r s Z1 G0.3 | qconvex G >eg/eg.33a.cone -rbox 10 r s Z1 G0.3 | qconvex FQ FV n | qhalf G >eg/eg.33b.cone.dual -rbox 10 r s Z1 G0.3 | qconvex FQ FV n | qhalf FQ s Fp | qconvex G >eg/eg.33c.cone.halfspace - -Halfspace intersection by the convex hull of 21 points in 3-d: - - Number of halfspaces: 21 - Number of non-redundant halfspaces: 21 - Number of intersection points: 21 - Number of non-simplicial intersection points: 11 - -Statistics for: rbox 10 r s Z1 G0.3 | qconvex FQ FV n | qhalf FQ s Fp - - Number of points processed: 21 - Number of hyperplanes created: 48 - Number of distance tests for qhull: 162 - Number of distance tests for merging: 435 - Number of distance tests for checking: 261 - Number of merged facets: 18 - CPU seconds to compute hull (after input): 0 - - -echo ==the following should generate flipped and concave facets== >/dev/null -rbox 200 s | qhull Q0 s R0.014 Gav Po >eg/eg.21a.roundoff.errors -QH6136 qhull precision error: facet f506 is flipped, distance= 0.461556194655 -QH6136 qhull precision error: facet f592 is flipped, distance= 0.439612545215 -QH6136 qhull precision error: facet f604 is flipped, distance= 0.465768128315 -QH6136 qhull precision error: facet f506 is flipped, distance= 0.468691154013 -QH6136 qhull precision error: facet f592 is flipped, distance= 0.450451888758 -QH6136 qhull precision error: facet f604 is flipped, distance= 0.471152553888 -QH6115 qhull precision error: f127 is concave to f267, since p65(v17) is 0.02603 above -QH6115 qhull precision error: f139 is concave to f285, since p13(v34) is 0.02883 above -QH6115 qhull precision error: f166 is concave to f316, since p189(v18) is 0.008704 above -QH6115 qhull precision error: f198 is concave to f604, since p109(v11) is 0.02657 above -QH6115 qhull precision error: f242 is concave to f527, since p65(v17) is 0.02938 above -QH6115 qhull precision error: f259 is concave to f462, since p59(v60) is 0.008633 above -QH6115 qhull precision error: f280 is concave to f286, since p22(v65) is 0.01973 above -QH6115 qhull precision error: f288 is concave to f310, since p71(v67) is 0.02406 above -QH6115 qhull precision error: f297 is concave to f487, since p180(v38) is 0.008078 above -QH6115 qhull precision error: f313 is concave to f496, since p63(v41) is 0.03309 above -QH6115 qhull precision error: f330 is concave to f331, since p10(v64) is 0.02231 above -QH6115 qhull precision error: f397 is concave to f542, since p69(v51) is 0.01923 above -QH6115 qhull precision error: f399 is concave to f543, since p155(v31) is 0.01245 above -QH6115 qhull precision error: f417 is concave to f552, since p184(v71) is 0.009005 above -QH6115 qhull precision error: f426 is concave to f477, since p135(v95) is 0.016 above -QH6115 qhull precision error: f431 is concave to f555, since p135(v95) is 0.008306 above -QH6115 qhull precision error: f442 is concave to f559, since p97(v98) is 0.04007 above -QH6115 qhull precision error: f444 is concave to f245, since p194(v99) is 0.0124 above -QH6115 qhull precision error: f457 is concave to f505, since p70(v101) is 0.05613 above -QH6115 qhull precision error: f460 is concave to f565, since p176(v61) is 0.02392 above -QH6115 qhull precision error: f469 is concave to f580, since p119(v9) is 0.07256 above -QH6115 qhull precision error: f472 is concave to f582, since p138(v63) is 0.04511 above -QH6115 qhull precision error: f481 is concave to f624, since p79(v93) is 0.0132 above -QH6115 qhull precision error: f484 is concave to f483, since p79(v93) is 0.01528 above -QH6115 qhull precision error: f492 is concave to f551, since p163(v108) is 0.05382 above -QH6115 qhull precision error: f501 is concave to f602, since p29(v10) is 0.01867 above -QH6115 qhull precision error: f505 is concave to f457, since p128(v110) is 0.008966 above -QH6113 qhull precision error: f506 is flipped(interior point is outside) -QH6115 qhull precision error: f520 is concave to f541, since p100(v114) is 0.009004 above -QH6115 qhull precision error: f521 is concave to f516, since p100(v114) is 0.01561 above -QH6115 qhull precision error: f522 is concave to f526, since p100(v114) is 0.0118 above -QH6115 qhull precision error: f534 is concave to f535, since p190(v2) is 0.01582 above -QH6115 qhull precision error: f535 is concave to f534, since p154(v47) is 0.009917 above -QH6115 qhull precision error: f544 is concave to f620, since p58(v91) is 0.01945 above -QH6115 qhull precision error: f551 is concave to f492, since p41(v120) is 0.0114 above -QH6115 qhull precision error: f559 is concave to f442, since p38(v122) is 0.01392 above -QH6115 qhull precision error: f565 is concave to f460, since p73(v123) is 0.01004 above -QH6115 qhull precision error: f566 is concave to f571, since p133(v16) is 0.01303 above -QH6115 qhull precision error: f580 is concave to f469, since p158(v127) is 0.0104 above -QH6113 qhull precision error: f592 is flipped(interior point is outside) -QH6115 qhull precision error: f595 is concave to f626, since p22(v65) is 0.008193 above -QH6115 qhull precision error: f603 is concave to f500, since p14(v132) is 0.00736 above -QH6113 qhull precision error: f604 is flipped(interior point is outside) -QH6115 qhull precision error: f619 is concave to f617, since p12(v1) is 0.007428 above - -Convex hull of 200 points in 3-d: - - Number of vertices: 138 - Number of facets: 272 - -Statistics for: rbox 200 s | qhull Q0 s R0.014 Gav Po - - Number of points processed: 138 - Number of hyperplanes created: 629 - Number of distance tests for qhull: 4659 - CPU seconds to compute hull (after input): 0 - - -precision problems (corrected unless 'Q0' or an error) - 120 coplanar half ridges in output - 41 concave half ridges in output - 3 flipped facets - 125 coplanar horizon facets for new vertices - 62 coplanar points during partitioning -echo ==the preceeding should report flipped and concave facets== >/dev/null - - - -eg/q_egtest -rbox d D3 | qconvex s Gnrv Tc Tv >eg/eg.t01.spheres.3 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox d D3 | qconvex s Gnrv Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -rbox d D2 | qconvex s Gnv Tc Tv >eg/eg.t02.spheres.2 - -Convex hull of 4 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox d D2 | qconvex s Gnv Tc Tv - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 4 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 1.3e-015 of -all facets. Will make 16 distance computations. -rbox d D3 | qconvex s Gnrp Tc Tv >eg/eg.t03.points.3 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox d D3 | qconvex s Gnrp Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -rbox d D2 | qconvex s Gnp Tc Tv >eg/eg.t04.points.2 - -Convex hull of 4 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox d D2 | qconvex s Gnp Tc Tv - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 4 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 1.3e-015 of -all facets. Will make 16 distance computations. -rbox c D4 | qconvex s C0.05 GnpcD3 Pd3:0.5 Tc Tv >eg/eg.t05.centrum.points.4-3 - -Convex hull of 16 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of 'good' facets: 1 - Number of 'good' non-simplicial facets: 1 - -Statistics for: rbox c D4 | qconvex s C0.05 GnpcD3 Pd3:0.5 Tc Tv - - Number of points processed: 16 - Number of hyperplanes created: 26 - Number of distance tests for qhull: 168 - Number of distance tests for merging: 963 - Number of distance tests for checking: 144 - Number of merged facets: 36 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16 distance computations. -rbox d D3 | qconvex s Gnrc Tc Tv >eg/eg.t06.centrums.3.precise - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox d D3 | qconvex s Gnrc Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -rbox d D3 | qconvex s C0.05 Gnrc Tc Tv >eg/eg.t07.centrums.3 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox d D3 | qconvex s C0.05 Gnrc Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 169 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -rbox d D2 | qconvex s C0.05 Gc Tc Tv >eg/eg.t08.centrums.2 - -Convex hull of 4 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox d D2 | qconvex s C0.05 Gc Tc Tv - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 4 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16 distance computations. -rbox d D3 | qconvex s Gnha Tc Tv >eg/eg.t09.intersect.3 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - -Statistics for: rbox d D3 | qconvex s Gnha Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -rbox d D3 | qconvex s GaD0 Pd0 Tc Tv >eg/eg.t10.faces.3-2 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - Number of 'good' facets: 4 - -Statistics for: rbox d D3 | qconvex s GaD0 Pd0 Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 24 distance computations. -rbox d D3 | qconvex s GnrpD0 Pd0 Tc Tv >eg/eg.t11.points.3-2 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - Number of 'good' facets: 4 - -Statistics for: rbox d D3 | qconvex s GnrpD0 Pd0 Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 24 distance computations. -rbox d D3 | qconvex s C0.05 GnrcD0 Pd0 Tc Tv >eg/eg.t12.centrums.3-2 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - Number of 'good' facets: 4 - -Statistics for: rbox d D3 | qconvex s C0.05 GnrcD0 Pd0 Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 169 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 24 distance computations. -rbox d D3 | qconvex s GnhaD0 Pd0 Tc Tv >eg/eg.t13.intersect.3-2 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - Number of 'good' facets: 4 - -Statistics for: rbox d D3 | qconvex s GnhaD0 Pd0 Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 24 distance computations. -rbox d D3 | qconvex s GnrvD0 Pd0 Tc Tv >eg/eg.t14.spheres.3-2 - -Convex hull of 6 points in 3-d: - - Number of vertices: 6 - Number of facets: 8 - Number of 'good' facets: 4 - -Statistics for: rbox d D3 | qconvex s GnrvD0 Pd0 Tc Tv - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 59 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 24 distance computations. -rbox c D4 | qconvex s GvD0 Pd0:0.5 Tc Tv >eg/eg.t15.spheres.4-3 - -Convex hull of 16 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of 'good' facets: 1 - Number of 'good' non-simplicial facets: 1 - -Statistics for: rbox c D4 | qconvex s GvD0 Pd0:0.5 Tc Tv - - Number of points processed: 16 - Number of hyperplanes created: 26 - Number of distance tests for qhull: 168 - Number of distance tests for merging: 788 - Number of distance tests for checking: 144 - Number of merged facets: 36 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16 distance computations. -rbox c D4 | qhull s Q0 C0 GpD0 Pd0:0.5 Tc Tv >eg/eg.t16.points.4-3 - -Convex hull of 16 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of 'good' facets: 1 - Number of 'good' non-simplicial facets: 1 - -Statistics for: rbox c D4 | qhull s Q0 C0 GpD0 Pd0:0.5 Tc Tv - - Number of points processed: 16 - Number of hyperplanes created: 62 - Number of distance tests for qhull: 163 - Number of distance tests for merging: 1304 - Number of distance tests for checking: 144 - Number of merged facets: 36 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16 distance computations. -rbox c D4 | qconvex s GahD0 Pd0:0.5 Tc Tv >eg/eg.t17.intersect.4-3 - -Convex hull of 16 points in 4-d: - - Number of vertices: 16 - Number of facets: 8 - Number of 'good' facets: 1 - Number of 'good' non-simplicial facets: 1 - -Statistics for: rbox c D4 | qconvex s GahD0 Pd0:0.5 Tc Tv - - Number of points processed: 16 - Number of hyperplanes created: 26 - Number of distance tests for qhull: 168 - Number of distance tests for merging: 788 - Number of distance tests for checking: 144 - Number of merged facets: 36 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16 distance computations. -rbox 100 s | qconvex s C-0.05 Qc Gicvprh Tc Tv >eg/eg.t18.imprecise.3 - -Convex hull of 100 points in 3-d: - - Number of vertices: 18 - Number of coplanar points: 82 - Number of facets: 16 - Number of non-simplicial facets: 12 - -Statistics for: rbox 100 s | qconvex s C-0.05 Qc Gicvprh Tc Tv - - Number of points processed: 18 - Number of hyperplanes created: 60 - Number of distance tests for qhull: 3313 - Number of distance tests for merging: 1030 - Number of distance tests for checking: 1347 - Number of merged facets: 29 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.092 (0.6x) - Maximum distance of vertex below facet: -0.14 (0.9x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1600 distance computations. -rbox 30 s D4 | qconvex s GhD0 Pd0d1d2D3 Tc >eg/eg.t19.intersect.precise.4-3 - -Convex hull of 30 points in 4-d: - - Number of vertices: 30 - Number of facets: 138 - Number of 'good' facets: 9 - -Statistics for: rbox 30 s D4 | qconvex s GhD0 Pd0d1d2D3 Tc - - Number of points processed: 30 - Number of hyperplanes created: 340 - Number of distance tests for qhull: 650 - CPU seconds to compute hull (after input): 0 - -rbox 100 s P1,1,1 | qconvex s QG-0 Pgp Tc G >eg/eg.t20.notvisible - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - Number of 'good' facets: 125 - -Statistics for: rbox 100 s P1,1,1 | qconvex s QG-0 Pgp Tc G - - Number of points processed: 100 - Number of hyperplanes created: 503 - Number of distance tests for qhull: 1631 - CPU seconds to compute hull (after input): 0 - -rbox 100 s | qconvex s QV-10 Pgp Tc G >eg/eg.t21.notvertex - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - Number of 'good' facets: 191 - -Statistics for: rbox 100 s | qconvex s QV-10 Pgp Tc G - - Number of points processed: 100 - Number of hyperplanes created: 494 - Number of distance tests for qhull: 1641 - CPU seconds to compute hull (after input): 0 - -rbox 100 r D2 P1,1 | qhull s Pd0:0.7 PD0:0.8 QgG0 G Tv >eg/eg.t22.split - -Convex hull of 100 points in 2-d: - - Number of vertices: 42 - Number of facets: 42 - Number of 'good' facets: 3 - -Statistics for: rbox 100 r D2 P1,1 | qhull s Pd0:0.7 PD0:0.8 QgG0 G Tv - - Number of points processed: 89 - Number of hyperplanes created: 176 - Number of distance tests for qhull: 1099 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 2.6e-015 of -all good facets. Will make 303 distance computations. -rbox 100 D2 c G1.0 | qvoronoi s A-0.95 Gna Tv >eg/eg.t23.voronoi.imprecise - -Voronoi diagram by the convex hull of 104 points in 3-d: - - Number of Voronoi regions: 13 - Total number of nearly incident points: 91 - Number of Voronoi vertices: 13 - Number of non-simplicial Voronoi vertices: 5 - -Statistics for: rbox 100 D2 c G1.0 | qvoronoi s A-0.95 Gna Tv - - Number of points processed: 13 - Number of hyperplanes created: 39 - Number of facets in hull: 14 - Number of distance tests for qhull: 2740 - Number of distance tests for merging: 464 - Number of distance tests for checking: 1119 - Number of merged facets: 13 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.098 (0.1x) - Maximum distance of vertex below facet: -0.082 (0.1x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1352 distance computations. -rbox 30 s D4 | qconvex s Gh Pd0d1d2D3 Tc >eg/eg.t24.intersect.precise.4d - -Convex hull of 30 points in 4-d: - - Number of vertices: 30 - Number of facets: 138 - Number of 'good' facets: 9 - -Statistics for: rbox 30 s D4 | qconvex s Gh Pd0d1d2D3 Tc - - Number of points processed: 30 - Number of hyperplanes created: 340 - Number of distance tests for qhull: 650 - CPU seconds to compute hull (after input): 0 - - -echo ==the following generates an error== >/dev/null -rbox 1000 D4 | qhull Q0 s Po R0.005 Ga Tc Tv >eg/eg.t25.neighbors.4d -QH6136 qhull precision error: facet f491 is flipped, distance= 0.413460414284 -QH6136 qhull precision error: facet f949 is flipped, distance= 0.558894018107 -QH6107 qhull precision error: facets f977, f981 and f978 meet at a ridge with more than 2 neighbors. Can not continue. -ERRONEOUS FACET: -- f977 - - flags: bottom simplicial new - - normal: -0.07131 -0.04413 0.08982 -0.9924 - - offset: -0.5084414 - - vertices: p108(v73) p722(v63) p713(v35) p241(v7) - - neighboring facets: f824 f968 f971 f978 -ERRONEOUS OTHER FACET: -- f981 - - flags: top simplicial new - - normal: -0.005308 -0.0126 0.005272 -0.9999 - - offset: -0.4947257 - - vertices: p108(v73) p722(v63) p713(v35) p62(v20) - - neighboring facets: f825 -ERRONEOUS and NEIGHBORING FACETS to output - -While executing: rbox 1000 D4 | qhull Q0 s Po R0.005 Ga Tc Tv -Options selected for Qhull 2012.1 2012/01/22: - run-id 315164332 Q0-no-premerge summary Poutput-forced - Random_perturb 0.005 Gall-points Tcheck-frequently Tverify _max-width 1 - Error-roundoff 0.0025 Visible-distance 0.0025 U-coplanar-distance 0.0025 - Width-outside 0.005 _wide-facet 0.015 -Last point added to hull was p108. - -Convex hull of 1000 points in 4-d: - - Number of vertices: 68 - Number of facets: 346 - -Statistics for: rbox 1000 D4 | qhull Q0 s Po R0.005 Ga Tc Tv - - Number of points processed: 73 - Number of hyperplanes created: 986 - Number of distance tests for qhull: 28532 - - -precision problems (corrected unless 'Q0' or an error) - 2 flipped facets - 42 coplanar horizon facets for new vertices - 141 coplanar points during partitioning - 9 degenerate hyperplanes recomputed with gaussian elimination - 9 nearly singular or axis-parallel hyperplanes - -Precision problems were detected during construction of the convex hull. -This occurs because convex hull algorithms assume that calculations are -exact, but floating-point arithmetic has roundoff errors. - -To correct for precision problems, do not use 'Q0'. By default, Qhull -selects 'C-0' or 'Qx' and merges non-convex facets. With option 'QJ', -Qhull joggles the input to prevent precision problems. See "Imprecision -in Qhull" (qh-impre.htm). - -If you use 'Q0', the output may include -coplanar ridges, concave ridges, and flipped facets. In 4-d and higher, -Qhull may produce a ridge with four neighbors or two facets with the same -vertices. Qhull reports these events when they occur. It stops when a -concave ridge, flipped facet, or duplicate facet occurs. - -If you need triangular output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft'. It triangulates non-simplicial facets with added points. - -If you must use 'Q0', -try one or more of the following options. They can not guarantee an output. - - use 'QbB' to scale the input to a cube. - - use 'Po' to produce output and prevent partitioning for flipped facets - - use 'V0' to set min. distance to visible facet as 0 instead of roundoff - - use 'En' to specify a maximum roundoff error less than 0.0025. - - options 'Qf', 'Qbb', and 'QR0' may also help - -To guarantee simplicial output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft' to triangulate the output by adding points - - use exact arithmetic (see "Imprecision in Qhull", qh-impre.htm) -echo ==the previous should generate an error== >/dev/null - - -eg/q_test - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: | qhull s Tcv - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 142 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. - -Delaunay triangulation by the convex hull of 8 points in 4-d: - - Number of input sites: 8 - Number of Delaunay regions: 11 - -Statistics for: | qhull s d Tcv - - Number of points processed: 8 - Number of hyperplanes created: 28 - Number of facets in hull: 16 - Number of distance tests for qhull: 33 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 1.4e-014 of -all facets. Will make 88 distance computations. - -Delaunay triangulation by the convex hull of 8 points in 4-d: - - Number of input sites: 8 - Number of Delaunay regions: 11 - -Statistics for: | qhull s d Tcv - - Number of points processed: 8 - Number of hyperplanes created: 24 - Number of facets in hull: 17 - Number of distance tests for qhull: 31 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 7.3e-015 of -all facets. Will make 88 distance computations. - -Halfspace intersection by the convex hull of 8 points in 3-d: - - Number of halfspaces: 8 - Number of non-redundant halfspaces: 8 - Number of intersection points: 6 - Number of non-simplicial intersection points: 6 - -Statistics for: | qhull H0 s Tcv Fp - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 142 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -echo === errors if 'user_eg' and 'user_eg2' not found === -=== errors if user_eg and user_eg2 not found === -echo === check user_eg ${d:-`date`} ===================== -date -=== check user_eg Tue Jan 24 20:16:42 EST 2012 ===================== -user_eg "QR1 p n Qt" "v p" Fp -This is the output from user_eg.c - -It shows how qhull() may be called from an application using the qhull -shared library. It is not part of qhull itself. If it appears accidently, -please remove user_eg.c from your project. - - -compute convex hull of cube after rotating input -input - -1 -1 -1 - 1 -1 -1 - -1 1 -1 - 1 1 -1 - -1 -1 1 - 1 -1 1 - -1 1 1 - 1 1 1 -3 -8 -0.9124763375291641 1.390833937612012 -0.4826674750136243 --0.5764091147442416 0.565375258822974 -1.532352227508615 --0.1847368907548403 1.250953879569599 1.183632828365285 --1.673622343028246 0.4254952007805605 0.1339480758702939 -1.673622343028246 -0.4254952007805605 -0.1339480758702939 -0.1847368907548403 -1.250953879569599 -1.183632828365285 -0.5764091147442416 -0.565375258822974 1.532352227508615 --0.9124763375291641 -1.390833937612012 0.4826674750136243 -4 -12 --0.380573002749541 0.9081645691962865 -0.1743596995716652 -1 --0.380573002749541 0.9081645691962865 -0.1743596995716652 -1 -0.744442726136703 0.4127293393945193 0.5248423762474955 -1 -0.744442726136703 0.4127293393945193 0.5248423762474955 -1 --0.5486066141420022 -0.06994002902120672 0.8331501516894545 -1 --0.5486066141420022 -0.06994002902120672 0.8331501516894545 -1 -0.5486066141420022 0.06994002902120679 -0.8331501516894545 -1 -0.5486066141420022 0.06994002902120679 -0.8331501516894545 -1 -0.380573002749541 -0.9081645691962865 0.1743596995716652 -1 -0.380573002749541 -0.9081645691962865 0.1743596995716652 -1 --0.7444427261367029 -0.4127293393945193 -0.5248423762474955 -0.9999999999999997 --0.7444427261367029 -0.4127293393945193 -0.5248423762474955 -0.9999999999999997 - -8 vertices and 12 facets with normals: - -0.38 0.91 -0.17 - -0.38 0.91 -0.17 - 0.74 0.41 0.52 - 0.74 0.41 0.52 - -0.55 -0.07 0.83 - -0.55 -0.07 0.83 - 0.55 0.07 -0.83 - 0.55 0.07 -0.83 - 0.38 -0.91 0.17 - 0.38 -0.91 0.17 - -0.74 -0.41 -0.52 - -0.74 -0.41 -0.52 - -compute 3-d Delaunay triangulation -seed: 1327454202 -input --0.706 0.185 -0.997 - 0.739 0.981 0.915 --0.0492 0.993 -0.337 --0.408 -0.521 0.378 --0.174 -0.217 -0.829 --0.114 -0.874 0.268 - 0.414 -0.87 -0.86 - 0.684 -0.12 0.241 -3 -11 -8.817140186696875 3.450584294550091 -5.020639188104951 -0.5403564279616564 -0.6912825989872701 2.425011907306929 --0.1199937357891065 0.4735709729694704 0.5770495599647179 -3.100407885814694 2.400973701393672 -6.350407240410952 -1.236411828590869 0.4751228563895312 -1.138297941446634 --0.5020263900519639 0.2374638672802573 -0.1134692063160839 --0.08697626605473376 0.1691016807526869 -0.05020263571440065 --2.27154828024003 -2.667494449872159 -1.43761610758808 --1.575536916403145 -1.453895924539648 -0.7477231573352229 -0.2382928326855393 -0.4652796623935117 -0.2533544020986503 -0.06787343520023301 -0.2808240579638571 -0.1335157472366256 - -8 vertices and 16 facets with normals: - -0.51 -0.42 0.26 0.7 - 0.65 -0.6 0.43 0.18 - 0.43 0.42 -0.68 0.42 - 0.82 0.32 -0.47 -0.047 - -0.68 -0.27 0.39 0.55 - -0.82 0.37 0.43 0.092 - 0.21 -0.26 0.92 -0.19 - -0.13 0.52 0.64 -0.55 - 0.41 0.32 -0.85 -0.067 - 0.68 0.26 -0.63 -0.28 - -0.66 0.31 -0.15 -0.66 - -0.16 0.31 -0.093 -0.93 - -0.59 -0.7 -0.38 -0.13 - -0.68 -0.63 -0.32 -0.22 - 0.31 -0.61 -0.33 -0.65 - 0.11 -0.47 -0.23 -0.84 - -find 3-d Delaunay triangle closest to [0.5, 0.5, ...] --0.41 -0.52 0.38 --0.05 0.99 -0.34 - 0.68 -0.12 0.24 - 0.74 0.98 0.92 - -save first triangulation and compute a new triangulation -seed: 1327454203 -input --0.706 0.448 0.514 --0.343 0.047 -0.647 -0.0449 0.351 -0.979 --0.538 0.246 -0.583 --0.512 -0.147 -0.722 - 0.945 0.468 0.283 --0.819 -0.736 -0.0249 -0.0573 -0.942 0.102 -3 -11 --0.2386622335477796 -0.1566542442491845 0.1628208587902705 -0.09843684708370071 0.01493208449583039 0.2089868348364177 -0.5723090085175291 -0.2124517280896852 -0.3449177752423304 --0.4619263792107396 -0.09379720018847126 0.07126402711263546 -0.03918182679269278 1.273584146776618 -0.1032761907666938 -0.07192003860173046 0.4326707178511331 0.0563639535749717 -0.1540676134834845 0.5692882636221464 -0.119465246220046 --0.2503820888867752 -0.4059765127196031 -0.1601524894225976 -0.4530074947629944 -0.7123718802783976 -0.9412410897971241 --0.5748832691392634 -0.1527250737689812 -0.08932774746840733 --0.5344126046033305 0.2483559898669195 -1.217616521674434 - -8 vertices and 17 facets with normals: - -0.14 0.22 -0.0066 0.97 - 0.033 -0.24 0.78 0.57 - -0.4 -0.26 0.27 -0.84 - 0.18 0.027 0.38 -0.91 - 0.27 -0.32 -0.24 0.87 - 0.66 -0.25 -0.4 -0.58 - -0.67 0.33 -0.31 0.59 - -0.67 -0.14 0.1 -0.72 - 0.029 0.93 -0.075 -0.36 - 0.11 0.65 0.084 -0.75 - 0.2 0.73 -0.15 -0.64 - 0.073 -0.63 -0.7 0.34 - -0.35 -0.57 -0.23 -0.7 - 0.33 -0.52 -0.69 -0.37 - -0.69 0.26 -0.41 0.54 - -0.73 -0.2 -0.11 -0.64 - -0.37 0.17 -0.84 -0.35 - -save second triangulation and restore first one - -8 vertices and 16 facets with normals: - -0.51 -0.42 0.26 0.7 - 0.65 -0.6 0.43 0.18 - 0.43 0.42 -0.68 0.42 - 0.82 0.32 -0.47 -0.047 - -0.68 -0.27 0.39 0.55 - -0.82 0.37 0.43 0.092 - 0.21 -0.26 0.92 -0.19 - -0.13 0.52 0.64 -0.55 - 0.41 0.32 -0.85 -0.067 - 0.68 0.26 -0.63 -0.28 - -0.66 0.31 -0.15 -0.66 - -0.16 0.31 -0.093 -0.93 - -0.59 -0.7 -0.38 -0.13 - -0.68 -0.63 -0.32 -0.22 - 0.31 -0.61 -0.33 -0.65 - 0.11 -0.47 -0.23 -0.84 - -free first triangulation and restore second one. - -8 vertices and 17 facets with normals: - -0.14 0.22 -0.0066 0.97 - 0.033 -0.24 0.78 0.57 - -0.4 -0.26 0.27 -0.84 - 0.18 0.027 0.38 -0.91 - 0.27 -0.32 -0.24 0.87 - 0.66 -0.25 -0.4 -0.58 - -0.67 0.33 -0.31 0.59 - -0.67 -0.14 0.1 -0.72 - 0.029 0.93 -0.075 -0.36 - 0.11 0.65 0.084 -0.75 - 0.2 0.73 -0.15 -0.64 - 0.073 -0.63 -0.7 0.34 - -0.35 -0.57 -0.23 -0.7 - 0.33 -0.52 -0.69 -0.37 - -0.69 0.26 -0.41 0.54 - -0.73 -0.2 -0.11 -0.64 - -0.37 0.17 -0.84 -0.35 - -compute halfspace intersection about the origin for a diamond -input as halfspace coefficients + offsets - -1 -1 -1 -1 - 1 -1 -1 -1 - -1 1 -1 -1 - 1 1 -1 -1 - -1 -1 1 -1 - 1 -1 1 -1 - -1 1 1 -1 - 1 1 1 -1 -3 -6 - 0 0 -1 - 0 -1 0 - 1 0 0 - -1 0 0 - 0 1 0 - 0 0 1 - -8 vertices and 6 facets with normals: - -0 -0 -1 - 0 -1 0 - 1 -0 -0 - -1 -0 -0 - 0 1 -0 - -0 -0 1 - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 12 - Number of triangulated facets: 6 - -Statistics for: | qhull s Tcv QR1 p n Qt QR1 - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 24 - Number of distance tests for merging: 186 - Number of distance tests for checking: 56 - Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96 distance computations. - -Voronoi diagram by the convex hull of 8 points in 4-d: - - Number of Voronoi regions: 8 - Number of Voronoi vertices: 11 - -Statistics for: | qhull s d Tcv v p - - Number of points processed: 8 - Number of hyperplanes created: 28 - Number of facets in hull: 16 - Number of distance tests for qhull: 33 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 1.4e-014 of -all facets. Will make 88 distance computations. - -Voronoi diagram by the convex hull of 8 points in 4-d: - - Number of Voronoi regions: 8 - Number of Voronoi vertices: 11 - -Statistics for: | qhull s d Tcv v p - - Number of points processed: 8 - Number of hyperplanes created: 24 - Number of facets in hull: 17 - Number of distance tests for qhull: 31 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 7.3e-015 of -all facets. Will make 88 distance computations. - -Halfspace intersection by the convex hull of 8 points in 3-d: - - Number of halfspaces: 8 - Number of non-redundant halfspaces: 8 - Number of intersection points: 6 - Number of non-simplicial intersection points: 6 - -Statistics for: | qhull H0 s Tcv Fp - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 142 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. -user_eg2 "QR1 p" "v p" Fp -This is the output from user_eg2.c - -It shows how qhull() may be called from an application in the same way as -qconvex. It is not part of qhull itself. If it appears accidently, -please remove user_eg2.c from your project. - - -compute triangulated convex hull of cube after rotating input - -8 vertices and 12 facets with normals: - -0.38 0.91 -0.17 - -0.38 0.91 -0.17 - 0.74 0.41 0.52 - 0.74 0.41 0.52 - -0.55 -0.07 0.83 - -0.55 -0.07 0.83 - 0.55 0.07 -0.83 - 0.55 0.07 -0.83 - 0.38 -0.91 0.17 - 0.38 -0.91 0.17 - -0.74 -0.41 -0.52 - -0.74 -0.41 -0.52 - -add points in a diamond -9 vertices and 14 facets -10 vertices and 16 facets -11 vertices and 18 facets -12 vertices and 20 facets -13 vertices and 22 facets -14 vertices and 24 facets - -14 vertices and 24 facets with normals: - -0.67 0.63 -0.39 - 0.67 -0.63 0.39 - -0.1 -0.71 0.7 - 0.65 -0.66 0.37 - 0.63 -0.7 -0.34 - -0.65 -0.65 -0.41 - -0.62 -0.62 -0.49 - -0.65 0.66 -0.37 - -0.63 0.7 0.34 - 0.1 0.71 -0.7 - 0.65 0.65 0.41 - 0.62 0.62 0.49 - -0.7 -0.13 -0.7 - -0.62 -0.49 -0.62 - 0.11 0.7 -0.71 - 0.68 0.29 -0.68 - 0.66 -0.34 -0.67 - 0.67 -0.3 -0.67 - -0.66 0.34 0.67 - -0.67 0.3 0.67 - 0.7 0.13 0.7 - 0.62 0.49 0.62 - -0.11 -0.7 0.71 - -0.68 -0.29 0.68 -3 -14 -0.9124763375291641 1.390833937612012 -0.4826674750136243 --0.5764091147442416 0.565375258822974 -1.532352227508615 --0.1847368907548403 1.250953879569599 1.183632828365285 --1.673622343028246 0.4254952007805605 0.1339480758702939 -1.673622343028246 -0.4254952007805605 -0.1339480758702939 -0.1847368907548403 -1.250953879569599 -1.183632828365285 -0.5764091147442416 -0.565375258822974 1.532352227508615 --0.9124763375291641 -1.390833937612012 0.4826674750136243 - -2 0 0 - 2 0 0 - 0 -2 0 - 0 2 0 - 0 0 -2 - 0 0 2 - -compute 2-d Delaunay triangulation -seed: 1327454202 - -8 vertices and 12 facets with normals: - -0.12 0.96 0.24 - -0.46 0.77 -0.44 - -0.03 -0.7 0.71 - 0.065 -0.78 0.62 - 0.21 0.57 -0.79 - 0.73 -0.68 -0.046 - 0.57 0.46 -0.68 - -0.69 -0.15 -0.7 - -0.61 0.095 -0.79 - -0.69 -0.11 -0.71 - -0.76 0.45 -0.47 - -0.92 0.17 -0.36 -2 -9 --0.5240618706046448 0.8690922898675285 -0.1358064000046035 0.3626730983099605 -7.974840388221374 -7.374405564218564 -0.4195468496642627 0.3335095202541082 --0.4922740987263012 -0.1088952709353415 --0.3827738348641049 0.0600803560653607 --0.4876069143265992 -0.0790832620725363 --0.8193548043760952 0.4791286600785644 --1.272050939831275 0.2416814840895872 - -add points to triangulation -added point p8: -1 -0.7369 1.543 -9 points, 0 extra points, 9 vertices, and 14 facets in total -added point p9: 0.5112 -0.0827 0.2682 -10 points, 0 extra points, 10 vertices, and 16 facets in total -added point p10: 0.06553 -0.5621 0.3202 -11 points, 0 extra points, 11 vertices, and 18 facets in total -added point p11: -0.9059 0.3577 0.9486 -12 points, 0 extra points, 12 vertices, and 20 facets in total -added point p12: 0.3586 0.8694 0.8844 -13 points, 0 extra points, 13 vertices, and 22 facets in total -added point p13: -0.233 0.03883 0.0558 -14 points, 0 extra points, 14 vertices, and 24 facets in total -2 -20 --0.5240618706046448 0.8690922898675285 --0.7142921036252496 -0.4804985865634099 --0.3868523717342836 -1.139305762703926 --0.1156818685064501 -0.4320436976219833 -0.1835775895812016 -0.2249639293216311 --0.7258967842870163 0.6025492522388728 --0.7138368277764179 0.3778481824012493 --0.947056678869817 0.1087890172824351 --3.220184924780109 0.005246869469005044 --2.144650850556788 -0.08718357304267166 -0.5665005822680963 2.292036901528415 -0.7037349508716335 0.4364365763155512 --0.4621934658225102 0.1363105721823742 -0.1412729021729308 -0.008672999714931684 --0.5240310768018593 -0.06418916274782284 -0.2007957323480979 0.3558162000371691 --0.5064628004910842 -0.1326436539669383 --0.4489169449937205 -0.1460994267569178 --0.03779347655016083 0.4959031883977701 -0.01966384040606073 0.4848333325721471 - -find Delaunay triangle closest to [0.5, 0.5, ...] --0.23 0.04 - 0.36 0.87 - 0.51 -0.08 - -compute halfspace intersection about the origin for a diamond -3 -6 - 0 0 -1 - 0 -1 0 - 1 0 0 - -1 0 0 - 0 1 0 - 0 0 1 - -add halfspaces for cube to intersection -added offset -1 and normal 1.732 0 0 -8 points, 1 extra points, 9 vertices, and 9 facets in total -added offset -1 and normal -1.732 0 0 -8 points, 2 extra points, 10 vertices, and 12 facets in total -added offset -1 and normal 0 1.732 0 -8 points, 3 extra points, 11 vertices, and 15 facets in total -added offset -1 and normal 0 -1.732 0 -8 points, 4 extra points, 12 vertices, and 18 facets in total -added offset -1 and normal 0 0 1.732 -8 points, 5 extra points, 13 vertices, and 21 facets in total -added offset -1 and normal 0 0 -1.732 -8 points, 6 extra points, 14 vertices, and 24 facets in total -3 -24 -0.5773502691896257 0 -0.4226497308103742 -0.5773502691896257 -0.4226497308103742 0 -0.5773502691896257 0.4226497308103742 0 -0.5773502691896257 0 0.4226497308103742 --0.5773502691896257 0 -0.4226497308103742 --0.5773502691896257 -0.4226497308103742 0 --0.5773502691896257 0.4226497308103742 0 --0.5773502691896257 0 0.4226497308103742 - 0 0.5773502691896257 -0.4226497308103742 -0.4226497308103742 0.5773502691896257 0 --0.4226497308103742 0.5773502691896257 0 - 0 0.5773502691896257 0.4226497308103742 - 0 -0.5773502691896257 -0.4226497308103742 --0.4226497308103742 -0.5773502691896257 0 -0.4226497308103742 -0.5773502691896257 0 - 0 -0.5773502691896257 0.4226497308103742 - 0 -0.4226497308103742 0.5773502691896257 -0.4226497308103742 0 0.5773502691896257 - 0 0.4226497308103742 0.5773502691896257 --0.4226497308103742 0 0.5773502691896257 --0.4226497308103742 0 -0.5773502691896257 - 0 -0.4226497308103742 -0.5773502691896257 -0.4226497308103742 0 -0.5773502691896257 - 0 0.4226497308103742 -0.5773502691896257 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96 distance computations. - -Convex hull of 14 points in 3-d: - - Number of vertices: 14 - Number of facets: 24 - -Statistics for: user_eg cube | qhull s Tcv Q11 QR1 p QR1 - - Number of points processed: 14 - Number of hyperplanes created: 45 - Number of distance tests for qhull: 68 - Number of distance tests for merging: 370 - Number of distance tests for checking: 214 - Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 192 distance computations. - -Voronoi diagram by the convex hull of 8 points in 3-d: - - Number of Voronoi regions: 8 - Number of Voronoi vertices: 9 - -Statistics for: user_eg Delaunay | qhull s d Tcv v p - - Number of points processed: 8 - Number of hyperplanes created: 21 - Number of facets in hull: 12 - Number of distance tests for qhull: 35 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 7.5e-015 of -all facets. Will make 72 distance computations. - -Voronoi diagram by the convex hull of 14 points in 3-d: - - Number of Voronoi regions: 14 - Number of Voronoi vertices: 20 - -Statistics for: user_eg Delaunay | qhull s d Tcv v p - - Number of points processed: 14 - Number of hyperplanes created: 53 - Number of facets in hull: 24 - Number of distance tests for qhull: 81 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 7.5e-015 of -all facets. Will make 280 distance computations. - -Halfspace intersection by the convex hull of 8 points in 3-d: - - Number of halfspaces: 8 - Number of non-redundant halfspaces: 8 - Number of intersection points: 6 - Number of non-simplicial intersection points: 6 - -Statistics for: user_eg halfspaces | qhull H0 s Tcv Fp - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 142 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48 distance computations. - -Halfspace intersection by the convex hull of 14 points in 3-d: - - Number of halfspaces: 14 - Number of non-redundant halfspaces: 14 - Number of intersection points: 24 - -Statistics for: user_eg halfspaces | qhull H0 s Tcv Fp - - Number of points processed: 14 - Number of hyperplanes created: 35 - Number of distance tests for qhull: 59 - Number of distance tests for merging: 306 - Number of distance tests for checking: 214 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 192 distance computations. -user_eg3 rbox "10 D2" "2 D2" qhull "p" -rbox 10 D2 -rbox 2 D2 - -Results of p -2 -5 --0.02222276248244826 -0.4979727817680433 --0.4285431913366012 0.4745826469497594 -0.3790312361708201 0.3779794437605696 -0.3443122672329771 -0.1437312230875075 --0.3674659290047977 0.0001301793382784133 -echo === check front ends ${d:-`date`} ================== -date -=== check front ends Tue Jan 24 20:16:43 EST 2012 ================== -qconvex - - -qconvex- compute the convex hull - http://www.qhull.org 2012.1 2012/01/22 - -input (stdin): - first lines: dimension and number of points (or vice-versa). - other lines: point coordinates, best if one point per line - comments: start with a non-numeric character - -options: - Qt - triangulated output - QJ - joggled input instead of merged facets - Qc - keep coplanar points with nearest facet - Qi - keep interior points with nearest facet - -Qhull control options: - Qbk:n - scale coord k so that low bound is n - QBk:n - scale coord k so that upper bound is n (QBk is 0.5) - QbB - scale input to unit cube centered at the origin - Qbk:0Bk:0 - remove k-th coordinate from input - QJn - randomly joggle input in range [-n,n] - QRn - random rotation (n=seed, n=0 time, n=-1 time/no rotate) - Qs - search all points for the initial simplex - QGn - good facet if visible from point n, -n for not visible - QVn - good facet if it includes point n, -n if not - -Trace options: - T4 - trace at level n, 4=all, 5=mem/gauss, -1= events - Tc - check frequently during execution - Ts - print statistics - Tv - verify result: structure, convexity, and point inclusion - Tz - send all output to stdout - TFn - report summary when n or more facets created - TI file - input data from file, no spaces or single quotes - TO file - output results to file, may be enclosed in single quotes - TPn - turn on tracing when point n added to hull - TMn - turn on tracing at merge n - TWn - trace merge facets when width > n - TVn - stop qhull after adding point n, -n for before (see TCn) - TCn - stop qhull after building cone for point n (see TVn) - -Precision options: - Cn - radius of centrum (roundoff added). Merge facets if non-convex - An - cosine of maximum angle. Merge facets if cosine > n or non-convex - C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge - Rn - randomly perturb computations by a factor of [1-n,1+n] - Un - max distance below plane for a new, coplanar point - Wn - min facet width for outside point (before roundoff) - -Output formats (may be combined; if none, produces a summary to stdout): - f - facet dump - G - Geomview output (see below) - i - vertices incident to each facet - m - Mathematica output (2-d and 3-d) - n - normals with offsets - o - OFF file format (dim, points and facets; Voronoi regions) - p - point coordinates - s - summary (stderr) - -More formats: - Fa - area for each facet - FA - compute total area and volume for option 's' - Fc - count plus coplanar points for each facet - use 'Qc' (default) for coplanar and 'Qi' for interior - FC - centrum for each facet - Fd - use cdd format for input (homogeneous with offset first) - FD - use cdd format for numeric output (offset first) - FF - facet dump without ridges - Fi - inner plane for each facet - FI - ID for each facet - Fm - merge count for each facet (511 max) - Fn - count plus neighboring facets for each facet - FN - count plus neighboring facets for each point - Fo - outer plane (or max_outside) for each facet - FO - options and precision constants - FP - nearest vertex for each coplanar point - FQ - command used for qconvex - Fs - summary: #int (8), dimension, #points, tot vertices, tot facets, - for output: #vertices, #facets, - #coplanar points, #non-simplicial facets - #real (2), max outer plane, min vertex - FS - sizes: #int (0) - #real (2) tot area, tot volume - Ft - triangulation with centrums for non-simplicial facets (OFF format) - Fv - count plus vertices for each facet - FV - average of vertices (a feasible point for 'H') - Fx - extreme points (in order for 2-d) - -Geomview output (2-d, 3-d, and 4-d) - Ga - all points as dots - Gp - coplanar points and vertices as radii - Gv - vertices as spheres - Gi - inner planes only - Gn - no planes - Go - outer planes only - Gc - centrums - Gh - hyperplane intersections - Gr - ridges - GDn - drop dimension n in 3-d and 4-d output - -Print options: - PAn - keep n largest facets by area - Pdk:n - drop facet if normal[k] <= n (default 0.0) - PDk:n - drop facet if normal[k] >= n - Pg - print good facets (needs 'QGn' or 'QVn') - PFn - keep facets whose area is at least n - PG - print neighbors of good facets - PMn - keep n facets with most merges - Po - force output. If error, output neighborhood of facet - Pp - do not report precision problems - - . - list of all options - - - one line descriptions of all options -qconvex . - -Qhull 2012.1 2012/01/22. -Except for 'F.' and 'PG', upper-case options take an argument. - - incidences mathematica normals OFF_format points - summary facet_dump - - Farea FArea_total Fcoplanars FCentrums Fd_cdd_in - FD_cdd_out FFacet_xridge Finner FIDs Fmerges - Fneighbors FNeigh_vertex Fouter FOptions FPoint_near - FQhull Fsummary FSize Fvertices FVertex_ave - Fxtremes FMaple - - Gvertices Gpoints Gall_points Gno_planes Ginner - Gcentrums Ghyperplanes Gridges Gouter GDrop_dim - - PArea_keep Pdrop d0:0D0 PFacet_area_keep Pgood PGood_neighbors - PMerge_keep Poutput_forced Pprecision_not - - QbBound 0:0.5 QbB_scale_box Qcoplanar QGood_point Qinterior - QJoggle Qrandom QRotate Qsearch_1st Qtriangulate - QVertex_good - - T4_trace Tcheck_often Tstatistics Tverify Tz_stdout - TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file - TWide_trace TVertex_stop TCone_stop - - Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside -qconvex - -qconvex- compute the convex hull. Qhull 2012.1 2012/01/22 - input (stdin): dimension, number of points, point coordinates - comments start with a non-numeric character - -options (qconvex.htm): - Qt - triangulated output - QJ - joggled input instead of merged facets - Tv - verify result: structure, convexity, and point inclusion - . - concise list of all options - - - one-line description of all options - -output options (subset): - s - summary of results (default) - i - vertices incident to each facet - n - normals with offsets - p - vertex coordinates (includes coplanar points if 'Qc') - Fx - extreme points (convex hull vertices) - FA - report total area and volume - FS - compute total area and volume - o - OFF format (dim, n, points, facets) - G - Geomview output (2-d, 3-d, and 4-d) - m - Mathematica output (2-d and 3-d) - QVn - print facets that include point n, -n if not - TO file- output results to file, may be enclosed in single quotes - -examples: - rbox c D2 | qconvex s n rbox c D2 | qconvex i - rbox c D2 | qconvex o rbox 1000 s | qconvex s Tv FA - rbox c d D2 | qconvex s Qc Fx rbox y 1000 W0 | qconvex s n - rbox y 1000 W0 | qconvex s QJ rbox d G1 D12 | qconvex QR0 FA Pp - rbox c D7 | qconvex FA TF1000 - -rbox c D3 | qconvex s n Qt -4 -12 - -0 -0 -1 -0.5 - -0 -0 -1 -0.5 - 0 -1 0 -0.5 - 0 -1 0 -0.5 - 1 -0 -0 -0.5 - 1 -0 -0 -0.5 - -1 -0 -0 -0.5 - -1 -0 -0 -0.5 - 0 1 -0 -0.5 - 0 1 -0 -0.5 - -0 -0 1 -0.5 - -0 -0 1 -0.5 - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 12 - Number of triangulated facets: 6 - -Statistics for: rbox c D3 | qconvex s n Qt - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 108 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - -rbox c D2 | qconvex s i -4 -0 2 -1 0 -2 3 -3 1 - -Convex hull of 4 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox c D2 | qconvex s i - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 6 - CPU seconds to compute hull (after input): 0 - -rbox c D2 | qconvex o -2 -4 4 4 - -0.5 -0.5 - -0.5 0.5 - 0.5 -0.5 - 0.5 0.5 -2 0 2 -2 1 0 -2 2 3 -2 3 1 -rbox 1000 s | qconvex s Tv FA - -Convex hull of 1000 points in 3-d: - - Number of vertices: 1000 - Number of facets: 1996 - -Statistics for: rbox 1000 s | qconvex s Tv FA - - Number of points processed: 1000 - Number of hyperplanes created: 5545 - Number of distance tests for qhull: 25488 - CPU seconds to compute hull (after input): 0 - Total facet area: 3.1201951 - Total volume: 0.51650274 - - -qhull output completed. Verifying that 1000 points are -below 2.1e-015 of the nearest facet. -rbox c d D2 | qconvex s Qc Fx -4 -0 -2 -3 -1 - -Convex hull of 8 points in 2-d: - - Number of vertices: 4 - Number of coplanar points: 4 - Number of facets: 4 - -Statistics for: rbox c d D2 | qconvex s Qc Fx - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 36 - CPU seconds to compute hull (after input): 0 - -rbox y 1000 W0 | qconvex s n -4 -4 -0.2135848119563837 0.1168704340428167 0.9699086708284445 -0.09806074564261891 -0.08553875579270345 -0.8316435307282575 -0.5486822022403077 -0.1234144150397865 --0.749541668500822 -0.02779445272382559 -0.6613733859014792 -0.2159556159595279 -0.3120013537900506 0.9498158823230658 -0.02247097950761911 -0.02453689035981485 - -Convex hull of 1004 points in 3-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox y 1000 W0 | qconvex s n - - Number of points processed: 4 - Number of hyperplanes created: 5 - Number of distance tests for qhull: 11001 - CPU seconds to compute hull (after input): 0 - -rbox y 1000 W0 | qconvex s QJ - -Convex hull of 1004 points in 3-d: - - Number of vertices: 51 - Number of facets: 98 - -Statistics for: rbox y 1000 W0 | qconvex s QJ - - Number of points processed: 52 - Number of hyperplanes created: 181 - Number of distance tests for qhull: 6424 - CPU seconds to compute hull (after input): 0 - Input joggled by: 2.1e-011 - -rbox d G1 D12 | qconvex QR0 FA - -Convex hull of 24 points in 12-d: - - Number of vertices: 24 - Number of facets: 4096 - -Statistics for: rbox d G1 D12 | qconvex QR0 FA QR1327454203 - - Number of points processed: 24 - Number of hyperplanes created: 4108 - Number of distance tests for qhull: 4216 - Number of distance tests for merging: 121128 - Number of distance tests for checking: 196656 - Number of merged facets: 2036 - CPU seconds to compute hull (after input): 0.109 - Approximate facet area: 0.00035546337 - Approximate volume: 8.5511197e-006 - -rbox c D6 | qconvex FA TF500 - -Convex hull of 64 points in 6-d: - - Number of vertices: 64 - Number of facets: 12 - Number of non-simplicial facets: 12 - -Statistics for: rbox c D6 | qconvex FA TF500 - - Number of points processed: 64 - Number of hyperplanes created: 359 - Number of distance tests for qhull: 2510 - Number of distance tests for merging: 14115 - Number of distance tests for checking: 832 - Number of merged facets: 1457 - CPU seconds to compute hull (after input): 0 - Approximate facet area: 12 - Approximate volume: 1 - - -At 20:16:43 & 0 CPU secs, qhull has created 543 facets and merged 289. - The current hull contains 91 facets and 23 vertices. There are 41 - outside points. Next is point p27(v24), 0.64 above f107. - -At 20:16:43 & 0 CPU secs, qhull has created 1061 facets and merged 737. - The current hull contains 69 facets and 33 vertices. There are 31 - outside points. Next is point p22(v34), 0.52 above f610. - -At 20:16:43 & 0 CPU secs, qhull has created 1575 facets and merged 1230. - The current hull contains 25 facets and 51 vertices. There are 13 - outside points. Next is point p45(v52), 0.45 above f1476. - -At 20:16:43 & 0 CPU secs, qhull has created 1815 facets and merged 1457. - The current hull contains 12 facets and 64 vertices. Last point was p35 - -Convex hull of 64 points in 6-d: - - Number of vertices: 64 - Number of facets: 12 - Number of non-simplicial facets: 12 - -Statistics for: rbox c D6 | qconvex FA TF500 - - Number of points processed: 64 - Number of hyperplanes created: 359 - Number of distance tests for qhull: 2510 - Number of distance tests for merging: 13995 - Number of distance tests for checking: 0 - Number of merged facets: 1457 - - -First post-merge with 'C3.5e-015' and 'A1.8e+308' - -At 20:16:43 & 0 CPU secs, qhull has created 1815 facets and merged 1457. - The current hull contains 12 facets and 64 vertices. Last point was p35 - -Testing all coplanar points. -computing area of each facet and volume of the convex hull -rbox c P0 d D2 | qconvex p Fa Fc FP FI Fn FN FS Fv Fx -2 -8 - -0.5 -0.5 - -0.5 0.5 - 0.5 -0.5 - 0.5 0.5 - 0 -0.5 - 0 0.5 - -0.5 0 - 0.5 0 -4 - 1 - 1 - 1 - 1 -4 -1 5 -1 7 -1 8 -1 6 -4 -3 5 1 0.5 -2 7 2 0.5 -4 8 4 0.5 -4 6 5 0.5 -4 -1 -2 -4 -5 -4 -2 1 2 -2 0 3 -2 0 3 -2 1 2 -9 -0 -2 0 1 -2 1 3 -2 0 2 -2 2 3 -1 0 -1 3 -1 1 -1 2 -0 -2 4 1 -4 -2 3 1 -2 2 1 -2 4 3 -2 4 2 -4 -1 -3 -4 -2 -rbox c d D2 | qconvex s i QV0 -2 -0 2 -1 0 - -Convex hull of 8 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - Number of 'good' facets: 2 - -Statistics for: rbox c d D2 | qconvex s i QV0 - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 36 - CPU seconds to compute hull (after input): 0 - -rbox c | qconvex Q0 -QH6029 qhull error: option 'Q0' is not used with this program. - It may be used with qhull. - -While executing: | qconvex Q0 -Options selected for Qhull 2012.1 2012/01/22: - run-id 315181139 -qvoronoi - - -qvoronoi- compute the Voronoi diagram - http://www.qhull.org 2012.1 2012/01/22 - -input (stdin): - first lines: dimension and number of points (or vice-versa). - other lines: point coordinates, best if one point per line - comments: start with a non-numeric character - -options: - Qu - compute furthest-site Voronoi diagram - -Qhull control options: - Qz - add point-at-infinity to Voronoi diagram - Qs - search all points for the initial simplex - QGn - Voronoi vertices if visible from point n, -n if not - QVn - Voronoi vertices for input point n, -n if not - -Trace options: - T4 - trace at level n, 4=all, 5=mem/gauss, -1= events - Tc - check frequently during execution - Ts - statistics - Tv - verify result: structure, convexity, and in-circle test - Tz - send all output to stdout - TFn - report summary when n or more facets created - TI file - input data from file, no spaces or single quotes - TO file - output results to file, may be enclosed in single quotes - TPn - turn on tracing when point n added to hull - TMn - turn on tracing at merge n - TWn - trace merge facets when width > n - TVn - stop qhull after adding point n, -n for before (see TCn) - TCn - stop qhull after building cone for point n (see TVn) - -Precision options: - Cn - radius of centrum (roundoff added). Merge facets if non-convex - An - cosine of maximum angle. Merge facets if cosine > n or non-convex - C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge - Rn - randomly perturb computations by a factor of [1-n,1+n] - Wn - min facet width for non-coincident point (before roundoff) - -Output formats (may be combined; if none, produces a summary to stdout): - s - summary to stderr - p - Voronoi vertices - o - OFF format (dim, Voronoi vertices, and Voronoi regions) - i - Delaunay regions (use 'Pp' to avoid warning) - f - facet dump - -More formats: - Fc - count plus coincident points (by Voronoi vertex) - Fd - use cdd format for input (homogeneous with offset first) - FD - use cdd format for output (offset first) - FF - facet dump without ridges - Fi - separating hyperplanes for bounded Voronoi regions - FI - ID for each Voronoi vertex - Fm - merge count for each Voronoi vertex (511 max) - Fn - count plus neighboring Voronoi vertices for each Voronoi vertex - FN - count and Voronoi vertices for each Voronoi region - Fo - separating hyperplanes for unbounded Voronoi regions - FO - options and precision constants - FP - nearest point and distance for each coincident point - FQ - command used for qvoronoi - Fs - summary: #int (8), dimension, #points, tot vertices, tot facets, - for output: #Voronoi regions, #Voronoi vertices, - #coincident points, #non-simplicial regions - #real (2), max outer plane and min vertex - Fv - Voronoi diagram as Voronoi vertices between adjacent input sites - Fx - extreme points of Delaunay triangulation (on convex hull) - -Geomview options (2-d only) - Ga - all points as dots - Gp - coplanar points and vertices as radii - Gv - vertices as spheres - Gi - inner planes only - Gn - no planes - Go - outer planes only - Gc - centrums - Gh - hyperplane intersections - Gr - ridges - GDn - drop dimension n in 3-d and 4-d output - -Print options: - PAn - keep n largest Voronoi vertices by 'area' - Pdk:n - drop facet if normal[k] <= n (default 0.0) - PDk:n - drop facet if normal[k] >= n - Pg - print good Voronoi vertices (needs 'QGn' or 'QVn') - PFn - keep Voronoi vertices whose 'area' is at least n - PG - print neighbors of good Voronoi vertices - PMn - keep n Voronoi vertices with most merges - Po - force output. If error, output neighborhood of facet - Pp - do not report precision problems - - . - list of all options - - - one line descriptions of all options -qvoronoi . - -Qhull 2012.1 2012/01/22. -Except for 'F.' and 'PG', upper-case options take an argument. - - OFF_format p_vertices i_delaunay summary facet_dump - - Fcoincident Fd_cdd_in FD_cdd_out FF-dump-xridge Fi_bounded - Fxtremes Fmerges Fneighbors FNeigh_region FOptions - Fo_unbounded FPoint_near FQvoronoi Fsummary Fvoronoi - FIDs - - Gvertices Gpoints Gall_points Gno_planes Ginner - Gcentrums Ghyperplanes Gridges Gouter GDrop_dim - - PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep - PGood_neighbors PMerge_keep Poutput_forced Pprecision_not - - QG_vertex_good Qsearch_1st Qupper_voronoi QV_point_good Qzinfinite - T4_trace Tcheck_often Tstatistics Tverify Tz_stdout - TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file - TWide_trace TVertex_stop TCone_stop - - Angle_max Centrum_size Random_dist Wide_outside -qvoronoi - -qvoronoi- compute the Voronoi diagram. Qhull 2012.1 2012/01/22 - input (stdin): dimension, number of points, point coordinates - comments start with a non-numeric character - -options (qvoronoi.htm): - Qu - compute furthest-site Voronoi diagram - Tv - verify result: structure, convexity, and in-circle test - . - concise list of all options - - - one-line description of all options - -output options (subset): - s - summary of results (default) - p - Voronoi vertices - o - OFF file format (dim, Voronoi vertices, and Voronoi regions) - FN - count and Voronoi vertices for each Voronoi region - Fv - Voronoi diagram as Voronoi vertices between adjacent input sites - Fi - separating hyperplanes for bounded regions, 'Fo' for unbounded - G - Geomview output (2-d only) - QVn - Voronoi vertices for input point n, -n if not - TO file- output results to file, may be enclosed in single quotes - -examples: -rbox c P0 D2 | qvoronoi s o rbox c P0 D2 | qvoronoi Fi -rbox c P0 D2 | qvoronoi Fo rbox c P0 D2 | qvoronoi Fv -rbox c P0 D2 | qvoronoi s Qu Fv rbox c P0 D2 | qvoronoi Qu Fo -rbox c G1 d D2 | qvoronoi s p rbox c P0 D2 | qvoronoi s Fv QV0 - -rbox c P0 D2 | qvoronoi s o -2 -5 5 1 --10.101 -10.101 - 0 -0.5 - -0.5 0 - 0.5 0 - 0 0.5 -4 4 2 1 3 -3 2 0 1 -3 4 0 2 -3 3 0 1 -3 4 0 3 - -Voronoi diagram by the convex hull of 5 points in 3-d: - - Number of Voronoi regions: 5 - Number of Voronoi vertices: 4 - -Statistics for: rbox c P0 D2 | qvoronoi s o - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 5 - Number of distance tests for qhull: 8 - Number of distance tests for merging: 29 - Number of distance tests for checking: 30 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox c P0 D2 | qvoronoi Fi Tv -4 -5 0 3 0.7071067811865475 -0.7071067811865475 -0.3535533905932737 -5 0 1 -0.7071067811865475 -0.7071067811865475 -0.3535533905932737 -5 0 2 -0.7071067811865475 0.7071067811865475 -0.3535533905932737 -5 0 4 0.7071067811865475 0.7071067811865475 -0.3535533905932737 - -Voronoi ridge statistics - 4 bounded ridges - 0 max. distance of midpoint to ridge - 4 bounded ridges with ok normal -2.2e-016 ave. angle to ridge -2.2e-016 max. angle to ridge - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 20 distance computations. -rbox c P0 D2 | qvoronoi Fo -4 -5 1 2 -1 0 -0.5 -5 1 3 1 -0 -0 -5 2 4 1 -0 -0 -5 3 4 -1 0 0.5 -rbox c P0 D2 | qvoronoi Fv -8 -4 0 3 1 3 -4 0 1 1 2 -4 0 2 2 4 -4 0 4 3 4 -4 1 2 0 2 -4 1 3 0 1 -4 2 4 0 4 -4 3 4 0 3 -rbox c P0 D2 | qvoronoi s Qu Qt Fv -4 -4 1 3 0 2 -4 1 2 0 1 -4 2 4 0 1 -4 3 4 0 2 - -Furthest-site Voronoi vertices by the convex hull of 5 points in 3-d: - - Number of Voronoi regions: 5 - Number of Voronoi vertices: 2 - Number of triangulated facets: 1 - -Statistics for: rbox c P0 D2 | qvoronoi s Qu Qt Fv - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 6 - Number of distance tests for qhull: 8 - Number of distance tests for merging: 33 - Number of distance tests for checking: 30 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox c P0 D2 | qvoronoi Qu Fo -4 -5 1 2 -0 1 0 -5 1 3 1 -0 -0 -5 2 4 1 -0 -0 -5 3 4 -0 1 -0 -rbox c G1 d D2 | qvoronoi s p -2 -9 - 0 -1.75 - -1.75 0 --0.5833333333333334 -0.5833333333333333 - 0 1.75 --0.5833333333333333 0.5833333333333334 - 1.75 0 -0.5833333333333334 -0.5833333333333333 -0.5833333333333334 0.5833333333333333 - 0 0 - -Voronoi diagram by the convex hull of 8 points in 3-d: - - Number of Voronoi regions: 8 - Number of Voronoi vertices: 9 - Number of non-simplicial Voronoi vertices: 1 - -Statistics for: rbox c G1 d D2 | qvoronoi s p - - Number of points processed: 8 - Number of hyperplanes created: 17 - Number of facets in hull: 10 - Number of distance tests for qhull: 42 - Number of distance tests for merging: 103 - Number of distance tests for checking: 80 - Number of merged facets: 3 - CPU seconds to compute hull (after input): 0 - -rbox c G1 d D2 | qvoronoi QJ p -2 -10 --2.57276422388486e-011 1.749999999802917 --2.05463598231932e-011 -1.750000000331276 -0.5833333333083517 -0.5833333333052267 -1.862254794815499e-011 -7.815052443180038e-011 -1.750000000002628 3.498100747664324e-011 -0.5833333333132078 0.5833333333796981 --0.5833333332888888 0.5833333333317835 --7.592293460589872e-011 -7.815050692933324e-011 --1.750000000049026 2.293196879294717e-011 --0.5833333333977308 -0.5833333333229861 -rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN -4 -0 -1 1 -0 -0 -1 -2 1 8 0 -rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN -4 -3 -1 2 3 -3 -1 2 3 -4 -1 0 1 3 -4 0 -1 2 1 -7 -3 3 2 0 -1 1 -3 3 1 2 -3 0 -1 2 -3 3 -1 0 -3 1 -1 2 -3 1 -1 3 - -Voronoi diagram by the convex hull of 7 points in 3-d: - - Number of Voronoi regions: 6 - Number of nearly incident points: 1 - Number of Voronoi vertices: 4 - Number of non-simplicial Voronoi vertices: 2 - -Statistics for: rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN - - Number of points processed: 6 - Number of hyperplanes created: 8 - Number of facets in hull: 5 - Number of distance tests for qhull: 33 - Number of distance tests for merging: 49 - Number of distance tests for checking: 43 - Number of merged facets: 3 - CPU seconds to compute hull (after input): 0 - -rbox P0 c D2 | qvoronoi s Fv QV0 -4 -4 0 3 1 3 -4 0 1 1 2 -4 0 2 2 4 -4 0 4 3 4 - -Voronoi diagram by the convex hull of 5 points in 3-d: - - Number of Voronoi regions: 5 - Number of 'good' Voronoi vertices: 4 - -Statistics for: rbox P0 c D2 | qvoronoi s Fv QV0 - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 5 - Number of distance tests for qhull: 8 - Number of distance tests for merging: 29 - Number of distance tests for checking: 30 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -qdelaunay - - -qdelaunay- compute the Delaunay triangulation - http://www.qhull.org 2012.1 2012/01/22 - -input (stdin): - first lines: dimension and number of points (or vice-versa). - other lines: point coordinates, best if one point per line - comments: start with a non-numeric character - -options: - Qu - compute furthest-site Delaunay triangulation - Qt - triangulated output - QJ - joggled input instead of merged facets - -Qhull control options: - QJn - randomly joggle input in range [-n,n] - Qs - search all points for the initial simplex - Qz - add point-at-infinity to Delaunay triangulation - QGn - print Delaunay region if visible from point n, -n if not - QVn - print Delaunay regions that include point n, -n if not - -Trace options: - T4 - trace at level n, 4=all, 5=mem/gauss, -1= events - Tc - check frequently during execution - Ts - print statistics - Tv - verify result: structure, convexity, and in-circle test - Tz - send all output to stdout - TFn - report summary when n or more facets created - TI file - input data from file, no spaces or single quotes - TO file - output results to file, may be enclosed in single quotes - TPn - turn on tracing when point n added to hull - TMn - turn on tracing at merge n - TWn - trace merge facets when width > n - TVn - stop qhull after adding point n, -n for before (see TCn) - TCn - stop qhull after building cone for point n (see TVn) - -Precision options: - Cn - radius of centrum (roundoff added). Merge facets if non-convex - An - cosine of maximum angle. Merge facets if cosine > n or non-convex - C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge - Rn - randomly perturb computations by a factor of [1-n,1+n] - Wn - min facet width for outside point (before roundoff) - -Output formats (may be combined; if none, produces a summary to stdout): - f - facet dump - G - Geomview output (see below) - i - vertices incident to each Delaunay region - m - Mathematica output (2-d only, lifted to a paraboloid) - o - OFF format (dim, points, and facets as a paraboloid) - p - point coordinates (lifted to a paraboloid) - s - summary (stderr) - -More formats: - Fa - area for each Delaunay region - FA - compute total area for option 's' - Fc - count plus coincident points for each Delaunay region - Fd - use cdd format for input (homogeneous with offset first) - FD - use cdd format for numeric output (offset first) - FF - facet dump without ridges - FI - ID of each Delaunay region - Fm - merge count for each Delaunay region (511 max) - FM - Maple output (2-d only, lifted to a paraboloid) - Fn - count plus neighboring region for each Delaunay region - FN - count plus neighboring region for each point - FO - options and precision constants - FP - nearest point and distance for each coincident point - FQ - command used for qdelaunay - Fs - summary: #int (8), dimension, #points, tot vertices, tot facets, - for output: #vertices, #Delaunay regions, - #coincident points, #non-simplicial regions - #real (2), max outer plane, min vertex - FS - sizes: #int (0) - #real (2), tot area, 0 - Fv - count plus vertices for each Delaunay region - Fx - extreme points of Delaunay triangulation (on convex hull) - -Geomview options (2-d and 3-d) - Ga - all points as dots - Gp - coplanar points and vertices as radii - Gv - vertices as spheres - Gi - inner planes only - Gn - no planes - Go - outer planes only - Gc - centrums - Gh - hyperplane intersections - Gr - ridges - GDn - drop dimension n in 3-d and 4-d output - Gt - transparent outer ridges to view 3-d Delaunay - -Print options: - PAn - keep n largest Delaunay regions by area - Pdk:n - drop facet if normal[k] <= n (default 0.0) - PDk:n - drop facet if normal[k] >= n - Pg - print good Delaunay regions (needs 'QGn' or 'QVn') - PFn - keep Delaunay regions whose area is at least n - PG - print neighbors of good regions (needs 'QGn' or 'QVn') - PMn - keep n Delaunay regions with most merges - Po - force output. If error, output neighborhood of facet - Pp - do not report precision problems - - . - list of all options - - - one line descriptions of all options -qdelaunay . - -Qhull 2012.1 2012/01/22. -Except for 'F.' and 'PG', upper-case options take an argument. - - incidences mathematica OFF_format points_lifted summary - facet_dump - - Farea FArea_total Fcoincident Fd_cdd_in FD_cdd_out - FF_dump_xridge FIDs Fmerges Fneighbors FNeigh_vertex - FOptions FPoint_near FQdelaun Fsummary FSize - Fvertices Fxtremes FMaple - - Gvertices Gpoints Gall_points Gno_planes Ginner - Gcentrums Ghyperplanes Gridges Gouter GDrop_dim - Gtransparent - - PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep - PGood_neighbors PMerge_keep Poutput_forced Pprecision_not - - QGood_point QJoggle Qsearch_1st Qtriangulate QupperDelaunay - QVertex_good Qzinfinite - - T4_trace Tcheck_often Tstatistics Tverify Tz_stdout - TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file - TWide_trace TVertex_stop TCone_stop - - Angle_max Centrum_size Random_dist Wide_outside -qdelaunay - -qdelaunay- compute the Delaunay triangulation. Qhull 2012.1 2012/01/22 - input (stdin): dimension, number of points, point coordinates - comments start with a non-numeric character - -options (qdelaun.htm): - Qu - furthest-site Delaunay triangulation - Qt - triangulated output - QJ - joggled input instead of merged facets - Tv - verify result: structure, convexity, and in-circle test - . - concise list of all options - - - one-line description of all options - -output options (subset): - s - summary of results (default) - i - vertices incident to each Delaunay region - Fx - extreme points (vertices of the convex hull) - o - OFF format (shows the points lifted to a paraboloid) - G - Geomview output (2-d and 3-d points lifted to a paraboloid) - m - Mathematica output (2-d inputs lifted to a paraboloid) - QVn - print Delaunay regions that include point n, -n if not - TO file- output results to file, may be enclosed in single quotes - -examples: - rbox c P0 D2 | qdelaunay s o rbox c P0 D2 | qdelaunay i - rbox c P0 D2 | qdelaunay Fv rbox c P0 D2 | qdelaunay s Qu Fv - rbox c G1 d D2 | qdelaunay s i rbox c G1 d D2 | qdelaunay Qt - rbox M3,4 z 100 D2 | qdelaunay s rbox M3,4 z 100 D2 | qdelaunay s Qt - -rbox c P0 D2 | qdelaunay s o -3 -5 4 6 - 0 0 0 - -0.5 -0.5 1 - -0.5 0.5 1 - 0.5 -0.5 1 - 0.5 0.5 1 -3 3 0 1 -3 0 2 1 -3 4 0 3 -3 0 4 2 - -Delaunay triangulation by the convex hull of 5 points in 3-d: - - Number of input sites: 5 - Number of Delaunay regions: 4 - -Statistics for: rbox c P0 D2 | qdelaunay s o - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 5 - Number of distance tests for qhull: 8 - Number of distance tests for merging: 29 - Number of distance tests for checking: 30 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox c P0 D2 | qdelaunay i -4 -3 0 1 -0 2 1 -4 0 3 -0 4 2 -rbox c P0 D2 | qdelaunay Fv -4 -3 0 3 1 -3 0 2 1 -3 4 0 3 -3 4 0 2 -rbox c P0 D2 | qdelaunay s Qu Qt Fv -2 -3 4 2 1 -3 4 3 1 - -Furthest-site Delaunay triangulation by the convex hull of 5 points in 3-d: - - Number of input sites: 5 - Number of Delaunay regions: 2 - Number of triangulated facets: 1 - -Statistics for: rbox c P0 D2 | qdelaunay s Qu Qt Fv - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 6 - Number of distance tests for qhull: 8 - Number of distance tests for merging: 33 - Number of distance tests for checking: 30 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox c G1 d D2 | qdelaunay s i -9 -2 4 0 -6 1 0 -4 6 0 -5 3 1 -6 5 1 -3 7 2 -7 4 2 -5 7 3 -4 7 5 6 - -Delaunay triangulation by the convex hull of 8 points in 3-d: - - Number of input sites: 8 - Number of Delaunay regions: 9 - Number of non-simplicial Delaunay regions: 1 - -Statistics for: rbox c G1 d D2 | qdelaunay s i - - Number of points processed: 8 - Number of hyperplanes created: 17 - Number of facets in hull: 10 - Number of distance tests for qhull: 42 - Number of distance tests for merging: 103 - Number of distance tests for checking: 80 - Number of merged facets: 3 - CPU seconds to compute hull (after input): 0 - -rbox c G1 d D2 | qhull d Qbb Ft -2 -9 12 14 - -1 -1 - -1 1 - 1 -1 - 1 1 - 0 -0.5 - 0 0.5 - -0.5 0 - 0.5 0 - 0 0 -3 2 4 0 -3 6 1 0 -3 4 6 0 -3 5 3 1 -3 6 5 1 -3 3 7 2 -3 7 4 2 -3 5 7 3 -3 8 5 6 -3 8 6 4 -3 8 4 7 -3 8 7 5 -rbox c G1 d D2 | qhull d Qbb QJ s Ft -2 -8 10 15 --1.000000000061343 -0.999999999957446 --0.9999999999945448 0.9999999999532114 -1.000000000029778 -0.9999999999701502 -0.9999999999806051 1.000000000003233 --7.748592400792811e-011 -0.5000000000743411 -2.849349704487493e-011 0.49999999991804 --0.5000000000721135 -1.37371989142159e-011 -0.5000000000148132 7.166044474310069e-011 -3 1 5 3 -3 2 4 0 -3 7 4 2 -3 4 7 5 -3 3 7 2 -3 5 7 3 -3 1 6 5 -3 6 4 5 -3 6 1 0 -3 4 6 0 - -Delaunay triangulation by the convex hull of 8 points in 3-d: - - Number of input sites: 8 - Number of Delaunay regions: 10 - -Statistics for: rbox c G1 d D2 | qhull d Qbb QJ s Ft - - Number of points processed: 8 - Number of hyperplanes created: 20 - Number of facets in hull: 12 - Number of distance tests for qhull: 32 - CPU seconds to compute hull (after input): 0 - Input joggled by: 8.3e-011 - -rbox M3,4 z 100 D2 | qdelaunay s - -Delaunay triangulation by the convex hull of 100 points in 3-d: - - Number of input sites: 100 - Number of Delaunay regions: 81 - Number of non-simplicial Delaunay regions: 81 - -Statistics for: rbox M3,4 z 100 D2 | qdelaunay s - - Number of points processed: 100 - Number of hyperplanes created: 262 - Number of facets in hull: 86 - Number of distance tests for qhull: 1652 - Number of distance tests for merging: 2778 - Number of distance tests for checking: 1348 - Number of merged facets: 152 - CPU seconds to compute hull (after input): 0 - -rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN -4 -4 -3 -6 -5 -4 - 0.2 - 0.2 - 0.3 - 0.3 -4 -0 -1 1 -0 -0 -1 -2 1 8 0 -rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN -4 -3 -1 2 3 -3 -1 2 3 -4 -1 0 1 3 -4 0 -1 2 1 -7 -3 3 2 0 -1 1 -3 3 1 2 -3 0 -1 2 -3 3 -1 0 -3 1 -1 2 -3 1 -1 3 - -Delaunay triangulation by the convex hull of 7 points in 3-d: - - Number of input sites: 6 - Number of nearly incident points: 1 - Number of Delaunay regions: 4 - Number of non-simplicial Delaunay regions: 2 - -Statistics for: rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN - - Number of points processed: 6 - Number of hyperplanes created: 8 - Number of facets in hull: 5 - Number of distance tests for qhull: 33 - Number of distance tests for merging: 49 - Number of distance tests for checking: 42 - Number of merged facets: 3 - CPU seconds to compute hull (after input): 0 - Approximate facet area: 1 - -rbox P0 P0 c D2 | qdelaunay s FP QV0 -1 -0 1 2 0 - -Delaunay triangulation by the convex hull of 6 points in 3-d: - - Number of input sites: 5 - Number of nearly incident points: 1 - Number of 'good' Delaunay regions: 4 - -Statistics for: rbox P0 P0 c D2 | qdelaunay s FP QV0 - - Number of points processed: 5 - Number of hyperplanes created: 7 - Number of facets in hull: 5 - Number of distance tests for qhull: 20 - Number of distance tests for merging: 29 - Number of distance tests for checking: 36 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -qhalf - - -qhalf- compute the intersection of halfspaces about a point - http://www.qhull.org 2012.1 2012/01/22 - -input (stdin): - optional interior point: dimension, 1, coordinates - first lines: dimension+1 and number of halfspaces - other lines: halfspace coefficients followed by offset - comments: start with a non-numeric character - -options: - Hn,n - specify coordinates of interior point - Qt - triangulated output - QJ - joggled input instead of merged facets - Qc - keep coplanar halfspaces - Qi - keep other redundant halfspaces - -Qhull control options: - QJn - randomly joggle input in range [-n,n] - Qbk:0Bk:0 - remove k-th coordinate from input - Qs - search all halfspaces for the initial simplex - QGn - print intersection if visible to halfspace n, -n for not - QVn - print intersections for halfspace n, -n if not - -Trace options: - T4 - trace at level n, 4=all, 5=mem/gauss, -1= events - Tc - check frequently during execution - Ts - print statistics - Tv - verify result: structure, convexity, and redundancy - Tz - send all output to stdout - TFn - report summary when n or more facets created - TI file - input data from file, no spaces or single quotes - TO file - output results to file, may be enclosed in single quotes - TPn - turn on tracing when halfspace n added to intersection - TMn - turn on tracing at merge n - TWn - trace merge facets when width > n - TVn - stop qhull after adding halfspace n, -n for before (see TCn) - TCn - stop qhull after building cone for halfspace n (see TVn) - -Precision options: - Cn - radius of centrum (roundoff added). Merge facets if non-convex - An - cosine of maximum angle. Merge facets if cosine > n or non-convex - C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge - Rn - randomly perturb computations by a factor of [1-n,1+n] - Un - max distance below plane for a new, coplanar halfspace - Wn - min facet width for outside halfspace (before roundoff) - -Output formats (may be combined; if none, produces a summary to stdout): - f - facet dump - G - Geomview output (dual convex hull) - i - non-redundant halfspaces incident to each intersection - m - Mathematica output (dual convex hull) - o - OFF format (dual convex hull: dimension, points, and facets) - p - vertex coordinates of dual convex hull (coplanars if 'Qc' or 'Qi') - s - summary (stderr) - -More formats: - Fc - count plus redundant halfspaces for each intersection - - Qc (default) for coplanar and Qi for other redundant - Fd - use cdd format for input (homogeneous with offset first) - FF - facet dump without ridges - FI - ID of each intersection - Fm - merge count for each intersection (511 max) - FM - Maple output (dual convex hull) - Fn - count plus neighboring intersections for each intersection - FN - count plus intersections for each non-redundant halfspace - FO - options and precision constants - Fp - dim, count, and intersection coordinates - FP - nearest halfspace and distance for each redundant halfspace - FQ - command used for qhalf - Fs - summary: #int (8), dim, #halfspaces, #non-redundant, #intersections - for output: #non-redundant, #intersections, #coplanar - halfspaces, #non-simplicial intersections - #real (2), max outer plane, min vertex - Fv - count plus non-redundant halfspaces for each intersection - Fx - non-redundant halfspaces - -Geomview output (2-d, 3-d and 4-d; dual convex hull) - Ga - all points (i.e., transformed halfspaces) as dots - Gp - coplanar points and vertices as radii - Gv - vertices (i.e., non-redundant halfspaces) as spheres - Gi - inner planes (i.e., halfspace intersections) only - Gn - no planes - Go - outer planes only - Gc - centrums - Gh - hyperplane intersections - Gr - ridges - GDn - drop dimension n in 3-d and 4-d output - -Print options: - PAn - keep n largest facets (i.e., intersections) by area - Pdk:n- drop facet if normal[k] <= n (default 0.0) - PDk:n- drop facet if normal[k] >= n - Pg - print good facets (needs 'QGn' or 'QVn') - PFn - keep facets whose area is at least n - PG - print neighbors of good facets - PMn - keep n facets with most merges - Po - force output. If error, output neighborhood of facet - Pp - do not report precision problems - - . - list of all options - - - one line descriptions of all options -qhalf . - -Qhull 2012.1 2012/01/22. -Except for 'F.' and 'PG', upper_case options take an argument. - - incidences Geomview mathematica OFF_format point_dual - summary facet_dump - - Fc_redundant Fd_cdd_in FF_dump_xridge FIDs Fmerges - Fneighbors FN_intersect FOptions Fp_coordinates FP_nearest - FQhalf Fsummary Fv_halfspace FMaple Fx_non_redundant - - Gvertices Gpoints Gall_points Gno_planes Ginner - Gcentrums Ghyperplanes Gridges Gouter GDrop_dim - - PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep - PGood_neighbors PMerge_keep Poutput_forced Pprecision_not - - Qbk:0Bk:0_drop Qcoplanar QG_half_good Qi_redundant QJoggle - Qsearch_1st Qtriangulate QVertex_good - - T4_trace Tcheck_often Tstatistics Tverify Tz_stdout - TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file - TWide_trace TVertex_stop TCone_stop - - Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside -qhalf - -qhalf- halfspace intersection about a point. Qhull 2012.1 2012/01/22 - input (stdin): [dim, 1, interior point], dim+1, n, coefficients+offset - comments start with a non-numeric character - -options (qhalf.htm): - Hn,n - specify coordinates of interior point - Qt - triangulated output - QJ - joggled input instead of merged facets - Tv - verify result: structure, convexity, and redundancy - . - concise list of all options - - - one-line description of all options - -output options (subset): - s - summary of results (default) - Fp - intersection coordinates - Fv - non-redundant halfspaces incident to each intersection - Fx - non-redundant halfspaces - o - OFF file format (dual convex hull) - G - Geomview output (dual convex hull) - m - Mathematica output (dual convex hull) - QVn - print intersections for halfspace n, -n if not - TO file - output results to file, may be enclosed in single quotes - -examples: - rbox d | qconvex FQ n | qhalf s H0,0,0 Fp - rbox c | qconvex FQ FV n | qhalf s i - rbox c | qconvex FQ FV n | qhalf s o - -rbox d | qhull FQ n | qhalf s Qt H0,0,0 Fp -3 -12 - 0 0 0.5 - 0 0 0.5 - 0 0.5 0 - 0 0.5 0 - -0.5 0 0 - -0.5 0 0 - 0.5 0 0 - 0.5 0 0 - 0 -0.5 0 - 0 -0.5 0 - 0 0 -0.5 - 0 0 -0.5 - -Halfspace intersection by the convex hull of 8 points in 3-d: - - Number of halfspaces: 8 - Number of non-redundant halfspaces: 8 - Number of intersection points: 12 - Number of triangulated facets: 6 - -Statistics for: rbox d | qhull FQ n | qhalf s Qt H0,0,0 Fp - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 33 - Number of distance tests for merging: 119 - Number of distance tests for checking: 56 - Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 - -rbox c | qhull FQ FV n | qhalf s i -8 -4 5 3 -5 4 2 -0 4 3 -4 0 2 -1 5 2 -5 1 3 -1 0 3 -0 1 2 - -Halfspace intersection by the convex hull of 6 points in 3-d: - - Number of halfspaces: 6 - Number of non-redundant halfspaces: 6 - Number of intersection points: 8 - -Statistics for: rbox c | qhull FQ FV n | qhalf s i - - Number of points processed: 6 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 11 - Number of distance tests for merging: 45 - Number of distance tests for checking: 54 - Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 - -rbox c | qhull FQ FV n | qhalf o -3 -6 8 12 - -0 -0 -2 - 0 -2 0 - 2 -0 -0 - -2 -0 -0 - 0 2 -0 - -0 -0 2 -3 4 5 3 -3 5 4 2 -3 0 4 3 -3 4 0 2 -3 1 5 2 -3 5 1 3 -3 1 0 3 -3 0 1 2 -rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx -4 -0 -0 -0 -0 -0 -4 -2 1 2 -2 0 3 -2 0 3 -2 1 2 -4 -2 0 1 -2 0 2 -2 1 3 -2 2 3 -rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx -4 -2 1 0 -2 2 0 -2 3 1 -2 3 2 -4 -1 -0 -2 -3 - -Halfspace intersection by the convex hull of 4 points in 2-d: - - Number of halfspaces: 4 - Number of non-redundant halfspaces: 4 - Number of intersection points: 4 - -Statistics for: rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 6 - CPU seconds to compute hull (after input): 0 - -echo === check quality of Qhull for ${d:-`hostname`} ${d:-`date`} -hostname -date -=== check quality of Qhull for ispy Tue Jan 24 20:16:44 EST 2012 -rbox 1000 W0 | qhull QR2 QJ s Fs Tv -10 3 1000 144 284 144 284 0 0 33 0 -2 5.045982607091333e-011 -5.045982607091333e-011 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 144 - Number of facets: 284 - -Statistics for: rbox 1000 W0 | qhull QR2 QJ s Fs Tv QR2 - - Number of points processed: 171 - Number of hyperplanes created: 1233 - Number of distance tests for qhull: 33562 - CPU seconds to compute hull (after input): 0 - After 1 retries, input joggled by: 2.9e-011 - - -Output completed. Verifying that all points are below 2.9e-015 of -all facets. Will make 284000 distance computations. -rbox 1000 W0 | qhull QR2 s Fs Tv -10 3 1000 84 98 84 98 0 6 13 0 -2 1.942124858599573e-015 -1.241679291552168e-015 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 84 - Number of facets: 98 - Number of non-simplicial facets: 6 - -Statistics for: rbox 1000 W0 | qhull QR2 s Fs Tv QR2 - - Number of points processed: 97 - Number of hyperplanes created: 299 - Number of distance tests for qhull: 18051 - Number of distance tests for merging: 3325 - Number of distance tests for checking: 15397 - Number of merged facets: 92 - CPU seconds to compute hull (after input): 0.015 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 98000 distance computations. -rbox 1000 s | qhull C0.02 Qc Tv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 114 - Number of coplanar points: 886 - Number of facets: 60 - Number of non-simplicial facets: 60 - -Statistics for: rbox 1000 s | qhull C0.02 Qc Tv - - Number of points processed: 1000 - Number of hyperplanes created: 5545 - Number of distance tests for qhull: 83858 - Number of distance tests for merging: 82226 - Number of distance tests for checking: 7929 - Number of merged facets: 1936 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of vertex below facet: -0.072 (1.2x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 60000 distance computations. -rbox 500 s D4 | qhull C0.01 Qc Tv - -Convex hull of 500 points in 4-d: - - Number of vertices: 467 - Number of coplanar points: 33 - Number of facets: 357 - Number of non-simplicial facets: 343 - -Statistics for: rbox 500 s D4 | qhull C0.01 Qc Tv - - Number of points processed: 500 - Number of hyperplanes created: 11284 - Number of distance tests for qhull: 41395 - Number of distance tests for merging: 162691 - Number of distance tests for checking: 20813 - Number of merged facets: 2809 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of vertex below facet: -0.073 (1.8x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 178500 distance computations. -rbox 1000 s | qhull C-0.02 Qc Tv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 47 - Number of coplanar points: 953 - Number of facets: 47 - Number of non-simplicial facets: 35 - -Statistics for: rbox 1000 s | qhull C-0.02 Qc Tv - - Number of points processed: 50 - Number of hyperplanes created: 199 - Number of distance tests for qhull: 52519 - Number of distance tests for merging: 2966 - Number of distance tests for checking: 24231 - Number of merged facets: 98 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.065 (1.1x) - Maximum distance of vertex below facet: -0.062 (1.0x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 47000 distance computations. -rbox 1000 s D4 | qhull C-0.01 Qc Tv - -Convex hull of 1000 points in 4-d: - - Number of vertices: 117 - Number of coplanar points: 883 - Number of facets: 232 - Number of non-simplicial facets: 149 - -Statistics for: rbox 1000 s D4 | qhull C-0.01 Qc Tv - - Number of points processed: 117 - Number of hyperplanes created: 1232 - Number of distance tests for qhull: 372627 - Number of distance tests for merging: 31334 - Number of distance tests for checking: 122166 - Number of merged facets: 1167 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of point above facet: 0.062 (1.5x) - Maximum distance of vertex below facet: -0.064 (1.6x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 232000 distance computations. -rbox 200 s D5 | qhull C-0.01 Qx Qc Tv - -Convex hull of 200 points in 5-d: - - Number of vertices: 160 - Number of coplanar points: 40 - Number of facets: 388 - Number of non-simplicial facets: 342 - -Statistics for: rbox 200 s D5 | qhull C-0.01 Qx Qc Tv - - Number of points processed: 160 - Number of hyperplanes created: 4522 - Number of distance tests for qhull: 235312 - Number of distance tests for merging: 143132 - Number of distance tests for checking: 46266 - Number of merged facets: 5940 - CPU seconds to compute hull (after input): 0.062 - Maximum distance of point above facet: 0.059 (1.2x) - Maximum distance of vertex below facet: -0.11 (2.1x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 77600 distance computations. -rbox 100 s D6 | qhull C-0.001 Qx Qc Tv - -Convex hull of 100 points in 6-d: - - Number of vertices: 100 - Number of facets: 4465 - Number of non-simplicial facets: 809 - -Statistics for: rbox 100 s D6 | qhull C-0.001 Qx Qc Tv - - Number of points processed: 100 - Number of hyperplanes created: 20175 - Number of distance tests for qhull: 33383 - Number of distance tests for merging: 299744 - Number of distance tests for checking: 66106 - Number of merged facets: 3948 - CPU seconds to compute hull (after input): 0.125 - Maximum distance of point above facet: 0.0029 (0.5x) - Maximum distance of vertex below facet: -0.014 (2.4x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 446500 distance computations. -rbox 1000 W1e-4 | qhull C-1e-6 Qc Tv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 144 - Number of coplanar points: 75 - Number of facets: 243 - Number of non-simplicial facets: 26 - -Statistics for: rbox 1000 W1e-4 | qhull C-1e-6 Qc Tv - - Number of points processed: 185 - Number of hyperplanes created: 939 - Number of distance tests for qhull: 42000 - Number of distance tests for merging: 8652 - Number of distance tests for checking: 5684 - Number of merged facets: 145 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 1.3e-006 (0.4x) - Maximum distance of vertex below facet: -3.2e-006 (1.1x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 243000 distance computations. -rbox 1000 W5e-4 D4 | qhull C-1e-5 Qc Tv - -Convex hull of 1000 points in 4-d: - - Number of vertices: 290 - Number of coplanar points: 433 - Number of facets: 1296 - Number of non-simplicial facets: 154 - -Statistics for: rbox 1000 W5e-4 D4 | qhull C-1e-5 Qc Tv - - Number of points processed: 368 - Number of hyperplanes created: 6238 - Number of distance tests for qhull: 182095 - Number of distance tests for merging: 75580 - Number of distance tests for checking: 52937 - Number of merged facets: 1353 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of point above facet: 9.1e-005 (2.3x) - Maximum distance of vertex below facet: -0.00012 (2.9x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1296000 distance computations. -rbox 400 W1e-3 D5 | qhull C-1e-5 Qx Qc Tv - -Convex hull of 400 points in 5-d: - - Number of vertices: 305 - Number of coplanar points: 35 - Number of facets: 5552 - Number of non-simplicial facets: 281 - -Statistics for: rbox 400 W1e-3 D5 | qhull C-1e-5 Qx Qc Tv - - Number of points processed: 336 - Number of hyperplanes created: 24527 - Number of distance tests for qhull: 251847 - Number of distance tests for merging: 277585 - Number of distance tests for checking: 61531 - Number of merged facets: 1482 - CPU seconds to compute hull (after input): 0.093 - Maximum distance of point above facet: 5.5e-005 (1.1x) - Maximum distance of vertex below facet: -0.0001 (2.1x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 2220800 distance computations. -echo === check input format etc. ${d:-`date`} -date -=== check input format etc. Tue Jan 24 20:16:45 EST 2012 -qhull <count): 16->1 24->13 88->4 - - size in bytes: merge 24 ridge 16 vertex 24 facet 88 - normal 24 ridge vertices 16 facet vertices or neighbors 20 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 142000 distance computations. -rbox 100 D3 | qhull T8 Tz TO q_test.log.1 -tail -n -10 q_test.log.1 -qh_mem 00450170 n 1022 free short: 88 bytes (tot 8984 cnt 228) -qh_mem 004501C8 n 1023 free short: 88 bytes (tot 8896 cnt 227) -qh_mem 00450220 n 1024 free short: 88 bytes (tot 8808 cnt 226) -qh_mem 00450278 n 1025 free short: 88 bytes (tot 8720 cnt 225) -qh_mem 00362CC8 n 30 free long: 96 bytes (tot 0 cnt 0) -qh_mem 004502D0 n 1026 free short: 16 bytes (tot 8704 cnt 224) -qh_mem 00450050 n 1027 free short: 88 bytes (tot 8616 cnt 223) -qh_mem 004500A8 n 1028 free short: 88 bytes (tot 8528 cnt 222) -qh_mem 00450100 n 1029 free short: 88 bytes (tot 8440 cnt 221) -qh_freebuffers: finished -rm q_test.log.1 -rbox 100 s D3 | qhull TcvV-2 - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 78 - Number of facets: 152 - -Statistics for: rbox 100 s D3 | qhull TcvV-2 - - Number of points processed: 78 - Number of hyperplanes created: 390 - Number of distance tests for qhull: 1489 - CPU seconds to compute hull (after input): 0 - -rbox 100 s D3 | qhull TcvC2 - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 79 - Number of facets: 154 - -Statistics for: rbox 100 s D3 | qhull TcvC2 - - Number of points processed: 79 - Number of hyperplanes created: 395 - Number of distance tests for qhull: 1496 - CPU seconds to compute hull (after input): 0 - -rbox 100 s D3 | qhull TcvV2 - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 79 - Number of facets: 154 - -Statistics for: rbox 100 s D3 | qhull TcvV2 - - Number of points processed: 79 - Number of hyperplanes created: 395 - Number of distance tests for qhull: 1496 - CPU seconds to compute hull (after input): 0 - -rbox 100 s D3 | qhull T1cvV2P2 - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 79 - Number of facets: 154 - -Statistics for: rbox 100 s D3 | qhull T1cvV2P2 - - Number of points processed: 79 - Number of hyperplanes created: 395 - Number of distance tests for qhull: 1496 - CPU seconds to compute hull (after input): 0 - -qh_readpoints: read in 100 3-dimensional points -qh_initqhull_globals: for rbox 100 s D3 | qhull T1cvV2P2 - -Trace level 1 for rbox 100 s D3 | qhull T1cvV2P2 -Options selected for Qhull 2012.1 2012/01/22: - run-id 315332402 Tcheck-frequently Tverify TV-stop-after-point 2 - Trace-point 2 _pre-merge _zero-centrum _max-width 0.94 - Error-roundoff 6.7e-016 _one-merge 4.7e-015 _near-inside 2.3e-014 - Visible-distance 1.3e-015 U-coplanar-distance 1.3e-015 - Width-outside 2.7e-015 _wide-facet 8.1e-015 -qh_findbest: point p2 starting at f7 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p41. Last merge was #0. max_outside 5.6e-017 -qh_findbest: point p2 starting at f15 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p52. Last merge was #0. max_outside 1.1e-016 -qh_findbest: point p2 starting at f37 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p73. Last merge was #0. max_outside 1.1e-016 -qh_findbest: point p2 starting at f52 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p87. Last merge was #0. max_outside 1.1e-016 -qh_findbest: point p2 starting at f72 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p76. Last merge was #0. max_outside 1.1e-016 -qh_findbest: point p2 starting at f120 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p84. Last merge was #0. max_outside 1.7e-016 -qh_findbest: point p2 starting at f211 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p10. Last merge was #0. max_outside 1.7e-016 -qh_findbest: point p2 starting at f289 isnewfacets? 1, unless 0 exit if > 2.7e-015 - testhorizon? 1 noupper? 0 Last point added was p6. Last merge was #0. max_outside 1.7e-016 -qh_addpoint: add p2(v79) to hull of 152 facets(0.014 above f288) and 22 outside at 0 CPU secs. Previous was p56. -qh_findhorizon: find horizon for point p2 facet f288 -qh_findhorizon: 5 horizon facets(good 5), 3 visible(good 3), 0 coplanar -qh_makenewfacets: created 5 new facets from point p2 to horizon -qh_matchnewfacets: match neighbors for new facets. -qh_partitionvisible: partitioned 0 points from outsidesets and 0 points from coplanarsets -qh_deletevisible: delete 3 visible facets and 0 vertices -qh_checkpolygon: check all facets from f390 -qh_buildhull: completed the hull construction -Qhull: algorithm completed -qh_checkpolygon: check all facets from f62 -qh_checkconvex: check all ridges are convex -qh_freeqhull2: free global memory -qh_freebuild: free memory from qh_inithull and qh_buildhull -rbox 100 s D3 | qhull TcvF100 - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox 100 s D3 | qhull TcvF100 - - Number of points processed: 100 - Number of hyperplanes created: 514 - Number of distance tests for qhull: 1691 - CPU seconds to compute hull (after input): 0 - - -At 20:16:52 & 0 CPU secs, qhull has created 102 facets and merged 0. - The current hull contains 46 facets and 25 vertices. There are 75 - outside points. Next is point p55(v26), 0.035 above f44. - -At 20:16:52 & 0 CPU secs, qhull has created 203 facets and merged 0. - The current hull contains 86 facets and 45 vertices. There are 55 - outside points. Next is point p82(v46), 0.067 above f117. - -At 20:16:52 & 0 CPU secs, qhull has created 306 facets and merged 0. - The current hull contains 122 facets and 63 vertices. There are 37 - outside points. Next is point p50(v64), 0.042 above f218. - -At 20:16:52 & 0 CPU secs, qhull has created 412 facets and merged 0. - The current hull contains 160 facets and 82 vertices. There are 18 - outside points. Next is point p60(v83), 0.031 above f307. - -Output completed. Verifying that all points are below 2e-015 of -all facets. Will make 19600 distance computations. -rbox 100 s D3 | qhull Qf Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox 100 s D3 | qhull Qf Tcv - - Number of points processed: 100 - Number of hyperplanes created: 504 - Number of distance tests for qhull: 4423 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 2e-015 of -all facets. Will make 19600 distance computations. -rbox 100 D3 | qhull Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 26 - Number of facets: 48 - -Statistics for: rbox 100 D3 | qhull Tcv - - Number of points processed: 28 - Number of hyperplanes created: 110 - Number of distance tests for qhull: 1164 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4800 distance computations. -rbox 100 D3 | qhull Qs Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 26 - Number of facets: 48 - -Statistics for: rbox 100 D3 | qhull Qs Tcv - - Number of points processed: 29 - Number of hyperplanes created: 105 - Number of distance tests for qhull: 1176 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4800 distance computations. -rbox 100 D5 | qhull Qs Tcv - -Convex hull of 100 points in 5-d: - - Number of vertices: 78 - Number of facets: 1174 - -Statistics for: rbox 100 D5 | qhull Qs Tcv - - Number of points processed: 85 - Number of hyperplanes created: 4015 - Number of distance tests for qhull: 8584 - CPU seconds to compute hull (after input): 0 - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 117400 distance computations. -rbox 100 D3 | qhull Qr Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 26 - Number of facets: 48 - -Statistics for: rbox 100 D3 | qhull Qr Tcv - - Number of points processed: 56 - Number of hyperplanes created: 294 - Number of distance tests for qhull: 2129 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4800 distance computations. -rbox 100 D3 | qhull Qxv Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 26 - Number of facets: 48 - -Statistics for: rbox 100 D3 | qhull Qxv Tcv - - Number of points processed: 28 - Number of hyperplanes created: 110 - Number of distance tests for qhull: 1164 - CPU seconds to compute hull (after input): 0 - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4800 distance computations. -rbox 100 D3 | qhull Qi f Pd0 Pd1 Pd2 Tcv -Vertices and facets: -- p11(v14): -0.31 0.47 0.07 -- p59(v8): 0.44 0.42 -0.11 -- p33(v2): -0.067 0.49 -0.11 -- p48(v25): 0.25 0.24 0.44 -- p37(v15): 0.45 0.26 0.04 -- p38(v5): 0.42 -0.25 0.42 -- f42 - - flags: bottom simplicial - - normal: 0.1292 0.9495 0.2858 - - offset: -0.4221543 - - coplanar set(furthest p70): - p70: 0.04762 0.3507 -0.06712 - furthest distance= -0.1 - - vertices: p11(v14) p59(v8) p33(v2) - - neighboring facets: f52 f41 f93 -- f93 - - flags: top simplicial - - normal: 0.142 0.9273 0.3463 - - offset: -0.4120445 - - coplanar set(furthest p28): - p27: 0.1182 0.3419 0.068 - p25: 0.1663 0.2352 0.3516 - p15: 0.2743 0.2665 0.07375 - p44: -0.1321 0.3861 0.167 - p28: -0.1003 0.4263 0.07335 - furthest distance= -0.0056 - - vertices: p48(v25) p11(v14) p59(v8) - - neighboring facets: f42 f94 f95 -- f94 - - flags: bottom simplicial - - normal: 0.7783 0.4631 0.4241 - - offset: -0.4905394 - - vertices: p48(v25) p37(v15) p59(v8) - - neighboring facets: f47 f93 f97 -- f97 - - flags: top simplicial - - normal: 0.8488 0.2736 0.4523 - - offset: -0.4744876 - - vertices: p48(v25) p37(v15) p38(v5) - - neighboring facets: f46 f99 f94 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 400 distance computations. -rbox c d | qhull Qc f Tcv -Vertices and facets: -- p6(v6): 0.5 0.5 -0.5 - neighbors: f1 f9 f10 -- p2(v2): -0.5 0.5 -0.5 - neighbors: f1 f3 f10 -- p4(v1): 0.5 -0.5 -0.5 - neighbors: f1 f2 f9 -- p0(v0): -0.5 -0.5 -0.5 - neighbors: f1 f2 f3 -- p5(v7): 0.5 -0.5 0.5 - neighbors: f2 f9 f13 -- p1(v3): -0.5 -0.5 0.5 - neighbors: f2 f3 f13 -- p7(v5): 0.5 0.5 0.5 - neighbors: f9 f10 f13 -- p3(v8): -0.5 0.5 0.5 - neighbors: f3 f10 f13 -- f1 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0 -0 -1 - - offset: -0.5 - - center: 0 0 -0.5 - - coplanar set(furthest p8): - p8: 0 0 -0.5 - furthest distance= 0 - - vertices: p6(v6) p2(v2) p4(v1) p0(v0) - - neighboring facets: f2 f3 f9 f10 - - ridges: - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 - - r3 tested - vertices: p4(v1) p0(v0) - between f2 and f1 - - r1 tested - vertices: p6(v6) p4(v1) - between f9 and f1 - - r2 tested - vertices: p6(v6) p2(v2) - between f1 and f10 -- f2 - - flags: top tested seen coplanar - - merges: 1 - - normal: 0 -1 0 - - offset: -0.5 - - center: 0 -0.5 0 - - coplanar set(furthest p10): - p10: 0 -0.5 0 - furthest distance= 0 - - vertices: p5(v7) p1(v3) p4(v1) p0(v0) - - neighboring facets: f1 f3 f9 f13 - - ridges: - - r3 tested - vertices: p4(v1) p0(v0) - between f2 and f1 - - r8 tested - vertices: p1(v3) p0(v0) - between f3 and f2 - - r7 tested - vertices: p5(v7) p1(v3) - between f13 and f2 - - r6 tested - vertices: p5(v7) p4(v1) - between f2 and f9 -- f9 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: 1 -0 -0 - - offset: -0.5 - - center: 0.5 0 0 - - coplanar set(furthest p13): - p13: 0.5 0 0 - furthest distance= 0 - - vertices: p5(v7) p6(v6) p7(v5) p4(v1) - - neighboring facets: f2 f1 f10 f13 - - ridges: - - r1 tested - vertices: p6(v6) p4(v1) - between f9 and f1 - - r6 tested - vertices: p5(v7) p4(v1) - between f2 and f9 - - r10 tested - vertices: p5(v7) p7(v5) - between f9 and f13 - - r11 tested - vertices: p6(v6) p7(v5) - between f10 and f9 -- f3 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -1 -0 -0 - - offset: -0.5 - - center: -0.5 0 0 - - coplanar set(furthest p12): - p12: -0.5 0 0 - furthest distance= 0 - - vertices: p3(v8) p1(v3) p2(v2) p0(v0) - - neighboring facets: f1 f2 f10 f13 - - ridges: - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 - - r13 tested - vertices: p3(v8) p2(v2) - between f10 and f3 - - r14 tested - vertices: p3(v8) p1(v3) - between f3 and f13 - - r8 tested - vertices: p1(v3) p0(v0) - between f3 and f2 -- f10 - - flags: top tested seen coplanar - - merges: 1 - - normal: 0 1 -0 - - offset: -0.5 - - center: 0 0.5 0 - - coplanar set(furthest p11): - p11: 0 0.5 0 - furthest distance= 0 - - vertices: p3(v8) p6(v6) p7(v5) p2(v2) - - neighboring facets: f3 f1 f9 f13 - - ridges: - - r2 tested - vertices: p6(v6) p2(v2) - between f1 and f10 - - r11 tested - vertices: p6(v6) p7(v5) - between f10 and f9 - - r16 tested - vertices: p3(v8) p7(v5) - between f13 and f10 - - r13 tested - vertices: p3(v8) p2(v2) - between f10 and f3 -- f13 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0 -0 1 - - offset: -0.5 - - center: 0 0 0.5 - - coplanar set(furthest p9): - p9: 0 0 0.5 - furthest distance= 0 - - vertices: p3(v8) p5(v7) p7(v5) p1(v3) - - neighboring facets: f10 f2 f9 f3 - - ridges: - - r7 tested - vertices: p5(v7) p1(v3) - between f13 and f2 - - r14 tested - vertices: p3(v8) p1(v3) - between f3 and f13 - - r16 tested - vertices: p3(v8) p7(v5) - between f13 and f10 - - r10 tested - vertices: p5(v7) p7(v5) - between f9 and f13 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 84 distance computations. -rbox c d | qhull Qc p Tcv -3 -14 - -0.5 -0.5 -0.5 - -0.5 -0.5 0.5 - -0.5 0.5 -0.5 - -0.5 0.5 0.5 - 0.5 -0.5 -0.5 - 0.5 -0.5 0.5 - 0.5 0.5 -0.5 - 0.5 0.5 0.5 - 0 0 -0.5 - 0 0 0.5 - 0 -0.5 0 - 0 0.5 0 - -0.5 0 0 - 0.5 0 0 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 84 distance computations. -rbox 100 D3 | qhull QbB FO Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 26 - Number of facets: 48 - -Statistics for: rbox 100 D3 | qhull QbB FO Tcv - - Number of points processed: 28 - Number of hyperplanes created: 110 - Number of distance tests for qhull: 1164 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315332402 QbBound-unit-box 0.5 Tcheck-frequently Tverify - _pre-merge _zero-centrum _max-width 1 Error-roundoff 6.9e-016 - _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 - U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4800 distance computations. -rbox 1000 D2 B1e6 | qhull d Qbb FO Tcv - -Delaunay triangulation by the convex hull of 1000 points in 3-d: - - Number of input sites: 1000 - Number of Delaunay regions: 1982 - -Statistics for: rbox 1000 D2 B1e6 | qhull d Qbb FO Tcv - - Number of points processed: 1000 - Number of hyperplanes created: 5422 - Number of facets in hull: 1996 - Number of distance tests for qhull: 27767 - CPU seconds to compute hull (after input): 0.015 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315332402 delaunay Qbbound-last Tcheck-frequently Tverify - _pre-merge _zero-centrum Pgood _max-width 2e+006 Error-roundoff 2.8e-009 - _one-merge 1.9e-008 _near-inside 9.7e-008 Visible-distance 5.5e-009 - U-coplanar-distance 5.5e-009 Width-outside 1.1e-008 _wide-facet 3.3e-008 - -qhull output completed. Verifying that 1000 points are -below 8.3e-009 of the nearest facet. -rbox 10 D3 | qhull QbB p Tcv -3 -9 --0.08928142660407056 -0.3194671263098747 0.3605569202297553 --0.1534778158747162 0.03516440701453921 0.5 --0.01663016790622804 0.3709299907861695 0.0764863283135003 -0.3932651765570926 0.4421392241401818 -0.09396622763110282 -0.199424728304684 0.5 0.06620718432588452 --0.2331094527352667 0.3262436269787957 -0.1289660986727641 - -0.5 0.2819439085196089 -0.5 -0.4999999999999999 0.3760666748352666 0.1399187075693636 -0.4888102268053206 -0.5 -0.2153953634886358 - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 140 distance computations. -rbox 10 D3 | qhull Qbb p Tcv -3 -9 --0.0222149361131852 -0.366434993563625 0.5972263834933854 --0.06676722137887703 -0.1566931052661437 0.6939998615477234 -0.02820502736438535 0.04189077954915421 0.4000814320337247 -0.3126723396709863 0.08400649026409401 0.2817873818077145 -0.1781470954214661 0.1182274414396169 0.3929477075294902 --0.1220315663349177 0.01546165115708642 0.2574974761506134 --0.3072535691850387 -0.01073880122111998 0 -0.3867462923626847 0.04492879989084675 0.4441034944549365 -0.3789805913148268 -0.4732086509216658 0.1975155783347269 -QH7040 qhull input warning: option 'Qbb' (scale-last-coordinate) is normally used with 'd' or 'v' - -Output completed. Verifying that all points are below 2.9e-015 of -all facets. Will make 140 distance computations. -rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv -3 -9 --5.733970380575339 -0.366434993563625 17.14322461142018 --6.400761988815289 -0.1566931052661437 20 --4.97936018866004 0.04189077954915421 11.32346018178494 --0.7218812392989191 0.08400649026409401 7.831392539952951 --2.735252796494545 0.1182274414396169 11.11287098934976 --7.227875597731384 0.01546165115708642 7.114348923589699 - -10 -0.01073880122111998 -0.4870359524963758 -0.3867462923626847 0.04492879989084675 12.62300161615219 -0.2705209571204694 -0.4732086509216658 5.343669467959106 - -Output completed. Verifying that all points are below 7.5e-014 of -all facets. Will make 140 distance computations. -rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv | qhull QbB p Tcv - -Output completed. Verifying that all points are below 7.5e-014 of -all facets. Will make 140 distance computations. -3 -9 --0.08928142660407051 -0.3194671263098747 0.3605569202297555 --0.1534778158747163 0.03516440701453921 0.5 --0.01663016790622796 0.3709299907861695 0.07648632831350066 -0.3932651765570927 0.4421392241401818 -0.09396622763110274 -0.1994247283046841 0.5 0.06620718432588446 --0.2331094527352668 0.3262436269787957 -0.128966098672764 - -0.5 0.2819439085196089 -0.4999999999999999 - 0.5 0.3760666748352666 0.1399187075693635 -0.4888102268053207 -0.5 -0.2153953634886357 - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 126 distance computations. -rbox 10 D3 | qhull Qb1:0B1:0 d Tcv Q8 - -Delaunay triangulation by the convex hull of 10 points in 3-d: - - Number of input sites: 10 - Number of Delaunay regions: 14 - -Statistics for: rbox 10 D3 | qhull Qb1:0B1:0 d Tcv Q8 - - Number of points processed: 10 - Number of hyperplanes created: 32 - Number of facets in hull: 16 - Number of distance tests for qhull: 62 - CPU seconds to compute hull (after input): 0 - -QH7077 qhull input warning: no outer plane check ('Q5') or no processing of -near-inside points ('Q8'). Verify may report that a point is outside -of a facet. - -Output completed. Verifying that all points are below 2e-015 of -all facets. Will make 140 distance computations. -rbox 10 D3 | qhull Qb1:0B1:0B2:0 d Tcv Q8 - -Delaunay triangulation by the convex hull of 10 points in 3-d: - - Number of input sites: 10 - Number of Delaunay regions: 14 - -Statistics for: rbox 10 D3 | qhull Qb1:0B1:0B2:0 d Tcv Q8 - - Number of points processed: 10 - Number of hyperplanes created: 32 - Number of facets in hull: 16 - Number of distance tests for qhull: 62 - CPU seconds to compute hull (after input): 0 - -QH7077 qhull input warning: no outer plane check ('Q5') or no processing of -near-inside points ('Q8'). Verify may report that a point is outside -of a facet. - -Output completed. Verifying that all points are below 2e-015 of -all facets. Will make 140 distance computations. -rbox 10 D3 | qhull Qb1:0 d Tcv - -Delaunay triangulation by the convex hull of 10 points in 4-d: - - Number of input sites: 10 - Number of Delaunay regions: 18 - -Statistics for: rbox 10 D3 | qhull Qb1:0 d Tcv - - Number of points processed: 10 - Number of hyperplanes created: 44 - Number of facets in hull: 27 - Number of distance tests for qhull: 67 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 2.9e-015 of -all facets. Will make 180 distance computations. -rbox 10 D3 | qhull Qb1:0B1:0 Tcv - -Convex hull of 10 points in 2-d: - - Number of vertices: 4 - Number of facets: 4 - -Statistics for: rbox 10 D3 | qhull Qb1:0B1:0 Tcv - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 49 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 1.3e-015 of -all facets. Will make 40 distance computations. -echo "== next command will error ${d:-`date`} ==" -date -== next command will error Tue Jan 24 20:16:53 EST 2012 == -rbox 10 D2 | qhull Qb1:1B1:1 Tcv -QH6154 qhull precision error: initial facet 1 is coplanar with the interior point -ERRONEOUS FACET: -- f1 - - flags: bottom simplicial flipped - - normal: 0 1 - - offset: -1 - - vertices: p4(v1) p1(v0) - - neighboring facets: f2 f3 - -While executing: rbox 10 D2 | qhull Qb1:1B1:1 Tcv -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Qbound-dim-low 1 1 QBound-dim-high 1 1 - Tcheck-frequently Tverify _pre-merge _zero-centrum _max-width 0.81 - Error-roundoff 8.6e-016 _one-merge 4.3e-015 _near-inside 2.1e-014 - Visible-distance 1.7e-015 U-coplanar-distance 1.7e-015 - Width-outside 3.4e-015 _wide-facet 1e-014 - -precision problems (corrected unless 'Q0' or an error) - 2 flipped facets - -The input to qhull appears to be less than 2 dimensional, or a -computation has overflowed. - -Qhull could not construct a clearly convex simplex from points: -- p0(v2): -0.022 1 -- p4(v1): 0.38 1 -- p1(v0): -0.43 1 - -The center point is coplanar with a facet, or a vertex is coplanar -with a neighboring facet. The maximum round off error for -computing distances is 8.6e-016. The center point, facets and distances -to the center point are as follows: - -center point -0.02391 1 - -facet p4 p1 distance= 0 -facet p0 p1 distance= 0 -facet p0 p4 distance= 0 - -These points either have a maximum or minimum x-coordinate, or -they maximize the determinant for k coordinates. Trial points -are first selected from points that maximize a coordinate. - -The min and max coordinates for each dimension are: - 0: -0.4285 0.379 difference= 0.8076 - 1: 1 1 difference= 0 - -If the input should be full dimensional, you have several options that -may determine an initial simplex: - - use 'QJ' to joggle the input and make it full dimensional - - use 'QbB' to scale the points to the unit cube - - use 'QR0' to randomly rotate the input for different maximum points - - use 'Qs' to search all points for the initial simplex - - use 'En' to specify a maximum roundoff error less than 8.6e-016. - - trace execution with 'T3' to see the determinant for each point. - -If the input is lower dimensional: - - use 'QJ' to joggle the input and make it full dimensional - - use 'Qbk:0Bk:0' to delete coordinate k from the input. You should - pick the coordinate with the least range. The hull will have the - correct topology. - - determine the flat containing the points, rotate the points - into a coordinate plane, and delete the other coordinates. - - add one or more points to make the input full dimensional. -rbox 200 L20 D2 t | qhull FO Tcv C-0 - -Convex hull of 200 points in 2-d: - - Number of vertices: 200 - Number of facets: 200 - -Statistics for: rbox 200 L20 D2 t1327454213 | qhull FO Tcv C-0 - - Number of points processed: 200 - Number of hyperplanes created: 398 - Number of distance tests for qhull: 2125 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Tcheck-frequently Tverify Centrum-premerge- 0 - _zero-centrum _max-width 1 Error-roundoff 3.4e-016 _one-merge 1.7e-015 - _near-inside 8.5e-015 Visible-distance 6.8e-016 - U-coplanar-distance 6.8e-016 Width-outside 1.4e-015 _wide-facet 4.1e-015 - -Output completed. Verifying that all points are below 1e-015 of -all facets. Will make 40000 distance computations. -rbox 1000 L20 t | qhull FO Tcv C-0 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 50 - Number of facets: 96 - -Statistics for: rbox 1000 L20 t1327454213 | qhull FO Tcv C-0 - - Number of points processed: 71 - Number of hyperplanes created: 286 - Number of distance tests for qhull: 13384 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Tcheck-frequently Tverify Centrum-premerge- 0 - _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 - _near-inside 2.4e-014 Visible-distance 1.4e-015 - U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96000 distance computations. -rbox 200 L20 D4 t | qhull FO Tcv C-0 - -Convex hull of 200 points in 4-d: - - Number of vertices: 54 - Number of facets: 243 - -Statistics for: rbox 200 L20 D4 t1327454213 | qhull FO Tcv C-0 - - Number of points processed: 66 - Number of hyperplanes created: 772 - Number of distance tests for qhull: 6317 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Tcheck-frequently Tverify Centrum-premerge- 0 - _zero-centrum _max-width 1 Error-roundoff 1e-015 _one-merge 9.1e-015 - _near-inside 4.5e-014 Visible-distance 6e-015 U-coplanar-distance 6e-015 - Width-outside 1.2e-014 _wide-facet 3.6e-014 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 48600 distance computations. -rbox 200 L20 D5 t | qhull FO Tcv Qx - -Convex hull of 200 points in 5-d: - - Number of vertices: 96 - Number of facets: 1366 - -Statistics for: rbox 200 L20 D5 t1327454213 | qhull FO Tcv Qx - - Number of points processed: 117 - Number of hyperplanes created: 5545 - Number of distance tests for qhull: 21165 - CPU seconds to compute hull (after input): 0.015 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Tcheck-frequently Tverify Qxact-merge _zero-centrum - _max-width 1 Error-roundoff 1.4e-015 _one-merge 1.5e-014 - _near-inside 7.5e-014 Visible-distance 8.2e-015 - U-coplanar-distance 8.2e-015 Width-outside 1.6e-014 _wide-facet 4.9e-014 -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 273200 distance computations. -rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu Q0 - -Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: - - Number of input sites: 1000 - Number of Delaunay regions: 260 - -Statistics for: rbox 1000 W1e-3 s D2 t1327454213 | qhull d FO Tcv Qu Q0 - - Number of points processed: 1000 - Number of hyperplanes created: 4637 - Number of facets in hull: 1996 - Number of distance tests for qhull: 26132 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 delaunay Tcheck-frequently Tverify QupperDelaunay - Q0-no-premerge Pgood _max-width 1 Error-roundoff 6.9e-016 - Visible-distance 6.9e-016 U-coplanar-distance 6.9e-016 - Width-outside 1.4e-015 _wide-facet 4.2e-015 - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 260000 distance computations. -rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu C-0 - -Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: - - Number of input sites: 1000 - Number of Delaunay regions: 260 - -Statistics for: rbox 1000 W1e-3 s D2 t1327454213 | qhull d FO Tcv Qu C-0 - - Number of points processed: 1000 - Number of hyperplanes created: 4637 - Number of facets in hull: 1996 - Number of distance tests for qhull: 26132 - CPU seconds to compute hull (after input): 0 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 delaunay Tcheck-frequently Tverify QupperDelaunay - Centrum-premerge- 0 _zero-centrum Pgood _max-width 1 - Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 - Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 - Width-outside 2.8e-015 _wide-facet 8.3e-015 - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 260000 distance computations. - -echo === check joggle and TRn ${d:-`date`} -date -=== check joggle and TRn Tue Jan 24 20:16:53 EST 2012 -rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 15 - Number of coplanar points: 4 - Number of facets: 25 - -Statistics for: rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv - - Number of points processed: 15 - Number of hyperplanes created: 11270 - Number of distance tests for qhull: 120689 - CPU seconds to compute hull (after input): 0.015 - Percentage of runs with precision errors: 100.0 - - -precision problems (corrected unless 'Q0' or an error) - 100 coplanar horizon facets for new vertices - 400 coplanar points during partitioning -rbox 100 W0 | qhull QJ1e-13 Qc TR100 Tv - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 28 - Number of coplanar points: 12 - Number of facets: 50 - -Statistics for: rbox 100 W0 | qhull QJ1e-13 Qc TR100 Tv - - Number of points processed: 28 - Number of hyperplanes created: 24800 - Number of distance tests for qhull: 197857 - CPU seconds to compute hull (after input): 0.031 - Percentage of runs with precision errors: 63.0 - - -precision problems (corrected unless 'Q0' or an error) - 10 coplanar half ridges in output - 53 coplanar horizon facets for new vertices - 119 coplanar points during partitioning -rbox 100 W0 | qhull QJ1e-12 Qc TR100 Tv - -At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. -Convex hull of 100 points in 3-d: - - Number of vertices: 40 - Number of coplanar points: 16 - Number of facets: 75 - -Statistics for: rbox 100 W0 | qhull QJ1e-12 Qc TR100 Tv - - Number of points processed: 40 - Number of hyperplanes created: 29205 - Number of distance tests for qhull: 217398 - CPU seconds to compute hull (after input): 0.031 - Percentage of runs with precision errors: 8.0 - - -precision problems (corrected unless 'Q0' or an error) - 2 coplanar half ridges in output - 6 coplanar horizon facets for new vertices - 17 coplanar points during partitioning -rbox 100 W0 | qhull QJ1e-11 Qc TR100 Tv - -Convex hull of 100 points in 3-d: - - Number of vertices: 66 - Number of coplanar points: 34 - Number of facets: 128 - -Statistics for: rbox 100 W0 | qhull QJ1e-11 Qc TR100 Tv - - Number of points processed: 75 - Number of hyperplanes created: 29630 - Number of distance tests for qhull: 219104 - CPU seconds to compute hull (after input): 0.031 - Percentage of runs with precision errors: 0.0 - - -precision problems (corrected unless 'Q0' or an error) - 3 coplanar points during partitioning - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 12800 distance computations. -rbox 100 W0 | qhull QJ1e-10 Qc TR100 Tv - -Convex hull of 100 points in 3-d: - - Number of vertices: 66 - Number of coplanar points: 34 - Number of facets: 128 - -Statistics for: rbox 100 W0 | qhull QJ1e-10 Qc TR100 Tv - - Number of points processed: 75 - Number of hyperplanes created: 29636 - Number of distance tests for qhull: 218960 - CPU seconds to compute hull (after input): 0.031 - Percentage of runs with precision errors: 0.0 - - -Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 12800 distance computations. -rbox 100 | qhull d QJ Qb0:1e4 QB0:1e5 Qb1:1e4 QB1:1e6 Qb2:1e5 QB2:1e7 FO Tv - -Delaunay triangulation by the convex hull of 100 points in 4-d: - - Number of input sites: 100 - Number of Delaunay regions: 488 - -Statistics for: rbox 100 | qhull d QJ Qb0:1e4 QB0:1e5 Qb1:1e4 QB1:1e6 Qb2:1e5 QB2:1e7 FO Tv - - Number of points processed: 100 - Number of hyperplanes created: 1578 - Number of facets in hull: 560 - Number of distance tests for qhull: 3924 - CPU seconds to compute hull (after input): 0.015 - Input joggled by: 6.7e+003 - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 delaunay Qbound-dim-low 0 1e+004 QBound-dim-high 0 1e+005 - Qbound-dim-low 1 1e+004 QBound-dim-high 1 1e+006 Qbound-dim-low 2 1e+005 - QBound-dim-high 2 1e+007 Tverify Pgood _run 1 QJoggle 6.7e+003 - _joggle-seed 16807 _max-width 1e+014 Error-roundoff 0.11 - Visible-distance 0.11 U-coplanar-distance 0.11 Width-outside 0.23 - _wide-facet 0.68 - -Output completed. Verifying that all points are below 0.34 of -all facets. Will make 48800 distance computations. - -echo === check precision options ${d:-`date`} -date -=== check precision options Tue Jan 24 20:16:53 EST 2012 -rbox 100 D3 s | qhull E0.01 Qx Tcv FO - -Convex hull of 100 points in 3-d: - - Number of vertices: 45 - Number of facets: 42 - Number of non-simplicial facets: 28 - -Statistics for: rbox 100 D3 s | qhull E0.01 Qx Tcv FO - - Number of points processed: 45 - Number of hyperplanes created: 160 - Number of distance tests for qhull: 3992 - Number of distance tests for merging: 2006 - Number of distance tests for checking: 1937 - Number of merged facets: 57 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.048 (0.6x) - Maximum distance of vertex below facet: -0.072 (0.9x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315349209 Distance-roundoff 0.01 Qxact-merge Tcheck-frequently - Tverify _zero-centrum _max-width 0.98 _one-merge 0.07 _near-inside 0.35 - Visible-distance 0.02 U-coplanar-distance 0.02 Width-outside 0.04 - _wide-facet 0.12 -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4200 distance computations. -rbox 100 D3 W1e-1 | qhull W1e-3 Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 33 - Number of facets: 62 - -Statistics for: rbox 100 D3 W1e-1 | qhull W1e-3 Tcv - - Number of points processed: 37 - Number of hyperplanes created: 170 - Number of distance tests for qhull: 1580 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.00084 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 6200 distance computations. -rbox 100 D3 W1e-1 | qhull W1e-2 Tcv Q0 - -Convex hull of 100 points in 3-d: - - Number of vertices: 28 - Number of facets: 52 - -Statistics for: rbox 100 D3 W1e-1 | qhull W1e-2 Tcv Q0 - - Number of points processed: 29 - Number of hyperplanes created: 128 - Number of distance tests for qhull: 1442 - CPU seconds to compute hull (after input): 0 - - -precision problems (corrected unless 'Q0' or an error) - 22 coplanar points during partitioning - -Output completed. Verifying that all points are below 0.0097 of -all facets. Will make 5200 distance computations. -rbox 100 D3 W1e-1 | qhull W1e-2 Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 29 - Number of facets: 54 - -Statistics for: rbox 100 D3 W1e-1 | qhull W1e-2 Tcv - - Number of points processed: 30 - Number of hyperplanes created: 132 - Number of distance tests for qhull: 1768 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.0057 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 5400 distance computations. -rbox 100 D3 W1e-1 | qhull W1e-1 Tcv - -Convex hull of 100 points in 3-d: - - Number of vertices: 13 - Number of facets: 22 - -Statistics for: rbox 100 D3 W1e-1 | qhull W1e-1 Tcv - - Number of points processed: 13 - Number of hyperplanes created: 46 - Number of distance tests for qhull: 2521 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.098 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 2200 distance computations. -rbox 15 D2 P0 P1e-14,1e-14 | qhull d Quc Tcv - -Furthest-site Delaunay triangulation by the convex hull of 17 points in 3-d: - - Number of input sites: 17 - Number of Delaunay regions: 5 - -Statistics for: rbox 15 D2 P0 P1e-14,1e-14 | qhull d Quc Tcv - - Number of points processed: 17 - Number of hyperplanes created: 64 - Number of facets in hull: 28 - Number of distance tests for qhull: 142 - Number of distance tests for merging: 527 - Number of distance tests for checking: 194 - Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 1.6e-015 (0.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 85 distance computations. -rbox 15 D3 P0 P1e-12,1e-14,1e-14 | qhull d Qcu Tcv - -Furthest-site Delaunay triangulation by the convex hull of 17 points in 4-d: - - Number of input sites: 17 - Number of Delaunay regions: 14 - -Statistics for: rbox 15 D3 P0 P1e-12,1e-14,1e-14 | qhull d Qcu Tcv - - Number of points processed: 17 - Number of hyperplanes created: 124 - Number of facets in hull: 60 - Number of distance tests for qhull: 225 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below 2.8e-015 of -all facets. Will make 238 distance computations. -rbox 1000 s D3 | qhull C-0.01 Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 107 - Number of coplanar points: 893 - Number of facets: 96 - Number of non-simplicial facets: 77 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Tcv Qc - - Number of points processed: 112 - Number of hyperplanes created: 449 - Number of distance tests for qhull: 64526 - Number of distance tests for merging: 8425 - Number of distance tests for checking: 23411 - Number of merged facets: 256 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96000 distance computations. -rbox 1000 s D3 | qhull C-0.01 V0 Qc Tcv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 120 - Number of coplanar points: 880 - Number of facets: 82 - Number of non-simplicial facets: 71 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 V0 Qc Tcv - - Number of points processed: 445 - Number of hyperplanes created: 2451 - Number of distance tests for qhull: 172077 - Number of distance tests for merging: 52430 - Number of distance tests for checking: 19885 - Number of merged facets: 1741 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of point above facet: 0.032 (1.1x) - Maximum distance of vertex below facet: -0.064 (2.1x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 82000 distance computations. -rbox 1000 s D3 | qhull C-0.01 U0 Qc Tcv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 107 - Number of coplanar points: 893 - Number of facets: 98 - Number of non-simplicial facets: 77 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 U0 Qc Tcv - - Number of points processed: 112 - Number of hyperplanes created: 497 - Number of distance tests for qhull: 64717 - Number of distance tests for merging: 9106 - Number of distance tests for checking: 23621 - Number of merged facets: 254 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 98000 distance computations. -rbox 1000 s D3 | qhull C-0.01 V0 Qcm Tcv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 106 - Number of coplanar points: 894 - Number of facets: 94 - Number of non-simplicial facets: 71 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 V0 Qcm Tcv - - Number of points processed: 114 - Number of hyperplanes created: 597 - Number of distance tests for qhull: 54389 - Number of distance tests for merging: 10179 - Number of distance tests for checking: 18597 - Number of merged facets: 288 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.025 (0.8x) - Maximum distance of vertex below facet: -0.07 (2.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 94000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Qcm Tcv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 103 - Number of coplanar points: 897 - Number of facets: 96 - Number of non-simplicial facets: 69 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Qcm Tcv - - Number of points processed: 106 - Number of hyperplanes created: 434 - Number of distance tests for qhull: 64355 - Number of distance tests for merging: 7947 - Number of distance tests for checking: 23460 - Number of merged facets: 234 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.022 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Q1 FO Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 105 - Number of coplanar points: 895 - Number of facets: 94 - Number of non-simplicial facets: 70 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q1 FO Tcv Qc - - Number of points processed: 110 - Number of hyperplanes created: 457 - Number of distance tests for qhull: 66717 - Number of distance tests for merging: 8730 - Number of distance tests for checking: 23168 - Number of merged facets: 258 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q1-no-angle-sort Tcheck-frequently - Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 - _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 - U-coplanar-distance 0.01 Width-outside 0.02 _wide-facet 0.06 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 94000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Q2 FO Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 106 - Number of coplanar points: 894 - Number of facets: 91 - Number of non-simplicial facets: 74 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q2 FO Tcv Qc - - Number of points processed: 112 - Number of hyperplanes created: 454 - Number of distance tests for qhull: 64909 - Number of distance tests for merging: 8602 - Number of distance tests for checking: 22777 - Number of merged facets: 267 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.049 (1.6x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q2-no-merge-independent - Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 - Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 - Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 - _wide-facet 0.06 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 91000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Q3 FO Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 112 - Number of coplanar points: 888 - Number of facets: 95 - Number of non-simplicial facets: 78 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q3 FO Tcv Qc - - Number of points processed: 112 - Number of hyperplanes created: 453 - Number of distance tests for qhull: 64248 - Number of distance tests for merging: 8529 - Number of distance tests for checking: 23283 - Number of merged facets: 260 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q3-no-merge-vertices - Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 - Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 - Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 - _wide-facet 0.06 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 95000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Q4 FO Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 107 - Number of coplanar points: 893 - Number of facets: 96 - Number of non-simplicial facets: 77 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q4 FO Tcv Qc - - Number of points processed: 112 - Number of hyperplanes created: 449 - Number of distance tests for qhull: 64526 - Number of distance tests for merging: 8425 - Number of distance tests for checking: 23411 - Number of merged facets: 256 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q4-avoid-old-into-new - Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 - Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 - Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 - _wide-facet 0.06 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 96000 distance computations. -echo === this may generate an error ${d:-`date`} -date -=== this may generate an error Tue Jan 24 20:16:54 EST 2012 -rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 107 - Number of facets: 96 - Number of non-simplicial facets: 77 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv - - Number of points processed: 112 - Number of hyperplanes created: 449 - Number of distance tests for qhull: 38064 - Number of distance tests for merging: 8425 - Number of distance tests for checking: 0 - Number of merged facets: 256 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.022 (0.7x) - Maximum distance of vertex below facet: -0.035 (1.2x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q5-no-check-outer - Tcheck-frequently Tverify _max-width 1 Error-roundoff 6.9e-016 - _one-merge 0.03 Visible-distance 0.01 U-coplanar-distance 0.01 - Width-outside 0.02 _wide-facet 0.06 -QH7077 qhull input warning: no outer plane check ('Q5') or no processing of -near-inside points ('Q8'). Verify may report that a point is outside -of a facet. - -Output completed. Verifying that all points are below 0.022 of -all facets. Will make 96000 distance computations. -echo === this should generate an error ${d:-`date`} -date -=== this should generate an error Tue Jan 24 20:16:54 EST 2012 -rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 114 - Number of coplanar points: 886 - Number of facets: 182 - Number of non-simplicial facets: 40 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc - - Number of points processed: 114 - Number of hyperplanes created: 447 - Number of distance tests for qhull: 53157 - Number of distance tests for merging: 3458 - Number of distance tests for checking: 27470 - Number of merged facets: 88 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.009 (0.3x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q6-no-concave-merge Poutput-forced - Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 - Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 - Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 - _wide-facet 0.06 -QH6117 qhull precision error: f324 is concave to f325. Centrum of f324 is 0.004134 above f325 -QH6117 qhull precision error: f325 is concave to f324. Centrum of f325 is 0.001027 above f324 -rbox 1000 s D3 | qhull C-0.01 Q7 FO Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 100 - Number of coplanar points: 900 - Number of facets: 94 - Number of non-simplicial facets: 73 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Q7 FO Tcv Qc - - Number of points processed: 103 - Number of hyperplanes created: 448 - Number of distance tests for qhull: 70481 - Number of distance tests for merging: 8005 - Number of distance tests for checking: 21158 - Number of merged facets: 233 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.042 (1.4x) - -Options selected for Qhull 2012.1 2012/01/22: - run-id 315366016 Centrum-premerge- 0.01 Q7-no-breadth-first - Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 - Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 - Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 - _wide-facet 0.06 - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 94000 distance computations. -rbox 1000 s D3 | qhull C-0.01 Qx Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 114 - Number of coplanar points: 886 - Number of facets: 103 - Number of non-simplicial facets: 77 - -Statistics for: rbox 1000 s D3 | qhull C-0.01 Qx Tcv Qc - - Number of points processed: 114 - Number of hyperplanes created: 447 - Number of distance tests for qhull: 90887 - Number of distance tests for merging: 5483 - Number of distance tests for checking: 20583 - Number of merged facets: 167 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.02 (0.7x) - Maximum distance of vertex below facet: -0.034 (1.1x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 103000 distance computations. -echo === this may generate an error e.g., t1263080158 ${d:-`date`} -date -=== this may generate an error e.g., t1263080158 Tue Jan 24 20:16:54 EST 2012 -rbox 100 s D3 t | qhull R1e-3 Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 99 - Number of coplanar points: 1 - Number of facets: 170 - Number of non-simplicial facets: 22 - -Statistics for: rbox 100 s D3 t1327454214 | qhull R1e-3 Tcv Qc - - Number of points processed: 100 - Number of hyperplanes created: 486 - Number of distance tests for qhull: 1750 - Number of distance tests for merging: 3528 - Number of distance tests for checking: 1354 - Number of merged facets: 45 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.0019 (0.5x) - Maximum distance of vertex below facet: -0.004 (1.0x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 17000 distance computations. -rbox 100 s D3 t | qhull R1e-2 Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 62 - Number of coplanar points: 38 - Number of facets: 61 - Number of non-simplicial facets: 37 - -Statistics for: rbox 100 s D3 t1327454214 | qhull R1e-2 Tcv Qc - - Number of points processed: 64 - Number of hyperplanes created: 273 - Number of distance tests for qhull: 3715 - Number of distance tests for merging: 4249 - Number of distance tests for checking: 2058 - Number of merged facets: 120 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.028 (0.7x) - Maximum distance of vertex below facet: -0.091 (2.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 6100 distance computations. -rbox 500 s D3 t | qhull R0.05 A-1 Tcv Qc - -Convex hull of 500 points in 3-d: - - Number of vertices: 22 - Number of coplanar points: 478 - Number of facets: 17 - Number of non-simplicial facets: 15 - -Statistics for: rbox 500 s D3 t1327454214 | qhull R0.05 A-1 Tcv Qc - - Number of points processed: 24 - Number of hyperplanes created: 80 - Number of distance tests for qhull: 22361 - Number of distance tests for merging: 1531 - Number of distance tests for checking: 7408 - Number of merged facets: 49 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.14 (0.2x) - Maximum distance of vertex below facet: -0.26 (0.4x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 8500 distance computations. -rbox 100 W0 D3 t | qhull R1e-3 Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 37 - Number of coplanar points: 63 - Number of facets: 46 - Number of non-simplicial facets: 8 - -Statistics for: rbox 100 W0 D3 t1327454214 | qhull R1e-3 Tcv Qc - - Number of points processed: 42 - Number of hyperplanes created: 142 - Number of distance tests for qhull: 2042 - Number of distance tests for merging: 1656 - Number of distance tests for checking: 1067 - Number of merged facets: 41 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 0.0025 (0.6x) - Maximum distance of vertex below facet: -0.0051 (1.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4600 distance computations. -rbox 100 W0 D3 t | qhull R1e-3 Qx Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 38 - Number of coplanar points: 62 - Number of facets: 47 - Number of non-simplicial facets: 9 - -Statistics for: rbox 100 W0 D3 t1327454214 | qhull R1e-3 Qx Tcv Qc - - Number of points processed: 44 - Number of hyperplanes created: 147 - Number of distance tests for qhull: 2938 - Number of distance tests for merging: 1582 - Number of distance tests for checking: 1068 - Number of merged facets: 42 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.0017 (0.4x) - Maximum distance of vertex below facet: -0.0048 (1.2x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 4700 distance computations. -rbox 100 W0 D3 t | qhull R1e-2 Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 27 - Number of coplanar points: 73 - Number of facets: 27 - Number of non-simplicial facets: 12 - -Statistics for: rbox 100 W0 D3 t1327454214 | qhull R1e-2 Tcv Qc - - Number of points processed: 33 - Number of hyperplanes created: 108 - Number of distance tests for qhull: 2267 - Number of distance tests for merging: 1505 - Number of distance tests for checking: 1069 - Number of merged facets: 44 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.024 (0.6x) - Maximum distance of vertex below facet: -0.031 (0.8x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 2700 distance computations. -rbox 100 W0 D3 t | qhull R1e-2 Qx Tcv Qc - -Convex hull of 100 points in 3-d: - - Number of vertices: 30 - Number of coplanar points: 70 - Number of facets: 30 - Number of non-simplicial facets: 11 - -Statistics for: rbox 100 W0 D3 t1327454215 | qhull R1e-2 Qx Tcv Qc - - Number of points processed: 34 - Number of hyperplanes created: 111 - Number of distance tests for qhull: 2798 - Number of distance tests for merging: 1363 - Number of distance tests for checking: 1107 - Number of merged facets: 38 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.025 (0.6x) - Maximum distance of vertex below facet: -0.05 (1.3x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 3000 distance computations. -rbox 500 W0 D3 t | qhull R0.05 A-1 Tcv Qc - -Convex hull of 500 points in 3-d: - - Number of vertices: 8 - Number of coplanar points: 492 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: rbox 500 W0 D3 t1327454215 | qhull R0.05 A-1 Tcv Qc - - Number of points processed: 15 - Number of hyperplanes created: 46 - Number of distance tests for qhull: 16005 - Number of distance tests for merging: 742 - Number of distance tests for checking: 3754 - Number of merged facets: 26 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.067 (0.1x) - Maximum distance of vertex below facet: -0.17 (0.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 3000 distance computations. -rbox 500 W0 D3 t | qhull R0.05 Qx Tcv Qc - -Convex hull of 500 points in 3-d: - - Number of vertices: 9 - Number of coplanar points: 491 - Number of facets: 7 - Number of non-simplicial facets: 6 - -Statistics for: rbox 500 W0 D3 t1327454215 | qhull R0.05 Qx Tcv Qc - - Number of points processed: 18 - Number of hyperplanes created: 45 - Number of distance tests for qhull: 22085 - Number of distance tests for merging: 596 - Number of distance tests for checking: 4091 - Number of merged facets: 31 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.14 (0.7x) - Maximum distance of vertex below facet: -0.19 (0.9x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 3500 distance computations. -rbox 1000 W1e-20 t | qhull Tcv Qc - -Convex hull of 1000 points in 3-d: - - Number of vertices: 76 - Number of coplanar points: 924 - Number of facets: 90 - Number of non-simplicial facets: 6 - -Statistics for: rbox 1000 W1e-20 t1327454215 | qhull Tcv Qc - - Number of points processed: 91 - Number of hyperplanes created: 288 - Number of distance tests for qhull: 19728 - Number of distance tests for merging: 3852 - Number of distance tests for checking: 28894 - Number of merged facets: 88 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 90000 distance computations. -rbox 1000 W1e-20 D4 t | qhull Tcv Qc - -Convex hull of 1000 points in 4-d: - - Number of vertices: 270 - Number of coplanar points: 730 - Number of facets: 975 - Number of non-simplicial facets: 8 - -Statistics for: rbox 1000 W1e-20 D4 t1327454215 | qhull Tcv Qc - - Number of points processed: 338 - Number of hyperplanes created: 4074 - Number of distance tests for qhull: 68477 - Number of distance tests for merging: 63566 - Number of distance tests for checking: 140180 - Number of merged facets: 1048 - CPU seconds to compute hull (after input): 0.078 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 975000 distance computations. -rbox 500 W1e-20 D5 t | qhull Tv Qc - -Convex hull of 500 points in 5-d: - - Number of vertices: 336 - Number of coplanar points: 164 - Number of facets: 5242 - Number of non-simplicial facets: 10 - -Statistics for: rbox 500 W1e-20 D5 t1327454215 | qhull Tv Qc - - Number of points processed: 402 - Number of hyperplanes created: 27379 - Number of distance tests for qhull: 125805 - Number of distance tests for merging: 297315 - Number of distance tests for checking: 226312 - Number of merged facets: 3444 - CPU seconds to compute hull (after input): 0.109 - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 2621000 distance computations. -rbox 100 W1e-20 D6 t | qhull Tv Qc - -Convex hull of 100 points in 6-d: - - Number of vertices: 100 - Number of facets: 5769 - Number of non-simplicial facets: 10 - -Statistics for: rbox 100 W1e-20 D6 t1327454215 | qhull Tv Qc - - Number of points processed: 100 - Number of hyperplanes created: 21073 - Number of distance tests for qhull: 33526 - Number of distance tests for merging: 178809 - Number of distance tests for checking: 119096 - Number of merged facets: 175 - CPU seconds to compute hull (after input): 0.078 - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 576900 distance computations. -rbox 50 W1e-20 D6 t | qhull Qv Tv Qc - -Convex hull of 50 points in 6-d: - - Number of vertices: 50 - Number of facets: 2052 - Number of non-simplicial facets: 1 - -Statistics for: rbox 50 W1e-20 D6 t1327454215 | qhull Qv Tv Qc - - Number of points processed: 50 - Number of hyperplanes created: 6174 - Number of distance tests for qhull: 9126 - Number of distance tests for merging: 3342083 - Number of distance tests for checking: 42086 - Number of merged facets: 2 - CPU seconds to compute hull (after input): 0.125 - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 102600 distance computations. -rbox 10000 D4 t | qhull QR0 Qc C-0.01 A0.3 Tv - -Convex hull of 10000 points in 4-d: - - Number of vertices: 16 - Number of coplanar points: 8178 - Number of facets: 8 - Number of non-simplicial facets: 8 - -Statistics for: rbox 10000 D4 t1327454215 | qhull QR0 Qc C-0.01 A0.3 Tv QR1327454215 - - Number of points processed: 57 - Number of hyperplanes created: 390 - Number of distance tests for qhull: 1765089 - Number of distance tests for merging: 14211 - Number of distance tests for checking: 99978 - Number of merged facets: 419 - CPU seconds to compute hull (after input): 0.078 - Maximum distance of point above facet: 0.062 - Maximum distance of vertex below facet: -0.16 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 80000 distance computations. -rbox 1000 D2 t | qhull d QR0 Qc C-1e-8 Qu Tv - -Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: - - Number of input sites: 1000 - Number of Delaunay regions: 16 - -Statistics for: rbox 1000 D2 t1327454216 | qhull d QR0 Qc C-1e-8 Qu Tv QR1327454216 - - Number of points processed: 1000 - Number of hyperplanes created: 5607 - Number of facets in hull: 1996 - Number of distance tests for qhull: 29361 - CPU seconds to compute hull (after input): 0 - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 16000 distance computations. -rbox 300 D5 t |qhull A-0.999 Qx Qc Tcv - -Convex hull of 300 points in 5-d: - - Number of vertices: 151 - Number of coplanar points: 33 - Number of facets: 1587 - Number of non-simplicial facets: 395 - -Statistics for: rbox 300 D5 t1327454216 | qhull A-0.999 Qx Qc Tcv - - Number of points processed: 189 - Number of hyperplanes created: 11655 - Number of distance tests for qhull: 177205 - Number of distance tests for merging: 54298 - Number of distance tests for checking: 19295 - Number of merged facets: 1099 - CPU seconds to compute hull (after input): 0.046 - Maximum distance of vertex below facet: -0.026 (0.3x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 476100 distance computations. -rbox 100 D6 t |qhull A-0.9999 Qx Qc Tcv - -Convex hull of 100 points in 6-d: - - Number of vertices: 84 - Number of coplanar points: 1 - Number of facets: 3470 - Number of non-simplicial facets: 220 - -Statistics for: rbox 100 D6 t1327454216 | qhull A-0.9999 Qx Qc Tcv - - Number of points processed: 89 - Number of hyperplanes created: 13314 - Number of distance tests for qhull: 34056 - Number of distance tests for merging: 73326 - Number of distance tests for checking: 74943 - Number of merged facets: 516 - CPU seconds to compute hull (after input): 0.046 - Maximum distance of vertex below facet: -0.0066 (0.2x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 347000 distance computations. -rbox 50 D7 t |qhull A-0.99999 Qx Qc Tcv W0.1 - -Convex hull of 50 points in 7-d: - - Number of vertices: 46 - Number of coplanar points: 2 - Number of facets: 5010 - Number of non-simplicial facets: 77 - -Statistics for: rbox 50 D7 t1327454216 | qhull A-0.99999 Qx Qc Tcv W0.1 - - Number of points processed: 46 - Number of hyperplanes created: 14157 - Number of distance tests for qhull: 32822 - Number of distance tests for merging: 100043 - Number of distance tests for checking: 197564 - Number of merged facets: 230 - CPU seconds to compute hull (after input): 0.078 - Maximum distance of point above facet: 0.23 - Maximum distance of vertex below facet: -0.0021 (0.2x) - -QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point -is outside of a facet. See qh-optq.htm#Qx - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 250500 distance computations. - -echo === check bad cases for Qhull. May cause errors ${d:-`date`} -date -=== check bad cases for Qhull. May cause errors Tue Jan 24 20:16:56 EST 2012 -rbox 1000 L100000 s G1e-6 t | qhull Tv - -Convex hull of 1000 points in 3-d: - - Number of vertices: 996 - Number of facets: 1524 - Number of non-simplicial facets: 4 - -Statistics for: rbox 1000 L100000 s G1e-6 t1327454216 | qhull Tv - - Number of points processed: 996 - Number of hyperplanes created: 3709 - Number of distance tests for qhull: 28946 - Number of distance tests for merging: 132465 - Number of distance tests for checking: 118998 - Number of merged facets: 465 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 1.8e-015 (0.3x) - -qhull precision warning: -The initial hull is narrow (cosine of min. angle is 1.0000000000000000). -Is the input lower dimensional (e.g., on a plane in 3-d)? Qhull may -produce a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale -last coordinate) may remove this warning. Use 'Pp' to skip this warning. -See 'Limitations' in qh-impre.htm. - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1524000 distance computations. -rbox 1000 L100000 s G1e-6 t | qhull Tv Q10 - -Convex hull of 1000 points in 3-d: - - Number of vertices: 996 - Number of facets: 1524 - Number of non-simplicial facets: 4 - -Statistics for: rbox 1000 L100000 s G1e-6 t1327454216 | qhull Tv Q10 - - Number of points processed: 996 - Number of hyperplanes created: 3709 - Number of distance tests for qhull: 28942 - Number of distance tests for merging: 132465 - Number of distance tests for checking: 118998 - Number of merged facets: 465 - CPU seconds to compute hull (after input): 0.031 - Maximum distance of point above facet: 1.8e-015 (0.3x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1524000 distance computations. -rbox 1000 s Z1 G1e-13 t | qhull Tv - -Convex hull of 1001 points in 3-d: - - Number of vertices: 1001 - Number of facets: 1490 - Number of non-simplicial facets: 165 - -Statistics for: rbox 1000 s Z1 G1e-13 t1327454216 | qhull Tv - - Number of points processed: 1001 - Number of hyperplanes created: 4496 - Number of distance tests for qhull: 29800 - Number of distance tests for merging: 77271 - Number of distance tests for checking: 185199 - Number of merged facets: 1602 - CPU seconds to compute hull (after input): 0.015 - Maximum distance of point above facet: 8.9e-015 (1.6x) - Maximum distance of vertex below facet: -9.1e-015 (1.6x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1491490 distance computations. -rbox 1000 s W1e-13 P0 t | qhull d Qbb Qc Tv - -Delaunay triangulation by the convex hull of 1001 points in 4-d: - - Number of input sites: 1001 - Number of Delaunay regions: 1996 - -Statistics for: rbox 1000 s W1e-13 P0 t1327454216 | qhull d Qbb Qc Tv - - Number of points processed: 1001 - Number of hyperplanes created: 133732 - Number of facets in hull: 2018 - Number of distance tests for qhull: 210877 - Number of distance tests for merging: 9912396 - Number of distance tests for checking: 2007669 - Number of merged facets: 127605 - CPU seconds to compute hull (after input): 2.562 - Maximum distance of point above facet: 2.7e-012 (136.2x) - Maximum distance of vertex below facet: -8e-013 (39.9x) - - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1997996 distance computations. -rbox 1000 s W1e-13 t | qhull d Tv - -Delaunay triangulation by the convex hull of 1000 points in 4-d: - - Number of input sites: 37 - Total number of deleted points due to merging: 316 - Total number of nearly incident points: 647 - Number of Delaunay regions: 30 - Number of non-simplicial Delaunay regions: 10 - -Statistics for: rbox 1000 s W1e-13 t1327454219 | qhull d Tv - - Number of points processed: 353 - Number of hyperplanes created: 4824 - Number of facets in hull: 53 - Number of distance tests for qhull: 956652 - Number of distance tests for merging: 160982 - Number of distance tests for checking: 50330 - Number of merged facets: 4255 - CPU seconds to compute hull (after input): 0.063 - Maximum distance of point above facet: 3.4e-013 (33.8x) - Maximum distance of vertex below facet: -4.7e-014 (4.7x) - -qhull precision warning: -The initial hull is narrow (cosine of min. angle is 1.0000000000000000). -Is the input lower dimensional (e.g., on a plane in 3-d)? Qhull may -produce a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale -last coordinate) may remove this warning. Use 'Pp' to skip this warning. -See 'Limitations' in qh-impre.htm. - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 30000 distance computations. -rbox 1000 s W1e-13 t D2 | qhull d Tv - -Delaunay triangulation by the convex hull of 1000 points in 3-d: - - Number of input sites: 974 - Total number of deleted points due to merging: 10 - Total number of nearly incident points: 16 - Number of Delaunay regions: 729 - Number of non-simplicial Delaunay regions: 132 - -Statistics for: rbox 1000 s W1e-13 D2 t1327454219 | qhull d Tv - - Number of points processed: 984 - Number of hyperplanes created: 3940 - Number of facets in hull: 1462 - Number of distance tests for qhull: 68482 - Number of distance tests for merging: 47115 - Number of distance tests for checking: 167978 - Number of merged facets: 885 - CPU seconds to compute hull (after input): 0.016 - Maximum distance of point above facet: 3e-014 (5.5x) - Maximum distance of vertex below facet: -7.6e-015 (1.4x) - -qhull precision warning: -The initial hull is narrow (cosine of min. angle is 1.0000000000000000). -Is the input lower dimensional (e.g., on a plane in 3-d)? Qhull may -produce a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale -last coordinate) may remove this warning. Use 'Pp' to skip this warning. -See 'Limitations' in qh-impre.htm. - -Output completed. Verifying that all points are below outer planes of -all facets. Will make 729000 distance computations. - -echo ======================================================= -======================================================= -echo ======================================================= -======================================================= -echo === The following commands may cause errors ${d:-`date`} -date -=== The following commands may cause errors Tue Jan 24 20:16:59 EST 2012 -echo ======================================================= -======================================================= -echo ======================================================= -======================================================= -rbox c D7 | qhull Q0 Tcv - -Convex hull of 128 points in 7-d: - - Number of vertices: 128 - Number of facets: 8666 - -Statistics for: rbox c D7 | qhull Q0 Tcv - - Number of points processed: 128 - Number of hyperplanes created: 12287 - Number of distance tests for qhull: 32936 - CPU seconds to compute hull (after input): 0.031 - - -precision problems (corrected unless 'Q0' or an error) - 41888 coplanar half ridges in output - 10185 coplanar horizon facets for new vertices - 8389 nearly singular or axis-parallel hyperplanes - 8389 zero divisors during back substitute - 11903 zero divisors during gaussian elimination - -qhull output completed. Verifying that 128 points are -below 6.6e-015 of the nearest facet. -rbox 100 s D3 | qhull Q0 E1e-3 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox 100 s D3 | qhull Q0 E1e-3 Tc Po - - Number of points processed: 100 - Number of hyperplanes created: 508 - Number of distance tests for qhull: 1728 - CPU seconds to compute hull (after input): 0 - -QH6115 qhull precision error: f100 is concave to f247, since p44(v13) is 0.002232 above -QH6115 qhull precision error: f139 is concave to f274, since p90(v32) is 0.007128 above -QH6115 qhull precision error: f163 is concave to f232, since p5(v6) is 0.001226 above -QH6115 qhull precision error: f293 is concave to f389, since p11(v61) is 0.002161 above -QH6115 qhull precision error: f307 is concave to f459, since p75(v21) is 0.01537 above - -precision problems (corrected unless 'Q0' or an error) - 16 coplanar half ridges in output - 5 concave half ridges in output - 18 coplanar horizon facets for new vertices -rbox 100 s D3 | qhull Q0 E1e-2 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 72 - Number of facets: 140 - -Statistics for: rbox 100 s D3 | qhull Q0 E1e-2 Tc Po - - Number of points processed: 72 - Number of hyperplanes created: 321 - Number of distance tests for qhull: 1693 - CPU seconds to compute hull (after input): 0 - -QH6115 qhull precision error: f123 is concave to f235, since p85(v8) is 0.06092 above -QH6115 qhull precision error: f177 is concave to f272, since p98(v20) is 0.03571 above -QH6115 qhull precision error: f246 is concave to f252, since p7(v57) is 0.02104 above -QH6115 qhull precision error: f261 is concave to f305, since p82(v60) is 0.01847 above -QH6115 qhull precision error: f266 is concave to f317, since p82(v60) is 0.02592 above - -precision problems (corrected unless 'Q0' or an error) - 52 coplanar half ridges in output - 5 concave half ridges in output - 54 coplanar horizon facets for new vertices - 27 coplanar points during partitioning -rbox 100 s D3 | qhull Q0 E1e-1 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 10 - Number of facets: 16 - -Statistics for: rbox 100 s D3 | qhull Q0 E1e-1 Tc Po - - Number of points processed: 10 - Number of hyperplanes created: 27 - Number of distance tests for qhull: 977 - CPU seconds to compute hull (after input): 0 - - -precision problems (corrected unless 'Q0' or an error) - 3 coplanar half ridges in output - 3 coplanar horizon facets for new vertices - 59 coplanar points during partitioning -rbox 100 s D3 | qhull Q0 R1e-3 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 100 - Number of facets: 196 - -Statistics for: rbox 100 s D3 | qhull Q0 R1e-3 Tc Po - - Number of points processed: 100 - Number of hyperplanes created: 513 - Number of distance tests for qhull: 1693 - CPU seconds to compute hull (after input): 0 - -QH6115 qhull precision error: f229 is concave to f300, since p90(v34) is 0.007895 above -QH6115 qhull precision error: f323 is concave to f421, since p11(v67) is 0.001894 above -QH6115 qhull precision error: f343 is concave to f493, since p75(v21) is 0.011 above -QH6115 qhull precision error: f493 is concave to f343, since p25(v97) is 0.000937 above - -precision problems (corrected unless 'Q0' or an error) - 14 coplanar half ridges in output - 4 concave half ridges in output - 9 coplanar horizon facets for new vertices -rbox 100 s D3 | qhull Q0 R1e-2 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 87 - Number of facets: 170 - -Statistics for: rbox 100 s D3 | qhull Q0 R1e-2 Tc Po - - Number of points processed: 87 - Number of hyperplanes created: 405 - Number of distance tests for qhull: 1734 - CPU seconds to compute hull (after input): 0.015 - -QH6136 qhull precision error: facet f326 is flipped, distance= 0.51437088552 -QH6136 qhull precision error: facet f326 is flipped, distance= 0.511098236347 -QH6115 qhull precision error: f76 is concave to f201, since p76(v21) is 0.0101 above -QH6115 qhull precision error: f96 is concave to f279, since p38(v22) is 0.008383 above -QH6115 qhull precision error: f132 is concave to f140, since p57(v0) is 0.02117 above -QH6115 qhull precision error: f140 is concave to f132, since p96(v34) is 0.00703 above -QH6115 qhull precision error: f150 is concave to f230, since p11(v37) is 0.04121 above -QH6115 qhull precision error: f161 is concave to f326, since p26(v32) is 0.01279 above -QH6115 qhull precision error: f194 is concave to f281, since p73(v12) is 0.03149 above -QH6115 qhull precision error: f230 is concave to f150, since p47(v52) is 0.008464 above -QH6115 qhull precision error: f263 is concave to f156, since p15(v60) is 0.01055 above -QH6115 qhull precision error: f277 is concave to f353, since p89(v36) is 0.005387 above -QH6115 qhull precision error: f281 is concave to f194, since p66(v63) is 0.005996 above -QH6115 qhull precision error: f319 is concave to f341, since p82(v70) is 0.07818 above -QH6115 qhull precision error: f324 is concave to f368, since p41(v5) is 0.01436 above -QH6113 qhull precision error: f326 is flipped(interior point is outside) -QH6115 qhull precision error: f344 is concave to f352, since p29(v75) is 0.009226 above -QH6115 qhull precision error: f348 is concave to f351, since p27(v76) is 0.008815 above -QH6115 qhull precision error: f349 is concave to f350, since p15(v60) is 0.01089 above -QH6115 qhull precision error: f352 is concave to f344, since p69(v77) is 0.008279 above -QH6115 qhull precision error: f353 is concave to f277, since p69(v77) is 0.006627 above -QH6115 qhull precision error: f385 is concave to f404, since p18(v73) is 0.007494 above -QH6115 qhull precision error: f404 is concave to f385, since p13(v87) is 0.005049 above - -precision problems (corrected unless 'Q0' or an error) - 45 coplanar half ridges in output - 20 concave half ridges in output - 1 flipped facets - 47 coplanar horizon facets for new vertices - 13 coplanar points during partitioning -rbox 100 s D3 | qhull Q0 R0.05 Tc -QH6136 qhull precision error: facet f160 is flipped, distance= 0.41168102504 -ERRONEOUS FACET: -- f160 - - flags: bottom simplicial flipped - - normal: -0.3615 -0.1924 0.9123 - - offset: 0.4644952 - - vertices: p94(v40) p19(v28) p56(v27) - - neighboring facets: f107 f158 f202 -QH6136 qhull precision error: facet f203 is flipped, distance= 0.448767103644 -ERRONEOUS FACET: -- f203 - - flags: top simplicial flipped - - normal: -0.2281 0.05702 -0.972 - - offset: 0.4136177 - - vertices: p40(v51) p83(v19) p48(v6) - - neighboring facets: f123 f204 f205 - -A flipped facet occurs when its distance to the interior point is -greater than -0.024, the maximum roundoff error. - -While executing: rbox 100 s D3 | qhull Q0 R0.05 Tc -Options selected for Qhull 2012.1 2012/01/22: - run-id 315466858 Q0-no-premerge Random_perturb 0.05 Tcheck-frequently - _max-width 0.94 Error-roundoff 0.024 Visible-distance 0.024 - U-coplanar-distance 0.024 Width-outside 0.048 _wide-facet 0.15 -Last point added to hull was p40. -Qhull has finished constructing the hull. - -At error exit: - -Convex hull of 100 points in 3-d: - - Number of vertices: 51 - Number of facets: 98 - -Statistics for: rbox 100 s D3 | qhull Q0 R0.05 Tc - - Number of points processed: 51 - Number of hyperplanes created: 206 - Number of distance tests for qhull: 2041 - CPU seconds to compute hull (after input): 0 - - -precision problems (corrected unless 'Q0' or an error) - 2 flipped facets - 50 coplanar horizon facets for new vertices - 46 coplanar points during partitioning - -Precision problems were detected during construction of the convex hull. -This occurs because convex hull algorithms assume that calculations are -exact, but floating-point arithmetic has roundoff errors. - -To correct for precision problems, do not use 'Q0'. By default, Qhull -selects 'C-0' or 'Qx' and merges non-convex facets. With option 'QJ', -Qhull joggles the input to prevent precision problems. See "Imprecision -in Qhull" (qh-impre.htm). - -If you use 'Q0', the output may include -coplanar ridges, concave ridges, and flipped facets. In 4-d and higher, -Qhull may produce a ridge with four neighbors or two facets with the same -vertices. Qhull reports these events when they occur. It stops when a -concave ridge, flipped facet, or duplicate facet occurs. - -If you need triangular output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft'. It triangulates non-simplicial facets with added points. - -If you must use 'Q0', -try one or more of the following options. They can not guarantee an output. - - use 'QbB' to scale the input to a cube. - - use 'Po' to produce output and prevent partitioning for flipped facets - - use 'V0' to set min. distance to visible facet as 0 instead of roundoff - - use 'En' to specify a maximum roundoff error less than 0.024. - - options 'Qf', 'Qbb', and 'QR0' may also help - -To guarantee simplicial output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft' to triangulate the output by adding points - - use exact arithmetic (see "Imprecision in Qhull", qh-impre.htm) -rbox 100 s D3 | qhull Q0 R0.05 Tc Po - -Convex hull of 100 points in 3-d: - - Number of vertices: 51 - Number of facets: 98 - -Statistics for: rbox 100 s D3 | qhull Q0 R0.05 Tc Po - - Number of points processed: 51 - Number of hyperplanes created: 209 - Number of distance tests for qhull: 2072 - CPU seconds to compute hull (after input): 0 - -QH6136 qhull precision error: facet f105 is flipped, distance= 0.531034433025 -QH6136 qhull precision error: facet f172 is flipped, distance= 0.351989788321 -QH6136 qhull precision error: facet f105 is flipped, distance= 0.524438872687 -QH6136 qhull precision error: facet f172 is flipped, distance= 0.311891927779 -QH6115 qhull precision error: f30 is concave to f172, since p90(v11) is 0.05852 above -QH6115 qhull precision error: f41 is concave to f70, since p28(v14) is 0.03835 above -QH6115 qhull precision error: f65 is concave to f128, since p18(v19) is 0.03961 above -QH6115 qhull precision error: f77 is concave to f201, since p89(v21) is 0.03681 above -QH6115 qhull precision error: f99 is concave to f192, since p85(v8) is 0.1891 above -QH6113 qhull precision error: f105 is flipped(interior point is outside) -QH6115 qhull precision error: f143 is concave to f179, since p3(v2) is 0.0956 above -QH6115 qhull precision error: f150 is concave to f185, since p70(v13) is 0.03157 above -QH6115 qhull precision error: f161 is concave to f171, since p41(v5) is 0.07964 above -QH6115 qhull precision error: f166 is concave to f108, since p96(v41) is 0.02537 above -QH6115 qhull precision error: f169 is concave to f129, since p60(v42) is 0.02492 above -QH6113 qhull precision error: f172 is flipped(interior point is outside) -QH6115 qhull precision error: f183 is concave to f205, since p44(v37) is 0.1309 above -QH6115 qhull precision error: f186 is concave to f207, since p5(v25) is 0.1066 above -QH6115 qhull precision error: f187 is concave to f151, since p75(v47) is 0.04347 above -QH6115 qhull precision error: f199 is concave to f200, since p12(v3) is 0.08495 above -QH6115 qhull precision error: f201 is concave to f77, since p35(v50) is 0.02603 above - -precision problems (corrected unless 'Q0' or an error) - 61 coplanar half ridges in output - 15 concave half ridges in output - 2 flipped facets - 44 coplanar horizon facets for new vertices - 46 coplanar points during partitioning -rbox 1000 W1e-7 | qhull Q0 Tc Po - -Convex hull of 1000 points in 3-d: - - Number of vertices: 164 - Number of facets: 324 - -Statistics for: rbox 1000 W1e-7 | qhull Q0 Tc Po - - Number of points processed: 221 - Number of hyperplanes created: 1160 - Number of distance tests for qhull: 22647 - CPU seconds to compute hull (after input): 0 - -rbox 50 s | qhull Q0 V0.05 W0.01 Tc Po -QH6136 qhull precision error: facet f105 is flipped, distance= 0.328228630954 -QH6136 qhull precision error: facet f125 is flipped, distance= 0.389476173148 -QH6136 qhull precision error: facet f152 is flipped, distance= 0.420187947128 -QH6136 qhull precision error: facet f155 is flipped, distance= 0.396217639489 -QH6136 qhull precision error: facet f161 is flipped, distance= 0.0543980568868 -QH6136 qhull precision error: facet f164 is flipped, distance= 0.448464152152 -QH6136 qhull precision error: facet f170 is flipped, distance= 0.430073300444 -QH6136 qhull precision error: facet f105 is flipped, distance= 0.328228630954 -QH6136 qhull precision error: facet f125 is flipped, distance= 0.389476173148 -QH6136 qhull precision error: facet f152 is flipped, distance= 0.420187947128 -QH6136 qhull precision error: facet f155 is flipped, distance= 0.396217639489 -QH6136 qhull precision error: facet f161 is flipped, distance= 0.0543980568868 -QH6136 qhull precision error: facet f164 is flipped, distance= 0.448464152152 -QH6136 qhull precision error: facet f170 is flipped, distance= 0.430073300444 -QH6115 qhull precision error: f25 is concave to f60, since p41(v8) is 0.1672 above -QH6115 qhull precision error: f25 is concave to f155, since p19(v2) is 0.01771 above -QH6115 qhull precision error: f38 is concave to f70, since p0(v13) is 0.06094 above -QH6115 qhull precision error: f39 is concave to f145, since p8(v11) is 0.2589 above -QH6115 qhull precision error: f45 is concave to f72, since p5(v15) is 0.02091 above -QH6115 qhull precision error: f47 is concave to f98, since p5(v15) is 0.05573 above -QH6115 qhull precision error: f47 is concave to f96, since p42(v7) is 0.05284 above -QH6115 qhull precision error: f50 is concave to f59, since p49(v16) is 0.01059 above -QH6115 qhull precision error: f54 is concave to f84, since p28(v17) is 0.03013 above -QH6115 qhull precision error: f54 is concave to f152, since p29(v1) is 0.2143 above -QH6115 qhull precision error: f59 is concave to f50, since p1(v19) is 0.01736 above -QH6115 qhull precision error: f60 is concave to f25, since p1(v19) is 0.02263 above -QH6115 qhull precision error: f62 is concave to f119, since p14(v5) is 0.02783 above -QH6115 qhull precision error: f65 is concave to f120, since p16(v10) is 0.003387 above -QH6115 qhull precision error: f70 is concave to f38, since p9(v22) is 0.04722 above -QH6115 qhull precision error: f71 is concave to f73, since p9(v22) is 0.04568 above -QH6115 qhull precision error: f72 is concave to f45, since p31(v23) is 0.02334 above -QH6115 qhull precision error: f73 is concave to f71, since p31(v23) is 0.04141 above -QH6115 qhull precision error: f78 is concave to f125, since p38(v24) is 0.01386 above -QH6115 qhull precision error: f84 is concave to f54, since p25(v26) is 0.01696 above -QH6115 qhull precision error: f87 is concave to f93, since p14(v5) is 0.01836 above -QH6115 qhull precision error: f88 is concave to f112, since p4(v27) is 0.04742 above -QH6115 qhull precision error: f91 is concave to f161, since p26(v28) is 0.3121 above -QH6115 qhull precision error: f93 is concave to f87, since p26(v28) is 0.01572 above -QH6115 qhull precision error: f96 is concave to f47, since p21(v29) is 0.02763 above -QH6115 qhull precision error: f98 is concave to f47, since p20(v30) is 0.03086 above -QH6113 qhull precision error: f105 is flipped(interior point is outside) -QH6115 qhull precision error: f106 is concave to f149, since p29(v1) is 0.0618 above -QH6115 qhull precision error: f112 is concave to f88, since p6(v34) is 0.02917 above -QH6115 qhull precision error: f119 is concave to f62, since p39(v36) is 0.006072 above -QH6115 qhull precision error: f120 is concave to f65, since p39(v36) is 0.001213 above -QH6113 qhull precision error: f125 is flipped(interior point is outside) -QH6115 qhull precision error: f134 is concave to f139, since p46(v40) is 0.07699 above -QH6115 qhull precision error: f139 is concave to f134, since p47(v41) is 0.01871 above -QH6115 qhull precision error: f141 is concave to f144, since p47(v41) is 0.1017 above -QH6115 qhull precision error: f144 is concave to f14 -Convex hull of 50 points in 3-d: - - Number of vertices: 50 - Number of facets: 96 - -Statistics for: rbox 50 s | qhull Q0 V0.05 W0.01 Tc Po - - Number of points processed: 50 - Number of hyperplanes created: 171 - Number of distance tests for qhull: 552 - CPU seconds to compute hull (after input): 0 - -1, since p35(v42) is 0.03263 above -QH6115 qhull precision error: f145 is concave to f39, since p2(v43) is 0.04048 above -QH6115 qhull precision error: f149 is concave to f106, since p18(v44) is 0.009672 above -QH6113 qhull precision error: f152 is flipped(interior point is outside) -QH6113 qhull precision error: f155 is flipped(interior point is outside) -QH6113 qhull precision error: f161 is flipped(interior point is outside) -QH6113 qhull precision error: f164 is flipped(interior point is outside) -QH6115 qhull precision error: f166 is concave to f170, since p16(v10) is 0.04552 above -QH6113 qhull precision error: f170 is flipped(interior point is outside) - -precision problems (corrected unless 'Q0' or an error) - 37 concave half ridges in output - 7 flipped facets - 82 coplanar horizon facets for new vertices -rbox 100 s D5 | qhull Q0 R1e-2 Tc Po - -Convex hull of 100 points in 5-d: - - Number of vertices: 37 - Number of facets: 500 - -Statistics for: rbox 100 s D5 | qhull Q0 R1e-2 Tc Po - - Number of points processed: 37 - Number of hyperplanes created: 1198 - Number of distance tests for qhull: 2764 - -QH6107 qhull precision error: facets f1150, f1191 and f1152 meet at a ridge with more than 2 neighbors. Can not continue. -ERRONEOUS FACET: -- f1150 - - flags: top simplicial new - - normal: -0.7563 0.3207 -0.3738 0.2956 0.3133 - - offset: -0.2362615 - - vertices: p70(v37) p59(v25) p47(v17) p33(v15) p6(v9) - - neighboring facets: f519 f1148 f1151 f1152 f1153 -ERRONEOUS OTHER FACET: -- f1191 - - flags: top simplicial new - - normal: 0.7615 -0.2592 0.3014 -0.3662 -0.3577 - - offset: 0.27682 - - vertices: p70(v37) p59(v25) p47(v17) p6(v9) p54(v0) - - neighboring facets: f519 f1148 -ERRONEOUS and NEIGHBORING FACETS to output - -While executing: rbox 100 s D5 | qhull Q0 R1e-2 Tc Po -Options selected for Qhull 2012.1 2012/01/22: - run-id 315466858 Q0-no-premerge Random_perturb 0.01 Tcheck-frequently - Poutput-forced _max-width 0.88 Error-roundoff 0.0045 - Visible-distance 0.0045 U-coplanar-distance 0.0045 Width-outside 0.009 - _wide-facet 0.027 -Last point added to hull was p70. - -precision problems (corrected unless 'Q0' or an error) - 50 coplanar horizon facets for new vertices - -Precision problems were detected during construction of the convex hull. -This occurs because convex hull algorithms assume that calculations are -exact, but floating-point arithmetic has roundoff errors. - -To correct for precision problems, do not use 'Q0'. By default, Qhull -selects 'C-0' or 'Qx' and merges non-convex facets. With option 'QJ', -Qhull joggles the input to prevent precision problems. See "Imprecision -in Qhull" (qh-impre.htm). - -If you use 'Q0', the output may include -coplanar ridges, concave ridges, and flipped facets. In 4-d and higher, -Qhull may produce a ridge with four neighbors or two facets with the same -vertices. Qhull reports these events when they occur. It stops when a -concave ridge, flipped facet, or duplicate facet occurs. - -If you need triangular output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft'. It triangulates non-simplicial facets with added points. - -If you must use 'Q0', -try one or more of the following options. They can not guarantee an output. - - use 'QbB' to scale the input to a cube. - - use 'Po' to produce output and prevent partitioning for flipped facets - - use 'V0' to set min. distance to visible facet as 0 instead of roundoff - - use 'En' to specify a maximum roundoff error less than 0.0045. - - options 'Qf', 'Qbb', and 'QR0' may also help - -To guarantee simplicial output: - - use option 'Qt' to triangulate the output - - use option 'QJ' to joggle the input points and remove precision errors - - use option 'Ft' to triangulate the output by adding points - - use exact arithmetic (see "Imprecision in Qhull", qh-impre.htm) -qhull - -qhull- compute convex hulls and related structures. Qhull 2012.1 2012/01/22 - input (stdin): dimension, n, point coordinates - comments start with a non-numeric character - halfspace: use dim+1 and put offsets after coefficients - -options (qh-quick.htm): - d - Delaunay triangulation by lifting points to a paraboloid - d Qu - furthest-site Delaunay triangulation (upper convex hull) - v - Voronoi diagram as the dual of the Delaunay triangulation - v Qu - furthest-site Voronoi diagram - H1,1 - Halfspace intersection about [1,1,0,...] via polar duality - Qt - triangulated output - QJ - joggled input instead of merged facets - Tv - verify result: structure, convexity, and point inclusion - . - concise list of all options - - - one-line description of each option - -Output options (subset): - s - summary of results (default) - i - vertices incident to each facet - n - normals with offsets - p - vertex coordinates (if 'Qc', includes coplanar points) - if 'v', Voronoi vertices - Fp - halfspace intersections - Fx - extreme points (convex hull vertices) - FA - compute total area and volume - o - OFF format (if 'v', outputs Voronoi regions) - G - Geomview output (2-d, 3-d and 4-d) - m - Mathematica output (2-d and 3-d) - QVn - print facets that include point n, -n if not - TO file- output results to file, may be enclosed in single quotes - -examples: - rbox c d D2 | qhull Qc s f Fx | more rbox 1000 s | qhull Tv s FA - rbox 10 D2 | qhull d QJ s i TO result rbox 10 D2 | qhull v Qbb Qt p - rbox 10 D2 | qhull d Qu QJ m rbox 10 D2 | qhull v Qu QJ o - rbox c | qhull n rbox c | qhull FV n | qhull H Fp - rbox d D12 | qhull QR0 FA rbox c D7 | qhull FA TF1000 - rbox y 1000 W0 | qhull rbox 10 | qhull v QJ o Fv - -qhull . - -Qhull 2012.1 2012/01/22. -Except for 'F.' and 'PG', upper-case options take an argument. - - delaunay voronoi Geomview Halfspace facet_dump - incidences mathematica normals OFF_format points - summary - - Farea FArea-total Fcoplanars FCentrums Fd-cdd-in - FD-cdd-out FF-dump-xridge Finner FIDs Fmerges - Fneighbors FNeigh-vertex Fouter FOptions Fpoint-intersect - FPoint_near FQhull Fsummary FSize Ftriangles - Fvertices Fvoronoi FVertex-ave Fxtremes FMaple - - Gvertices Gpoints Gall_points Gno_planes Ginner - Gcentrums Ghyperplanes Gridges Gouter GDrop_dim - Gtransparent - - PArea-keep Pdrop d0:0D0 Pgood PFacet_area_keep - PGood_neighbors PMerge-keep Poutput_forced Pprecision_not - - QbBound 0:0.5 Qbk:0Bk:0_drop QbB-scale-box Qbb-scale-last Qcoplanar - Qfurthest Qgood_only QGood_point Qinterior Qmax_out - QJoggle Qrandom QRotate Qsearch_1st Qtriangulate - QupperDelaunay QVertex_good Qvneighbors Qxact_merge Qzinfinite - - Q0_no_premerge Q1_no_angle Q2_no_independ Q3_no_redundant Q4_no_old - Q5_no_check_out Q6_no_concave Q7_depth_first Q8_no_near_in Q9_pick_furthest - Q10_no_narrow Q11_trinormals - - T4_trace Tannotate Tcheck_often Tstatistics Tverify - Tz_stdout TFacet_log TInput_file TPoint_trace TMerge_trace - TOutput_file TRerun TWide_trace TVertex_stop TCone_stop - - Angle_max Centrum_size Error_round Random_dist Visible_min - Ucoplanar_max Wide_outside -qhull - - -qhull- compute convex hulls and related structures. - http://www.qhull.org 2012.1 2012/01/22 - -input (stdin): - first lines: dimension and number of points (or vice-versa). - other lines: point coordinates, best if one point per line - comments: start with a non-numeric character - halfspaces: use dim plus one and put offset after coefficients. - May be preceeded by a single interior point ('H'). - -options: - d - Delaunay triangulation by lifting points to a paraboloid - d Qu - furthest-site Delaunay triangulation (upper convex hull) - v - Voronoi diagram (dual of the Delaunay triangulation) - v Qu - furthest-site Voronoi diagram - Hn,n,... - halfspace intersection about point [n,n,0,...] - Qt - triangulated output - QJ - joggled input instead of merged facets - Qc - keep coplanar points with nearest facet - Qi - keep interior points with nearest facet - -Qhull control options: - Qbk:n - scale coord k so that low bound is n - QBk:n - scale coord k so that upper bound is n (QBk is 0.5) - QbB - scale input to unit cube centered at the origin - Qbb - scale last coordinate to [0,m] for Delaunay triangulations - Qbk:0Bk:0 - remove k-th coordinate from input - QJn - randomly joggle input in range [-n,n] - QRn - random rotation (n=seed, n=0 time, n=-1 time/no rotate) - Qf - partition point to furthest outside facet - Qg - only build good facets (needs 'QGn', 'QVn', or 'PdD') - Qm - only process points that would increase max_outside - Qr - process random outside points instead of furthest ones - Qs - search all points for the initial simplex - Qu - for 'd' or 'v', compute upper hull without point at-infinity - returns furthest-site Delaunay triangulation - Qv - test vertex neighbors for convexity - Qx - exact pre-merges (skips coplanar and angle-coplanar facets) - Qz - add point-at-infinity to Delaunay triangulation - QGn - good facet if visible from point n, -n for not visible - QVn - good facet if it includes point n, -n if not - Q0 - turn off default premerge with 'C-0'/'Qx' - Q1 - sort merges by type instead of angle - Q2 - merge all non-convex at once instead of independent sets - Q3 - do not merge redundant vertices - Q4 - avoid old->new merges - Q5 - do not correct outer planes at end of qhull - Q6 - do not pre-merge concave or coplanar facets - Q7 - depth-first processing instead of breadth-first - Q8 - do not process near-inside points - Q9 - process furthest of furthest points - Q10 - no special processing for narrow distributions - Q11 - copy normals and recompute centrums for tricoplanar facets - -Topts- Trace options: - T4 - trace at level n, 4=all, 5=mem/gauss, -1= events - Ta - annotate output with message codes - Tc - check frequently during execution - Ts - print statistics - Tv - verify result: structure, convexity, and point inclusion - Tz - send all output to stdout - TFn - report summary when n or more facets created - TI file - input data from file, no spaces or single quotes - TO file - output results to file, may be enclosed in single quotes - TPn - turn on tracing when point n added to hull - TMn - turn on tracing at merge n - TWn - trace merge facets when width > n - TRn - rerun qhull n times. Use with 'QJn' - TVn - stop qhull after adding point n, -n for before (see TCn) - TCn - stop qhull after building cone for point n (see TVn) - -Precision options: - Cn - radius of centrum (roundoff added). Merge facets if non-convex - An - cosine of maximum angle. Merge facets if cosine > n or non-convex - C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge - En - max roundoff error for distance computation - Rn - randomly perturb computations by a factor of [1-n,1+n] - Vn - min distance above plane for a visible facet (default 3C-n or En) - Un - max distance below plane for a new, coplanar point (default Vn) - Wn - min facet width for outside point (before roundoff, default 2Vn) - -Output formats (may be combined; if none, produces a summary to stdout): - f - facet dump - G - Geomview output (see below) - i - vertices incident to each facet - m - Mathematica output (2-d and 3-d) - o - OFF format (dim, points and facets; Voronoi regions) - n - normals with offsets - p - vertex coordinates or Voronoi vertices (coplanar points if 'Qc') - s - summary (stderr) - -More formats: - Fa - area for each facet - FA - compute total area and volume for option 's' - Fc - count plus coplanar points for each facet - use 'Qc' (default) for coplanar and 'Qi' for interior - FC - centrum or Voronoi center for each facet - Fd - use cdd format for input (homogeneous with offset first) - FD - use cdd format for numeric output (offset first) - FF - facet dump without ridges - Fi - inner plane for each facet - for 'v', separating hyperplanes for bounded Voronoi regions - FI - ID of each facet - Fm - merge count for each facet (511 max) - FM - Maple output (2-d and 3-d) - Fn - count plus neighboring facets for each facet - FN - count plus neighboring facets for each point - Fo - outer plane (or max_outside) for each facet - for 'v', separating hyperplanes for unbounded Voronoi regions - FO - options and precision constants - Fp - dim, count, and intersection coordinates (halfspace only) - FP - nearest vertex and distance for each coplanar point - FQ - command used for qhull - Fs - summary: #int (8), dimension, #points, tot vertices, tot facets, - output: #vertices, #facets, #coplanars, #nonsimplicial - #real (2), max outer plane, min vertex - FS - sizes: #int (0) - #real (2) tot area, tot volume - Ft - triangulation with centrums for non-simplicial facets (OFF format) - Fv - count plus vertices for each facet - for 'v', Voronoi diagram as Voronoi vertices for pairs of sites - FV - average of vertices (a feasible point for 'H') - Fx - extreme points (in order for 2-d) - -Geomview options (2-d, 3-d, and 4-d; 2-d Voronoi) - Ga - all points as dots - Gp - coplanar points and vertices as radii - Gv - vertices as spheres - Gi - inner planes only - Gn - no planes - Go - outer planes only - Gc - centrums - Gh - hyperplane intersections - Gr - ridges - GDn - drop dimension n in 3-d and 4-d output - Gt - for 3-d 'd', transparent outer ridges - -Print options: - PAn - keep n largest facets by area - Pdk:n - drop facet if normal[k] <= n (default 0.0) - PDk:n - drop facet if normal[k] >= n - Pg - print good facets (needs 'QGn' or 'QVn') - PFn - keep facets whose area is at least n - PG - print neighbors of good facets - PMn - keep n facets with most merges - Po - force output. If error, output neighborhood of facet - Pp - do not report precision problems - - . - list of all options - - - one line descriptions of all options -rbox - --rbox- generate various point distributions. Default is random in cube. - -args (any order, space separated): Version: 2001/06/24 - 3000 number of random points in cube, lens, spiral, sphere or grid - D3 dimension 3-d - c add a unit cube to the output ('c G2.0' sets size) - d add a unit diamond to the output ('d G2.0' sets size) - l generate a regular 3-d spiral - r generate a regular polygon, ('r s Z1 G0.1' makes a cone) - s generate cospherical points - x generate random points in simplex, may use 'r' or 'Wn' - y same as 'x', plus simplex - Pn,m,r add point [n,m,r] first, pads with 0 - - Ln lens distribution of radius n. Also 's', 'r', 'G', 'W'. - Mn,m,r lattice(Mesh) rotated by [n,-m,0], [m,n,0], [0,0,r], ... - '27 M1,0,1' is {0,1,2} x {0,1,2} x {0,1,2}. Try 'M3,4 z'. - W0.1 random distribution within 0.1 of the cube's or sphere's surface - Z0.5 s random points in a 0.5 disk projected to a sphere - Z0.5 s G0.6 same as Z0.5 within a 0.6 gap - - Bn bounding box coordinates, default 0.5 - h output as homogeneous coordinates for cdd - n remove command line from the first line of output - On offset coordinates by n - t use time as the random number seed(default is command line) - tn use n as the random number seed - z print integer coordinates, default 'Bn' is 1e+006 -cat html/qhull.txt html/rbox.txt - - - -qhull(1) qhull(1) - - -NAME - qhull - convex hull, Delaunay triangulation, Voronoi dia- - gram, halfspace intersection about a point, hull volume, facet area - -SYNOPSIS - qhull- compute convex hulls and related structures - input (stdin): dimension, #points, point coordinates - first comment (non-numeric) is listed in the summary - halfspace: use dim plus one with offsets after coefficients - - options (qh-quick.htm): - d - Delaunay triangulation by lifting points to a paraboloid - v - Voronoi diagram via the Delaunay triangulation - H1,1 - Halfspace intersection about [1,1,0,...] - d Qu - Furthest-site Delaunay triangulation (upper convex hull) - v Qu - Furthest-site Voronoi diagram - QJ - Joggle the input to avoid precision problems - . - concise list of all options - - - one-line description of all options - - Output options (subset): - FA - compute total area and volume - Fx - extreme points (convex hull vertices) - G - Geomview output (2-d, 3-d and 4-d) - Fp - halfspace intersection coordinates - m - Mathematica output (2-d and 3-d) - n - normals with offsets - o - OFF file format (if Voronoi, outputs regions) - TO file- output results to file, may be enclosed in single quotes - f - print all fields of all facets - s - summary of results (default) - Tv - verify result: structure, convexity, and point inclusion - p - vertex coordinates - i - vertices incident to each facet - - example: - rbox 1000 s | qhull Tv s FA - - - html manual: index.htm - - installation: README.txt - - see also: COPYING.txt, REGISTER.txt, Changes.txt - - WWW: - - GIT: - - mirror: - - news: - - Geomview: - - news group: - - FAQ: - - email: qhull@qhull.org - - bug reports: qhull_bug@qhull.org - - - - -Geometry Center 2003/12/30 1 - - - - - -qhull(1) qhull(1) - - - The sections are: - - INTRODUCTION - - DESCRIPTION, a description of Qhull - - IMPRECISION, how Qhull handles imprecision - - OPTIONS - - Input and output options - - Additional input/output formats - - Precision options - - Geomview options - - Print options - - Qhull options - - Trace options - - BUGS - - E-MAIL - - SEE ALSO - - AUTHORS - - ACKNOWLEGEMENTS - - This man page briefly describes all Qhull options. Please - report any mismatches with Qhull's html manual (qh- - man.htm). - - - -INTRODUCTION - Qhull is a general dimension code for computing convex - hulls, Delaunay triangulations, Voronoi diagram, furthest- - site Voronoi diagram, furthest-site Delaunay triangula- - tions, and halfspace intersections about a point. It - implements the Quickhull algorithm for computing the con- - vex hull. Qhull handles round-off errors from floating - point arithmetic. It can approximate a convex hull. - - The program includes options for hull volume, facet area, - partial hulls, input transformations, randomization, trac- - ing, multiple output formats, and execution statistics. - The program can be called from within your application. - You can view the results in 2-d, 3-d and 4-d with - Geomview. - - -DESCRIPTION - The format of input is the following: first line contains - the dimension, second line contains the number of input - points, and point coordinates follow. The dimension and - number of points can be reversed. Comments and line - breaks are ignored. A comment starts with a non-numeric - character and continues to the end of line. The first - comment is reported in summaries and statistics. Error - reporting is better if there is one point per line. - - The default printout option is a short summary. There are - many other output formats. - - - - -Geometry Center 2003/12/30 2 - - - - - -qhull(1) qhull(1) - - - Qhull implements the Quickhull algorithm for convex hull. - This algorithm combines the 2-d Quickhull algorithm with - the n-d beneath-beyond algorithm [c.f., Preparata & Shamos - '85]. It is similar to the randomized algorithms of - Clarkson and others [Clarkson et al. '93]. The main - advantages of Quickhull are output sensitive performance, - reduced space requirements, and automatic handling of pre- - cision problems. - - The data structure produced by Qhull consists of vertices, - ridges, and facets. A vertex is a point of the input set. - A ridge is a set of d vertices and two neighboring facets. - For example in 3-d, a ridge is an edge of the polyhedron. - A facet is a set of ridges, a set of neighboring facets, a - set of incident vertices, and a hyperplane equation. For - simplicial facets, the ridges are defined by the vertices - and neighboring facets. When Qhull merges two facets, it - produces a non-simplicial facet. A non-simplicial facet - has more than d neighbors and may share more than one - ridge with a neighbor. - - -IMPRECISION - Since Qhull uses floating point arithmetic, roundoff error - may occur for each calculation. This causes problems for - most geometric algorithms. - - Qhull automatically sets option 'C-0' in 2-d, 3-d, and - 4-d, or option 'Qx' in 5-d and higher. These options han- - dle precision problems by merging facets. Alternatively, - use option 'QJ' to joggle the input. - - With 'C-0', Qhull merges non-convex facets while con- - structing the hull. The remaining facets are clearly con- - vex. With 'Qx', Qhull merges coplanar horizon facets, - flipped facets, concave facets and duplicated ridges. It - merges coplanar facets after constructing the hull. With - 'Qx', coplanar points may be missed, but it appears to be - unlikely. - - To guarantee triangular output, joggle the input with - option 'QJ'. Facet merging will not occur. - -OPTIONS - To get a list of the most important options, execute - 'qhull' by itself. To get a complete list of options, - execute 'qhull -'. To get a complete, concise list of - options, execute 'qhull .'. - - Options can be in any order. Capitalized options take an - argument (except 'PG' and 'F' options). Single letters - are used for output formats and precision constants. The - other options are grouped into menus for other output for- - mats ('F'), Geomview output ('G'), printing ('P'), Qhull - - - -Geometry Center 2003/12/30 3 - - - - - -qhull(1) qhull(1) - - - control ('Q'), and tracing ('T'). - - Main options: - - default - Compute the convex hull of the input points. - Report a summary of the result. - - d Compute the Delaunay triangulation by lifting the - input points to a paraboloid. The 'o' option - prints the input points and facets. The 'QJ' - option guarantees triangular output. The 'Ft' - option prints a triangulation. It adds points (the - centrums) to non-simplicial facets. - - v Compute the Voronoi diagram from the Delaunay tri- - angulation. The 'p' option prints the Voronoi ver- - tices. The 'o' option prints the Voronoi vertices - and the vertices in each Voronoi region. It lists - regions in site id order. The 'Fv' option prints - each ridge of the Voronoi diagram. The first or - zero'th vertex indicates the infinity vertex. Its - coordinates are qh_INFINITE (-10.101). It indi- - cates unbounded Voronoi regions or degenerate - Delaunay triangles. - - Hn,n,... - Compute halfspace intersection about [n,n,0,...]. - The input is a set of halfspaces defined in the - same format as 'n', 'Fo', and 'Fi'. Use 'Fp' to - print the intersection points. Use 'Fv' to list - the intersection points for each halfspace. The - other output formats display the dual convex hull. - - The point [n,n,n,...] is a feasible point for the - halfspaces, i.e., a point that is inside all of the - halfspaces (Hx+b <= 0). The default coordinate - value is 0. - - The input may start with a feasible point. If so, - use 'H' by itself. The input starts with a feasi- - ble point when the first number is the dimension, - the second number is "1", and the coordinates com- - plete a line. The 'FV' option produces a feasible - point for a convex hull. - - d Qu Compute the furthest-site Delaunay triangulation - from the upper convex hull. The 'o' option prints - the input points and facets. The 'QJ' option guar- - antees triangular otuput. You can also use facets. - - v Qu Compute the furthest-site Voronoi diagram. The 'p' - option prints the Voronoi vertices. The 'o' option - prints the Voronoi vertices and the vertices in - - - -Geometry Center 2003/12/30 4 - - - - - -qhull(1) qhull(1) - - - each Voronoi region. The 'Fv' option prints each - ridge of the Voronoi diagram. The first or zero'th - vertex indicates the infinity vertex at infinity. - Its coordinates are qh_INFINITE (-10.101). It - indicates unbounded Voronoi regions and degenerate - Delaunay triangles. - - Qt Triangulated output. - - - Input/Output options: - - f Print out all facets and all fields of each facet. - - G Output the hull in Geomview format. For imprecise - hulls, Geomview displays the inner and outer hull. - Geomview can also display points, ridges, vertices, - coplanar points, and facet intersections. See - below for a list of options. - - For Delaunay triangulations, 'G' displays the cor- - responding paraboloid. For halfspace intersection, - 'G' displays the dual polytope. - - i Output the incident vertices for each facet. Qhull - prints the number of facets followed by the ver- - tices of each facet. One facet is printed per - line. The numbers are the 0-relative indices of - the corresponding input points. The facets are - oriented. - - In 4-d and higher, Qhull triangulates non-simpli- - cial facets. Each apex (the first vertex) is a - created point that corresponds to the facet's cen- - trum. Its index is greater than the indices of the - input points. Each base corresponds to a simpli- - cial ridge between two facets. To print the ver- - tices without triangulation, use option 'Fv'. - - m Output the hull in Mathematica format. Qhull - writes a Mathematica file for 2-d and 3-d convex - hulls and for 2-d Delaunay triangulations. Qhull - produces a list of objects that you can assign to a - variable in Mathematica, for example: "list= << - ". If the object is 2-d, it can be - visualized by "Show[Graphics[list]] ". For 3-d - objects the command is "Show[Graphics3D[list]]". - - n Output the normal equation for each facet. Qhull - prints the dimension (plus one), the number of - facets, and the normals for each facet. The - facet's offset follows its normal coefficients. - - o Output the facets in OFF file format. Qhull prints - the dimension, number of points, number of facets, - and number of ridges. Then it prints the - - - -Geometry Center 2003/12/30 5 - - - - - -qhull(1) qhull(1) - - - coordinates of the input points and the vertices - for each facet. Each facet is on a separate line. - The first number is the number of vertices. The - remainder are the indices of the corresponding - points. The vertices are oriented in 2-d, 3-d, and - in simplicial facets. - - For 2-d Voronoi diagrams, the vertices are sorted - by adjacency, but not oriented. In 3-d and higher, - the Voronoi vertices are sorted by index. See the - 'v' option for more information. - - p Output the coordinates of each vertex point. Qhull - prints the dimension, the number of points, and the - coordinates for each vertex. With the 'Gc' and - 'Gi' options, it also prints coplanar and interior - points. For Voronoi diagrams, it prints the coor- - dinates of each Voronoi vertex. - - s Print a summary to stderr. If no output options - are specified at all, a summary goes to stdout. - The summary lists the number of input points, the - dimension, the number of vertices in the convex - hull, the number of facets in the convex hull, the - number of good facets (if 'Pg'), and statistics. - - The last two statistics (if needed) measure the - maximum distance from a point or vertex to a facet. - The number in parenthesis (e.g., 2.1x) is the ratio - between the maximum distance and the worst-case - distance due to merging two simplicial facets. - - - Precision options - - An Maximum angle given as a cosine. If the angle - between a pair of facet normals is greater than n, Qhull - merges one of the facets into a neighbor. If 'n' - is negative, Qhull tests angles after adding each - point to the hull (pre-merging). If 'n' is posi- - tive, Qhull tests angles after constructing the - hull (post-merging). Both pre- and post-merging - can be defined. - - Option 'C0' or 'C-0' is set if the corresponding - 'Cn' or 'C-n' is not set. If 'Qx' is set, then 'A- - n' and 'C-n' are checked after the hull is con- - structed and before 'An' and 'Cn' are checked. - - Cn Centrum radius. If a centrum is less than n below - a neighboring facet, Qhull merges one of the - facets. If 'n' is negative or '-0', Qhull tests - and merges facets after adding each point to the - hull. This is called "pre-merging". If 'n' is - - - -Geometry Center 2003/12/30 6 - - - - - -qhull(1) qhull(1) - - - positive, Qhull tests for convexity after con- - structing the hull ("post-merging"). Both pre- and - post-merging can be defined. - - For 5-d and higher, 'Qx' should be used instead of - 'C-n'. Otherwise, most or all facets may be merged - together. - - En Maximum roundoff error for distance computations. - - Rn Randomly perturb distance computations up to +/- n - * max_coord. This option perturbs every distance, - hyperplane, and angle computation. To use time as - the random number seed, use option 'QR-1'. - - Vn Minimum distance for a facet to be visible. A - facet is visible if the distance from the point to - the facet is greater than 'Vn'. - - Without merging, the default value for 'Vn' is the - round-off error ('En'). With merging, the default - value is the pre-merge centrum ('C-n') in 2-d or - 3--d, or three times that in other dimensions. If - the outside width is specified ('Wn'), the maximum, - default value for 'Vn' is 'Wn'. - - Un Maximum distance below a facet for a point to be - coplanar to the facet. The default value is 'Vn'. - - Wn Minimum outside width of the hull. Points are - added to the convex hull only if they are clearly - outside of a facet. A point is outside of a facet - if its distance to the facet is greater than 'Wn'. - The normal value for 'Wn' is 'En'. If the user - specifies pre-merging and does not set 'Wn', than - 'Wn' is set to the premerge 'Cn' and maxco- - ord*(1-An). - - - Additional input/output formats - - Fa Print area for each facet. For Delaunay triangula- - tions, the area is the area of the triangle. For - Voronoi diagrams, the area is the area of the dual - facet. Use 'PAn' for printing the n largest - facets, and option 'PFn' for printing facets larger - than 'n'. - - The area for non-simplicial facets is the sum of - the areas for each ridge to the centrum. Vertices - far below the facet's hyperplane are ignored. The - reported area may be significantly less than the - actual area. - - - - -Geometry Center 2003/12/30 7 - - - - - -qhull(1) qhull(1) - - - FA Compute the total area and volume for option 's'. - It is an approximation for non-simplicial facets - (see 'Fa'). - - Fc Print coplanar points for each facet. The output - starts with the number of facets. Then each facet - is printed one per line. Each line is the number - of coplanar points followed by the point ids. - Option 'Qi' includes the interior points. Each - coplanar point (interior point) is assigned to the - facet it is furthest above (resp., least below). - - FC Print centrums for each facet. The output starts - with the dimension followed by the number of - facets. Then each facet centrum is printed, one - per line. - - Fd Read input in cdd format with homogeneous points. - The input starts with comments. The first comment - is reported in the summary. Data starts after a - "begin" line. The next line is the number of - points followed by the dimension+1 and "real" or - "integer". Then the points are listed with a - leading "1" or "1.0". The data ends with an "end" - line. - - For halfspaces ('Fd Hn,n,...'), the input format is - the same. Each halfspace starts with its offset. - The sign of the offset is the opposite of Qhull's - convention. - - FD Print normals ('n', 'Fo', 'Fi') or points ('p') in - cdd format. The first line is the command line - that invoked Qhull. Data starts with a "begin" - line. The next line is the number of normals or - points followed by the dimension+1 and "real". - Then the normals or points are listed with the - offset before the coefficients. The offset for - points is 1.0. The offset for normals has the - opposite sign. The data ends with an "end" line. - - FF Print facets (as in 'f') without printing the - ridges. - - Fi Print inner planes for each facet. The inner plane - is below all vertices. - - Fi Print separating hyperplanes for bounded, inner - regions of the Voronoi diagram. The first line is - the number of ridges. Then each hyperplane is - printed, one per line. A line starts with the num- - ber of indices and floats. The first pair lists - adjacent input sites, the next d floats are the - normalized coefficients for the hyperplane, and the - - - -Geometry Center 2003/12/30 8 - - - - - -qhull(1) qhull(1) - - - last float is the offset. The hyperplane is ori- - ented toward verify that the hyperplanes are per- - pendicular bisectors. Use 'Fo' for unbounded - regions, and 'Fv' for the corresponding Voronoi - vertices. - - FI Print facet identifiers. - - Fm Print number of merges for each facet. At most 511 - merges are reported for a facet. See 'PMn' for - printing the facets with the most merges. - - FM Output the hull in Maple format. See 'm' - - Fn Print neighbors for each facet. The output starts - with the number of facets. Then each facet is - printed one per line. Each line is the number of - neighbors followed by an index for each neighbor. - The indices match the other facet output formats. - - A negative index indicates an unprinted facet due - to printing only good facets ('Pg'). It is the - negation of the facet's id (option 'FI'). For - example, negative indices are used for facets "at - infinity" in the Delaunay triangulation. - - FN Print vertex neighbors or coplanar facet for each - point. The first line is the number of points. - Then each point is printed, one per line. If the - point is coplanar, the line is "1" followed by the - facet's id. If the point is not a selected vertex, - the line is "0". Otherwise, each line is the num- - ber of neighbors followed by the corresponding - facet indices (see 'Fn'). - - Fo Print outer planes for each facet in the same for- - mat as 'n'. The outer plane is above all points. - - Fo Print separating hyperplanes for unbounded, outer - regions of the Voronoi diagram. The first line is - the number of ridges. Then each hyperplane is - printed, one per line. A line starts with the num- - ber of indices and floats. The first pair lists - adjacent input sites, the next d floats are the - normalized coefficients for the hyperplane, and the - last float is the offset. The hyperplane is ori- - ented toward verify that the hyperplanes are per- - pendicular bisectors. Use 'Fi' for bounded - regions, and 'Fv' for the corresponding Voronoi - vertices. - - FO List all options to stderr, including the default - values. Additional 'FO's are printed to stdout. - - Fp Print points for halfspace intersections (option - 'Hn,n,...'). Each intersection corresponds to a - - - -Geometry Center 2003/12/30 9 - - - -qhull(1) qhull(1) - - - facet of the dual polytope. The "infinity" point - [-10.101,-10.101,...] indicates an unbounded - intersection. - - FP For each coplanar point ('Qc') print the point id - of the nearest vertex, the point id, the facet id, - and the distance. - - FQ Print command used for qhull and input. - - Fs Print a summary. The first line consists of the - number of integers ("7"), followed by the dimen- - sion, the number of points, the number of vertices, - the number of facets, the number of vertices - selected for output, the number of facets selected - for output, the number of coplanar points selected - for output. - - The second line consists of the number of reals - ("2"), followed by the maxmimum offset to an outer - plane and and minimum offset to an inner plane. - Roundoff is included. Later versions of Qhull may - produce additional integers or reals. - - FS Print the size of the hull. The first line con- - sists of the number of integers ("0"). The second - line consists of the number of reals ("2"), fol- - lowed by the total facet area, and the total vol- - ume. Later versions of Qhull may produce addi- - tional integers or reals. - - The total volume measures the volume of the inter- - section of the halfspaces defined by each facet. - Both area and volume are approximations for non- - simplicial facets. See option 'Fa'. - - Ft Print a triangulation with added points for non- - simplicial facets. The first line is the dimension - and the second line is the number of points and the - number of facets. The points follow, one per line, - then the facets follow as a list of point indices. - With option points include the point-at-infinity. - - Fv Print vertices for each facet. The first line is - the number of facets. Then each facet is printed, - one per line. Each line is the number of vertices - followed by the corresponding point ids. Vertices - are listed in the order they were added to the hull - (the last one is first). - - Fv Print all ridges of a Voronoi diagram. The first - line is the number of ridges. Then each ridge is - printed, one per line. A line starts with the num- - ber of indices. The first pair lists adjacent - - - -Geometry Center 2003/12/30 10 - - - - - -qhull(1) qhull(1) - - - input sites, the remaining indices list Voronoi - vertices. Vertex '0' indicates the vertex-at- - infinity (i.e., an unbounded ray). In 3-d, the - vertices are listed in order. See 'Fi' and 'Fo' - for separating hyperplanes. - - FV Print average vertex. The average vertex is a fea- - sible point for halfspace intersection. - - Fx List extreme points (vertices) of the convex hull. - The first line is the number of points. The other - lines give the indices of the corresponding points. - The first point is '0'. In 2-d, the points occur - in counter-clockwise order; otherwise they occur in - input order. For Delaunay triangulations, 'Fx' - lists the extreme points of the input sites. The - points are unordered. - - - Geomview options - - G Produce a file for viewing with Geomview. Without - other options, Qhull displays edges in 2-d, outer - planes in 3-d, and ridges in 4-d. A ridge can be - explicit or implicit. An explicit ridge is a dim-1 - dimensional simplex between two facets. In 4-d, - the explicit ridges are triangles. When displaying - a ridge in 4-d, Qhull projects the ridge's vertices - to one of its facets' hyperplanes. Use 'Gh' to - project ridges to the intersection of both hyper- - planes. - - Ga Display all input points as dots. - - Gc Display the centrum for each facet in 3-d. The - centrum is defined by a green radius sitting on a - blue plane. The plane corresponds to the facet's - hyperplane. The radius is defined by 'C-n' or - 'Cn'. - - GDn Drop dimension n in 3-d or 4-d. The result is a - 2-d or 3-d object. - - Gh Display hyperplane intersections in 3-d and 4-d. - In 3-d, the intersection is a black line. It lies - on two neighboring hyperplanes (c.f., the blue - squares associated with centrums ('Gc')). In 4-d, - the ridges are projected to the intersection of - both hyperplanes. - - Gi Display inner planes in 2-d and 3-d. The inner - plane of a facet is below all of its vertices. It - is parallel to the facet's hyperplane. The inner - plane's color is the opposite (1-r,1-g,1-b) of the - - - -Geometry Center 2003/12/30 11 - - - - - -qhull(1) qhull(1) - - - outer plane. Its edges are determined by the ver- - tices. - - Gn Do not display inner or outer planes. By default, - Geomview displays the precise plane (no merging) or - both inner and output planes (merging). Under - merging, Geomview does not display the inner plane - if the the difference between inner and outer is - too small. - - Go Display outer planes in 2-d and 3-d. The outer - plane of a facet is above all input points. It is - parallel to the facet's hyperplane. Its color is - determined by the facet's normal, and its edges are - determined by the vertices. - - Gp Display coplanar points and vertices as radii. A - radius defines a ball which corresponds to the - imprecision of the point. The imprecision is the - maximum of the roundoff error, the centrum radius, - and maxcoord * (1-An). It is at least 1/20'th of - the maximum coordinate, and ignores post-merging if - pre-merging is done. - - Gr Display ridges in 3-d. A ridge connects the two - vertices that are shared by neighboring facets. - Ridges are always displayed in 4-d. - - Gt A 3-d Delaunay triangulation looks like a convex - hull with interior facets. Option 'Gt' removes the - outside ridges to reveal the outermost facets. It - automatically sets options 'Gr' and 'GDn'. - - Gv Display vertices as spheres. The radius of the - sphere corresponds to the imprecision of the data. - See 'Gp' for determining the radius. - - - Print options - - PAn Only the n largest facets are marked good for - printing. Unless 'PG' is set, 'Pg' is automati- - cally set. - - Pdk:n Drop facet from output if normal[k] <= n. The - option 'Pdk' uses the default value of 0 for n. - - PDk:n Drop facet from output if normal[k] >= n. The - option 'PDk' uses the default value of 0 for n. - - PFn Only facets with area at least 'n' are marked good - for printing. Unless 'PG' is set, 'Pg' is automat- - ically set. - - - - -Geometry Center 2003/12/30 12 - - - - - -qhull(1) qhull(1) - - - Pg Print only good facets. A good facet is either - visible from a point (the 'QGn' option) or includes - a point (the 'QVn' option). It also meets the - requirements of 'Pdk' and 'PDk' options. Option - 'Pg' is automatically set for options 'PAn' and - 'PFn'. - - PG Print neighbors of good facets. - - PMn Only the n facets with the most merges are marked - good for printing. Unless 'PG' is set, 'Pg' is - automatically set. - - Po Force output despite precision problems. Verify ('Tv') does not check - coplanar points. Flipped facets are reported and - concave facets are counted. If 'Po' is used, - points are not partitioned into flipped facets and - a flipped facet is always visible to a point. - Also, if an error occurs before the completion of - Qhull and tracing is not active, 'Po' outputs a - neighborhood of the erroneous facets (if any). - - Pp Do not report precision problems. - - - Qhull control options - - Qbk:0Bk:0 - Drop dimension k from the input points. This - allows the user to take convex hulls of sub-dimen- - sional objects. It happens before the Delaunay and - Voronoi transformation. - - QbB Scale the input points to fit the unit cube. After - scaling, the lower bound will be -0.5 and the upper - bound +0.5 in all dimensions. For Delaunay and - Voronoi diagrams, scaling happens after projection - to the paraboloid. Under precise arithmetic, scal- - ing does not change the topology of the convex - hull. - - Qbb Scale the last coordinate to [0, m] where m is the - maximum absolute value of the other coordinates. - For Delaunay and Voronoi diagrams, scaling happens - after projection to the paraboloid. It reduces - roundoff error for inputs with integer coordinates. - Under precise arithmetic, scaling does not change - the topology of the convex hull. - - Qbk:n Scale the k'th coordinate of the input points. - After scaling, the lower bound of the input points - will be n. 'Qbk' scales to -0.5. - - - -Geometry Center 2003/12/30 13 - - - - - -qhull(1) qhull(1) - - - QBk:n Scale the k'th coordinate of the input points. - After scaling, the upper bound will be n. 'QBk' - scales to +0.5. - - Qc Keep coplanar points with the nearest facet. Out- - put formats 'p', 'f', 'Gp', 'Fc', 'FN', and 'FP' - will print the points. - - Qf Partition points to the furthest outside facet. - - Qg Only build good facets. With the 'Qg' option, - Qhull will only build those facets that it needs to - determine the good facets in the output. See - 'QGn', 'QVn', and 'PdD' for defining good facets, - and 'Pg' and 'PG' for printing good facets and - their neighbors. - - QGn A facet is good (see 'Qg' and 'Pg') if it is visi- - ble from point n. If n < 0, a facet is good if it - is not visible from point n. Point n is not added - to the hull (unless 'TCn' or 'TPn'). With rbox, - use the 'Pn,m,r' option to define your point; it - will be point 0 (QG0). - - Qi Keep interior points with the nearest facet. Out- - put formats 'p', 'f', 'Gp', 'FN', 'FP', and 'Fc' - will print the points. - - QJn Joggle each input coordinate by adding a random - number in [-n,n]. If a precision error occurs, - then qhull increases n and tries again. It does - not increase n beyond a certain value, and it stops - after a certain number of attempts [see user.h]. - Option 'QJ' selects a default value for n. The - output will be simplicial. For Delaunay triangula- - tions, 'QJn' sets 'Qbb' to scale the last coordi- - nate (not if 'Qbk:n' or 'QBk:n' is set). 'QJn' is - deprecated for Voronoi diagrams. See also 'Qt'. - - Qm Only process points that would otherwise increase - max_outside. Other points are treated as coplanar - or interior points. - - Qr Process random outside points instead of furthest - ones. This makes Qhull equivalent to the random- - ized incremental algorithms. CPU time is not - reported since the randomization is inefficient. - - QRn Randomly rotate the input points. If n=0, use time - as the random number seed. If n>0, use n as the - random number seed. If n=-1, don't rotate but use - time as the random number seed. For Delaunay tri- - angulations ('d' and 'v'), rotate about the last - axis. - - - - -Geometry Center 2003/12/30 14 - - - - - -qhull(1) qhull(1) - - - Qs Search all points for the initial simplex. - - Qt Triangulated output. Triangulate non-simplicial - facets. 'Qt' is deprecated for Voronoi diagrams. - See also 'QJn' - - Qv Test vertex neighbors for convexity after post- - merging. To use the 'Qv' option, you also need to - set a merge option (e.g., 'Qx' or 'C-0'). - - QVn A good facet (see 'Qg' and 'Pg') includes point n. - If n<0, then a good facet does not include point n. - The point is either in the initial simplex or it is - the first point added to the hull. Option 'QVn' - may not be used with merging. - - Qx Perform exact merges while building the hull. The - "exact" merges are merging a point into a coplanar - facet (defined by 'Vn', 'Un', and 'C-n'), merging - concave facets, merging duplicate ridges, and merg- - ing flipped facets. Coplanar merges and angle - coplanar merges ('A-n') are not performed. Concav- - ity testing is delayed until a merge occurs. - - After the hull is built, all coplanar merges are - performed (defined by 'C-n' and 'A-n'), then post- - merges are performed (defined by 'Cn' and 'An'). - - Qz Add a point "at infinity" that is above the - paraboloid for Delaunay triangulations and Voronoi - diagrams. This reduces precision problems and - allows the triangulation of cospherical points. - - - Qhull experiments and speedups - - Q0 Turn off pre-merging as a default option. With - 'Q0'/'Qx' and without explicit pre-merge options, - Qhull ignores precision issues while constructing - the convex hull. This may lead to precision - errors. If so, a descriptive warning is generated. - - Q1 With 'Q1', Qhull sorts merges by type (coplanar, - angle coplanar, concave) instead of by angle. - - Q2 With 'Q2', Qhull merges all facets at once instead - of using independent sets of merges and then - retesting. - - Q3 With 'Q3', Qhull does not remove redundant ver- - tices. - - Q4 With 'Q4', Qhull avoids merges of an old facet into - a new facet. - - Q5 With 'Q5', Qhull does not correct outer planes at - the end. The maximum outer plane is used instead. - - - - -Geometry Center 2003/12/30 15 - - - - - -qhull(1) qhull(1) - - - Q6 With 'Q6', Qhull does not pre-merge concave or - coplanar facets. - - Q7 With 'Q7', Qhull processes facets in depth-first - order instead of breadth-first order. - - Q8 With 'Q8' and merging, Qhull does not retain near- - interior points for adjusting outer planes. 'Qc' - will probably retain all points that adjust outer - planes. - - Q9 With 'Q9', Qhull processes the furthest of all out- - side sets at each iteration. - - Q10 With 'Q10', Qhull does not use special processing - for narrow distributions. - - Q11 With 'Q11', Qhull copies normals and recomputes - centrums for tricoplanar facets. - - Trace options - - Tn Trace at level n. Qhull includes full execution - tracing. 'T-1' traces events. 'T1' traces the - overall execution of the program. 'T2' and 'T3' - trace overall execution and geometric and topologi- - cal events. 'T4' traces the algorithm. 'T5' - includes information about memory allocation and - Gaussian elimination. - - Ta Annotate output with codes that identify the - corresponding qh_fprintf() statement. - - Tc Check frequently during execution. This will catch - most inconsistency errors. - - TCn Stop Qhull after building the cone of new facets - for point n. The output for 'f' includes the cone - and the old hull. See also 'TVn'. - - TFn Report progress whenever more than n facets are - created During post-merging, 'TFn' reports progress - after more than n/2 merges. - - TI file - Input data from 'file'. The filename may not include - spaces or quotes. - - TO file - Output results to 'file'. The name may be enclosed - in single quotes. - - TPn Turn on tracing when point n is added to the hull. - Trace partitions of point n. If used with TWn, turn off - tracing after adding point n to the hull. - - TRn Rerun qhull n times. Usually used with 'QJn' to - determine the probability that a given joggle will - fail. - - Ts Collect statistics and print to stderr at the end - of execution. - - Tv Verify the convex hull. This checks the topologi- - cal structure, facet convexity, and point inclu- - sion. If precision problems occurred, facet con- - vexity is tested whether or not 'Tv' is selected. - Option 'Tv' does not check point inclusion if - - - -Geometry Center 2003/12/30 16 - - - - - -qhull(1) qhull(1) - - - forcing output with 'Po', or if 'Q5' is set. - - For point inclusion testing, Qhull verifies that - all points are below all outer planes (facet->max- - outside). Point inclusion is exhaustive if merging - or if the facet-point product is small enough; oth- - erwise Qhull verifies each point with a directed - search (qh_findbest). - - Point inclusion testing occurs after producing out- - put. It prints a message to stderr unless option - 'Pp' is used. This allows the user to interrupt - Qhull without changing the output. - - TVn Stop Qhull after adding point n. If n < 0, stop - Qhull before adding point n. Output shows the hull - at this time. See also 'TCn' - - TMn Turn on tracing at n'th merge. - - TWn Trace merge facets when the width is greater than - n. - - Tz Redirect stderr to stdout. - - -BUGS - Please report bugs to Brad Barber at - qhull_bug@qhull.org. - - If Qhull does not compile, it is due to an incompatibility - between your system and ours. The first thing to check is - that your compiler is ANSI standard. If it is, check the - man page for the best options, or find someone to help - you. If you locate the cause of your problem, please send - email since it might help others. - - If Qhull compiles but crashes on the test case (rbox D4), - there's still incompatibility between your system and - ours. Typically it's been due to mem.c and memory align- - ment. You can use qh_NOmem in mem.h to turn off memory - management. Please let us know if you figure out how to - fix these problems. - - If you do find a problem, try to simplify it before - reporting the error. Try different size inputs to locate - the smallest one that causes an error. You're welcome to - hunt through the code using the execution trace as a - guide. This is especially true if you're incorporating - Qhull into your own program. - - When you do report an error, please attach a data set to - the end of your message. This allows us to see the error - for ourselves. Qhull is maintained part-time. - - - -Geometry Center 2003/12/30 17 - - - - - -qhull(1) qhull(1) - - -E-MAIL - Please send correspondence to qhull@qhull.org and - report bugs to qhull_bug@qhull.org. Let us know how - you use Qhull. If you mention it in a paper, please send - the reference and an abstract. - - If you would like to get Qhull announcements (e.g., a new - version) and news (any bugs that get fixed, etc.), let us - know and we will add you to our mailing list. If you - would like to communicate with other Qhull users, we will - add you to the qhull_users alias. For Internet news about - geometric algorithms and convex hulls, look at comp.graph- - ics.algorithms and sci.math.num-analysis - - -SEE ALSO - rbox(1) - - Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, "The - Quickhull Algorithm for Convex Hulls," ACM Trans. on Math- - ematical Software, 22(4):469-483, Dec. 1996. - http://portal.acm.org/citation.cfm?doid=235815.235821 - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.117.405 - - - Clarkson, K.L., K. Mehlhorn, and R. Seidel, "Four results - on randomized incremental construction," Computational - Geometry: Theory and Applications, vol. 3, p. 185-211, - 1993. - - Preparata, F. and M. Shamos, Computational Geometry, - Springer-Verlag, New York, 1985. - - - -AUTHORS - C. Bradford Barber Hannu Huhdanpaa - bradb@shore.net hannu@qhull.org - - - -ACKNOWLEDGEMENTS - A special thanks to Albert Marden, Victor Milenkovic, the - Geometry Center, Harvard University, and Endocardial Solu- - tions, Inc. for supporting this work. - - Qhull 1.0 and 2.0 were developed under National Science Foundation - grants NSF/DMS-8920161 and NSF-CCR-91-15793 750-7504. David Dobkin - - - -Geometry Center 2003/12/30 18 - - - - - -qhull(1) qhull(1) - - - guided the original work at Princeton University. If you find it - useful, please let us know. - - The Geometry Center was supported by grant DMS-8920161 from the National - Science Foundation, by grant DOE/DE-FG02-92ER25137 from the Department - of Energy, by the University of Minnesota, and by Minnesota Technology, Inc. - - Qhull is available from http://www.qhull.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Geometry Center 2003/12/30 19 - - - - - -rbox(1) rbox(1) - - -NAME - rbox - generate point distributions for qhull - -SYNOPSIS - Command "rbox" (w/o arguments) lists the options. - -DESCRIPTION - rbox generates random or regular points according to the - options given, and outputs the points to stdout. The - points are generated in a cube, unless 's' or given. The - format of the output is the following: first line contains - the dimension and a comment, second line contains the num- - ber of points, and the following lines contain the points, - one point per line. Points are represented by their coor- - dinate values. - -EXAMPLES - rbox 10 - 10 random points in the unit cube centered at the - origin. - - rbox 10 s D2 - 10 random points on a 2-d circle. - - rbox 100 W0 - 100 random points on the surface of a cube. - - rbox 1000 s D4 - 1000 random points on a 4-d sphere. - - rbox c D5 O0.5 - a 5-d hypercube with one corner at the origin. - - rbox d D10 - a 10-d diamond. - - rbox x 1000 r W0 - 100 random points on the surface of a fixed simplex - - rbox y D12 - a 12-d simplex. - - rbox l 10 - 10 random points along a spiral - - rbox l 10 r - 10 regular points along a spiral plus two end - points - - rbox 1000 L10000 D4 s - 1000 random points on the surface of a narrow lens. - - rbox c G2 d G3 - a cube with coordinates +2/-2 and a diamond with - - - -Geometry Center August 10, 1998 1 - - - - - -rbox(1) rbox(1) - - - coordinates +3/-3. - - rbox 64 M3,4 z - a rotated, {0,1,2,3} x {0,1,2,3} x {0,1,2,3} lat- - tice (Mesh) of integer points. - - rbox P0 P0 P0 P0 P0 - 5 copies of the origin in 3-d. Try 'rbox P0 P0 P0 - P0 P0 | qhull QJ'. - - r 100 s Z1 G0.1 - two cospherical 100-gons plus another cospherical - point. - - 100 s Z1 - a cone of points. - - 100 s Z1e-7 - a narrow cone of points with many precision errors. - -OPTIONS - n number of points - - Dn dimension n-d (default 3-d) - - Bn bounding box coordinates (default 0.5) - - l spiral distribution, available only in 3-d - - Ln lens distribution of radius n. May be used with - 's', 'r', 'G', and 'W'. - - Mn,m,r lattice (Mesh) rotated by {[n,-m,0], [m,n,0], - [0,0,r], ...}. Use 'Mm,n' for a rigid rotation - with r = sqrt(n^2+m^2). 'M1,0' is an orthogonal - lattice. For example, '27 M1,0' is {0,1,2} x - {0,1,2} x {0,1,2}. - - s cospherical points randomly generated in a cube and - projected to the unit sphere - - x simplicial distribution. It is fixed for option - 'r'. May be used with 'W'. - - y simplicial distribution plus a simplex. Both 'x' - and 'y' generate the same points. - - Wn restrict points to distance n of the surface of a - sphere or a cube - - c add a unit cube to the output - - c Gm add a cube with all combinations of +m and -m to - the output - - - -Geometry Center August 10, 1998 2 - - - - - -rbox(1) rbox(1) - - - d add a unit diamond to the output. - - d Gm add a diamond made of 0, +m and -m to the output - - Pn,m,r add point [n,m,r] to the output first. Pad coordi- - nates with 0.0. - - n Remove the command line from the first line of out- - put. - - On offset the data by adding n to each coordinate. - - t use time in seconds as the random number seed - (default is command line). - - tn set the random number seed to n. - - z generate integer coordinates. Use 'Bn' to change - the range. The default is 'B1e6' for six-digit - coordinates. In R^4, seven-digit coordinates will - overflow hyperplane normalization. - - Zn s restrict points to a disk about the z+ axis and the - sphere (default Z1.0). Includes the opposite pole. - 'Z1e-6' generates degenerate points under single - precision. - - Zn Gm s - same as Zn with an empty center (default G0.5). - - r s D2 generate a regular polygon - - r s Z1 G0.1 - generate a regular cone - -BUGS - Some combinations of arguments generate odd results. - - Report bugs to qhull_bug@qhull.org, other correspon- - dence to qhull@qhull.org - -SEE ALSO - qhull(1) - -AUTHOR - C. Bradford Barber - bradb@shore.net - - - - - - - -Geometry Center August 10, 1998 3 - - - -# end of q_test diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test.bat b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test.bat deleted file mode 100755 index a18a6237df..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/q_test.bat +++ /dev/null @@ -1,666 +0,0 @@ -echo Run q_test for Windows from the bin/ directory. >q_test.x -echo === errors if 'user_eg' and 'user_eg2' not found === -echo === check user_eg === >>q_test.x -echo "user_eg 'QR1 p n Qt' 'v p' Fp" >>q_test.x -user_eg "QR1 p n Qt" "v p" Fp >>q_test.x -echo "user_eg2 'QR1 p' 'v p' Fp" >>q_test.x -user_eg2 "QR1 p" "v p" Fp >>q_test.x -echo 'user_eg3 rbox "10 D2" "2 D2" qhull "p"' >>q_test.x -user_eg3 rbox "10 D2" "2 D2" qhull "p" >>q_test.x -echo === check front ends ========================================================== >>q_test.x -echo "qconvex -" >>q_test.x -qconvex - >>q_test.x -echo "qconvex ." >>q_test.x -qconvex . >>q_test.x -echo "qconvex" >>q_test.x -qconvex >>q_test.x -echo "rbox c D3 | qconvex s n Qt" >>q_test.x -rbox c D3 | qconvex s n Qt >>q_test.x -echo "rbox c D2 | qconvex i Qt " >>q_test.x -rbox c D2 | qconvex i Qt >>q_test.x -echo "rbox c D2 | qconvex o" >>q_test.x -rbox c D2 | qconvex o >>q_test.x -echo "rbox 1000 s | qconvex s Tv FA" >>q_test.x -rbox 1000 s | qconvex s Tv FA >>q_test.x -echo "rbox c d D2 | qconvex s Qc Fx" >>q_test.x -rbox c d D2 | qconvex s Qc Fx >>q_test.x -echo "rbox y 1000 W0 | qconvex s n " >>q_test.x -rbox y 1000 W0 | qconvex s n >>q_test.x -echo "rbox y 1000 W0 | qconvex s QJ" >>q_test.x -rbox y 1000 W0 | qconvex s QJ >>q_test.x -echo "rbox d G1 D12 | qconvex QR0 FA" >>q_test.x -rbox d G1 D12 | qconvex QR0 FA >>q_test.x -echo "rbox c D6 | qconvex FA TF500" >>q_test.x -rbox c D6 | qconvex FA TF500 >>q_test.x -echo "rbox c P0 d D2 | qconvex p Fa Fc FP FI Fn FN FS Fv Fx" >>q_test.x -rbox c P0 d D2 | qconvex p Fa Fc FP FI Fn FN FS Fv Fx >>q_test.x -echo "rbox c d D2 | qconvex s i QV0" >>q_test.x -rbox c d D2 | qconvex s i QV0 >>q_test.x -echo "rbox c | qconvex Q0" >>q_test.x -rbox c | qconvex Q0 >>q_test.x -echo "qvoronoi -" >>q_test.x -qvoronoi - >>q_test.x -echo "qvoronoi ." >>q_test.x -qvoronoi . >>q_test.x -echo "qvoronoi" >>q_test.x -qvoronoi >>q_test.x -echo "rbox c P0 D2 | qvoronoi s o" >>q_test.x -rbox c P0 D2 | qvoronoi s o >>q_test.x -echo "rbox c P0 D2 | qvoronoi Fi" >>q_test.x -rbox c P0 D2 | qvoronoi Fi >>q_test.x -echo "rbox c P0 D2 | qvoronoi Fo" >>q_test.x -rbox c P0 D2 | qvoronoi Fo >>q_test.x -echo "rbox c P0 D2 | qvoronoi Fv" >>q_test.x -rbox c P0 D2 | qvoronoi Fv >>q_test.x -echo "rbox c P0 D2 | qvoronoi s Qu Qt Fv" >>q_test.x -rbox c P0 D2 | qvoronoi s Qu Qt Fv >>q_test.x -echo "rbox c P0 D2 | qvoronoi Qu Fo" >>q_test.x -rbox c P0 D2 | qvoronoi Qu Fo >>q_test.x -echo "rbox c G1 d D2 | qvoronoi s p " >>q_test.x -rbox c G1 d D2 | qvoronoi s p >>q_test.x -echo "rbox c G1 d D2 | qvoronoi QJ p " >>q_test.x -rbox c G1 d D2 | qvoronoi QJ p >>q_test.x -echo "rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN " >>q_test.x -rbox c P-0.1 P+0.1 P+0.1 D2 | qvoronoi s Fc FP FQ Fn FN >>q_test.x -echo "rbox P0 c D2 | qvoronoi s Fv QV0" >>q_test.x -rbox P0 c D2 | qvoronoi s Fv QV0 >>q_test.x -echo "qdelaunay -" >>q_test.x -qdelaunay - >>q_test.x -echo "qdelaunay ." >>q_test.x -qdelaunay . >>q_test.x -echo "qdelaunay" >>q_test.x -qdelaunay >>q_test.x -echo "rbox c P0 D2 | qdelaunay s o" >>q_test.x -rbox c P0 D2 | qdelaunay s o >>q_test.x -echo "rbox c P0 D2 | qdelaunay i" >>q_test.x -rbox c P0 D2 | qdelaunay i >>q_test.x -echo "rbox c P0 D2 | qdelaunay Fv" >>q_test.x -rbox c P0 D2 | qdelaunay Fv >>q_test.x -echo "rbox c P0 D2 | qdelaunay s Qu Qt Fv" >>q_test.x -rbox c P0 D2 | qdelaunay s Qu Qt Fv >>q_test.x -echo "rbox c G1 d D2 | qdelaunay s i" >>q_test.x -rbox c G1 d D2 | qdelaunay s i >>q_test.x -echo "rbox c G1 d D2 | qdelaunay Ft" >>q_test.x -rbox c G1 d D2 | qdelaunay Ft >>q_test.x -echo "rbox c G1 d D2 | qdelaunay QJ s Ft" >>q_test.x -rbox c G1 d D2 | qdelaunay QJ s Ft >>q_test.x -echo "rbox M3,4 z 100 D2 | qdelaunay s" >>q_test.x -rbox M3,4 z 100 D2 | qdelaunay s >>q_test.x -echo "rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN" >>q_test.x -rbox c P-0.1 P+0.1 P+0.1 D2 | qdelaunay s Fx Fa Fc FP FQ Fn FN >>q_test.x -echo "rbox P0 P0 c D2 | qdelaunay s FP QV0" >>q_test.x -rbox P0 P0 c D2 | qdelaunay s FP QV0 >>q_test.x -echo "qhalf -" >>q_test.x -qhalf - >>q_test.x -echo "qhalf ." >>q_test.x -qhalf . >>q_test.x -echo "qhalf" >>q_test.x -qhalf >>q_test.x -echo "rbox d | qhull FQ n | qhalf s Qt H0,0,0 Fp" >>q_test.x -rbox d | qhull FQ n | qhalf s H0,0,0 Fp >>q_test.x -echo "rbox c | qhull FQ FV n | qhalf s i" >>q_test.x -rbox c | qhull FQ FV n | qhalf s i >>q_test.x -echo "rbox c | qhull FQ FV n | qhalf o" >>q_test.x -rbox c | qhull FQ FV n | qhalf o >>q_test.x -echo "rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx" >>q_test.x -rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx >>q_test.x - -echo === check quality of merges for ${d:-`hostname`} ${d:-`date`} >>q_test.x -echo "rbox 1000 W0 t | qhull QR2 QJ s Fs Tv" >>q_test.x -rbox 1000 W0 t | qhull QR2 QJ s Fs Tv >>q_test.x -echo "rbox 1000 W0 t | qhull QR2 s Fs Tv" >>q_test.x -rbox 1000 W0 t | qhull QR2 s Fs Tv >>q_test.x -echo "rbox 1000 s t | qhull C0.02 Qc Tv" >>q_test.x -rbox 1000 s t | qhull C0.02 Qc Tv >>q_test.x -echo "rbox 500 s D4 t | qhull C0.01 Qc Tv" >>q_test.x -rbox 500 s D4 t | qhull C0.01 Qc Tv >>q_test.x -echo "rbox 1000 s t | qhull C-0.02 Qc Tv" >>q_test.x -rbox 1000 s t | qhull C-0.02 Qc Tv >>q_test.x -echo "rbox 1000 s D4 t | qhull C-0.01 Qc Tv" >>q_test.x -rbox 1000 s D4 t | qhull C-0.01 Qc Tv >>q_test.x -echo "rbox 200 s D5 t | qhull C-0.01 Qx Qc Tv" >>q_test.x -rbox 200 s D5 t | qhull C-0.01 Qx Qc Tv >>q_test.x -echo "rbox 100 s D6 t | qhull C-0.001 Qx Qc Tv" >>q_test.x -rbox 100 s D6 t | qhull C-0.001 Qx Qc Tv >>q_test.x -echo "rbox 1000 W1e-4 t | qhull C-1e-6 Qc Tv" >>q_test.x -rbox 1000 W1e-4 t | qhull C-1e-6 Qc Tv >>q_test.x -echo "rbox 1000 W5e-4 D4 t | qhull C-1e-5 Qc Tv" >>q_test.x -rbox 1000 W5e-4 D4 t | qhull C-1e-5 Qc Tv >>q_test.x -echo "rbox 400 W1e-3 D5 t | qhull C-1e-5 Qx Qc Tv" >>q_test.x -rbox 400 W1e-3 D5 t | qhull C-1e-5 Qx Qc Tv >>q_test.x - -echo === check input format etc. ${d:-`date`} >>q_test.x -echo "rbox d h | qhull Fd FV n FD Tcv | qhull Fd H Fp Tcv" >>q_test.x -rbox d h | qhull Fd FV n FD Tcv | qhull Fd H Fp Tcv >>q_test.x -echo "rbox 10 h | qhull Fd FD p Tcv | qhull Fd d Tcv " >>q_test.x -rbox 10 h | qhull Fd FD p Tcv | qhull Fd d Tcv >>q_test.x - -echo === check rbox ${d:-`date`} >>q_test.x -echo "rbox 3 n D2" >>q_test.x -rbox 3 n D2 >>q_test.x -echo "rbox 3 D2" >>q_test.x -rbox 3 D2 >>q_test.x -echo "rbox 3 h D2" >>q_test.x -rbox 3 h D2 >>q_test.x -echo "rbox 3 z D2" >>q_test.x -rbox 3 z D2 >>q_test.x -echo "rbox 3 z h D2" >>q_test.x -rbox 3 z h D2 >>q_test.x -echo "rbox 3 B10 D2" >>q_test.x -rbox 3 B10 D2 >>q_test.x -echo "rbox 3 z B10 D2" >>q_test.x -rbox 3 z B10 D2 >>q_test.x -echo "rbox 4 L2 r D2" >>q_test.x -rbox 4 L2 r D2 >>q_test.x -echo "rbox 8 L2 D2" >>q_test.x -rbox 8 L2 D2 >>q_test.x -echo "rbox 4 L4 r D3" >>q_test.x -rbox 4 L4 r D3 >>q_test.x -echo "rbox y" >>q_test.x -rbox y >>q_test.x -echo "rbox 10 M3,4" >>q_test.x -rbox 10 M3,4 >>q_test.x -echo "rbox 4 L4 s D5 W1e-3 " >>q_test.x -rbox 4 L4 s D5 W1e-3 >>q_test.x -echo "rbox 10 L2 s D3 | qhull Tcv" >>q_test.x -rbox 10 L2 s D3 | qhull Tcv >>q_test.x -echo "rbox 10 L4 s W1e-3 D3 | qhull Tcv" >>q_test.x -rbox 10 L4 s W1e-3 D3 | qhull Tcv >>q_test.x -echo "rbox 10 L6 D3 | qhull Tcv" >>q_test.x -rbox 10 L6 D3 | qhull Tcv >>q_test.x -echo "rbox 10 L1.1 s D4 | qhull Tcv" >>q_test.x -rbox 10 L1.1 s D4 | qhull Tcv >>q_test.x -echo "rbox y r 100 W0 O0.5 | qhull s p Tcv" >>q_test.x -rbox y r 100 W0 O0.5 | qhull s p Tcv >>q_test.x -echo "rbox x r 100 W0 O0.5 | qhull s p Tcv" >>q_test.x -rbox x r 100 W0 O0.5 | qhull s p Tcv >>q_test.x -echo "rbox 12 D8 | qhull Tcv" >>q_test.x -rbox 12 D8 | qhull Tcv >>q_test.x -echo "rbox 12 D9 | qhull Tcv" >>q_test.x -rbox 12 D9 | qhull Tcv >>q_test.x -echo "rbox 1000 D4 | qhull s i A-0.97 C0.2 A0.7 Tcv" >>q_test.x -rbox 1000 D4 | qhull s i A-0.97 C0.2 A0.7 Tcv >>q_test.x -echo "rbox 3 D2 | qhull Qb0B1:-2 p " >>q_test.x -rbox 3 D2 | qhull Qb0B1:-2 p >>q_test.x -echo "rbox 100 r D2 | qhull Pd0:0.7 PD0:0.8 n Tcv" >>q_test.x -rbox 100 r D2 | qhull Pd0:0.7 PD0:0.8 n Tcv >>q_test.x -echo "rbox 1000 s | qhull C0.05 Tcv" >>q_test.x -rbox 1000 s | qhull C0.05 Tcv >>q_test.x -echo "rbox 1000 s t | qhull Qm C0.05 Tcv" >>q_test.x -rbox 1000 s t | qhull Qm C0.05 Tcv >>q_test.x -echo "rbox 500 D2 | qhull n A-0.95 C0.1 Tcv" >>q_test.x -rbox 500 D2 | qhull n A-0.95 C0.1 Tcv >>q_test.x -echo "rbox 500 s P1,1,1 | qhull QgG0 Pp Tcv" >>q_test.x -rbox 500 s P1,1,1 | qhull QgG0 Pp Tcv >>q_test.x - -echo "rbox d | qhull m" >>q_test.x -rbox d | qhull m >>q_test.x -echo "rbox d | qhull FM" >>q_test.x -rbox d | qhull FM >>q_test.x -echo "rbox c D2 | qhull Q0 Tcv" >>q_test.x -rbox c D2 | qhull Q0 Tcv >>q_test.x -echo "rbox d D2 | qhull Tcv" >>q_test.x -rbox d D2 | qhull Tcv >>q_test.x -echo "rbox c D3 | qhull Q0 Tcv" >>q_test.x -rbox c D3 | qhull Q0 Tcv >>q_test.x -echo "rbox d D3 | qhull Tcv" >>q_test.x -rbox d D3 | qhull Tcv >>q_test.x -echo "rbox c D4 | qhull Q0 Tcv" >>q_test.x -rbox c D4 | qhull Q0 Tcv >>q_test.x -echo "rbox d D4 | qhull Tcv" >>q_test.x -rbox d D4 | qhull Tcv >>q_test.x -echo "rbox c D5 | qhull Q0 Tcv" >>q_test.x -rbox c D5 | qhull Q0 Tcv >>q_test.x -echo "rbox d D5 | qhull Tcv" >>q_test.x -rbox d D5 | qhull Tcv >>q_test.x -echo "rbox c D6 | qhull Q0 Tcv" >>q_test.x -rbox c D6 | qhull Q0 Tcv >>q_test.x -echo "rbox d D6 | qhull Tcv" >>q_test.x -rbox d D6 | qhull Tcv >>q_test.x -echo "rbox d D7 | qhull Tcv" >>q_test.x -rbox d D7 | qhull Tcv >>q_test.x -echo "rbox c D2 | qhull Tcv C-0" >>q_test.x -rbox c D2 | qhull Tcv C-0 >>q_test.x -echo "rbox c D3 | qhull Tcv C-0" >>q_test.x -rbox c D3 | qhull Tcv C-0 >>q_test.x -echo "rbox c D4 | qhull Tcv C-0" >>q_test.x -rbox c D4 | qhull Tcv C-0 >>q_test.x -echo "rbox c D5 | qhull Tcv C-0" >>q_test.x -rbox c D5 | qhull Tcv C-0 >>q_test.x -echo "rbox c D6 | qhull Tcv C-0" >>q_test.x -rbox c D6 | qhull Tcv C-0 >>q_test.x -echo "rbox c D7 | qhull Tv C-0" >>q_test.x -rbox c D7 | qhull Tv C-0 >>q_test.x -echo "rbox 20 l D3 | qhull Tcv" >>q_test.x -rbox 20 l D3 | qhull Tcv >>q_test.x -echo "rbox 100 s D2 | qhull Tcv" >>q_test.x -rbox 100 s D2 | qhull Tcv >>q_test.x -echo "rbox 100 s D3 | qhull Tcv" >>q_test.x -rbox 100 s D3 | qhull Tcv >>q_test.x -echo "rbox 100 s D4 | qhull Tcv" >>q_test.x -rbox 100 s D4 | qhull Tcv >>q_test.x -echo "rbox 100 s c D4 | qhull Tcv" >>q_test.x -rbox 100 s c D4 | qhull Tcv >>q_test.x -echo "rbox 100 s d G1.5 D4 | qhull Tcv" >>q_test.x -rbox 100 s d G1.5 D4 | qhull Tcv >>q_test.x -echo "rbox 100 s W1e-2 | qhull Tcv" >>q_test.x -rbox 100 s W1e-2 | qhull Tcv >>q_test.x -echo "rbox 100 | qhull Tcv" >>q_test.x -rbox 100 | qhull Tcv >>q_test.x -echo "rbox 100 W1e-3 | qhull Tcv" >>q_test.x -rbox 100 W1e-3 | qhull Tcv >>q_test.x -echo "rbox 100 r D2 | qhull Tcv" >>q_test.x -rbox 100 r D2 | qhull Tcv >>q_test.x -echo "rbox 100 r s Z1 | qhull Tcv" >>q_test.x -rbox 100 r s Z1 | qhull Tcv >>q_test.x -echo "rbox 100 r s Z1 G0.1 | qhull Tcv C-0" >>q_test.x -rbox 100 r s Z1 G0.1 | qhull Tcv C-0 >>q_test.x -echo "rbox 100 s Z1 G0.1 | qhull Tcv " >>q_test.x -rbox 100 s Z1 G0.1 | qhull Tcv >>q_test.x -echo "rbox 100 s Z1e-5 G0.1 | qhull Tc Pp" >>q_test.x -rbox 100 s Z1e-5 G0.1 | qhull Tc Pp >>q_test.x - -echo === check qhull output formats ${d:-`date`} >>q_test.x -echo "rbox 5 r s D2 | qhull Tcv" >>q_test.x -rbox 5 r s D2 | qhull Tcv >>q_test.x -echo "rbox 5 r s D2 | qhull s " >>q_test.x -rbox 5 r s D2 | qhull s >>q_test.x -echo "rbox 5 r s D2 | qhull s o " >>q_test.x -rbox 5 r s D2 | qhull s o >>q_test.x -echo "rbox 5 r s D2 | qhull f" >>q_test.x -rbox 5 r s D2 | qhull f >>q_test.x -echo "rbox 5 r s D2 | qhull i " >>q_test.x -rbox 5 r s D2 | qhull i >>q_test.x -echo "rbox 5 r s D2 | qhull m " >>q_test.x -rbox 5 r s D2 | qhull m >>q_test.x -echo "rbox 5 r s D2 | qhull FM " >>q_test.x -rbox 5 r s D2 | qhull FM >>q_test.x -echo "rbox 5 r s D2 | qhull n " >>q_test.x -rbox 5 r s D2 | qhull n >>q_test.x -echo "rbox 5 r s D2 | qhull p " >>q_test.x -rbox 5 r s D2 | qhull p >>q_test.x -echo "rbox 5 r s D2 | qhull o " >>q_test.x -rbox 5 r s D2 | qhull o >>q_test.x -echo "rbox 5 r s D2 | qhull Fx" >>q_test.x -rbox 5 r s D2 | qhull Fx >>q_test.x -echo "rbox 5 r s D2 | qhull p n i p p" >>q_test.x -rbox 5 r s D2 | qhull p n i p p >>q_test.x -echo "rbox 10 D3 | qhull f Tcv" >>q_test.x -rbox 10 D3 | qhull f Tcv >>q_test.x -echo "rbox 10 D3 | qhull i" >>q_test.x -rbox 10 D3 | qhull i >>q_test.x -echo "rbox 10 D3 | qhull p " >>q_test.x -rbox 10 D3 | qhull p >>q_test.x -echo "rbox 10 D3 | qhull o " >>q_test.x -rbox 10 D3 | qhull o >>q_test.x -echo "rbox 10 D3 | qhull Fx " >>q_test.x -rbox 10 D3 | qhull Fx >>q_test.x -echo "rbox 27 M1,0,1 | qhull Qc" >>q_test.x -rbox 27 M1,0,1 | qhull Qc >>q_test.x -echo "rbox 50 D3 s | qhull C0.1 Qc Pd0d1d2 s p Tcv" >>q_test.x -rbox 50 D3 s | qhull C0.1 Qc Pd0d1d2 s p Tcv >>q_test.x -echo "rbox 10 D2 P0 P1e-15 | qhull d Qc FP s Tcv" >>q_test.x -rbox 10 D2 P0 P1e-15 | qhull d Qc FP s Tcv >>q_test.x -echo "rbox 100 s | qhull C-0.003 Qc FP s" >>q_test.x -rbox 100 s | qhull C-0.003 Qc FP s >>q_test.x -echo "rbox 100 s D2 | qhull C0.1 i Fx Tcv" >>q_test.x -rbox 100 s D2 | qhull C0.1 i Fx Tcv >>q_test.x -echo "rbox 4 s D3 | qhull Qc Ghipv Tcv " >>q_test.x -rbox 4 s D3 | qhull Qc Ghipv Tcv >>q_test.x -echo "rbox 6 D4 | qhull f Tcv" >>q_test.x -rbox 6 D4 | qhull f Tcv >>q_test.x -echo "rbox 6 D4 | qhull i" >>q_test.x -rbox 6 D4 | qhull i >>q_test.x -echo "rbox 6 D4 | qhull p " >>q_test.x -rbox 6 D4 | qhull p >>q_test.x -echo "rbox 6 D4 | qhull o" >>q_test.x -rbox 6 D4 | qhull o >>q_test.x -echo "rbox 1000 s D2 | qhull FA Tcv" >>q_test.x -rbox 1000 s D2 | qhull FA Tcv >>q_test.x -echo "rbox 1000 s | qhull FA Tcv" >>q_test.x -rbox 1000 s | qhull FA Tcv >>q_test.x -echo "rbox c D4 | qhull FA Tcv" >>q_test.x -rbox c D4 | qhull FA Tcv >>q_test.x -echo "rbox c D5 | qhull FA Tcv" >>q_test.x -rbox c D5 | qhull FA Tcv >>q_test.x -echo "rbox 10 D2 | qhull d FA Tcv" >>q_test.x -rbox 10 D2 | qhull d FA Tcv >>q_test.x -echo "rbox 10 D2 | qhull d Qu FA Tcv" >>q_test.x -rbox 10 D2 | qhull d Qu FA Tcv >>q_test.x -echo "rbox 10 D2 | qhull FA Tcv" >>q_test.x -rbox 10 D2 | qhull FA Tcv >>q_test.x -echo "rbox 10 c D2 | qhull Fx Tcv" >>q_test.x -rbox 10 c D2 | qhull Fx Tcv >>q_test.x -echo "rbox 1000 s | qhull FS Tcv" >>q_test.x -rbox 1000 s | qhull FS Tcv >>q_test.x -echo "rbox 10 W0 D2 | qhull p Qc FcC Tcv" >>q_test.x -rbox 10 W0 D2 | qhull p Qc FcC Tcv >>q_test.x -echo "rbox 4 z h s D2 | qhull Fd s n FD Tcv" >>q_test.x -rbox 4 z h s D2 | qhull Fd s n FD Tcv >>q_test.x -echo "rbox 6 s D3 | qhull C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv Tcv" >>q_test.x -rbox 6 s D3 | qhull C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv Tcv >>q_test.x -echo "rbox P0.5,0.5 P0.5,0.5 W0 5 D2 | qhull d FN Qc" >>q_test.x -rbox P0.5,0.5 P0.5,0.5 W0 5 D2 | qhull d FN Qc >>q_test.x -echo "rbox 10 D3 | qhull Fa PA5" >>q_test.x -rbox 10 D3 | qhull Fa PA5 >>q_test.x -echo "rbox 10 D3 | qhull Fa PF0.4" >>q_test.x -rbox 10 D3 | qhull Fa PF0.4 >>q_test.x - -echo === test Qt >>q_test.x -echo "rbox c | qhull Qt s o Tcv" >>q_test.x -rbox c | qhull Qt s o Tcv >>q_test.x -echo "rbox c | qhull Qt f i" >>q_test.x -rbox c | qhull Qt f i >>q_test.x -echo "rbox c | qhull Qt m FM n" >>q_test.x -rbox c | qhull Qt m FM n >>q_test.x -echo "rbox c | qhull Qt p o" >>q_test.x -rbox c | qhull Qt p o >>q_test.x -echo "rbox c | qhull Qt Fx" >>q_test.x -rbox c | qhull Qt Fx >>q_test.x -echo "rbox c | qhull Qt FA s Fa" >>q_test.x -rbox c | qhull Qt FA s Fa >>q_test.x -echo "rbox 6 r s c G0.1 D2 | qhull Qt d FA Tcv" >>q_test.x -rbox 6 r s c G0.1 D2 | qhull Qt d FA Tcv >>q_test.x -echo "rbox 6 r s c G0.1 D2 | qhull d FA Tcv" >>q_test.x -rbox 6 r s c G0.1 D2 | qhull d FA Tcv >>q_test.x -echo "rbox 6 r s c G0.1 D2 | qhull Qt v p Tcv" >>q_test.x -rbox 6 r s c G0.1 D2 | qhull Qt v p Tcv >>q_test.x -echo "rbox c | qhull Qt C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv Tcv" >>q_test.x -rbox c | qhull Qt C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv Tcv >>q_test.x -echo "rbox 6 r s c G0.1 D2 P0.1,0.1 | qhull s FP d FO Qt" >>q_test.x -rbox 6 r s c G0.1 D2 P0.1,0.1 | qhull s FP d FO Qt >>q_test.x -echo "RBOX 100 W0 | QHULL Tv Q11 FO" >>q_test.x -RBOX 100 W0 | QHULL Tv Q11 FO >>q_test.x - -echo === test unbounded intersection >>q_test.x -echo "rbox c | qhull PD0:0.5 n | qhull H0 Fp Tcv" >>q_test.x -rbox c | qhull PD0:0.5 n | qhull H0 Fp Tcv >>q_test.x -echo "rbox 1000 W1e-3 D3 | qhull PA8 Fa FS s n Tcv " >>q_test.x -rbox 1000 W1e-3 D3 | qhull PA8 Fa FS s n Tcv >>q_test.x -echo "rbox 1000 W1e-3 D3 | qhull C-0.01 PM10 Fm n Tcv Qc" >>q_test.x -rbox 1000 W1e-3 D3 | qhull C-0.01 PM10 Fm n Tcv Qc >>q_test.x -echo "rbox 1000 W1e-3 D3 | qhull C-0.01 PA8 PG n Tcv Qc" >>q_test.x -rbox 1000 W1e-3 D3 | qhull C-0.01 PA8 PG n Tcv Qc >>q_test.x -rbox 10 | qhull FO Tz TO q_test.log.1 -echo "type q_test.log.1" >>q_test.x -type q_test.log.1 >>q_test.x - -echo === check Delaunay/Voronoi ${d:-`date`} >>q_test.x -echo "rbox 10 D2 | qhull d Tcv" >>q_test.x -rbox 10 D2 | qhull d Tcv >>q_test.x -echo "rbox 10 D2 | qhull d Qz Tcv" >>q_test.x -rbox 10 D2 | qhull d Qz Tcv >>q_test.x -echo "rbox 10 D3 | qhull d Tcv" >>q_test.x -rbox 10 D3 | qhull d Tcv >>q_test.x -echo "rbox c | qhull d Qz Ft Tcv" >>q_test.x -rbox c | qhull d Qz Ft Tcv >>q_test.x -echo "rbox 10 s D2 c | qhull d Tcv" >>q_test.x -rbox 10 s D2 c | qhull d Tcv >>q_test.x -echo "rbox 10 s D2 | qhull d Tcv Qz Q8" >>q_test.x -rbox 10 s D2 | qhull d Tcv Qz Q8 >>q_test.x -echo "rbox 10 D2 | qhull d Tcv p" >>q_test.x -rbox 10 D2 | qhull d Tcv p >>q_test.x -echo "rbox 10 D2 | qhull d Tcv i" >>q_test.x -rbox 10 D2 | qhull d Tcv i >>q_test.x -echo "rbox 10 D2 | qhull d Tcv o" >>q_test.x -rbox 10 D2 | qhull d Tcv o >>q_test.x -echo "rbox 10 D2 | qhull v Tcv o" >>q_test.x -rbox 10 D2 | qhull v Tcv o >>q_test.x -echo "rbox 10 D2 | qhull v Tcv p" >>q_test.x -rbox 10 D2 | qhull v Tcv p >>q_test.x -echo "rbox 10 D2 | qhull v Tcv G" >>q_test.x -rbox 10 D2 | qhull v Tcv G >>q_test.x -echo "rbox 10 D2 | qhull v Tcv Fv" >>q_test.x -rbox 10 D2 | qhull v Tcv Fv >>q_test.x -echo "rbox 10 D2 | qhull v Tcv Fi" >>q_test.x -rbox 10 D2 | qhull v Tcv Fi >>q_test.x -echo "rbox 10 D2 | qhull v Tcv Fo" >>q_test.x -rbox 10 D2 | qhull v Tcv Fo >>q_test.x -echo "rbox 10 D2 | qhull v Qu Tcv o Fv Fi Fo" >>q_test.x -rbox 10 D2 | qhull v Qu Tcv o Fv Fi Fo >>q_test.x -echo "rbox 10 D3 | qhull v Tcv Fv" >>q_test.x -rbox 10 D3 | qhull v Tcv Fv >>q_test.x -echo "rbox 10 D3 | qhull v Tcv Fi" >>q_test.x -rbox 10 D3 | qhull v Tcv Fi >>q_test.x -echo "rbox 10 D3 | qhull v Tcv Fo" >>q_test.x -rbox 10 D3 | qhull v Tcv Fo >>q_test.x -echo "rbox 10 D3 | qhull v Qu Tcv o Fv Fi Fo" >>q_test.x -rbox 10 D3 | qhull v Qu Tcv o Fv Fi Fo >>q_test.x -echo "rbox 5 D2 | qhull v f FnN o" >>q_test.x -rbox 5 D2 | qhull v f FnN o >>q_test.x - -echo === check Halfspace ${d:-`date`} >>q_test.x -echo "rbox 100 s D4 | qhull FA FV n s Tcv | qhull H Fp Tcv | qhull FA Tcv" >>q_test.x -rbox 100 s D4 | qhull FA s Tcv >>q_test.x -rbox 100 s D4 | qhull FA FV n s Tcv | qhull H Fp Tcv | qhull FA Tcv >>q_test.x -echo "rbox d D3 | qhull FQ n s FD Tcv | qhull Fd H0.1,0.1 Fp FQ Tcv" >>q_test.x -rbox d D3 | qhull s >>q_test.x -rbox d D3 | qhull FQ n FD Tcv | qhull Fd H0.1,0.1 Fp FQ Tcv >>q_test.x -echo "rbox 5 r D2 | qhull s n Tcv | qhull H0 Fp Tcv" >>q_test.x -rbox 5 r D2 | qhull >>q_test.x -rbox 5 r D2 | qhull n Tcv | qhull H0 Fp Tcv >>q_test.x - -echo === check qhull ${d:-`date`} >>q_test.x -echo "rbox 10 s D3 | qhull Tcv" >>q_test.x -rbox 10 s D3 | qhull Tcv >>q_test.x -echo "rbox 10 s D3 | qhull f Pd0:0.5 Pd2 Tcv" >>q_test.x -rbox 10 s D3 | qhull f Pd0:0.5 Pd2 Tcv >>q_test.x -echo "rbox 10 s D3 | qhull f Tcv PD2:-0.5" >>q_test.x -rbox 10 s D3 | qhull f Tcv PD2:-0.5 >>q_test.x -echo "rbox 10 s D3 | qhull QR-1" >>q_test.x -rbox 10 s D3 | qhull QR-1 >>q_test.x -echo "rbox 10 s D3 | qhull QR-40" >>q_test.x -rbox 10 s D3 | qhull QR-40 >>q_test.x -echo "rbox 1000 D3 | qhull Tcvs" >>q_test.x -rbox 1000 D3 | qhull Tcvs >>q_test.x -echo "rbox 100 s D3 | qhull TcvV-2" >>q_test.x -rbox 100 s D3 | qhull TcvV-2 >>q_test.x -echo "rbox 100 s D3 | qhull TcvC2" >>q_test.x -rbox 100 s D3 | qhull TcvC2 >>q_test.x -echo "rbox 100 s D3 | qhull TcvV2" >>q_test.x -rbox 100 s D3 | qhull TcvV2 >>q_test.x -echo "rbox 100 s D3 | qhull T1cvV2P2" >>q_test.x -rbox 100 s D3 | qhull T1cvV2P2 >>q_test.x -echo "rbox 100 s D3 | qhull TcvF100" >>q_test.x -rbox 100 s D3 | qhull TcvF100 >>q_test.x -echo "rbox 100 s D3 | qhull Qf Tcv" >>q_test.x -rbox 100 s D3 | qhull Qf Tcv >>q_test.x -echo "rbox 100 D3 | qhull Tcv" >>q_test.x -rbox 100 D3 | qhull Tcv >>q_test.x -echo "rbox 100 D3 | qhull Qs Tcv" >>q_test.x -rbox 100 D3 | qhull Qs Tcv >>q_test.x -echo "rbox 100 D5 | qhull Qs Tcv" >>q_test.x -rbox 100 D5 | qhull Qs Tcv >>q_test.x -echo "rbox 100 D3 | qhull Qr Tcv" >>q_test.x -rbox 100 D3 | qhull Qr Tcv >>q_test.x -echo "rbox 100 D3 | qhull Qxv Tcv" >>q_test.x -rbox 100 D3 | qhull Qxv Tcv >>q_test.x -echo "rbox 100 D3 | qhull Qi f Pd0 Pd1 Pd2 Tcv" >>q_test.x -rbox 100 D3 | qhull Qi f Pd0 Pd1 Pd2 Tcv >>q_test.x -echo "rbox c d | qhull Qc f Tcv" >>q_test.x -rbox c d | qhull Qc f Tcv >>q_test.x -echo "rbox c d | qhull Qc p Tcv" >>q_test.x -rbox c d | qhull Qc p Tcv >>q_test.x -echo "rbox 100 D3 | qhull QbB FO Tcv" >>q_test.x -rbox 100 D3 | qhull QbB FO Tcv >>q_test.x -echo "rbox 1000 D2 B1e6 | qhull d Qbb FO Tcv" >>q_test.x -rbox 1000 D2 B1e6 | qhull d Qbb FO Tcv >>q_test.x -echo "rbox 10 D3 | qhull QbB p Tcv" >>q_test.x -rbox 10 D3 | qhull QbB p Tcv >>q_test.x -echo "rbox 10 D3 | qhull Qbb p Tcv" >>q_test.x -rbox 10 D3 | qhull Qbb p Tcv >>q_test.x -echo "rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv" >>q_test.x -rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv >>q_test.x -echo "rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv | qhull QbB p Tcv" >>q_test.x -rbox 10 D3 | qhull Qb0:-10B2:20 p Tcv | qhull QbB p Tcv >>q_test.x -echo "rbox 10 D3 | qhull Qb1:0B1:0 d Tcv Q8" >>q_test.x -rbox 10 D3 | qhull Qb1:0B1:0 d Tcv Q8 >>q_test.x -echo "rbox 10 D3 | qhull Qb1:0B1:0B2:0 d Tcv Q8" >>q_test.x -rbox 10 D3 | qhull Qb1:0B1:0B2:0 d Tcv Q8 >>q_test.x -echo "rbox 10 D3 | qhull Qb1:0 d Tcv " >>q_test.x -rbox 10 D3 | qhull Qb1:0 d Tcv >>q_test.x -echo "rbox 10 D3 | qhull Qb1:0B1:0 Tcv" >>q_test.x -rbox 10 D3 | qhull Qb1:0B1:0 Tcv >>q_test.x -echo "== next command will error ==" >>q_test.x -echo "rbox 10 D2 | qhull Qb1:1B1:1 Tcv" >>q_test.x -rbox 10 D2 | qhull Qb1:1B1:1 Tcv >>q_test.x -echo "rbox 200 L20 D2 t | qhull FO Tcv C-0" >>q_test.x -rbox 200 L20 D2 t | qhull FO Tcv C-0 >>q_test.x -echo "rbox 1000 L20 t | qhull FO Tcv C-0" >>q_test.x -rbox 1000 L20 t | qhull FO Tcv C-0 >>q_test.x -echo "rbox 200 L20 D4 t | qhull FO Tcv C-0" >>q_test.x -rbox 200 L20 D4 t | qhull FO Tcv C-0 >>q_test.x -echo "rbox 200 L20 D5 t | qhull FO Tcv Qx" >>q_test.x -rbox 200 L20 D5 t | qhull FO Tcv Qx >>q_test.x -echo "rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu Q0" >>q_test.x -rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu Q0 >>q_test.x -echo "rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu C-0" >>q_test.x -rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu C-0 >>q_test.x - -echo === check joggle and TRn ${d:-`date`} >>q_test.x -echo "rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv" >>q_test.x -rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv >>q_test.x -echo "rbox 100 W0 | qhull QJ1e-13 Qc TR100 Tv" >>q_test.x -rbox 100 W0 | qhull QJ1e-13 Qc TR100 Tv >>q_test.x -echo "rbox 100 W0 | qhull QJ1e-12 Qc TR100 Tv" >>q_test.x -rbox 100 W0 | qhull QJ1e-12 Qc TR100 Tv >>q_test.x -echo "rbox 100 W0 | qhull QJ1e-11 Qc TR100 Tv" >>q_test.x -rbox 100 W0 | qhull QJ1e-11 Qc TR100 Tv >>q_test.x -echo "rbox 100 W0 | qhull QJ1e-10 Qc TR100 Tv" >>q_test.x -rbox 100 W0 | qhull QJ1e-10 Qc TR100 Tv >>q_test.x -echo "rbox 100 | qhull d QJ Qb0:1e4 QB0:1e5 Qb1:1e4 QB1:1e6 Qb2:1e5 QB2:1e7 FO Tv" >>q_test.x -rbox 100 | qhull d QJ Qb0:1e4 QB0:1e5 Qb1:1e4 QB1:1e6 Qb2:1e5 QB2:1e7 FO Tv >>q_test.x - -echo === check precision options ${d:-`date`} >>q_test.x -echo "rbox 100 D3 s | qhull E0.01 Qx Tcv FO" >>q_test.x -rbox 100 D3 s | qhull E0.01 Qx Tcv FO >>q_test.x -echo "rbox 100 D3 W1e-1 | qhull W1e-3 Tcv" >>q_test.x -rbox 100 D3 W1e-1 | qhull W1e-3 Tcv >>q_test.x -echo "rbox 100 D3 W1e-1 | qhull W1e-2 Tcv Q0" >>q_test.x -rbox 100 D3 W1e-1 | qhull W1e-2 Tcv Q0 >>q_test.x -echo "rbox 100 D3 W1e-1 | qhull W1e-2 Tcv" >>q_test.x -rbox 100 D3 W1e-1 | qhull W1e-2 Tcv >>q_test.x -echo "rbox 100 D3 W1e-1 | qhull W1e-1 Tcv" >>q_test.x -rbox 100 D3 W1e-1 | qhull W1e-1 Tcv >>q_test.x -echo "rbox 15 D2 P0 P1e-14,1e-14 | qhull d Quc Tcv" >>q_test.x -rbox 15 D2 P0 P1e-14,1e-14 | qhull d Quc Tcv >>q_test.x -echo "rbox 15 D3 P0 P1e-12,1e-14,1e-14 | qhull d Qcu Tcv" >>q_test.x -rbox 15 D3 P0 P1e-12,1e-14,1e-14 | qhull d Qcu Tcv >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 V0 Qc Tcv" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 V0 Qc Tcv >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 U0 Qc Tcv" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 U0 Qc Tcv >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 V0 Qcm Tcv" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 V0 Qcm Tcv >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Qcm Tcv" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Qcm Tcv >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q1 FO Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q1 FO Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q2 FO Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q2 FO Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q3 FO Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q3 FO Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q4 FO Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q4 FO Tcv Qc >>q_test.x -echo === this may generate an error ${d:-`date`} >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv " >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv >>q_test.x -echo === this should generate an error ${d:-`date`} >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Q7 FO Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Q7 FO Tcv Qc >>q_test.x -echo "rbox 1000 s D3 | qhull C-0.01 Qx Tcv Qc" >>q_test.x -rbox 1000 s D3 | qhull C-0.01 Qx Tcv Qc >>q_test.x -echo "rbox 100 s D3 t | qhull R1e-3 Tcv Qc" >>q_test.x -rbox 100 s D3 t | qhull R1e-3 Tcv Qc >>q_test.x -echo "rbox 100 s D3 t | qhull R1e-2 Tcv Qc" >>q_test.x -rbox 100 s D3 t | qhull R1e-2 Tcv Qc >>q_test.x -echo "rbox 500 s D3 t | qhull R0.05 A-1 Tcv Qc" >>q_test.x -rbox 500 s D3 t | qhull R0.05 A-1 Tcv Qc >>q_test.x -echo "rbox 100 W0 D3 t | qhull R1e-3 Tcv Qc" >>q_test.x -rbox 100 W0 D3 t | qhull R1e-3 Tcv Qc >>q_test.x -echo "rbox 100 W0 D3 t | qhull R1e-3 Qx Tcv Qc" >>q_test.x -rbox 100 W0 D3 t | qhull R1e-3 Qx Tcv Qc >>q_test.x -echo "rbox 100 W0 D3 t | qhull R1e-2 Tcv Qc" >>q_test.x -rbox 100 W0 D3 t | qhull R1e-2 Tcv Qc >>q_test.x -echo "rbox 100 W0 D3 t | qhull R1e-2 Qx Tcv Qc" >>q_test.x -rbox 100 W0 D3 t | qhull R1e-2 Qx Tcv Qc >>q_test.x -echo "rbox 500 W0 D3 t | qhull R0.05 A-1 Tcv Qc" >>q_test.x -rbox 500 W0 D3 t | qhull R0.05 A-1 Tcv Qc >>q_test.x -echo "rbox 500 W0 D3 t | qhull R0.05 Qx Tcv Qc" >>q_test.x -rbox 500 W0 D3 t | qhull R0.05 Qx Tcv Qc >>q_test.x -echo "rbox 1000 W1e-20 t | qhull Tcv Qc" >>q_test.x -rbox 1000 W1e-20 t | qhull Tcv Qc >>q_test.x -echo "rbox 1000 W1e-20 D4 t | qhull Tcv Qc" >>q_test.x -rbox 1000 W1e-20 D4 t | qhull Tcv Qc >>q_test.x -echo "rbox 500 W1e-20 D5 t | qhull Tv Qc" >>q_test.x -rbox 500 W1e-20 D5 t | qhull Tv Qc >>q_test.x -echo "rbox 100 W1e-20 D6 t | qhull Tv Qc" >>q_test.x -rbox 100 W1e-20 D6 t | qhull Tv Qc >>q_test.x -echo "rbox 50 W1e-20 D6 t | qhull Qv Tv Qc" >>q_test.x -rbox 50 W1e-20 D6 t | qhull Qv Tv Qc >>q_test.x -echo "rbox 10000 D4 t | qhull QR0 Qc C-0.01 A0.3 Tv" >>q_test.x -rbox 10000 D4 t | qhull QR0 Qc C-0.01 A0.3 Tv >>q_test.x -echo "rbox 1000 D2 t | qhull d QR0 Qc C-1e-8 Qu Tv" >>q_test.x -rbox 1000 D2 t | qhull d QR0 Qc C-1e-8 Qu Tv >>q_test.x -echo "rbox 300 D5 t |qhull A-0.999 Qc Tcv" >>q_test.x -rbox 300 D5 t |qhull A-0.999 Qc Tcv >>q_test.x -echo "rbox 100 D6 t |qhull A-0.9999 Qc Tcv" >>q_test.x -rbox 100 D6 t |qhull A-0.9999 Qc Tcv >>q_test.x -echo "rbox 50 D7 t |qhull A-0.99999 Qc Tcv W0.1" >>q_test.x -rbox 50 D7 t |qhull A-0.99999 Qc Tcv W0.1 >>q_test.x - -echo === check bad cases for Qhull. May cause errors ${d:-`date`} >>q_test.x -echo "RBOX 1000 L100000 s G1e-6 t | QHULL Tv" >>q_test.x -RBOX 1000 L100000 s G1e-6 t | QHULL Tv >>q_test.x -echo "RBOX 1000 L100000 s G1e-6 t | QHULL Tv Q10" >>q_test.x -RBOX 1000 L100000 s G1e-6 t | QHULL Tv Q10 >>q_test.x -echo "rbox 1000 s Z1 G1e-13 t | qhull Tv" >>q_test.x -rbox 1000 s Z1 G1e-13 t | qhull Tv >>q_test.x -echo "RBOX 1000 s W1e-13 P0 t | QHULL d Qbb Qc Tv" >>q_test.x -RBOX 1000 s W1e-13 P0 t | QHULL d Qbb Qc Tv >>q_test.x -echo "RBOX 1000 s W1e-13 t | QHULL d Tv" >>q_test.x -RBOX 1000 s W1e-13 t | QHULL d Tv >>q_test.x -echo "RBOX 1000 s W1e-13 t D2 | QHULL d Tv" >>q_test.x -RBOX 1000 s W1e-13 t D2 | QHULL d Tv >>q_test.x - -echo ======================================================= >>q_test.x -echo ======================================================= >>q_test.x -echo === The following commands may cause errors =========== >>q_test.x -echo ======================================================= >>q_test.x -echo ======================================================= >>q_test.x -echo "rbox c D7 | qhull Q0 Tcv" >>q_test.x -rbox c D7 | qhull Q0 Tcv >>q_test.x -echo "rbox 100 s D3 | qhull Q0 E1e-3 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 E1e-3 Tc Po >>q_test.x -echo "rbox 100 s D3 | qhull Q0 E1e-2 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 E1e-2 Tc Po >>q_test.x -echo "rbox 100 s D3 | qhull Q0 E1e-1 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 E1e-1 Tc Po >>q_test.x -echo "rbox 100 s D3 | qhull Q0 R1e-3 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 R1e-3 Tc Po >>q_test.x -echo "rbox 100 s D3 | qhull Q0 R1e-2 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 R1e-2 Tc Po >>q_test.x -echo "rbox 100 s D3 | qhull Q0 R0.05 Tc" >>q_test.x -rbox 100 s D3 | qhull Q0 R0.05 Tc >>q_test.x -echo "rbox 100 s D3 | qhull Q0 R0.05 Tc Po" >>q_test.x -rbox 100 s D3 | qhull Q0 R0.05 Tc Po >>q_test.x -echo "rbox 1000 W1e-7 | qhull Q0 Tc Po" >>q_test.x -rbox 1000 W1e-7 | qhull Q0 Tc Po >>q_test.x -echo "rbox 50 s | qhull Q0 V0.05 W0.01 Tc Po" >>q_test.x -rbox 50 s | qhull Q0 V0.05 W0.01 Tc Po >>q_test.x -echo "rbox 100 s D5 | qhull Q0 R1e-2 Tc Po" >>q_test.x -rbox 100 s D5 | qhull Q0 R1e-2 Tc Po >>q_test.x -echo "qhull" >>q_test.x -qhull >>q_test.x -echo "qhull ." >>q_test.x -qhull . >>q_test.x -echo "qhull -" >>q_test.x -qhull - >>q_test.x -echo "rbox" >>q_test.x -rbox >>q_test.x - -echo "# end of q_test" >>q_test.x diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhull-zip.sh b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhull-zip.sh deleted file mode 100755 index b9b04b54cb..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhull-zip.sh +++ /dev/null @@ -1,257 +0,0 @@ -#!/bin/sh -# -# qhull-zip.sh version -- Make zip and tgz files for Qhull release -# -# wzzip from http://www.winzip.com/wzcline.htm -# can not use path with $zip_file -# odd error messages if can't locate directory -# -# $Id: //main/2011/qhull/eg/qhull-zip.sh#16 $$Change: 1493 $ -# $DateTime: 2012/02/20 09:31:24 $$Author: bbarber $ - -if [[ $# -eq 0 ]]; then - echo 'Missing date stamp, e.g., qhull-zip.sh 2007.1' - exit -fi -version=$1 - -err_program=qhull-zip -err_log=/var/tmp/qhull-zip.log -[[ -e $HOME/bash/etc/road-script.sh ]] && source $HOME/bash/etc/road-script.sh \ - || source /etc/road-script.sh - -check_err_log $LINENO "$err_log" -check_err_log $LINENO "$err_step_log" -log_step $LINENO "Logging to $err_log\n... and $err_step_log" - -log_note $LINENO "Find Qhull directory" -if [[ ! -d qhull/eg && ! -d ../qhull/eg && -d ../../qhull/eg ]]; then - exit_err $LINENO "qhull/eg directory not found at or above $PWD" -fi -if [[ ! -d qhull/eg ]]; then - if [[ -d ../qhull/eg ]]; then - cd .. - else - cd ../.. # Tested above - fi -fi -root_dir=$(pwd) - -TEMP_DIR="$TMP/qhull-zip-$(ro_today2)" -TEMP_FILE="$TMP/qhull-zip-$(ro_today2).txt" - -qhull_zip_file=qhull-$version.zip # no path or spaces -qhull_tgz_file=qhull-$version-src.tgz -qhullmd5_file=qhull-$version.md5sum - -exit_if_fail $LINENO "rm -f $qhull_zip_file $qhull_tgz_file $qhullmd5_file" - -############################# -log_step $LINENO "Check environment" -############################# - -[[ $(type -p md5sum) ]] || exit_err $LINENO "md5sum is missing" -[[ $(cp --help || grep '[-]-parents') ]] || exit_err $LINENO "cp does not have --parents option" - -############################# -log_step $LINENO "Define functions" -############################# - -function check_zip_file #zip_file -{ - local zip_file=$1 - local HERE=$(ro_here) - log_note $HERE "Check $zip_file" - ls -l $zip_file >>$err_log - exit_if_err $HERE "Did not create $zip_file" - wzunzip -ybc -t $zip_file | grep -E -v -e '( OK|Zip)' >>$err_log - exit_if_err $HERE "Error while checking $zip_file" -} - -function check_tgz_file #tgz_file -{ - local tgz_file=$1 - local HERE=$(ro_here) - log_note $HERE "Check $tgz_file" - ls -l $tgz_file >>$err_log - exit_if_err $HERE "Did not create $tgz_file" - tar -tzf $tgz_file >/dev/null 2>>$err_log - exit_if_err $HERE "Can not extract -- tar -tzf $tgz_file" -} - -function convert_to_unix #dir $qhull_2ufiles -- convert files to Unix, preserving modtime from $root_dir -{ - local temp_dir=$1 - local HERE=$(ro_here) - log_note $HERE "Convert files to unix format in $1" - for f in $(find $temp_dir -type f | grep -E '^([^.]*|.*\.(ac|am|bashrc|c|cfg|cpp|css|d|dpatch|h|htm|html|man|pl|pri|pro|profile|sh|sql|termcap|txt|xml|xsd|xsl))$'); do - exit_if_fail $HERE "d2u '$f' && touch -r '$root_dir/${f#$temp_dir/}' '$f'" - done - for f in $qhull_2ufiles; do - exit_if_fail $HERE "d2u '$temp_dir/$f' && touch -r '$root_dir/$f' '$temp_dir/$f'" - done -} - -function create_md5sum #md5_file -- create md5sum of current directory -{ - local md5_file=$1 - local HERE=$(ro_here) - log_step $HERE "Compute $md5_file" - exit_if_fail $HERE "rm -f $md5_file" - find . -type f | sed 's|^\./||' | sort | xargs md5sum >>$md5_file - exit_if_err $HERE "md5sum failed" - log_note $HERE "$(md5sum $md5_file)" -} - -############################# -log_step $LINENO "Configure $0 for $(pwd)/qhull" -############################# - -md5_zip_file=qhull-$version-zip.md5sum -md5_tgz_file=qhull-$version-src-tgz.md5sum - -# recursive -qhull_dirs="qhull/config qhull/eg qhull/html qhull/src" -qhull_files="qhull/build/*.sln qhull/build/*.vcproj \ - qhull/Announce.txt qhull/CMakeLists.txt qhull/COPYING.txt \ - qhull/File_id.diz qhull/QHULL-GO.lnk qhull/README.txt \ - qhull/REGISTER.txt qhull/index.htm qhull/Makefile qhull/bin/qhull.dll \ - qhull/bin/qconvex.exe qhull/bin/qdelaunay.exe qhull/bin/qhalf.exe \ - qhull/bin/qhull.exe qhull/bin/qhull_p.dll qhull/bin/qvoronoi.exe \ - qhull/bin/rbox.exe qhull/bin/user_eg.exe qhull/bin/user_eg2.exe \ - qhull/bin/user_eg3.exe qhull/bin/testqset.exe qhull/bin/msvcr80.dll" -qhull_ufiles="$qhull_dirs qhull/build/*.sln qhull/build/*.vcproj \ - qhull/Announce.txt qhull/CMakeLists.txt qhull/COPYING.txt \ - qhull/File_id.diz qhull/QHULL-GO.lnk qhull/README.txt \ - qhull/REGISTER.txt qhull/index.htm qhull/Makefile" -qhull_d2ufiles="config/changelog config/patches/00list config/Makefile-am-eg \ - config/Makefile-am-html config/Makefile-am-libqhull - config/Makefile-am-main config/README Makefile src/libqhull/Makefile - src/libqhull/MBorland eg/q_eg eg/q_egtest eg/q_test " - -############################# -log_step $LINENO "Clean distribution directories" -############################# - -if [[ -f qhull/src/Make-config.sh || -d qhull/src/debian ]]; then - exit_err $LINENO "Before continuing, remove debian build from src/" -fi -p4 sync -f qhull/build/... -exit_if_err $LINENO "Can not 'p4 sync -f qhull.sln *.vcproj'" -cd qhull && make clean -exit_if_err $LINENO "Can not 'make clean'" -cd .. -rm -f qhull/src/qhull-all.pro.user* qhull/src/libqhull/BCC32tmp.cfg -rm -f qhull/eg/eg.* qhull/*.x qhull/x.* qhull/x qhull/eg/x -rm -f qhull/bin/qhulltest.exe qhull/bin/qhulltest qhull/configure.in -rm -f qhull/src/libqhull/*.exe qhull/src/libqhull/*.a -rm -f qhull/src/libqhull/qconvex.c qhull/src/libqhull/unix.c -rm -f qhull/src/libqhull/qdelaun.c qhull/src/libqhull/qhalf.c -rm -f qhull/src/libqhull/qvoronoi.c qhull/src/libqhull/rbox.c -rm -f qhull/src/libqhull/user_eg.c qhull/src/libqhull/user_eg2.c -rm -f qhull/src/libqhull/testqset.c qhull/Makefile.am -rm -f qhull/src/libqhull/Makefile.am qhull/html/Makefile.am -rm -f qhull/src/Makefile.am qhull/eg/Makefile.am -rm -f qhull/configure.ac - -set noglob - -if [[ -e /bin/msysinfo && $(type -p wzzip) && $(type -p wzunzip) ]]; then - - ############################# - log_step $LINENO "Build zip directory, $TEMP_DIR/qhull" - ############################# - - ls -l $qhull_files $qhull_dirs >>$err_log - exit_if_err $LINENO "Missing files for zip directory" - - log_note $LINENO "Copy \$qhull_files \$qhull_dirs to $TEMP_DIR/qhull" - exit_if_fail $LINENO "rm -rf $TEMP_DIR && mkdir $TEMP_DIR" - exit_if_fail $LINENO "cp -r -p --parents $qhull_files $qhull_dirs $TEMP_DIR" - - ############################# - log_step $LINENO "Write md5sum to $md5_tgz_file" - ############################# - - exit_if_fail $LINENO "pushd $TEMP_DIR/qhull" - create_md5sum $md5_zip_file - exit_if_fail $LINENO "cp -p $md5_zip_file $root_dir" - - ############################# - log_step $LINENO "Write $qhull_zip_file" - ############################# - - log_note $LINENO "Write \$qhull_files to $qhull_zip_file" - exit_if_fail $LINENO "cd .. && mv qhull qhull-$version && md5sum qhull-$version/$md5_zip_file >>$root_dir/$qhullmd5_file" - wzzip -P -r -u $qhull_zip_file qhull-$version >>$err_log - exit_if_err $LINENO "wzzip does not exist or error while zipping files" - check_zip_file $qhull_zip_file - exit_if_fail $LINENO "popd" - exit_if_fail $LINENO "mv $TEMP_DIR/$qhull_zip_file ." -fi - -############################# -log_step $LINENO "Build tgz directory, $TEMP_DIR/qhull" -############################# - -log_note $LINENO "Archive these files as $qhull_tgz_file" -ls -l $qhull_ufiles >>$err_log -exit_if_err $LINENO "Missing files for tgz" - -exit_if_fail $LINENO "rm -rf $TEMP_DIR && mkdir -p $TEMP_DIR" -exit_if_fail $LINENO "cp -r -p --parents $qhull_ufiles $TEMP_DIR" - -if [[ $IS_WINDOWS && $(type -p d2u) ]]; then - log_step $LINENO "Convert to Unix line endings" - convert_to_unix "$TEMP_DIR" -fi - -############################# -log_step $LINENO "Write md5sum to $md5_tgz_file" -############################# - -exit_if_fail $LINENO "pushd $TEMP_DIR && cd qhull" -create_md5sum $md5_tgz_file -exit_if_fail $LINENO "cp -p $md5_tgz_file $root_dir" - -exit_if_fail $LINENO "cd .. && mv qhull qhull-$version && md5sum qhull-$version/$md5_tgz_file >>$root_dir/$qhullmd5_file" - -############################# -log_step $LINENO "Write $qhull_tgz_file" -############################# - -exit_if_fail $LINENO "tar -zcf $root_dir/$qhull_tgz_file * && popd" -check_tgz_file $qhull_tgz_file - -log_note $LINENO "md5sum of zip and tgz files" - -for f in $qhull_zip_file $qhull_tgz_file; do - if [[ -r $f ]]; then - exit_if_fail $LINENO "md5sum $f >>$qhullmd5_file" - fi -done - -############################# -log_step $LINENO "Extract zip and tgz files to ($TEMP_DIR)" -############################# - -exit_if_fail $LINENO "rm -rf $TEMP_DIR" -if [[ -r $root_dir/$qhull_zip_file ]]; then - exit_if_fail $LINENO "mkdir -p $TEMP_DIR/zip && cd $TEMP_DIR/zip" - exit_if_fail $LINENO "wzunzip -yb -d $root_dir/$qhull_zip_file" - log_step $LINENO "Search for date stamps to zip/Dates.txt" - find . -type f | grep -v '/bin/' | xargs grep '\-20' | grep -v -E '(page=|ISBN|sql-2005|utility-2000|written 2002-2003|tail -n -20|Spinellis|WEBSIDESTORY|D:06-5-2007|server-2005)' >Dates.txt - find . -type f | grep -v '/bin/' | xargs grep -i 'qhull *20' >>Dates.txt -fi -if [[ -r $root_dir/$qhull_tgz_file ]]; then - exit_if_fail $LINENO "mkdir -p $TEMP_DIR/tgz && cd $TEMP_DIR/tgz" - exit_if_fail $LINENO "tar -zxf $root_dir/$qhull_tgz_file" -fi - -############################# -log_step $LINENO "Compare previous zip release, Dates.txt, and md5sum. Check for virus." -log_step $LINENO "Compare zip and tgz for CRLF vs LF" -log_step $LINENO "Search xml files for UNDEFINED. Check page links" -log_step $LINENO "Extract zip to Qhull/ and compare directories" -log_step $LINENO "Finished successfully" -############################# diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhulltest-ok.txt b/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhulltest-ok.txt deleted file mode 100644 index 8b74a60020..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/eg/qhulltest-ok.txt +++ /dev/null @@ -1,1128 +0,0 @@ -********* Start testing of orgQhull::QhullVertex_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullVertex_test::initTestCase() -PASS : orgQhull::QhullVertex_test::t_constructConvert() -5 -3 -2 -1 -6 -0 -7 -8 -XFAIL : orgQhull::QhullVertex_test::t_getSet() ListIterator copy constructor not reset to BOT -..\..\src\qhulltest\QhullVertex_test.cpp(107) : failure location -Point 1: -p1: 0.15707 -0.521517 0.673312 - -Point 0: -p0: -0.0992431 0.442941 0.737533 - -Point 2: -p2: 0.554717 0.664895 0.0142947 - -Point 3: -p3: 0.81103 -0.299563 -0.0499261 - -Point 6: -p6: -0.15707 0.521517 -0.673312 - -Point 4: -p4: -0.81103 0.299563 0.0499261 - -Point 5: -p5: -0.554717 -0.664895 -0.0142947 - -Point 7: -p7: 0.0992431 -0.442941 -0.737533 - -PASS : orgQhull::QhullVertex_test::t_getSet() -PASS : orgQhull::QhullVertex_test::t_foreach() -Vertex and vertices w/o runId: -- p4 (v1): 0.5 -0.5 -0.5 - neighborFacets: f1 f2 f9 - p6(v6) p2(v2) p4(v1) p0(v0) -Vertex and vertices w/ runId: -- p4 (v1): 0.5 -0.5 -0.5 - neighborFacets: f1 f2 f9 -vertices: p6(v6) p2(v2) p4(v1) p0(v0) - -Try again with simplicial facets. No neighboring facets listed for vertices. -Vertex and vertices w/o runId: -- p0 (v5): -0.0222149 -0.366435 0.327062 -This time with neighborFacets() defined for all vertices: -- p0 (v5): -0.0222149 -0.366435 0.327062 - neighborFacets: f5 f6 f7 f8 - -Try again with Voronoi diagram of simplicial facets. Neighboring facets automatically defined for vertices. -Vertex and vertices w/o runId: -- p7 (v1): 0.386746 0.0449288 0.118336 0.165595 - neighborFacets: f1 f6 f9 f13 f14 f15 f16 f18 f19 f21 -PASS : orgQhull::QhullVertex_test::t_io() -PASS : orgQhull::QhullVertex_test::cleanupTestCase() -Totals: 6 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullVertex_test ********* -********* Start testing of orgQhull::Coordinates_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::Coordinates_test::initTestCase() -PASS : orgQhull::Coordinates_test::t_construct() -PASS : orgQhull::Coordinates_test::t_convert() -PASS : orgQhull::Coordinates_test::t_element() -PASS : orgQhull::Coordinates_test::t_readonly() -PASS : orgQhull::Coordinates_test::t_operator() -PASS : orgQhull::Coordinates_test::t_const_iterator() -PASS : orgQhull::Coordinates_test::t_iterator() -PASS : orgQhull::Coordinates_test::t_coord_iterator() -PASS : orgQhull::Coordinates_test::t_mutable_coord_iterator() -PASS : orgQhull::Coordinates_test::t_readwrite() -PASS : orgQhull::Coordinates_test::t_search() -Coordinates 1-2-3 -1 2 3 PASS : orgQhull::Coordinates_test::t_io() -PASS : orgQhull::Coordinates_test::cleanupTestCase() -Totals: 14 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::Coordinates_test ********* -********* Start testing of orgQhull::PointCoordinates_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::PointCoordinates_test::initTestCase() -PASS : orgQhull::PointCoordinates_test::t_construct() -PASS : orgQhull::PointCoordinates_test::t_convert() -INFO : Caught QH10063 Qhull error: can not change PointCoordinates dimension (from 3 to 2) -PASS : orgQhull::PointCoordinates_test::t_getset() -PASS : orgQhull::PointCoordinates_test::t_element() -PASS : orgQhull::PointCoordinates_test::t_foreach() -PASS : orgQhull::PointCoordinates_test::t_search() -PASS : orgQhull::PointCoordinates_test::t_modify() -PASS : orgQhull::PointCoordinates_test::t_append_points() -PASS : orgQhull::PointCoordinates_test::t_coord_iterator() -PointCoordinates 0-d -0 -0 -PointCoordinates 1-3-2 -2 -3 -1 2 -3 1 -2 3 -PASS : orgQhull::PointCoordinates_test::t_io() -PASS : orgQhull::PointCoordinates_test::cleanupTestCase() -Totals: 12 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::PointCoordinates_test ********* -********* Start testing of orgQhull::QhullFacet_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullFacet_test::initTestCase() -PASS : orgQhull::QhullFacet_test::t_constructConvert() -18 -19 -22 -24 -26 -27 -30 -31 -34 -35 -38 -39 -XFAIL : orgQhull::QhullFacet_test::t_getSet() ListIterator copy constructor not reset to BOT -..\..\src\qhulltest\QhullFacet_test.cpp(106) : failure location -Hyperplane: 0.711787 0.143377 0.687607 -0.5 - -InnerPlane: 0.711787 0.143377 0.687607 -0.5 -innerOffset+0.5 1.16573e-015 -OuterPlane: 0.711787 0.143377 0.687607 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10487712: 0.355893 0.0716887 0.343803 - -Hyperplane: 0.711787 0.143377 0.687607 -0.5 - -InnerPlane: 0.711787 0.143377 0.687607 -0.5 -innerOffset+0.5 1.16573e-015 -OuterPlane: 0.711787 0.143377 0.687607 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10487712: 0.355893 0.0716887 0.343803 - -Hyperplane: -0.256313 0.964458 0.0642208 -0.5 - -InnerPlane: -0.256313 0.964458 0.0642208 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: -0.256313 0.964458 0.0642208 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10488224: -0.128156 0.482229 0.0321104 - -Hyperplane: -0.256313 0.964458 0.0642208 -0.5 - -InnerPlane: -0.256313 0.964458 0.0642208 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: -0.256313 0.964458 0.0642208 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10488224: -0.128156 0.482229 0.0321104 - -Hyperplane: -0.65396 -0.221954 0.723238 -0.5 - -InnerPlane: -0.65396 -0.221954 0.723238 -0.5 -innerOffset+0.5 1.22125e-015 -OuterPlane: -0.65396 -0.221954 0.723238 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10497256: -0.32698 -0.110977 0.361619 - -Hyperplane: -0.65396 -0.221954 0.723238 -0.5 - -InnerPlane: -0.65396 -0.221954 0.723238 -0.5 -innerOffset+0.5 1.22125e-015 -OuterPlane: -0.65396 -0.221954 0.723238 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10497256: -0.32698 -0.110977 0.361619 - -Hyperplane: 0.65396 0.221954 -0.723238 -0.5 - -InnerPlane: 0.65396 0.221954 -0.723238 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: 0.65396 0.221954 -0.723238 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10488096: 0.32698 0.110977 -0.361619 - -Hyperplane: 0.65396 0.221954 -0.723238 -0.5 - -InnerPlane: 0.65396 0.221954 -0.723238 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: 0.65396 0.221954 -0.723238 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10488096: 0.32698 0.110977 -0.361619 - -Hyperplane: 0.256313 -0.964458 -0.0642208 -0.5 - -InnerPlane: 0.256313 -0.964458 -0.0642208 -0.5 -innerOffset+0.5 1.22125e-015 -OuterPlane: 0.256313 -0.964458 -0.0642208 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10497112: 0.128156 -0.482229 -0.0321104 - -Hyperplane: 0.256313 -0.964458 -0.0642208 -0.5 - -InnerPlane: 0.256313 -0.964458 -0.0642208 -0.5 -innerOffset+0.5 1.22125e-015 -OuterPlane: 0.256313 -0.964458 -0.0642208 -0.5 -outerOffset+0.5 -2.33147e-015 -Center: p10497112: 0.128156 -0.482229 -0.0321104 - -Hyperplane: -0.711787 -0.143377 -0.687607 -0.5 - -InnerPlane: -0.711787 -0.143377 -0.687607 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: -0.711787 -0.143377 -0.687607 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10497280: -0.355893 -0.0716887 -0.343803 - -Hyperplane: -0.711787 -0.143377 -0.687607 -0.5 - -InnerPlane: -0.711787 -0.143377 -0.687607 -0.5 -innerOffset+0.5 1.11022e-015 -OuterPlane: -0.711787 -0.143377 -0.687607 -0.5 -outerOffset+0.5 -2.22045e-015 -Center: p10497280: -0.355893 -0.0716887 -0.343803 - -Voronoi vertex: 0 4.996e-016 4.996e-016 - DistanceEpsilon 1e-012 -PASS : orgQhull::QhullFacet_test::t_getSet() -PASS : orgQhull::QhullFacet_test::t_value() -PASS : orgQhull::QhullFacet_test::t_foreach() -- f1 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0 -0 -1 - - offset: -0.5 - - center: 0 0 -0.5 - - vertices: p6(v6) p2(v2) p4(v1) p0(v0) - - neighboring facets: f2 f3 f9 f10 - - ridges: - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 - - r3 tested - vertices: p4(v1) p0(v0) - between f2 and f1 - - r1 tested - vertices: p6(v6) p4(v1) - between f9 and f1 - - r2 tested - vertices: p6(v6) p2(v2) - between f1 and f10 -- f1 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0 -0 -1 - - offset: -0.5 - - center: 0 0 -0.5 - - vertices: p6(v6) p2(v2) p4(v1) p0(v0) - - neighboring facets: f2 f3 f9 f10 - - flags: bottom tested seen coplanar - - center:0 0 -0.5 - - ridges: - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 - - r3 tested - vertices: p4(v1) p0(v0) - between f2 and f1 - - r1 tested - vertices: p6(v6) p4(v1) - between f9 and f1 - - r2 tested - vertices: p6(v6) p2(v2) - between f1 and f10 -PASS : orgQhull::QhullFacet_test::t_io() -PASS : orgQhull::QhullFacet_test::cleanupTestCase() -Totals: 7 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullFacet_test ********* -********* Start testing of orgQhull::QhullFacetList_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullFacetList_test::initTestCase() -PASS : orgQhull::QhullFacetList_test::t_construct() -PASS : orgQhull::QhullFacetList_test::t_convert() -PASS : orgQhull::QhullFacetList_test::t_readonly() -PASS : orgQhull::QhullFacetList_test::t_foreach() -Vertices for 3 facets -- p1 (v5): 0.15707 -0.521517 0.673312 - neighborFacets: f6 f4 f11 -- p0 (v3): -0.0992431 0.442941 0.737533 - neighborFacets: f3 f4 f6 -- p2 (v2): 0.554717 0.664895 0.0142947 - neighborFacets: f3 f4 f8 -- p3 (v1): 0.81103 -0.299563 -0.0499261 - neighborFacets: f4 f8 f11 -- p6 (v6): -0.15707 0.521517 -0.673312 - neighborFacets: f8 f3 f13 -- p4 (v0): -0.81103 0.299563 0.0499261 - neighborFacets: f3 f6 f13 -- p5 (v7): -0.554717 -0.664895 -0.0142947 - neighborFacets: f11 f6 f13 -- f4 - - flags: top tested seen - - merges: 1 - - normal: 0.711787 0.143377 0.687607 - - offset: -0.5 - - center: 0.355893 0.0716887 0.343803 - - vertices: p1(v5) p0(v3) p2(v2) p3(v1) - - neighboring facets: f8 f3 f11 f6 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r3 tested - vertices: p2(v2) p3(v1) - between f4 and f8 - - r1 tested - vertices: p1(v5) p3(v1) - between f11 and f4 - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 -- f3 - - flags: bottom tested seen - - merges: 1 - - normal: -0.256313 0.964458 0.0642208 - - offset: -0.5 - - center: -0.128156 0.482229 0.0321104 - - vertices: p6(v6) p0(v3) p2(v2) p4(v0) - - neighboring facets: f13 f6 f4 f8 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - - r6 tested - vertices: p6(v6) p4(v0) - between f13 and f3 - - r10 tested - vertices: p6(v6) p2(v2) - between f3 and f8 -- f6 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0.65396 -0.221954 0.723238 - - offset: -0.5 - - center: -0.32698 -0.110977 0.361619 - - vertices: p5(v7) p1(v5) p0(v3) p4(v0) - - neighboring facets: f3 f4 f13 f11 - - ridges: - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 - - r14 tested - vertices: p5(v7) p1(v5) - between f11 and f6 - - r13 tested - vertices: p5(v7) p4(v0) - between f6 and f13 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - -Facets only -- f4 - - flags: top tested seen - - merges: 1 - - normal: 0.711787 0.143377 0.687607 - - offset: -0.5 - - center: 0.355893 0.0716887 0.343803 - - vertices: p1(v5) p0(v3) p2(v2) p3(v1) - - neighboring facets: f8 f3 f11 f6 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r3 tested - vertices: p2(v2) p3(v1) - between f4 and f8 - - r1 tested - vertices: p1(v5) p3(v1) - between f11 and f4 - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 -- f3 - - flags: bottom tested seen - - merges: 1 - - normal: -0.256313 0.964458 0.0642208 - - offset: -0.5 - - center: -0.128156 0.482229 0.0321104 - - vertices: p6(v6) p0(v3) p2(v2) p4(v0) - - neighboring facets: f13 f6 f4 f8 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - - r6 tested - vertices: p6(v6) p4(v0) - between f13 and f3 - - r10 tested - vertices: p6(v6) p2(v2) - between f3 and f8 -- f6 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0.65396 -0.221954 0.723238 - - offset: -0.5 - - center: -0.32698 -0.110977 0.361619 - - vertices: p5(v7) p1(v5) p0(v3) p4(v0) - - neighboring facets: f3 f4 f13 f11 - - ridges: - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 - - r14 tested - vertices: p5(v7) p1(v5) - between f11 and f6 - - r13 tested - vertices: p5(v7) p4(v0) - between f6 and f13 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 -PASS : orgQhull::QhullFacetList_test::t_io() -PASS : orgQhull::QhullFacetList_test::cleanupTestCase() -Totals: 7 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullFacetList_test ********* -********* Start testing of orgQhull::QhullFacetSet_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullFacetSet_test::initTestCase() -PASS : orgQhull::QhullFacetSet_test::t_construct() -PASS : orgQhull::QhullFacetSet_test::t_convert() -PASS : orgQhull::QhullFacetSet_test::t_readonly() -PASS : orgQhull::QhullFacetSet_test::t_foreach() -- f3 - - flags: bottom tested seen - - merges: 1 - - normal: -0.256313 0.964458 0.0642208 - - offset: -0.5 - - center: -0.128156 0.482229 0.0321104 - - vertices: p6(v6) p0(v3) p2(v2) p4(v0) - - neighboring facets: f13 f6 f4 f8 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - - r6 tested - vertices: p6(v6) p4(v0) - between f13 and f3 - - r10 tested - vertices: p6(v6) p2(v2) - between f3 and f8 -- f6 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0.65396 -0.221954 0.723238 - - offset: -0.5 - - center: -0.32698 -0.110977 0.361619 - - vertices: p5(v7) p1(v5) p0(v3) p4(v0) - - neighboring facets: f3 f4 f13 f11 - - ridges: - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 - - r14 tested - vertices: p5(v7) p1(v5) - between f11 and f6 - - r13 tested - vertices: p5(v7) p4(v0) - between f6 and f13 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - -Facet identifiers: f3 f6 -PASS : orgQhull::QhullFacetSet_test::t_io() -PASS : orgQhull::QhullFacetSet_test::cleanupTestCase() -Totals: 7 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullFacetSet_test ********* -********* Start testing of orgQhull::QhullHyperplane_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullHyperplane_test::initTestCase() -PASS : orgQhull::QhullHyperplane_test::t_construct() -PASS : orgQhull::QhullHyperplane_test::t_convert() -h18 -h19 -h22 -h24 -h26 -h27 -h30 -h31 -h34 -h35 -h38 -h39 -PASS : orgQhull::QhullHyperplane_test::t_readonly() -PASS : orgQhull::QhullHyperplane_test::t_define() -PASS : orgQhull::QhullHyperplane_test::t_value() -PASS : orgQhull::QhullHyperplane_test::t_operator() -PASS : orgQhull::QhullHyperplane_test::t_iterator() -PASS : orgQhull::QhullHyperplane_test::t_const_iterator() -PASS : orgQhull::QhullHyperplane_test::t_qhullHyperplane_iterator() -Hyperplane: - -0 -0 -1 -0.5 -Hyperplane w/ runId: - -0 -0 -1 -0.5 - and a message -0 -0 -1 offset -0.5 -PASS : orgQhull::QhullHyperplane_test::t_io() -PASS : orgQhull::QhullHyperplane_test::cleanupTestCase() -Totals: 12 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullHyperplane_test ********* -********* Start testing of orgQhull::QhullLinkedList_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullLinkedList_test::initTestCase() -PASS : orgQhull::QhullLinkedList_test::t_construct() -PASS : orgQhull::QhullLinkedList_test::t_convert() -PASS : orgQhull::QhullLinkedList_test::t_element() -PASS : orgQhull::QhullLinkedList_test::t_search() -PASS : orgQhull::QhullLinkedList_test::t_iterator() -PASS : orgQhull::QhullLinkedList_test::t_const_iterator() -PASS : orgQhull::QhullLinkedList_test::t_QhullLinkedList_iterator() -INFO: empty QhullVertextList -INFO: - p0 (v3): -0.0992431 0.442941 0.737533 - neighborFacets: f3 f4 f6 -- p7 (v8): 0.0992431 -0.442941 -0.737533 - neighborFacets: f8 f11 f13 -- p6 (v6): -0.15707 0.521517 -0.673312 - neighborFacets: f8 f3 f13 -- p3 (v1): 0.81103 -0.299563 -0.0499261 - neighborFacets: f4 f8 f11 -- p5 (v7): -0.554717 -0.664895 -0.0142947 - neighborFacets: f11 f6 f13 -- p2 (v2): 0.554717 0.664895 0.0142947 - neighborFacets: f3 f4 f8 -- p1 (v5): 0.15707 -0.521517 0.673312 - neighborFacets: f6 f4 f11 -- p4 (v0): -0.81103 0.299563 0.0499261 - neighborFacets: f3 f6 f13 - -PASS : orgQhull::QhullLinkedList_test::t_io() -PASS : orgQhull::QhullLinkedList_test::cleanupTestCase() -Totals: 10 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullLinkedList_test ********* -********* Start testing of orgQhull::QhullPoint_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullPoint_test::initTestCase() -PASS : orgQhull::QhullPoint_test::t_construct() -PASS : orgQhull::QhullPoint_test::t_convert() -p1 -p0 -p2 -p3 -p6 -p4 -p5 -p7 -PASS : orgQhull::QhullPoint_test::t_readonly() -PASS : orgQhull::QhullPoint_test::t_define() -PASS : orgQhull::QhullPoint_test::t_operator() -PASS : orgQhull::QhullPoint_test::t_iterator() -PASS : orgQhull::QhullPoint_test::t_const_iterator() -PASS : orgQhull::QhullPoint_test::t_qhullpoint_iterator() -Point w/o runId: -p4: 0.5 -0.5 -0.5 -Point w/ runId: -p4: 0.5 -0.5 -0.5 - and a message 0.5 -0.5 -0.5 - Point with id and a message p4: 0.5 -0.5 -0.5 -PASS : orgQhull::QhullPoint_test::t_io() -PASS : orgQhull::QhullPoint_test::cleanupTestCase() -Totals: 11 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullPoint_test ********* -********* Start testing of orgQhull::QhullPoints_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullPoints_test::initTestCase() -PASS : orgQhull::QhullPoints_test::t_construct() -PASS : orgQhull::QhullPoints_test::t_convert() -PASS : orgQhull::QhullPoints_test::t_getset() -PASS : orgQhull::QhullPoints_test::t_element() -PASS : orgQhull::QhullPoints_test::t_iterator() -PASS : orgQhull::QhullPoints_test::t_const_iterator() -PASS : orgQhull::QhullPoints_test::t_search() -PASS : orgQhull::QhullPoints_test::t_points_iterator() -Empty QhullPoints - -QhullPoints from c[] -p1241312: 0 1 2 -p1241336: 3 4 5 - -QhullPoints -p0: -0.0992431 0.442941 0.737533 -p1: 0.15707 -0.521517 0.673312 -p2: 0.554717 0.664895 0.0142947 -p3: 0.81103 -0.299563 -0.0499261 -p4: -0.81103 0.299563 0.0499261 -p5: -0.554717 -0.664895 -0.0142947 -p6: -0.15707 0.521517 -0.673312 -p7: 0.0992431 -0.442941 -0.737533 -RunId -p0: -0.0992431 0.442941 0.737533 -p1: 0.15707 -0.521517 0.673312 -p2: 0.554717 0.664895 0.0142947 -p3: 0.81103 -0.299563 -0.0499261 -p4: -0.81103 0.299563 0.0499261 -p5: -0.554717 -0.664895 -0.0142947 -p6: -0.15707 0.521517 -0.673312 -p7: 0.0992431 -0.442941 -0.737533 -RunId w/ message - -0.0992431 0.442941 0.737533 - 0.15707 -0.521517 0.673312 - 0.554717 0.664895 0.0142947 - 0.81103 -0.299563 -0.0499261 - -0.81103 0.299563 0.0499261 - -0.554717 -0.664895 -0.0142947 - -0.15707 0.521517 -0.673312 - 0.0992431 -0.442941 -0.737533 -RunId w/ identifiers -p0: -0.0992431 0.442941 0.737533 -p1: 0.15707 -0.521517 0.673312 -p2: 0.554717 0.664895 0.0142947 -p3: 0.81103 -0.299563 -0.0499261 -p4: -0.81103 0.299563 0.0499261 -p5: -0.554717 -0.664895 -0.0142947 -p6: -0.15707 0.521517 -0.673312 -p7: 0.0992431 -0.442941 -0.737533 -PASS : orgQhull::QhullPoints_test::t_io() -PASS : orgQhull::QhullPoints_test::cleanupTestCase() -Totals: 11 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullPoints_test ********* -********* Start testing of orgQhull::QhullPointSet_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullPointSet_test::initTestCase() -PASS : orgQhull::QhullPointSet_test::t_construct() -PASS : orgQhull::QhullPointSet_test::t_convert() -PASS : orgQhull::QhullPointSet_test::t_element() -PASS : orgQhull::QhullPointSet_test::t_iterator() -PASS : orgQhull::QhullPointSet_test::t_const_iterator() -PASS : orgQhull::QhullPointSet_test::t_search() -PASS : orgQhull::QhullPointSet_test::t_pointset_iterator() -QhullPointSet from coplanarPoints -p21: 0.368247 0.129543 0.5 -p51: 0.35127 -0.210684 0.5 -p80: 0.313266 0.0568358 0.5 -p27: 0.0344498 -0.00151988 0.5 -p34: -0.000258967 -0.352467 0.5 -p19: 0.44098 -0.449916 0.5 -p57: -0.300445 0.416634 0.5 -p97: -0.336919 0.403301 0.5 -p108: -0.442525 0.486883 0.5 -p48: 0.100394 0.317561 0.5 -p50: 0.188981 0.202207 0.5 -p75: 0.196243 0.25294 0.5 -p5: -0.082514 0.186773 0.5 -p12: -0.22729 -0.0635886 0.5 -p23: -0.148985 0.0132737 0.5 -p29: -0.340232 -0.287248 0.5 -p87: -0.17844 -0.0395658 0.5 -p100: -0.114231 0.126861 0.5 -p7: -0.0840006 0.201191 0.5 -p0: -0.499992 -0.368462 0.5 -p110: 0.076173 0.238959 0.5 -p28: 0.0545838 0.390737 0.5 -p15: 0.404653 0.00452289 0.5 - - -RunId -p21: 0.368247 0.129543 0.5 -p51: 0.35127 -0.210684 0.5 -p80: 0.313266 0.0568358 0.5 -p27: 0.0344498 -0.00151988 0.5 -p34: -0.000258967 -0.352467 0.5 -p19: 0.44098 -0.449916 0.5 -p57: -0.300445 0.416634 0.5 -p97: -0.336919 0.403301 0.5 -p108: -0.442525 0.486883 0.5 -p48: 0.100394 0.317561 0.5 -p50: 0.188981 0.202207 0.5 -p75: 0.196243 0.25294 0.5 -p5: -0.082514 0.186773 0.5 -p12: -0.22729 -0.0635886 0.5 -p23: -0.148985 0.0132737 0.5 -p29: -0.340232 -0.287248 0.5 -p87: -0.17844 -0.0395658 0.5 -p100: -0.114231 0.126861 0.5 -p7: -0.0840006 0.201191 0.5 -p0: -0.499992 -0.368462 0.5 -p110: 0.076173 0.238959 0.5 -p28: 0.0545838 0.390737 0.5 -p15: 0.404653 0.00452289 0.5 - -RunId w/ message -p21: 0.368247 0.129543 0.5 -p51: 0.35127 -0.210684 0.5 -p80: 0.313266 0.0568358 0.5 -p27: 0.0344498 -0.00151988 0.5 -p34: -0.000258967 -0.352467 0.5 -p19: 0.44098 -0.449916 0.5 -p57: -0.300445 0.416634 0.5 -p97: -0.336919 0.403301 0.5 -p108: -0.442525 0.486883 0.5 -p48: 0.100394 0.317561 0.5 -p50: 0.188981 0.202207 0.5 -p75: 0.196243 0.25294 0.5 -p5: -0.082514 0.186773 0.5 -p12: -0.22729 -0.0635886 0.5 -p23: -0.148985 0.0132737 0.5 -p29: -0.340232 -0.287248 0.5 -p87: -0.17844 -0.0395658 0.5 -p100: -0.114231 0.126861 0.5 -p7: -0.0840006 0.201191 0.5 -p0: -0.499992 -0.368462 0.5 -p110: 0.076173 0.238959 0.5 -p28: 0.0545838 0.390737 0.5 -p15: 0.404653 0.00452289 0.5 -PASS : orgQhull::QhullPointSet_test::t_io() -PASS : orgQhull::QhullPointSet_test::cleanupTestCase() -Totals: 10 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullPointSet_test ********* -********* Start testing of orgQhull::QhullRidge_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullRidge_test::initTestCase() -PASS : orgQhull::QhullRidge_test::t_construct() -4 -3 -1 -2 -XFAIL : orgQhull::QhullRidge_test::t_getSet() SetIterator copy constructor not reset to BOT -..\..\src\qhulltest\QhullRidge_test.cpp(105) : failure location -PASS : orgQhull::QhullRidge_test::t_getSet() -PASS : orgQhull::QhullRidge_test::t_foreach() -Ridges Without runId - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 - - r3 tested - vertices: p4(v1) p0(v0) - between f2 and f1 - - r1 tested - vertices: p6(v6) p4(v1) - between f9 and f1 - - r2 tested - vertices: p6(v6) p2(v2) - between f1 and f10 -Ridge - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 -Ridge with runId - - r4 tested - vertices: p2(v2) p0(v0) - between f1 and f3 -PASS : orgQhull::QhullRidge_test::t_io() -PASS : orgQhull::QhullRidge_test::cleanupTestCase() -Totals: 6 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullRidge_test ********* -********* Start testing of orgQhull::QhullSet_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullSet_test::initTestCase() -PASS : orgQhull::QhullSet_test::t_qhullsetbase() -PASS : orgQhull::QhullSet_test::t_convert() -PASS : orgQhull::QhullSet_test::t_element() -PASS : orgQhull::QhullSet_test::t_search() -PASS : orgQhull::QhullSet_test::t_iterator() -PASS : orgQhull::QhullSet_test::t_const_iterator() -PASS : orgQhull::QhullSet_test::t_qhullset_iterator() -INFO: empty set -INFO: Neighboring facets -- f8 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: 0.65396 0.221954 -0.723238 - - offset: -0.5 - - center: 0.32698 0.110977 -0.361619 - - vertices: p7(v8) p6(v6) p2(v2) p3(v1) - - neighboring facets: f4 f3 f11 f13 - - ridges: - - r3 tested - vertices: p2(v2) p3(v1) - between f4 and f8 - - r10 tested - vertices: p6(v6) p2(v2) - between f3 and f8 - - r17 tested - vertices: p7(v8) p6(v6) - between f13 and f8 - - r16 tested - vertices: p7(v8) p3(v1) - between f8 and f11 -- f3 - - flags: bottom tested seen - - merges: 1 - - normal: -0.256313 0.964458 0.0642208 - - offset: -0.5 - - center: -0.128156 0.482229 0.0321104 - - vertices: p6(v6) p0(v3) p2(v2) p4(v0) - - neighboring facets: f13 f6 f4 f8 - - ridges: - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - - r6 tested - vertices: p6(v6) p4(v0) - between f13 and f3 - - r10 tested - vertices: p6(v6) p2(v2) - between f3 and f8 -- f11 - - flags: top tested seen coplanar - - merges: 1 - - normal: 0.256313 -0.964458 -0.0642208 - - offset: -0.5 - - center: 0.128156 -0.482229 -0.0321104 - - vertices: p7(v8) p5(v7) p1(v5) p3(v1) - - neighboring facets: f4 f8 f6 f13 - - ridges: - - r1 tested - vertices: p1(v5) p3(v1) - between f11 and f4 - - r16 tested - vertices: p7(v8) p3(v1) - between f8 and f11 - - r19 tested - vertices: p7(v8) p5(v7) - between f11 and f13 - - r14 tested - vertices: p5(v7) p1(v5) - between f11 and f6 -- f6 - - flags: bottom tested seen coplanar - - merges: 1 - - normal: -0.65396 -0.221954 0.723238 - - offset: -0.5 - - center: -0.32698 -0.110977 0.361619 - - vertices: p5(v7) p1(v5) p0(v3) p4(v0) - - neighboring facets: f3 f4 f13 f11 - - ridges: - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 - - r14 tested - vertices: p5(v7) p1(v5) - between f11 and f6 - - r13 tested - vertices: p5(v7) p4(v0) - between f6 and f13 - - r11 tested - vertices: p0(v3) p4(v0) - between f3 and f6 - -INFO: Ridges for a facet - - r4 tested - vertices: p0(v3) p2(v2) - between f4 and f3 - - r3 tested - vertices: p2(v2) p3(v1) - between f4 and f8 - - r1 tested - vertices: p1(v5) p3(v1) - between f11 and f4 - - r2 tested - vertices: p1(v5) p0(v3) - between f4 and f6 - -PASS : orgQhull::QhullSet_test::t_io() -PASS : orgQhull::QhullSet_test::cleanupTestCase() -Totals: 10 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullSet_test ********* -********* Start testing of orgQhull::QhullVertex_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::QhullVertex_test::initTestCase() -PASS : orgQhull::QhullVertex_test::t_constructConvert() -5 -3 -2 -1 -6 -0 -7 -8 -XFAIL : orgQhull::QhullVertex_test::t_getSet() ListIterator copy constructor not reset to BOT -..\..\src\qhulltest\QhullVertex_test.cpp(107) : failure location -Point 1: -p1: 0.15707 -0.521517 0.673312 - -Point 0: -p0: -0.0992431 0.442941 0.737533 - -Point 2: -p2: 0.554717 0.664895 0.0142947 - -Point 3: -p3: 0.81103 -0.299563 -0.0499261 - -Point 6: -p6: -0.15707 0.521517 -0.673312 - -Point 4: -p4: -0.81103 0.299563 0.0499261 - -Point 5: -p5: -0.554717 -0.664895 -0.0142947 - -Point 7: -p7: 0.0992431 -0.442941 -0.737533 - -PASS : orgQhull::QhullVertex_test::t_getSet() -PASS : orgQhull::QhullVertex_test::t_foreach() -Vertex and vertices w/o runId: -- p4 (v1): 0.5 -0.5 -0.5 - neighborFacets: f1 f2 f9 - p6(v6) p2(v2) p4(v1) p0(v0) -Vertex and vertices w/ runId: -- p4 (v1): 0.5 -0.5 -0.5 - neighborFacets: f1 f2 f9 -vertices: p6(v6) p2(v2) p4(v1) p0(v0) - -Try again with simplicial facets. No neighboring facets listed for vertices. -Vertex and vertices w/o runId: -- p0 (v5): -0.0222149 -0.366435 0.327062 -This time with neighborFacets() defined for all vertices: -- p0 (v5): -0.0222149 -0.366435 0.327062 - neighborFacets: f5 f6 f7 f8 - -Try again with Voronoi diagram of simplicial facets. Neighboring facets automatically defined for vertices. -Vertex and vertices w/o runId: -- p7 (v1): 0.386746 0.0449288 0.118336 0.165595 - neighborFacets: f1 f6 f9 f13 f14 f15 f16 f18 f19 f21 -PASS : orgQhull::QhullVertex_test::t_io() -PASS : orgQhull::QhullVertex_test::cleanupTestCase() -Totals: 6 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::QhullVertex_test ********* -********* Start testing of orgQhull::RboxPoints_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::RboxPoints_test::initTestCase() -PASS : orgQhull::RboxPoints_test::t_construct() -INFO : Caught QH6189 rbox error: dimension, D0, out of bounds (>=200 or <=0) -INFO : Caught QH10062 Qhull error: can not set PointCoordinates dimension to -1 -PASS : orgQhull::RboxPoints_test::t_error() -PASS : orgQhull::RboxPoints_test::t_test() -INFO : Caught QH10063 Qhull error: can not change PointCoordinates dimension (from 2 to 102) -PASS : orgQhull::RboxPoints_test::t_getSet() -PASS : orgQhull::RboxPoints_test::t_foreach() -INFO : Caught QH10012 Qhull error: expected 4 2-d PointCoordinates but read 3 PointCoordinates plus 1 extra coordinates -PASS : orgQhull::RboxPoints_test::t_change() -PASS : orgQhull::RboxPoints_test::t_ostream() -PASS : orgQhull::RboxPoints_test::cleanupTestCase() -Totals: 9 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::RboxPoints_test ********* -********* Start testing of orgQhull::UsingLibQhull_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::UsingLibQhull_test::initTestCase() -MachineEpsilon 2.22045e-016 angleEpsilon 8.9706e-015 distanceEpsilon 9.87561e-015 - Global angleEpsilon 1 distanceEpsilon 1 -INFO Caught error -- QH10057 Qhull error: missing definition for currentVertexDimension(). Need currentQhull() or setGlobalVertexDimension() - -PASS : orgQhull::UsingLibQhull_test::t_classMembers() -pointsBegin 003E9ED0 pointsEnd 003EA010 dimension 4 -INFO Caught error -- QH10059 Qhull error: missing definition for currentPoints(). Need currentQhull() or setGlobalDistanceEpsilon() - -PASS : orgQhull::UsingLibQhull_test::t_globalPoints() -INFO : Caught QH10049 Qhull error: UsingLibQhull already in use by QhullQh.runId 330525930 -PASS : orgQhull::UsingLibQhull_test::t_UsingLibQhull() -INFO : Caught QH1 -INFO : QH10054 Report previous NOthrow error - -Qhull output at end -qhull: no message for error. Check cerr or error stream -PASS : orgQhull::UsingLibQhull_test::t_methods() -PASS : orgQhull::UsingLibQhull_test::t_cleanuptestcase() -PASS : orgQhull::UsingLibQhull_test::cleanupTestCase() -Totals: 7 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::UsingLibQhull_test ********* -********* Start testing of orgQhull::Qhull_test ********* -Config: Using QTest library 4.7.4, Qt 4.7.4 -PASS : orgQhull::Qhull_test::initTestCase() -INFO : Caught QH10023 Qhull error: checkIfQhullInitialized failed. Call runQhull() first. -INFO : Caught QH10069 Qhull error: can not use Qhull copy constructor if initialized() is true -INFO : Caught QH10070 Qhull error: can not use Qhull copy assignment if initialized() is true -INFO : Caught QH10070 Qhull error: can not use Qhull copy assignment if initialized() is true -PASS : orgQhull::Qhull_test::t_construct() -Expecting summary of halfspace intersect - -Halfspace intersection by the convex hull of 4 points in 2-d: - - Number of halfspaces: 4 - Number of non-redundant halfspaces: 4 - Number of intersection points: 4 - -Statistics for: normals of square | qhull H - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 4 - CPU seconds to compute hull (after input): 0 - -Expecting no output from qh_fprintf() in Qhull.cpp - -Qhull output at end - -Halfspace intersection by the convex hull of 4 points in 2-d: - - Number of halfspaces: 4 - Number of non-redundant halfspaces: 4 - Number of intersection points: 4 - -Statistics for: normals of square | qhull H - - Number of points processed: 4 - Number of hyperplanes created: 6 - Number of distance tests for qhull: 4 - CPU seconds to compute hull (after input): 0 - -PASS : orgQhull::Qhull_test::t_attribute() -INFO : Caught QH6029 qhull error: option 'Fd' is not used with this program. - It may be used with qhull. - -While executing: | -Options selected for Qhull 2012.1 2012/01/22: - run-id 330525930 -INFO : Error stream without output stream -qhull error: option 'Fd' is not used with this program. - It may be used with qhull. - -While executing: | -Options selected for Qhull 2012.1 2012/01/22: - run-id 330525930 -INFO : Caught QH6029 -INFO : Error output sent to output stream without error stream -qhull input error: feasible point is not clearly inside halfspace -feasible point: 0 0 - halfspace: -0.5 -0.5 - at offset: 0.5 and distance: 0.5 -The halfspace was at index 1 - -While executing: rbox "c" | qhull Tz H0 -Options selected for Qhull 2012.1 2012/01/22: - run-id 330525930 Tz-stdout Halfspace-about 0 -INFO : Caught QH6023 -INFO : No error stream or output stream -INFO : Caught QH6029 qhull error: option 'Fd' is not used with this program. - It may be used with qhull. - -While executing: | -Options selected for Qhull 2012.1 2012/01/22: - run-id 330525930 -PASS : orgQhull::Qhull_test::t_message() - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: rbox "c" | qhull s - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 84 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - - -Convex hull of 8 points in 3-d: - - Number of vertices: 8 - Number of facets: 6 - Number of non-simplicial facets: 6 - -Statistics for: rbox "c" | qhull - - Number of points processed: 8 - Number of hyperplanes created: 11 - Number of distance tests for qhull: 35 - Number of distance tests for merging: 84 - Number of distance tests for checking: 56 - Number of merged facets: 6 - CPU seconds to compute hull (after input): 0 - -PASS : orgQhull::Qhull_test::t_getSet() -PASS : orgQhull::Qhull_test::t_getQh() -PASS : orgQhull::Qhull_test::t_getValue() -PASS : orgQhull::Qhull_test::t_foreach() -Expecting vertexList and facetList of a 3-d diamond. -3 -6 8 12 - 0 0 -0.5 - 0 0 0.5 - 0 -0.5 0 - 0 0.5 0 - -0.5 0 0 - 0.5 0 0 -3 3 1 4 -3 1 3 5 -3 0 3 4 -3 3 0 5 -3 2 1 5 -3 1 2 4 -3 2 0 4 -3 0 2 5 -Expecting normals of a 3-d diamond. -4 -8 --0.5773502691896258 0.5773502691896258 0.5773502691896258 -0.2886751345948129 -0.5773502691896258 0.5773502691896258 0.5773502691896258 -0.2886751345948129 --0.5773502691896258 0.5773502691896258 -0.5773502691896258 -0.2886751345948129 -0.5773502691896258 0.5773502691896258 -0.5773502691896258 -0.2886751345948129 -0.5773502691896258 -0.5773502691896258 0.5773502691896258 -0.2886751345948129 --0.5773502691896258 -0.5773502691896258 0.5773502691896258 -0.2886751345948129 --0.5773502691896258 -0.5773502691896258 -0.5773502691896258 -0.2886751345948129 -0.5773502691896258 -0.5773502691896258 -0.5773502691896258 -0.2886751345948129 -PASS : orgQhull::Qhull_test::t_modify() -PASS : orgQhull::Qhull_test::cleanupTestCase() -Totals: 10 passed, 0 failed, 0 skipped -********* Finished testing of orgQhull::Qhull_test ********* -Passed 121 tests. -Finished test of libqhullcpp. Test libqhull with eg/q_test diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/index.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/index.htm deleted file mode 100644 index 5a8cc94abb..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/index.htm +++ /dev/null @@ -1,278 +0,0 @@ - - - - -Qhull code for Convex Hull, Delaunay Triangulation, Voronoi Diagram, and Halfspace Intersection about a Point - - - - -URL: http://www.qhull.org -
    To: -News -• Download -• CiteSeer -• Images -• Manual -• FAQ -• Programs -• Options -

    - -
    - - -
    -

    Qhull

    - [CONE] -
    -Qhull computes the convex hull, Delaunay triangulation, Voronoi diagram, -halfspace intersection about a point, furthest-site Delaunay -triangulation, and furthest-site Voronoi diagram. The source code runs in -2-d, 3-d, 4-d, and higher dimensions. Qhull implements the Quickhull -algorithm for computing the convex hull. It handles roundoff -errors from floating point arithmetic. It computes volumes, -surface areas, and approximations to the convex hull.

    - - -

    Qhull does not support triangulation of non-convex surfaces, mesh -generation of non-convex objects, medium-sized inputs in 9-D -and higher, alpha shapes, weighted Voronoi diagrams, Voronoi volumes, or -constrained Delaunay triangulations,

    - -

    Qhull 2012.1 fixes qhull-go for Windows 64-bit. If you use Qhull 2003.1. please upgrade to 2012.1 or apply poly.c-qh_gethash.patch.

    -
    - -
    -
    - - - -
    - -

    Introduction -

      -
    • Fukuda's introduction to convex hulls, Delaunay - triangulations, Voronoi diagrams, and linear programming
    • -
    • Lambert's Java visualization of convex hull algorithms
    • -
    • LEDA Guide to geometry algorithms -
    • MathWorld's Computational Geometry from Wolfram Research -
    • Skiena's Computational Geometry from his Algorithm Design Manual. -
    • Stony Brook Algorithm Repository, computational geometry
    • -
    - -

    Qhull Documentation and Support -

    - -

    Related URLs -

    - -

    FAQs and Newsgroups -

    - -
    - -

    The program includes options for input transformations, -randomization, tracing, multiple output formats, and execution -statistics. The program can be called from within your -application.

    - -

    You can view the results in 2-d, 3-d and 4-d with Geomview. An alternative -is VTK.

    - -

    For an article about Qhull, download from - ACM or CiteSeer: -

    - -
    -

    Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., "The - Quickhull algorithm for convex hulls," ACM Trans. on - Mathematical Software, 22(4):469-483, Dec 1996, http://www.qhull.org

    -
    - -

    Abstract:

    - -
    -

    The convex hull of a set of points is the smallest convex - set that contains the points. This article presents a - practical convex hull algorithm that combines the - two-dimensional Quickhull Algorithm with the general - dimension Beneath-Beyond Algorithm. It is similar to the - randomized, incremental algorithms for convex hull and - Delaunay triangulation. We provide empirical evidence that - the algorithm runs faster when the input contains non-extreme - points, and that it uses less memory.

    -

    Computational geometry algorithms have traditionally - assumed that input sets are well behaved. When an algorithm - is implemented with floating point arithmetic, this - assumption can lead to serious errors. We briefly describe a - solution to this problem when computing the convex hull in - two, three, or four dimensions. The output is a set of - "thick" facets that contain all possible exact convex hulls - of the input. A variation is effective in five or more - dimensions.

    -
    - -
    - -

    Up: Past Software -Projects of the Geometry Center
    -URL: http://www.qhull.org -
    To: -News -• Download -• CiteSeer -• Images -• Manual -• FAQ -• Programs -• Options -

    - -
    - -

    [HOME] The Geometry Center Home Page

    - -

    Comments to: qhull@qhull.org -
    -Created: May 17 1995 --- - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/qhull-2012.1-src-tgz.md5sum b/src/amuse_simplex/src/plugins/qhull-2012.1/qhull-2012.1-src-tgz.md5sum deleted file mode 100644 index 4a5e87495e..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/qhull-2012.1-src-tgz.md5sum +++ /dev/null @@ -1,226 +0,0 @@ -7eefb7a0e9e50b497965d8cce481aef0 *Announce.txt -228b114fc16e318042aa48d36168108c *CMakeLists.txt -4d4e8c0754b225e2c78cfdd911e8b09e *COPYING.txt -4d888e346c579e8b5775f7b9798982e7 *File_id.diz -77fce4695926034a3f5339a5d4022080 *Makefile -dd1051d9a32f67f84b14d8e841c98532 *QHULL-GO.lnk -8f87d8a173d5488c3a740ae2e2b39446 *README.txt -dfc60c06612b894244510f7efa338c08 *REGISTER.txt -7664877de4e43640ed5ee8efa8d1be2e *build/libqhull.vcproj -902d81edeb5e8de740e2c1f3a34f6582 *build/libqhull_p.vcproj -0cbb4c10f75b0617abe0afd9133a1631 *build/qconvex.vcproj -ed4a1b9f54d9fcb1703003fc636e142a *build/qdelaunay.vcproj -02436b535ac3f9c7e878d72ffcf72841 *build/qhalf.vcproj -04d3ff5080070fa9e9c8cd55a48e8d2f *build/qhull.sln -ed4f697e12be2587dfd53b6db8f95e97 *build/qhull.vcproj -f22428057e018506ecf9fde643896d5f *build/qhullcpp.vcproj -830495c4e0a42298f6ee66a8fe861da6 *build/qhullstatic.vcproj -887d15f733ba90ccb1a5fdf5219bb691 *build/qhullstatic_p.vcproj -b670e407a05228d15814e4fc977d7312 *build/qhulltest.vcproj -e009d90f8beb3edbebcdd251a136c5cf *build/qvoronoi.vcproj -b9dab89541fd7dd63f5bbf6499357108 *build/rbox.vcproj -b0af07d3af7b19aba12c7c151b61f4ed *build/testqset.vcproj -dcf0eb0872eed64edbdaa65c68c7a142 *build/user_eg.vcproj -91f8eba2da101b6f83a0849585cfaff5 *build/user_eg2.vcproj -0b97443e1e9d8dbfdd1e5f9a2e5824f2 *build/user_eg3.vcproj -bc0491b8f4b6024aa9ac29edb1521b0e *config/Makefile-am-eg -1ff23ff54be9692c51ff6c1f848a38ff *config/Makefile-am-html -98f797bade8963e17999ea279741625a *config/Makefile-am-libqhull -3e0562a2b0b293da80c5f643869dadbc *config/Makefile-am-main -40ef7d099a414c69cb2ef8c1e8930f24 *config/Makefile.am -4bc948f73b5e857fa4f1d7e670d93170 *config/README -9dd887eecb76f00a4cffe5b3a12a02dc *config/bootstrap.sh -c46221f1337972cd8f5bc68570302776 *config/changelog -ced9e66e820893e924b96d5c48308107 *config/configure.ac -701b05f40a0748533658e39d7662723f *config/patches/00list -b715736656ac71ff820c66b5281bc305 *config/patches/QHpointer.dpatch -e027029ab2bd9337b4c39e5519cb6db9 *config/patches/make-new-msg.dpatch -a7c173113017aeac4a2f15cb0c391ad8 *eg/Qhull-go.bat -71962e2051e8012aeb6355f7d504e2a9 *eg/make-vcproj.sh -28b54d35fb29c2e6b324bd84d8233c9f *eg/q_eg -c9f81fb803d736caa08c64f797f347e4 *eg/q_egtest -22f89ca3c845c375ae8e51523eaef6d2 *eg/q_test -150dc7c0b4459acbfd6e8359a3d34811 *eg/q_test-ok.txt -acf2db74ccb4caa61e9719b9d185655e *eg/q_test.bat -154be3b6389dee1613d4b2cd7245f782 *eg/qhull-zip.sh -3bcc4b517880f3493e4fdcc2afeaddc2 *eg/qhulltest-ok.txt -adf55b299d1140d0a4afc9d19ccfbe03 *html/index.htm -59e9b69f186c9e715192df9e146ebd21 *html/normal_voronoi_knauss_oesterle.jpg -fc2dc7a8d47b6742dc286ea81351788e *html/qconvex.htm -f6fe4664e7906f43bf2416d46e5f338c *html/qdelau_f.htm -31b462365a07e35547868af716c967a4 *html/qdelaun.htm -bb51e7810cc49e5aff1b910bc3126713 *html/qh--4d.gif -687f459f95e958da6c3ff0c83cafcf46 *html/qh--cone.gif -dc51084bc7ba1f235c71d40c771ce9c8 *html/qh--dt.gif -829df3fbc9a3f36dbdb6389f768b5570 *html/qh--geom.gif -0587393a4591c5fbcd040af9a4f510c7 *html/qh--half.gif -0515fcc283b7dfeeaa7169218722880e *html/qh--rand.gif -8b315590d891a0ba3f8dd375342042a4 *html/qh-code.htm -46ef051cb9a8fedfae6986aaa1d1687e *html/qh-eg.htm -066ac284de6b14d44e12fb64ba158873 *html/qh-faq.htm -522c5098dafaa3af7ff4e3fc3f0efa0c *html/qh-get.htm -9a20f2e77c1ff2967f574fd1a9c25831 *html/qh-impre.htm -86148bd756898b7763991e086f31f206 *html/qh-optc.htm -a1bbd01a4295da8dcaf3ac2673565c17 *html/qh-optf.htm -2e6f040a7287d5ba15fdefc5dc022bbe *html/qh-optg.htm -ea5dcdf7f4524ccb481ef8d6b5ca996c *html/qh-opto.htm -9567d39c46459051f3ee3d7e3d0dcc44 *html/qh-optp.htm -8bc8afee64900d2e844addde13736212 *html/qh-optq.htm -eb28e606940efd911871b9aecd33ea2f *html/qh-optt.htm -363544401925838bbe1ceab33d9726bb *html/qh-quick.htm -69f0438674646abb7e26f262078125c1 *html/qhalf.htm -1c38b2d9feebdfa3a314a9f270a6376f *html/qhull-cpp.xml -c445b73408c8db30f12224c3f14fb0b9 *html/qhull.htm -d331c1896f7d8e169b67a20f84b0db66 *html/qhull.man -4dec0c255230cad36c663bd40ad242c6 *html/qhull.txt -3e371f2fd3f0f86d4710b13b19aaff5a *html/qvoron_f.htm -6cf18d98ae05418ba2a23ef95fca123d *html/qvoronoi.htm -1b5f3e990ec8e23b6c9215f9549d0bd4 *html/rbox.htm -35f4fda8b97c1b35046ba419db8e3b00 *html/rbox.man -8be71a3700b38b23c84dc76d467fbe2c *html/rbox.txt -3ef57a456eab6c76f5c029c917a5db3d *index.htm -b4ff72a73ea097b7fed6d0a1359c917b *src/Changes.txt -570fe0f0921d09563283c9c7832c0a40 *src/libqhull/Makefile -e76b4786a5fa7197784c0dcf98e3949f *src/libqhull/Mborland -33df56a158139017240ed504e0859902 *src/libqhull/geom.c -f6bf01635c613188127072f12fe00780 *src/libqhull/geom.h -397184a62236b6da5743c51d1966936e *src/libqhull/geom2.c -497d9d529fc5b59cf12f3c3bb990f33f *src/libqhull/global.c -08e91f19466a73d68d86a3d062f97362 *src/libqhull/index.htm -14d5a50bd0c9d610cb6228872eddd37a *src/libqhull/io.c -468967da4f11b026b625f06e8eb914ce *src/libqhull/io.h -defc29d305b749957846c342cf25e792 *src/libqhull/libqhull.c -93ad3473088d395bb95957e806a54022 *src/libqhull/libqhull.h -494592497fda68c24d9b3cb1990dbbcc *src/libqhull/libqhull.pro -19590eb4d9ac809bb05a7442dd411efb *src/libqhull/mem.c -eda36f5553416f06257fbddeb6ae9896 *src/libqhull/mem.h -86529cdc35e4f3d7b7a6a58c38334c5c *src/libqhull/merge.c -9b2af5595e53875a4cfe9e0c00373f17 *src/libqhull/merge.h -ed9d9a72120f54953bea267087e4e11e *src/libqhull/poly.c -b0dad87be22a2df940803bffc07123b8 *src/libqhull/poly.h -99cf70c159e244a01e6bef1ddc6080c6 *src/libqhull/poly2.c -d40b8b3b91cbba952e1e2a2cb87060e0 *src/libqhull/qh-geom.htm -ff3f3bcbafe20885688df4b4098e61a8 *src/libqhull/qh-globa.htm -0004d1fc076236eed4b9b718ddf7a60b *src/libqhull/qh-io.htm -2e0810f8c0c76bbc86bb3fe91af7d825 *src/libqhull/qh-mem.htm -86ca15e7d9666a6c8f80f4306d67c0ba *src/libqhull/qh-merge.htm -77e2ab66da8a9557bcd9f408a65381ba *src/libqhull/qh-poly.htm -6ea522b6f42dd7cb5c0b9a437b9742c4 *src/libqhull/qh-qhull.htm -8450973fd8602d6f1933826c88170cc5 *src/libqhull/qh-set.htm -1837440279e1e20ff5f9187c08402421 *src/libqhull/qh-stat.htm -2bef2af48313ec0c0292baf77945a60d *src/libqhull/qh-user.htm -93439c8b3ce15bcbf46b12d05b1c5d41 *src/libqhull/qhull-exports.def -e48866d2bf886f36f382a953cd89d188 *src/libqhull/qhull_a.h -e9e5e784e7855b3780b9c918ec0378f8 *src/libqhull/qset.c -0bf5245627a0c967462e72d75ec4577a *src/libqhull/qset.h -8b715e49c811ccc9e0344ba3ce84a64c *src/libqhull/random.c -0cd875c49dbece7da242e82c9f0a9b57 *src/libqhull/random.h -fa53472e44fcd1e5c2609ab211fd6bdc *src/libqhull/rboxlib.c -95fb4aea24293d21bdfc66aa29f4d298 *src/libqhull/stat.c -da58d2b7c170bc745e367dbf676e0c84 *src/libqhull/stat.h -17712e8f53052183c05d7a6a94c9ce15 *src/libqhull/user.c -fc3549bf0ef2c2df2197b6778cbc52f9 *src/libqhull/user.h -ffcb064a0e40cb4362e4856330b9fa9e *src/libqhull/usermem.c -44cdbaf75ac939cd232bea4b87eb5d23 *src/libqhull/userprintf.c -02231d8c24455712e111fc051c5beead *src/libqhull/userprintf_rbox.c -382e8c1c64504f3881447af220c923ea *src/libqhullcpp/Coordinates.cpp -55251548d5704f3e7a772a8710866100 *src/libqhullcpp/Coordinates.h -8a6d47d74739a6091697e10129cd2930 *src/libqhullcpp/PointCoordinates.cpp -79934156057661d383c1d8600aafd829 *src/libqhullcpp/PointCoordinates.h -6ae2215c97c81318d4b4f11166daaa1c *src/libqhullcpp/Qhull.cpp -9f304be7db079b76028d5c27ad970b99 *src/libqhullcpp/Qhull.h -c338c4b387032eb2ff50a1fdf35741ee *src/libqhullcpp/QhullError.h -7773563912b6cdc4fc4b41ce6a4f27ed *src/libqhullcpp/QhullFacet.cpp -cbe861a3fae8c7295600b56191d3ae6d *src/libqhullcpp/QhullFacet.h -b3ca304832df52f4fa5c70650ec11d29 *src/libqhullcpp/QhullFacetList.cpp -b44173b27af91415f42d3af123e8a3c1 *src/libqhullcpp/QhullFacetList.h -e41bd833082235d277f1589bdd230901 *src/libqhullcpp/QhullFacetSet.cpp -2396fa3789b8e08e5688028307751204 *src/libqhullcpp/QhullFacetSet.h -de893224155afb991b5a6b9210c91875 *src/libqhullcpp/QhullHyperplane.cpp -788a306bd152b47d06fa02b14ce4258a *src/libqhullcpp/QhullHyperplane.h -9b67ffe6ef6a1c795e21c8284cbe072e *src/libqhullcpp/QhullIterator.h -97e88e444e101ec62f60560a45bc05b1 *src/libqhullcpp/QhullLinkedList.h -5b74b535d054bf518c16cca5c5925232 *src/libqhullcpp/QhullPoint.cpp -ff6a771ee13916a4852c305ab0c71c51 *src/libqhullcpp/QhullPoint.h -1acea5c471e160edb11e6d0c4c371470 *src/libqhullcpp/QhullPointSet.cpp -0e6fd2a043f1fb8e0f666989fcb9d7bb *src/libqhullcpp/QhullPointSet.h -a56a9eff52696389389267a007364ce2 *src/libqhullcpp/QhullPoints.cpp -0643aeede36ca7bd63cf57a7cacbca15 *src/libqhullcpp/QhullPoints.h -2ebb3ffe7e46c3548bbd0764f0ae8256 *src/libqhullcpp/QhullQh.cpp -363a2cebdb669f51b42b7a865111df59 *src/libqhullcpp/QhullQh.h -3c02d28c52383c02080bdd3545df2e0b *src/libqhullcpp/QhullRidge.cpp -f8a56f12257257deb36954a72cfcbb49 *src/libqhullcpp/QhullRidge.h -bc395fa1e070f0006128c240984c8e8e *src/libqhullcpp/QhullSet.cpp -2f76fa536cac29a92e6e84e1a47ed23f *src/libqhullcpp/QhullSet.h -cf217e2c71f194d9d58302f04eeb34aa *src/libqhullcpp/QhullSets.h -fd290add689e138c4027e8f3bcb79c22 *src/libqhullcpp/QhullStat.cpp -628d20fd4fdcd9c9a9bccf3a2a86db92 *src/libqhullcpp/QhullStat.h -b256a7ce99b33ca945d3636f49e69001 *src/libqhullcpp/QhullVertex.cpp -62fd8eb77af5f8866fb3dacce88a46a0 *src/libqhullcpp/QhullVertex.h -69f552a3dc64bab4aa66996e9c036ebc *src/libqhullcpp/QhullVertexSet.cpp -7d332c5cf2cb6c9905447086b9564e81 *src/libqhullcpp/QhullVertexSet.h -3cfeda37cea58bc876ade8c34d079767 *src/libqhullcpp/RboxPoints.cpp -e2d2e52a0b5a50344a5efbf24dff30b1 *src/libqhullcpp/RboxPoints.h -790744a4f9cbf86b3cb57defc91a0abf *src/libqhullcpp/RoadError.cpp -e4b78bd0d5305e7b846b0ee4fe0bb5b4 *src/libqhullcpp/RoadError.h -5b3741f630a4e9c4a3d919867f8c29de *src/libqhullcpp/RoadLogEvent.cpp -c5e1fd7f243d4dc44bb85ee2b580830f *src/libqhullcpp/RoadLogEvent.h -180c881c817762a4a32082bb54ba4c3a *src/libqhullcpp/UsingLibQhull.cpp -3b0d7bc23c7aa41a73a576ce1b5f025a *src/libqhullcpp/UsingLibQhull.h -13d788e220a7509e70a281e0677529f7 *src/libqhullcpp/functionObjects.h -bead19cfbd8620f9d0908183e7adfe6b *src/libqhullcpp/libqhullcpp.pro -02197188428e0e1bbe0da9fae9603254 *src/libqhullcpp/qhull_interface.cpp -547eb360d03b8999a4ebe6d37b9b8544 *src/libqhullcpp/qt-qhull.cpp -4b6de9e1cae851f3d5146f78c861932e *src/libqhullp/libqhullp.pro -6137d593aafdad1a9e2cf741c9766831 *src/libqhullp/qhull_p-exports.def -b4752f1c7e6e6bdf90f2fafafabe324b *src/libqhullstatic/libqhullstatic.pro -d56ca08f64583cdb55bc49f7d780c2d0 *src/libqhullstaticp/libqhullstaticp.pro -59dec8bc40bf91e3a20313730e3902fe *src/qconvex/qconvex.c -4ea25c0ef260f5d1c1f59326f1439997 *src/qconvex/qconvex.pro -faee878b6cde780460e95fb1b954ade8 *src/qdelaunay/qdelaun.c -ae7da22e7e39cc39f54b5bc4f8f68b47 *src/qdelaunay/qdelaunay.pro -4a7e3cee32ea78748108d7e6fabf5548 *src/qhalf/qhalf.c -eea5fc6e1ff79d68e05a525a7d2f5d82 *src/qhalf/qhalf.pro -b579949ef318ae9202f04e7b2dfdeedd *src/qhull-all.pro -ef9be21e7d823979816f1e86e85c898c *src/qhull-app-c.pri -df3f18b857ae6e3e41d0dfe357adb2e6 *src/qhull-app-cpp.pri -e11fbdadadc83ac4f6ee9510867027ec *src/qhull-app-shared.pri -19797759332dfc4baa2322c7b90cc870 *src/qhull-app-sharedp.pri -2ba6feda8a328e0248da31f8430ac2c2 *src/qhull-libqhull-src.pri -540b971438fb2bbb5123111834c528e8 *src/qhull-warn.pri -c03bb0d78787a8008bbf17c02652ceb2 *src/qhull/qhull.pro -0840c6b45ce31ca76b7c266af594c400 *src/qhull/unix.c -e1ef8a9f4ca2401a5acf6048c61628e9 *src/qhulltest/Coordinates_test.cpp -f9bf023337f40312c46577b488857f78 *src/qhulltest/PointCoordinates_test.cpp -5d709df9125ff9e142054190f9cff9e2 *src/qhulltest/Point_test.cpp -7ddf5a200d108403838b78bf65084690 *src/qhulltest/QhullFacetList_test.cpp -bd013b7686af8f44f25999ef71f52934 *src/qhulltest/QhullFacetSet_test.cpp -798ec4ed5483027e1f92a79c0dc93fdd *src/qhulltest/QhullFacet_test.cpp -b89a97ab0103021f0b8bfc8bffa1d7fb *src/qhulltest/QhullHyperplane_test.cpp -19b63c3a1115a3c60fcb6bc51e3d474b *src/qhulltest/QhullLinkedList_test.cpp -fa9c22a01896a81904bcb21968c4fbbf *src/qhulltest/QhullPointSet_test.cpp -f60e9d4c2a058d69a881196fe3fb0c57 *src/qhulltest/QhullPoint_test.cpp -cfc4233fff63b72455d2999967be1d8b *src/qhulltest/QhullPoints_test.cpp -aaec6212b6a36d292c391fe9f2742e5c *src/qhulltest/QhullRidge_test.cpp -f965da82a5d7d644625b835e0c5d6517 *src/qhulltest/QhullSet_test.cpp -0b7809ce929ccb088eca73926ba3c6ab *src/qhulltest/QhullVertexSet_test.cpp -1c14324ed858277c0652b785682f8f6a *src/qhulltest/QhullVertex_test.cpp -e0aea85a8577a9cba1fd0b4587efb2af *src/qhulltest/Qhull_test.cpp -75377022aceb6a620e7b9cf6553c1c11 *src/qhulltest/RboxPoints_test.cpp -5d9cb5b39755c5d14510cddd655c8a27 *src/qhulltest/RoadTest.cpp -77c7060d4aa779fbf718b327705e631a *src/qhulltest/RoadTest.h -5384e25cc9834f9774e20eca8cbdfbcc *src/qhulltest/UsingLibQhull_test.cpp -b1f695463367864fc38ae5afbde1dfdb *src/qhulltest/qhulltest.cpp -2b2dc78b75cd14cc4799b97b7926c3e7 *src/qhulltest/qhulltest.pro -7e9017fb7136bd9dd35369c9395321e3 *src/qvoronoi/qvoronoi.c -fbeca66e16029e38c1ecfef02294387d *src/qvoronoi/qvoronoi.pro -c85807379293e6d430a232d90902fe52 *src/rbox/rbox.c -cdbffaa3818c41e3d291119671a109d1 *src/rbox/rbox.pro -fdbfbe818291ba8be33b07948f609a53 *src/testqset/testqset.c -64491d533a69d272983b14dbb0ed0cb6 *src/testqset/testqset.pro -9ba59e61916bd2356afc76991611f22d *src/user_eg/user_eg.c -d5a157eeff28813507c6425cbcce010c *src/user_eg/user_eg.pro -bc317bcaa2cbc79f0d35ba6e945f6675 *src/user_eg2/user_eg2.c -ee6841249a13952f35d05ef3cc7a549d *src/user_eg2/user_eg2.pro -1f926ca5b9abfebefd2d9d54f79eeb82 *src/user_eg3/user_eg3.cpp -102d151a2b0ac747e91e20388bd17c7b *src/user_eg3/user_eg3.pro diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/Changes.txt b/src/amuse_simplex/src/plugins/qhull-2012.1/src/Changes.txt deleted file mode 100644 index 0e38be1b0b..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/Changes.txt +++ /dev/null @@ -1,1626 +0,0 @@ - -.............This file lists all changes to qhull and rbox..................... - ------------- -Need help - - Qhull needs RPM and Debian builds (CMake's CPackRMP and CPackDeb). - - Add an Autotools build for everything - - Set up debian build [octave-maintainers] - Please keep debian files in config/ - - Qhull needs a mirror/archive site for old and new builds - - The C++ interface needs work. Give it a try and make it better. - http://gitorious.org/qhull/ - - Document with Qt conventions using Doxygen (//! and //!<) - - Produce conformant triangulations for merged facets using option 'Qt' - -To do - - Review email for doc changes before jun'10 - - Git: Create signed tags for Qhull versions - - Wiki: Add FIXUP to QH11026 for known problems - - Notes to compgeom on conformant triangulation and Voronoi volume - - Set File Ver and Product Ver in dll - - For the C++ interface, make qh_qh a parameter instead of a global static - This replaces qh_QHpointer. It simplifies multithreading. - - Compute the convex hull of each Voronoi or Delaunay region - - Performance test of qset and qhull - ------------- -Qhull 2012.1 2012/02/18 6.3.1.1494 - - Fix CMakeLists for libqhull with MATCHES [P. Gajdos] - ------------- -Qhull 2012.1 2012/02/18 6.3.1.1490 - -Code changes - - Require option 'Qz' for Delaunay triangulation/Voronoi diagram - of cocircular/cospherical points [D. Sheehy] - - qh_errexit: Do not call qh_printsummary or qh_printstats on qh_ERRinput - - Change error QH6227 (all degenerate) from qh_ERRinput to qh_ERRprec - - Change error QH6159 (ID overflow) from qh_ERRinput to qh_ERRqhull - - eg/q_eg, q_egtest, q_test: Run if qconvex is in $PATH [M. Atzeri] - -Build changes [M. Atzeri] - - Install to share/doc/qhull instead of share/doc/packages/qhull - - On Unix systems, install to share/man/man1 instead of man/man1 - - CMakeLists: Remove the installation of user_eg* and testqset - - CMakeLists: Remove VERSION from qhull executables and libraries - - CMakeLists: Define qhull_SOVERSION instead of qhull_MAJOR - - CMakeLists: Set SOVERSION for shared libraries - - Rename libraries to qhull, qhull_d, qhull_p, and qhull_pd - libqhull6_p.vcproj is now libqhull_p.vcproj - mingw builds as libqhull.dll - cygwin builds as cygqhull-6.dll - linux builds as libqhull.so.6.3.1 with symbolic link as libqhull.so - - Developers using qhull 2011: - libqhull6.so is now libqhull_p.so. Do not use libqhull.so. - qhull6.dll is now qhull_p.dll. Do not use qhull.dll. - - Merged road/ into libqhullcpp/ and qhulltest/ - Moved RoadLogEvent.* and RoadError.* to libqhullcpp - Moved RoadTest.* to qhulltest (requires Qt) - Installed RoadTest.h in libqhullcpp - -Doc changes - - index.htm: Mathworks uses qhull for n-d - - qhull.htm: Fix qhull for qconvex - - qdelaun.htm/qvoronoi.htm: Use option 'Qz' for circular/cospherical inputs - - make help: Display targets - - Makefile: Better messaging - ------------- -Qhull 2012.1 2012/02/02 6.3.0.1483 - -Bug fixes - - Fixed qset.c for -fno-strict-aliasing. This gcc option is no longer needed - (disallow two pointers of differing types to the same memory location) - - Fixed error in qh_setappend_set if first set full and second set empty - - qh_setdelnth, qh_setdelnth_sorted: fixed wording of error message - - qh_setcheck: error message listed size and max backwards. - - qh_setequal: Allow NULL set as documented - - qh_setindex: Allow NULL set as documented - - qh_settemppush: report error if NULL - -Code changes - - Add testqset: low level test of qset.c with mem.c - - qh_setendpointer: Implements QSet::endPointer() - - Assigned unique error code for qh_gethash - -Build changes - - Added qhull.dll(.so) for Octave and other Debian builds - The global data structure qh_qh is statically defined (no qh_QHpointer) - Linked user_eg2 with qhull.dll (libqhull.so) instead of qhullstatic - Added qh_dllimport to libqhull.h for qhull.dll with MSVC - Changed qhull-app-shared.pri to use libqhull (without qh_QHpointer) - - Renamed libqhull6.so to libqhull6_p.so - Renamed qhull6.dll to qhull6_p.dll - The _p libraries (e.g., libqhull6_p.so) require -Dqh_QHpointer - Renamed qhull6.vcproj to libqhull6_p.vcproj - Added libqhullp/libqhullp.pro for shared library (libqhull6_p.so) - Added qhull-app-sharedp.pri for shared libraries with qh_QHpointer - - Install libqhull/*.htm files into include/libqhull - - Removed libqhull/qhull.h-deprecated [J. Eaton] - - Other changes to Makefile builds - Added 'make qtestall' as a smoketest of each qhull program - src/libqhull/Makefile: Use 'ar -rs ...' instead of ranlib - src/libqhull/Makefile: Fixed targets for cleanall - - Other changes to DevStudio builds - Moved pdb files for qhull libraries to lib/ - AdditionalIncludeDirectories: Removed ../src/libqhullcpp - Use build-cmake/ for the DevStudio CMake build - - Other changes to Qt builds - Renamed qhull-libsrc.pri to qhull-libqhull-src.pri - - Added explicit d2u conversions to qhull-zip.sh - - Fixed \n vs. \r\n issues for Windows source files - - Draft of Debian/AutoConf build (untested) - - Adjusted the Makefile.am's for the new directory structure. - - Added testqset to bin_PROGRAMS - - config/bootstrap.sh copies program sources into src/libqhull - - Kept qh_QHpointer=0 (static global data structure, qh_qh). It is faster. - Planning a new interface (qhull7?) which passes qh_qh as a parameter - - Added config/changelog from the 2003.1 Debian build - - Moved the debian/patches directory to config/ - Optional patches to change smoketest message and turn on qh_QHpointer - - Deleted the debian directory. It was the old Debian build from 2003.1 - Rafael Laboissiere's config directory replaced this build.. - - Deleted Make-conf.sh (also the old Debian build) - -Doc changes - - FAQ: Updated notes on computing volume of a Voronoi region - - Added direct link to ACM Digital Library for downloading the qhull paper - - Added link to Qhull in R - - qset.c: Updated notes about NULL sets - - qh_setappend: clarify qh_setappend for NULL newelem - - qh_setdellast: Fix head note - - Add build/README.txt - - Add uninstall instructions to README.txt and CMakeLists.txt - - Added instructions to create build/*.vcproj to CMakeLists.txt - - Update copyright to 2012 - - Updated page links. Added Google books, patents, and blogs. - ------------ -Qhull 2009.1.3 2011/12/06 - configure: Add -fno-strict-aliasing if $GCC, Required for gcc 4.1+ - ------------- -Qhull 2011.2 2011/11/29 6.2.1.1446 - -Bug fixes - - qh_new_qhull: Call qh_prepare_output if !outfile [A. Aldoma] - No effect on qhull users since qh_prepare_output is always called. - - Replace Qhull-go.pif with Qhull-go.lnk for Windows 7 64-bit [lots] - - Error if qh_newhashtable, qh_setnew, or qh_memalloc overflows [X. Cheng] - For example, 'rbox 64 D32' overflows hash table for qh_matchnewfacets - Qhull uses 32-bit ints for identifiers, counts, and sizes. See "WARN64" - - q_eg, q_test: change tail +3 to tail -n +3 [N. Dubray, M. Atzeri] - - Qhull-go.bat: Changed 'cmd' to '%comspec%' - -Build changes - - Added src/libqhull/Makefile for simple gcc build of executables and lib - - qhulltest.vcproj: Replaced full path to QT with $QTDIR (e.g., c:/qt/4.7.4) - - Split userprintf_rbox.c from userprintf.c, - Otherwise qhull brings in rboxlib and rbox brings in libqhull - - Makefile: qhullx target must be after LIBQHULLS_OBJS - - Makefile: Explicitly list rbox dependencies for qhullx target - - MBorland: Fixed tabs - - Placed $LIBQHULLS_OBJS in same order. Frequently called ones together. - - Update file lists for Make-config.sh [O. Lahaye] - - CMakeLists: add README.txt,etc. to DOC_INSTALL_DIR [M. Atzeri] - - Restored qhull.h-deprecated. - qhull.h conflicts with Qhull.h on Windows systems [C. Abela] - - make-config.sh: Add warning that it is out-of-date - - Remove extra space in '#! /bin/sh' in q_eg, etc. [P. Cheeseman] - -Source changes - - libqhull.h: Added qh_True and qh_False for True/False [A. Mutzel] - Did not remove or replace True/False since it is used everywhere - - Moved error message from qh_argv_to_command to caller. Avoids dependency. - - user_eg3.c: Use '10 D2' as default rbox (e.g., 'user_eg3 rbox qhull d') - - user.c, user_eg2.c: Add test of qh_qh as done in user_eg.c - - q_test: Removed duplicate test of qhull C-0.02 - -Documentation - - index.html: Added ACM Authorizer link to ACM Trans. Math. Software - - Split Delaunay and Voronoi FAQs - - FAQ: How to compute the volume of a Voronoi region [C, Brinch] - - Add 'FS' to qconvex prompt (total area and volume) - - Add clarification to 'Fv' about corner input sites [O. Can] - - Qhull-go.bat: Removed out-of-date advice. Added title. - - qh-code.htm: Updated the discussion of multi-threading for C++ [I. Pirwani] - -Qhull 2009.1.2 2011/11/21 - - Revert to LF line endings [P. Cheeseman] - - Remove out-of-date material from qhull-go.bat - - Replaced QHULL-GO with a lnk file - -Qhull 2011.1 2011/05/23 6.2.0.1385 (exe/dll files unchanged) - - delaunay.vcproj: Fixed qhullstatic_d.lib for debug and minrelsize builds - - Did not redate the distribution - -Qhull 2011.1 2011/05/18 6.2.0.1385 (exe/dll files unchanged) - - Add 'm' library to shared and static targets on Unix [A. Bouchard] - -Qhull 2011.1 2011/05/14 6.2.0.1383 (exe/dll files unchanged) - - PointCoordinates.cpp: Add #include [R. Richter, S. Pasko] - - Remove deprecated libqhull/qhull.h - Use libqhull/libqhull.h instead. Avoids confusion with libqhullcpp/Qhull.h - - Makefile: Add LIBDIR, INCDIR, and DESTDIR to install [L.H. de Mello] - Separate MAN install from DOC install - Create install directories - Installs headers to include/libqhull, include/libqhullcpp, include/road - - CMakeLists.txt: Add MAN_INSTALL_DIR for qhull.1 and rbox.1 man pages - Add RoadTest.h to include/road for Qt users (road_HEADERS) - - Renamed md5sum files to avoid two extensions - - qh-get.htm: Add Readme links and 2009.1 note. - - qh-optf.htm: Fix link - - index.htm: Updated Google Scholar link - - qhull-zip.sh: Improved error message. - ------------- -Qhull 2011.1 2011/04/17 6.2.0.1373 - -Changes to deliverables - - qvoronoi: Deprecated 'Qt' and 'QJn'. Removed from documentation and prompts. - These options produced duplicate Voronoi vertices for cospherical data. - - Removed doskey from Qhull-go.bat. It is incompatible with Windows 7 - - Added 'facets' argument to user_eg3.cpp - - user_eg links with shared library - - qhulltest.cpp: Add closing prompt. - -Changes to build system - - Reorganized source directories - - Moved executables to bin directory - - Add CMake build for all targets (CMakeFiles.txt) [M. Moll assisted] - - Add gcc build for all targets (Makefile) - - Fixed location of qhull.man and rbox.man [M. Moll] - - Add DevStudio builds for all targets (build/*.vcproj) - - Added shared library (lib/qhull6.dll) - Added qh_QHpointer_dllimport to work around problems with MSVC - - Added static libraries with and without qh_QHpointer (lib/qhullstatic.lib) - - Added eg/make-vcproj.sh to create vcproj/sln files from cmake and qmake - - Document location of qh_QHpointer - - Use shadow build directory - - Made -fno-strict-aliasing conditional on gcc version - - Added src/qhull-app-cpp.pri, src/qhull-app-c.pri, etc. for common settings - - Add .gitignore with ignored files and directories. - - Use .git/info/exclude for locally excluded files. - - Fixed MBorland for new directory structure - -Changes to documentation - - qvoronoi.htm: Remove quotes from qvoronoi example - - qhull-cpp.xml: Add naming conventions - - index.htm: Add Google Scholar references - - qh-optf.htm: Add note about order of 'Fn' matching 'Fv' order [Q. Pan] - - Add patch for old builds in qh-get.htm - - Added C++ compiling instructions to README.txt - - Add instructions for fixing the DOS window - - Changed DOS window to command window - - Fixed html links - - qh-get.htm: Dropped the Spanish mirror site. It was disabled. - -Changes to C code - - mem.h: Define ptr_intT as 'long long' for Microsoft Windows _win64 builds. - On Linux and Mac, 'long' is 64-bits on a 64-bit host - - Added qh_QHpointer_dllimport to work around MSVC problem - - qconvex.c,etc.: Define prototype for _isatty - - Define MSG_QHULL_ERROR in user.h - - Move MSG_FIXUP to 11000 and updated FIXUP QH11... - -Changes to test code - - Add note to q_test than R1e-3 may error (qh-code.htm, Enhancements) - - Add test for executables to q_eg, etc. - - Fixed Qhull-go.bat. QHULL-GO invokes it with command.com, - -Changes to C++ interface - - QhullFacet: Added isSimplicial, isTopOrient, isTriCoplanar, isUpperDelaunay - - Added Qhull::defineVertexFacetNeighbors() for facetNeighbors of vertices. - Automatically called for facet merging and Voronoi diagrams - Do not print QhullVertex::facetNeighbors is !facetNeighborsDefined() - - Add Fixup identifiers - - QhullError: Add copy constructor, assignment operator, and destructor - - Add throw() specifiers to RoadError and QhullError - - Renamed RoadError::defined() to RoadError::isDefined() - - Add #error to Qhull.h if qh_QHpointer is not defined - -Changes to C++ code - - Fixed bug reported by renangms. Vertex output throws error QH10034 - and defineVertexNeighbors() does not exist. - - Define QHULL_USES_QT for qt-qhull.cpp [renangms] - - Reviewed all copy constructors and copy assignments. Updated comments. - Defined Qhull copy constructor and copy assignment [G. Rivet-Sabourin] - Disabled UsingQhullLib default constructor, copy construct, and copy assign - - Merged changes from J. Obermayr in gitorious/jobermayrs-qhull:next - - Fix strncat limit in rboxlib.c and global.c - - Changes to CMakeLists.txt for openSUSE - - Fixed additional uses of strncat - - Fixed QhullFacet::PrintRidges to check hasNextRidge3d() - - Removed gcc warnings for shadowing from code (src/qhull-warn.pri) - - Removed semicolon after extern "C" {...} - - Removed experimental QhullEvent/QhullLog - - Use fabs() instead of abs() to avoid accidental conversions to int - - Fixed type of vertex->neighbors in qh_printvoronoi [no effect on results] - - Removed unnecessary if statement in qh_printvoronoi - ------------- -qhull 2010.1 2010/01/14 -- Fixed quote for #include in qhull.h [U.Hergenhahn, K.Roland] -- Add qt-qhull.cpp with Qt conditional code -- Add libqhullp.proj -- Add libqhull5 to Readme, Announce, download -- Reviewed #pragma -- Reviewed FIXUP and assigned QH tags -- All projects compile with warnings enabled -- Replaced 'up' glyphs with » -- Moved cpp questions to qh-code.htm#questions-cpp -- Moved suggestions to qh-code.htm#enhance -- Moved documentation requests to qh-code.htm#enhance -- Add md5sum file to distributions -- Switched to DevStudio builds to avoid dependent libraries, 10% slower - Removed user_eg3.exe and qhullcpp.dll from Windows build - Fix qhull.sln and project files for qh_QHpointer -- Add eg/qhull-zip.sh to build qhull distribution files - ------------- -qhull 2010.1 2010/01/10 -- Test for NULL fp in qh_eachvoronoi [D. Szczerba] - -qhull 2010.1 2010/01/09 - -Changes to build and distribution -- Use qh_QHpointer=0 for libqhull.a, qhull, rbox, etc. - Use -Dqh_QHpointer for libqhullp.a, qhullcpp.dll, etc. - qh_QHpointer [2010, gcc] 4% time 4% space, [2003, msvc] 8% time 2% space -- Add config/ and project/debian/ for Autoconf build [R. Laboissiere] - from debian branch in git and http://savannah.nongnu.org/cvs/?group=qhull -- Add CMakeLists.txt [kwilliams] -- Fix tabs in Makefile.txt [mschamschula] -- Add -fno-strict-aliasing to Makefile for gcc 4.1, 4.2, and 4.3 qset segfault -- Remove user_eg.exe and user_eg2.exe from Windows distribution -- Order object files by frequency of execution for better locality. - -Changes to source -- Remove ptr_intT from qh_matchvertices. It was int since the beginning. -- user.h requires for CLOCKS_PER_SEC -- Move ostream<

      ---------------------------------
    -
    -   geom.c
    -   geometric routines of qhull
    -
    -   see qh-geom.htm and geom.h
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/geom.c#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -
    -   infrequent code goes into geom2.c
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*---------------------------------
    -
    -  qh_distplane( point, facet, dist )
    -    return distance from point to facet
    -
    -  returns:
    -    dist
    -    if qh.RANDOMdist, joggles result
    -
    -  notes:
    -    dist > 0 if point is above facet (i.e., outside)
    -    does not error (for qh_sortfacets, qh_outerinner)
    -
    -  see:
    -    qh_distnorm in geom2.c
    -    qh_distplane [geom.c], QhullFacet::distance, and QhullHyperplane::distance are copies
    -*/
    -void qh_distplane(pointT *point, facetT *facet, realT *dist) {
    -  coordT *normal= facet->normal, *coordp, randr;
    -  int k;
    -
    -  switch (qh hull_dim){
    -  case 2:
    -    *dist= facet->offset + point[0] * normal[0] + point[1] * normal[1];
    -    break;
    -  case 3:
    -    *dist= facet->offset + point[0] * normal[0] + point[1] * normal[1] + point[2] * normal[2];
    -    break;
    -  case 4:
    -    *dist= facet->offset+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3];
    -    break;
    -  case 5:
    -    *dist= facet->offset+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4];
    -    break;
    -  case 6:
    -    *dist= facet->offset+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5];
    -    break;
    -  case 7:
    -    *dist= facet->offset+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5]+point[6]*normal[6];
    -    break;
    -  case 8:
    -    *dist= facet->offset+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5]+point[6]*normal[6]+point[7]*normal[7];
    -    break;
    -  default:
    -    *dist= facet->offset;
    -    coordp= point;
    -    for (k=qh hull_dim; k--; )
    -      *dist += *coordp++ * *normal++;
    -    break;
    -  }
    -  zinc_(Zdistplane);
    -  if (!qh RANDOMdist && qh IStracing < 4)
    -    return;
    -  if (qh RANDOMdist) {
    -    randr= qh_RANDOMint;
    -    *dist += (2.0 * randr / qh_RANDOMmax - 1.0) *
    -      qh RANDOMfactor * qh MAXabs_coord;
    -  }
    -  if (qh IStracing >= 4) {
    -    qh_fprintf(qh ferr, 8001, "qh_distplane: ");
    -    qh_fprintf(qh ferr, 8002, qh_REAL_1, *dist);
    -    qh_fprintf(qh ferr, 8003, "from p%d to f%d\n", qh_pointid(point), facet->id);
    -  }
    -  return;
    -} /* distplane */
    -
    -
    -/*---------------------------------
    -
    -  qh_findbest( point, startfacet, bestoutside, qh_ISnewfacets, qh_NOupper, dist, isoutside, numpart )
    -    find facet that is furthest below a point
    -    for upperDelaunay facets
    -      returns facet only if !qh_NOupper and clearly above
    -
    -  input:
    -    starts search at 'startfacet' (can not be flipped)
    -    if !bestoutside(qh_ALL), stops at qh.MINoutside
    -
    -  returns:
    -    best facet (reports error if NULL)
    -    early out if isoutside defined and bestdist > qh.MINoutside
    -    dist is distance to facet
    -    isoutside is true if point is outside of facet
    -    numpart counts the number of distance tests
    -
    -  see also:
    -    qh_findbestnew()
    -
    -  notes:
    -    If merging (testhorizon), searches horizon facets of coplanar best facets because
    -    after qh_distplane, this and qh_partitionpoint are the most expensive in 3-d
    -      avoid calls to distplane, function calls, and real number operations.
    -    caller traces result
    -    Optimized for outside points.   Tried recording a search set for qh_findhorizon.
    -    Made code more complicated.
    -
    -  when called by qh_partitionvisible():
    -    indicated by qh_ISnewfacets
    -    qh.newfacet_list is list of simplicial, new facets
    -    qh_findbestnew set if qh_sharpnewfacets returns True (to use qh_findbestnew)
    -    qh.bestfacet_notsharp set if qh_sharpnewfacets returns False
    -
    -  when called by qh_findfacet(), qh_partitionpoint(), qh_partitioncoplanar(),
    -                 qh_check_bestdist(), qh_addpoint()
    -    indicated by !qh_ISnewfacets
    -    returns best facet in neighborhood of given facet
    -      this is best facet overall if dist > -   qh.MAXcoplanar
    -        or hull has at least a "spherical" curvature
    -
    -  design:
    -    initialize and test for early exit
    -    repeat while there are better facets
    -      for each neighbor of facet
    -        exit if outside facet found
    -        test for better facet
    -    if point is inside and partitioning
    -      test for new facets with a "sharp" intersection
    -      if so, future calls go to qh_findbestnew()
    -    test horizon facets
    -*/
    -facetT *qh_findbest(pointT *point, facetT *startfacet,
    -                     boolT bestoutside, boolT isnewfacets, boolT noupper,
    -                     realT *dist, boolT *isoutside, int *numpart) {
    -  realT bestdist= -REALmax/2 /* avoid underflow */;
    -  facetT *facet, *neighbor, **neighborp;
    -  facetT *bestfacet= NULL, *lastfacet= NULL;
    -  int oldtrace= qh IStracing;
    -  unsigned int visitid= ++qh visit_id;
    -  int numpartnew=0;
    -  boolT testhorizon = True; /* needed if precise, e.g., rbox c D6 | qhull Q0 Tv */
    -
    -  zinc_(Zfindbest);
    -  if (qh IStracing >= 3 || (qh TRACElevel && qh TRACEpoint >= 0 && qh TRACEpoint == qh_pointid(point))) {
    -    if (qh TRACElevel > qh IStracing)
    -      qh IStracing= qh TRACElevel;
    -    qh_fprintf(qh ferr, 8004, "qh_findbest: point p%d starting at f%d isnewfacets? %d, unless %d exit if > %2.2g\n",
    -             qh_pointid(point), startfacet->id, isnewfacets, bestoutside, qh MINoutside);
    -    qh_fprintf(qh ferr, 8005, "  testhorizon? %d noupper? %d", testhorizon, noupper);
    -    qh_fprintf(qh ferr, 8006, "  Last point added was p%d.", qh furthest_id);
    -    qh_fprintf(qh ferr, 8007, "  Last merge was #%d.  max_outside %2.2g\n", zzval_(Ztotmerge), qh max_outside);
    -  }
    -  if (isoutside)
    -    *isoutside= True;
    -  if (!startfacet->flipped) {  /* test startfacet */
    -    *numpart= 1;
    -    qh_distplane(point, startfacet, dist);  /* this code is duplicated below */
    -    if (!bestoutside && *dist >= qh MINoutside
    -    && (!startfacet->upperdelaunay || !noupper)) {
    -      bestfacet= startfacet;
    -      goto LABELreturn_best;
    -    }
    -    bestdist= *dist;
    -    if (!startfacet->upperdelaunay) {
    -      bestfacet= startfacet;
    -    }
    -  }else
    -    *numpart= 0;
    -  startfacet->visitid= visitid;
    -  facet= startfacet;
    -  while (facet) {
    -    trace4((qh ferr, 4001, "qh_findbest: neighbors of f%d, bestdist %2.2g f%d\n",
    -                facet->id, bestdist, getid_(bestfacet)));
    -    lastfacet= facet;
    -    FOREACHneighbor_(facet) {
    -      if (!neighbor->newfacet && isnewfacets)
    -        continue;
    -      if (neighbor->visitid == visitid)
    -        continue;
    -      neighbor->visitid= visitid;
    -      if (!neighbor->flipped) {  /* code duplicated above */
    -        (*numpart)++;
    -        qh_distplane(point, neighbor, dist);
    -        if (*dist > bestdist) {
    -          if (!bestoutside && *dist >= qh MINoutside
    -          && (!neighbor->upperdelaunay || !noupper)) {
    -            bestfacet= neighbor;
    -            goto LABELreturn_best;
    -          }
    -          if (!neighbor->upperdelaunay) {
    -            bestfacet= neighbor;
    -            bestdist= *dist;
    -            break; /* switch to neighbor */
    -          }else if (!bestfacet) {
    -            bestdist= *dist;
    -            break; /* switch to neighbor */
    -          }
    -        } /* end of *dist>bestdist */
    -      } /* end of !flipped */
    -    } /* end of FOREACHneighbor */
    -    facet= neighbor;  /* non-NULL only if *dist>bestdist */
    -  } /* end of while facet (directed search) */
    -  if (isnewfacets) {
    -    if (!bestfacet) {
    -      bestdist= -REALmax/2;
    -      bestfacet= qh_findbestnew(point, startfacet->next, &bestdist, bestoutside, isoutside, &numpartnew);
    -      testhorizon= False; /* qh_findbestnew calls qh_findbesthorizon */
    -    }else if (!qh findbest_notsharp && bestdist < - qh DISTround) {
    -      if (qh_sharpnewfacets()) {
    -        /* seldom used, qh_findbestnew will retest all facets */
    -        zinc_(Zfindnewsharp);
    -        bestfacet= qh_findbestnew(point, bestfacet, &bestdist, bestoutside, isoutside, &numpartnew);
    -        testhorizon= False; /* qh_findbestnew calls qh_findbesthorizon */
    -        qh findbestnew= True;
    -      }else
    -        qh findbest_notsharp= True;
    -    }
    -  }
    -  if (!bestfacet)
    -    bestfacet= qh_findbestlower(lastfacet, point, &bestdist, numpart);
    -  if (testhorizon)
    -    bestfacet= qh_findbesthorizon(!qh_IScheckmax, point, bestfacet, noupper, &bestdist, &numpartnew);
    -  *dist= bestdist;
    -  if (isoutside && bestdist < qh MINoutside)
    -    *isoutside= False;
    -LABELreturn_best:
    -  zadd_(Zfindbesttot, *numpart);
    -  zmax_(Zfindbestmax, *numpart);
    -  (*numpart) += numpartnew;
    -  qh IStracing= oldtrace;
    -  return bestfacet;
    -}  /* findbest */
    -
    -
    -/*---------------------------------
    -
    -  qh_findbesthorizon( qh_IScheckmax, point, startfacet, qh_NOupper, &bestdist, &numpart )
    -    search coplanar and better horizon facets from startfacet/bestdist
    -    ischeckmax turns off statistics and minsearch update
    -    all arguments must be initialized
    -  returns(ischeckmax):
    -    best facet
    -  returns(!ischeckmax):
    -    best facet that is not upperdelaunay
    -    allows upperdelaunay that is clearly outside
    -  returns:
    -    bestdist is distance to bestfacet
    -    numpart -- updates number of distance tests
    -
    -  notes:
    -    no early out -- use qh_findbest() or qh_findbestnew()
    -    Searches coplanar or better horizon facets
    -
    -  when called by qh_check_maxout() (qh_IScheckmax)
    -    startfacet must be closest to the point
    -      Otherwise, if point is beyond and below startfacet, startfacet may be a local minimum
    -      even though other facets are below the point.
    -    updates facet->maxoutside for good, visited facets
    -    may return NULL
    -
    -    searchdist is qh.max_outside + 2 * DISTround
    -      + max( MINvisible('Vn'), MAXcoplanar('Un'));
    -    This setting is a guess.  It must be at least max_outside + 2*DISTround
    -    because a facet may have a geometric neighbor across a vertex
    -
    -  design:
    -    for each horizon facet of coplanar best facets
    -      continue if clearly inside
    -      unless upperdelaunay or clearly outside
    -         update best facet
    -*/
    -facetT *qh_findbesthorizon(boolT ischeckmax, pointT* point, facetT *startfacet, boolT noupper, realT *bestdist, int *numpart) {
    -  facetT *bestfacet= startfacet;
    -  realT dist;
    -  facetT *neighbor, **neighborp, *facet;
    -  facetT *nextfacet= NULL; /* optimize last facet of coplanarfacetset */
    -  int numpartinit= *numpart, coplanarfacetset_size;
    -  unsigned int visitid= ++qh visit_id;
    -  boolT newbest= False; /* for tracing */
    -  realT minsearch, searchdist;  /* skip facets that are too far from point */
    -
    -  if (!ischeckmax) {
    -    zinc_(Zfindhorizon);
    -  }else {
    -#if qh_MAXoutside
    -    if ((!qh ONLYgood || startfacet->good) && *bestdist > startfacet->maxoutside)
    -      startfacet->maxoutside= *bestdist;
    -#endif
    -  }
    -  searchdist= qh_SEARCHdist; /* multiple of qh.max_outside and precision constants */
    -  minsearch= *bestdist - searchdist;
    -  if (ischeckmax) {
    -    /* Always check coplanar facets.  Needed for RBOX 1000 s Z1 G1e-13 t996564279 | QHULL Tv */
    -    minimize_(minsearch, -searchdist);
    -  }
    -  coplanarfacetset_size= 0;
    -  facet= startfacet;
    -  while (True) {
    -    trace4((qh ferr, 4002, "qh_findbesthorizon: neighbors of f%d bestdist %2.2g f%d ischeckmax? %d noupper? %d minsearch %2.2g searchdist %2.2g\n",
    -                facet->id, *bestdist, getid_(bestfacet), ischeckmax, noupper,
    -                minsearch, searchdist));
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid == visitid)
    -        continue;
    -      neighbor->visitid= visitid;
    -      if (!neighbor->flipped) {
    -        qh_distplane(point, neighbor, &dist);
    -        (*numpart)++;
    -        if (dist > *bestdist) {
    -          if (!neighbor->upperdelaunay || ischeckmax || (!noupper && dist >= qh MINoutside)) {
    -            bestfacet= neighbor;
    -            *bestdist= dist;
    -            newbest= True;
    -            if (!ischeckmax) {
    -              minsearch= dist - searchdist;
    -              if (dist > *bestdist + searchdist) {
    -                zinc_(Zfindjump);  /* everything in qh.coplanarfacetset at least searchdist below */
    -                coplanarfacetset_size= 0;
    -              }
    -            }
    -          }
    -        }else if (dist < minsearch)
    -          continue;  /* if ischeckmax, dist can't be positive */
    -#if qh_MAXoutside
    -        if (ischeckmax && dist > neighbor->maxoutside)
    -          neighbor->maxoutside= dist;
    -#endif
    -      } /* end of !flipped */
    -      if (nextfacet) {
    -        if (!coplanarfacetset_size++) {
    -          SETfirst_(qh coplanarfacetset)= nextfacet;
    -          SETtruncate_(qh coplanarfacetset, 1);
    -        }else
    -          qh_setappend(&qh coplanarfacetset, nextfacet); /* Was needed for RBOX 1000 s W1e-13 P0 t996547055 | QHULL d Qbb Qc Tv
    -                                                 and RBOX 1000 s Z1 G1e-13 t996564279 | qhull Tv  */
    -      }
    -      nextfacet= neighbor;
    -    } /* end of EACHneighbor */
    -    facet= nextfacet;
    -    if (facet)
    -      nextfacet= NULL;
    -    else if (!coplanarfacetset_size)
    -      break;
    -    else if (!--coplanarfacetset_size) {
    -      facet= SETfirstt_(qh coplanarfacetset, facetT);
    -      SETtruncate_(qh coplanarfacetset, 0);
    -    }else
    -      facet= (facetT*)qh_setdellast(qh coplanarfacetset);
    -  } /* while True, for each facet in qh.coplanarfacetset */
    -  if (!ischeckmax) {
    -    zadd_(Zfindhorizontot, *numpart - numpartinit);
    -    zmax_(Zfindhorizonmax, *numpart - numpartinit);
    -    if (newbest)
    -      zinc_(Zparthorizon);
    -  }
    -  trace4((qh ferr, 4003, "qh_findbesthorizon: newbest? %d bestfacet f%d bestdist %2.2g\n", newbest, getid_(bestfacet), *bestdist));
    -  return bestfacet;
    -}  /* findbesthorizon */
    -
    -/*---------------------------------
    -
    -  qh_findbestnew( point, startfacet, dist, isoutside, numpart )
    -    find best newfacet for point
    -    searches all of qh.newfacet_list starting at startfacet
    -    searches horizon facets of coplanar best newfacets
    -    searches all facets if startfacet == qh.facet_list
    -  returns:
    -    best new or horizon facet that is not upperdelaunay
    -    early out if isoutside and not 'Qf'
    -    dist is distance to facet
    -    isoutside is true if point is outside of facet
    -    numpart is number of distance tests
    -
    -  notes:
    -    Always used for merged new facets (see qh_USEfindbestnew)
    -    Avoids upperdelaunay facet unless (isoutside and outside)
    -
    -    Uses qh.visit_id, qh.coplanarfacetset.
    -    If share visit_id with qh_findbest, coplanarfacetset is incorrect.
    -
    -    If merging (testhorizon), searches horizon facets of coplanar best facets because
    -    a point maybe coplanar to the bestfacet, below its horizon facet,
    -    and above a horizon facet of a coplanar newfacet.  For example,
    -      rbox 1000 s Z1 G1e-13 | qhull
    -      rbox 1000 s W1e-13 P0 t992110337 | QHULL d Qbb Qc
    -
    -    qh_findbestnew() used if
    -       qh_sharpnewfacets -- newfacets contains a sharp angle
    -       if many merges, qh_premerge found a merge, or 'Qf' (qh.findbestnew)
    -
    -  see also:
    -    qh_partitionall() and qh_findbest()
    -
    -  design:
    -    for each new facet starting from startfacet
    -      test distance from point to facet
    -      return facet if clearly outside
    -      unless upperdelaunay and a lowerdelaunay exists
    -         update best facet
    -    test horizon facets
    -*/
    -facetT *qh_findbestnew(pointT *point, facetT *startfacet,
    -           realT *dist, boolT bestoutside, boolT *isoutside, int *numpart) {
    -  realT bestdist= -REALmax/2;
    -  facetT *bestfacet= NULL, *facet;
    -  int oldtrace= qh IStracing, i;
    -  unsigned int visitid= ++qh visit_id;
    -  realT distoutside= 0.0;
    -  boolT isdistoutside; /* True if distoutside is defined */
    -  boolT testhorizon = True; /* needed if precise, e.g., rbox c D6 | qhull Q0 Tv */
    -
    -  if (!startfacet) {
    -    if (qh MERGING)
    -      qh_fprintf(qh ferr, 6001, "qhull precision error (qh_findbestnew): merging has formed and deleted a cone of new facets.  Can not continue.\n");
    -    else
    -      qh_fprintf(qh ferr, 6002, "qhull internal error (qh_findbestnew): no new facets for point p%d\n",
    -              qh furthest_id);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  zinc_(Zfindnew);
    -  if (qh BESToutside || bestoutside)
    -    isdistoutside= False;
    -  else {
    -    isdistoutside= True;
    -    distoutside= qh_DISToutside; /* multiple of qh.MINoutside & qh.max_outside, see user.h */
    -  }
    -  if (isoutside)
    -    *isoutside= True;
    -  *numpart= 0;
    -  if (qh IStracing >= 3 || (qh TRACElevel && qh TRACEpoint >= 0 && qh TRACEpoint == qh_pointid(point))) {
    -    if (qh TRACElevel > qh IStracing)
    -      qh IStracing= qh TRACElevel;
    -    qh_fprintf(qh ferr, 8008, "qh_findbestnew: point p%d facet f%d. Stop? %d if dist > %2.2g\n",
    -             qh_pointid(point), startfacet->id, isdistoutside, distoutside);
    -    qh_fprintf(qh ferr, 8009, "  Last point added p%d visitid %d.",  qh furthest_id, visitid);
    -    qh_fprintf(qh ferr, 8010, "  Last merge was #%d.\n", zzval_(Ztotmerge));
    -  }
    -  /* visit all new facets starting with startfacet, maybe qh facet_list */
    -  for (i=0, facet=startfacet; i < 2; i++, facet= qh newfacet_list) {
    -    FORALLfacet_(facet) {
    -      if (facet == startfacet && i)
    -        break;
    -      facet->visitid= visitid;
    -      if (!facet->flipped) {
    -        qh_distplane(point, facet, dist);
    -        (*numpart)++;
    -        if (*dist > bestdist) {
    -          if (!facet->upperdelaunay || *dist >= qh MINoutside) {
    -            bestfacet= facet;
    -            if (isdistoutside && *dist >= distoutside)
    -              goto LABELreturn_bestnew;
    -            bestdist= *dist;
    -          }
    -        }
    -      } /* end of !flipped */
    -    } /* FORALLfacet from startfacet or qh newfacet_list */
    -  }
    -  if (testhorizon || !bestfacet)
    -    bestfacet= qh_findbesthorizon(!qh_IScheckmax, point, bestfacet ? bestfacet : startfacet,
    -                                        !qh_NOupper, &bestdist, numpart);
    -  *dist= bestdist;
    -  if (isoutside && *dist < qh MINoutside)
    -    *isoutside= False;
    -LABELreturn_bestnew:
    -  zadd_(Zfindnewtot, *numpart);
    -  zmax_(Zfindnewmax, *numpart);
    -  trace4((qh ferr, 4004, "qh_findbestnew: bestfacet f%d bestdist %2.2g\n", getid_(bestfacet), *dist));
    -  qh IStracing= oldtrace;
    -  return bestfacet;
    -}  /* findbestnew */
    -
    -/* ============ hyperplane functions -- keep code together [?] ============ */
    -
    -/*---------------------------------
    -
    -  qh_backnormal( rows, numrow, numcol, sign, normal, nearzero )
    -    given an upper-triangular rows array and a sign,
    -    solve for normal equation x using back substitution over rows U
    -
    -  returns:
    -     normal= x
    -
    -     if will not be able to divzero() when normalized(qh.MINdenom_2 and qh.MINdenom_1_2),
    -       if fails on last row
    -         this means that the hyperplane intersects [0,..,1]
    -         sets last coordinate of normal to sign
    -       otherwise
    -         sets tail of normal to [...,sign,0,...], i.e., solves for b= [0...0]
    -         sets nearzero
    -
    -  notes:
    -     assumes numrow == numcol-1
    -
    -     see Golub & van Loan 4.4-9 for back substitution
    -
    -     solves Ux=b where Ax=b and PA=LU
    -     b= [0,...,0,sign or 0]  (sign is either -1 or +1)
    -     last row of A= [0,...,0,1]
    -
    -     1) Ly=Pb == y=b since P only permutes the 0's of   b
    -
    -  design:
    -    for each row from end
    -      perform back substitution
    -      if near zero
    -        use qh_divzero for division
    -        if zero divide and not last row
    -          set tail of normal to 0
    -*/
    -void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign,
    -        coordT *normal, boolT *nearzero) {
    -  int i, j;
    -  coordT *normalp, *normal_tail, *ai, *ak;
    -  realT diagonal;
    -  boolT waszero;
    -  int zerocol= -1;
    -
    -  normalp= normal + numcol - 1;
    -  *normalp--= (sign ? -1.0 : 1.0);
    -  for (i=numrow; i--; ) {
    -    *normalp= 0.0;
    -    ai= rows[i] + i + 1;
    -    ak= normalp+1;
    -    for (j=i+1; j < numcol; j++)
    -      *normalp -= *ai++ * *ak++;
    -    diagonal= (rows[i])[i];
    -    if (fabs_(diagonal) > qh MINdenom_2)
    -      *(normalp--) /= diagonal;
    -    else {
    -      waszero= False;
    -      *normalp= qh_divzero(*normalp, diagonal, qh MINdenom_1_2, &waszero);
    -      if (waszero) {
    -        zerocol= i;
    -        *(normalp--)= (sign ? -1.0 : 1.0);
    -        for (normal_tail= normalp+2; normal_tail < normal + numcol; normal_tail++)
    -          *normal_tail= 0.0;
    -      }else
    -        normalp--;
    -    }
    -  }
    -  if (zerocol != -1) {
    -    zzinc_(Zback0);
    -    *nearzero= True;
    -    trace4((qh ferr, 4005, "qh_backnormal: zero diagonal at column %d.\n", i));
    -    qh_precision("zero diagonal on back substitution");
    -  }
    -} /* backnormal */
    -
    -/*---------------------------------
    -
    -  qh_gausselim( rows, numrow, numcol, sign )
    -    Gaussian elimination with partial pivoting
    -
    -  returns:
    -    rows is upper triangular (includes row exchanges)
    -    flips sign for each row exchange
    -    sets nearzero if pivot[k] < qh.NEARzero[k], else clears it
    -
    -  notes:
    -    if nearzero, the determinant's sign may be incorrect.
    -    assumes numrow <= numcol
    -
    -  design:
    -    for each row
    -      determine pivot and exchange rows if necessary
    -      test for near zero
    -      perform gaussian elimination step
    -*/
    -void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero) {
    -  realT *ai, *ak, *rowp, *pivotrow;
    -  realT n, pivot, pivot_abs= 0.0, temp;
    -  int i, j, k, pivoti, flip=0;
    -
    -  *nearzero= False;
    -  for (k=0; k < numrow; k++) {
    -    pivot_abs= fabs_((rows[k])[k]);
    -    pivoti= k;
    -    for (i=k+1; i < numrow; i++) {
    -      if ((temp= fabs_((rows[i])[k])) > pivot_abs) {
    -        pivot_abs= temp;
    -        pivoti= i;
    -      }
    -    }
    -    if (pivoti != k) {
    -      rowp= rows[pivoti];
    -      rows[pivoti]= rows[k];
    -      rows[k]= rowp;
    -      *sign ^= 1;
    -      flip ^= 1;
    -    }
    -    if (pivot_abs <= qh NEARzero[k]) {
    -      *nearzero= True;
    -      if (pivot_abs == 0.0) {   /* remainder of column == 0 */
    -        if (qh IStracing >= 4) {
    -          qh_fprintf(qh ferr, 8011, "qh_gausselim: 0 pivot at column %d. (%2.2g < %2.2g)\n", k, pivot_abs, qh DISTround);
    -          qh_printmatrix(qh ferr, "Matrix:", rows, numrow, numcol);
    -        }
    -        zzinc_(Zgauss0);
    -        qh_precision("zero pivot for Gaussian elimination");
    -        goto LABELnextcol;
    -      }
    -    }
    -    pivotrow= rows[k] + k;
    -    pivot= *pivotrow++;  /* signed value of pivot, and remainder of row */
    -    for (i=k+1; i < numrow; i++) {
    -      ai= rows[i] + k;
    -      ak= pivotrow;
    -      n= (*ai++)/pivot;   /* divzero() not needed since |pivot| >= |*ai| */
    -      for (j= numcol - (k+1); j--; )
    -        *ai++ -= n * *ak++;
    -    }
    -  LABELnextcol:
    -    ;
    -  }
    -  wmin_(Wmindenom, pivot_abs);  /* last pivot element */
    -  if (qh IStracing >= 5)
    -    qh_printmatrix(qh ferr, "qh_gausselem: result", rows, numrow, numcol);
    -} /* gausselim */
    -
    -
    -/*---------------------------------
    -
    -  qh_getangle( vect1, vect2 )
    -    returns the dot product of two vectors
    -    if qh.RANDOMdist, joggles result
    -
    -  notes:
    -    the angle may be > 1.0 or < -1.0 because of roundoff errors
    -
    -*/
    -realT qh_getangle(pointT *vect1, pointT *vect2) {
    -  realT angle= 0, randr;
    -  int k;
    -
    -  for (k=qh hull_dim; k--; )
    -    angle += *vect1++ * *vect2++;
    -  if (qh RANDOMdist) {
    -    randr= qh_RANDOMint;
    -    angle += (2.0 * randr / qh_RANDOMmax - 1.0) *
    -      qh RANDOMfactor;
    -  }
    -  trace4((qh ferr, 4006, "qh_getangle: %2.2g\n", angle));
    -  return(angle);
    -} /* getangle */
    -
    -
    -/*---------------------------------
    -
    -  qh_getcenter( vertices )
    -    returns arithmetic center of a set of vertices as a new point
    -
    -  notes:
    -    allocates point array for center
    -*/
    -pointT *qh_getcenter(setT *vertices) {
    -  int k;
    -  pointT *center, *coord;
    -  vertexT *vertex, **vertexp;
    -  int count= qh_setsize(vertices);
    -
    -  if (count < 2) {
    -    qh_fprintf(qh ferr, 6003, "qhull internal error (qh_getcenter): not defined for %d points\n", count);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  center= (pointT *)qh_memalloc(qh normal_size);
    -  for (k=0; k < qh hull_dim; k++) {
    -    coord= center+k;
    -    *coord= 0.0;
    -    FOREACHvertex_(vertices)
    -      *coord += vertex->point[k];
    -    *coord /= count;
    -  }
    -  return(center);
    -} /* getcenter */
    -
    -
    -/*---------------------------------
    -
    -  qh_getcentrum( facet )
    -    returns the centrum for a facet as a new point
    -
    -  notes:
    -    allocates the centrum
    -*/
    -pointT *qh_getcentrum(facetT *facet) {
    -  realT dist;
    -  pointT *centrum, *point;
    -
    -  point= qh_getcenter(facet->vertices);
    -  zzinc_(Zcentrumtests);
    -  qh_distplane(point, facet, &dist);
    -  centrum= qh_projectpoint(point, facet, dist);
    -  qh_memfree(point, qh normal_size);
    -  trace4((qh ferr, 4007, "qh_getcentrum: for f%d, %d vertices dist= %2.2g\n",
    -          facet->id, qh_setsize(facet->vertices), dist));
    -  return centrum;
    -} /* getcentrum */
    -
    -
    -/*---------------------------------
    -
    -  qh_getdistance( facet, neighbor, mindist, maxdist )
    -    returns the maxdist and mindist distance of any vertex from neighbor
    -
    -  returns:
    -    the max absolute value
    -
    -  design:
    -    for each vertex of facet that is not in neighbor
    -      test the distance from vertex to neighbor
    -*/
    -realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist) {
    -  vertexT *vertex, **vertexp;
    -  realT dist, maxd, mind;
    -
    -  FOREACHvertex_(facet->vertices)
    -    vertex->seen= False;
    -  FOREACHvertex_(neighbor->vertices)
    -    vertex->seen= True;
    -  mind= 0.0;
    -  maxd= 0.0;
    -  FOREACHvertex_(facet->vertices) {
    -    if (!vertex->seen) {
    -      zzinc_(Zbestdist);
    -      qh_distplane(vertex->point, neighbor, &dist);
    -      if (dist < mind)
    -        mind= dist;
    -      else if (dist > maxd)
    -        maxd= dist;
    -    }
    -  }
    -  *mindist= mind;
    -  *maxdist= maxd;
    -  mind= -mind;
    -  if (maxd > mind)
    -    return maxd;
    -  else
    -    return mind;
    -} /* getdistance */
    -
    -
    -/*---------------------------------
    -
    -  qh_normalize( normal, dim, toporient )
    -    normalize a vector and report if too small
    -    does not use min norm
    -
    -  see:
    -    qh_normalize2
    -*/
    -void qh_normalize(coordT *normal, int dim, boolT toporient) {
    -  qh_normalize2( normal, dim, toporient, NULL, NULL);
    -} /* normalize */
    -
    -/*---------------------------------
    -
    -  qh_normalize2( normal, dim, toporient, minnorm, ismin )
    -    normalize a vector and report if too small
    -    qh.MINdenom/MINdenom1 are the upper limits for divide overflow
    -
    -  returns:
    -    normalized vector
    -    flips sign if !toporient
    -    if minnorm non-NULL,
    -      sets ismin if normal < minnorm
    -
    -  notes:
    -    if zero norm
    -       sets all elements to sqrt(1.0/dim)
    -    if divide by zero (divzero())
    -       sets largest element to   +/-1
    -       bumps Znearlysingular
    -
    -  design:
    -    computes norm
    -    test for minnorm
    -    if not near zero
    -      normalizes normal
    -    else if zero norm
    -      sets normal to standard value
    -    else
    -      uses qh_divzero to normalize
    -      if nearzero
    -        sets norm to direction of maximum value
    -*/
    -void qh_normalize2 (coordT *normal, int dim, boolT toporient,
    -            realT *minnorm, boolT *ismin) {
    -  int k;
    -  realT *colp, *maxp, norm= 0, temp, *norm1, *norm2, *norm3;
    -  boolT zerodiv;
    -
    -  norm1= normal+1;
    -  norm2= normal+2;
    -  norm3= normal+3;
    -  if (dim == 2)
    -    norm= sqrt((*normal)*(*normal) + (*norm1)*(*norm1));
    -  else if (dim == 3)
    -    norm= sqrt((*normal)*(*normal) + (*norm1)*(*norm1) + (*norm2)*(*norm2));
    -  else if (dim == 4) {
    -    norm= sqrt((*normal)*(*normal) + (*norm1)*(*norm1) + (*norm2)*(*norm2)
    -               + (*norm3)*(*norm3));
    -  }else if (dim > 4) {
    -    norm= (*normal)*(*normal) + (*norm1)*(*norm1) + (*norm2)*(*norm2)
    -               + (*norm3)*(*norm3);
    -    for (k=dim-4, colp=normal+4; k--; colp++)
    -      norm += (*colp) * (*colp);
    -    norm= sqrt(norm);
    -  }
    -  if (minnorm) {
    -    if (norm < *minnorm)
    -      *ismin= True;
    -    else
    -      *ismin= False;
    -  }
    -  wmin_(Wmindenom, norm);
    -  if (norm > qh MINdenom) {
    -    if (!toporient)
    -      norm= -norm;
    -    *normal /= norm;
    -    *norm1 /= norm;
    -    if (dim == 2)
    -      ; /* all done */
    -    else if (dim == 3)
    -      *norm2 /= norm;
    -    else if (dim == 4) {
    -      *norm2 /= norm;
    -      *norm3 /= norm;
    -    }else if (dim >4) {
    -      *norm2 /= norm;
    -      *norm3 /= norm;
    -      for (k=dim-4, colp=normal+4; k--; )
    -        *colp++ /= norm;
    -    }
    -  }else if (norm == 0.0) {
    -    temp= sqrt(1.0/dim);
    -    for (k=dim, colp=normal; k--; )
    -      *colp++ = temp;
    -  }else {
    -    if (!toporient)
    -      norm= -norm;
    -    for (k=dim, colp=normal; k--; colp++) { /* k used below */
    -      temp= qh_divzero(*colp, norm, qh MINdenom_1, &zerodiv);
    -      if (!zerodiv)
    -        *colp= temp;
    -      else {
    -        maxp= qh_maxabsval(normal, dim);
    -        temp= ((*maxp * norm >= 0.0) ? 1.0 : -1.0);
    -        for (k=dim, colp=normal; k--; colp++)
    -          *colp= 0.0;
    -        *maxp= temp;
    -        zzinc_(Znearlysingular);
    -        trace0((qh ferr, 1, "qh_normalize: norm=%2.2g too small during p%d\n",
    -               norm, qh furthest_id));
    -        return;
    -      }
    -    }
    -  }
    -} /* normalize */
    -
    -
    -/*---------------------------------
    -
    -  qh_projectpoint( point, facet, dist )
    -    project point onto a facet by dist
    -
    -  returns:
    -    returns a new point
    -
    -  notes:
    -    if dist= distplane(point,facet)
    -      this projects point to hyperplane
    -    assumes qh_memfree_() is valid for normal_size
    -*/
    -pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist) {
    -  pointT *newpoint, *np, *normal;
    -  int normsize= qh normal_size;
    -  int k;
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  qh_memalloc_(normsize, freelistp, newpoint, pointT);
    -  np= newpoint;
    -  normal= facet->normal;
    -  for (k=qh hull_dim; k--; )
    -    *(np++)= *point++ - dist * *normal++;
    -  return(newpoint);
    -} /* projectpoint */
    -
    -
    -/*---------------------------------
    -
    -  qh_setfacetplane( facet )
    -    sets the hyperplane for a facet
    -    if qh.RANDOMdist, joggles hyperplane
    -
    -  notes:
    -    uses global buffers qh.gm_matrix and qh.gm_row
    -    overwrites facet->normal if already defined
    -    updates Wnewvertex if PRINTstatistics
    -    sets facet->upperdelaunay if upper envelope of Delaunay triangulation
    -
    -  design:
    -    copy vertex coordinates to qh.gm_matrix/gm_row
    -    compute determinate
    -    if nearzero
    -      recompute determinate with gaussian elimination
    -      if nearzero
    -        force outside orientation by testing interior point
    -*/
    -void qh_setfacetplane(facetT *facet) {
    -  pointT *point;
    -  vertexT *vertex, **vertexp;
    -  int normsize= qh normal_size;
    -  int k,i, oldtrace= 0;
    -  realT dist;
    -  void **freelistp; /* used !qh_NOmem */
    -  coordT *coord, *gmcoord;
    -  pointT *point0= SETfirstt_(facet->vertices, vertexT)->point;
    -  boolT nearzero= False;
    -
    -  zzinc_(Zsetplane);
    -  if (!facet->normal)
    -    qh_memalloc_(normsize, freelistp, facet->normal, coordT);
    -  if (facet == qh tracefacet) {
    -    oldtrace= qh IStracing;
    -    qh IStracing= 5;
    -    qh_fprintf(qh ferr, 8012, "qh_setfacetplane: facet f%d created.\n", facet->id);
    -    qh_fprintf(qh ferr, 8013, "  Last point added to hull was p%d.", qh furthest_id);
    -    if (zzval_(Ztotmerge))
    -      qh_fprintf(qh ferr, 8014, "  Last merge was #%d.", zzval_(Ztotmerge));
    -    qh_fprintf(qh ferr, 8015, "\n\nCurrent summary is:\n");
    -      qh_printsummary(qh ferr);
    -  }
    -  if (qh hull_dim <= 4) {
    -    i= 0;
    -    if (qh RANDOMdist) {
    -      gmcoord= qh gm_matrix;
    -      FOREACHvertex_(facet->vertices) {
    -        qh gm_row[i++]= gmcoord;
    -        coord= vertex->point;
    -        for (k=qh hull_dim; k--; )
    -          *(gmcoord++)= *coord++ * qh_randomfactor(qh RANDOMa, qh RANDOMb);
    -      }
    -    }else {
    -      FOREACHvertex_(facet->vertices)
    -       qh gm_row[i++]= vertex->point;
    -    }
    -    qh_sethyperplane_det(qh hull_dim, qh gm_row, point0, facet->toporient,
    -                facet->normal, &facet->offset, &nearzero);
    -  }
    -  if (qh hull_dim > 4 || nearzero) {
    -    i= 0;
    -    gmcoord= qh gm_matrix;
    -    FOREACHvertex_(facet->vertices) {
    -      if (vertex->point != point0) {
    -        qh gm_row[i++]= gmcoord;
    -        coord= vertex->point;
    -        point= point0;
    -        for (k=qh hull_dim; k--; )
    -          *(gmcoord++)= *coord++ - *point++;
    -      }
    -    }
    -    qh gm_row[i]= gmcoord;  /* for areasimplex */
    -    if (qh RANDOMdist) {
    -      gmcoord= qh gm_matrix;
    -      for (i=qh hull_dim-1; i--; ) {
    -        for (k=qh hull_dim; k--; )
    -          *(gmcoord++) *= qh_randomfactor(qh RANDOMa, qh RANDOMb);
    -      }
    -    }
    -    qh_sethyperplane_gauss(qh hull_dim, qh gm_row, point0, facet->toporient,
    -                facet->normal, &facet->offset, &nearzero);
    -    if (nearzero) {
    -      if (qh_orientoutside(facet)) {
    -        trace0((qh ferr, 2, "qh_setfacetplane: flipped orientation after testing interior_point during p%d\n", qh furthest_id));
    -      /* this is part of using Gaussian Elimination.  For example in 5-d
    -           1 1 1 1 0
    -           1 1 1 1 1
    -           0 0 0 1 0
    -           0 1 0 0 0
    -           1 0 0 0 0
    -           norm= 0.38 0.38 -0.76 0.38 0
    -         has a determinate of 1, but g.e. after subtracting pt. 0 has
    -         0's in the diagonal, even with full pivoting.  It does work
    -         if you subtract pt. 4 instead. */
    -      }
    -    }
    -  }
    -  facet->upperdelaunay= False;
    -  if (qh DELAUNAY) {
    -    if (qh UPPERdelaunay) {     /* matches qh_triangulate_facet and qh.lower_threshold in qh_initbuild */
    -      if (facet->normal[qh hull_dim -1] >= qh ANGLEround * qh_ZEROdelaunay)
    -        facet->upperdelaunay= True;
    -    }else {
    -      if (facet->normal[qh hull_dim -1] > -qh ANGLEround * qh_ZEROdelaunay)
    -        facet->upperdelaunay= True;
    -    }
    -  }
    -  if (qh PRINTstatistics || qh IStracing || qh TRACElevel || qh JOGGLEmax < REALmax) {
    -    qh old_randomdist= qh RANDOMdist;
    -    qh RANDOMdist= False;
    -    FOREACHvertex_(facet->vertices) {
    -      if (vertex->point != point0) {
    -        boolT istrace= False;
    -        zinc_(Zdiststat);
    -        qh_distplane(vertex->point, facet, &dist);
    -        dist= fabs_(dist);
    -        zinc_(Znewvertex);
    -        wadd_(Wnewvertex, dist);
    -        if (dist > wwval_(Wnewvertexmax)) {
    -          wwval_(Wnewvertexmax)= dist;
    -          if (dist > qh max_outside) {
    -            qh max_outside= dist;  /* used by qh_maxouter() */
    -            if (dist > qh TRACEdist)
    -              istrace= True;
    -          }
    -        }else if (-dist > qh TRACEdist)
    -          istrace= True;
    -        if (istrace) {
    -          qh_fprintf(qh ferr, 8016, "qh_setfacetplane: ====== vertex p%d(v%d) increases max_outside to %2.2g for new facet f%d last p%d\n",
    -                qh_pointid(vertex->point), vertex->id, dist, facet->id, qh furthest_id);
    -          qh_errprint("DISTANT", facet, NULL, NULL, NULL);
    -        }
    -      }
    -    }
    -    qh RANDOMdist= qh old_randomdist;
    -  }
    -  if (qh IStracing >= 3) {
    -    qh_fprintf(qh ferr, 8017, "qh_setfacetplane: f%d offset %2.2g normal: ",
    -             facet->id, facet->offset);
    -    for (k=0; k < qh hull_dim; k++)
    -      qh_fprintf(qh ferr, 8018, "%2.2g ", facet->normal[k]);
    -    qh_fprintf(qh ferr, 8019, "\n");
    -  }
    -  if (facet == qh tracefacet)
    -    qh IStracing= oldtrace;
    -} /* setfacetplane */
    -
    -
    -/*---------------------------------
    -
    -  qh_sethyperplane_det( dim, rows, point0, toporient, normal, offset, nearzero )
    -    given dim X dim array indexed by rows[], one row per point,
    -        toporient(flips all signs),
    -        and point0 (any row)
    -    set normalized hyperplane equation from oriented simplex
    -
    -  returns:
    -    normal (normalized)
    -    offset (places point0 on the hyperplane)
    -    sets nearzero if hyperplane not through points
    -
    -  notes:
    -    only defined for dim == 2..4
    -    rows[] is not modified
    -    solves det(P-V_0, V_n-V_0, ..., V_1-V_0)=0, i.e. every point is on hyperplane
    -    see Bower & Woodworth, A programmer's geometry, Butterworths 1983.
    -
    -  derivation of 3-d minnorm
    -    Goal: all vertices V_i within qh.one_merge of hyperplane
    -    Plan: exactly translate the facet so that V_0 is the origin
    -          exactly rotate the facet so that V_1 is on the x-axis and y_2=0.
    -          exactly rotate the effective perturbation to only effect n_0
    -             this introduces a factor of sqrt(3)
    -    n_0 = ((y_2-y_0)*(z_1-z_0) - (z_2-z_0)*(y_1-y_0)) / norm
    -    Let M_d be the max coordinate difference
    -    Let M_a be the greater of M_d and the max abs. coordinate
    -    Let u be machine roundoff and distround be max error for distance computation
    -    The max error for n_0 is sqrt(3) u M_a M_d / norm.  n_1 is approx. 1 and n_2 is approx. 0
    -    The max error for distance of V_1 is sqrt(3) u M_a M_d M_d / norm.  Offset=0 at origin
    -    Then minnorm = 1.8 u M_a M_d M_d / qh.ONEmerge
    -    Note that qh.one_merge is approx. 45.5 u M_a and norm is usually about M_d M_d
    -
    -  derivation of 4-d minnorm
    -    same as above except rotate the facet so that V_1 on x-axis and w_2, y_3, w_3=0
    -     [if two vertices fixed on x-axis, can rotate the other two in yzw.]
    -    n_0 = det3_(...) = y_2 det2_(z_1, w_1, z_3, w_3) = - y_2 w_1 z_3
    -     [all other terms contain at least two factors nearly zero.]
    -    The max error for n_0 is sqrt(4) u M_a M_d M_d / norm
    -    Then minnorm = 2 u M_a M_d M_d M_d / qh.ONEmerge
    -    Note that qh.one_merge is approx. 82 u M_a and norm is usually about M_d M_d M_d
    -*/
    -void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
    -          boolT toporient, coordT *normal, realT *offset, boolT *nearzero) {
    -  realT maxround, dist;
    -  int i;
    -  pointT *point;
    -
    -
    -  if (dim == 2) {
    -    normal[0]= dY(1,0);
    -    normal[1]= dX(0,1);
    -    qh_normalize2 (normal, dim, toporient, NULL, NULL);
    -    *offset= -(point0[0]*normal[0]+point0[1]*normal[1]);
    -    *nearzero= False;  /* since nearzero norm => incident points */
    -  }else if (dim == 3) {
    -    normal[0]= det2_(dY(2,0), dZ(2,0),
    -                     dY(1,0), dZ(1,0));
    -    normal[1]= det2_(dX(1,0), dZ(1,0),
    -                     dX(2,0), dZ(2,0));
    -    normal[2]= det2_(dX(2,0), dY(2,0),
    -                     dX(1,0), dY(1,0));
    -    qh_normalize2 (normal, dim, toporient, NULL, NULL);
    -    *offset= -(point0[0]*normal[0] + point0[1]*normal[1]
    -               + point0[2]*normal[2]);
    -    maxround= qh DISTround;
    -    for (i=dim; i--; ) {
    -      point= rows[i];
    -      if (point != point0) {
    -        dist= *offset + (point[0]*normal[0] + point[1]*normal[1]
    -               + point[2]*normal[2]);
    -        if (dist > maxround || dist < -maxround) {
    -          *nearzero= True;
    -          break;
    -        }
    -      }
    -    }
    -  }else if (dim == 4) {
    -    normal[0]= - det3_(dY(2,0), dZ(2,0), dW(2,0),
    -                        dY(1,0), dZ(1,0), dW(1,0),
    -                        dY(3,0), dZ(3,0), dW(3,0));
    -    normal[1]=   det3_(dX(2,0), dZ(2,0), dW(2,0),
    -                        dX(1,0), dZ(1,0), dW(1,0),
    -                        dX(3,0), dZ(3,0), dW(3,0));
    -    normal[2]= - det3_(dX(2,0), dY(2,0), dW(2,0),
    -                        dX(1,0), dY(1,0), dW(1,0),
    -                        dX(3,0), dY(3,0), dW(3,0));
    -    normal[3]=   det3_(dX(2,0), dY(2,0), dZ(2,0),
    -                        dX(1,0), dY(1,0), dZ(1,0),
    -                        dX(3,0), dY(3,0), dZ(3,0));
    -    qh_normalize2 (normal, dim, toporient, NULL, NULL);
    -    *offset= -(point0[0]*normal[0] + point0[1]*normal[1]
    -               + point0[2]*normal[2] + point0[3]*normal[3]);
    -    maxround= qh DISTround;
    -    for (i=dim; i--; ) {
    -      point= rows[i];
    -      if (point != point0) {
    -        dist= *offset + (point[0]*normal[0] + point[1]*normal[1]
    -               + point[2]*normal[2] + point[3]*normal[3]);
    -        if (dist > maxround || dist < -maxround) {
    -          *nearzero= True;
    -          break;
    -        }
    -      }
    -    }
    -  }
    -  if (*nearzero) {
    -    zzinc_(Zminnorm);
    -    trace0((qh ferr, 3, "qh_sethyperplane_det: degenerate norm during p%d.\n", qh furthest_id));
    -    zzinc_(Znearlysingular);
    -  }
    -} /* sethyperplane_det */
    -
    -
    -/*---------------------------------
    -
    -  qh_sethyperplane_gauss( dim, rows, point0, toporient, normal, offset, nearzero )
    -    given(dim-1) X dim array of rows[i]= V_{i+1} - V_0 (point0)
    -    set normalized hyperplane equation from oriented simplex
    -
    -  returns:
    -    normal (normalized)
    -    offset (places point0 on the hyperplane)
    -
    -  notes:
    -    if nearzero
    -      orientation may be incorrect because of incorrect sign flips in gausselim
    -    solves [V_n-V_0,...,V_1-V_0, 0 .. 0 1] * N == [0 .. 0 1]
    -        or [V_n-V_0,...,V_1-V_0, 0 .. 0 1] * N == [0]
    -    i.e., N is normal to the hyperplane, and the unnormalized
    -        distance to [0 .. 1] is either 1 or   0
    -
    -  design:
    -    perform gaussian elimination
    -    flip sign for negative values
    -    perform back substitution
    -    normalize result
    -    compute offset
    -*/
    -void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0,
    -                boolT toporient, coordT *normal, coordT *offset, boolT *nearzero) {
    -  coordT *pointcoord, *normalcoef;
    -  int k;
    -  boolT sign= toporient, nearzero2= False;
    -
    -  qh_gausselim(rows, dim-1, dim, &sign, nearzero);
    -  for (k=dim-1; k--; ) {
    -    if ((rows[k])[k] < 0)
    -      sign ^= 1;
    -  }
    -  if (*nearzero) {
    -    zzinc_(Znearlysingular);
    -    trace0((qh ferr, 4, "qh_sethyperplane_gauss: nearly singular or axis parallel hyperplane during p%d.\n", qh furthest_id));
    -    qh_backnormal(rows, dim-1, dim, sign, normal, &nearzero2);
    -  }else {
    -    qh_backnormal(rows, dim-1, dim, sign, normal, &nearzero2);
    -    if (nearzero2) {
    -      zzinc_(Znearlysingular);
    -      trace0((qh ferr, 5, "qh_sethyperplane_gauss: singular or axis parallel hyperplane at normalization during p%d.\n", qh furthest_id));
    -    }
    -  }
    -  if (nearzero2)
    -    *nearzero= True;
    -  qh_normalize2(normal, dim, True, NULL, NULL);
    -  pointcoord= point0;
    -  normalcoef= normal;
    -  *offset= -(*pointcoord++ * *normalcoef++);
    -  for (k=dim-1; k--; )
    -    *offset -= *pointcoord++ * *normalcoef++;
    -} /* sethyperplane_gauss */
    -
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom.h
    deleted file mode 100644
    index c85049bc71..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom.h
    +++ /dev/null
    @@ -1,176 +0,0 @@
    -/*
      ---------------------------------
    -
    -  geom.h
    -    header file for geometric routines
    -
    -   see qh-geom.htm and geom.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/geom.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFgeom
    -#define qhDEFgeom 1
    -
    -#include "libqhull.h"
    -
    -/* ============ -macros- ======================== */
    -
    -/*----------------------------------
    -
    -  fabs_(a)
    -    returns the absolute value of a
    -*/
    -#define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
    -
    -/*----------------------------------
    -
    -  fmax_(a,b)
    -    returns the maximum value of a and b
    -*/
    -#define fmax_( a,b )  ( ( a ) < ( b ) ? ( b ) : ( a ) )
    -
    -/*----------------------------------
    -
    -  fmin_(a,b)
    -    returns the minimum value of a and b
    -*/
    -#define fmin_( a,b )  ( ( a ) > ( b ) ? ( b ) : ( a ) )
    -
    -/*----------------------------------
    -
    -  maximize_(maxval, val)
    -    set maxval to val if val is greater than maxval
    -*/
    -#define maximize_( maxval, val ) { if (( maxval ) < ( val )) ( maxval )= ( val ); }
    -
    -/*----------------------------------
    -
    -  minimize_(minval, val)
    -    set minval to val if val is less than minval
    -*/
    -#define minimize_( minval, val ) { if (( minval ) > ( val )) ( minval )= ( val ); }
    -
    -/*----------------------------------
    -
    -  det2_(a1, a2,
    -        b1, b2)
    -
    -    compute a 2-d determinate
    -*/
    -#define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
    -
    -/*----------------------------------
    -
    -  det3_(a1, a2, a3,
    -       b1, b2, b3,
    -       c1, c2, c3)
    -
    -    compute a 3-d determinate
    -*/
    -#define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
    -                - ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
    -
    -/*----------------------------------
    -
    -  dX( p1, p2 )
    -  dY( p1, p2 )
    -  dZ( p1, p2 )
    -
    -    given two indices into rows[],
    -
    -    compute the difference between X, Y, or Z coordinates
    -*/
    -#define dX( p1,p2 )  ( *( rows[p1] ) - *( rows[p2] ))
    -#define dY( p1,p2 )  ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
    -#define dZ( p1,p2 )  ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
    -#define dW( p1,p2 )  ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
    -
    -/*============= prototypes in alphabetical order, infrequent at end ======= */
    -
    -void    qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
    -void    qh_distplane(pointT *point, facetT *facet, realT *dist);
    -facetT *qh_findbest(pointT *point, facetT *startfacet,
    -                     boolT bestoutside, boolT isnewfacets, boolT noupper,
    -                     realT *dist, boolT *isoutside, int *numpart);
    -facetT *qh_findbesthorizon(boolT ischeckmax, pointT *point,
    -                     facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
    -facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist,
    -                     boolT bestoutside, boolT *isoutside, int *numpart);
    -void    qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
    -realT   qh_getangle(pointT *vect1, pointT *vect2);
    -pointT *qh_getcenter(setT *vertices);
    -pointT *qh_getcentrum(facetT *facet);
    -realT   qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist);
    -void    qh_normalize(coordT *normal, int dim, boolT toporient);
    -void    qh_normalize2 (coordT *normal, int dim, boolT toporient,
    -            realT *minnorm, boolT *ismin);
    -pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist);
    -
    -void    qh_setfacetplane(facetT *newfacets);
    -void    qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
    -              boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
    -void    qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0,
    -             boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
    -boolT   qh_sharpnewfacets(void);
    -
    -/*========= infrequently used code in geom2.c =============*/
    -
    -coordT *qh_copypoints(coordT *points, int numpoints, int dimension);
    -void    qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
    -realT   qh_determinant(realT **rows, int dim, boolT *nearzero);
    -realT   qh_detjoggle(pointT *points, int numpoints, int dimension);
    -void    qh_detroundoff(void);
    -realT   qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero);
    -realT   qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp);
    -realT   qh_distround(int dimension, realT maxabs, realT maxsumabs);
    -realT   qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
    -realT   qh_facetarea(facetT *facet);
    -realT   qh_facetarea_simplex(int dim, coordT *apex, setT *vertices,
    -          vertexT *notvertex,  boolT toporient, coordT *normal, realT *offset);
    -pointT *qh_facetcenter(setT *vertices);
    -facetT *qh_findgooddist(pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
    -void    qh_getarea(facetT *facetlist);
    -boolT   qh_gram_schmidt(int dim, realT **rows);
    -boolT   qh_inthresholds(coordT *normal, realT *angle);
    -void    qh_joggleinput(void);
    -realT  *qh_maxabsval(realT *normal, int dim);
    -setT   *qh_maxmin(pointT *points, int numpoints, int dimension);
    -realT   qh_maxouter(void);
    -void    qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
    -realT   qh_minabsval(realT *normal, int dim);
    -int     qh_mindiff(realT *vecA, realT *vecB, int dim);
    -boolT   qh_orientoutside(facetT *facet);
    -void    qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane);
    -coordT  qh_pointdist(pointT *point1, pointT *point2, int dim);
    -void    qh_printmatrix(FILE *fp, const char *string, realT **rows, int numrow, int numcol);
    -void    qh_printpoints(FILE *fp, const char *string, setT *points);
    -void    qh_projectinput(void);
    -void    qh_projectpoints(signed char *project, int n, realT *points,
    -             int numpoints, int dim, realT *newpoints, int newdim);
    -void    qh_rotateinput(realT **rows);
    -void    qh_rotatepoints(realT *points, int numpoints, int dim, realT **rows);
    -void    qh_scaleinput(void);
    -void    qh_scalelast(coordT *points, int numpoints, int dim, coordT low,
    -                   coordT high, coordT newhigh);
    -void    qh_scalepoints(pointT *points, int numpoints, int dim,
    -                realT *newlows, realT *newhighs);
    -boolT   qh_sethalfspace(int dim, coordT *coords, coordT **nextp,
    -              coordT *normal, coordT *offset, coordT *feasible);
    -coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible);
    -pointT *qh_voronoi_center(int dim, setT *points);
    -
    -#endif /* qhDEFgeom */
    -
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom2.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom2.c
    deleted file mode 100644
    index a78a1cb1dd..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/geom2.c
    +++ /dev/null
    @@ -1,2081 +0,0 @@
    -/*
      ---------------------------------
    -
    -
    -   geom2.c
    -   infrequently used geometric routines of qhull
    -
    -   see qh-geom.htm and geom.h
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/geom2.c#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -
    -   frequently used code goes into geom.c
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*================== functions in alphabetic order ============*/
    -
    -/*---------------------------------
    -
    -  qh_copypoints( points, numpoints, dimension)
    -    return qh_malloc'd copy of points
    -*/
    -coordT *qh_copypoints(coordT *points, int numpoints, int dimension) {
    -  int size;
    -  coordT *newpoints;
    -
    -  size= numpoints * dimension * (int)sizeof(coordT);
    -  if (!(newpoints=(coordT*)qh_malloc((size_t)size))) {
    -    qh_fprintf(qh ferr, 6004, "qhull error: insufficient memory to copy %d points\n",
    -        numpoints);
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  memcpy((char *)newpoints, (char *)points, (size_t)size);
    -  return newpoints;
    -} /* copypoints */
    -
    -/*---------------------------------
    -
    -  qh_crossproduct( dim, vecA, vecB, vecC )
    -    crossproduct of 2 dim vectors
    -    C= A x B
    -
    -  notes:
    -    from Glasner, Graphics Gems I, p. 639
    -    only defined for dim==3
    -*/
    -void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]){
    -
    -  if (dim == 3) {
    -    vecC[0]=   det2_(vecA[1], vecA[2],
    -                     vecB[1], vecB[2]);
    -    vecC[1]= - det2_(vecA[0], vecA[2],
    -                     vecB[0], vecB[2]);
    -    vecC[2]=   det2_(vecA[0], vecA[1],
    -                     vecB[0], vecB[1]);
    -  }
    -} /* vcross */
    -
    -/*---------------------------------
    -
    -  qh_determinant( rows, dim, nearzero )
    -    compute signed determinant of a square matrix
    -    uses qh.NEARzero to test for degenerate matrices
    -
    -  returns:
    -    determinant
    -    overwrites rows and the matrix
    -    if dim == 2 or 3
    -      nearzero iff determinant < qh NEARzero[dim-1]
    -      (!quite correct, not critical)
    -    if dim >= 4
    -      nearzero iff diagonal[k] < qh NEARzero[k]
    -*/
    -realT qh_determinant(realT **rows, int dim, boolT *nearzero) {
    -  realT det=0;
    -  int i;
    -  boolT sign= False;
    -
    -  *nearzero= False;
    -  if (dim < 2) {
    -    qh_fprintf(qh ferr, 6005, "qhull internal error (qh_determinate): only implemented for dimension >= 2\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }else if (dim == 2) {
    -    det= det2_(rows[0][0], rows[0][1],
    -                 rows[1][0], rows[1][1]);
    -    if (fabs_(det) < qh NEARzero[1])  /* not really correct, what should this be? */
    -      *nearzero= True;
    -  }else if (dim == 3) {
    -    det= det3_(rows[0][0], rows[0][1], rows[0][2],
    -                 rows[1][0], rows[1][1], rows[1][2],
    -                 rows[2][0], rows[2][1], rows[2][2]);
    -    if (fabs_(det) < qh NEARzero[2])  /* not really correct, what should this be? */
    -      *nearzero= True;
    -  }else {
    -    qh_gausselim(rows, dim, dim, &sign, nearzero);  /* if nearzero, diagonal still ok*/
    -    det= 1.0;
    -    for (i=dim; i--; )
    -      det *= (rows[i])[i];
    -    if (sign)
    -      det= -det;
    -  }
    -  return det;
    -} /* determinant */
    -
    -/*---------------------------------
    -
    -  qh_detjoggle( points, numpoints, dimension )
    -    determine default max joggle for point array
    -      as qh_distround * qh_JOGGLEdefault
    -
    -  returns:
    -    initial value for JOGGLEmax from points and REALepsilon
    -
    -  notes:
    -    computes DISTround since qh_maxmin not called yet
    -    if qh SCALElast, last dimension will be scaled later to MAXwidth
    -
    -    loop duplicated from qh_maxmin
    -*/
    -realT qh_detjoggle(pointT *points, int numpoints, int dimension) {
    -  realT abscoord, distround, joggle, maxcoord, mincoord;
    -  pointT *point, *pointtemp;
    -  realT maxabs= -REALmax;
    -  realT sumabs= 0;
    -  realT maxwidth= 0;
    -  int k;
    -
    -  for (k=0; k < dimension; k++) {
    -    if (qh SCALElast && k == dimension-1)
    -      abscoord= maxwidth;
    -    else if (qh DELAUNAY && k == dimension-1) /* will qh_setdelaunay() */
    -      abscoord= 2 * maxabs * maxabs;  /* may be low by qh hull_dim/2 */
    -    else {
    -      maxcoord= -REALmax;
    -      mincoord= REALmax;
    -      FORALLpoint_(points, numpoints) {
    -        maximize_(maxcoord, point[k]);
    -        minimize_(mincoord, point[k]);
    -      }
    -      maximize_(maxwidth, maxcoord-mincoord);
    -      abscoord= fmax_(maxcoord, -mincoord);
    -    }
    -    sumabs += abscoord;
    -    maximize_(maxabs, abscoord);
    -  } /* for k */
    -  distround= qh_distround(qh hull_dim, maxabs, sumabs);
    -  joggle= distround * qh_JOGGLEdefault;
    -  maximize_(joggle, REALepsilon * qh_JOGGLEdefault);
    -  trace2((qh ferr, 2001, "qh_detjoggle: joggle=%2.2g maxwidth=%2.2g\n", joggle, maxwidth));
    -  return joggle;
    -} /* detjoggle */
    -
    -/*---------------------------------
    -
    -  qh_detroundoff()
    -    determine maximum roundoff errors from
    -      REALepsilon, REALmax, REALmin, qh.hull_dim, qh.MAXabs_coord,
    -      qh.MAXsumcoord, qh.MAXwidth, qh.MINdenom_1
    -
    -    accounts for qh.SETroundoff, qh.RANDOMdist, qh MERGEexact
    -      qh.premerge_cos, qh.postmerge_cos, qh.premerge_centrum,
    -      qh.postmerge_centrum, qh.MINoutside,
    -      qh_RATIOnearinside, qh_COPLANARratio, qh_WIDEcoplanar
    -
    -  returns:
    -    sets qh.DISTround, etc. (see below)
    -    appends precision constants to qh.qhull_options
    -
    -  see:
    -    qh_maxmin() for qh.NEARzero
    -
    -  design:
    -    determine qh.DISTround for distance computations
    -    determine minimum denominators for qh_divzero
    -    determine qh.ANGLEround for angle computations
    -    adjust qh.premerge_cos,... for roundoff error
    -    determine qh.ONEmerge for maximum error due to a single merge
    -    determine qh.NEARinside, qh.MAXcoplanar, qh.MINvisible,
    -      qh.MINoutside, qh.WIDEfacet
    -    initialize qh.max_vertex and qh.minvertex
    -*/
    -void qh_detroundoff(void) {
    -
    -  qh_option("_max-width", NULL, &qh MAXwidth);
    -  if (!qh SETroundoff) {
    -    qh DISTround= qh_distround(qh hull_dim, qh MAXabs_coord, qh MAXsumcoord);
    -    if (qh RANDOMdist)
    -      qh DISTround += qh RANDOMfactor * qh MAXabs_coord;
    -    qh_option("Error-roundoff", NULL, &qh DISTround);
    -  }
    -  qh MINdenom= qh MINdenom_1 * qh MAXabs_coord;
    -  qh MINdenom_1_2= sqrt(qh MINdenom_1 * qh hull_dim) ;  /* if will be normalized */
    -  qh MINdenom_2= qh MINdenom_1_2 * qh MAXabs_coord;
    -                                              /* for inner product */
    -  qh ANGLEround= 1.01 * qh hull_dim * REALepsilon;
    -  if (qh RANDOMdist)
    -    qh ANGLEround += qh RANDOMfactor;
    -  if (qh premerge_cos < REALmax/2) {
    -    qh premerge_cos -= qh ANGLEround;
    -    if (qh RANDOMdist)
    -      qh_option("Angle-premerge-with-random", NULL, &qh premerge_cos);
    -  }
    -  if (qh postmerge_cos < REALmax/2) {
    -    qh postmerge_cos -= qh ANGLEround;
    -    if (qh RANDOMdist)
    -      qh_option("Angle-postmerge-with-random", NULL, &qh postmerge_cos);
    -  }
    -  qh premerge_centrum += 2 * qh DISTround;    /*2 for centrum and distplane()*/
    -  qh postmerge_centrum += 2 * qh DISTround;
    -  if (qh RANDOMdist && (qh MERGEexact || qh PREmerge))
    -    qh_option("Centrum-premerge-with-random", NULL, &qh premerge_centrum);
    -  if (qh RANDOMdist && qh POSTmerge)
    -    qh_option("Centrum-postmerge-with-random", NULL, &qh postmerge_centrum);
    -  { /* compute ONEmerge, max vertex offset for merging simplicial facets */
    -    realT maxangle= 1.0, maxrho;
    -
    -    minimize_(maxangle, qh premerge_cos);
    -    minimize_(maxangle, qh postmerge_cos);
    -    /* max diameter * sin theta + DISTround for vertex to its hyperplane */
    -    qh ONEmerge= sqrt((realT)qh hull_dim) * qh MAXwidth *
    -      sqrt(1.0 - maxangle * maxangle) + qh DISTround;
    -    maxrho= qh hull_dim * qh premerge_centrum + qh DISTround;
    -    maximize_(qh ONEmerge, maxrho);
    -    maxrho= qh hull_dim * qh postmerge_centrum + qh DISTround;
    -    maximize_(qh ONEmerge, maxrho);
    -    if (qh MERGING)
    -      qh_option("_one-merge", NULL, &qh ONEmerge);
    -  }
    -  qh NEARinside= qh ONEmerge * qh_RATIOnearinside; /* only used if qh KEEPnearinside */
    -  if (qh JOGGLEmax < REALmax/2 && (qh KEEPcoplanar || qh KEEPinside)) {
    -    realT maxdist;             /* adjust qh.NEARinside for joggle */
    -    qh KEEPnearinside= True;
    -    maxdist= sqrt((realT)qh hull_dim) * qh JOGGLEmax + qh DISTround;
    -    maxdist= 2*maxdist;        /* vertex and coplanar point can joggle in opposite directions */
    -    maximize_(qh NEARinside, maxdist);  /* must agree with qh_nearcoplanar() */
    -  }
    -  if (qh KEEPnearinside)
    -    qh_option("_near-inside", NULL, &qh NEARinside);
    -  if (qh JOGGLEmax < qh DISTround) {
    -    qh_fprintf(qh ferr, 6006, "qhull error: the joggle for 'QJn', %.2g, is below roundoff for distance computations, %.2g\n",
    -         qh JOGGLEmax, qh DISTround);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (qh MINvisible > REALmax/2) {
    -    if (!qh MERGING)
    -      qh MINvisible= qh DISTround;
    -    else if (qh hull_dim <= 3)
    -      qh MINvisible= qh premerge_centrum;
    -    else
    -      qh MINvisible= qh_COPLANARratio * qh premerge_centrum;
    -    if (qh APPROXhull && qh MINvisible > qh MINoutside)
    -      qh MINvisible= qh MINoutside;
    -    qh_option("Visible-distance", NULL, &qh MINvisible);
    -  }
    -  if (qh MAXcoplanar > REALmax/2) {
    -    qh MAXcoplanar= qh MINvisible;
    -    qh_option("U-coplanar-distance", NULL, &qh MAXcoplanar);
    -  }
    -  if (!qh APPROXhull) {             /* user may specify qh MINoutside */
    -    qh MINoutside= 2 * qh MINvisible;
    -    if (qh premerge_cos < REALmax/2)
    -      maximize_(qh MINoutside, (1- qh premerge_cos) * qh MAXabs_coord);
    -    qh_option("Width-outside", NULL, &qh MINoutside);
    -  }
    -  qh WIDEfacet= qh MINoutside;
    -  maximize_(qh WIDEfacet, qh_WIDEcoplanar * qh MAXcoplanar);
    -  maximize_(qh WIDEfacet, qh_WIDEcoplanar * qh MINvisible);
    -  qh_option("_wide-facet", NULL, &qh WIDEfacet);
    -  if (qh MINvisible > qh MINoutside + 3 * REALepsilon
    -  && !qh BESToutside && !qh FORCEoutput)
    -    qh_fprintf(qh ferr, 7001, "qhull input warning: minimum visibility V%.2g is greater than \nminimum outside W%.2g.  Flipped facets are likely.\n",
    -             qh MINvisible, qh MINoutside);
    -  qh max_vertex= qh DISTround;
    -  qh min_vertex= -qh DISTround;
    -  /* numeric constants reported in printsummary */
    -} /* detroundoff */
    -
    -/*---------------------------------
    -
    -  qh_detsimplex( apex, points, dim, nearzero )
    -    compute determinant of a simplex with point apex and base points
    -
    -  returns:
    -     signed determinant and nearzero from qh_determinant
    -
    -  notes:
    -     uses qh.gm_matrix/qh.gm_row (assumes they're big enough)
    -
    -  design:
    -    construct qm_matrix by subtracting apex from points
    -    compute determinate
    -*/
    -realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero) {
    -  pointT *coorda, *coordp, *gmcoord, *point, **pointp;
    -  coordT **rows;
    -  int k,  i=0;
    -  realT det;
    -
    -  zinc_(Zdetsimplex);
    -  gmcoord= qh gm_matrix;
    -  rows= qh gm_row;
    -  FOREACHpoint_(points) {
    -    if (i == dim)
    -      break;
    -    rows[i++]= gmcoord;
    -    coordp= point;
    -    coorda= apex;
    -    for (k=dim; k--; )
    -      *(gmcoord++)= *coordp++ - *coorda++;
    -  }
    -  if (i < dim) {
    -    qh_fprintf(qh ferr, 6007, "qhull internal error (qh_detsimplex): #points %d < dimension %d\n",
    -               i, dim);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  det= qh_determinant(rows, dim, nearzero);
    -  trace2((qh ferr, 2002, "qh_detsimplex: det=%2.2g for point p%d, dim %d, nearzero? %d\n",
    -          det, qh_pointid(apex), dim, *nearzero));
    -  return det;
    -} /* detsimplex */
    -
    -/*---------------------------------
    -
    -  qh_distnorm( dim, point, normal, offset )
    -    return distance from point to hyperplane at normal/offset
    -
    -  returns:
    -    dist
    -
    -  notes:
    -    dist > 0 if point is outside of hyperplane
    -
    -  see:
    -    qh_distplane in geom.c
    -*/
    -realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp) {
    -  coordT *normalp= normal, *coordp= point;
    -  realT dist;
    -  int k;
    -
    -  dist= *offsetp;
    -  for (k=dim; k--; )
    -    dist += *(coordp++) * *(normalp++);
    -  return dist;
    -} /* distnorm */
    -
    -/*---------------------------------
    -
    -  qh_distround(dimension, maxabs, maxsumabs )
    -    compute maximum round-off error for a distance computation
    -      to a normalized hyperplane
    -    maxabs is the maximum absolute value of a coordinate
    -    maxsumabs is the maximum possible sum of absolute coordinate values
    -
    -  returns:
    -    max dist round for REALepsilon
    -
    -  notes:
    -    calculate roundoff error according to
    -    Lemma 3.2-1 of Golub and van Loan "Matrix Computation"
    -    use sqrt(dim) since one vector is normalized
    -      or use maxsumabs since one vector is < 1
    -*/
    -realT qh_distround(int dimension, realT maxabs, realT maxsumabs) {
    -  realT maxdistsum, maxround;
    -
    -  maxdistsum= sqrt((realT)dimension) * maxabs;
    -  minimize_( maxdistsum, maxsumabs);
    -  maxround= REALepsilon * (dimension * maxdistsum * 1.01 + maxabs);
    -              /* adds maxabs for offset */
    -  trace4((qh ferr, 4008, "qh_distround: %2.2g maxabs %2.2g maxsumabs %2.2g maxdistsum %2.2g\n",
    -                 maxround, maxabs, maxsumabs, maxdistsum));
    -  return maxround;
    -} /* distround */
    -
    -/*---------------------------------
    -
    -  qh_divzero( numer, denom, mindenom1, zerodiv )
    -    divide by a number that's nearly zero
    -    mindenom1= minimum denominator for dividing into 1.0
    -
    -  returns:
    -    quotient
    -    sets zerodiv and returns 0.0 if it would overflow
    -
    -  design:
    -    if numer is nearly zero and abs(numer) < abs(denom)
    -      return numer/denom
    -    else if numer is nearly zero
    -      return 0 and zerodiv
    -    else if denom/numer non-zero
    -      return numer/denom
    -    else
    -      return 0 and zerodiv
    -*/
    -realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv) {
    -  realT temp, numerx, denomx;
    -
    -
    -  if (numer < mindenom1 && numer > -mindenom1) {
    -    numerx= fabs_(numer);
    -    denomx= fabs_(denom);
    -    if (numerx < denomx) {
    -      *zerodiv= False;
    -      return numer/denom;
    -    }else {
    -      *zerodiv= True;
    -      return 0.0;
    -    }
    -  }
    -  temp= denom/numer;
    -  if (temp > mindenom1 || temp < -mindenom1) {
    -    *zerodiv= False;
    -    return numer/denom;
    -  }else {
    -    *zerodiv= True;
    -    return 0.0;
    -  }
    -} /* divzero */
    -
    -
    -/*---------------------------------
    -
    -  qh_facetarea( facet )
    -    return area for a facet
    -
    -  notes:
    -    if non-simplicial,
    -      uses centrum to triangulate facet and sums the projected areas.
    -    if (qh DELAUNAY),
    -      computes projected area instead for last coordinate
    -    assumes facet->normal exists
    -    projecting tricoplanar facets to the hyperplane does not appear to make a difference
    -
    -  design:
    -    if simplicial
    -      compute area
    -    else
    -      for each ridge
    -        compute area from centrum to ridge
    -    negate area if upper Delaunay facet
    -*/
    -realT qh_facetarea(facetT *facet) {
    -  vertexT *apex;
    -  pointT *centrum;
    -  realT area= 0.0;
    -  ridgeT *ridge, **ridgep;
    -
    -  if (facet->simplicial) {
    -    apex= SETfirstt_(facet->vertices, vertexT);
    -    area= qh_facetarea_simplex(qh hull_dim, apex->point, facet->vertices,
    -                    apex, facet->toporient, facet->normal, &facet->offset);
    -  }else {
    -    if (qh CENTERtype == qh_AScentrum)
    -      centrum= facet->center;
    -    else
    -      centrum= qh_getcentrum(facet);
    -    FOREACHridge_(facet->ridges)
    -      area += qh_facetarea_simplex(qh hull_dim, centrum, ridge->vertices,
    -                 NULL, (boolT)(ridge->top == facet),  facet->normal, &facet->offset);
    -    if (qh CENTERtype != qh_AScentrum)
    -      qh_memfree(centrum, qh normal_size);
    -  }
    -  if (facet->upperdelaunay && qh DELAUNAY)
    -    area= -area;  /* the normal should be [0,...,1] */
    -  trace4((qh ferr, 4009, "qh_facetarea: f%d area %2.2g\n", facet->id, area));
    -  return area;
    -} /* facetarea */
    -
    -/*---------------------------------
    -
    -  qh_facetarea_simplex( dim, apex, vertices, notvertex, toporient, normal, offset )
    -    return area for a simplex defined by
    -      an apex, a base of vertices, an orientation, and a unit normal
    -    if simplicial or tricoplanar facet,
    -      notvertex is defined and it is skipped in vertices
    -
    -  returns:
    -    computes area of simplex projected to plane [normal,offset]
    -    returns 0 if vertex too far below plane (qh WIDEfacet)
    -      vertex can't be apex of tricoplanar facet
    -
    -  notes:
    -    if (qh DELAUNAY),
    -      computes projected area instead for last coordinate
    -    uses qh gm_matrix/gm_row and qh hull_dim
    -    helper function for qh_facetarea
    -
    -  design:
    -    if Notvertex
    -      translate simplex to apex
    -    else
    -      project simplex to normal/offset
    -      translate simplex to apex
    -    if Delaunay
    -      set last row/column to 0 with -1 on diagonal
    -    else
    -      set last row to Normal
    -    compute determinate
    -    scale and flip sign for area
    -*/
    -realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices,
    -        vertexT *notvertex,  boolT toporient, coordT *normal, realT *offset) {
    -  pointT *coorda, *coordp, *gmcoord;
    -  coordT **rows, *normalp;
    -  int k,  i=0;
    -  realT area, dist;
    -  vertexT *vertex, **vertexp;
    -  boolT nearzero;
    -
    -  gmcoord= qh gm_matrix;
    -  rows= qh gm_row;
    -  FOREACHvertex_(vertices) {
    -    if (vertex == notvertex)
    -      continue;
    -    rows[i++]= gmcoord;
    -    coorda= apex;
    -    coordp= vertex->point;
    -    normalp= normal;
    -    if (notvertex) {
    -      for (k=dim; k--; )
    -        *(gmcoord++)= *coordp++ - *coorda++;
    -    }else {
    -      dist= *offset;
    -      for (k=dim; k--; )
    -        dist += *coordp++ * *normalp++;
    -      if (dist < -qh WIDEfacet) {
    -        zinc_(Znoarea);
    -        return 0.0;
    -      }
    -      coordp= vertex->point;
    -      normalp= normal;
    -      for (k=dim; k--; )
    -        *(gmcoord++)= (*coordp++ - dist * *normalp++) - *coorda++;
    -    }
    -  }
    -  if (i != dim-1) {
    -    qh_fprintf(qh ferr, 6008, "qhull internal error (qh_facetarea_simplex): #points %d != dim %d -1\n",
    -               i, dim);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  rows[i]= gmcoord;
    -  if (qh DELAUNAY) {
    -    for (i=0; i < dim-1; i++)
    -      rows[i][dim-1]= 0.0;
    -    for (k=dim; k--; )
    -      *(gmcoord++)= 0.0;
    -    rows[dim-1][dim-1]= -1.0;
    -  }else {
    -    normalp= normal;
    -    for (k=dim; k--; )
    -      *(gmcoord++)= *normalp++;
    -  }
    -  zinc_(Zdetsimplex);
    -  area= qh_determinant(rows, dim, &nearzero);
    -  if (toporient)
    -    area= -area;
    -  area *= qh AREAfactor;
    -  trace4((qh ferr, 4010, "qh_facetarea_simplex: area=%2.2g for point p%d, toporient %d, nearzero? %d\n",
    -          area, qh_pointid(apex), toporient, nearzero));
    -  return area;
    -} /* facetarea_simplex */
    -
    -/*---------------------------------
    -
    -  qh_facetcenter( vertices )
    -    return Voronoi center (Voronoi vertex) for a facet's vertices
    -
    -  returns:
    -    return temporary point equal to the center
    -
    -  see:
    -    qh_voronoi_center()
    -*/
    -pointT *qh_facetcenter(setT *vertices) {
    -  setT *points= qh_settemp(qh_setsize(vertices));
    -  vertexT *vertex, **vertexp;
    -  pointT *center;
    -
    -  FOREACHvertex_(vertices)
    -    qh_setappend(&points, vertex->point);
    -  center= qh_voronoi_center(qh hull_dim-1, points);
    -  qh_settempfree(&points);
    -  return center;
    -} /* facetcenter */
    -
    -/*---------------------------------
    -
    -  qh_findgooddist( point, facetA, dist, facetlist )
    -    find best good facet visible for point from facetA
    -    assumes facetA is visible from point
    -
    -  returns:
    -    best facet, i.e., good facet that is furthest from point
    -      distance to best facet
    -      NULL if none
    -
    -    moves good, visible facets (and some other visible facets)
    -      to end of qh facet_list
    -
    -  notes:
    -    uses qh visit_id
    -
    -  design:
    -    initialize bestfacet if facetA is good
    -    move facetA to end of facetlist
    -    for each facet on facetlist
    -      for each unvisited neighbor of facet
    -        move visible neighbors to end of facetlist
    -        update best good neighbor
    -        if no good neighbors, update best facet
    -*/
    -facetT *qh_findgooddist(pointT *point, facetT *facetA, realT *distp,
    -               facetT **facetlist) {
    -  realT bestdist= -REALmax, dist;
    -  facetT *neighbor, **neighborp, *bestfacet=NULL, *facet;
    -  boolT goodseen= False;
    -
    -  if (facetA->good) {
    -    zzinc_(Zcheckpart);  /* calls from check_bestdist occur after print stats */
    -    qh_distplane(point, facetA, &bestdist);
    -    bestfacet= facetA;
    -    goodseen= True;
    -  }
    -  qh_removefacet(facetA);
    -  qh_appendfacet(facetA);
    -  *facetlist= facetA;
    -  facetA->visitid= ++qh visit_id;
    -  FORALLfacet_(*facetlist) {
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid == qh visit_id)
    -        continue;
    -      neighbor->visitid= qh visit_id;
    -      if (goodseen && !neighbor->good)
    -        continue;
    -      zzinc_(Zcheckpart);
    -      qh_distplane(point, neighbor, &dist);
    -      if (dist > 0) {
    -        qh_removefacet(neighbor);
    -        qh_appendfacet(neighbor);
    -        if (neighbor->good) {
    -          goodseen= True;
    -          if (dist > bestdist) {
    -            bestdist= dist;
    -            bestfacet= neighbor;
    -          }
    -        }
    -      }
    -    }
    -  }
    -  if (bestfacet) {
    -    *distp= bestdist;
    -    trace2((qh ferr, 2003, "qh_findgooddist: p%d is %2.2g above good facet f%d\n",
    -      qh_pointid(point), bestdist, bestfacet->id));
    -    return bestfacet;
    -  }
    -  trace4((qh ferr, 4011, "qh_findgooddist: no good facet for p%d above f%d\n",
    -      qh_pointid(point), facetA->id));
    -  return NULL;
    -}  /* findgooddist */
    -
    -/*---------------------------------
    -
    -  qh_getarea( facetlist )
    -    set area of all facets in facetlist
    -    collect statistics
    -    nop if hasAreaVolume
    -
    -  returns:
    -    sets qh totarea/totvol to total area and volume of convex hull
    -    for Delaunay triangulation, computes projected area of the lower or upper hull
    -      ignores upper hull if qh ATinfinity
    -
    -  notes:
    -    could compute outer volume by expanding facet area by rays from interior
    -    the following attempt at perpendicular projection underestimated badly:
    -      qh.totoutvol += (-dist + facet->maxoutside + qh DISTround)
    -                            * area/ qh hull_dim;
    -  design:
    -    for each facet on facetlist
    -      compute facet->area
    -      update qh.totarea and qh.totvol
    -*/
    -void qh_getarea(facetT *facetlist) {
    -  realT area;
    -  realT dist;
    -  facetT *facet;
    -
    -  if (qh hasAreaVolume)
    -    return;
    -  if (qh REPORTfreq)
    -    qh_fprintf(qh ferr, 8020, "computing area of each facet and volume of the convex hull\n");
    -  else
    -    trace1((qh ferr, 1001, "qh_getarea: computing volume and area for each facet\n"));
    -  qh totarea= qh totvol= 0.0;
    -  FORALLfacet_(facetlist) {
    -    if (!facet->normal)
    -      continue;
    -    if (facet->upperdelaunay && qh ATinfinity)
    -      continue;
    -    if (!facet->isarea) {
    -      facet->f.area= qh_facetarea(facet);
    -      facet->isarea= True;
    -    }
    -    area= facet->f.area;
    -    if (qh DELAUNAY) {
    -      if (facet->upperdelaunay == qh UPPERdelaunay)
    -        qh totarea += area;
    -    }else {
    -      qh totarea += area;
    -      qh_distplane(qh interior_point, facet, &dist);
    -      qh totvol += -dist * area/ qh hull_dim;
    -    }
    -    if (qh PRINTstatistics) {
    -      wadd_(Wareatot, area);
    -      wmax_(Wareamax, area);
    -      wmin_(Wareamin, area);
    -    }
    -  }
    -  qh hasAreaVolume= True;
    -} /* getarea */
    -
    -/*---------------------------------
    -
    -  qh_gram_schmidt( dim, row )
    -    implements Gram-Schmidt orthogonalization by rows
    -
    -  returns:
    -    false if zero norm
    -    overwrites rows[dim][dim]
    -
    -  notes:
    -    see Golub & van Loan Algorithm 6.2-2
    -    overflow due to small divisors not handled
    -
    -  design:
    -    for each row
    -      compute norm for row
    -      if non-zero, normalize row
    -      for each remaining rowA
    -        compute inner product of row and rowA
    -        reduce rowA by row * inner product
    -*/
    -boolT qh_gram_schmidt(int dim, realT **row) {
    -  realT *rowi, *rowj, norm;
    -  int i, j, k;
    -
    -  for (i=0; i < dim; i++) {
    -    rowi= row[i];
    -    for (norm= 0.0, k= dim; k--; rowi++)
    -      norm += *rowi * *rowi;
    -    norm= sqrt(norm);
    -    wmin_(Wmindenom, norm);
    -    if (norm == 0.0)  /* either 0 or overflow due to sqrt */
    -      return False;
    -    for (k=dim; k--; )
    -      *(--rowi) /= norm;
    -    for (j=i+1; j < dim; j++) {
    -      rowj= row[j];
    -      for (norm= 0.0, k=dim; k--; )
    -        norm += *rowi++ * *rowj++;
    -      for (k=dim; k--; )
    -        *(--rowj) -= *(--rowi) * norm;
    -    }
    -  }
    -  return True;
    -} /* gram_schmidt */
    -
    -
    -/*---------------------------------
    -
    -  qh_inthresholds( normal, angle )
    -    return True if normal within qh.lower_/upper_threshold
    -
    -  returns:
    -    estimate of angle by summing of threshold diffs
    -      angle may be NULL
    -      smaller "angle" is better
    -
    -  notes:
    -    invalid if qh.SPLITthresholds
    -
    -  see:
    -    qh.lower_threshold in qh_initbuild()
    -    qh_initthresholds()
    -
    -  design:
    -    for each dimension
    -      test threshold
    -*/
    -boolT qh_inthresholds(coordT *normal, realT *angle) {
    -  boolT within= True;
    -  int k;
    -  realT threshold;
    -
    -  if (angle)
    -    *angle= 0.0;
    -  for (k=0; k < qh hull_dim; k++) {
    -    threshold= qh lower_threshold[k];
    -    if (threshold > -REALmax/2) {
    -      if (normal[k] < threshold)
    -        within= False;
    -      if (angle) {
    -        threshold -= normal[k];
    -        *angle += fabs_(threshold);
    -      }
    -    }
    -    if (qh upper_threshold[k] < REALmax/2) {
    -      threshold= qh upper_threshold[k];
    -      if (normal[k] > threshold)
    -        within= False;
    -      if (angle) {
    -        threshold -= normal[k];
    -        *angle += fabs_(threshold);
    -      }
    -    }
    -  }
    -  return within;
    -} /* inthresholds */
    -
    -
    -/*---------------------------------
    -
    -  qh_joggleinput()
    -    randomly joggle input to Qhull by qh.JOGGLEmax
    -    initial input is qh.first_point/qh.num_points of qh.hull_dim
    -      repeated calls use qh.input_points/qh.num_points
    -
    -  returns:
    -    joggles points at qh.first_point/qh.num_points
    -    copies data to qh.input_points/qh.input_malloc if first time
    -    determines qh.JOGGLEmax if it was zero
    -    if qh.DELAUNAY
    -      computes the Delaunay projection of the joggled points
    -
    -  notes:
    -    if qh.DELAUNAY, unnecessarily joggles the last coordinate
    -    the initial 'QJn' may be set larger than qh_JOGGLEmaxincrease
    -
    -  design:
    -    if qh.DELAUNAY
    -      set qh.SCALElast for reduced precision errors
    -    if first call
    -      initialize qh.input_points to the original input points
    -      if qh.JOGGLEmax == 0
    -        determine default qh.JOGGLEmax
    -    else
    -      increase qh.JOGGLEmax according to qh.build_cnt
    -    joggle the input by adding a random number in [-qh.JOGGLEmax,qh.JOGGLEmax]
    -    if qh.DELAUNAY
    -      sets the Delaunay projection
    -*/
    -void qh_joggleinput(void) {
    -  int i, seed, size;
    -  coordT *coordp, *inputp;
    -  realT randr, randa, randb;
    -
    -  if (!qh input_points) { /* first call */
    -    qh input_points= qh first_point;
    -    qh input_malloc= qh POINTSmalloc;
    -    size= qh num_points * qh hull_dim * sizeof(coordT);
    -    if (!(qh first_point=(coordT*)qh_malloc((size_t)size))) {
    -      qh_fprintf(qh ferr, 6009, "qhull error: insufficient memory to joggle %d points\n",
    -          qh num_points);
    -      qh_errexit(qh_ERRmem, NULL, NULL);
    -    }
    -    qh POINTSmalloc= True;
    -    if (qh JOGGLEmax == 0.0) {
    -      qh JOGGLEmax= qh_detjoggle(qh input_points, qh num_points, qh hull_dim);
    -      qh_option("QJoggle", NULL, &qh JOGGLEmax);
    -    }
    -  }else {                 /* repeated call */
    -    if (!qh RERUN && qh build_cnt > qh_JOGGLEretry) {
    -      if (((qh build_cnt-qh_JOGGLEretry-1) % qh_JOGGLEagain) == 0) {
    -        realT maxjoggle= qh MAXwidth * qh_JOGGLEmaxincrease;
    -        if (qh JOGGLEmax < maxjoggle) {
    -          qh JOGGLEmax *= qh_JOGGLEincrease;
    -          minimize_(qh JOGGLEmax, maxjoggle);
    -        }
    -      }
    -    }
    -    qh_option("QJoggle", NULL, &qh JOGGLEmax);
    -  }
    -  if (qh build_cnt > 1 && qh JOGGLEmax > fmax_(qh MAXwidth/4, 0.1)) {
    -      qh_fprintf(qh ferr, 6010, "qhull error: the current joggle for 'QJn', %.2g, is too large for the width\nof the input.  If possible, recompile Qhull with higher-precision reals.\n",
    -                qh JOGGLEmax);
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  /* for some reason, using qh ROTATErandom and qh_RANDOMseed does not repeat the run. Use 'TRn' instead */
    -  seed= qh_RANDOMint;
    -  qh_option("_joggle-seed", &seed, NULL);
    -  trace0((qh ferr, 6, "qh_joggleinput: joggle input by %2.2g with seed %d\n",
    -    qh JOGGLEmax, seed));
    -  inputp= qh input_points;
    -  coordp= qh first_point;
    -  randa= 2.0 * qh JOGGLEmax/qh_RANDOMmax;
    -  randb= -qh JOGGLEmax;
    -  size= qh num_points * qh hull_dim;
    -  for (i=size; i--; ) {
    -    randr= qh_RANDOMint;
    -    *(coordp++)= *(inputp++) + (randr * randa + randb);
    -  }
    -  if (qh DELAUNAY) {
    -    qh last_low= qh last_high= qh last_newhigh= REALmax;
    -    qh_setdelaunay(qh hull_dim, qh num_points, qh first_point);
    -  }
    -} /* joggleinput */
    -
    -/*---------------------------------
    -
    -  qh_maxabsval( normal, dim )
    -    return pointer to maximum absolute value of a dim vector
    -    returns NULL if dim=0
    -*/
    -realT *qh_maxabsval(realT *normal, int dim) {
    -  realT maxval= -REALmax;
    -  realT *maxp= NULL, *colp, absval;
    -  int k;
    -
    -  for (k=dim, colp= normal; k--; colp++) {
    -    absval= fabs_(*colp);
    -    if (absval > maxval) {
    -      maxval= absval;
    -      maxp= colp;
    -    }
    -  }
    -  return maxp;
    -} /* maxabsval */
    -
    -
    -/*---------------------------------
    -
    -  qh_maxmin( points, numpoints, dimension )
    -    return max/min points for each dimension
    -    determine max and min coordinates
    -
    -  returns:
    -    returns a temporary set of max and min points
    -      may include duplicate points. Does not include qh.GOODpoint
    -    sets qh.NEARzero, qh.MAXabs_coord, qh.MAXsumcoord, qh.MAXwidth
    -         qh.MAXlastcoord, qh.MINlastcoord
    -    initializes qh.max_outside, qh.min_vertex, qh.WAScoplanar, qh.ZEROall_ok
    -
    -  notes:
    -    loop duplicated in qh_detjoggle()
    -
    -  design:
    -    initialize global precision variables
    -    checks definition of REAL...
    -    for each dimension
    -      for each point
    -        collect maximum and minimum point
    -      collect maximum of maximums and minimum of minimums
    -      determine qh.NEARzero for Gaussian Elimination
    -*/
    -setT *qh_maxmin(pointT *points, int numpoints, int dimension) {
    -  int k;
    -  realT maxcoord, temp;
    -  pointT *minimum, *maximum, *point, *pointtemp;
    -  setT *set;
    -
    -  qh max_outside= 0.0;
    -  qh MAXabs_coord= 0.0;
    -  qh MAXwidth= -REALmax;
    -  qh MAXsumcoord= 0.0;
    -  qh min_vertex= 0.0;
    -  qh WAScoplanar= False;
    -  if (qh ZEROcentrum)
    -    qh ZEROall_ok= True;
    -  if (REALmin < REALepsilon && REALmin < REALmax && REALmin > -REALmax
    -  && REALmax > 0.0 && -REALmax < 0.0)
    -    ; /* all ok */
    -  else {
    -    qh_fprintf(qh ferr, 6011, "qhull error: floating point constants in user.h are wrong\n\
    -REALepsilon %g REALmin %g REALmax %g -REALmax %g\n",
    -             REALepsilon, REALmin, REALmax, -REALmax);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  set= qh_settemp(2*dimension);
    -  for (k=0; k < dimension; k++) {
    -    if (points == qh GOODpointp)
    -      minimum= maximum= points + dimension;
    -    else
    -      minimum= maximum= points;
    -    FORALLpoint_(points, numpoints) {
    -      if (point == qh GOODpointp)
    -        continue;
    -      if (maximum[k] < point[k])
    -        maximum= point;
    -      else if (minimum[k] > point[k])
    -        minimum= point;
    -    }
    -    if (k == dimension-1) {
    -      qh MINlastcoord= minimum[k];
    -      qh MAXlastcoord= maximum[k];
    -    }
    -    if (qh SCALElast && k == dimension-1)
    -      maxcoord= qh MAXwidth;
    -    else {
    -      maxcoord= fmax_(maximum[k], -minimum[k]);
    -      if (qh GOODpointp) {
    -        temp= fmax_(qh GOODpointp[k], -qh GOODpointp[k]);
    -        maximize_(maxcoord, temp);
    -      }
    -      temp= maximum[k] - minimum[k];
    -      maximize_(qh MAXwidth, temp);
    -    }
    -    maximize_(qh MAXabs_coord, maxcoord);
    -    qh MAXsumcoord += maxcoord;
    -    qh_setappend(&set, maximum);
    -    qh_setappend(&set, minimum);
    -    /* calculation of qh NEARzero is based on error formula 4.4-13 of
    -       Golub & van Loan, authors say n^3 can be ignored and 10 be used in
    -       place of rho */
    -    qh NEARzero[k]= 80 * qh MAXsumcoord * REALepsilon;
    -  }
    -  if (qh IStracing >=1)
    -    qh_printpoints(qh ferr, "qh_maxmin: found the max and min points(by dim):", set);
    -  return(set);
    -} /* maxmin */
    -
    -/*---------------------------------
    -
    -  qh_maxouter()
    -    return maximum distance from facet to outer plane
    -    normally this is qh.max_outside+qh.DISTround
    -    does not include qh.JOGGLEmax
    -
    -  see:
    -    qh_outerinner()
    -
    -  notes:
    -    need to add another qh.DISTround if testing actual point with computation
    -
    -  for joggle:
    -    qh_setfacetplane() updated qh.max_outer for Wnewvertexmax (max distance to vertex)
    -    need to use Wnewvertexmax since could have a coplanar point for a high
    -      facet that is replaced by a low facet
    -    need to add qh.JOGGLEmax if testing input points
    -*/
    -realT qh_maxouter(void) {
    -  realT dist;
    -
    -  dist= fmax_(qh max_outside, qh DISTround);
    -  dist += qh DISTround;
    -  trace4((qh ferr, 4012, "qh_maxouter: max distance from facet to outer plane is %2.2g max_outside is %2.2g\n", dist, qh max_outside));
    -  return dist;
    -} /* maxouter */
    -
    -/*---------------------------------
    -
    -  qh_maxsimplex( dim, maxpoints, points, numpoints, simplex )
    -    determines maximum simplex for a set of points
    -    starts from points already in simplex
    -    skips qh.GOODpointp (assumes that it isn't in maxpoints)
    -
    -  returns:
    -    simplex with dim+1 points
    -
    -  notes:
    -    assumes at least pointsneeded points in points
    -    maximizes determinate for x,y,z,w, etc.
    -    uses maxpoints as long as determinate is clearly non-zero
    -
    -  design:
    -    initialize simplex with at least two points
    -      (find points with max or min x coordinate)
    -    for each remaining dimension
    -      add point that maximizes the determinate
    -        (use points from maxpoints first)
    -*/
    -void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex) {
    -  pointT *point, **pointp, *pointtemp, *maxpoint, *minx=NULL, *maxx=NULL;
    -  boolT nearzero, maxnearzero= False;
    -  int k, sizinit;
    -  realT maxdet= -REALmax, det, mincoord= REALmax, maxcoord= -REALmax;
    -
    -  sizinit= qh_setsize(*simplex);
    -  if (sizinit < 2) {
    -    if (qh_setsize(maxpoints) >= 2) {
    -      FOREACHpoint_(maxpoints) {
    -        if (maxcoord < point[0]) {
    -          maxcoord= point[0];
    -          maxx= point;
    -        }
    -        if (mincoord > point[0]) {
    -          mincoord= point[0];
    -          minx= point;
    -        }
    -      }
    -    }else {
    -      FORALLpoint_(points, numpoints) {
    -        if (point == qh GOODpointp)
    -          continue;
    -        if (maxcoord < point[0]) {
    -          maxcoord= point[0];
    -          maxx= point;
    -        }
    -        if (mincoord > point[0]) {
    -          mincoord= point[0];
    -          minx= point;
    -        }
    -      }
    -    }
    -    qh_setunique(simplex, minx);
    -    if (qh_setsize(*simplex) < 2)
    -      qh_setunique(simplex, maxx);
    -    sizinit= qh_setsize(*simplex);
    -    if (sizinit < 2) {
    -      qh_precision("input has same x coordinate");
    -      if (zzval_(Zsetplane) > qh hull_dim+1) {
    -        qh_fprintf(qh ferr, 6012, "qhull precision error (qh_maxsimplex for voronoi_center):\n%d points with the same x coordinate.\n",
    -                 qh_setsize(maxpoints)+numpoints);
    -        qh_errexit(qh_ERRprec, NULL, NULL);
    -      }else {
    -        qh_fprintf(qh ferr, 6013, "qhull input error: input is less than %d-dimensional since it has the same x coordinate\n", qh hull_dim);
    -        qh_errexit(qh_ERRinput, NULL, NULL);
    -      }
    -    }
    -  }
    -  for (k=sizinit; k < dim+1; k++) {
    -    maxpoint= NULL;
    -    maxdet= -REALmax;
    -    FOREACHpoint_(maxpoints) {
    -      if (!qh_setin(*simplex, point)) {
    -        det= qh_detsimplex(point, *simplex, k, &nearzero);
    -        if ((det= fabs_(det)) > maxdet) {
    -          maxdet= det;
    -          maxpoint= point;
    -          maxnearzero= nearzero;
    -        }
    -      }
    -    }
    -    if (!maxpoint || maxnearzero) {
    -      zinc_(Zsearchpoints);
    -      if (!maxpoint) {
    -        trace0((qh ferr, 7, "qh_maxsimplex: searching all points for %d-th initial vertex.\n", k+1));
    -      }else {
    -        trace0((qh ferr, 8, "qh_maxsimplex: searching all points for %d-th initial vertex, better than p%d det %2.2g\n",
    -                k+1, qh_pointid(maxpoint), maxdet));
    -      }
    -      FORALLpoint_(points, numpoints) {
    -        if (point == qh GOODpointp)
    -          continue;
    -        if (!qh_setin(*simplex, point)) {
    -          det= qh_detsimplex(point, *simplex, k, &nearzero);
    -          if ((det= fabs_(det)) > maxdet) {
    -            maxdet= det;
    -            maxpoint= point;
    -            maxnearzero= nearzero;
    -          }
    -        }
    -      }
    -    } /* !maxpoint */
    -    if (!maxpoint) {
    -      qh_fprintf(qh ferr, 6014, "qhull internal error (qh_maxsimplex): not enough points available\n");
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -    qh_setappend(simplex, maxpoint);
    -    trace1((qh ferr, 1002, "qh_maxsimplex: selected point p%d for %d`th initial vertex, det=%2.2g\n",
    -            qh_pointid(maxpoint), k+1, maxdet));
    -  } /* k */
    -} /* maxsimplex */
    -
    -/*---------------------------------
    -
    -  qh_minabsval( normal, dim )
    -    return minimum absolute value of a dim vector
    -*/
    -realT qh_minabsval(realT *normal, int dim) {
    -  realT minval= 0;
    -  realT maxval= 0;
    -  realT *colp;
    -  int k;
    -
    -  for (k=dim, colp=normal; k--; colp++) {
    -    maximize_(maxval, *colp);
    -    minimize_(minval, *colp);
    -  }
    -  return fmax_(maxval, -minval);
    -} /* minabsval */
    -
    -
    -/*---------------------------------
    -
    -  qh_mindif ( vecA, vecB, dim )
    -    return index of min abs. difference of two vectors
    -*/
    -int qh_mindiff(realT *vecA, realT *vecB, int dim) {
    -  realT mindiff= REALmax, diff;
    -  realT *vecAp= vecA, *vecBp= vecB;
    -  int k, mink= 0;
    -
    -  for (k=0; k < dim; k++) {
    -    diff= *vecAp++ - *vecBp++;
    -    diff= fabs_(diff);
    -    if (diff < mindiff) {
    -      mindiff= diff;
    -      mink= k;
    -    }
    -  }
    -  return mink;
    -} /* mindiff */
    -
    -
    -
    -/*---------------------------------
    -
    -  qh_orientoutside( facet  )
    -    make facet outside oriented via qh.interior_point
    -
    -  returns:
    -    True if facet reversed orientation.
    -*/
    -boolT qh_orientoutside(facetT *facet) {
    -  int k;
    -  realT dist;
    -
    -  qh_distplane(qh interior_point, facet, &dist);
    -  if (dist > 0) {
    -    for (k=qh hull_dim; k--; )
    -      facet->normal[k]= -facet->normal[k];
    -    facet->offset= -facet->offset;
    -    return True;
    -  }
    -  return False;
    -} /* orientoutside */
    -
    -/*---------------------------------
    -
    -  qh_outerinner( facet, outerplane, innerplane  )
    -    if facet and qh.maxoutdone (i.e., qh_check_maxout)
    -      returns outer and inner plane for facet
    -    else
    -      returns maximum outer and inner plane
    -    accounts for qh.JOGGLEmax
    -
    -  see:
    -    qh_maxouter(), qh_check_bestdist(), qh_check_points()
    -
    -  notes:
    -    outerplaner or innerplane may be NULL
    -    facet is const
    -    Does not error (QhullFacet)
    -
    -    includes qh.DISTround for actual points
    -    adds another qh.DISTround if testing with floating point arithmetic
    -*/
    -void qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane) {
    -  realT dist, mindist;
    -  vertexT *vertex, **vertexp;
    -
    -  if (outerplane) {
    -    if (!qh_MAXoutside || !facet || !qh maxoutdone) {
    -      *outerplane= qh_maxouter();       /* includes qh.DISTround */
    -    }else { /* qh_MAXoutside ... */
    -#if qh_MAXoutside
    -      *outerplane= facet->maxoutside + qh DISTround;
    -#endif
    -
    -    }
    -    if (qh JOGGLEmax < REALmax/2)
    -      *outerplane += qh JOGGLEmax * sqrt((realT)qh hull_dim);
    -  }
    -  if (innerplane) {
    -    if (facet) {
    -      mindist= REALmax;
    -      FOREACHvertex_(facet->vertices) {
    -        zinc_(Zdistio);
    -        qh_distplane(vertex->point, facet, &dist);
    -        minimize_(mindist, dist);
    -      }
    -      *innerplane= mindist - qh DISTround;
    -    }else
    -      *innerplane= qh min_vertex - qh DISTround;
    -    if (qh JOGGLEmax < REALmax/2)
    -      *innerplane -= qh JOGGLEmax * sqrt((realT)qh hull_dim);
    -  }
    -} /* outerinner */
    -
    -/*---------------------------------
    -
    -  qh_pointdist( point1, point2, dim )
    -    return distance between two points
    -
    -  notes:
    -    returns distance squared if 'dim' is negative
    -*/
    -coordT qh_pointdist(pointT *point1, pointT *point2, int dim) {
    -  coordT dist, diff;
    -  int k;
    -
    -  dist= 0.0;
    -  for (k= (dim > 0 ? dim : -dim); k--; ) {
    -    diff= *point1++ - *point2++;
    -    dist += diff * diff;
    -  }
    -  if (dim > 0)
    -    return(sqrt(dist));
    -  return dist;
    -} /* pointdist */
    -
    -
    -/*---------------------------------
    -
    -  qh_printmatrix( fp, string, rows, numrow, numcol )
    -    print matrix to fp given by row vectors
    -    print string as header
    -
    -  notes:
    -    print a vector by qh_printmatrix(fp, "", &vect, 1, len)
    -*/
    -void qh_printmatrix(FILE *fp, const char *string, realT **rows, int numrow, int numcol) {
    -  realT *rowp;
    -  realT r; /*bug fix*/
    -  int i,k;
    -
    -  qh_fprintf(fp, 9001, "%s\n", string);
    -  for (i=0; i < numrow; i++) {
    -    rowp= rows[i];
    -    for (k=0; k < numcol; k++) {
    -      r= *rowp++;
    -      qh_fprintf(fp, 9002, "%6.3g ", r);
    -    }
    -    qh_fprintf(fp, 9003, "\n");
    -  }
    -} /* printmatrix */
    -
    -
    -/*---------------------------------
    -
    -  qh_printpoints( fp, string, points )
    -    print pointids to fp for a set of points
    -    if string, prints string and 'p' point ids
    -*/
    -void qh_printpoints(FILE *fp, const char *string, setT *points) {
    -  pointT *point, **pointp;
    -
    -  if (string) {
    -    qh_fprintf(fp, 9004, "%s", string);
    -    FOREACHpoint_(points)
    -      qh_fprintf(fp, 9005, " p%d", qh_pointid(point));
    -    qh_fprintf(fp, 9006, "\n");
    -  }else {
    -    FOREACHpoint_(points)
    -      qh_fprintf(fp, 9007, " %d", qh_pointid(point));
    -    qh_fprintf(fp, 9008, "\n");
    -  }
    -} /* printpoints */
    -
    -
    -/*---------------------------------
    -
    -  qh_projectinput()
    -    project input points using qh.lower_bound/upper_bound and qh DELAUNAY
    -    if qh.lower_bound[k]=qh.upper_bound[k]= 0,
    -      removes dimension k
    -    if halfspace intersection
    -      removes dimension k from qh.feasible_point
    -    input points in qh first_point, num_points, input_dim
    -
    -  returns:
    -    new point array in qh first_point of qh hull_dim coordinates
    -    sets qh POINTSmalloc
    -    if qh DELAUNAY
    -      projects points to paraboloid
    -      lowbound/highbound is also projected
    -    if qh ATinfinity
    -      adds point "at-infinity"
    -    if qh POINTSmalloc
    -      frees old point array
    -
    -  notes:
    -    checks that qh.hull_dim agrees with qh.input_dim, PROJECTinput, and DELAUNAY
    -
    -
    -  design:
    -    sets project[k] to -1 (delete), 0 (keep), 1 (add for Delaunay)
    -    determines newdim and newnum for qh hull_dim and qh num_points
    -    projects points to newpoints
    -    projects qh.lower_bound to itself
    -    projects qh.upper_bound to itself
    -    if qh DELAUNAY
    -      if qh ATINFINITY
    -        projects points to paraboloid
    -        computes "infinity" point as vertex average and 10% above all points
    -      else
    -        uses qh_setdelaunay to project points to paraboloid
    -*/
    -void qh_projectinput(void) {
    -  int k,i;
    -  int newdim= qh input_dim, newnum= qh num_points;
    -  signed char *project;
    -  int size= (qh input_dim+1)*sizeof(*project);
    -  pointT *newpoints, *coord, *infinity;
    -  realT paraboloid, maxboloid= 0;
    -
    -  project= (signed char*)qh_memalloc(size);
    -  memset((char*)project, 0, (size_t)size);
    -  for (k=0; k < qh input_dim; k++) {   /* skip Delaunay bound */
    -    if (qh lower_bound[k] == 0 && qh upper_bound[k] == 0) {
    -      project[k]= -1;
    -      newdim--;
    -    }
    -  }
    -  if (qh DELAUNAY) {
    -    project[k]= 1;
    -    newdim++;
    -    if (qh ATinfinity)
    -      newnum++;
    -  }
    -  if (newdim != qh hull_dim) {
    -    qh_fprintf(qh ferr, 6015, "qhull internal error (qh_projectinput): dimension after projection %d != hull_dim %d\n", newdim, qh hull_dim);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  if (!(newpoints=(coordT*)qh_malloc(newnum*newdim*sizeof(coordT)))){
    -    qh_fprintf(qh ferr, 6016, "qhull error: insufficient memory to project %d points\n",
    -           qh num_points);
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  qh_projectpoints(project, qh input_dim+1, qh first_point,
    -                    qh num_points, qh input_dim, newpoints, newdim);
    -  trace1((qh ferr, 1003, "qh_projectinput: updating lower and upper_bound\n"));
    -  qh_projectpoints(project, qh input_dim+1, qh lower_bound,
    -                    1, qh input_dim+1, qh lower_bound, newdim+1);
    -  qh_projectpoints(project, qh input_dim+1, qh upper_bound,
    -                    1, qh input_dim+1, qh upper_bound, newdim+1);
    -  if (qh HALFspace) {
    -    if (!qh feasible_point) {
    -      qh_fprintf(qh ferr, 6017, "qhull internal error (qh_projectinput): HALFspace defined without qh.feasible_point\n");
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -    qh_projectpoints(project, qh input_dim, qh feasible_point,
    -                      1, qh input_dim, qh feasible_point, newdim);
    -  }
    -  qh_memfree(project, (qh input_dim+1)*sizeof(*project));
    -  if (qh POINTSmalloc)
    -    qh_free(qh first_point);
    -  qh first_point= newpoints;
    -  qh POINTSmalloc= True;
    -  if (qh DELAUNAY && qh ATinfinity) {
    -    coord= qh first_point;
    -    infinity= qh first_point + qh hull_dim * qh num_points;
    -    for (k=qh hull_dim-1; k--; )
    -      infinity[k]= 0.0;
    -    for (i=qh num_points; i--; ) {
    -      paraboloid= 0.0;
    -      for (k=0; k < qh hull_dim-1; k++) {
    -        paraboloid += *coord * *coord;
    -        infinity[k] += *coord;
    -        coord++;
    -      }
    -      *(coord++)= paraboloid;
    -      maximize_(maxboloid, paraboloid);
    -    }
    -    /* coord == infinity */
    -    for (k=qh hull_dim-1; k--; )
    -      *(coord++) /= qh num_points;
    -    *(coord++)= maxboloid * 1.1;
    -    qh num_points++;
    -    trace0((qh ferr, 9, "qh_projectinput: projected points to paraboloid for Delaunay\n"));
    -  }else if (qh DELAUNAY)  /* !qh ATinfinity */
    -    qh_setdelaunay( qh hull_dim, qh num_points, qh first_point);
    -} /* projectinput */
    -
    -
    -/*---------------------------------
    -
    -  qh_projectpoints( project, n, points, numpoints, dim, newpoints, newdim )
    -    project points/numpoints/dim to newpoints/newdim
    -    if project[k] == -1
    -      delete dimension k
    -    if project[k] == 1
    -      add dimension k by duplicating previous column
    -    n is size of project
    -
    -  notes:
    -    newpoints may be points if only adding dimension at end
    -
    -  design:
    -    check that 'project' and 'newdim' agree
    -    for each dimension
    -      if project == -1
    -        skip dimension
    -      else
    -        determine start of column in newpoints
    -        determine start of column in points
    -          if project == +1, duplicate previous column
    -        copy dimension (column) from points to newpoints
    -*/
    -void qh_projectpoints(signed char *project, int n, realT *points,
    -        int numpoints, int dim, realT *newpoints, int newdim) {
    -  int testdim= dim, oldk=0, newk=0, i,j=0,k;
    -  realT *newp, *oldp;
    -
    -  for (k=0; k < n; k++)
    -    testdim += project[k];
    -  if (testdim != newdim) {
    -    qh_fprintf(qh ferr, 6018, "qhull internal error (qh_projectpoints): newdim %d should be %d after projection\n",
    -      newdim, testdim);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  for (j=0; j= dim)
    -          continue;
    -        oldp= points+oldk;
    -      }else
    -        oldp= points+oldk++;
    -      for (i=numpoints; i--; ) {
    -        *newp= *oldp;
    -        newp += newdim;
    -        oldp += dim;
    -      }
    -    }
    -    if (oldk >= dim)
    -      break;
    -  }
    -  trace1((qh ferr, 1004, "qh_projectpoints: projected %d points from dim %d to dim %d\n",
    -    numpoints, dim, newdim));
    -} /* projectpoints */
    -
    -
    -/*---------------------------------
    -
    -  qh_rotateinput( rows )
    -    rotate input using row matrix
    -    input points given by qh first_point, num_points, hull_dim
    -    assumes rows[dim] is a scratch buffer
    -    if qh POINTSmalloc, overwrites input points, else mallocs a new array
    -
    -  returns:
    -    rotated input
    -    sets qh POINTSmalloc
    -
    -  design:
    -    see qh_rotatepoints
    -*/
    -void qh_rotateinput(realT **rows) {
    -
    -  if (!qh POINTSmalloc) {
    -    qh first_point= qh_copypoints(qh first_point, qh num_points, qh hull_dim);
    -    qh POINTSmalloc= True;
    -  }
    -  qh_rotatepoints(qh first_point, qh num_points, qh hull_dim, rows);
    -}  /* rotateinput */
    -
    -/*---------------------------------
    -
    -  qh_rotatepoints( points, numpoints, dim, row )
    -    rotate numpoints points by a d-dim row matrix
    -    assumes rows[dim] is a scratch buffer
    -
    -  returns:
    -    rotated points in place
    -
    -  design:
    -    for each point
    -      for each coordinate
    -        use row[dim] to compute partial inner product
    -      for each coordinate
    -        rotate by partial inner product
    -*/
    -void qh_rotatepoints(realT *points, int numpoints, int dim, realT **row) {
    -  realT *point, *rowi, *coord= NULL, sum, *newval;
    -  int i,j,k;
    -
    -  if (qh IStracing >= 1)
    -    qh_printmatrix(qh ferr, "qh_rotatepoints: rotate points by", row, dim, dim);
    -  for (point= points, j= numpoints; j--; point += dim) {
    -    newval= row[dim];
    -    for (i=0; i < dim; i++) {
    -      rowi= row[i];
    -      coord= point;
    -      for (sum= 0.0, k= dim; k--; )
    -        sum += *rowi++ * *coord++;
    -      *(newval++)= sum;
    -    }
    -    for (k=dim; k--; )
    -      *(--coord)= *(--newval);
    -  }
    -} /* rotatepoints */
    -
    -
    -/*---------------------------------
    -
    -  qh_scaleinput()
    -    scale input points using qh low_bound/high_bound
    -    input points given by qh first_point, num_points, hull_dim
    -    if qh POINTSmalloc, overwrites input points, else mallocs a new array
    -
    -  returns:
    -    scales coordinates of points to low_bound[k], high_bound[k]
    -    sets qh POINTSmalloc
    -
    -  design:
    -    see qh_scalepoints
    -*/
    -void qh_scaleinput(void) {
    -
    -  if (!qh POINTSmalloc) {
    -    qh first_point= qh_copypoints(qh first_point, qh num_points, qh hull_dim);
    -    qh POINTSmalloc= True;
    -  }
    -  qh_scalepoints(qh first_point, qh num_points, qh hull_dim,
    -       qh lower_bound, qh upper_bound);
    -}  /* scaleinput */
    -
    -/*---------------------------------
    -
    -  qh_scalelast( points, numpoints, dim, low, high, newhigh )
    -    scale last coordinate to [0,m] for Delaunay triangulations
    -    input points given by points, numpoints, dim
    -
    -  returns:
    -    changes scale of last coordinate from [low, high] to [0, newhigh]
    -    overwrites last coordinate of each point
    -    saves low/high/newhigh in qh.last_low, etc. for qh_setdelaunay()
    -
    -  notes:
    -    when called by qh_setdelaunay, low/high may not match actual data
    -
    -  design:
    -    compute scale and shift factors
    -    apply to last coordinate of each point
    -*/
    -void qh_scalelast(coordT *points, int numpoints, int dim, coordT low,
    -                   coordT high, coordT newhigh) {
    -  realT scale, shift;
    -  coordT *coord;
    -  int i;
    -  boolT nearzero= False;
    -
    -  trace4((qh ferr, 4013, "qh_scalelast: scale last coordinate from [%2.2g, %2.2g] to [0,%2.2g]\n",
    -    low, high, newhigh));
    -  qh last_low= low;
    -  qh last_high= high;
    -  qh last_newhigh= newhigh;
    -  scale= qh_divzero(newhigh, high - low,
    -                  qh MINdenom_1, &nearzero);
    -  if (nearzero) {
    -    if (qh DELAUNAY)
    -      qh_fprintf(qh ferr, 6019, "qhull input error: can not scale last coordinate.  Input is cocircular\n   or cospherical.   Use option 'Qz' to add a point at infinity.\n");
    -    else
    -      qh_fprintf(qh ferr, 6020, "qhull input error: can not scale last coordinate.  New bounds [0, %2.2g] are too wide for\nexisting bounds [%2.2g, %2.2g] (width %2.2g)\n",
    -                newhigh, low, high, high-low);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  shift= - low * newhigh / (high-low);
    -  coord= points + dim - 1;
    -  for (i=numpoints; i--; coord += dim)
    -    *coord= *coord * scale + shift;
    -} /* scalelast */
    -
    -/*---------------------------------
    -
    -  qh_scalepoints( points, numpoints, dim, newlows, newhighs )
    -    scale points to new lowbound and highbound
    -    retains old bound when newlow= -REALmax or newhigh= +REALmax
    -
    -  returns:
    -    scaled points
    -    overwrites old points
    -
    -  design:
    -    for each coordinate
    -      compute current low and high bound
    -      compute scale and shift factors
    -      scale all points
    -      enforce new low and high bound for all points
    -*/
    -void qh_scalepoints(pointT *points, int numpoints, int dim,
    -        realT *newlows, realT *newhighs) {
    -  int i,k;
    -  realT shift, scale, *coord, low, high, newlow, newhigh, mincoord, maxcoord;
    -  boolT nearzero= False;
    -
    -  for (k=0; k < dim; k++) {
    -    newhigh= newhighs[k];
    -    newlow= newlows[k];
    -    if (newhigh > REALmax/2 && newlow < -REALmax/2)
    -      continue;
    -    low= REALmax;
    -    high= -REALmax;
    -    for (i=numpoints, coord=points+k; i--; coord += dim) {
    -      minimize_(low, *coord);
    -      maximize_(high, *coord);
    -    }
    -    if (newhigh > REALmax/2)
    -      newhigh= high;
    -    if (newlow < -REALmax/2)
    -      newlow= low;
    -    if (qh DELAUNAY && k == dim-1 && newhigh < newlow) {
    -      qh_fprintf(qh ferr, 6021, "qhull input error: 'Qb%d' or 'QB%d' inverts paraboloid since high bound %.2g < low bound %.2g\n",
    -               k, k, newhigh, newlow);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    scale= qh_divzero(newhigh - newlow, high - low,
    -                  qh MINdenom_1, &nearzero);
    -    if (nearzero) {
    -      qh_fprintf(qh ferr, 6022, "qhull input error: %d'th dimension's new bounds [%2.2g, %2.2g] too wide for\nexisting bounds [%2.2g, %2.2g]\n",
    -              k, newlow, newhigh, low, high);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    shift= (newlow * high - low * newhigh)/(high-low);
    -    coord= points+k;
    -    for (i=numpoints; i--; coord += dim)
    -      *coord= *coord * scale + shift;
    -    coord= points+k;
    -    if (newlow < newhigh) {
    -      mincoord= newlow;
    -      maxcoord= newhigh;
    -    }else {
    -      mincoord= newhigh;
    -      maxcoord= newlow;
    -    }
    -    for (i=numpoints; i--; coord += dim) {
    -      minimize_(*coord, maxcoord);  /* because of roundoff error */
    -      maximize_(*coord, mincoord);
    -    }
    -    trace0((qh ferr, 10, "qh_scalepoints: scaled %d'th coordinate [%2.2g, %2.2g] to [%.2g, %.2g] for %d points by %2.2g and shifted %2.2g\n",
    -      k, low, high, newlow, newhigh, numpoints, scale, shift));
    -  }
    -} /* scalepoints */
    -
    -
    -/*---------------------------------
    -
    -  qh_setdelaunay( dim, count, points )
    -    project count points to dim-d paraboloid for Delaunay triangulation
    -
    -    dim is one more than the dimension of the input set
    -    assumes dim is at least 3 (i.e., at least a 2-d Delaunay triangulation)
    -
    -    points is a dim*count realT array.  The first dim-1 coordinates
    -    are the coordinates of the first input point.  array[dim] is
    -    the first coordinate of the second input point.  array[2*dim] is
    -    the first coordinate of the third input point.
    -
    -    if qh.last_low defined (i.e., 'Qbb' called qh_scalelast)
    -      calls qh_scalelast to scale the last coordinate the same as the other points
    -
    -  returns:
    -    for each point
    -      sets point[dim-1] to sum of squares of coordinates
    -    scale points to 'Qbb' if needed
    -
    -  notes:
    -    to project one point, use
    -      qh_setdelaunay(qh hull_dim, 1, point)
    -
    -    Do not use options 'Qbk', 'QBk', or 'QbB' since they scale
    -    the coordinates after the original projection.
    -
    -*/
    -void qh_setdelaunay(int dim, int count, pointT *points) {
    -  int i, k;
    -  coordT *coordp, coord;
    -  realT paraboloid;
    -
    -  trace0((qh ferr, 11, "qh_setdelaunay: project %d points to paraboloid for Delaunay triangulation\n", count));
    -  coordp= points;
    -  for (i=0; i < count; i++) {
    -    coord= *coordp++;
    -    paraboloid= coord*coord;
    -    for (k=dim-2; k--; ) {
    -      coord= *coordp++;
    -      paraboloid += coord*coord;
    -    }
    -    *coordp++ = paraboloid;
    -  }
    -  if (qh last_low < REALmax/2)
    -    qh_scalelast(points, count, dim, qh last_low, qh last_high, qh last_newhigh);
    -} /* setdelaunay */
    -
    -
    -/*---------------------------------
    -
    -  qh_sethalfspace( dim, coords, nextp, normal, offset, feasible )
    -    set point to dual of halfspace relative to feasible point
    -    halfspace is normal coefficients and offset.
    -
    -  returns:
    -    false if feasible point is outside of hull (error message already reported)
    -    overwrites coordinates for point at dim coords
    -    nextp= next point (coords)
    -
    -  design:
    -    compute distance from feasible point to halfspace
    -    divide each normal coefficient by -dist
    -*/
    -boolT qh_sethalfspace(int dim, coordT *coords, coordT **nextp,
    -         coordT *normal, coordT *offset, coordT *feasible) {
    -  coordT *normp= normal, *feasiblep= feasible, *coordp= coords;
    -  realT dist;
    -  realT r; /*bug fix*/
    -  int k;
    -  boolT zerodiv;
    -
    -  dist= *offset;
    -  for (k=dim; k--; )
    -    dist += *(normp++) * *(feasiblep++);
    -  if (dist > 0)
    -    goto LABELerroroutside;
    -  normp= normal;
    -  if (dist < -qh MINdenom) {
    -    for (k=dim; k--; )
    -      *(coordp++)= *(normp++) / -dist;
    -  }else {
    -    for (k=dim; k--; ) {
    -      *(coordp++)= qh_divzero(*(normp++), -dist, qh MINdenom_1, &zerodiv);
    -      if (zerodiv)
    -        goto LABELerroroutside;
    -    }
    -  }
    -  *nextp= coordp;
    -  if (qh IStracing >= 4) {
    -    qh_fprintf(qh ferr, 8021, "qh_sethalfspace: halfspace at offset %6.2g to point: ", *offset);
    -    for (k=dim, coordp=coords; k--; ) {
    -      r= *coordp++;
    -      qh_fprintf(qh ferr, 8022, " %6.2g", r);
    -    }
    -    qh_fprintf(qh ferr, 8023, "\n");
    -  }
    -  return True;
    -LABELerroroutside:
    -  feasiblep= feasible;
    -  normp= normal;
    -  qh_fprintf(qh ferr, 6023, "qhull input error: feasible point is not clearly inside halfspace\nfeasible point: ");
    -  for (k=dim; k--; )
    -    qh_fprintf(qh ferr, 8024, qh_REAL_1, r=*(feasiblep++));
    -  qh_fprintf(qh ferr, 8025, "\n     halfspace: ");
    -  for (k=dim; k--; )
    -    qh_fprintf(qh ferr, 8026, qh_REAL_1, r=*(normp++));
    -  qh_fprintf(qh ferr, 8027, "\n     at offset: ");
    -  qh_fprintf(qh ferr, 8028, qh_REAL_1, *offset);
    -  qh_fprintf(qh ferr, 8029, " and distance: ");
    -  qh_fprintf(qh ferr, 8030, qh_REAL_1, dist);
    -  qh_fprintf(qh ferr, 8031, "\n");
    -  return False;
    -} /* sethalfspace */
    -
    -/*---------------------------------
    -
    -  qh_sethalfspace_all( dim, count, halfspaces, feasible )
    -    generate dual for halfspace intersection with feasible point
    -    array of count halfspaces
    -      each halfspace is normal coefficients followed by offset
    -      the origin is inside the halfspace if the offset is negative
    -
    -  returns:
    -    malloc'd array of count X dim-1 points
    -
    -  notes:
    -    call before qh_init_B or qh_initqhull_globals
    -    unused/untested code: please email bradb@shore.net if this works ok for you
    -    If using option 'Fp', also set qh feasible_point. It is a malloc'd array
    -      that is freed by qh_freebuffers.
    -
    -  design:
    -    see qh_sethalfspace
    -*/
    -coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible) {
    -  int i, newdim;
    -  pointT *newpoints;
    -  coordT *coordp, *normalp, *offsetp;
    -
    -  trace0((qh ferr, 12, "qh_sethalfspace_all: compute dual for halfspace intersection\n"));
    -  newdim= dim - 1;
    -  if (!(newpoints=(coordT*)qh_malloc(count*newdim*sizeof(coordT)))){
    -    qh_fprintf(qh ferr, 6024, "qhull error: insufficient memory to compute dual of %d halfspaces\n",
    -          count);
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  coordp= newpoints;
    -  normalp= halfspaces;
    -  for (i=0; i < count; i++) {
    -    offsetp= normalp + newdim;
    -    if (!qh_sethalfspace(newdim, coordp, &coordp, normalp, offsetp, feasible)) {
    -      qh_fprintf(qh ferr, 8032, "The halfspace was at index %d\n", i);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    normalp= offsetp + 1;
    -  }
    -  return newpoints;
    -} /* sethalfspace_all */
    -
    -
    -/*---------------------------------
    -
    -  qh_sharpnewfacets()
    -
    -  returns:
    -    true if could be an acute angle (facets in different quadrants)
    -
    -  notes:
    -    for qh_findbest
    -
    -  design:
    -    for all facets on qh.newfacet_list
    -      if two facets are in different quadrants
    -        set issharp
    -*/
    -boolT qh_sharpnewfacets() {
    -  facetT *facet;
    -  boolT issharp = False;
    -  int *quadrant, k;
    -
    -  quadrant= (int*)qh_memalloc(qh hull_dim * sizeof(int));
    -  FORALLfacet_(qh newfacet_list) {
    -    if (facet == qh newfacet_list) {
    -      for (k=qh hull_dim; k--; )
    -        quadrant[ k]= (facet->normal[ k] > 0);
    -    }else {
    -      for (k=qh hull_dim; k--; ) {
    -        if (quadrant[ k] != (facet->normal[ k] > 0)) {
    -          issharp= True;
    -          break;
    -        }
    -      }
    -    }
    -    if (issharp)
    -      break;
    -  }
    -  qh_memfree( quadrant, qh hull_dim * sizeof(int));
    -  trace3((qh ferr, 3001, "qh_sharpnewfacets: %d\n", issharp));
    -  return issharp;
    -} /* sharpnewfacets */
    -
    -/*---------------------------------
    -
    -  qh_voronoi_center( dim, points )
    -    return Voronoi center for a set of points
    -    dim is the orginal dimension of the points
    -    gh.gm_matrix/qh.gm_row are scratch buffers
    -
    -  returns:
    -    center as a temporary point
    -    if non-simplicial,
    -      returns center for max simplex of points
    -
    -  notes:
    -    from Bowyer & Woodwark, A Programmer's Geometry, 1983, p. 65
    -
    -  design:
    -    if non-simplicial
    -      determine max simplex for points
    -    translate point0 of simplex to origin
    -    compute sum of squares of diagonal
    -    compute determinate
    -    compute Voronoi center (see Bowyer & Woodwark)
    -*/
    -pointT *qh_voronoi_center(int dim, setT *points) {
    -  pointT *point, **pointp, *point0;
    -  pointT *center= (pointT*)qh_memalloc(qh center_size);
    -  setT *simplex;
    -  int i, j, k, size= qh_setsize(points);
    -  coordT *gmcoord;
    -  realT *diffp, sum2, *sum2row, *sum2p, det, factor;
    -  boolT nearzero, infinite;
    -
    -  if (size == dim+1)
    -    simplex= points;
    -  else if (size < dim+1) {
    -    qh_fprintf(qh ferr, 6025, "qhull internal error (qh_voronoi_center):\n  need at least %d points to construct a Voronoi center\n",
    -             dim+1);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -    simplex= points;  /* never executed -- avoids warning */
    -  }else {
    -    simplex= qh_settemp(dim+1);
    -    qh_maxsimplex(dim, points, NULL, 0, &simplex);
    -  }
    -  point0= SETfirstt_(simplex, pointT);
    -  gmcoord= qh gm_matrix;
    -  for (k=0; k < dim; k++) {
    -    qh gm_row[k]= gmcoord;
    -    FOREACHpoint_(simplex) {
    -      if (point != point0)
    -        *(gmcoord++)= point[k] - point0[k];
    -    }
    -  }
    -  sum2row= gmcoord;
    -  for (i=0; i < dim; i++) {
    -    sum2= 0.0;
    -    for (k=0; k < dim; k++) {
    -      diffp= qh gm_row[k] + i;
    -      sum2 += *diffp * *diffp;
    -    }
    -    *(gmcoord++)= sum2;
    -  }
    -  det= qh_determinant(qh gm_row, dim, &nearzero);
    -  factor= qh_divzero(0.5, det, qh MINdenom, &infinite);
    -  if (infinite) {
    -    for (k=dim; k--; )
    -      center[k]= qh_INFINITE;
    -    if (qh IStracing)
    -      qh_printpoints(qh ferr, "qh_voronoi_center: at infinity for ", simplex);
    -  }else {
    -    for (i=0; i < dim; i++) {
    -      gmcoord= qh gm_matrix;
    -      sum2p= sum2row;
    -      for (k=0; k < dim; k++) {
    -        qh gm_row[k]= gmcoord;
    -        if (k == i) {
    -          for (j=dim; j--; )
    -            *(gmcoord++)= *sum2p++;
    -        }else {
    -          FOREACHpoint_(simplex) {
    -            if (point != point0)
    -              *(gmcoord++)= point[k] - point0[k];
    -          }
    -        }
    -      }
    -      center[i]= qh_determinant(qh gm_row, dim, &nearzero)*factor + point0[i];
    -    }
    -#ifndef qh_NOtrace
    -    if (qh IStracing >= 3) {
    -      qh_fprintf(qh ferr, 8033, "qh_voronoi_center: det %2.2g factor %2.2g ", det, factor);
    -      qh_printmatrix(qh ferr, "center:", ¢er, 1, dim);
    -      if (qh IStracing >= 5) {
    -        qh_printpoints(qh ferr, "points", simplex);
    -        FOREACHpoint_(simplex)
    -          qh_fprintf(qh ferr, 8034, "p%d dist %.2g, ", qh_pointid(point),
    -                   qh_pointdist(point, center, dim));
    -        qh_fprintf(qh ferr, 8035, "\n");
    -      }
    -    }
    -#endif
    -  }
    -  if (simplex != points)
    -    qh_settempfree(&simplex);
    -  return center;
    -} /* voronoi_center */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/global.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/global.c
    deleted file mode 100644
    index a9063ea8ad..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/global.c
    +++ /dev/null
    @@ -1,2127 +0,0 @@
    -
    -/*
      ---------------------------------
    -
    -   global.c
    -   initializes all the globals of the qhull application
    -
    -   see README
    -
    -   see libqhull.h for qh.globals and function prototypes
    -
    -   see qhull_a.h for internal functions
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/global.c#15 $$Change: 1490 $
    -   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    - */
    -
    -#include "qhull_a.h"
    -
    -/*========= qh definition -- globals defined in libqhull.h =======================*/
    -
    -int qhull_inuse= 0; /* not used */
    -
    -#if qh_QHpointer
    -qhT *qh_qh= NULL;       /* pointer to all global variables */
    -#else
    -qhT qh_qh;              /* all global variables.
    -                           Add "= {0}" if this causes a compiler error.
    -                           Also qh_qhstat in stat.c and qhmem in mem.c.  */
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_version
    -    version string by year and date
    -
    -    the revision increases on code changes only
    -
    -  notes:
    -    change date:    Changes.txt, Announce.txt, index.htm, README.txt,
    -                    qhull-news.html, Eudora signatures, CMakeLists.txt
    -    change version: README.txt, qh-get.htm, File_id.diz, Makefile.txt
    -    change year:    Copying.txt
    -    check download size
    -    recompile user_eg.c, rbox.c, libqhull.c, qconvex.c, qdelaun.c qvoronoi.c, qhalf.c, testqset.c
    -*/
    -
    -const char *qh_version = "2012.1 2012/02/18";
    -
    -/*---------------------------------
    -
    -  qh_appendprint( printFormat )
    -    append printFormat to qh.PRINTout unless already defined
    -*/
    -void qh_appendprint(qh_PRINT format) {
    -  int i;
    -
    -  for (i=0; i < qh_PRINTEND; i++) {
    -    if (qh PRINTout[i] == format && format != qh_PRINTqhull)
    -      break;
    -    if (!qh PRINTout[i]) {
    -      qh PRINTout[i]= format;
    -      break;
    -    }
    -  }
    -} /* appendprint */
    -
    -/*---------------------------------
    -
    -  qh_checkflags( commandStr, hiddenFlags )
    -    errors if commandStr contains hiddenFlags
    -    hiddenFlags starts and ends with a space and is space deliminated (checked)
    -
    -  notes:
    -    ignores first word (e.g., "qconvex i")
    -    use qh_strtol/strtod since strtol/strtod may or may not skip trailing spaces
    -
    -  see:
    -    qh_initflags() initializes Qhull according to commandStr
    -*/
    -void qh_checkflags(char *command, char *hiddenflags) {
    -  char *s= command, *t, *chkerr; /* qh_skipfilename is non-const */
    -  char key, opt, prevopt;
    -  char chkkey[]= "   ";
    -  char chkopt[]=  "    ";
    -  char chkopt2[]= "     ";
    -  boolT waserr= False;
    -
    -  if (*hiddenflags != ' ' || hiddenflags[strlen(hiddenflags)-1] != ' ') {
    -    qh_fprintf(qh ferr, 6026, "qhull error (qh_checkflags): hiddenflags must start and end with a space: \"%s\"", hiddenflags);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (strpbrk(hiddenflags, ",\n\r\t")) {
    -    qh_fprintf(qh ferr, 6027, "qhull error (qh_checkflags): hiddenflags contains commas, newlines, or tabs: \"%s\"", hiddenflags);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  while (*s && !isspace(*s))  /* skip program name */
    -    s++;
    -  while (*s) {
    -    while (*s && isspace(*s))
    -      s++;
    -    if (*s == '-')
    -      s++;
    -    if (!*s)
    -      break;
    -    key = *s++;
    -    chkerr = NULL;
    -    if (key == 'T' && (*s == 'I' || *s == 'O')) {  /* TI or TO 'file name' */
    -      s= qh_skipfilename(++s);
    -      continue;
    -    }
    -    chkkey[1]= key;
    -    if (strstr(hiddenflags, chkkey)) {
    -      chkerr= chkkey;
    -    }else if (isupper(key)) {
    -      opt= ' ';
    -      prevopt= ' ';
    -      chkopt[1]= key;
    -      chkopt2[1]= key;
    -      while (!chkerr && *s && !isspace(*s)) {
    -        opt= *s++;
    -        if (isalpha(opt)) {
    -          chkopt[2]= opt;
    -          if (strstr(hiddenflags, chkopt))
    -            chkerr= chkopt;
    -          if (prevopt != ' ') {
    -            chkopt2[2]= prevopt;
    -            chkopt2[3]= opt;
    -            if (strstr(hiddenflags, chkopt2))
    -              chkerr= chkopt2;
    -          }
    -        }else if (key == 'Q' && isdigit(opt) && prevopt != 'b'
    -              && (prevopt == ' ' || islower(prevopt))) {
    -            chkopt[2]= opt;
    -            if (strstr(hiddenflags, chkopt))
    -              chkerr= chkopt;
    -        }else {
    -          qh_strtod(s-1, &t);
    -          if (s < t)
    -            s= t;
    -        }
    -        prevopt= opt;
    -      }
    -    }
    -    if (chkerr) {
    -      *chkerr= '\'';
    -      chkerr[strlen(chkerr)-1]=  '\'';
    -      qh_fprintf(qh ferr, 6029, "qhull error: option %s is not used with this program.\n             It may be used with qhull.\n", chkerr);
    -      waserr= True;
    -    }
    -  }
    -  if (waserr)
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -} /* checkflags */
    -
    -/*---------------------------------
    -
    -  qh_clear_outputflags()
    -    Clear output flags for QhullPoints
    -*/
    -void qh_clear_outputflags(void) {
    -  int i,k;
    -
    -  qh ANNOTATEoutput= False;
    -  qh DOintersections= False;
    -  qh DROPdim= -1;
    -  qh FORCEoutput= False;
    -  qh GETarea= False;
    -  qh GOODpoint= 0;
    -  qh GOODpointp= NULL;
    -  qh GOODthreshold= False;
    -  qh GOODvertex= 0;
    -  qh GOODvertexp= NULL;
    -  qh IStracing= 0;
    -  qh KEEParea= False;
    -  qh KEEPmerge= False;
    -  qh KEEPminArea= REALmax;
    -  qh PRINTcentrums= False;
    -  qh PRINTcoplanar= False;
    -  qh PRINTdots= False;
    -  qh PRINTgood= False;
    -  qh PRINTinner= False;
    -  qh PRINTneighbors= False;
    -  qh PRINTnoplanes= False;
    -  qh PRINToptions1st= False;
    -  qh PRINTouter= False;
    -  qh PRINTprecision= True;
    -  qh PRINTridges= False;
    -  qh PRINTspheres= False;
    -  qh PRINTstatistics= False;
    -  qh PRINTsummary= False;
    -  qh PRINTtransparent= False;
    -  qh SPLITthresholds= False;
    -  qh TRACElevel= 0;
    -  qh TRInormals= False;
    -  qh USEstdout= False;
    -  qh VERIFYoutput= False;
    -  for (k=qh input_dim+1; k--; ) {  /* duplicated in qh_initqhull_buffers and qh_clear_ouputflags */
    -    qh lower_threshold[k]= -REALmax;
    -    qh upper_threshold[k]= REALmax;
    -    qh lower_bound[k]= -REALmax;
    -    qh upper_bound[k]= REALmax;
    -  }
    -
    -  for (i=0; i < qh_PRINTEND; i++) {
    -    qh PRINTout[i]= qh_PRINTnone;
    -  }
    -
    -  if (!qh qhull_commandsiz2)
    -      qh qhull_commandsiz2= (int)strlen(qh qhull_command); /* WARN64 */
    -  else {
    -      qh qhull_command[qh qhull_commandsiz2]= '\0';
    -  }
    -  if (!qh qhull_optionsiz2)
    -    qh qhull_optionsiz2= (int)strlen(qh qhull_options);  /* WARN64 */
    -  else {
    -    qh qhull_options[qh qhull_optionsiz2]= '\0';
    -    qh qhull_optionlen= qh_OPTIONline;  /* start a new line */
    -  }
    -} /* clear_outputflags */
    -
    -/*---------------------------------
    -
    -  qh_clock()
    -    return user CPU time in 100ths (qh_SECtick)
    -    only defined for qh_CLOCKtype == 2
    -
    -  notes:
    -    use first value to determine time 0
    -    from Stevens '92 8.15
    -*/
    -unsigned long qh_clock(void) {
    -
    -#if (qh_CLOCKtype == 2)
    -  struct tms time;
    -  static long clktck;  /* initialized first call */
    -  double ratio, cpu;
    -  unsigned long ticks;
    -
    -  if (!clktck) {
    -    if ((clktck= sysconf(_SC_CLK_TCK)) < 0) {
    -      qh_fprintf(qh ferr, 6030, "qhull internal error (qh_clock): sysconf() failed.  Use qh_CLOCKtype 1 in user.h\n");
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -  }
    -  if (times(&time) == -1) {
    -    qh_fprintf(qh ferr, 6031, "qhull internal error (qh_clock): times() failed.  Use qh_CLOCKtype 1 in user.h\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  ratio= qh_SECticks / (double)clktck;
    -  ticks= time.tms_utime * ratio;
    -  return ticks;
    -#else
    -  qh_fprintf(qh ferr, 6032, "qhull internal error (qh_clock): use qh_CLOCKtype 2 in user.h\n");
    -  qh_errexit(qh_ERRqhull, NULL, NULL); /* never returns */
    -  return 0;
    -#endif
    -} /* clock */
    -
    -/*---------------------------------
    -
    -  qh_freebuffers()
    -    free up global memory buffers
    -
    -  notes:
    -    must match qh_initbuffers()
    -*/
    -void qh_freebuffers(void) {
    -
    -  trace5((qh ferr, 5001, "qh_freebuffers: freeing up global memory buffers\n"));
    -  /* allocated by qh_initqhull_buffers */
    -  qh_memfree(qh NEARzero, qh hull_dim * sizeof(realT));
    -  qh_memfree(qh lower_threshold, (qh input_dim+1) * sizeof(realT));
    -  qh_memfree(qh upper_threshold, (qh input_dim+1) * sizeof(realT));
    -  qh_memfree(qh lower_bound, (qh input_dim+1) * sizeof(realT));
    -  qh_memfree(qh upper_bound, (qh input_dim+1) * sizeof(realT));
    -  qh_memfree(qh gm_matrix, (qh hull_dim+1) * qh hull_dim * sizeof(coordT));
    -  qh_memfree(qh gm_row, (qh hull_dim+1) * sizeof(coordT *));
    -  qh NEARzero= qh lower_threshold= qh upper_threshold= NULL;
    -  qh lower_bound= qh upper_bound= NULL;
    -  qh gm_matrix= NULL;
    -  qh gm_row= NULL;
    -  qh_setfree(&qh other_points);
    -  qh_setfree(&qh del_vertices);
    -  qh_setfree(&qh coplanarfacetset);
    -  if (qh line)                /* allocated by qh_readinput, freed if no error */
    -    qh_free(qh line);
    -  if (qh half_space)
    -    qh_free(qh half_space);
    -  if (qh temp_malloc)
    -    qh_free(qh temp_malloc);
    -  if (qh feasible_point)      /* allocated by qh_readfeasible */
    -    qh_free(qh feasible_point);
    -  if (qh feasible_string)     /* allocated by qh_initflags */
    -    qh_free(qh feasible_string);
    -  qh line= qh feasible_string= NULL;
    -  qh half_space= qh feasible_point= qh temp_malloc= NULL;
    -  /* usually allocated by qh_readinput */
    -  if (qh first_point && qh POINTSmalloc) {
    -    qh_free(qh first_point);
    -    qh first_point= NULL;
    -  }
    -  if (qh input_points && qh input_malloc) { /* set by qh_joggleinput */
    -    qh_free(qh input_points);
    -    qh input_points= NULL;
    -  }
    -  trace5((qh ferr, 5002, "qh_freebuffers: finished\n"));
    -} /* freebuffers */
    -
    -
    -/*---------------------------------
    -
    -  qh_freebuild( allmem )
    -    free global memory used by qh_initbuild and qh_buildhull
    -    if !allmem,
    -      does not free short memory (e.g., facetT, freed by qh_memfreeshort)
    -
    -  design:
    -    free centrums
    -    free each vertex
    -    mark unattached ridges
    -    for each facet
    -      free ridges
    -      free outside set, coplanar set, neighbor set, ridge set, vertex set
    -      free facet
    -    free hash table
    -    free interior point
    -    free merge set
    -    free temporary sets
    -*/
    -void qh_freebuild(boolT allmem) {
    -  facetT *facet;
    -  vertexT *vertex;
    -  ridgeT *ridge, **ridgep;
    -  mergeT *merge, **mergep;
    -
    -  trace1((qh ferr, 1005, "qh_freebuild: free memory from qh_inithull and qh_buildhull\n"));
    -  if (qh del_vertices)
    -    qh_settruncate(qh del_vertices, 0);
    -  if (allmem) {
    -    while ((vertex= qh vertex_list)) {
    -      if (vertex->next)
    -        qh_delvertex(vertex);
    -      else {
    -        qh_memfree(vertex, (int)sizeof(vertexT));
    -        qh newvertex_list= qh vertex_list= NULL;
    -      }
    -    }
    -  }else if (qh VERTEXneighbors) {
    -    FORALLvertices
    -      qh_setfreelong(&(vertex->neighbors));
    -  }
    -  qh VERTEXneighbors= False;
    -  qh GOODclosest= NULL;
    -  if (allmem) {
    -    FORALLfacets {
    -      FOREACHridge_(facet->ridges)
    -        ridge->seen= False;
    -    }
    -    FORALLfacets {
    -      if (facet->visible) {
    -        FOREACHridge_(facet->ridges) {
    -          if (!otherfacet_(ridge, facet)->visible)
    -            ridge->seen= True;  /* an unattached ridge */
    -        }
    -      }
    -    }
    -    while ((facet= qh facet_list)) {
    -      FOREACHridge_(facet->ridges) {
    -        if (ridge->seen) {
    -          qh_setfree(&(ridge->vertices));
    -          qh_memfree(ridge, (int)sizeof(ridgeT));
    -        }else
    -          ridge->seen= True;
    -      }
    -      qh_setfree(&(facet->outsideset));
    -      qh_setfree(&(facet->coplanarset));
    -      qh_setfree(&(facet->neighbors));
    -      qh_setfree(&(facet->ridges));
    -      qh_setfree(&(facet->vertices));
    -      if (facet->next)
    -        qh_delfacet(facet);
    -      else {
    -        qh_memfree(facet, (int)sizeof(facetT));
    -        qh visible_list= qh newfacet_list= qh facet_list= NULL;
    -      }
    -    }
    -  }else {
    -    FORALLfacets {
    -      qh_setfreelong(&(facet->outsideset));
    -      qh_setfreelong(&(facet->coplanarset));
    -      if (!facet->simplicial) {
    -        qh_setfreelong(&(facet->neighbors));
    -        qh_setfreelong(&(facet->ridges));
    -        qh_setfreelong(&(facet->vertices));
    -      }
    -    }
    -  }
    -  qh_setfree(&(qh hash_table));
    -  qh_memfree(qh interior_point, qh normal_size);
    -  qh interior_point= NULL;
    -  FOREACHmerge_(qh facet_mergeset)  /* usually empty */
    -    qh_memfree(merge, (int)sizeof(mergeT));
    -  qh facet_mergeset= NULL;  /* temp set */
    -  qh degen_mergeset= NULL;  /* temp set */
    -  qh_settempfree_all();
    -} /* freebuild */
    -
    -/*---------------------------------
    -
    -  qh_freeqhull( allmem )
    -    see qh_freeqhull2
    -    if qh_QHpointer, frees qh_qh
    -*/
    -void qh_freeqhull(boolT allmem) {
    -    qh_freeqhull2(allmem);
    -#if qh_QHpointer
    -    qh_free(qh_qh);
    -    qh_qh= NULL;
    -#endif
    -}
    -
    -/*---------------------------------
    -
    -qh_freeqhull2( allmem )
    -  free global memory
    -  if !allmem,
    -    does not free short memory (freed by qh_memfreeshort)
    -
    -notes:
    -  sets qh.NOerrexit in case caller forgets to
    -
    -see:
    -  see qh_initqhull_start2()
    -
    -design:
    -  free global and temporary memory from qh_initbuild and qh_buildhull
    -  free buffers
    -  free statistics
    -*/
    -void qh_freeqhull2(boolT allmem) {
    -
    -  trace1((qh ferr, 1006, "qh_freeqhull2: free global memory\n"));
    -  qh NOerrexit= True;  /* no more setjmp since called at exit and ~QhullQh */
    -  qh_freebuild(allmem);
    -  qh_freebuffers();
    -  qh_freestatistics();
    -#if qh_QHpointer
    -  memset((char *)qh_qh, 0, sizeof(qhT));
    -  /* qh_qh freed by caller, qh_freeqhull() */
    -#else
    -  memset((char *)&qh_qh, 0, sizeof(qhT));
    -#endif
    -  qh NOerrexit= True;
    -} /* freeqhull2 */
    -
    -/*---------------------------------
    -
    -  qh_init_A( infile, outfile, errfile, argc, argv )
    -    initialize memory and stdio files
    -    convert input options to option string (qh.qhull_command)
    -
    -  notes:
    -    infile may be NULL if qh_readpoints() is not called
    -
    -    errfile should always be defined.  It is used for reporting
    -    errors.  outfile is used for output and format options.
    -
    -    argc/argv may be 0/NULL
    -
    -    called before error handling initialized
    -    qh_errexit() may not be used
    -*/
    -void qh_init_A(FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[]) {
    -  qh_meminit(errfile);
    -  qh_initqhull_start(infile, outfile, errfile);
    -  qh_init_qhull_command(argc, argv);
    -} /* init_A */
    -
    -/*---------------------------------
    -
    -  qh_init_B( points, numpoints, dim, ismalloc )
    -    initialize globals for points array
    -
    -    points has numpoints dim-dimensional points
    -      points[0] is the first coordinate of the first point
    -      points[1] is the second coordinate of the first point
    -      points[dim] is the first coordinate of the second point
    -
    -    ismalloc=True
    -      Qhull will call qh_free(points) on exit or input transformation
    -    ismalloc=False
    -      Qhull will allocate a new point array if needed for input transformation
    -
    -    qh.qhull_command
    -      is the option string.
    -      It is defined by qh_init_B(), qh_qhull_command(), or qh_initflags
    -
    -  returns:
    -    if qh.PROJECTinput or (qh.DELAUNAY and qh.PROJECTdelaunay)
    -      projects the input to a new point array
    -
    -        if qh.DELAUNAY,
    -          qh.hull_dim is increased by one
    -        if qh.ATinfinity,
    -          qh_projectinput adds point-at-infinity for Delaunay tri.
    -
    -    if qh.SCALEinput
    -      changes the upper and lower bounds of the input, see qh_scaleinput()
    -
    -    if qh.ROTATEinput
    -      rotates the input by a random rotation, see qh_rotateinput()
    -      if qh.DELAUNAY
    -        rotates about the last coordinate
    -
    -  notes:
    -    called after points are defined
    -    qh_errexit() may be used
    -*/
    -void qh_init_B(coordT *points, int numpoints, int dim, boolT ismalloc) {
    -  qh_initqhull_globals(points, numpoints, dim, ismalloc);
    -  if (qhmem.LASTsize == 0)
    -    qh_initqhull_mem();
    -  /* mem.c and qset.c are initialized */
    -  qh_initqhull_buffers();
    -  qh_initthresholds(qh qhull_command);
    -  if (qh PROJECTinput || (qh DELAUNAY && qh PROJECTdelaunay))
    -    qh_projectinput();
    -  if (qh SCALEinput)
    -    qh_scaleinput();
    -  if (qh ROTATErandom >= 0) {
    -    qh_randommatrix(qh gm_matrix, qh hull_dim, qh gm_row);
    -    if (qh DELAUNAY) {
    -      int k, lastk= qh hull_dim-1;
    -      for (k=0; k < lastk; k++) {
    -        qh gm_row[k][lastk]= 0.0;
    -        qh gm_row[lastk][k]= 0.0;
    -      }
    -      qh gm_row[lastk][lastk]= 1.0;
    -    }
    -    qh_gram_schmidt(qh hull_dim, qh gm_row);
    -    qh_rotateinput(qh gm_row);
    -  }
    -} /* init_B */
    -
    -/*---------------------------------
    -
    -  qh_init_qhull_command( argc, argv )
    -    build qh.qhull_command from argc/argv
    -
    -  returns:
    -    a space-delimited string of options (just as typed)
    -
    -  notes:
    -    makes option string easy to input and output
    -
    -    argc/argv may be 0/NULL
    -*/
    -void qh_init_qhull_command(int argc, char *argv[]) {
    -
    -  if (!qh_argv_to_command(argc, argv, qh qhull_command, (int)sizeof(qh qhull_command))){
    -    /* Assumes qh.ferr is defined. */
    -    qh_fprintf(qh ferr, 6033, "qhull input error: more than %d characters in command line\n",
    -          (int)sizeof(qh qhull_command));
    -    qh_exit(qh_ERRinput);  /* error reported, can not use qh_errexit */
    -  }
    -} /* init_qhull_command */
    -
    -/*---------------------------------
    -
    -  qh_initflags( commandStr )
    -    set flags and initialized constants from commandStr
    -
    -  returns:
    -    sets qh.qhull_command to command if needed
    -
    -  notes:
    -    ignores first word (e.g., "qhull d")
    -    use qh_strtol/strtod since strtol/strtod may or may not skip trailing spaces
    -
    -  see:
    -    qh_initthresholds() continues processing of 'Pdn' and 'PDn'
    -    'prompt' in unix.c for documentation
    -
    -  design:
    -    for each space-deliminated option group
    -      if top-level option
    -        check syntax
    -        append approriate option to option string
    -        set appropriate global variable or append printFormat to print options
    -      else
    -        for each sub-option
    -          check syntax
    -          append approriate option to option string
    -          set appropriate global variable or append printFormat to print options
    -*/
    -void qh_initflags(char *command) {
    -  int k, i, lastproject;
    -  char *s= command, *t, *prev_s, *start, key;
    -  boolT isgeom= False, wasproject;
    -  realT r;
    -
    -  if (command <= &qh qhull_command[0] || command > &qh qhull_command[0] + sizeof(qh qhull_command)) {
    -    if (command != &qh qhull_command[0]) {
    -      *qh qhull_command= '\0';
    -      strncat(qh qhull_command, command, sizeof(qh qhull_command)-strlen(qh qhull_command)-1);
    -    }
    -    while (*s && !isspace(*s))  /* skip program name */
    -      s++;
    -  }
    -  while (*s) {
    -    while (*s && isspace(*s))
    -      s++;
    -    if (*s == '-')
    -      s++;
    -    if (!*s)
    -      break;
    -    prev_s= s;
    -    switch (*s++) {
    -    case 'd':
    -      qh_option("delaunay", NULL, NULL);
    -      qh DELAUNAY= True;
    -      break;
    -    case 'f':
    -      qh_option("facets", NULL, NULL);
    -      qh_appendprint(qh_PRINTfacets);
    -      break;
    -    case 'i':
    -      qh_option("incidence", NULL, NULL);
    -      qh_appendprint(qh_PRINTincidences);
    -      break;
    -    case 'm':
    -      qh_option("mathematica", NULL, NULL);
    -      qh_appendprint(qh_PRINTmathematica);
    -      break;
    -    case 'n':
    -      qh_option("normals", NULL, NULL);
    -      qh_appendprint(qh_PRINTnormals);
    -      break;
    -    case 'o':
    -      qh_option("offFile", NULL, NULL);
    -      qh_appendprint(qh_PRINToff);
    -      break;
    -    case 'p':
    -      qh_option("points", NULL, NULL);
    -      qh_appendprint(qh_PRINTpoints);
    -      break;
    -    case 's':
    -      qh_option("summary", NULL, NULL);
    -      qh PRINTsummary= True;
    -      break;
    -    case 'v':
    -      qh_option("voronoi", NULL, NULL);
    -      qh VORONOI= True;
    -      qh DELAUNAY= True;
    -      break;
    -    case 'A':
    -      if (!isdigit(*s) && *s != '.' && *s != '-')
    -        qh_fprintf(qh ferr, 7002, "qhull warning: no maximum cosine angle given for option 'An'.  Ignored.\n");
    -      else {
    -        if (*s == '-') {
    -          qh premerge_cos= -qh_strtod(s, &s);
    -          qh_option("Angle-premerge-", NULL, &qh premerge_cos);
    -          qh PREmerge= True;
    -        }else {
    -          qh postmerge_cos= qh_strtod(s, &s);
    -          qh_option("Angle-postmerge", NULL, &qh postmerge_cos);
    -          qh POSTmerge= True;
    -        }
    -        qh MERGING= True;
    -      }
    -      break;
    -    case 'C':
    -      if (!isdigit(*s) && *s != '.' && *s != '-')
    -        qh_fprintf(qh ferr, 7003, "qhull warning: no centrum radius given for option 'Cn'.  Ignored.\n");
    -      else {
    -        if (*s == '-') {
    -          qh premerge_centrum= -qh_strtod(s, &s);
    -          qh_option("Centrum-premerge-", NULL, &qh premerge_centrum);
    -          qh PREmerge= True;
    -        }else {
    -          qh postmerge_centrum= qh_strtod(s, &s);
    -          qh_option("Centrum-postmerge", NULL, &qh postmerge_centrum);
    -          qh POSTmerge= True;
    -        }
    -        qh MERGING= True;
    -      }
    -      break;
    -    case 'E':
    -      if (*s == '-')
    -        qh_fprintf(qh ferr, 7004, "qhull warning: negative maximum roundoff given for option 'An'.  Ignored.\n");
    -      else if (!isdigit(*s))
    -        qh_fprintf(qh ferr, 7005, "qhull warning: no maximum roundoff given for option 'En'.  Ignored.\n");
    -      else {
    -        qh DISTround= qh_strtod(s, &s);
    -        qh_option("Distance-roundoff", NULL, &qh DISTround);
    -        qh SETroundoff= True;
    -      }
    -      break;
    -    case 'H':
    -      start= s;
    -      qh HALFspace= True;
    -      qh_strtod(s, &t);
    -      while (t > s)  {
    -        if (*t && !isspace(*t)) {
    -          if (*t == ',')
    -            t++;
    -          else
    -            qh_fprintf(qh ferr, 7006, "qhull warning: origin for Halfspace intersection should be 'Hn,n,n,...'\n");
    -        }
    -        s= t;
    -        qh_strtod(s, &t);
    -      }
    -      if (start < t) {
    -        if (!(qh feasible_string= (char*)calloc((size_t)(t-start+1), (size_t)1))) {
    -          qh_fprintf(qh ferr, 6034, "qhull error: insufficient memory for 'Hn,n,n'\n");
    -          qh_errexit(qh_ERRmem, NULL, NULL);
    -        }
    -        strncpy(qh feasible_string, start, (size_t)(t-start));
    -        qh_option("Halfspace-about", NULL, NULL);
    -        qh_option(qh feasible_string, NULL, NULL);
    -      }else
    -        qh_option("Halfspace", NULL, NULL);
    -      break;
    -    case 'R':
    -      if (!isdigit(*s))
    -        qh_fprintf(qh ferr, 7007, "qhull warning: missing random perturbation for option 'Rn'.  Ignored\n");
    -      else {
    -        qh RANDOMfactor= qh_strtod(s, &s);
    -        qh_option("Random_perturb", NULL, &qh RANDOMfactor);
    -        qh RANDOMdist= True;
    -      }
    -      break;
    -    case 'V':
    -      if (!isdigit(*s) && *s != '-')
    -        qh_fprintf(qh ferr, 7008, "qhull warning: missing visible distance for option 'Vn'.  Ignored\n");
    -      else {
    -        qh MINvisible= qh_strtod(s, &s);
    -        qh_option("Visible", NULL, &qh MINvisible);
    -      }
    -      break;
    -    case 'U':
    -      if (!isdigit(*s) && *s != '-')
    -        qh_fprintf(qh ferr, 7009, "qhull warning: missing coplanar distance for option 'Un'.  Ignored\n");
    -      else {
    -        qh MAXcoplanar= qh_strtod(s, &s);
    -        qh_option("U-coplanar", NULL, &qh MAXcoplanar);
    -      }
    -      break;
    -    case 'W':
    -      if (*s == '-')
    -        qh_fprintf(qh ferr, 7010, "qhull warning: negative outside width for option 'Wn'.  Ignored.\n");
    -      else if (!isdigit(*s))
    -        qh_fprintf(qh ferr, 7011, "qhull warning: missing outside width for option 'Wn'.  Ignored\n");
    -      else {
    -        qh MINoutside= qh_strtod(s, &s);
    -        qh_option("W-outside", NULL, &qh MINoutside);
    -        qh APPROXhull= True;
    -      }
    -      break;
    -    /************  sub menus ***************/
    -    case 'F':
    -      while (*s && !isspace(*s)) {
    -        switch (*s++) {
    -        case 'a':
    -          qh_option("Farea", NULL, NULL);
    -          qh_appendprint(qh_PRINTarea);
    -          qh GETarea= True;
    -          break;
    -        case 'A':
    -          qh_option("FArea-total", NULL, NULL);
    -          qh GETarea= True;
    -          break;
    -        case 'c':
    -          qh_option("Fcoplanars", NULL, NULL);
    -          qh_appendprint(qh_PRINTcoplanars);
    -          break;
    -        case 'C':
    -          qh_option("FCentrums", NULL, NULL);
    -          qh_appendprint(qh_PRINTcentrums);
    -          break;
    -        case 'd':
    -          qh_option("Fd-cdd-in", NULL, NULL);
    -          qh CDDinput= True;
    -          break;
    -        case 'D':
    -          qh_option("FD-cdd-out", NULL, NULL);
    -          qh CDDoutput= True;
    -          break;
    -        case 'F':
    -          qh_option("FFacets-xridge", NULL, NULL);
    -          qh_appendprint(qh_PRINTfacets_xridge);
    -          break;
    -        case 'i':
    -          qh_option("Finner", NULL, NULL);
    -          qh_appendprint(qh_PRINTinner);
    -          break;
    -        case 'I':
    -          qh_option("FIDs", NULL, NULL);
    -          qh_appendprint(qh_PRINTids);
    -          break;
    -        case 'm':
    -          qh_option("Fmerges", NULL, NULL);
    -          qh_appendprint(qh_PRINTmerges);
    -          break;
    -        case 'M':
    -          qh_option("FMaple", NULL, NULL);
    -          qh_appendprint(qh_PRINTmaple);
    -          break;
    -        case 'n':
    -          qh_option("Fneighbors", NULL, NULL);
    -          qh_appendprint(qh_PRINTneighbors);
    -          break;
    -        case 'N':
    -          qh_option("FNeighbors-vertex", NULL, NULL);
    -          qh_appendprint(qh_PRINTvneighbors);
    -          break;
    -        case 'o':
    -          qh_option("Fouter", NULL, NULL);
    -          qh_appendprint(qh_PRINTouter);
    -          break;
    -        case 'O':
    -          if (qh PRINToptions1st) {
    -            qh_option("FOptions", NULL, NULL);
    -            qh_appendprint(qh_PRINToptions);
    -          }else
    -            qh PRINToptions1st= True;
    -          break;
    -        case 'p':
    -          qh_option("Fpoint-intersect", NULL, NULL);
    -          qh_appendprint(qh_PRINTpointintersect);
    -          break;
    -        case 'P':
    -          qh_option("FPoint-nearest", NULL, NULL);
    -          qh_appendprint(qh_PRINTpointnearest);
    -          break;
    -        case 'Q':
    -          qh_option("FQhull", NULL, NULL);
    -          qh_appendprint(qh_PRINTqhull);
    -          break;
    -        case 's':
    -          qh_option("Fsummary", NULL, NULL);
    -          qh_appendprint(qh_PRINTsummary);
    -          break;
    -        case 'S':
    -          qh_option("FSize", NULL, NULL);
    -          qh_appendprint(qh_PRINTsize);
    -          qh GETarea= True;
    -          break;
    -        case 't':
    -          qh_option("Ftriangles", NULL, NULL);
    -          qh_appendprint(qh_PRINTtriangles);
    -          break;
    -        case 'v':
    -          /* option set in qh_initqhull_globals */
    -          qh_appendprint(qh_PRINTvertices);
    -          break;
    -        case 'V':
    -          qh_option("FVertex-average", NULL, NULL);
    -          qh_appendprint(qh_PRINTaverage);
    -          break;
    -        case 'x':
    -          qh_option("Fxtremes", NULL, NULL);
    -          qh_appendprint(qh_PRINTextremes);
    -          break;
    -        default:
    -          s--;
    -          qh_fprintf(qh ferr, 7012, "qhull warning: unknown 'F' output option %c, rest ignored\n", (int)s[0]);
    -          while (*++s && !isspace(*s));
    -          break;
    -        }
    -      }
    -      break;
    -    case 'G':
    -      isgeom= True;
    -      qh_appendprint(qh_PRINTgeom);
    -      while (*s && !isspace(*s)) {
    -        switch (*s++) {
    -        case 'a':
    -          qh_option("Gall-points", NULL, NULL);
    -          qh PRINTdots= True;
    -          break;
    -        case 'c':
    -          qh_option("Gcentrums", NULL, NULL);
    -          qh PRINTcentrums= True;
    -          break;
    -        case 'h':
    -          qh_option("Gintersections", NULL, NULL);
    -          qh DOintersections= True;
    -          break;
    -        case 'i':
    -          qh_option("Ginner", NULL, NULL);
    -          qh PRINTinner= True;
    -          break;
    -        case 'n':
    -          qh_option("Gno-planes", NULL, NULL);
    -          qh PRINTnoplanes= True;
    -          break;
    -        case 'o':
    -          qh_option("Gouter", NULL, NULL);
    -          qh PRINTouter= True;
    -          break;
    -        case 'p':
    -          qh_option("Gpoints", NULL, NULL);
    -          qh PRINTcoplanar= True;
    -          break;
    -        case 'r':
    -          qh_option("Gridges", NULL, NULL);
    -          qh PRINTridges= True;
    -          break;
    -        case 't':
    -          qh_option("Gtransparent", NULL, NULL);
    -          qh PRINTtransparent= True;
    -          break;
    -        case 'v':
    -          qh_option("Gvertices", NULL, NULL);
    -          qh PRINTspheres= True;
    -          break;
    -        case 'D':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 6035, "qhull input error: missing dimension for option 'GDn'\n");
    -          else {
    -            if (qh DROPdim >= 0)
    -              qh_fprintf(qh ferr, 7013, "qhull warning: can only drop one dimension.  Previous 'GD%d' ignored\n",
    -                   qh DROPdim);
    -            qh DROPdim= qh_strtol(s, &s);
    -            qh_option("GDrop-dim", &qh DROPdim, NULL);
    -          }
    -          break;
    -        default:
    -          s--;
    -          qh_fprintf(qh ferr, 7014, "qhull warning: unknown 'G' print option %c, rest ignored\n", (int)s[0]);
    -          while (*++s && !isspace(*s));
    -          break;
    -        }
    -      }
    -      break;
    -    case 'P':
    -      while (*s && !isspace(*s)) {
    -        switch (*s++) {
    -        case 'd': case 'D':  /* see qh_initthresholds() */
    -          key= s[-1];
    -          i= qh_strtol(s, &s);
    -          r= 0;
    -          if (*s == ':') {
    -            s++;
    -            r= qh_strtod(s, &s);
    -          }
    -          if (key == 'd')
    -            qh_option("Pdrop-facets-dim-less", &i, &r);
    -          else
    -            qh_option("PDrop-facets-dim-more", &i, &r);
    -          break;
    -        case 'g':
    -          qh_option("Pgood-facets", NULL, NULL);
    -          qh PRINTgood= True;
    -          break;
    -        case 'G':
    -          qh_option("PGood-facet-neighbors", NULL, NULL);
    -          qh PRINTneighbors= True;
    -          break;
    -        case 'o':
    -          qh_option("Poutput-forced", NULL, NULL);
    -          qh FORCEoutput= True;
    -          break;
    -        case 'p':
    -          qh_option("Pprecision-ignore", NULL, NULL);
    -          qh PRINTprecision= False;
    -          break;
    -        case 'A':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 6036, "qhull input error: missing facet count for keep area option 'PAn'\n");
    -          else {
    -            qh KEEParea= qh_strtol(s, &s);
    -            qh_option("PArea-keep", &qh KEEParea, NULL);
    -            qh GETarea= True;
    -          }
    -          break;
    -        case 'F':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 6037, "qhull input error: missing facet area for option 'PFn'\n");
    -          else {
    -            qh KEEPminArea= qh_strtod(s, &s);
    -            qh_option("PFacet-area-keep", NULL, &qh KEEPminArea);
    -            qh GETarea= True;
    -          }
    -          break;
    -        case 'M':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 6038, "qhull input error: missing merge count for option 'PMn'\n");
    -          else {
    -            qh KEEPmerge= qh_strtol(s, &s);
    -            qh_option("PMerge-keep", &qh KEEPmerge, NULL);
    -          }
    -          break;
    -        default:
    -          s--;
    -          qh_fprintf(qh ferr, 7015, "qhull warning: unknown 'P' print option %c, rest ignored\n", (int)s[0]);
    -          while (*++s && !isspace(*s));
    -          break;
    -        }
    -      }
    -      break;
    -    case 'Q':
    -      lastproject= -1;
    -      while (*s && !isspace(*s)) {
    -        switch (*s++) {
    -        case 'b': case 'B':  /* handled by qh_initthresholds */
    -          key= s[-1];
    -          if (key == 'b' && *s == 'B') {
    -            s++;
    -            r= qh_DEFAULTbox;
    -            qh SCALEinput= True;
    -            qh_option("QbBound-unit-box", NULL, &r);
    -            break;
    -          }
    -          if (key == 'b' && *s == 'b') {
    -            s++;
    -            qh SCALElast= True;
    -            qh_option("Qbbound-last", NULL, NULL);
    -            break;
    -          }
    -          k= qh_strtol(s, &s);
    -          r= 0.0;
    -          wasproject= False;
    -          if (*s == ':') {
    -            s++;
    -            if ((r= qh_strtod(s, &s)) == 0.0) {
    -              t= s;            /* need true dimension for memory allocation */
    -              while (*t && !isspace(*t)) {
    -                if (toupper(*t++) == 'B'
    -                 && k == qh_strtol(t, &t)
    -                 && *t++ == ':'
    -                 && qh_strtod(t, &t) == 0.0) {
    -                  qh PROJECTinput++;
    -                  trace2((qh ferr, 2004, "qh_initflags: project dimension %d\n", k));
    -                  qh_option("Qb-project-dim", &k, NULL);
    -                  wasproject= True;
    -                  lastproject= k;
    -                  break;
    -                }
    -              }
    -            }
    -          }
    -          if (!wasproject) {
    -            if (lastproject == k && r == 0.0)
    -              lastproject= -1;  /* doesn't catch all possible sequences */
    -            else if (key == 'b') {
    -              qh SCALEinput= True;
    -              if (r == 0.0)
    -                r= -qh_DEFAULTbox;
    -              qh_option("Qbound-dim-low", &k, &r);
    -            }else {
    -              qh SCALEinput= True;
    -              if (r == 0.0)
    -                r= qh_DEFAULTbox;
    -              qh_option("QBound-dim-high", &k, &r);
    -            }
    -          }
    -          break;
    -        case 'c':
    -          qh_option("Qcoplanar-keep", NULL, NULL);
    -          qh KEEPcoplanar= True;
    -          break;
    -        case 'f':
    -          qh_option("Qfurthest-outside", NULL, NULL);
    -          qh BESToutside= True;
    -          break;
    -        case 'g':
    -          qh_option("Qgood-facets-only", NULL, NULL);
    -          qh ONLYgood= True;
    -          break;
    -        case 'i':
    -          qh_option("Qinterior-keep", NULL, NULL);
    -          qh KEEPinside= True;
    -          break;
    -        case 'm':
    -          qh_option("Qmax-outside-only", NULL, NULL);
    -          qh ONLYmax= True;
    -          break;
    -        case 'r':
    -          qh_option("Qrandom-outside", NULL, NULL);
    -          qh RANDOMoutside= True;
    -          break;
    -        case 's':
    -          qh_option("Qsearch-initial-simplex", NULL, NULL);
    -          qh ALLpoints= True;
    -          break;
    -        case 't':
    -          qh_option("Qtriangulate", NULL, NULL);
    -          qh TRIangulate= True;
    -          break;
    -        case 'T':
    -          qh_option("QTestPoints", NULL, NULL);
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 6039, "qhull input error: missing number of test points for option 'QTn'\n");
    -          else {
    -            qh TESTpoints= qh_strtol(s, &s);
    -            qh_option("QTestPoints", &qh TESTpoints, NULL);
    -          }
    -          break;
    -        case 'u':
    -          qh_option("QupperDelaunay", NULL, NULL);
    -          qh UPPERdelaunay= True;
    -          break;
    -        case 'v':
    -          qh_option("Qvertex-neighbors-convex", NULL, NULL);
    -          qh TESTvneighbors= True;
    -          break;
    -        case 'x':
    -          qh_option("Qxact-merge", NULL, NULL);
    -          qh MERGEexact= True;
    -          break;
    -        case 'z':
    -          qh_option("Qz-infinity-point", NULL, NULL);
    -          qh ATinfinity= True;
    -          break;
    -        case '0':
    -          qh_option("Q0-no-premerge", NULL, NULL);
    -          qh NOpremerge= True;
    -          break;
    -        case '1':
    -          if (!isdigit(*s)) {
    -            qh_option("Q1-no-angle-sort", NULL, NULL);
    -            qh ANGLEmerge= False;
    -            break;
    -          }
    -          switch (*s++) {
    -          case '0':
    -            qh_option("Q10-no-narrow", NULL, NULL);
    -            qh NOnarrow= True;
    -            break;
    -          case '1':
    -            qh_option("Q11-trinormals Qtriangulate", NULL, NULL);
    -            qh TRInormals= True;
    -            qh TRIangulate= True;
    -            break;
    -          default:
    -            s--;
    -            qh_fprintf(qh ferr, 7016, "qhull warning: unknown 'Q' qhull option 1%c, rest ignored\n", (int)s[0]);
    -            while (*++s && !isspace(*s));
    -            break;
    -          }
    -          break;
    -        case '2':
    -          qh_option("Q2-no-merge-independent", NULL, NULL);
    -          qh MERGEindependent= False;
    -          goto LABELcheckdigit;
    -          break; /* no warnings */
    -        case '3':
    -          qh_option("Q3-no-merge-vertices", NULL, NULL);
    -          qh MERGEvertices= False;
    -        LABELcheckdigit:
    -          if (isdigit(*s))
    -            qh_fprintf(qh ferr, 7017, "qhull warning: can not follow '1', '2', or '3' with a digit.  '%c' skipped.\n",
    -                     *s++);
    -          break;
    -        case '4':
    -          qh_option("Q4-avoid-old-into-new", NULL, NULL);
    -          qh AVOIDold= True;
    -          break;
    -        case '5':
    -          qh_option("Q5-no-check-outer", NULL, NULL);
    -          qh SKIPcheckmax= True;
    -          break;
    -        case '6':
    -          qh_option("Q6-no-concave-merge", NULL, NULL);
    -          qh SKIPconvex= True;
    -          break;
    -        case '7':
    -          qh_option("Q7-no-breadth-first", NULL, NULL);
    -          qh VIRTUALmemory= True;
    -          break;
    -        case '8':
    -          qh_option("Q8-no-near-inside", NULL, NULL);
    -          qh NOnearinside= True;
    -          break;
    -        case '9':
    -          qh_option("Q9-pick-furthest", NULL, NULL);
    -          qh PICKfurthest= True;
    -          break;
    -        case 'G':
    -          i= qh_strtol(s, &t);
    -          if (qh GOODpoint)
    -            qh_fprintf(qh ferr, 7018, "qhull warning: good point already defined for option 'QGn'.  Ignored\n");
    -          else if (s == t)
    -            qh_fprintf(qh ferr, 7019, "qhull warning: missing good point id for option 'QGn'.  Ignored\n");
    -          else if (i < 0 || *s == '-') {
    -            qh GOODpoint= i-1;
    -            qh_option("QGood-if-dont-see-point", &i, NULL);
    -          }else {
    -            qh GOODpoint= i+1;
    -            qh_option("QGood-if-see-point", &i, NULL);
    -          }
    -          s= t;
    -          break;
    -        case 'J':
    -          if (!isdigit(*s) && *s != '-')
    -            qh JOGGLEmax= 0.0;
    -          else {
    -            qh JOGGLEmax= (realT) qh_strtod(s, &s);
    -            qh_option("QJoggle", NULL, &qh JOGGLEmax);
    -          }
    -          break;
    -        case 'R':
    -          if (!isdigit(*s) && *s != '-')
    -            qh_fprintf(qh ferr, 7020, "qhull warning: missing random seed for option 'QRn'.  Ignored\n");
    -          else {
    -            qh ROTATErandom= i= qh_strtol(s, &s);
    -            if (i > 0)
    -              qh_option("QRotate-id", &i, NULL );
    -            else if (i < -1)
    -              qh_option("QRandom-seed", &i, NULL );
    -          }
    -          break;
    -        case 'V':
    -          i= qh_strtol(s, &t);
    -          if (qh GOODvertex)
    -            qh_fprintf(qh ferr, 7021, "qhull warning: good vertex already defined for option 'QVn'.  Ignored\n");
    -          else if (s == t)
    -            qh_fprintf(qh ferr, 7022, "qhull warning: no good point id given for option 'QVn'.  Ignored\n");
    -          else if (i < 0) {
    -            qh GOODvertex= i - 1;
    -            qh_option("QV-good-facets-not-point", &i, NULL);
    -          }else {
    -            qh_option("QV-good-facets-point", &i, NULL);
    -            qh GOODvertex= i + 1;
    -          }
    -          s= t;
    -          break;
    -        default:
    -          s--;
    -          qh_fprintf(qh ferr, 7023, "qhull warning: unknown 'Q' qhull option %c, rest ignored\n", (int)s[0]);
    -          while (*++s && !isspace(*s));
    -          break;
    -        }
    -      }
    -      break;
    -    case 'T':
    -      while (*s && !isspace(*s)) {
    -        if (isdigit(*s) || *s == '-')
    -          qh IStracing= qh_strtol(s, &s);
    -        else switch (*s++) {
    -        case 'a':
    -          qh_option("Tannotate-output", NULL, NULL);
    -          qh ANNOTATEoutput= True;
    -          break;
    -        case 'c':
    -          qh_option("Tcheck-frequently", NULL, NULL);
    -          qh CHECKfrequently= True;
    -          break;
    -        case 's':
    -          qh_option("Tstatistics", NULL, NULL);
    -          qh PRINTstatistics= True;
    -          break;
    -        case 'v':
    -          qh_option("Tverify", NULL, NULL);
    -          qh VERIFYoutput= True;
    -          break;
    -        case 'z':
    -          if (qh ferr == qh_FILEstderr) {
    -            /* The C++ interface captures the output in qh_fprint_qhull() */
    -            qh_option("Tz-stdout", NULL, NULL);
    -            qh USEstdout= True;
    -          }else if (!qh fout)
    -            qh_fprintf(qh ferr, 7024, "qhull warning: output file undefined(stdout).  Option 'Tz' ignored.\n");
    -          else {
    -            qh_option("Tz-stdout", NULL, NULL);
    -            qh USEstdout= True;
    -            qh ferr= qh fout;
    -            qhmem.ferr= qh fout;
    -          }
    -          break;
    -        case 'C':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7025, "qhull warning: missing point id for cone for trace option 'TCn'.  Ignored\n");
    -          else {
    -            i= qh_strtol(s, &s);
    -            qh_option("TCone-stop", &i, NULL);
    -            qh STOPcone= i + 1;
    -          }
    -          break;
    -        case 'F':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7026, "qhull warning: missing frequency count for trace option 'TFn'.  Ignored\n");
    -          else {
    -            qh REPORTfreq= qh_strtol(s, &s);
    -            qh_option("TFacet-log", &qh REPORTfreq, NULL);
    -            qh REPORTfreq2= qh REPORTfreq/2;  /* for tracemerging() */
    -          }
    -          break;
    -        case 'I':
    -          if (!isspace(*s))
    -            qh_fprintf(qh ferr, 7027, "qhull warning: missing space between 'TI' and filename, %s\n", s);
    -          while (isspace(*s))
    -            s++;
    -          t= qh_skipfilename(s);
    -          {
    -            char filename[qh_FILENAMElen];
    -
    -            qh_copyfilename(filename, (int)sizeof(filename), s, (int)(t-s));   /* WARN64 */
    -            s= t;
    -            if (!freopen(filename, "r", stdin)) {
    -              qh_fprintf(qh ferr, 6041, "qhull error: could not open file \"%s\".", filename);
    -              qh_errexit(qh_ERRinput, NULL, NULL);
    -            }else {
    -              qh_option("TInput-file", NULL, NULL);
    -              qh_option(filename, NULL, NULL);
    -            }
    -          }
    -          break;
    -        case 'O':
    -            if (!isspace(*s))
    -                qh_fprintf(qh ferr, 7028, "qhull warning: missing space between 'TO' and filename, %s\n", s);
    -            while (isspace(*s))
    -                s++;
    -            t= qh_skipfilename(s);
    -            {
    -              char filename[qh_FILENAMElen];
    -
    -              qh_copyfilename(filename, (int)sizeof(filename), s, (int)(t-s));  /* WARN64 */
    -              s= t;
    -              if (!freopen(filename, "w", stdout)) {
    -                qh_fprintf(qh ferr, 6044, "qhull error: could not open file \"%s\".", filename);
    -                qh_errexit(qh_ERRinput, NULL, NULL);
    -              }else {
    -                qh_option("TOutput-file", NULL, NULL);
    -              qh_option(filename, NULL, NULL);
    -            }
    -          }
    -          break;
    -        case 'P':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7029, "qhull warning: missing point id for trace option 'TPn'.  Ignored\n");
    -          else {
    -            qh TRACEpoint= qh_strtol(s, &s);
    -            qh_option("Trace-point", &qh TRACEpoint, NULL);
    -          }
    -          break;
    -        case 'M':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7030, "qhull warning: missing merge id for trace option 'TMn'.  Ignored\n");
    -          else {
    -            qh TRACEmerge= qh_strtol(s, &s);
    -            qh_option("Trace-merge", &qh TRACEmerge, NULL);
    -          }
    -          break;
    -        case 'R':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7031, "qhull warning: missing rerun count for trace option 'TRn'.  Ignored\n");
    -          else {
    -            qh RERUN= qh_strtol(s, &s);
    -            qh_option("TRerun", &qh RERUN, NULL);
    -          }
    -          break;
    -        case 'V':
    -          i= qh_strtol(s, &t);
    -          if (s == t)
    -            qh_fprintf(qh ferr, 7032, "qhull warning: missing furthest point id for trace option 'TVn'.  Ignored\n");
    -          else if (i < 0) {
    -            qh STOPpoint= i - 1;
    -            qh_option("TV-stop-before-point", &i, NULL);
    -          }else {
    -            qh STOPpoint= i + 1;
    -            qh_option("TV-stop-after-point", &i, NULL);
    -          }
    -          s= t;
    -          break;
    -        case 'W':
    -          if (!isdigit(*s))
    -            qh_fprintf(qh ferr, 7033, "qhull warning: missing max width for trace option 'TWn'.  Ignored\n");
    -          else {
    -            qh TRACEdist= (realT) qh_strtod(s, &s);
    -            qh_option("TWide-trace", NULL, &qh TRACEdist);
    -          }
    -          break;
    -        default:
    -          s--;
    -          qh_fprintf(qh ferr, 7034, "qhull warning: unknown 'T' trace option %c, rest ignored\n", (int)s[0]);
    -          while (*++s && !isspace(*s));
    -          break;
    -        }
    -      }
    -      break;
    -    default:
    -      qh_fprintf(qh ferr, 7035, "qhull warning: unknown flag %c(%x)\n", (int)s[-1],
    -               (int)s[-1]);
    -      break;
    -    }
    -    if (s-1 == prev_s && *s && !isspace(*s)) {
    -      qh_fprintf(qh ferr, 7036, "qhull warning: missing space after flag %c(%x); reserved for menu. Skipped.\n",
    -               (int)*prev_s, (int)*prev_s);
    -      while (*s && !isspace(*s))
    -        s++;
    -    }
    -  }
    -  if (qh STOPcone && qh JOGGLEmax < REALmax/2)
    -    qh_fprintf(qh ferr, 7078, "qhull warning: 'TCn' (stopCone) ignored when used with 'QJn' (joggle)\n");
    -  if (isgeom && !qh FORCEoutput && qh PRINTout[1])
    -    qh_fprintf(qh ferr, 7037, "qhull warning: additional output formats are not compatible with Geomview\n");
    -  /* set derived values in qh_initqhull_globals */
    -} /* initflags */
    -
    -
    -/*---------------------------------
    -
    -  qh_initqhull_buffers()
    -    initialize global memory buffers
    -
    -  notes:
    -    must match qh_freebuffers()
    -*/
    -void qh_initqhull_buffers(void) {
    -  int k;
    -
    -  qh TEMPsize= (qhmem.LASTsize - sizeof(setT))/SETelemsize;
    -  if (qh TEMPsize <= 0 || qh TEMPsize > qhmem.LASTsize)
    -    qh TEMPsize= 8;  /* e.g., if qh_NOmem */
    -  qh other_points= qh_setnew(qh TEMPsize);
    -  qh del_vertices= qh_setnew(qh TEMPsize);
    -  qh coplanarfacetset= qh_setnew(qh TEMPsize);
    -  qh NEARzero= (realT *)qh_memalloc(qh hull_dim * sizeof(realT));
    -  qh lower_threshold= (realT *)qh_memalloc((qh input_dim+1) * sizeof(realT));
    -  qh upper_threshold= (realT *)qh_memalloc((qh input_dim+1) * sizeof(realT));
    -  qh lower_bound= (realT *)qh_memalloc((qh input_dim+1) * sizeof(realT));
    -  qh upper_bound= (realT *)qh_memalloc((qh input_dim+1) * sizeof(realT));
    -  for (k=qh input_dim+1; k--; ) {  /* duplicated in qh_initqhull_buffers and qh_clear_ouputflags */
    -    qh lower_threshold[k]= -REALmax;
    -    qh upper_threshold[k]= REALmax;
    -    qh lower_bound[k]= -REALmax;
    -    qh upper_bound[k]= REALmax;
    -  }
    -  qh gm_matrix= (coordT *)qh_memalloc((qh hull_dim+1) * qh hull_dim * sizeof(coordT));
    -  qh gm_row= (coordT **)qh_memalloc((qh hull_dim+1) * sizeof(coordT *));
    -} /* initqhull_buffers */
    -
    -/*---------------------------------
    -
    -  qh_initqhull_globals( points, numpoints, dim, ismalloc )
    -    initialize globals
    -    if ismalloc
    -      points were malloc'd and qhull should free at end
    -
    -  returns:
    -    sets qh.first_point, num_points, input_dim, hull_dim and others
    -    seeds random number generator (seed=1 if tracing)
    -    modifies qh.hull_dim if ((qh.DELAUNAY and qh.PROJECTdelaunay) or qh.PROJECTinput)
    -    adjust user flags as needed
    -    also checks DIM3 dependencies and constants
    -
    -  notes:
    -    do not use qh_point() since an input transformation may move them elsewhere
    -
    -  see:
    -    qh_initqhull_start() sets default values for non-zero globals
    -
    -  design:
    -    initialize points array from input arguments
    -    test for qh.ZEROcentrum
    -      (i.e., use opposite vertex instead of cetrum for convexity testing)
    -    initialize qh.CENTERtype, qh.normal_size,
    -      qh.center_size, qh.TRACEpoint/level,
    -    initialize and test random numbers
    -    qh_initqhull_outputflags() -- adjust and test output flags
    -*/
    -void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc) {
    -  int seed, pointsneeded, extra= 0, i, randi, k;
    -  realT randr;
    -  realT factorial;
    -
    -  time_t timedata;
    -
    -  trace0((qh ferr, 13, "qh_initqhull_globals: for %s | %s\n", qh rbox_command,
    -      qh qhull_command));
    -  qh POINTSmalloc= ismalloc;
    -  qh first_point= points;
    -  qh num_points= numpoints;
    -  qh hull_dim= qh input_dim= dim;
    -  if (!qh NOpremerge && !qh MERGEexact && !qh PREmerge && qh JOGGLEmax > REALmax/2) {
    -    qh MERGING= True;
    -    if (qh hull_dim <= 4) {
    -      qh PREmerge= True;
    -      qh_option("_pre-merge", NULL, NULL);
    -    }else {
    -      qh MERGEexact= True;
    -      qh_option("Qxact_merge", NULL, NULL);
    -    }
    -  }else if (qh MERGEexact)
    -    qh MERGING= True;
    -  if (!qh NOpremerge && qh JOGGLEmax > REALmax/2) {
    -#ifdef qh_NOmerge
    -    qh JOGGLEmax= 0.0;
    -#endif
    -  }
    -  if (qh TRIangulate && qh JOGGLEmax < REALmax/2 && qh PRINTprecision)
    -    qh_fprintf(qh ferr, 7038, "qhull warning: joggle('QJ') always produces simplicial output.  Triangulated output('Qt') does nothing.\n");
    -  if (qh JOGGLEmax < REALmax/2 && qh DELAUNAY && !qh SCALEinput && !qh SCALElast) {
    -    qh SCALElast= True;
    -    qh_option("Qbbound-last-qj", NULL, NULL);
    -  }
    -  if (qh MERGING && !qh POSTmerge && qh premerge_cos > REALmax/2
    -  && qh premerge_centrum == 0) {
    -    qh ZEROcentrum= True;
    -    qh ZEROall_ok= True;
    -    qh_option("_zero-centrum", NULL, NULL);
    -  }
    -  if (qh JOGGLEmax < REALmax/2 && REALepsilon > 2e-8 && qh PRINTprecision)
    -    qh_fprintf(qh ferr, 7039, "qhull warning: real epsilon, %2.2g, is probably too large for joggle('QJn')\nRecompile with double precision reals(see user.h).\n",
    -          REALepsilon);
    -#ifdef qh_NOmerge
    -  if (qh MERGING) {
    -    qh_fprintf(qh ferr, 6045, "qhull input error: merging not installed(qh_NOmerge + 'Qx', 'Cn' or 'An')\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -#endif
    -  if (qh DELAUNAY && qh KEEPcoplanar && !qh KEEPinside) {
    -    qh KEEPinside= True;
    -    qh_option("Qinterior-keep", NULL, NULL);
    -  }
    -  if (qh DELAUNAY && qh HALFspace) {
    -    qh_fprintf(qh ferr, 6046, "qhull input error: can not use Delaunay('d') or Voronoi('v') with halfspace intersection('H')\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (!qh DELAUNAY && (qh UPPERdelaunay || qh ATinfinity)) {
    -    qh_fprintf(qh ferr, 6047, "qhull input error: use upper-Delaunay('Qu') or infinity-point('Qz') with Delaunay('d') or Voronoi('v')\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (qh UPPERdelaunay && qh ATinfinity) {
    -    qh_fprintf(qh ferr, 6048, "qhull input error: can not use infinity-point('Qz') with upper-Delaunay('Qu')\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (qh SCALElast && !qh DELAUNAY && qh PRINTprecision)
    -    qh_fprintf(qh ferr, 7040, "qhull input warning: option 'Qbb' (scale-last-coordinate) is normally used with 'd' or 'v'\n");
    -  qh DOcheckmax= (!qh SKIPcheckmax && qh MERGING );
    -  qh KEEPnearinside= (qh DOcheckmax && !(qh KEEPinside && qh KEEPcoplanar)
    -                          && !qh NOnearinside);
    -  if (qh MERGING)
    -    qh CENTERtype= qh_AScentrum;
    -  else if (qh VORONOI)
    -    qh CENTERtype= qh_ASvoronoi;
    -  if (qh TESTvneighbors && !qh MERGING) {
    -    qh_fprintf(qh ferr, 6049, "qhull input error: test vertex neighbors('Qv') needs a merge option\n");
    -    qh_errexit(qh_ERRinput, NULL ,NULL);
    -  }
    -  if (qh PROJECTinput || (qh DELAUNAY && qh PROJECTdelaunay)) {
    -    qh hull_dim -= qh PROJECTinput;
    -    if (qh DELAUNAY) {
    -      qh hull_dim++;
    -      if (qh ATinfinity)
    -        extra= 1;
    -    }
    -  }
    -  if (qh hull_dim <= 1) {
    -    qh_fprintf(qh ferr, 6050, "qhull error: dimension %d must be > 1\n", qh hull_dim);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  for (k=2, factorial=1.0; k < qh hull_dim; k++)
    -    factorial *= k;
    -  qh AREAfactor= 1.0 / factorial;
    -  trace2((qh ferr, 2005, "qh_initqhull_globals: initialize globals.  dim %d numpoints %d malloc? %d projected %d to hull_dim %d\n",
    -        dim, numpoints, ismalloc, qh PROJECTinput, qh hull_dim));
    -  qh normal_size= qh hull_dim * sizeof(coordT);
    -  qh center_size= qh normal_size - sizeof(coordT);
    -  pointsneeded= qh hull_dim+1;
    -  if (qh hull_dim > qh_DIMmergeVertex) {
    -    qh MERGEvertices= False;
    -    qh_option("Q3-no-merge-vertices-dim-high", NULL, NULL);
    -  }
    -  if (qh GOODpoint)
    -    pointsneeded++;
    -#ifdef qh_NOtrace
    -  if (qh IStracing) {
    -    qh_fprintf(qh ferr, 6051, "qhull input error: tracing is not installed(qh_NOtrace in user.h)");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -#endif
    -  if (qh RERUN > 1) {
    -    qh TRACElastrun= qh IStracing; /* qh_build_withrestart duplicates next conditional */
    -    if (qh IStracing != -1)
    -      qh IStracing= 0;
    -  }else if (qh TRACEpoint != -1 || qh TRACEdist < REALmax/2 || qh TRACEmerge) {
    -    qh TRACElevel= (qh IStracing? qh IStracing : 3);
    -    qh IStracing= 0;
    -  }
    -  if (qh ROTATErandom == 0 || qh ROTATErandom == -1) {
    -    seed= (int)time(&timedata);
    -    if (qh ROTATErandom  == -1) {
    -      seed= -seed;
    -      qh_option("QRandom-seed", &seed, NULL );
    -    }else
    -      qh_option("QRotate-random", &seed, NULL);
    -    qh ROTATErandom= seed;
    -  }
    -  seed= qh ROTATErandom;
    -  if (seed == INT_MIN)    /* default value */
    -    seed= 1;
    -  else if (seed < 0)
    -    seed= -seed;
    -  qh_RANDOMseed_(seed);
    -  randr= 0.0;
    -  for (i=1000; i--; ) {
    -    randi= qh_RANDOMint;
    -    randr += randi;
    -    if (randi > qh_RANDOMmax) {
    -      qh_fprintf(qh ferr, 8036, "\
    -qhull configuration error (qh_RANDOMmax in user.h):\n\
    -   random integer %d > qh_RANDOMmax(%.8g)\n",
    -               randi, qh_RANDOMmax);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -  }
    -  qh_RANDOMseed_(seed);
    -  randr = randr/1000;
    -  if (randr < qh_RANDOMmax * 0.1
    -  || randr > qh_RANDOMmax * 0.9)
    -    qh_fprintf(qh ferr, 8037, "\
    -qhull configuration warning (qh_RANDOMmax in user.h):\n\
    -   average of 1000 random integers (%.2g) is much different than expected (%.2g).\n\
    -   Is qh_RANDOMmax (%.2g) wrong?\n",
    -             randr, qh_RANDOMmax * 0.5, qh_RANDOMmax);
    -  qh RANDOMa= 2.0 * qh RANDOMfactor/qh_RANDOMmax;
    -  qh RANDOMb= 1.0 - qh RANDOMfactor;
    -  if (qh_HASHfactor < 1.1) {
    -    qh_fprintf(qh ferr, 6052, "qhull internal error (qh_initqhull_globals): qh_HASHfactor %d must be at least 1.1.  Qhull uses linear hash probing\n",
    -      qh_HASHfactor);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  if (numpoints+extra < pointsneeded) {
    -    qh_fprintf(qh ferr, 6214, "qhull input error: not enough points(%d) to construct initial simplex (need %d)\n",
    -            numpoints, pointsneeded);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  qh_initqhull_outputflags();
    -} /* initqhull_globals */
    -
    -/*---------------------------------
    -
    -  qh_initqhull_mem(  )
    -    initialize mem.c for qhull
    -    qh.hull_dim and qh.normal_size determine some of the allocation sizes
    -    if qh.MERGING,
    -      includes ridgeT
    -    calls qh_user_memsizes() to add up to 10 additional sizes for quick allocation
    -      (see numsizes below)
    -
    -  returns:
    -    mem.c already for qh_memalloc/qh_memfree (errors if called beforehand)
    -
    -  notes:
    -    qh_produceoutput() prints memsizes
    -
    -*/
    -void qh_initqhull_mem(void) {
    -  int numsizes;
    -  int i;
    -
    -  numsizes= 8+10;
    -  qh_meminitbuffers(qh IStracing, qh_MEMalign, numsizes,
    -                     qh_MEMbufsize,qh_MEMinitbuf);
    -  qh_memsize((int)sizeof(vertexT));
    -  if (qh MERGING) {
    -    qh_memsize((int)sizeof(ridgeT));
    -    qh_memsize((int)sizeof(mergeT));
    -  }
    -  qh_memsize((int)sizeof(facetT));
    -  i= sizeof(setT) + (qh hull_dim - 1) * SETelemsize;  /* ridge.vertices */
    -  qh_memsize(i);
    -  qh_memsize(qh normal_size);        /* normal */
    -  i += SETelemsize;                 /* facet.vertices, .ridges, .neighbors */
    -  qh_memsize(i);
    -  qh_user_memsizes();
    -  qh_memsetup();
    -} /* initqhull_mem */
    -
    -/*---------------------------------
    -
    -  qh_initqhull_outputflags
    -    initialize flags concerned with output
    -
    -  returns:
    -    adjust user flags as needed
    -
    -  see:
    -    qh_clear_outputflags() resets the flags
    -
    -  design:
    -    test for qh.PRINTgood (i.e., only print 'good' facets)
    -    check for conflicting print output options
    -*/
    -void qh_initqhull_outputflags(void) {
    -  boolT printgeom= False, printmath= False, printcoplanar= False;
    -  int i;
    -
    -  trace3((qh ferr, 3024, "qh_initqhull_outputflags: %s\n", qh qhull_command));
    -  if (!(qh PRINTgood || qh PRINTneighbors)) {
    -    if (qh KEEParea || qh KEEPminArea < REALmax/2 || qh KEEPmerge || qh DELAUNAY
    -        || (!qh ONLYgood && (qh GOODvertex || qh GOODpoint))) {
    -      qh PRINTgood= True;
    -      qh_option("Pgood", NULL, NULL);
    -    }
    -  }
    -  if (qh PRINTtransparent) {
    -    if (qh hull_dim != 4 || !qh DELAUNAY || qh VORONOI || qh DROPdim >= 0) {
    -      qh_fprintf(qh ferr, 6215, "qhull input error: transparent Delaunay('Gt') needs 3-d Delaunay('d') w/o 'GDn'\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    qh DROPdim = 3;
    -    qh PRINTridges = True;
    -  }
    -  for (i=qh_PRINTEND; i--; ) {
    -    if (qh PRINTout[i] == qh_PRINTgeom)
    -      printgeom= True;
    -    else if (qh PRINTout[i] == qh_PRINTmathematica || qh PRINTout[i] == qh_PRINTmaple)
    -      printmath= True;
    -    else if (qh PRINTout[i] == qh_PRINTcoplanars)
    -      printcoplanar= True;
    -    else if (qh PRINTout[i] == qh_PRINTpointnearest)
    -      printcoplanar= True;
    -    else if (qh PRINTout[i] == qh_PRINTpointintersect && !qh HALFspace) {
    -      qh_fprintf(qh ferr, 6053, "qhull input error: option 'Fp' is only used for \nhalfspace intersection('Hn,n,n').\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }else if (qh PRINTout[i] == qh_PRINTtriangles && (qh HALFspace || qh VORONOI)) {
    -      qh_fprintf(qh ferr, 6054, "qhull input error: option 'Ft' is not available for Voronoi vertices or halfspace intersection\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }else if (qh PRINTout[i] == qh_PRINTcentrums && qh VORONOI) {
    -      qh_fprintf(qh ferr, 6055, "qhull input error: option 'FC' is not available for Voronoi vertices('v')\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }else if (qh PRINTout[i] == qh_PRINTvertices) {
    -      if (qh VORONOI)
    -        qh_option("Fvoronoi", NULL, NULL);
    -      else
    -        qh_option("Fvertices", NULL, NULL);
    -    }
    -  }
    -  if (printcoplanar && qh DELAUNAY && qh JOGGLEmax < REALmax/2) {
    -    if (qh PRINTprecision)
    -      qh_fprintf(qh ferr, 7041, "qhull input warning: 'QJ' (joggle) will usually prevent coincident input sites for options 'Fc' and 'FP'\n");
    -  }
    -  if (printmath && (qh hull_dim > 3 || qh VORONOI)) {
    -    qh_fprintf(qh ferr, 6056, "qhull input error: Mathematica and Maple output is only available for 2-d and 3-d convex hulls and 2-d Delaunay triangulations\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (printgeom) {
    -    if (qh hull_dim > 4) {
    -      qh_fprintf(qh ferr, 6057, "qhull input error: Geomview output is only available for 2-d, 3-d and 4-d\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    if (qh PRINTnoplanes && !(qh PRINTcoplanar + qh PRINTcentrums
    -     + qh PRINTdots + qh PRINTspheres + qh DOintersections + qh PRINTridges)) {
    -      qh_fprintf(qh ferr, 6058, "qhull input error: no output specified for Geomview\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    if (qh VORONOI && (qh hull_dim > 3 || qh DROPdim >= 0)) {
    -      qh_fprintf(qh ferr, 6059, "qhull input error: Geomview output for Voronoi diagrams only for 2-d\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    /* can not warn about furthest-site Geomview output: no lower_threshold */
    -    if (qh hull_dim == 4 && qh DROPdim == -1 &&
    -        (qh PRINTcoplanar || qh PRINTspheres || qh PRINTcentrums)) {
    -      qh_fprintf(qh ferr, 7042, "qhull input warning: coplanars, vertices, and centrums output not\n\
    -available for 4-d output(ignored).  Could use 'GDn' instead.\n");
    -      qh PRINTcoplanar= qh PRINTspheres= qh PRINTcentrums= False;
    -    }
    -  }
    -  if (!qh KEEPcoplanar && !qh KEEPinside && !qh ONLYgood) {
    -    if ((qh PRINTcoplanar && qh PRINTspheres) || printcoplanar) {
    -      if (qh QHULLfinished) {
    -        qh_fprintf(qh ferr, 7072, "qhull output warning: ignoring coplanar points, option 'Qc' was not set for the first run of qhull.\n");
    -      }else {
    -        qh KEEPcoplanar = True;
    -        qh_option("Qcoplanar", NULL, NULL);
    -      }
    -    }
    -  }
    -  qh PRINTdim= qh hull_dim;
    -  if (qh DROPdim >=0) {    /* after Geomview checks */
    -    if (qh DROPdim < qh hull_dim) {
    -      qh PRINTdim--;
    -      if (!printgeom || qh hull_dim < 3)
    -        qh_fprintf(qh ferr, 7043, "qhull input warning: drop dimension 'GD%d' is only available for 3-d/4-d Geomview\n", qh DROPdim);
    -    }else
    -      qh DROPdim= -1;
    -  }else if (qh VORONOI) {
    -    qh DROPdim= qh hull_dim-1;
    -    qh PRINTdim= qh hull_dim-1;
    -  }
    -} /* qh_initqhull_outputflags */
    -
    -/*---------------------------------
    -
    -  qh_initqhull_start( infile, outfile, errfile )
    -    allocate memory if needed and call qh_initqhull_start2()
    -*/
    -void qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile) {
    -
    -#if qh_QHpointer
    -  if (qh_qh) {
    -    qh_fprintf(errfile, 6205, "qhull error (qh_initqhull_start): qh_qh already defined.  Call qh_save_qhull() first\n");
    -    qh_exit(qh_ERRqhull);  /* no error handler */
    -  }
    -  if (!(qh_qh= (qhT *)qh_malloc(sizeof(qhT)))) {
    -    qh_fprintf(errfile, 6060, "qhull error (qh_initqhull_start): insufficient memory\n");
    -    qh_exit(qh_ERRmem);  /* no error handler */
    -  }
    -#endif
    -  qh_initstatistics();
    -  qh_initqhull_start2(infile, outfile, errfile);
    -} /* initqhull_start */
    -
    -/*---------------------------------
    -
    -  qh_initqhull_start2( infile, outfile, errfile )
    -    start initialization of qhull
    -    initialize statistics, stdio, default values for global variables
    -    assumes qh_qh is defined
    -  notes:
    -    report errors elsewhere, error handling and g_qhull_output [Qhull.cpp, QhullQh()] not in initialized
    -  see:
    -    qh_maxmin() determines the precision constants
    -    qh_freeqhull2()
    -*/
    -void qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile) {
    -  time_t timedata;
    -  int seed;
    -
    -  qh_CPUclock; /* start the clock(for qh_clock).  One-shot. */
    -#if qh_QHpointer
    -  memset((char *)qh_qh, 0, sizeof(qhT));   /* every field is 0, FALSE, NULL */
    -#else
    -  memset((char *)&qh_qh, 0, sizeof(qhT));
    -#endif
    -  qh ANGLEmerge= True;
    -  qh DROPdim= -1;
    -  qh ferr= errfile;
    -  qh fin= infile;
    -  qh fout= outfile;
    -  qh furthest_id= -1;
    -  qh JOGGLEmax= REALmax;
    -  qh KEEPminArea = REALmax;
    -  qh last_low= REALmax;
    -  qh last_high= REALmax;
    -  qh last_newhigh= REALmax;
    -  qh max_outside= 0.0;
    -  qh max_vertex= 0.0;
    -  qh MAXabs_coord= 0.0;
    -  qh MAXsumcoord= 0.0;
    -  qh MAXwidth= -REALmax;
    -  qh MERGEindependent= True;
    -  qh MINdenom_1= fmax_(1.0/REALmax, REALmin); /* used by qh_scalepoints */
    -  qh MINoutside= 0.0;
    -  qh MINvisible= REALmax;
    -  qh MAXcoplanar= REALmax;
    -  qh outside_err= REALmax;
    -  qh premerge_centrum= 0.0;
    -  qh premerge_cos= REALmax;
    -  qh PRINTprecision= True;
    -  qh PRINTradius= 0.0;
    -  qh postmerge_cos= REALmax;
    -  qh postmerge_centrum= 0.0;
    -  qh ROTATErandom= INT_MIN;
    -  qh MERGEvertices= True;
    -  qh totarea= 0.0;
    -  qh totvol= 0.0;
    -  qh TRACEdist= REALmax;
    -  qh TRACEpoint= -1; /* recompile or use 'TPn' */
    -  qh tracefacet_id= UINT_MAX;  /* recompile to trace a facet */
    -  qh tracevertex_id= UINT_MAX; /* recompile to trace a vertex */
    -  seed= (int)time(&timedata);
    -  qh_RANDOMseed_(seed);
    -  qh run_id= qh_RANDOMint+1; /* disallow 0 [UsingLibQhull::NOqhRunId] */
    -  qh_option("run-id", &qh run_id, NULL);
    -  strcat(qh qhull, "qhull");
    -} /* initqhull_start2 */
    -
    -/*---------------------------------
    -
    -  qh_initthresholds( commandString )
    -    set thresholds for printing and scaling from commandString
    -
    -  returns:
    -    sets qh.GOODthreshold or qh.SPLITthreshold if 'Pd0D1' used
    -
    -  see:
    -    qh_initflags(), 'Qbk' 'QBk' 'Pdk' and 'PDk'
    -    qh_inthresholds()
    -
    -  design:
    -    for each 'Pdn' or 'PDn' option
    -      check syntax
    -      set qh.lower_threshold or qh.upper_threshold
    -    set qh.GOODthreshold if an unbounded threshold is used
    -    set qh.SPLITthreshold if a bounded threshold is used
    -*/
    -void qh_initthresholds(char *command) {
    -  realT value;
    -  int idx, maxdim, k;
    -  char *s= command; /* non-const due to strtol */
    -  char key;
    -
    -  maxdim= qh input_dim;
    -  if (qh DELAUNAY && (qh PROJECTdelaunay || qh PROJECTinput))
    -    maxdim++;
    -  while (*s) {
    -    if (*s == '-')
    -      s++;
    -    if (*s == 'P') {
    -      s++;
    -      while (*s && !isspace(key= *s++)) {
    -        if (key == 'd' || key == 'D') {
    -          if (!isdigit(*s)) {
    -            qh_fprintf(qh ferr, 7044, "qhull warning: no dimension given for Print option '%c' at: %s.  Ignored\n",
    -                    key, s-1);
    -            continue;
    -          }
    -          idx= qh_strtol(s, &s);
    -          if (idx >= qh hull_dim) {
    -            qh_fprintf(qh ferr, 7045, "qhull warning: dimension %d for Print option '%c' is >= %d.  Ignored\n",
    -                idx, key, qh hull_dim);
    -            continue;
    -          }
    -          if (*s == ':') {
    -            s++;
    -            value= qh_strtod(s, &s);
    -            if (fabs((double)value) > 1.0) {
    -              qh_fprintf(qh ferr, 7046, "qhull warning: value %2.4g for Print option %c is > +1 or < -1.  Ignored\n",
    -                      value, key);
    -              continue;
    -            }
    -          }else
    -            value= 0.0;
    -          if (key == 'd')
    -            qh lower_threshold[idx]= value;
    -          else
    -            qh upper_threshold[idx]= value;
    -        }
    -      }
    -    }else if (*s == 'Q') {
    -      s++;
    -      while (*s && !isspace(key= *s++)) {
    -        if (key == 'b' && *s == 'B') {
    -          s++;
    -          for (k=maxdim; k--; ) {
    -            qh lower_bound[k]= -qh_DEFAULTbox;
    -            qh upper_bound[k]= qh_DEFAULTbox;
    -          }
    -        }else if (key == 'b' && *s == 'b')
    -          s++;
    -        else if (key == 'b' || key == 'B') {
    -          if (!isdigit(*s)) {
    -            qh_fprintf(qh ferr, 7047, "qhull warning: no dimension given for Qhull option %c.  Ignored\n",
    -                    key);
    -            continue;
    -          }
    -          idx= qh_strtol(s, &s);
    -          if (idx >= maxdim) {
    -            qh_fprintf(qh ferr, 7048, "qhull warning: dimension %d for Qhull option %c is >= %d.  Ignored\n",
    -                idx, key, maxdim);
    -            continue;
    -          }
    -          if (*s == ':') {
    -            s++;
    -            value= qh_strtod(s, &s);
    -          }else if (key == 'b')
    -            value= -qh_DEFAULTbox;
    -          else
    -            value= qh_DEFAULTbox;
    -          if (key == 'b')
    -            qh lower_bound[idx]= value;
    -          else
    -            qh upper_bound[idx]= value;
    -        }
    -      }
    -    }else {
    -      while (*s && !isspace(*s))
    -        s++;
    -    }
    -    while (isspace(*s))
    -      s++;
    -  }
    -  for (k=qh hull_dim; k--; ) {
    -    if (qh lower_threshold[k] > -REALmax/2) {
    -      qh GOODthreshold= True;
    -      if (qh upper_threshold[k] < REALmax/2) {
    -        qh SPLITthresholds= True;
    -        qh GOODthreshold= False;
    -        break;
    -      }
    -    }else if (qh upper_threshold[k] < REALmax/2)
    -      qh GOODthreshold= True;
    -  }
    -} /* initthresholds */
    -
    -/*---------------------------------
    -
    -  qh_option( option, intVal, realVal )
    -    add an option description to qh.qhull_options
    -
    -  notes:
    -    NOerrors -- qh_option can not call qh_errexit() [qh_initqhull_start2]
    -    will be printed with statistics ('Ts') and errors
    -    strlen(option) < 40
    -*/
    -void qh_option(const char *option, int *i, realT *r) {
    -  char buf[200];
    -  int len, maxlen;
    -
    -  sprintf(buf, "  %s", option);
    -  if (i)
    -    sprintf(buf+strlen(buf), " %d", *i);
    -  if (r)
    -    sprintf(buf+strlen(buf), " %2.2g", *r);
    -  len= (int)strlen(buf);  /* WARN64 */
    -  qh qhull_optionlen += len;
    -  maxlen= sizeof(qh qhull_options) - len -1;
    -  maximize_(maxlen, 0);
    -  if (qh qhull_optionlen >= qh_OPTIONline && maxlen > 0) {
    -    qh qhull_optionlen= len;
    -    strncat(qh qhull_options, "\n", (size_t)(maxlen--));
    -  }
    -  strncat(qh qhull_options, buf, (size_t)maxlen);
    -} /* option */
    -
    -#if qh_QHpointer
    -/*---------------------------------
    -
    -  qh_restore_qhull( oldqh )
    -    restores a previously saved qhull
    -    also restores qh_qhstat and qhmem.tempstack
    -    Sets *oldqh to NULL
    -  notes:
    -    errors if current qhull hasn't been saved or freed
    -    uses qhmem for error reporting
    -
    -  NOTE 1998/5/11:
    -    Freeing memory after qh_save_qhull and qh_restore_qhull
    -    is complicated.  The procedures will be redesigned.
    -
    -  see:
    -    qh_save_qhull(), UsingLibQhull
    -*/
    -void qh_restore_qhull(qhT **oldqh) {
    -
    -  if (*oldqh && strcmp((*oldqh)->qhull, "qhull")) {
    -    qh_fprintf(qhmem.ferr, 6061, "qhull internal error (qh_restore_qhull): %p is not a qhull data structure\n",
    -                  *oldqh);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  if (qh_qh) {
    -    qh_fprintf(qhmem.ferr, 6062, "qhull internal error (qh_restore_qhull): did not save or free existing qhull\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  if (!*oldqh || !(*oldqh)->old_qhstat) {
    -    qh_fprintf(qhmem.ferr, 6063, "qhull internal error (qh_restore_qhull): did not previously save qhull %p\n",
    -                  *oldqh);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  qh_qh= *oldqh;
    -  *oldqh= NULL;
    -  qh_qhstat= qh old_qhstat;
    -  qhmem.tempstack= qh old_tempstack;
    -  qh old_qhstat= 0;
    -  qh old_tempstack= 0;
    -  trace1((qh ferr, 1007, "qh_restore_qhull: restored qhull from %p\n", *oldqh));
    -} /* restore_qhull */
    -
    -/*---------------------------------
    -
    -  qh_save_qhull(  )
    -    saves qhull for a later qh_restore_qhull
    -    also saves qh_qhstat and qhmem.tempstack
    -
    -  returns:
    -    qh_qh=NULL
    -
    -  notes:
    -    need to initialize qhull or call qh_restore_qhull before continuing
    -
    -  NOTE 1998/5/11:
    -    Freeing memory after qh_save_qhull and qh_restore_qhull
    -    is complicated.  The procedures will be redesigned.
    -
    -  see:
    -    qh_restore_qhull()
    -*/
    -qhT *qh_save_qhull(void) {
    -  qhT *oldqh;
    -
    -  trace1((qhmem.ferr, 1045, "qh_save_qhull: save qhull %p\n", qh_qh));
    -  if (!qh_qh) {
    -    qh_fprintf(qhmem.ferr, 6064, "qhull internal error (qh_save_qhull): qhull not initialized\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  qh old_qhstat= qh_qhstat;
    -  qh_qhstat= NULL;
    -  qh old_tempstack= qhmem.tempstack;
    -  qhmem.tempstack= NULL;
    -  oldqh= qh_qh;
    -  qh_qh= NULL;
    -  return oldqh;
    -} /* save_qhull */
    -
    -#endif
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/index.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/index.htm
    deleted file mode 100644
    index b9ca9d0ed3..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/index.htm
    +++ /dev/null
    @@ -1,248 +0,0 @@
    -
    -
    -
    -
    -Qhull functions, macros, and data structures
    -
    -
    -
    -
    -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code
    -To: Qhull files
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser - -


    - - -

    Qhull functions, macros, and data structures

    -
    -

    The following sections provide an overview and index to -Qhull's functions, macros, and data structures. Each -section starts with an introduction. If you use Opera, the source code links back to this documentation. -See also Calling -Qhull from C programs and Calling Qhull from C++ programs.

    - -

    Qhull uses the following conventions:

    -
    - -
      -
    • in code, global variables start with "qh " -
    • in documentation, global variables start with 'qh.' -
    • constants start with an upper case word -
    • important globals include an '_' -
    • functions, macros, and constants start with "qh_"
    • -
    • data types end in "T"
    • -
    • macros with arguments end in "_"
    • -
    • iterators are macros that use local variables
    • -
    • iterators for sets start with "FOREACH"
    • -
    • iterators for lists start with "FORALL"
    • -
    • qhull options are in single quotes (e.g., 'Pdn')
    • -
    • lists are sorted alphabetically
    • -
    • preprocessor directives on left margin for older compilers
    • -
    -
    -

    -When reading the code, please note that the -global data structure, 'qh', is a macro. It -either expands to "qh_qh." or to -"qh_qh->". The later is used for -applications which run concurrent calls to qh_qhull(). -

    -When reading code with an editor, a search for -"procedure -will locate the header of qh_procedure. A search for * procedure -will locate the tail of qh_procedure. - -

    A useful starting point is libqhull.h. It defines most -of Qhull data structures and top-level functions. Search for 'PFn' to -determine the corresponding constant in Qhull. Search for 'Fp' to -determine the corresponding qh_PRINT... constant. -Search io.c to learn how the print function is implemented.

    - -

    If your web browser loads .c and .h files with an external application, -change the MIME type of .c and .h files to "text/html". -Opera does not always work since it treats '<' characters as HTML tags. -

    -Please report documentation and link errors -to qhull-bug@qhull.org. -

    - -

    Copyright © 1997-2012 C.B. Barber

    - -
    - -

    »Qhull files

    -
    - -

    This sections lists the .c and .h files for Qhull. Please -refer to these files for detailed information.

    -
    - -
    -
    Makefile, CMakeLists.txt
    -
    Makefile is preconfigured for gcc. CMakeLists.txt supports multiple -platforms with CMake. -Qhull includes project files for Visual Studio and Qt. -
    - -
     
    -
    libqhull.h
    -
    Include file for the Qhull library (libqhull.so, qhull.dll, libqhullstatic.a). -Data structures are documented under Poly. -Global variables are documented under Global. -Other data structures and variables are documented under -Qhull or Geom.
    - -
     
    -
    Geom, -geom.h, -geom.c, -geom2.c, -random.c, -random.h
    -
    Geometric routines. These routines implement mathematical -functions such as Gaussian elimination and geometric -routines needed for Qhull. Frequently used routines are -in geom.c while infrequent ones are in geom2.c. -
    - -
     
    -
    Global, -global.c, -libqhull.h
    -
    Global routines. Qhull uses a global data structure, qh, -to store globally defined constants, lists, sets, and -variables. -global.c initializes and frees these -structures.
    - -
     
    -
    Io, io.h, -io.c
    -
    Input and output routines. Qhull provides a wide range of -input and output options.
    - -
     
    -
    Mem, -mem.h, -mem.c
    -
    Memory routines. Qhull provides memory allocation and -deallocation. It uses quick-fit allocation.
    - -
     
    -
    Merge, -merge.h, -merge.c
    -
    Merge routines. Qhull handles precision problems by -merged facets or joggled input. These routines merge simplicial facets, -merge non-simplicial facets, merge cycles of facets, and -rename redundant vertices.
    - -
     
    -
    Poly, -poly.h, -poly.c, -poly2.c, -libqhull.h
    -
    Polyhedral routines. Qhull produces a polyhedron as a -list of facets with vertices, neighbors, ridges, and -geometric information. libqhull.h defines the main -data structures. Frequently used routines are in poly.c -while infrequent ones are in poly2.c.
    - -
     
    -
    Qhull, -libqhull.c, -libqhull.h, -qhull_a.h, -unix.c , -qconvex.c , -qdelaun.c , -qhalf.c , -qvoronoi.c
    -
    Top-level routines. The Quickhull algorithm is -implemented by libqhull.c. qhull_a.h -includes all header files.
    - -
     
    -
    Set, -qset.h, -qset.c
    -
    Set routines. Qhull implements its data structures as -sets. A set is an array of pointers that is expanded as -needed. This is a separate package that may be used in -other applications.
    - -
     
    -
    Stat, -stat.h, -stat.c
    -
    Statistical routines. Qhull maintains statistics about -its implementation.
    - -
     
    -
    User, -user.h, -user.c, -user_eg.c, -user_eg2.c, -user_eg3.cpp, -qhull_interface.cpp
    -
    User-defined routines. Qhull allows the user to configure -the code with defined constants and specialized routines. -
    -
    -
    - -
    -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull files
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    - -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.c deleted file mode 100644 index 09a00795a3..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.c +++ /dev/null @@ -1,4060 +0,0 @@ -/*
      ---------------------------------
    -
    -   io.c
    -   Input/Output routines of qhull application
    -
    -   see qh-io.htm and io.h
    -
    -   see user.c for qh_errprint and qh_printfacetlist
    -
    -   unix.c calls qh_readpoints and qh_produce_output
    -
    -   unix.c and user.c are the only callers of io.c functions
    -   This allows the user to avoid loading io.o from qhull.a
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/io.c#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*========= -functions in alphabetical order after qh_produce_output()  =====*/
    -
    -/*---------------------------------
    -
    -  qh_produce_output()
    -  qh_produce_output2()
    -    prints out the result of qhull in desired format
    -    qh_produce_output2() does not call qh_prepare_output()
    -    if qh.GETarea
    -      computes and prints area and volume
    -    qh.PRINTout[] is an array of output formats
    -
    -  notes:
    -    prints output in qh.PRINTout order
    -*/
    -void qh_produce_output(void) {
    -    int tempsize= qh_setsize(qhmem.tempstack);
    -
    -    qh_prepare_output();
    -    qh_produce_output2();
    -    if (qh_setsize(qhmem.tempstack) != tempsize) {
    -        qh_fprintf(qh ferr, 6206, "qhull internal error (qh_produce_output): temporary sets not empty(%d)\n",
    -            qh_setsize(qhmem.tempstack));
    -        qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -} /* produce_output */
    -
    -
    -void qh_produce_output2(void) {
    -  int i, tempsize= qh_setsize(qhmem.tempstack), d_1;
    -
    -  if (qh PRINTsummary)
    -    qh_printsummary(qh ferr);
    -  else if (qh PRINTout[0] == qh_PRINTnone)
    -    qh_printsummary(qh fout);
    -  for (i=0; i < qh_PRINTEND; i++)
    -    qh_printfacets(qh fout, qh PRINTout[i], qh facet_list, NULL, !qh_ALL);
    -  qh_allstatistics();
    -  if (qh PRINTprecision && !qh MERGING && (qh JOGGLEmax > REALmax/2 || qh RERUN))
    -    qh_printstats(qh ferr, qhstat precision, NULL);
    -  if (qh VERIFYoutput && (zzval_(Zridge) > 0 || zzval_(Zridgemid) > 0))
    -    qh_printstats(qh ferr, qhstat vridges, NULL);
    -  if (qh PRINTstatistics) {
    -    qh_printstatistics(qh ferr, "");
    -    qh_memstatistics(qh ferr);
    -    d_1= sizeof(setT) + (qh hull_dim - 1) * SETelemsize;
    -    qh_fprintf(qh ferr, 8040, "\
    -    size in bytes: merge %d ridge %d vertex %d facet %d\n\
    -         normal %d ridge vertices %d facet vertices or neighbors %d\n",
    -            (int)sizeof(mergeT), (int)sizeof(ridgeT),
    -            (int)sizeof(vertexT), (int)sizeof(facetT),
    -            qh normal_size, d_1, d_1 + SETelemsize);
    -  }
    -  if (qh_setsize(qhmem.tempstack) != tempsize) {
    -    qh_fprintf(qh ferr, 6065, "qhull internal error (qh_produce_output2): temporary sets not empty(%d)\n",
    -             qh_setsize(qhmem.tempstack));
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -} /* produce_output2 */
    -
    -/*---------------------------------
    -
    -  dfacet( id )
    -    print facet by id, for debugging
    -
    -*/
    -void dfacet(unsigned id) {
    -  facetT *facet;
    -
    -  FORALLfacets {
    -    if (facet->id == id) {
    -      qh_printfacet(qh fout, facet);
    -      break;
    -    }
    -  }
    -} /* dfacet */
    -
    -
    -/*---------------------------------
    -
    -  dvertex( id )
    -    print vertex by id, for debugging
    -*/
    -void dvertex(unsigned id) {
    -  vertexT *vertex;
    -
    -  FORALLvertices {
    -    if (vertex->id == id) {
    -      qh_printvertex(qh fout, vertex);
    -      break;
    -    }
    -  }
    -} /* dvertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_compare_vertexpoint( p1, p2 )
    -    used by qsort() to order vertices by point id
    -*/
    -int qh_compare_vertexpoint(const void *p1, const void *p2) {
    -  const vertexT *a= *((vertexT *const*)p1), *b= *((vertexT *const*)p2);
    -
    -  return((qh_pointid(a->point) > qh_pointid(b->point)?1:-1));
    -} /* compare_vertexpoint */
    -
    -/*---------------------------------
    -
    -  qh_compare_facetarea( p1, p2 )
    -    used by qsort() to order facets by area
    -*/
    -int qh_compare_facetarea(const void *p1, const void *p2) {
    -  const facetT *a= *((facetT *const*)p1), *b= *((facetT *const*)p2);
    -
    -  if (!a->isarea)
    -    return -1;
    -  if (!b->isarea)
    -    return 1;
    -  if (a->f.area > b->f.area)
    -    return 1;
    -  else if (a->f.area == b->f.area)
    -    return 0;
    -  return -1;
    -} /* compare_facetarea */
    -
    -/*---------------------------------
    -
    -  qh_compare_facetmerge( p1, p2 )
    -    used by qsort() to order facets by number of merges
    -*/
    -int qh_compare_facetmerge(const void *p1, const void *p2) {
    -  const facetT *a= *((facetT *const*)p1), *b= *((facetT *const*)p2);
    -
    -  return(a->nummerge - b->nummerge);
    -} /* compare_facetvisit */
    -
    -/*---------------------------------
    -
    -  qh_compare_facetvisit( p1, p2 )
    -    used by qsort() to order facets by visit id or id
    -*/
    -int qh_compare_facetvisit(const void *p1, const void *p2) {
    -  const facetT *a= *((facetT *const*)p1), *b= *((facetT *const*)p2);
    -  int i,j;
    -
    -  if (!(i= a->visitid))
    -    i= 0 - a->id; /* do not convert to int, sign distinguishes id from visitid */
    -  if (!(j= b->visitid))
    -    j= 0 - b->id;
    -  return(i - j);
    -} /* compare_facetvisit */
    -
    -/*---------------------------------
    -
    -  qh_copyfilename( dest, size, source, length )
    -    copy filename identified by qh_skipfilename()
    -
    -  notes:
    -    see qh_skipfilename() for syntax
    -*/
    -void qh_copyfilename(char *filename, int size, const char* source, int length) {
    -  char c= *source;
    -
    -  if (length > size + 1) {
    -      qh_fprintf(qh ferr, 6040, "qhull error: filename is more than %d characters, %s\n",  size-1, source);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  strncpy(filename, source, length);
    -  filename[length]= '\0';
    -  if (c == '\'' || c == '"') {
    -    char *s= filename + 1;
    -    char *t= filename;
    -    while (*s) {
    -      if (*s == c) {
    -          if (s[-1] == '\\')
    -              t[-1]= c;
    -      }else
    -          *t++= *s;
    -      s++;
    -    }
    -    *t= '\0';
    -  }
    -} /* copyfilename */
    -
    -/*---------------------------------
    -
    -  qh_countfacets( facetlist, facets, printall,
    -          numfacets, numsimplicial, totneighbors, numridges, numcoplanar, numtricoplanars  )
    -    count good facets for printing and set visitid
    -    if allfacets, ignores qh_skipfacet()
    -
    -  notes:
    -    qh_printsummary and qh_countfacets must match counts
    -
    -  returns:
    -    numfacets, numsimplicial, total neighbors, numridges, coplanars
    -    each facet with ->visitid indicating 1-relative position
    -      ->visitid==0 indicates not good
    -
    -  notes
    -    numfacets >= numsimplicial
    -    if qh.NEWfacets,
    -      does not count visible facets (matches qh_printafacet)
    -
    -  design:
    -    for all facets on facetlist and in facets set
    -      unless facet is skipped or visible (i.e., will be deleted)
    -        mark facet->visitid
    -        update counts
    -*/
    -void qh_countfacets(facetT *facetlist, setT *facets, boolT printall,
    -    int *numfacetsp, int *numsimplicialp, int *totneighborsp, int *numridgesp, int *numcoplanarsp, int *numtricoplanarsp) {
    -  facetT *facet, **facetp;
    -  int numfacets= 0, numsimplicial= 0, numridges= 0, totneighbors= 0, numcoplanars= 0, numtricoplanars= 0;
    -
    -  FORALLfacet_(facetlist) {
    -    if ((facet->visible && qh NEWfacets)
    -    || (!printall && qh_skipfacet(facet)))
    -      facet->visitid= 0;
    -    else {
    -      facet->visitid= ++numfacets;
    -      totneighbors += qh_setsize(facet->neighbors);
    -      if (facet->simplicial) {
    -        numsimplicial++;
    -        if (facet->keepcentrum && facet->tricoplanar)
    -          numtricoplanars++;
    -      }else
    -        numridges += qh_setsize(facet->ridges);
    -      if (facet->coplanarset)
    -        numcoplanars += qh_setsize(facet->coplanarset);
    -    }
    -  }
    -
    -  FOREACHfacet_(facets) {
    -    if ((facet->visible && qh NEWfacets)
    -    || (!printall && qh_skipfacet(facet)))
    -      facet->visitid= 0;
    -    else {
    -      facet->visitid= ++numfacets;
    -      totneighbors += qh_setsize(facet->neighbors);
    -      if (facet->simplicial){
    -        numsimplicial++;
    -        if (facet->keepcentrum && facet->tricoplanar)
    -          numtricoplanars++;
    -      }else
    -        numridges += qh_setsize(facet->ridges);
    -      if (facet->coplanarset)
    -        numcoplanars += qh_setsize(facet->coplanarset);
    -    }
    -  }
    -  qh visit_id += numfacets+1;
    -  *numfacetsp= numfacets;
    -  *numsimplicialp= numsimplicial;
    -  *totneighborsp= totneighbors;
    -  *numridgesp= numridges;
    -  *numcoplanarsp= numcoplanars;
    -  *numtricoplanarsp= numtricoplanars;
    -} /* countfacets */
    -
    -/*---------------------------------
    -
    -  qh_detvnorm( vertex, vertexA, centers, offset )
    -    compute separating plane of the Voronoi diagram for a pair of input sites
    -    centers= set of facets (i.e., Voronoi vertices)
    -      facet->visitid= 0 iff vertex-at-infinity (i.e., unbounded)
    -
    -  assumes:
    -    qh_ASvoronoi and qh_vertexneighbors() already set
    -
    -  returns:
    -    norm
    -      a pointer into qh.gm_matrix to qh.hull_dim-1 reals
    -      copy the data before reusing qh.gm_matrix
    -    offset
    -      if 'QVn'
    -        sign adjusted so that qh.GOODvertexp is inside
    -      else
    -        sign adjusted so that vertex is inside
    -
    -    qh.gm_matrix= simplex of points from centers relative to first center
    -
    -  notes:
    -    in io.c so that code for 'v Tv' can be removed by removing io.c
    -    returns pointer into qh.gm_matrix to avoid tracking of temporary memory
    -
    -  design:
    -    determine midpoint of input sites
    -    build points as the set of Voronoi vertices
    -    select a simplex from points (if necessary)
    -      include midpoint if the Voronoi region is unbounded
    -    relocate the first vertex of the simplex to the origin
    -    compute the normalized hyperplane through the simplex
    -    orient the hyperplane toward 'QVn' or 'vertex'
    -    if 'Tv' or 'Ts'
    -      if bounded
    -        test that hyperplane is the perpendicular bisector of the input sites
    -      test that Voronoi vertices not in the simplex are still on the hyperplane
    -    free up temporary memory
    -*/
    -pointT *qh_detvnorm(vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp) {
    -  facetT *facet, **facetp;
    -  int  i, k, pointid, pointidA, point_i, point_n;
    -  setT *simplex= NULL;
    -  pointT *point, **pointp, *point0, *midpoint, *normal, *inpoint;
    -  coordT *coord, *gmcoord, *normalp;
    -  setT *points= qh_settemp(qh TEMPsize);
    -  boolT nearzero= False;
    -  boolT unbounded= False;
    -  int numcenters= 0;
    -  int dim= qh hull_dim - 1;
    -  realT dist, offset, angle, zero= 0.0;
    -
    -  midpoint= qh gm_matrix + qh hull_dim * qh hull_dim;  /* last row */
    -  for (k=0; k < dim; k++)
    -    midpoint[k]= (vertex->point[k] + vertexA->point[k])/2;
    -  FOREACHfacet_(centers) {
    -    numcenters++;
    -    if (!facet->visitid)
    -      unbounded= True;
    -    else {
    -      if (!facet->center)
    -        facet->center= qh_facetcenter(facet->vertices);
    -      qh_setappend(&points, facet->center);
    -    }
    -  }
    -  if (numcenters > dim) {
    -    simplex= qh_settemp(qh TEMPsize);
    -    qh_setappend(&simplex, vertex->point);
    -    if (unbounded)
    -      qh_setappend(&simplex, midpoint);
    -    qh_maxsimplex(dim, points, NULL, 0, &simplex);
    -    qh_setdelnth(simplex, 0);
    -  }else if (numcenters == dim) {
    -    if (unbounded)
    -      qh_setappend(&points, midpoint);
    -    simplex= points;
    -  }else {
    -    qh_fprintf(qh ferr, 6216, "qhull internal error (qh_detvnorm): too few points(%d) to compute separating plane\n", numcenters);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  i= 0;
    -  gmcoord= qh gm_matrix;
    -  point0= SETfirstt_(simplex, pointT);
    -  FOREACHpoint_(simplex) {
    -    if (qh IStracing >= 4)
    -      qh_printmatrix(qh ferr, "qh_detvnorm: Voronoi vertex or midpoint",
    -                              &point, 1, dim);
    -    if (point != point0) {
    -      qh gm_row[i++]= gmcoord;
    -      coord= point0;
    -      for (k=dim; k--; )
    -        *(gmcoord++)= *point++ - *coord++;
    -    }
    -  }
    -  qh gm_row[i]= gmcoord;  /* does not overlap midpoint, may be used later for qh_areasimplex */
    -  normal= gmcoord;
    -  qh_sethyperplane_gauss(dim, qh gm_row, point0, True,
    -                normal, &offset, &nearzero);
    -  if (qh GOODvertexp == vertexA->point)
    -    inpoint= vertexA->point;
    -  else
    -    inpoint= vertex->point;
    -  zinc_(Zdistio);
    -  dist= qh_distnorm(dim, inpoint, normal, &offset);
    -  if (dist > 0) {
    -    offset= -offset;
    -    normalp= normal;
    -    for (k=dim; k--; ) {
    -      *normalp= -(*normalp);
    -      normalp++;
    -    }
    -  }
    -  if (qh VERIFYoutput || qh PRINTstatistics) {
    -    pointid= qh_pointid(vertex->point);
    -    pointidA= qh_pointid(vertexA->point);
    -    if (!unbounded) {
    -      zinc_(Zdiststat);
    -      dist= qh_distnorm(dim, midpoint, normal, &offset);
    -      if (dist < 0)
    -        dist= -dist;
    -      zzinc_(Zridgemid);
    -      wwmax_(Wridgemidmax, dist);
    -      wwadd_(Wridgemid, dist);
    -      trace4((qh ferr, 4014, "qh_detvnorm: points %d %d midpoint dist %2.2g\n",
    -                 pointid, pointidA, dist));
    -      for (k=0; k < dim; k++)
    -        midpoint[k]= vertexA->point[k] - vertex->point[k];  /* overwrites midpoint! */
    -      qh_normalize(midpoint, dim, False);
    -      angle= qh_distnorm(dim, midpoint, normal, &zero); /* qh_detangle uses dim+1 */
    -      if (angle < 0.0)
    -        angle= angle + 1.0;
    -      else
    -        angle= angle - 1.0;
    -      if (angle < 0.0)
    -        angle -= angle;
    -      trace4((qh ferr, 4015, "qh_detvnorm: points %d %d angle %2.2g nearzero %d\n",
    -                 pointid, pointidA, angle, nearzero));
    -      if (nearzero) {
    -        zzinc_(Zridge0);
    -        wwmax_(Wridge0max, angle);
    -        wwadd_(Wridge0, angle);
    -      }else {
    -        zzinc_(Zridgeok)
    -        wwmax_(Wridgeokmax, angle);
    -        wwadd_(Wridgeok, angle);
    -      }
    -    }
    -    if (simplex != points) {
    -      FOREACHpoint_i_(points) {
    -        if (!qh_setin(simplex, point)) {
    -          facet= SETelemt_(centers, point_i, facetT);
    -          zinc_(Zdiststat);
    -          dist= qh_distnorm(dim, point, normal, &offset);
    -          if (dist < 0)
    -            dist= -dist;
    -          zzinc_(Zridge);
    -          wwmax_(Wridgemax, dist);
    -          wwadd_(Wridge, dist);
    -          trace4((qh ferr, 4016, "qh_detvnorm: points %d %d Voronoi vertex %d dist %2.2g\n",
    -                             pointid, pointidA, facet->visitid, dist));
    -        }
    -      }
    -    }
    -  }
    -  *offsetp= offset;
    -  if (simplex != points)
    -    qh_settempfree(&simplex);
    -  qh_settempfree(&points);
    -  return normal;
    -} /* detvnorm */
    -
    -/*---------------------------------
    -
    -  qh_detvridge( vertexA )
    -    determine Voronoi ridge from 'seen' neighbors of vertexA
    -    include one vertex-at-infinite if an !neighbor->visitid
    -
    -  returns:
    -    temporary set of centers (facets, i.e., Voronoi vertices)
    -    sorted by center id
    -*/
    -setT *qh_detvridge(vertexT *vertex) {
    -  setT *centers= qh_settemp(qh TEMPsize);
    -  setT *tricenters= qh_settemp(qh TEMPsize);
    -  facetT *neighbor, **neighborp;
    -  boolT firstinf= True;
    -
    -  FOREACHneighbor_(vertex) {
    -    if (neighbor->seen) {
    -      if (neighbor->visitid) {
    -        if (!neighbor->tricoplanar || qh_setunique(&tricenters, neighbor->center))
    -          qh_setappend(¢ers, neighbor);
    -      }else if (firstinf) {
    -        firstinf= False;
    -        qh_setappend(¢ers, neighbor);
    -      }
    -    }
    -  }
    -  qsort(SETaddr_(centers, facetT), (size_t)qh_setsize(centers),
    -             sizeof(facetT *), qh_compare_facetvisit);
    -  qh_settempfree(&tricenters);
    -  return centers;
    -} /* detvridge */
    -
    -/*---------------------------------
    -
    -  qh_detvridge3( atvertex, vertex )
    -    determine 3-d Voronoi ridge from 'seen' neighbors of atvertex and vertex
    -    include one vertex-at-infinite for !neighbor->visitid
    -    assumes all facet->seen2= True
    -
    -  returns:
    -    temporary set of centers (facets, i.e., Voronoi vertices)
    -    listed in adjacency order (!oriented)
    -    all facet->seen2= True
    -
    -  design:
    -    mark all neighbors of atvertex
    -    for each adjacent neighbor of both atvertex and vertex
    -      if neighbor selected
    -        add neighbor to set of Voronoi vertices
    -*/
    -setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex) {
    -  setT *centers= qh_settemp(qh TEMPsize);
    -  setT *tricenters= qh_settemp(qh TEMPsize);
    -  facetT *neighbor, **neighborp, *facet= NULL;
    -  boolT firstinf= True;
    -
    -  FOREACHneighbor_(atvertex)
    -    neighbor->seen2= False;
    -  FOREACHneighbor_(vertex) {
    -    if (!neighbor->seen2) {
    -      facet= neighbor;
    -      break;
    -    }
    -  }
    -  while (facet) {
    -    facet->seen2= True;
    -    if (neighbor->seen) {
    -      if (facet->visitid) {
    -        if (!facet->tricoplanar || qh_setunique(&tricenters, facet->center))
    -          qh_setappend(¢ers, facet);
    -      }else if (firstinf) {
    -        firstinf= False;
    -        qh_setappend(¢ers, facet);
    -      }
    -    }
    -    FOREACHneighbor_(facet) {
    -      if (!neighbor->seen2) {
    -        if (qh_setin(vertex->neighbors, neighbor))
    -          break;
    -        else
    -          neighbor->seen2= True;
    -      }
    -    }
    -    facet= neighbor;
    -  }
    -  if (qh CHECKfrequently) {
    -    FOREACHneighbor_(vertex) {
    -      if (!neighbor->seen2) {
    -          qh_fprintf(qh ferr, 6217, "qhull internal error (qh_detvridge3): neighbors of vertex p%d are not connected at facet %d\n",
    -                 qh_pointid(vertex->point), neighbor->id);
    -        qh_errexit(qh_ERRqhull, neighbor, NULL);
    -      }
    -    }
    -  }
    -  FOREACHneighbor_(atvertex)
    -    neighbor->seen2= True;
    -  qh_settempfree(&tricenters);
    -  return centers;
    -} /* detvridge3 */
    -
    -/*---------------------------------
    -
    -  qh_eachvoronoi( fp, printvridge, vertex, visitall, innerouter, inorder )
    -    if visitall,
    -      visit all Voronoi ridges for vertex (i.e., an input site)
    -    else
    -      visit all unvisited Voronoi ridges for vertex
    -      all vertex->seen= False if unvisited
    -    assumes
    -      all facet->seen= False
    -      all facet->seen2= True (for qh_detvridge3)
    -      all facet->visitid == 0 if vertex_at_infinity
    -                         == index of Voronoi vertex
    -                         >= qh.num_facets if ignored
    -    innerouter:
    -      qh_RIDGEall--  both inner (bounded) and outer(unbounded) ridges
    -      qh_RIDGEinner- only inner
    -      qh_RIDGEouter- only outer
    -
    -    if inorder
    -      orders vertices for 3-d Voronoi diagrams
    -
    -  returns:
    -    number of visited ridges (does not include previously visited ridges)
    -
    -    if printvridge,
    -      calls printvridge( fp, vertex, vertexA, centers)
    -        fp== any pointer (assumes FILE*)
    -        vertex,vertexA= pair of input sites that define a Voronoi ridge
    -        centers= set of facets (i.e., Voronoi vertices)
    -                 ->visitid == index or 0 if vertex_at_infinity
    -                 ordered for 3-d Voronoi diagram
    -  notes:
    -    uses qh.vertex_visit
    -
    -  see:
    -    qh_eachvoronoi_all()
    -
    -  design:
    -    mark selected neighbors of atvertex
    -    for each selected neighbor (either Voronoi vertex or vertex-at-infinity)
    -      for each unvisited vertex
    -        if atvertex and vertex share more than d-1 neighbors
    -          bump totalcount
    -          if printvridge defined
    -            build the set of shared neighbors (i.e., Voronoi vertices)
    -            call printvridge
    -*/
    -int qh_eachvoronoi(FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder) {
    -  boolT unbounded;
    -  int count;
    -  facetT *neighbor, **neighborp, *neighborA, **neighborAp;
    -  setT *centers;
    -  setT *tricenters= qh_settemp(qh TEMPsize);
    -
    -  vertexT *vertex, **vertexp;
    -  boolT firstinf;
    -  unsigned int numfacets= (unsigned int)qh num_facets;
    -  int totridges= 0;
    -
    -  qh vertex_visit++;
    -  atvertex->seen= True;
    -  if (visitall) {
    -    FORALLvertices
    -      vertex->seen= False;
    -  }
    -  FOREACHneighbor_(atvertex) {
    -    if (neighbor->visitid < numfacets)
    -      neighbor->seen= True;
    -  }
    -  FOREACHneighbor_(atvertex) {
    -    if (neighbor->seen) {
    -      FOREACHvertex_(neighbor->vertices) {
    -        if (vertex->visitid != qh vertex_visit && !vertex->seen) {
    -          vertex->visitid= qh vertex_visit;
    -          count= 0;
    -          firstinf= True;
    -          qh_settruncate(tricenters, 0);
    -          FOREACHneighborA_(vertex) {
    -            if (neighborA->seen) {
    -              if (neighborA->visitid) {
    -                if (!neighborA->tricoplanar || qh_setunique(&tricenters, neighborA->center))
    -                  count++;
    -              }else if (firstinf) {
    -                count++;
    -                firstinf= False;
    -              }
    -            }
    -          }
    -          if (count >= qh hull_dim - 1) {  /* e.g., 3 for 3-d Voronoi */
    -            if (firstinf) {
    -              if (innerouter == qh_RIDGEouter)
    -                continue;
    -              unbounded= False;
    -            }else {
    -              if (innerouter == qh_RIDGEinner)
    -                continue;
    -              unbounded= True;
    -            }
    -            totridges++;
    -            trace4((qh ferr, 4017, "qh_eachvoronoi: Voronoi ridge of %d vertices between sites %d and %d\n",
    -                  count, qh_pointid(atvertex->point), qh_pointid(vertex->point)));
    -            if (printvridge && fp) {
    -              if (inorder && qh hull_dim == 3+1) /* 3-d Voronoi diagram */
    -                centers= qh_detvridge3 (atvertex, vertex);
    -              else
    -                centers= qh_detvridge(vertex);
    -              (*printvridge) (fp, atvertex, vertex, centers, unbounded);
    -              qh_settempfree(¢ers);
    -            }
    -          }
    -        }
    -      }
    -    }
    -  }
    -  FOREACHneighbor_(atvertex)
    -    neighbor->seen= False;
    -  qh_settempfree(&tricenters);
    -  return totridges;
    -} /* eachvoronoi */
    -
    -
    -/*---------------------------------
    -
    -  qh_eachvoronoi_all( fp, printvridge, isUpper, innerouter, inorder )
    -    visit all Voronoi ridges
    -
    -    innerouter:
    -      see qh_eachvoronoi()
    -
    -    if inorder
    -      orders vertices for 3-d Voronoi diagrams
    -
    -  returns
    -    total number of ridges
    -
    -    if isUpper == facet->upperdelaunay  (i.e., a Vornoi vertex)
    -      facet->visitid= Voronoi vertex index(same as 'o' format)
    -    else
    -      facet->visitid= 0
    -
    -    if printvridge,
    -      calls printvridge( fp, vertex, vertexA, centers)
    -      [see qh_eachvoronoi]
    -
    -  notes:
    -    Not used for qhull.exe
    -    same effect as qh_printvdiagram but ridges not sorted by point id
    -*/
    -int qh_eachvoronoi_all(FILE *fp, printvridgeT printvridge, boolT isUpper, qh_RIDGE innerouter, boolT inorder) {
    -  facetT *facet;
    -  vertexT *vertex;
    -  int numcenters= 1;  /* vertex 0 is vertex-at-infinity */
    -  int totridges= 0;
    -
    -  qh_clearcenters(qh_ASvoronoi);
    -  qh_vertexneighbors();
    -  maximize_(qh visit_id, (unsigned) qh num_facets);
    -  FORALLfacets {
    -    facet->visitid= 0;
    -    facet->seen= False;
    -    facet->seen2= True;
    -  }
    -  FORALLfacets {
    -    if (facet->upperdelaunay == isUpper)
    -      facet->visitid= numcenters++;
    -  }
    -  FORALLvertices
    -    vertex->seen= False;
    -  FORALLvertices {
    -    if (qh GOODvertex > 0 && qh_pointid(vertex->point)+1 != qh GOODvertex)
    -      continue;
    -    totridges += qh_eachvoronoi(fp, printvridge, vertex,
    -                   !qh_ALL, innerouter, inorder);
    -  }
    -  return totridges;
    -} /* eachvoronoi_all */
    -
    -/*---------------------------------
    -
    -  qh_facet2point( facet, point0, point1, mindist )
    -    return two projected temporary vertices for a 2-d facet
    -    may be non-simplicial
    -
    -  returns:
    -    point0 and point1 oriented and projected to the facet
    -    returns mindist (maximum distance below plane)
    -*/
    -void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist) {
    -  vertexT *vertex0, *vertex1;
    -  realT dist;
    -
    -  if (facet->toporient ^ qh_ORIENTclock) {
    -    vertex0= SETfirstt_(facet->vertices, vertexT);
    -    vertex1= SETsecondt_(facet->vertices, vertexT);
    -  }else {
    -    vertex1= SETfirstt_(facet->vertices, vertexT);
    -    vertex0= SETsecondt_(facet->vertices, vertexT);
    -  }
    -  zadd_(Zdistio, 2);
    -  qh_distplane(vertex0->point, facet, &dist);
    -  *mindist= dist;
    -  *point0= qh_projectpoint(vertex0->point, facet, dist);
    -  qh_distplane(vertex1->point, facet, &dist);
    -  minimize_(*mindist, dist);
    -  *point1= qh_projectpoint(vertex1->point, facet, dist);
    -} /* facet2point */
    -
    -
    -/*---------------------------------
    -
    -  qh_facetvertices( facetlist, facets, allfacets )
    -    returns temporary set of vertices in a set and/or list of facets
    -    if allfacets, ignores qh_skipfacet()
    -
    -  returns:
    -    vertices with qh.vertex_visit
    -
    -  notes:
    -    optimized for allfacets of facet_list
    -
    -  design:
    -    if allfacets of facet_list
    -      create vertex set from vertex_list
    -    else
    -      for each selected facet in facets or facetlist
    -        append unvisited vertices to vertex set
    -*/
    -setT *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets) {
    -  setT *vertices;
    -  facetT *facet, **facetp;
    -  vertexT *vertex, **vertexp;
    -
    -  qh vertex_visit++;
    -  if (facetlist == qh facet_list && allfacets && !facets) {
    -    vertices= qh_settemp(qh num_vertices);
    -    FORALLvertices {
    -      vertex->visitid= qh vertex_visit;
    -      qh_setappend(&vertices, vertex);
    -    }
    -  }else {
    -    vertices= qh_settemp(qh TEMPsize);
    -    FORALLfacet_(facetlist) {
    -      if (!allfacets && qh_skipfacet(facet))
    -        continue;
    -      FOREACHvertex_(facet->vertices) {
    -        if (vertex->visitid != qh vertex_visit) {
    -          vertex->visitid= qh vertex_visit;
    -          qh_setappend(&vertices, vertex);
    -        }
    -      }
    -    }
    -  }
    -  FOREACHfacet_(facets) {
    -    if (!allfacets && qh_skipfacet(facet))
    -      continue;
    -    FOREACHvertex_(facet->vertices) {
    -      if (vertex->visitid != qh vertex_visit) {
    -        vertex->visitid= qh vertex_visit;
    -        qh_setappend(&vertices, vertex);
    -      }
    -    }
    -  }
    -  return vertices;
    -} /* facetvertices */
    -
    -/*---------------------------------
    -
    -  qh_geomplanes( facet, outerplane, innerplane )
    -    return outer and inner planes for Geomview
    -    qh.PRINTradius is size of vertices and points (includes qh.JOGGLEmax)
    -
    -  notes:
    -    assume precise calculations in io.c with roundoff covered by qh_GEOMepsilon
    -*/
    -void qh_geomplanes(facetT *facet, realT *outerplane, realT *innerplane) {
    -  realT radius;
    -
    -  if (qh MERGING || qh JOGGLEmax < REALmax/2) {
    -    qh_outerinner(facet, outerplane, innerplane);
    -    radius= qh PRINTradius;
    -    if (qh JOGGLEmax < REALmax/2)
    -      radius -= qh JOGGLEmax * sqrt((realT)qh hull_dim);  /* already accounted for in qh_outerinner() */
    -    *outerplane += radius;
    -    *innerplane -= radius;
    -    if (qh PRINTcoplanar || qh PRINTspheres) {
    -      *outerplane += qh MAXabs_coord * qh_GEOMepsilon;
    -      *innerplane -= qh MAXabs_coord * qh_GEOMepsilon;
    -    }
    -  }else
    -    *innerplane= *outerplane= 0;
    -} /* geomplanes */
    -
    -
    -/*---------------------------------
    -
    -  qh_markkeep( facetlist )
    -    mark good facets that meet qh.KEEParea, qh.KEEPmerge, and qh.KEEPminArea
    -    ignores visible facets (!part of convex hull)
    -
    -  returns:
    -    may clear facet->good
    -    recomputes qh.num_good
    -
    -  design:
    -    get set of good facets
    -    if qh.KEEParea
    -      sort facets by area
    -      clear facet->good for all but n largest facets
    -    if qh.KEEPmerge
    -      sort facets by merge count
    -      clear facet->good for all but n most merged facets
    -    if qh.KEEPminarea
    -      clear facet->good if area too small
    -    update qh.num_good
    -*/
    -void qh_markkeep(facetT *facetlist) {
    -  facetT *facet, **facetp;
    -  setT *facets= qh_settemp(qh num_facets);
    -  int size, count;
    -
    -  trace2((qh ferr, 2006, "qh_markkeep: only keep %d largest and/or %d most merged facets and/or min area %.2g\n",
    -          qh KEEParea, qh KEEPmerge, qh KEEPminArea));
    -  FORALLfacet_(facetlist) {
    -    if (!facet->visible && facet->good)
    -      qh_setappend(&facets, facet);
    -  }
    -  size= qh_setsize(facets);
    -  if (qh KEEParea) {
    -    qsort(SETaddr_(facets, facetT), (size_t)size,
    -             sizeof(facetT *), qh_compare_facetarea);
    -    if ((count= size - qh KEEParea) > 0) {
    -      FOREACHfacet_(facets) {
    -        facet->good= False;
    -        if (--count == 0)
    -          break;
    -      }
    -    }
    -  }
    -  if (qh KEEPmerge) {
    -    qsort(SETaddr_(facets, facetT), (size_t)size,
    -             sizeof(facetT *), qh_compare_facetmerge);
    -    if ((count= size - qh KEEPmerge) > 0) {
    -      FOREACHfacet_(facets) {
    -        facet->good= False;
    -        if (--count == 0)
    -          break;
    -      }
    -    }
    -  }
    -  if (qh KEEPminArea < REALmax/2) {
    -    FOREACHfacet_(facets) {
    -      if (!facet->isarea || facet->f.area < qh KEEPminArea)
    -        facet->good= False;
    -    }
    -  }
    -  qh_settempfree(&facets);
    -  count= 0;
    -  FORALLfacet_(facetlist) {
    -    if (facet->good)
    -      count++;
    -  }
    -  qh num_good= count;
    -} /* markkeep */
    -
    -
    -/*---------------------------------
    -
    -  qh_markvoronoi( facetlist, facets, printall, isLower, numcenters )
    -    mark voronoi vertices for printing by site pairs
    -
    -  returns:
    -    temporary set of vertices indexed by pointid
    -    isLower set if printing lower hull (i.e., at least one facet is lower hull)
    -    numcenters= total number of Voronoi vertices
    -    bumps qh.printoutnum for vertex-at-infinity
    -    clears all facet->seen and sets facet->seen2
    -
    -    if selected
    -      facet->visitid= Voronoi vertex id
    -    else if upper hull (or 'Qu' and lower hull)
    -      facet->visitid= 0
    -    else
    -      facet->visitid >= qh num_facets
    -
    -  notes:
    -    ignores qh.ATinfinity, if defined
    -*/
    -setT *qh_markvoronoi(facetT *facetlist, setT *facets, boolT printall, boolT *isLowerp, int *numcentersp) {
    -  int numcenters=0;
    -  facetT *facet, **facetp;
    -  setT *vertices;
    -  boolT isLower= False;
    -
    -  qh printoutnum++;
    -  qh_clearcenters(qh_ASvoronoi);  /* in case, qh_printvdiagram2 called by user */
    -  qh_vertexneighbors();
    -  vertices= qh_pointvertex();
    -  if (qh ATinfinity)
    -    SETelem_(vertices, qh num_points-1)= NULL;
    -  qh visit_id++;
    -  maximize_(qh visit_id, (unsigned) qh num_facets);
    -  FORALLfacet_(facetlist) {
    -    if (printall || !qh_skipfacet(facet)) {
    -      if (!facet->upperdelaunay) {
    -        isLower= True;
    -        break;
    -      }
    -    }
    -  }
    -  FOREACHfacet_(facets) {
    -    if (printall || !qh_skipfacet(facet)) {
    -      if (!facet->upperdelaunay) {
    -        isLower= True;
    -        break;
    -      }
    -    }
    -  }
    -  FORALLfacets {
    -    if (facet->normal && (facet->upperdelaunay == isLower))
    -      facet->visitid= 0;  /* facetlist or facets may overwrite */
    -    else
    -      facet->visitid= qh visit_id;
    -    facet->seen= False;
    -    facet->seen2= True;
    -  }
    -  numcenters++;  /* qh_INFINITE */
    -  FORALLfacet_(facetlist) {
    -    if (printall || !qh_skipfacet(facet))
    -      facet->visitid= numcenters++;
    -  }
    -  FOREACHfacet_(facets) {
    -    if (printall || !qh_skipfacet(facet))
    -      facet->visitid= numcenters++;
    -  }
    -  *isLowerp= isLower;
    -  *numcentersp= numcenters;
    -  trace2((qh ferr, 2007, "qh_markvoronoi: isLower %d numcenters %d\n", isLower, numcenters));
    -  return vertices;
    -} /* markvoronoi */
    -
    -/*---------------------------------
    -
    -  qh_order_vertexneighbors( vertex )
    -    order facet neighbors of a 2-d or 3-d vertex by adjacency
    -
    -  notes:
    -    does not orient the neighbors
    -
    -  design:
    -    initialize a new neighbor set with the first facet in vertex->neighbors
    -    while vertex->neighbors non-empty
    -      select next neighbor in the previous facet's neighbor set
    -    set vertex->neighbors to the new neighbor set
    -*/
    -void qh_order_vertexneighbors(vertexT *vertex) {
    -  setT *newset;
    -  facetT *facet, *neighbor, **neighborp;
    -
    -  trace4((qh ferr, 4018, "qh_order_vertexneighbors: order neighbors of v%d for 3-d\n", vertex->id));
    -  newset= qh_settemp(qh_setsize(vertex->neighbors));
    -  facet= (facetT*)qh_setdellast(vertex->neighbors);
    -  qh_setappend(&newset, facet);
    -  while (qh_setsize(vertex->neighbors)) {
    -    FOREACHneighbor_(vertex) {
    -      if (qh_setin(facet->neighbors, neighbor)) {
    -        qh_setdel(vertex->neighbors, neighbor);
    -        qh_setappend(&newset, neighbor);
    -        facet= neighbor;
    -        break;
    -      }
    -    }
    -    if (!neighbor) {
    -      qh_fprintf(qh ferr, 6066, "qhull internal error (qh_order_vertexneighbors): no neighbor of v%d for f%d\n",
    -        vertex->id, facet->id);
    -      qh_errexit(qh_ERRqhull, facet, NULL);
    -    }
    -  }
    -  qh_setfree(&vertex->neighbors);
    -  qh_settemppop();
    -  vertex->neighbors= newset;
    -} /* order_vertexneighbors */
    -
    -/*---------------------------------
    -
    -  qh_prepare_output( )
    -    prepare for qh_produce_output2() according to
    -      qh.KEEPminArea, KEEParea, KEEPmerge, GOODvertex, GOODthreshold, GOODpoint, ONLYgood, SPLITthresholds
    -    does not reset facet->good
    -
    -  notes
    -    except for PRINTstatistics, no-op if previously called with same options
    -*/
    -void qh_prepare_output(void) {
    -  if (qh VORONOI) {
    -    qh_clearcenters (qh_ASvoronoi);
    -    qh_vertexneighbors();
    -  }
    -  if (qh TRIangulate && !qh hasTriangulation) {
    -    qh_triangulate();
    -    if (qh VERIFYoutput && !qh CHECKfrequently)
    -      qh_checkpolygon (qh facet_list);
    -  }
    -  qh_findgood_all (qh facet_list);
    -  if (qh GETarea)
    -    qh_getarea(qh facet_list);
    -  if (qh KEEParea || qh KEEPmerge || qh KEEPminArea < REALmax/2)
    -    qh_markkeep (qh facet_list);
    -  if (qh PRINTstatistics)
    -    qh_collectstatistics();
    -}
    -
    -/*---------------------------------
    -
    -  qh_printafacet( fp, format, facet, printall )
    -    print facet to fp in given output format (see qh.PRINTout)
    -
    -  returns:
    -    nop if !printall and qh_skipfacet()
    -    nop if visible facet and NEWfacets and format != PRINTfacets
    -    must match qh_countfacets
    -
    -  notes
    -    preserves qh.visit_id
    -    facet->normal may be null if PREmerge/MERGEexact and STOPcone before merge
    -
    -  see
    -    qh_printbegin() and qh_printend()
    -
    -  design:
    -    test for printing facet
    -    call appropriate routine for format
    -    or output results directly
    -*/
    -void qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT printall) {
    -  realT color[4], offset, dist, outerplane, innerplane;
    -  boolT zerodiv;
    -  coordT *point, *normp, *coordp, **pointp, *feasiblep;
    -  int k;
    -  vertexT *vertex, **vertexp;
    -  facetT *neighbor, **neighborp;
    -
    -  if (!printall && qh_skipfacet(facet))
    -    return;
    -  if (facet->visible && qh NEWfacets && format != qh_PRINTfacets)
    -    return;
    -  qh printoutnum++;
    -  switch (format) {
    -  case qh_PRINTarea:
    -    if (facet->isarea) {
    -      qh_fprintf(fp, 9009, qh_REAL_1, facet->f.area);
    -      qh_fprintf(fp, 9010, "\n");
    -    }else
    -      qh_fprintf(fp, 9011, "0\n");
    -    break;
    -  case qh_PRINTcoplanars:
    -    qh_fprintf(fp, 9012, "%d", qh_setsize(facet->coplanarset));
    -    FOREACHpoint_(facet->coplanarset)
    -      qh_fprintf(fp, 9013, " %d", qh_pointid(point));
    -    qh_fprintf(fp, 9014, "\n");
    -    break;
    -  case qh_PRINTcentrums:
    -    qh_printcenter(fp, format, NULL, facet);
    -    break;
    -  case qh_PRINTfacets:
    -    qh_printfacet(fp, facet);
    -    break;
    -  case qh_PRINTfacets_xridge:
    -    qh_printfacetheader(fp, facet);
    -    break;
    -  case qh_PRINTgeom:  /* either 2 , 3, or 4-d by qh_printbegin */
    -    if (!facet->normal)
    -      break;
    -    for (k=qh hull_dim; k--; ) {
    -      color[k]= (facet->normal[k]+1.0)/2.0;
    -      maximize_(color[k], -1.0);
    -      minimize_(color[k], +1.0);
    -    }
    -    qh_projectdim3 (color, color);
    -    if (qh PRINTdim != qh hull_dim)
    -      qh_normalize2 (color, 3, True, NULL, NULL);
    -    if (qh hull_dim <= 2)
    -      qh_printfacet2geom(fp, facet, color);
    -    else if (qh hull_dim == 3) {
    -      if (facet->simplicial)
    -        qh_printfacet3geom_simplicial(fp, facet, color);
    -      else
    -        qh_printfacet3geom_nonsimplicial(fp, facet, color);
    -    }else {
    -      if (facet->simplicial)
    -        qh_printfacet4geom_simplicial(fp, facet, color);
    -      else
    -        qh_printfacet4geom_nonsimplicial(fp, facet, color);
    -    }
    -    break;
    -  case qh_PRINTids:
    -    qh_fprintf(fp, 9015, "%d\n", facet->id);
    -    break;
    -  case qh_PRINTincidences:
    -  case qh_PRINToff:
    -  case qh_PRINTtriangles:
    -    if (qh hull_dim == 3 && format != qh_PRINTtriangles)
    -      qh_printfacet3vertex(fp, facet, format);
    -    else if (facet->simplicial || qh hull_dim == 2 || format == qh_PRINToff)
    -      qh_printfacetNvertex_simplicial(fp, facet, format);
    -    else
    -      qh_printfacetNvertex_nonsimplicial(fp, facet, qh printoutvar++, format);
    -    break;
    -  case qh_PRINTinner:
    -    qh_outerinner(facet, NULL, &innerplane);
    -    offset= facet->offset - innerplane;
    -    goto LABELprintnorm;
    -    break; /* prevent warning */
    -  case qh_PRINTmerges:
    -    qh_fprintf(fp, 9016, "%d\n", facet->nummerge);
    -    break;
    -  case qh_PRINTnormals:
    -    offset= facet->offset;
    -    goto LABELprintnorm;
    -    break; /* prevent warning */
    -  case qh_PRINTouter:
    -    qh_outerinner(facet, &outerplane, NULL);
    -    offset= facet->offset - outerplane;
    -  LABELprintnorm:
    -    if (!facet->normal) {
    -      qh_fprintf(fp, 9017, "no normal for facet f%d\n", facet->id);
    -      break;
    -    }
    -    if (qh CDDoutput) {
    -      qh_fprintf(fp, 9018, qh_REAL_1, -offset);
    -      for (k=0; k < qh hull_dim; k++)
    -        qh_fprintf(fp, 9019, qh_REAL_1, -facet->normal[k]);
    -    }else {
    -      for (k=0; k < qh hull_dim; k++)
    -        qh_fprintf(fp, 9020, qh_REAL_1, facet->normal[k]);
    -      qh_fprintf(fp, 9021, qh_REAL_1, offset);
    -    }
    -    qh_fprintf(fp, 9022, "\n");
    -    break;
    -  case qh_PRINTmathematica:  /* either 2 or 3-d by qh_printbegin */
    -  case qh_PRINTmaple:
    -    if (qh hull_dim == 2)
    -      qh_printfacet2math(fp, facet, format, qh printoutvar++);
    -    else
    -      qh_printfacet3math(fp, facet, format, qh printoutvar++);
    -    break;
    -  case qh_PRINTneighbors:
    -    qh_fprintf(fp, 9023, "%d", qh_setsize(facet->neighbors));
    -    FOREACHneighbor_(facet)
    -      qh_fprintf(fp, 9024, " %d",
    -               neighbor->visitid ? neighbor->visitid - 1: 0 - neighbor->id);
    -    qh_fprintf(fp, 9025, "\n");
    -    break;
    -  case qh_PRINTpointintersect:
    -    if (!qh feasible_point) {
    -      qh_fprintf(qh ferr, 6067, "qhull input error (qh_printafacet): option 'Fp' needs qh feasible_point\n");
    -      qh_errexit( qh_ERRinput, NULL, NULL);
    -    }
    -    if (facet->offset > 0)
    -      goto LABELprintinfinite;
    -    point= coordp= (coordT*)qh_memalloc(qh normal_size);
    -    normp= facet->normal;
    -    feasiblep= qh feasible_point;
    -    if (facet->offset < -qh MINdenom) {
    -      for (k=qh hull_dim; k--; )
    -        *(coordp++)= (*(normp++) / - facet->offset) + *(feasiblep++);
    -    }else {
    -      for (k=qh hull_dim; k--; ) {
    -        *(coordp++)= qh_divzero(*(normp++), facet->offset, qh MINdenom_1,
    -                                 &zerodiv) + *(feasiblep++);
    -        if (zerodiv) {
    -          qh_memfree(point, qh normal_size);
    -          goto LABELprintinfinite;
    -        }
    -      }
    -    }
    -    qh_printpoint(fp, NULL, point);
    -    qh_memfree(point, qh normal_size);
    -    break;
    -  LABELprintinfinite:
    -    for (k=qh hull_dim; k--; )
    -      qh_fprintf(fp, 9026, qh_REAL_1, qh_INFINITE);
    -    qh_fprintf(fp, 9027, "\n");
    -    break;
    -  case qh_PRINTpointnearest:
    -    FOREACHpoint_(facet->coplanarset) {
    -      int id, id2;
    -      vertex= qh_nearvertex(facet, point, &dist);
    -      id= qh_pointid(vertex->point);
    -      id2= qh_pointid(point);
    -      qh_fprintf(fp, 9028, "%d %d %d " qh_REAL_1 "\n", id, id2, facet->id, dist);
    -    }
    -    break;
    -  case qh_PRINTpoints:  /* VORONOI only by qh_printbegin */
    -    if (qh CDDoutput)
    -      qh_fprintf(fp, 9029, "1 ");
    -    qh_printcenter(fp, format, NULL, facet);
    -    break;
    -  case qh_PRINTvertices:
    -    qh_fprintf(fp, 9030, "%d", qh_setsize(facet->vertices));
    -    FOREACHvertex_(facet->vertices)
    -      qh_fprintf(fp, 9031, " %d", qh_pointid(vertex->point));
    -    qh_fprintf(fp, 9032, "\n");
    -    break;
    -  default:
    -    break;
    -  }
    -} /* printafacet */
    -
    -/*---------------------------------
    -
    -  qh_printbegin(  )
    -    prints header for all output formats
    -
    -  returns:
    -    checks for valid format
    -
    -  notes:
    -    uses qh.visit_id for 3/4off
    -    changes qh.interior_point if printing centrums
    -    qh_countfacets clears facet->visitid for non-good facets
    -
    -  see
    -    qh_printend() and qh_printafacet()
    -
    -  design:
    -    count facets and related statistics
    -    print header for format
    -*/
    -void qh_printbegin(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall) {
    -  int numfacets, numsimplicial, numridges, totneighbors, numcoplanars, numtricoplanars;
    -  int i, num;
    -  facetT *facet, **facetp;
    -  vertexT *vertex, **vertexp;
    -  setT *vertices;
    -  pointT *point, **pointp, *pointtemp;
    -
    -  qh printoutnum= 0;
    -  qh_countfacets(facetlist, facets, printall, &numfacets, &numsimplicial,
    -      &totneighbors, &numridges, &numcoplanars, &numtricoplanars);
    -  switch (format) {
    -  case qh_PRINTnone:
    -    break;
    -  case qh_PRINTarea:
    -    qh_fprintf(fp, 9033, "%d\n", numfacets);
    -    break;
    -  case qh_PRINTcoplanars:
    -    qh_fprintf(fp, 9034, "%d\n", numfacets);
    -    break;
    -  case qh_PRINTcentrums:
    -    if (qh CENTERtype == qh_ASnone)
    -      qh_clearcenters(qh_AScentrum);
    -    qh_fprintf(fp, 9035, "%d\n%d\n", qh hull_dim, numfacets);
    -    break;
    -  case qh_PRINTfacets:
    -  case qh_PRINTfacets_xridge:
    -    if (facetlist)
    -      qh_printvertexlist(fp, "Vertices and facets:\n", facetlist, facets, printall);
    -    break;
    -  case qh_PRINTgeom:
    -    if (qh hull_dim > 4)  /* qh_initqhull_globals also checks */
    -      goto LABELnoformat;
    -    if (qh VORONOI && qh hull_dim > 3)  /* PRINTdim == DROPdim == hull_dim-1 */
    -      goto LABELnoformat;
    -    if (qh hull_dim == 2 && (qh PRINTridges || qh DOintersections))
    -      qh_fprintf(qh ferr, 7049, "qhull warning: output for ridges and intersections not implemented in 2-d\n");
    -    if (qh hull_dim == 4 && (qh PRINTinner || qh PRINTouter ||
    -                             (qh PRINTdim == 4 && qh PRINTcentrums)))
    -      qh_fprintf(qh ferr, 7050, "qhull warning: output for outer/inner planes and centrums not implemented in 4-d\n");
    -    if (qh PRINTdim == 4 && (qh PRINTspheres))
    -      qh_fprintf(qh ferr, 7051, "qhull warning: output for vertices not implemented in 4-d\n");
    -    if (qh PRINTdim == 4 && qh DOintersections && qh PRINTnoplanes)
    -      qh_fprintf(qh ferr, 7052, "qhull warning: 'Gnh' generates no output in 4-d\n");
    -    if (qh PRINTdim == 2) {
    -      qh_fprintf(fp, 9036, "{appearance {linewidth 3} LIST # %s | %s\n",
    -              qh rbox_command, qh qhull_command);
    -    }else if (qh PRINTdim == 3) {
    -      qh_fprintf(fp, 9037, "{appearance {+edge -evert linewidth 2} LIST # %s | %s\n",
    -              qh rbox_command, qh qhull_command);
    -    }else if (qh PRINTdim == 4) {
    -      qh visit_id++;
    -      num= 0;
    -      FORALLfacet_(facetlist)    /* get number of ridges to be printed */
    -        qh_printend4geom(NULL, facet, &num, printall);
    -      FOREACHfacet_(facets)
    -        qh_printend4geom(NULL, facet, &num, printall);
    -      qh ridgeoutnum= num;
    -      qh printoutvar= 0;  /* counts number of ridges in output */
    -      qh_fprintf(fp, 9038, "LIST # %s | %s\n", qh rbox_command, qh qhull_command);
    -    }
    -
    -    if (qh PRINTdots) {
    -      qh printoutnum++;
    -      num= qh num_points + qh_setsize(qh other_points);
    -      if (qh DELAUNAY && qh ATinfinity)
    -        num--;
    -      if (qh PRINTdim == 4)
    -        qh_fprintf(fp, 9039, "4VECT %d %d 1\n", num, num);
    -      else
    -        qh_fprintf(fp, 9040, "VECT %d %d 1\n", num, num);
    -
    -      for (i=num; i--; ) {
    -        if (i % 20 == 0)
    -          qh_fprintf(fp, 9041, "\n");
    -        qh_fprintf(fp, 9042, "1 ");
    -      }
    -      qh_fprintf(fp, 9043, "# 1 point per line\n1 ");
    -      for (i=num-1; i--; ) { /* num at least 3 for D2 */
    -        if (i % 20 == 0)
    -          qh_fprintf(fp, 9044, "\n");
    -        qh_fprintf(fp, 9045, "0 ");
    -      }
    -      qh_fprintf(fp, 9046, "# 1 color for all\n");
    -      FORALLpoints {
    -        if (!qh DELAUNAY || !qh ATinfinity || qh_pointid(point) != qh num_points-1) {
    -          if (qh PRINTdim == 4)
    -            qh_printpoint(fp, NULL, point);
    -            else
    -              qh_printpoint3 (fp, point);
    -        }
    -      }
    -      FOREACHpoint_(qh other_points) {
    -        if (qh PRINTdim == 4)
    -          qh_printpoint(fp, NULL, point);
    -        else
    -          qh_printpoint3 (fp, point);
    -      }
    -      qh_fprintf(fp, 9047, "0 1 1 1  # color of points\n");
    -    }
    -
    -    if (qh PRINTdim == 4  && !qh PRINTnoplanes)
    -      /* 4dview loads up multiple 4OFF objects slowly */
    -      qh_fprintf(fp, 9048, "4OFF %d %d 1\n", 3*qh ridgeoutnum, qh ridgeoutnum);
    -    qh PRINTcradius= 2 * qh DISTround;  /* include test DISTround */
    -    if (qh PREmerge) {
    -      maximize_(qh PRINTcradius, qh premerge_centrum + qh DISTround);
    -    }else if (qh POSTmerge)
    -      maximize_(qh PRINTcradius, qh postmerge_centrum + qh DISTround);
    -    qh PRINTradius= qh PRINTcradius;
    -    if (qh PRINTspheres + qh PRINTcoplanar)
    -      maximize_(qh PRINTradius, qh MAXabs_coord * qh_MINradius);
    -    if (qh premerge_cos < REALmax/2) {
    -      maximize_(qh PRINTradius, (1- qh premerge_cos) * qh MAXabs_coord);
    -    }else if (!qh PREmerge && qh POSTmerge && qh postmerge_cos < REALmax/2) {
    -      maximize_(qh PRINTradius, (1- qh postmerge_cos) * qh MAXabs_coord);
    -    }
    -    maximize_(qh PRINTradius, qh MINvisible);
    -    if (qh JOGGLEmax < REALmax/2)
    -      qh PRINTradius += qh JOGGLEmax * sqrt((realT)qh hull_dim);
    -    if (qh PRINTdim != 4 &&
    -        (qh PRINTcoplanar || qh PRINTspheres || qh PRINTcentrums)) {
    -      vertices= qh_facetvertices(facetlist, facets, printall);
    -      if (qh PRINTspheres && qh PRINTdim <= 3)
    -        qh_printspheres(fp, vertices, qh PRINTradius);
    -      if (qh PRINTcoplanar || qh PRINTcentrums) {
    -        qh firstcentrum= True;
    -        if (qh PRINTcoplanar&& !qh PRINTspheres) {
    -          FOREACHvertex_(vertices)
    -            qh_printpointvect2 (fp, vertex->point, NULL, qh interior_point, qh PRINTradius);
    -        }
    -        FORALLfacet_(facetlist) {
    -          if (!printall && qh_skipfacet(facet))
    -            continue;
    -          if (!facet->normal)
    -            continue;
    -          if (qh PRINTcentrums && qh PRINTdim <= 3)
    -            qh_printcentrum(fp, facet, qh PRINTcradius);
    -          if (!qh PRINTcoplanar)
    -            continue;
    -          FOREACHpoint_(facet->coplanarset)
    -            qh_printpointvect2 (fp, point, facet->normal, NULL, qh PRINTradius);
    -          FOREACHpoint_(facet->outsideset)
    -            qh_printpointvect2 (fp, point, facet->normal, NULL, qh PRINTradius);
    -        }
    -        FOREACHfacet_(facets) {
    -          if (!printall && qh_skipfacet(facet))
    -            continue;
    -          if (!facet->normal)
    -            continue;
    -          if (qh PRINTcentrums && qh PRINTdim <= 3)
    -            qh_printcentrum(fp, facet, qh PRINTcradius);
    -          if (!qh PRINTcoplanar)
    -            continue;
    -          FOREACHpoint_(facet->coplanarset)
    -            qh_printpointvect2 (fp, point, facet->normal, NULL, qh PRINTradius);
    -          FOREACHpoint_(facet->outsideset)
    -            qh_printpointvect2 (fp, point, facet->normal, NULL, qh PRINTradius);
    -        }
    -      }
    -      qh_settempfree(&vertices);
    -    }
    -    qh visit_id++; /* for printing hyperplane intersections */
    -    break;
    -  case qh_PRINTids:
    -    qh_fprintf(fp, 9049, "%d\n", numfacets);
    -    break;
    -  case qh_PRINTincidences:
    -    if (qh VORONOI && qh PRINTprecision)
    -      qh_fprintf(qh ferr, 7053, "qhull warning: writing Delaunay.  Use 'p' or 'o' for Voronoi centers\n");
    -    qh printoutvar= qh vertex_id;  /* centrum id for non-simplicial facets */
    -    if (qh hull_dim <= 3)
    -      qh_fprintf(fp, 9050, "%d\n", numfacets);
    -    else
    -      qh_fprintf(fp, 9051, "%d\n", numsimplicial+numridges);
    -    break;
    -  case qh_PRINTinner:
    -  case qh_PRINTnormals:
    -  case qh_PRINTouter:
    -    if (qh CDDoutput)
    -      qh_fprintf(fp, 9052, "%s | %s\nbegin\n    %d %d real\n", qh rbox_command,
    -            qh qhull_command, numfacets, qh hull_dim+1);
    -    else
    -      qh_fprintf(fp, 9053, "%d\n%d\n", qh hull_dim+1, numfacets);
    -    break;
    -  case qh_PRINTmathematica:
    -  case qh_PRINTmaple:
    -    if (qh hull_dim > 3)  /* qh_initbuffers also checks */
    -      goto LABELnoformat;
    -    if (qh VORONOI)
    -      qh_fprintf(qh ferr, 7054, "qhull warning: output is the Delaunay triangulation\n");
    -    if (format == qh_PRINTmaple) {
    -      if (qh hull_dim == 2)
    -        qh_fprintf(fp, 9054, "PLOT(CURVES(\n");
    -      else
    -        qh_fprintf(fp, 9055, "PLOT3D(POLYGONS(\n");
    -    }else
    -      qh_fprintf(fp, 9056, "{\n");
    -    qh printoutvar= 0;   /* counts number of facets for notfirst */
    -    break;
    -  case qh_PRINTmerges:
    -    qh_fprintf(fp, 9057, "%d\n", numfacets);
    -    break;
    -  case qh_PRINTpointintersect:
    -    qh_fprintf(fp, 9058, "%d\n%d\n", qh hull_dim, numfacets);
    -    break;
    -  case qh_PRINTneighbors:
    -    qh_fprintf(fp, 9059, "%d\n", numfacets);
    -    break;
    -  case qh_PRINToff:
    -  case qh_PRINTtriangles:
    -    if (qh VORONOI)
    -      goto LABELnoformat;
    -    num = qh hull_dim;
    -    if (format == qh_PRINToff || qh hull_dim == 2)
    -      qh_fprintf(fp, 9060, "%d\n%d %d %d\n", num,
    -        qh num_points+qh_setsize(qh other_points), numfacets, totneighbors/2);
    -    else { /* qh_PRINTtriangles */
    -      qh printoutvar= qh num_points+qh_setsize(qh other_points); /* first centrum */
    -      if (qh DELAUNAY)
    -        num--;  /* drop last dimension */
    -      qh_fprintf(fp, 9061, "%d\n%d %d %d\n", num, qh printoutvar
    -        + numfacets - numsimplicial, numsimplicial + numridges, totneighbors/2);
    -    }
    -    FORALLpoints
    -      qh_printpointid(qh fout, NULL, num, point, -1);
    -    FOREACHpoint_(qh other_points)
    -      qh_printpointid(qh fout, NULL, num, point, -1);
    -    if (format == qh_PRINTtriangles && qh hull_dim > 2) {
    -      FORALLfacets {
    -        if (!facet->simplicial && facet->visitid)
    -          qh_printcenter(qh fout, format, NULL, facet);
    -      }
    -    }
    -    break;
    -  case qh_PRINTpointnearest:
    -    qh_fprintf(fp, 9062, "%d\n", numcoplanars);
    -    break;
    -  case qh_PRINTpoints:
    -    if (!qh VORONOI)
    -      goto LABELnoformat;
    -    if (qh CDDoutput)
    -      qh_fprintf(fp, 9063, "%s | %s\nbegin\n%d %d real\n", qh rbox_command,
    -           qh qhull_command, numfacets, qh hull_dim);
    -    else
    -      qh_fprintf(fp, 9064, "%d\n%d\n", qh hull_dim-1, numfacets);
    -    break;
    -  case qh_PRINTvertices:
    -    qh_fprintf(fp, 9065, "%d\n", numfacets);
    -    break;
    -  case qh_PRINTsummary:
    -  default:
    -  LABELnoformat:
    -    qh_fprintf(qh ferr, 6068, "qhull internal error (qh_printbegin): can not use this format for dimension %d\n",
    -         qh hull_dim);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -} /* printbegin */
    -
    -/*---------------------------------
    -
    -  qh_printcenter( fp, string, facet )
    -    print facet->center as centrum or Voronoi center
    -    string may be NULL.  Don't include '%' codes.
    -    nop if qh CENTERtype neither CENTERvoronoi nor CENTERcentrum
    -    if upper envelope of Delaunay triangulation and point at-infinity
    -      prints qh_INFINITE instead;
    -
    -  notes:
    -    defines facet->center if needed
    -    if format=PRINTgeom, adds a 0 if would otherwise be 2-d
    -    Same as QhullFacet::printCenter
    -*/
    -void qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facetT *facet) {
    -  int k, num;
    -
    -  if (qh CENTERtype != qh_ASvoronoi && qh CENTERtype != qh_AScentrum)
    -    return;
    -  if (string)
    -    qh_fprintf(fp, 9066, string);
    -  if (qh CENTERtype == qh_ASvoronoi) {
    -    num= qh hull_dim-1;
    -    if (!facet->normal || !facet->upperdelaunay || !qh ATinfinity) {
    -      if (!facet->center)
    -        facet->center= qh_facetcenter(facet->vertices);
    -      for (k=0; k < num; k++)
    -        qh_fprintf(fp, 9067, qh_REAL_1, facet->center[k]);
    -    }else {
    -      for (k=0; k < num; k++)
    -        qh_fprintf(fp, 9068, qh_REAL_1, qh_INFINITE);
    -    }
    -  }else /* qh CENTERtype == qh_AScentrum */ {
    -    num= qh hull_dim;
    -    if (format == qh_PRINTtriangles && qh DELAUNAY)
    -      num--;
    -    if (!facet->center)
    -      facet->center= qh_getcentrum(facet);
    -    for (k=0; k < num; k++)
    -      qh_fprintf(fp, 9069, qh_REAL_1, facet->center[k]);
    -  }
    -  if (format == qh_PRINTgeom && num == 2)
    -    qh_fprintf(fp, 9070, " 0\n");
    -  else
    -    qh_fprintf(fp, 9071, "\n");
    -} /* printcenter */
    -
    -/*---------------------------------
    -
    -  qh_printcentrum( fp, facet, radius )
    -    print centrum for a facet in OOGL format
    -    radius defines size of centrum
    -    2-d or 3-d only
    -
    -  returns:
    -    defines facet->center if needed
    -*/
    -void qh_printcentrum(FILE *fp, facetT *facet, realT radius) {
    -  pointT *centrum, *projpt;
    -  boolT tempcentrum= False;
    -  realT xaxis[4], yaxis[4], normal[4], dist;
    -  realT green[3]={0, 1, 0};
    -  vertexT *apex;
    -  int k;
    -
    -  if (qh CENTERtype == qh_AScentrum) {
    -    if (!facet->center)
    -      facet->center= qh_getcentrum(facet);
    -    centrum= facet->center;
    -  }else {
    -    centrum= qh_getcentrum(facet);
    -    tempcentrum= True;
    -  }
    -  qh_fprintf(fp, 9072, "{appearance {-normal -edge normscale 0} ");
    -  if (qh firstcentrum) {
    -    qh firstcentrum= False;
    -    qh_fprintf(fp, 9073, "{INST geom { define centrum CQUAD  # f%d\n\
    --0.3 -0.3 0.0001     0 0 1 1\n\
    - 0.3 -0.3 0.0001     0 0 1 1\n\
    - 0.3  0.3 0.0001     0 0 1 1\n\
    --0.3  0.3 0.0001     0 0 1 1 } transform { \n", facet->id);
    -  }else
    -    qh_fprintf(fp, 9074, "{INST geom { : centrum } transform { # f%d\n", facet->id);
    -  apex= SETfirstt_(facet->vertices, vertexT);
    -  qh_distplane(apex->point, facet, &dist);
    -  projpt= qh_projectpoint(apex->point, facet, dist);
    -  for (k=qh hull_dim; k--; ) {
    -    xaxis[k]= projpt[k] - centrum[k];
    -    normal[k]= facet->normal[k];
    -  }
    -  if (qh hull_dim == 2) {
    -    xaxis[2]= 0;
    -    normal[2]= 0;
    -  }else if (qh hull_dim == 4) {
    -    qh_projectdim3 (xaxis, xaxis);
    -    qh_projectdim3 (normal, normal);
    -    qh_normalize2 (normal, qh PRINTdim, True, NULL, NULL);
    -  }
    -  qh_crossproduct(3, xaxis, normal, yaxis);
    -  qh_fprintf(fp, 9075, "%8.4g %8.4g %8.4g 0\n", xaxis[0], xaxis[1], xaxis[2]);
    -  qh_fprintf(fp, 9076, "%8.4g %8.4g %8.4g 0\n", yaxis[0], yaxis[1], yaxis[2]);
    -  qh_fprintf(fp, 9077, "%8.4g %8.4g %8.4g 0\n", normal[0], normal[1], normal[2]);
    -  qh_printpoint3 (fp, centrum);
    -  qh_fprintf(fp, 9078, "1 }}}\n");
    -  qh_memfree(projpt, qh normal_size);
    -  qh_printpointvect(fp, centrum, facet->normal, NULL, radius, green);
    -  if (tempcentrum)
    -    qh_memfree(centrum, qh normal_size);
    -} /* printcentrum */
    -
    -/*---------------------------------
    -
    -  qh_printend( fp, format )
    -    prints trailer for all output formats
    -
    -  see:
    -    qh_printbegin() and qh_printafacet()
    -
    -*/
    -void qh_printend(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall) {
    -  int num;
    -  facetT *facet, **facetp;
    -
    -  if (!qh printoutnum)
    -    qh_fprintf(qh ferr, 7055, "qhull warning: no facets printed\n");
    -  switch (format) {
    -  case qh_PRINTgeom:
    -    if (qh hull_dim == 4 && qh DROPdim < 0  && !qh PRINTnoplanes) {
    -      qh visit_id++;
    -      num= 0;
    -      FORALLfacet_(facetlist)
    -        qh_printend4geom(fp, facet,&num, printall);
    -      FOREACHfacet_(facets)
    -        qh_printend4geom(fp, facet, &num, printall);
    -      if (num != qh ridgeoutnum || qh printoutvar != qh ridgeoutnum) {
    -        qh_fprintf(qh ferr, 6069, "qhull internal error (qh_printend): number of ridges %d != number printed %d and at end %d\n", qh ridgeoutnum, qh printoutvar, num);
    -        qh_errexit(qh_ERRqhull, NULL, NULL);
    -      }
    -    }else
    -      qh_fprintf(fp, 9079, "}\n");
    -    break;
    -  case qh_PRINTinner:
    -  case qh_PRINTnormals:
    -  case qh_PRINTouter:
    -    if (qh CDDoutput)
    -      qh_fprintf(fp, 9080, "end\n");
    -    break;
    -  case qh_PRINTmaple:
    -    qh_fprintf(fp, 9081, "));\n");
    -    break;
    -  case qh_PRINTmathematica:
    -    qh_fprintf(fp, 9082, "}\n");
    -    break;
    -  case qh_PRINTpoints:
    -    if (qh CDDoutput)
    -      qh_fprintf(fp, 9083, "end\n");
    -    break;
    -  default:
    -    break;
    -  }
    -} /* printend */
    -
    -/*---------------------------------
    -
    -  qh_printend4geom( fp, facet, numridges, printall )
    -    helper function for qh_printbegin/printend
    -
    -  returns:
    -    number of printed ridges
    -
    -  notes:
    -    just counts printed ridges if fp=NULL
    -    uses facet->visitid
    -    must agree with qh_printfacet4geom...
    -
    -  design:
    -    computes color for facet from its normal
    -    prints each ridge of facet
    -*/
    -void qh_printend4geom(FILE *fp, facetT *facet, int *nump, boolT printall) {
    -  realT color[3];
    -  int i, num= *nump;
    -  facetT *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -
    -  if (!printall && qh_skipfacet(facet))
    -    return;
    -  if (qh PRINTnoplanes || (facet->visible && qh NEWfacets))
    -    return;
    -  if (!facet->normal)
    -    return;
    -  if (fp) {
    -    for (i=0; i < 3; i++) {
    -      color[i]= (facet->normal[i]+1.0)/2.0;
    -      maximize_(color[i], -1.0);
    -      minimize_(color[i], +1.0);
    -    }
    -  }
    -  facet->visitid= qh visit_id;
    -  if (facet->simplicial) {
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid != qh visit_id) {
    -        if (fp)
    -          qh_fprintf(fp, 9084, "3 %d %d %d %8.4g %8.4g %8.4g 1 # f%d f%d\n",
    -                 3*num, 3*num+1, 3*num+2, color[0], color[1], color[2],
    -                 facet->id, neighbor->id);
    -        num++;
    -      }
    -    }
    -  }else {
    -    FOREACHridge_(facet->ridges) {
    -      neighbor= otherfacet_(ridge, facet);
    -      if (neighbor->visitid != qh visit_id) {
    -        if (fp)
    -          qh_fprintf(fp, 9085, "3 %d %d %d %8.4g %8.4g %8.4g 1 #r%d f%d f%d\n",
    -                 3*num, 3*num+1, 3*num+2, color[0], color[1], color[2],
    -                 ridge->id, facet->id, neighbor->id);
    -        num++;
    -      }
    -    }
    -  }
    -  *nump= num;
    -} /* printend4geom */
    -
    -/*---------------------------------
    -
    -  qh_printextremes( fp, facetlist, facets, printall )
    -    print extreme points for convex hulls or halfspace intersections
    -
    -  notes:
    -    #points, followed by ids, one per line
    -
    -    sorted by id
    -    same order as qh_printpoints_out if no coplanar/interior points
    -*/
    -void qh_printextremes(FILE *fp, facetT *facetlist, setT *facets, boolT printall) {
    -  setT *vertices, *points;
    -  pointT *point;
    -  vertexT *vertex, **vertexp;
    -  int id;
    -  int numpoints=0, point_i, point_n;
    -  int allpoints= qh num_points + qh_setsize(qh other_points);
    -
    -  points= qh_settemp(allpoints);
    -  qh_setzero(points, 0, allpoints);
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  FOREACHvertex_(vertices) {
    -    id= qh_pointid(vertex->point);
    -    if (id >= 0) {
    -      SETelem_(points, id)= vertex->point;
    -      numpoints++;
    -    }
    -  }
    -  qh_settempfree(&vertices);
    -  qh_fprintf(fp, 9086, "%d\n", numpoints);
    -  FOREACHpoint_i_(points) {
    -    if (point)
    -      qh_fprintf(fp, 9087, "%d\n", point_i);
    -  }
    -  qh_settempfree(&points);
    -} /* printextremes */
    -
    -/*---------------------------------
    -
    -  qh_printextremes_2d( fp, facetlist, facets, printall )
    -    prints point ids for facets in qh_ORIENTclock order
    -
    -  notes:
    -    #points, followed by ids, one per line
    -    if facetlist/facets are disjoint than the output includes skips
    -    errors if facets form a loop
    -    does not print coplanar points
    -*/
    -void qh_printextremes_2d(FILE *fp, facetT *facetlist, setT *facets, boolT printall) {
    -  int numfacets, numridges, totneighbors, numcoplanars, numsimplicial, numtricoplanars;
    -  setT *vertices;
    -  facetT *facet, *startfacet, *nextfacet;
    -  vertexT *vertexA, *vertexB;
    -
    -  qh_countfacets(facetlist, facets, printall, &numfacets, &numsimplicial,
    -      &totneighbors, &numridges, &numcoplanars, &numtricoplanars); /* marks qh visit_id */
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  qh_fprintf(fp, 9088, "%d\n", qh_setsize(vertices));
    -  qh_settempfree(&vertices);
    -  if (!numfacets)
    -    return;
    -  facet= startfacet= facetlist ? facetlist : SETfirstt_(facets, facetT);
    -  qh vertex_visit++;
    -  qh visit_id++;
    -  do {
    -    if (facet->toporient ^ qh_ORIENTclock) {
    -      vertexA= SETfirstt_(facet->vertices, vertexT);
    -      vertexB= SETsecondt_(facet->vertices, vertexT);
    -      nextfacet= SETfirstt_(facet->neighbors, facetT);
    -    }else {
    -      vertexA= SETsecondt_(facet->vertices, vertexT);
    -      vertexB= SETfirstt_(facet->vertices, vertexT);
    -      nextfacet= SETsecondt_(facet->neighbors, facetT);
    -    }
    -    if (facet->visitid == qh visit_id) {
    -      qh_fprintf(qh ferr, 6218, "Qhull internal error (qh_printextremes_2d): loop in facet list.  facet %d nextfacet %d\n",
    -                 facet->id, nextfacet->id);
    -      qh_errexit2 (qh_ERRqhull, facet, nextfacet);
    -    }
    -    if (facet->visitid) {
    -      if (vertexA->visitid != qh vertex_visit) {
    -        vertexA->visitid= qh vertex_visit;
    -        qh_fprintf(fp, 9089, "%d\n", qh_pointid(vertexA->point));
    -      }
    -      if (vertexB->visitid != qh vertex_visit) {
    -        vertexB->visitid= qh vertex_visit;
    -        qh_fprintf(fp, 9090, "%d\n", qh_pointid(vertexB->point));
    -      }
    -    }
    -    facet->visitid= qh visit_id;
    -    facet= nextfacet;
    -  }while (facet && facet != startfacet);
    -} /* printextremes_2d */
    -
    -/*---------------------------------
    -
    -  qh_printextremes_d( fp, facetlist, facets, printall )
    -    print extreme points of input sites for Delaunay triangulations
    -
    -  notes:
    -    #points, followed by ids, one per line
    -
    -    unordered
    -*/
    -void qh_printextremes_d(FILE *fp, facetT *facetlist, setT *facets, boolT printall) {
    -  setT *vertices;
    -  vertexT *vertex, **vertexp;
    -  boolT upperseen, lowerseen;
    -  facetT *neighbor, **neighborp;
    -  int numpoints=0;
    -
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  qh_vertexneighbors();
    -  FOREACHvertex_(vertices) {
    -    upperseen= lowerseen= False;
    -    FOREACHneighbor_(vertex) {
    -      if (neighbor->upperdelaunay)
    -        upperseen= True;
    -      else
    -        lowerseen= True;
    -    }
    -    if (upperseen && lowerseen) {
    -      vertex->seen= True;
    -      numpoints++;
    -    }else
    -      vertex->seen= False;
    -  }
    -  qh_fprintf(fp, 9091, "%d\n", numpoints);
    -  FOREACHvertex_(vertices) {
    -    if (vertex->seen)
    -      qh_fprintf(fp, 9092, "%d\n", qh_pointid(vertex->point));
    -  }
    -  qh_settempfree(&vertices);
    -} /* printextremes_d */
    -
    -/*---------------------------------
    -
    -  qh_printfacet( fp, facet )
    -    prints all fields of a facet to fp
    -
    -  notes:
    -    ridges printed in neighbor order
    -*/
    -void qh_printfacet(FILE *fp, facetT *facet) {
    -
    -  qh_printfacetheader(fp, facet);
    -  if (facet->ridges)
    -    qh_printfacetridges(fp, facet);
    -} /* printfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet2geom( fp, facet, color )
    -    print facet as part of a 2-d VECT for Geomview
    -
    -    notes:
    -      assume precise calculations in io.c with roundoff covered by qh_GEOMepsilon
    -      mindist is calculated within io.c.  maxoutside is calculated elsewhere
    -      so a DISTround error may have occured.
    -*/
    -void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]) {
    -  pointT *point0, *point1;
    -  realT mindist, innerplane, outerplane;
    -  int k;
    -
    -  qh_facet2point(facet, &point0, &point1, &mindist);
    -  qh_geomplanes(facet, &outerplane, &innerplane);
    -  if (qh PRINTouter || (!qh PRINTnoplanes && !qh PRINTinner))
    -    qh_printfacet2geom_points(fp, point0, point1, facet, outerplane, color);
    -  if (qh PRINTinner || (!qh PRINTnoplanes && !qh PRINTouter &&
    -                outerplane - innerplane > 2 * qh MAXabs_coord * qh_GEOMepsilon)) {
    -    for (k=3; k--; )
    -      color[k]= 1.0 - color[k];
    -    qh_printfacet2geom_points(fp, point0, point1, facet, innerplane, color);
    -  }
    -  qh_memfree(point1, qh normal_size);
    -  qh_memfree(point0, qh normal_size);
    -} /* printfacet2geom */
    -
    -/*---------------------------------
    -
    -  qh_printfacet2geom_points( fp, point1, point2, facet, offset, color )
    -    prints a 2-d facet as a VECT with 2 points at some offset.
    -    The points are on the facet's plane.
    -*/
    -void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2,
    -                               facetT *facet, realT offset, realT color[3]) {
    -  pointT *p1= point1, *p2= point2;
    -
    -  qh_fprintf(fp, 9093, "VECT 1 2 1 2 1 # f%d\n", facet->id);
    -  if (offset != 0.0) {
    -    p1= qh_projectpoint(p1, facet, -offset);
    -    p2= qh_projectpoint(p2, facet, -offset);
    -  }
    -  qh_fprintf(fp, 9094, "%8.4g %8.4g %8.4g\n%8.4g %8.4g %8.4g\n",
    -           p1[0], p1[1], 0.0, p2[0], p2[1], 0.0);
    -  if (offset != 0.0) {
    -    qh_memfree(p1, qh normal_size);
    -    qh_memfree(p2, qh normal_size);
    -  }
    -  qh_fprintf(fp, 9095, "%8.4g %8.4g %8.4g 1.0\n", color[0], color[1], color[2]);
    -} /* printfacet2geom_points */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet2math( fp, facet, format, notfirst )
    -    print 2-d Maple or Mathematica output for a facet
    -    may be non-simplicial
    -
    -  notes:
    -    use %16.8f since Mathematica 2.2 does not handle exponential format
    -    see qh_printfacet3math
    -*/
    -void qh_printfacet2math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst) {
    -  pointT *point0, *point1;
    -  realT mindist;
    -  const char *pointfmt;
    -
    -  qh_facet2point(facet, &point0, &point1, &mindist);
    -  if (notfirst)
    -    qh_fprintf(fp, 9096, ",");
    -  if (format == qh_PRINTmaple)
    -    pointfmt= "[[%16.8f, %16.8f], [%16.8f, %16.8f]]\n";
    -  else
    -    pointfmt= "Line[{{%16.8f, %16.8f}, {%16.8f, %16.8f}}]\n";
    -  qh_fprintf(fp, 9097, pointfmt, point0[0], point0[1], point1[0], point1[1]);
    -  qh_memfree(point1, qh normal_size);
    -  qh_memfree(point0, qh normal_size);
    -} /* printfacet2math */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet3geom_nonsimplicial( fp, facet, color )
    -    print Geomview OFF for a 3-d nonsimplicial facet.
    -    if DOintersections, prints ridges to unvisited neighbors(qh visit_id)
    -
    -  notes
    -    uses facet->visitid for intersections and ridges
    -*/
    -void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]) {
    -  ridgeT *ridge, **ridgep;
    -  setT *projectedpoints, *vertices;
    -  vertexT *vertex, **vertexp, *vertexA, *vertexB;
    -  pointT *projpt, *point, **pointp;
    -  facetT *neighbor;
    -  realT dist, outerplane, innerplane;
    -  int cntvertices, k;
    -  realT black[3]={0, 0, 0}, green[3]={0, 1, 0};
    -
    -  qh_geomplanes(facet, &outerplane, &innerplane);
    -  vertices= qh_facet3vertex(facet); /* oriented */
    -  cntvertices= qh_setsize(vertices);
    -  projectedpoints= qh_settemp(cntvertices);
    -  FOREACHvertex_(vertices) {
    -    zinc_(Zdistio);
    -    qh_distplane(vertex->point, facet, &dist);
    -    projpt= qh_projectpoint(vertex->point, facet, dist);
    -    qh_setappend(&projectedpoints, projpt);
    -  }
    -  if (qh PRINTouter || (!qh PRINTnoplanes && !qh PRINTinner))
    -    qh_printfacet3geom_points(fp, projectedpoints, facet, outerplane, color);
    -  if (qh PRINTinner || (!qh PRINTnoplanes && !qh PRINTouter &&
    -                outerplane - innerplane > 2 * qh MAXabs_coord * qh_GEOMepsilon)) {
    -    for (k=3; k--; )
    -      color[k]= 1.0 - color[k];
    -    qh_printfacet3geom_points(fp, projectedpoints, facet, innerplane, color);
    -  }
    -  FOREACHpoint_(projectedpoints)
    -    qh_memfree(point, qh normal_size);
    -  qh_settempfree(&projectedpoints);
    -  qh_settempfree(&vertices);
    -  if ((qh DOintersections || qh PRINTridges)
    -  && (!facet->visible || !qh NEWfacets)) {
    -    facet->visitid= qh visit_id;
    -    FOREACHridge_(facet->ridges) {
    -      neighbor= otherfacet_(ridge, facet);
    -      if (neighbor->visitid != qh visit_id) {
    -        if (qh DOintersections)
    -          qh_printhyperplaneintersection(fp, facet, neighbor, ridge->vertices, black);
    -        if (qh PRINTridges) {
    -          vertexA= SETfirstt_(ridge->vertices, vertexT);
    -          vertexB= SETsecondt_(ridge->vertices, vertexT);
    -          qh_printline3geom(fp, vertexA->point, vertexB->point, green);
    -        }
    -      }
    -    }
    -  }
    -} /* printfacet3geom_nonsimplicial */
    -
    -/*---------------------------------
    -
    -  qh_printfacet3geom_points( fp, points, facet, offset )
    -    prints a 3-d facet as OFF Geomview object.
    -    offset is relative to the facet's hyperplane
    -    Facet is determined as a list of points
    -*/
    -void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]) {
    -  int k, n= qh_setsize(points), i;
    -  pointT *point, **pointp;
    -  setT *printpoints;
    -
    -  qh_fprintf(fp, 9098, "{ OFF %d 1 1 # f%d\n", n, facet->id);
    -  if (offset != 0.0) {
    -    printpoints= qh_settemp(n);
    -    FOREACHpoint_(points)
    -      qh_setappend(&printpoints, qh_projectpoint(point, facet, -offset));
    -  }else
    -    printpoints= points;
    -  FOREACHpoint_(printpoints) {
    -    for (k=0; k < qh hull_dim; k++) {
    -      if (k == qh DROPdim)
    -        qh_fprintf(fp, 9099, "0 ");
    -      else
    -        qh_fprintf(fp, 9100, "%8.4g ", point[k]);
    -    }
    -    if (printpoints != points)
    -      qh_memfree(point, qh normal_size);
    -    qh_fprintf(fp, 9101, "\n");
    -  }
    -  if (printpoints != points)
    -    qh_settempfree(&printpoints);
    -  qh_fprintf(fp, 9102, "%d ", n);
    -  for (i=0; i < n; i++)
    -    qh_fprintf(fp, 9103, "%d ", i);
    -  qh_fprintf(fp, 9104, "%8.4g %8.4g %8.4g 1.0 }\n", color[0], color[1], color[2]);
    -} /* printfacet3geom_points */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet3geom_simplicial(  )
    -    print Geomview OFF for a 3-d simplicial facet.
    -
    -  notes:
    -    may flip color
    -    uses facet->visitid for intersections and ridges
    -
    -    assume precise calculations in io.c with roundoff covered by qh_GEOMepsilon
    -    innerplane may be off by qh DISTround.  Maxoutside is calculated elsewhere
    -    so a DISTround error may have occured.
    -*/
    -void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]) {
    -  setT *points, *vertices;
    -  vertexT *vertex, **vertexp, *vertexA, *vertexB;
    -  facetT *neighbor, **neighborp;
    -  realT outerplane, innerplane;
    -  realT black[3]={0, 0, 0}, green[3]={0, 1, 0};
    -  int k;
    -
    -  qh_geomplanes(facet, &outerplane, &innerplane);
    -  vertices= qh_facet3vertex(facet);
    -  points= qh_settemp(qh TEMPsize);
    -  FOREACHvertex_(vertices)
    -    qh_setappend(&points, vertex->point);
    -  if (qh PRINTouter || (!qh PRINTnoplanes && !qh PRINTinner))
    -    qh_printfacet3geom_points(fp, points, facet, outerplane, color);
    -  if (qh PRINTinner || (!qh PRINTnoplanes && !qh PRINTouter &&
    -              outerplane - innerplane > 2 * qh MAXabs_coord * qh_GEOMepsilon)) {
    -    for (k=3; k--; )
    -      color[k]= 1.0 - color[k];
    -    qh_printfacet3geom_points(fp, points, facet, innerplane, color);
    -  }
    -  qh_settempfree(&points);
    -  qh_settempfree(&vertices);
    -  if ((qh DOintersections || qh PRINTridges)
    -  && (!facet->visible || !qh NEWfacets)) {
    -    facet->visitid= qh visit_id;
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid != qh visit_id) {
    -        vertices= qh_setnew_delnthsorted(facet->vertices, qh hull_dim,
    -                          SETindex_(facet->neighbors, neighbor), 0);
    -        if (qh DOintersections)
    -           qh_printhyperplaneintersection(fp, facet, neighbor, vertices, black);
    -        if (qh PRINTridges) {
    -          vertexA= SETfirstt_(vertices, vertexT);
    -          vertexB= SETsecondt_(vertices, vertexT);
    -          qh_printline3geom(fp, vertexA->point, vertexB->point, green);
    -        }
    -        qh_setfree(&vertices);
    -      }
    -    }
    -  }
    -} /* printfacet3geom_simplicial */
    -
    -/*---------------------------------
    -
    -  qh_printfacet3math( fp, facet, notfirst )
    -    print 3-d Maple or Mathematica output for a facet
    -
    -  notes:
    -    may be non-simplicial
    -    use %16.8f since Mathematica 2.2 does not handle exponential format
    -    see qh_printfacet2math
    -*/
    -void qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst) {
    -  vertexT *vertex, **vertexp;
    -  setT *points, *vertices;
    -  pointT *point, **pointp;
    -  boolT firstpoint= True;
    -  realT dist;
    -  const char *pointfmt, *endfmt;
    -
    -  if (notfirst)
    -    qh_fprintf(fp, 9105, ",\n");
    -  vertices= qh_facet3vertex(facet);
    -  points= qh_settemp(qh_setsize(vertices));
    -  FOREACHvertex_(vertices) {
    -    zinc_(Zdistio);
    -    qh_distplane(vertex->point, facet, &dist);
    -    point= qh_projectpoint(vertex->point, facet, dist);
    -    qh_setappend(&points, point);
    -  }
    -  if (format == qh_PRINTmaple) {
    -    qh_fprintf(fp, 9106, "[");
    -    pointfmt= "[%16.8f, %16.8f, %16.8f]";
    -    endfmt= "]";
    -  }else {
    -    qh_fprintf(fp, 9107, "Polygon[{");
    -    pointfmt= "{%16.8f, %16.8f, %16.8f}";
    -    endfmt= "}]";
    -  }
    -  FOREACHpoint_(points) {
    -    if (firstpoint)
    -      firstpoint= False;
    -    else
    -      qh_fprintf(fp, 9108, ",\n");
    -    qh_fprintf(fp, 9109, pointfmt, point[0], point[1], point[2]);
    -  }
    -  FOREACHpoint_(points)
    -    qh_memfree(point, qh normal_size);
    -  qh_settempfree(&points);
    -  qh_settempfree(&vertices);
    -  qh_fprintf(fp, 9110, endfmt);
    -} /* printfacet3math */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet3vertex( fp, facet, format )
    -    print vertices in a 3-d facet as point ids
    -
    -  notes:
    -    prints number of vertices first if format == qh_PRINToff
    -    the facet may be non-simplicial
    -*/
    -void qh_printfacet3vertex(FILE *fp, facetT *facet, qh_PRINT format) {
    -  vertexT *vertex, **vertexp;
    -  setT *vertices;
    -
    -  vertices= qh_facet3vertex(facet);
    -  if (format == qh_PRINToff)
    -    qh_fprintf(fp, 9111, "%d ", qh_setsize(vertices));
    -  FOREACHvertex_(vertices)
    -    qh_fprintf(fp, 9112, "%d ", qh_pointid(vertex->point));
    -  qh_fprintf(fp, 9113, "\n");
    -  qh_settempfree(&vertices);
    -} /* printfacet3vertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet4geom_nonsimplicial(  )
    -    print Geomview 4OFF file for a 4d nonsimplicial facet
    -    prints all ridges to unvisited neighbors (qh.visit_id)
    -    if qh.DROPdim
    -      prints in OFF format
    -
    -  notes:
    -    must agree with printend4geom()
    -*/
    -void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]) {
    -  facetT *neighbor;
    -  ridgeT *ridge, **ridgep;
    -  vertexT *vertex, **vertexp;
    -  pointT *point;
    -  int k;
    -  realT dist;
    -
    -  facet->visitid= qh visit_id;
    -  if (qh PRINTnoplanes || (facet->visible && qh NEWfacets))
    -    return;
    -  FOREACHridge_(facet->ridges) {
    -    neighbor= otherfacet_(ridge, facet);
    -    if (neighbor->visitid == qh visit_id)
    -      continue;
    -    if (qh PRINTtransparent && !neighbor->good)
    -      continue;
    -    if (qh DOintersections)
    -      qh_printhyperplaneintersection(fp, facet, neighbor, ridge->vertices, color);
    -    else {
    -      if (qh DROPdim >= 0)
    -        qh_fprintf(fp, 9114, "OFF 3 1 1 # f%d\n", facet->id);
    -      else {
    -        qh printoutvar++;
    -        qh_fprintf(fp, 9115, "# r%d between f%d f%d\n", ridge->id, facet->id, neighbor->id);
    -      }
    -      FOREACHvertex_(ridge->vertices) {
    -        zinc_(Zdistio);
    -        qh_distplane(vertex->point,facet, &dist);
    -        point=qh_projectpoint(vertex->point,facet, dist);
    -        for (k=0; k < qh hull_dim; k++) {
    -          if (k != qh DROPdim)
    -            qh_fprintf(fp, 9116, "%8.4g ", point[k]);
    -        }
    -        qh_fprintf(fp, 9117, "\n");
    -        qh_memfree(point, qh normal_size);
    -      }
    -      if (qh DROPdim >= 0)
    -        qh_fprintf(fp, 9118, "3 0 1 2 %8.4g %8.4g %8.4g\n", color[0], color[1], color[2]);
    -    }
    -  }
    -} /* printfacet4geom_nonsimplicial */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacet4geom_simplicial( fp, facet, color )
    -    print Geomview 4OFF file for a 4d simplicial facet
    -    prints triangles for unvisited neighbors (qh.visit_id)
    -
    -  notes:
    -    must agree with printend4geom()
    -*/
    -void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]) {
    -  setT *vertices;
    -  facetT *neighbor, **neighborp;
    -  vertexT *vertex, **vertexp;
    -  int k;
    -
    -  facet->visitid= qh visit_id;
    -  if (qh PRINTnoplanes || (facet->visible && qh NEWfacets))
    -    return;
    -  FOREACHneighbor_(facet) {
    -    if (neighbor->visitid == qh visit_id)
    -      continue;
    -    if (qh PRINTtransparent && !neighbor->good)
    -      continue;
    -    vertices= qh_setnew_delnthsorted(facet->vertices, qh hull_dim,
    -                          SETindex_(facet->neighbors, neighbor), 0);
    -    if (qh DOintersections)
    -      qh_printhyperplaneintersection(fp, facet, neighbor, vertices, color);
    -    else {
    -      if (qh DROPdim >= 0)
    -        qh_fprintf(fp, 9119, "OFF 3 1 1 # ridge between f%d f%d\n",
    -                facet->id, neighbor->id);
    -      else {
    -        qh printoutvar++;
    -        qh_fprintf(fp, 9120, "# ridge between f%d f%d\n", facet->id, neighbor->id);
    -      }
    -      FOREACHvertex_(vertices) {
    -        for (k=0; k < qh hull_dim; k++) {
    -          if (k != qh DROPdim)
    -            qh_fprintf(fp, 9121, "%8.4g ", vertex->point[k]);
    -        }
    -        qh_fprintf(fp, 9122, "\n");
    -      }
    -      if (qh DROPdim >= 0)
    -        qh_fprintf(fp, 9123, "3 0 1 2 %8.4g %8.4g %8.4g\n", color[0], color[1], color[2]);
    -    }
    -    qh_setfree(&vertices);
    -  }
    -} /* printfacet4geom_simplicial */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacetNvertex_nonsimplicial( fp, facet, id, format )
    -    print vertices for an N-d non-simplicial facet
    -    triangulates each ridge to the id
    -*/
    -void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, qh_PRINT format) {
    -  vertexT *vertex, **vertexp;
    -  ridgeT *ridge, **ridgep;
    -
    -  if (facet->visible && qh NEWfacets)
    -    return;
    -  FOREACHridge_(facet->ridges) {
    -    if (format == qh_PRINTtriangles)
    -      qh_fprintf(fp, 9124, "%d ", qh hull_dim);
    -    qh_fprintf(fp, 9125, "%d ", id);
    -    if ((ridge->top == facet) ^ qh_ORIENTclock) {
    -      FOREACHvertex_(ridge->vertices)
    -        qh_fprintf(fp, 9126, "%d ", qh_pointid(vertex->point));
    -    }else {
    -      FOREACHvertexreverse12_(ridge->vertices)
    -        qh_fprintf(fp, 9127, "%d ", qh_pointid(vertex->point));
    -    }
    -    qh_fprintf(fp, 9128, "\n");
    -  }
    -} /* printfacetNvertex_nonsimplicial */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacetNvertex_simplicial( fp, facet, format )
    -    print vertices for an N-d simplicial facet
    -    prints vertices for non-simplicial facets
    -      2-d facets (orientation preserved by qh_mergefacet2d)
    -      PRINToff ('o') for 4-d and higher
    -*/
    -void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, qh_PRINT format) {
    -  vertexT *vertex, **vertexp;
    -
    -  if (format == qh_PRINToff || format == qh_PRINTtriangles)
    -    qh_fprintf(fp, 9129, "%d ", qh_setsize(facet->vertices));
    -  if ((facet->toporient ^ qh_ORIENTclock)
    -  || (qh hull_dim > 2 && !facet->simplicial)) {
    -    FOREACHvertex_(facet->vertices)
    -      qh_fprintf(fp, 9130, "%d ", qh_pointid(vertex->point));
    -  }else {
    -    FOREACHvertexreverse12_(facet->vertices)
    -      qh_fprintf(fp, 9131, "%d ", qh_pointid(vertex->point));
    -  }
    -  qh_fprintf(fp, 9132, "\n");
    -} /* printfacetNvertex_simplicial */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacetheader( fp, facet )
    -    prints header fields of a facet to fp
    -
    -  notes:
    -    for 'f' output and debugging
    -    Same as QhullFacet::printHeader()
    -*/
    -void qh_printfacetheader(FILE *fp, facetT *facet) {
    -  pointT *point, **pointp, *furthest;
    -  facetT *neighbor, **neighborp;
    -  realT dist;
    -
    -  if (facet == qh_MERGEridge) {
    -    qh_fprintf(fp, 9133, " MERGEridge\n");
    -    return;
    -  }else if (facet == qh_DUPLICATEridge) {
    -    qh_fprintf(fp, 9134, " DUPLICATEridge\n");
    -    return;
    -  }else if (!facet) {
    -    qh_fprintf(fp, 9135, " NULLfacet\n");
    -    return;
    -  }
    -  qh old_randomdist= qh RANDOMdist;
    -  qh RANDOMdist= False;
    -  qh_fprintf(fp, 9136, "- f%d\n", facet->id);
    -  qh_fprintf(fp, 9137, "    - flags:");
    -  if (facet->toporient)
    -    qh_fprintf(fp, 9138, " top");
    -  else
    -    qh_fprintf(fp, 9139, " bottom");
    -  if (facet->simplicial)
    -    qh_fprintf(fp, 9140, " simplicial");
    -  if (facet->tricoplanar)
    -    qh_fprintf(fp, 9141, " tricoplanar");
    -  if (facet->upperdelaunay)
    -    qh_fprintf(fp, 9142, " upperDelaunay");
    -  if (facet->visible)
    -    qh_fprintf(fp, 9143, " visible");
    -  if (facet->newfacet)
    -    qh_fprintf(fp, 9144, " new");
    -  if (facet->tested)
    -    qh_fprintf(fp, 9145, " tested");
    -  if (!facet->good)
    -    qh_fprintf(fp, 9146, " notG");
    -  if (facet->seen)
    -    qh_fprintf(fp, 9147, " seen");
    -  if (facet->coplanar)
    -    qh_fprintf(fp, 9148, " coplanar");
    -  if (facet->mergehorizon)
    -    qh_fprintf(fp, 9149, " mergehorizon");
    -  if (facet->keepcentrum)
    -    qh_fprintf(fp, 9150, " keepcentrum");
    -  if (facet->dupridge)
    -    qh_fprintf(fp, 9151, " dupridge");
    -  if (facet->mergeridge && !facet->mergeridge2)
    -    qh_fprintf(fp, 9152, " mergeridge1");
    -  if (facet->mergeridge2)
    -    qh_fprintf(fp, 9153, " mergeridge2");
    -  if (facet->newmerge)
    -    qh_fprintf(fp, 9154, " newmerge");
    -  if (facet->flipped)
    -    qh_fprintf(fp, 9155, " flipped");
    -  if (facet->notfurthest)
    -    qh_fprintf(fp, 9156, " notfurthest");
    -  if (facet->degenerate)
    -    qh_fprintf(fp, 9157, " degenerate");
    -  if (facet->redundant)
    -    qh_fprintf(fp, 9158, " redundant");
    -  qh_fprintf(fp, 9159, "\n");
    -  if (facet->isarea)
    -    qh_fprintf(fp, 9160, "    - area: %2.2g\n", facet->f.area);
    -  else if (qh NEWfacets && facet->visible && facet->f.replace)
    -    qh_fprintf(fp, 9161, "    - replacement: f%d\n", facet->f.replace->id);
    -  else if (facet->newfacet) {
    -    if (facet->f.samecycle && facet->f.samecycle != facet)
    -      qh_fprintf(fp, 9162, "    - shares same visible/horizon as f%d\n", facet->f.samecycle->id);
    -  }else if (facet->tricoplanar /* !isarea */) {
    -    if (facet->f.triowner)
    -      qh_fprintf(fp, 9163, "    - owner of normal & centrum is facet f%d\n", facet->f.triowner->id);
    -  }else if (facet->f.newcycle)
    -    qh_fprintf(fp, 9164, "    - was horizon to f%d\n", facet->f.newcycle->id);
    -  if (facet->nummerge)
    -    qh_fprintf(fp, 9165, "    - merges: %d\n", facet->nummerge);
    -  qh_printpointid(fp, "    - normal: ", qh hull_dim, facet->normal, -1);
    -  qh_fprintf(fp, 9166, "    - offset: %10.7g\n", facet->offset);
    -  if (qh CENTERtype == qh_ASvoronoi || facet->center)
    -    qh_printcenter(fp, qh_PRINTfacets, "    - center: ", facet);
    -#if qh_MAXoutside
    -  if (facet->maxoutside > qh DISTround)
    -    qh_fprintf(fp, 9167, "    - maxoutside: %10.7g\n", facet->maxoutside);
    -#endif
    -  if (!SETempty_(facet->outsideset)) {
    -    furthest= (pointT*)qh_setlast(facet->outsideset);
    -    if (qh_setsize(facet->outsideset) < 6) {
    -      qh_fprintf(fp, 9168, "    - outside set(furthest p%d):\n", qh_pointid(furthest));
    -      FOREACHpoint_(facet->outsideset)
    -        qh_printpoint(fp, "     ", point);
    -    }else if (qh_setsize(facet->outsideset) < 21) {
    -      qh_printpoints(fp, "    - outside set:", facet->outsideset);
    -    }else {
    -      qh_fprintf(fp, 9169, "    - outside set:  %d points.", qh_setsize(facet->outsideset));
    -      qh_printpoint(fp, "  Furthest", furthest);
    -    }
    -#if !qh_COMPUTEfurthest
    -    qh_fprintf(fp, 9170, "    - furthest distance= %2.2g\n", facet->furthestdist);
    -#endif
    -  }
    -  if (!SETempty_(facet->coplanarset)) {
    -    furthest= (pointT*)qh_setlast(facet->coplanarset);
    -    if (qh_setsize(facet->coplanarset) < 6) {
    -      qh_fprintf(fp, 9171, "    - coplanar set(furthest p%d):\n", qh_pointid(furthest));
    -      FOREACHpoint_(facet->coplanarset)
    -        qh_printpoint(fp, "     ", point);
    -    }else if (qh_setsize(facet->coplanarset) < 21) {
    -      qh_printpoints(fp, "    - coplanar set:", facet->coplanarset);
    -    }else {
    -      qh_fprintf(fp, 9172, "    - coplanar set:  %d points.", qh_setsize(facet->coplanarset));
    -      qh_printpoint(fp, "  Furthest", furthest);
    -    }
    -    zinc_(Zdistio);
    -    qh_distplane(furthest, facet, &dist);
    -    qh_fprintf(fp, 9173, "      furthest distance= %2.2g\n", dist);
    -  }
    -  qh_printvertices(fp, "    - vertices:", facet->vertices);
    -  qh_fprintf(fp, 9174, "    - neighboring facets:");
    -  FOREACHneighbor_(facet) {
    -    if (neighbor == qh_MERGEridge)
    -      qh_fprintf(fp, 9175, " MERGE");
    -    else if (neighbor == qh_DUPLICATEridge)
    -      qh_fprintf(fp, 9176, " DUP");
    -    else
    -      qh_fprintf(fp, 9177, " f%d", neighbor->id);
    -  }
    -  qh_fprintf(fp, 9178, "\n");
    -  qh RANDOMdist= qh old_randomdist;
    -} /* printfacetheader */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacetridges( fp, facet )
    -    prints ridges of a facet to fp
    -
    -  notes:
    -    ridges printed in neighbor order
    -    assumes the ridges exist
    -    for 'f' output
    -    same as QhullFacet::printRidges
    -*/
    -void qh_printfacetridges(FILE *fp, facetT *facet) {
    -  facetT *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -  int numridges= 0;
    -
    -
    -  if (facet->visible && qh NEWfacets) {
    -    qh_fprintf(fp, 9179, "    - ridges(ids may be garbage):");
    -    FOREACHridge_(facet->ridges)
    -      qh_fprintf(fp, 9180, " r%d", ridge->id);
    -    qh_fprintf(fp, 9181, "\n");
    -  }else {
    -    qh_fprintf(fp, 9182, "    - ridges:\n");
    -    FOREACHridge_(facet->ridges)
    -      ridge->seen= False;
    -    if (qh hull_dim == 3) {
    -      ridge= SETfirstt_(facet->ridges, ridgeT);
    -      while (ridge && !ridge->seen) {
    -        ridge->seen= True;
    -        qh_printridge(fp, ridge);
    -        numridges++;
    -        ridge= qh_nextridge3d(ridge, facet, NULL);
    -        }
    -    }else {
    -      FOREACHneighbor_(facet) {
    -        FOREACHridge_(facet->ridges) {
    -          if (otherfacet_(ridge,facet) == neighbor) {
    -            ridge->seen= True;
    -            qh_printridge(fp, ridge);
    -            numridges++;
    -          }
    -        }
    -      }
    -    }
    -    if (numridges != qh_setsize(facet->ridges)) {
    -      qh_fprintf(fp, 9183, "     - all ridges:");
    -      FOREACHridge_(facet->ridges)
    -        qh_fprintf(fp, 9184, " r%d", ridge->id);
    -        qh_fprintf(fp, 9185, "\n");
    -    }
    -    FOREACHridge_(facet->ridges) {
    -      if (!ridge->seen)
    -        qh_printridge(fp, ridge);
    -    }
    -  }
    -} /* printfacetridges */
    -
    -/*---------------------------------
    -
    -  qh_printfacets( fp, format, facetlist, facets, printall )
    -    prints facetlist and/or facet set in output format
    -
    -  notes:
    -    also used for specialized formats ('FO' and summary)
    -    turns off 'Rn' option since want actual numbers
    -*/
    -void qh_printfacets(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall) {
    -  int numfacets, numsimplicial, numridges, totneighbors, numcoplanars, numtricoplanars;
    -  facetT *facet, **facetp;
    -  setT *vertices;
    -  coordT *center;
    -  realT outerplane, innerplane;
    -
    -  qh old_randomdist= qh RANDOMdist;
    -  qh RANDOMdist= False;
    -  if (qh CDDoutput && (format == qh_PRINTcentrums || format == qh_PRINTpointintersect || format == qh_PRINToff))
    -    qh_fprintf(qh ferr, 7056, "qhull warning: CDD format is not available for centrums, halfspace\nintersections, and OFF file format.\n");
    -  if (format == qh_PRINTnone)
    -    ; /* print nothing */
    -  else if (format == qh_PRINTaverage) {
    -    vertices= qh_facetvertices(facetlist, facets, printall);
    -    center= qh_getcenter(vertices);
    -    qh_fprintf(fp, 9186, "%d 1\n", qh hull_dim);
    -    qh_printpointid(fp, NULL, qh hull_dim, center, -1);
    -    qh_memfree(center, qh normal_size);
    -    qh_settempfree(&vertices);
    -  }else if (format == qh_PRINTextremes) {
    -    if (qh DELAUNAY)
    -      qh_printextremes_d(fp, facetlist, facets, printall);
    -    else if (qh hull_dim == 2)
    -      qh_printextremes_2d(fp, facetlist, facets, printall);
    -    else
    -      qh_printextremes(fp, facetlist, facets, printall);
    -  }else if (format == qh_PRINToptions)
    -    qh_fprintf(fp, 9187, "Options selected for Qhull %s:\n%s\n", qh_version, qh qhull_options);
    -  else if (format == qh_PRINTpoints && !qh VORONOI)
    -    qh_printpoints_out(fp, facetlist, facets, printall);
    -  else if (format == qh_PRINTqhull)
    -    qh_fprintf(fp, 9188, "%s | %s\n", qh rbox_command, qh qhull_command);
    -  else if (format == qh_PRINTsize) {
    -    qh_fprintf(fp, 9189, "0\n2 ");
    -    qh_fprintf(fp, 9190, qh_REAL_1, qh totarea);
    -    qh_fprintf(fp, 9191, qh_REAL_1, qh totvol);
    -    qh_fprintf(fp, 9192, "\n");
    -  }else if (format == qh_PRINTsummary) {
    -    qh_countfacets(facetlist, facets, printall, &numfacets, &numsimplicial,
    -      &totneighbors, &numridges, &numcoplanars, &numtricoplanars);
    -    vertices= qh_facetvertices(facetlist, facets, printall);
    -    qh_fprintf(fp, 9193, "10 %d %d %d %d %d %d %d %d %d %d\n2 ", qh hull_dim,
    -                qh num_points + qh_setsize(qh other_points),
    -                qh num_vertices, qh num_facets - qh num_visible,
    -                qh_setsize(vertices), numfacets, numcoplanars,
    -                numfacets - numsimplicial, zzval_(Zdelvertextot),
    -                numtricoplanars);
    -    qh_settempfree(&vertices);
    -    qh_outerinner(NULL, &outerplane, &innerplane);
    -    qh_fprintf(fp, 9194, qh_REAL_2n, outerplane, innerplane);
    -  }else if (format == qh_PRINTvneighbors)
    -    qh_printvneighbors(fp, facetlist, facets, printall);
    -  else if (qh VORONOI && format == qh_PRINToff)
    -    qh_printvoronoi(fp, format, facetlist, facets, printall);
    -  else if (qh VORONOI && format == qh_PRINTgeom) {
    -    qh_printbegin(fp, format, facetlist, facets, printall);
    -    qh_printvoronoi(fp, format, facetlist, facets, printall);
    -    qh_printend(fp, format, facetlist, facets, printall);
    -  }else if (qh VORONOI
    -  && (format == qh_PRINTvertices || format == qh_PRINTinner || format == qh_PRINTouter))
    -    qh_printvdiagram(fp, format, facetlist, facets, printall);
    -  else {
    -    qh_printbegin(fp, format, facetlist, facets, printall);
    -    FORALLfacet_(facetlist)
    -      qh_printafacet(fp, format, facet, printall);
    -    FOREACHfacet_(facets)
    -      qh_printafacet(fp, format, facet, printall);
    -    qh_printend(fp, format, facetlist, facets, printall);
    -  }
    -  qh RANDOMdist= qh old_randomdist;
    -} /* printfacets */
    -
    -
    -/*---------------------------------
    -
    -  qh_printhyperplaneintersection( fp, facet1, facet2, vertices, color )
    -    print Geomview OFF or 4OFF for the intersection of two hyperplanes in 3-d or 4-d
    -*/
    -void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2,
    -                   setT *vertices, realT color[3]) {
    -  realT costheta, denominator, dist1, dist2, s, t, mindenom, p[4];
    -  vertexT *vertex, **vertexp;
    -  int i, k;
    -  boolT nearzero1, nearzero2;
    -
    -  costheta= qh_getangle(facet1->normal, facet2->normal);
    -  denominator= 1 - costheta * costheta;
    -  i= qh_setsize(vertices);
    -  if (qh hull_dim == 3)
    -    qh_fprintf(fp, 9195, "VECT 1 %d 1 %d 1 ", i, i);
    -  else if (qh hull_dim == 4 && qh DROPdim >= 0)
    -    qh_fprintf(fp, 9196, "OFF 3 1 1 ");
    -  else
    -    qh printoutvar++;
    -  qh_fprintf(fp, 9197, "# intersect f%d f%d\n", facet1->id, facet2->id);
    -  mindenom= 1 / (10.0 * qh MAXabs_coord);
    -  FOREACHvertex_(vertices) {
    -    zadd_(Zdistio, 2);
    -    qh_distplane(vertex->point, facet1, &dist1);
    -    qh_distplane(vertex->point, facet2, &dist2);
    -    s= qh_divzero(-dist1 + costheta * dist2, denominator,mindenom,&nearzero1);
    -    t= qh_divzero(-dist2 + costheta * dist1, denominator,mindenom,&nearzero2);
    -    if (nearzero1 || nearzero2)
    -      s= t= 0.0;
    -    for (k=qh hull_dim; k--; )
    -      p[k]= vertex->point[k] + facet1->normal[k] * s + facet2->normal[k] * t;
    -    if (qh PRINTdim <= 3) {
    -      qh_projectdim3 (p, p);
    -      qh_fprintf(fp, 9198, "%8.4g %8.4g %8.4g # ", p[0], p[1], p[2]);
    -    }else
    -      qh_fprintf(fp, 9199, "%8.4g %8.4g %8.4g %8.4g # ", p[0], p[1], p[2], p[3]);
    -    if (nearzero1+nearzero2)
    -      qh_fprintf(fp, 9200, "p%d(coplanar facets)\n", qh_pointid(vertex->point));
    -    else
    -      qh_fprintf(fp, 9201, "projected p%d\n", qh_pointid(vertex->point));
    -  }
    -  if (qh hull_dim == 3)
    -    qh_fprintf(fp, 9202, "%8.4g %8.4g %8.4g 1.0\n", color[0], color[1], color[2]);
    -  else if (qh hull_dim == 4 && qh DROPdim >= 0)
    -    qh_fprintf(fp, 9203, "3 0 1 2 %8.4g %8.4g %8.4g 1.0\n", color[0], color[1], color[2]);
    -} /* printhyperplaneintersection */
    -
    -/*---------------------------------
    -
    -  qh_printline3geom( fp, pointA, pointB, color )
    -    prints a line as a VECT
    -    prints 0's for qh.DROPdim
    -
    -  notes:
    -    if pointA == pointB,
    -      it's a 1 point VECT
    -*/
    -void qh_printline3geom(FILE *fp, pointT *pointA, pointT *pointB, realT color[3]) {
    -  int k;
    -  realT pA[4], pB[4];
    -
    -  qh_projectdim3(pointA, pA);
    -  qh_projectdim3(pointB, pB);
    -  if ((fabs(pA[0] - pB[0]) > 1e-3) ||
    -      (fabs(pA[1] - pB[1]) > 1e-3) ||
    -      (fabs(pA[2] - pB[2]) > 1e-3)) {
    -    qh_fprintf(fp, 9204, "VECT 1 2 1 2 1\n");
    -    for (k=0; k < 3; k++)
    -       qh_fprintf(fp, 9205, "%8.4g ", pB[k]);
    -    qh_fprintf(fp, 9206, " # p%d\n", qh_pointid(pointB));
    -  }else
    -    qh_fprintf(fp, 9207, "VECT 1 1 1 1 1\n");
    -  for (k=0; k < 3; k++)
    -    qh_fprintf(fp, 9208, "%8.4g ", pA[k]);
    -  qh_fprintf(fp, 9209, " # p%d\n", qh_pointid(pointA));
    -  qh_fprintf(fp, 9210, "%8.4g %8.4g %8.4g 1\n", color[0], color[1], color[2]);
    -}
    -
    -/*---------------------------------
    -
    -  qh_printneighborhood( fp, format, facetA, facetB, printall )
    -    print neighborhood of one or two facets
    -
    -  notes:
    -    calls qh_findgood_all()
    -    bumps qh.visit_id
    -*/
    -void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall) {
    -  facetT *neighbor, **neighborp, *facet;
    -  setT *facets;
    -
    -  if (format == qh_PRINTnone)
    -    return;
    -  qh_findgood_all(qh facet_list);
    -  if (facetA == facetB)
    -    facetB= NULL;
    -  facets= qh_settemp(2*(qh_setsize(facetA->neighbors)+1));
    -  qh visit_id++;
    -  for (facet= facetA; facet; facet= ((facet == facetA) ? facetB : NULL)) {
    -    if (facet->visitid != qh visit_id) {
    -      facet->visitid= qh visit_id;
    -      qh_setappend(&facets, facet);
    -    }
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid == qh visit_id)
    -        continue;
    -      neighbor->visitid= qh visit_id;
    -      if (printall || !qh_skipfacet(neighbor))
    -        qh_setappend(&facets, neighbor);
    -    }
    -  }
    -  qh_printfacets(fp, format, NULL, facets, printall);
    -  qh_settempfree(&facets);
    -} /* printneighborhood */
    -
    -/*---------------------------------
    -
    -  qh_printpoint( fp, string, point )
    -  qh_printpointid( fp, string, dim, point, id )
    -    prints the coordinates of a point
    -
    -  returns:
    -    if string is defined
    -      prints 'string p%d' (skips p%d if id=-1)
    -
    -  notes:
    -    nop if point is NULL
    -    prints id unless it is undefined (-1)
    -    Same as QhullPoint's printPoint
    -*/
    -void qh_printpoint(FILE *fp, const char *string, pointT *point) {
    -  int id= qh_pointid( point);
    -
    -  qh_printpointid( fp, string, qh hull_dim, point, id);
    -} /* printpoint */
    -
    -void qh_printpointid(FILE *fp, const char *string, int dim, pointT *point, int id) {
    -  int k;
    -  realT r; /*bug fix*/
    -
    -  if (!point)
    -    return;
    -  if (string) {
    -    qh_fprintf(fp, 9211, "%s", string);
    -   if (id != -1)
    -      qh_fprintf(fp, 9212, " p%d: ", id);
    -  }
    -  for (k=dim; k--; ) {
    -    r= *point++;
    -    if (string)
    -      qh_fprintf(fp, 9213, " %8.4g", r);
    -    else
    -      qh_fprintf(fp, 9214, qh_REAL_1, r);
    -  }
    -  qh_fprintf(fp, 9215, "\n");
    -} /* printpointid */
    -
    -/*---------------------------------
    -
    -  qh_printpoint3( fp, point )
    -    prints 2-d, 3-d, or 4-d point as Geomview 3-d coordinates
    -*/
    -void qh_printpoint3 (FILE *fp, pointT *point) {
    -  int k;
    -  realT p[4];
    -
    -  qh_projectdim3 (point, p);
    -  for (k=0; k < 3; k++)
    -    qh_fprintf(fp, 9216, "%8.4g ", p[k]);
    -  qh_fprintf(fp, 9217, " # p%d\n", qh_pointid(point));
    -} /* printpoint3 */
    -
    -/*----------------------------------------
    --printpoints- print pointids for a set of points starting at index
    -   see geom.c
    -*/
    -
    -/*---------------------------------
    -
    -  qh_printpoints_out( fp, facetlist, facets, printall )
    -    prints vertices, coplanar/inside points, for facets by their point coordinates
    -    allows qh.CDDoutput
    -
    -  notes:
    -    same format as qhull input
    -    if no coplanar/interior points,
    -      same order as qh_printextremes
    -*/
    -void qh_printpoints_out(FILE *fp, facetT *facetlist, setT *facets, boolT printall) {
    -  int allpoints= qh num_points + qh_setsize(qh other_points);
    -  int numpoints=0, point_i, point_n;
    -  setT *vertices, *points;
    -  facetT *facet, **facetp;
    -  pointT *point, **pointp;
    -  vertexT *vertex, **vertexp;
    -  int id;
    -
    -  points= qh_settemp(allpoints);
    -  qh_setzero(points, 0, allpoints);
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  FOREACHvertex_(vertices) {
    -    id= qh_pointid(vertex->point);
    -    if (id >= 0)
    -      SETelem_(points, id)= vertex->point;
    -  }
    -  if (qh KEEPinside || qh KEEPcoplanar || qh KEEPnearinside) {
    -    FORALLfacet_(facetlist) {
    -      if (!printall && qh_skipfacet(facet))
    -        continue;
    -      FOREACHpoint_(facet->coplanarset) {
    -        id= qh_pointid(point);
    -        if (id >= 0)
    -          SETelem_(points, id)= point;
    -      }
    -    }
    -    FOREACHfacet_(facets) {
    -      if (!printall && qh_skipfacet(facet))
    -        continue;
    -      FOREACHpoint_(facet->coplanarset) {
    -        id= qh_pointid(point);
    -        if (id >= 0)
    -          SETelem_(points, id)= point;
    -      }
    -    }
    -  }
    -  qh_settempfree(&vertices);
    -  FOREACHpoint_i_(points) {
    -    if (point)
    -      numpoints++;
    -  }
    -  if (qh CDDoutput)
    -    qh_fprintf(fp, 9218, "%s | %s\nbegin\n%d %d real\n", qh rbox_command,
    -             qh qhull_command, numpoints, qh hull_dim + 1);
    -  else
    -    qh_fprintf(fp, 9219, "%d\n%d\n", qh hull_dim, numpoints);
    -  FOREACHpoint_i_(points) {
    -    if (point) {
    -      if (qh CDDoutput)
    -        qh_fprintf(fp, 9220, "1 ");
    -      qh_printpoint(fp, NULL, point);
    -    }
    -  }
    -  if (qh CDDoutput)
    -    qh_fprintf(fp, 9221, "end\n");
    -  qh_settempfree(&points);
    -} /* printpoints_out */
    -
    -
    -/*---------------------------------
    -
    -  qh_printpointvect( fp, point, normal, center, radius, color )
    -    prints a 2-d, 3-d, or 4-d point as 3-d VECT's relative to normal or to center point
    -*/
    -void qh_printpointvect(FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]) {
    -  realT diff[4], pointA[4];
    -  int k;
    -
    -  for (k=qh hull_dim; k--; ) {
    -    if (center)
    -      diff[k]= point[k]-center[k];
    -    else if (normal)
    -      diff[k]= normal[k];
    -    else
    -      diff[k]= 0;
    -  }
    -  if (center)
    -    qh_normalize2 (diff, qh hull_dim, True, NULL, NULL);
    -  for (k=qh hull_dim; k--; )
    -    pointA[k]= point[k]+diff[k] * radius;
    -  qh_printline3geom(fp, point, pointA, color);
    -} /* printpointvect */
    -
    -/*---------------------------------
    -
    -  qh_printpointvect2( fp, point, normal, center, radius )
    -    prints a 2-d, 3-d, or 4-d point as 2 3-d VECT's for an imprecise point
    -*/
    -void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius) {
    -  realT red[3]={1, 0, 0}, yellow[3]={1, 1, 0};
    -
    -  qh_printpointvect(fp, point, normal, center, radius, red);
    -  qh_printpointvect(fp, point, normal, center, -radius, yellow);
    -} /* printpointvect2 */
    -
    -/*---------------------------------
    -
    -  qh_printridge( fp, ridge )
    -    prints the information in a ridge
    -
    -  notes:
    -    for qh_printfacetridges()
    -    same as operator<< [QhullRidge.cpp]
    -*/
    -void qh_printridge(FILE *fp, ridgeT *ridge) {
    -
    -  qh_fprintf(fp, 9222, "     - r%d", ridge->id);
    -  if (ridge->tested)
    -    qh_fprintf(fp, 9223, " tested");
    -  if (ridge->nonconvex)
    -    qh_fprintf(fp, 9224, " nonconvex");
    -  qh_fprintf(fp, 9225, "\n");
    -  qh_printvertices(fp, "           vertices:", ridge->vertices);
    -  if (ridge->top && ridge->bottom)
    -    qh_fprintf(fp, 9226, "           between f%d and f%d\n",
    -            ridge->top->id, ridge->bottom->id);
    -} /* printridge */
    -
    -/*---------------------------------
    -
    -  qh_printspheres( fp, vertices, radius )
    -    prints 3-d vertices as OFF spheres
    -
    -  notes:
    -    inflated octahedron from Stuart Levy earth/mksphere2
    -*/
    -void qh_printspheres(FILE *fp, setT *vertices, realT radius) {
    -  vertexT *vertex, **vertexp;
    -
    -  qh printoutnum++;
    -  qh_fprintf(fp, 9227, "{appearance {-edge -normal normscale 0} {\n\
    -INST geom {define vsphere OFF\n\
    -18 32 48\n\
    -\n\
    -0 0 1\n\
    -1 0 0\n\
    -0 1 0\n\
    --1 0 0\n\
    -0 -1 0\n\
    -0 0 -1\n\
    -0.707107 0 0.707107\n\
    -0 -0.707107 0.707107\n\
    -0.707107 -0.707107 0\n\
    --0.707107 0 0.707107\n\
    --0.707107 -0.707107 0\n\
    -0 0.707107 0.707107\n\
    --0.707107 0.707107 0\n\
    -0.707107 0.707107 0\n\
    -0.707107 0 -0.707107\n\
    -0 0.707107 -0.707107\n\
    --0.707107 0 -0.707107\n\
    -0 -0.707107 -0.707107\n\
    -\n\
    -3 0 6 11\n\
    -3 0 7 6 \n\
    -3 0 9 7 \n\
    -3 0 11 9\n\
    -3 1 6 8 \n\
    -3 1 8 14\n\
    -3 1 13 6\n\
    -3 1 14 13\n\
    -3 2 11 13\n\
    -3 2 12 11\n\
    -3 2 13 15\n\
    -3 2 15 12\n\
    -3 3 9 12\n\
    -3 3 10 9\n\
    -3 3 12 16\n\
    -3 3 16 10\n\
    -3 4 7 10\n\
    -3 4 8 7\n\
    -3 4 10 17\n\
    -3 4 17 8\n\
    -3 5 14 17\n\
    -3 5 15 14\n\
    -3 5 16 15\n\
    -3 5 17 16\n\
    -3 6 13 11\n\
    -3 7 8 6\n\
    -3 9 10 7\n\
    -3 11 12 9\n\
    -3 14 8 17\n\
    -3 15 13 14\n\
    -3 16 12 15\n\
    -3 17 10 16\n} transforms { TLIST\n");
    -  FOREACHvertex_(vertices) {
    -    qh_fprintf(fp, 9228, "%8.4g 0 0 0 # v%d\n 0 %8.4g 0 0\n0 0 %8.4g 0\n",
    -      radius, vertex->id, radius, radius);
    -    qh_printpoint3 (fp, vertex->point);
    -    qh_fprintf(fp, 9229, "1\n");
    -  }
    -  qh_fprintf(fp, 9230, "}}}\n");
    -} /* printspheres */
    -
    -
    -/*----------------------------------------------
    --printsummary-
    -                see libqhull.c
    -*/
    -
    -/*---------------------------------
    -
    -  qh_printvdiagram( fp, format, facetlist, facets, printall )
    -    print voronoi diagram
    -      # of pairs of input sites
    -      #indices site1 site2 vertex1 ...
    -
    -    sites indexed by input point id
    -      point 0 is the first input point
    -    vertices indexed by 'o' and 'p' order
    -      vertex 0 is the 'vertex-at-infinity'
    -      vertex 1 is the first Voronoi vertex
    -
    -  see:
    -    qh_printvoronoi()
    -    qh_eachvoronoi_all()
    -
    -  notes:
    -    if all facets are upperdelaunay,
    -      prints upper hull (furthest-site Voronoi diagram)
    -*/
    -void qh_printvdiagram(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall) {
    -  setT *vertices;
    -  int totcount, numcenters;
    -  boolT isLower;
    -  qh_RIDGE innerouter= qh_RIDGEall;
    -  printvridgeT printvridge= NULL;
    -
    -  if (format == qh_PRINTvertices) {
    -    innerouter= qh_RIDGEall;
    -    printvridge= qh_printvridge;
    -  }else if (format == qh_PRINTinner) {
    -    innerouter= qh_RIDGEinner;
    -    printvridge= qh_printvnorm;
    -  }else if (format == qh_PRINTouter) {
    -    innerouter= qh_RIDGEouter;
    -    printvridge= qh_printvnorm;
    -  }else {
    -    qh_fprintf(qh ferr, 6219, "Qhull internal error (qh_printvdiagram): unknown print format %d.\n", format);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  vertices= qh_markvoronoi(facetlist, facets, printall, &isLower, &numcenters);
    -  totcount= qh_printvdiagram2 (NULL, NULL, vertices, innerouter, False);
    -  qh_fprintf(fp, 9231, "%d\n", totcount);
    -  totcount= qh_printvdiagram2 (fp, printvridge, vertices, innerouter, True /* inorder*/);
    -  qh_settempfree(&vertices);
    -#if 0  /* for testing qh_eachvoronoi_all */
    -  qh_fprintf(fp, 9232, "\n");
    -  totcount= qh_eachvoronoi_all(fp, printvridge, qh UPPERdelaunay, innerouter, True /* inorder*/);
    -  qh_fprintf(fp, 9233, "%d\n", totcount);
    -#endif
    -} /* printvdiagram */
    -
    -/*---------------------------------
    -
    -  qh_printvdiagram2( fp, printvridge, vertices, innerouter, inorder )
    -    visit all pairs of input sites (vertices) for selected Voronoi vertices
    -    vertices may include NULLs
    -
    -  innerouter:
    -    qh_RIDGEall   print inner ridges(bounded) and outer ridges(unbounded)
    -    qh_RIDGEinner print only inner ridges
    -    qh_RIDGEouter print only outer ridges
    -
    -  inorder:
    -    print 3-d Voronoi vertices in order
    -
    -  assumes:
    -    qh_markvoronoi marked facet->visitid for Voronoi vertices
    -    all facet->seen= False
    -    all facet->seen2= True
    -
    -  returns:
    -    total number of Voronoi ridges
    -    if printvridge,
    -      calls printvridge( fp, vertex, vertexA, centers) for each ridge
    -      [see qh_eachvoronoi()]
    -
    -  see:
    -    qh_eachvoronoi_all()
    -*/
    -int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder) {
    -  int totcount= 0;
    -  int vertex_i, vertex_n;
    -  vertexT *vertex;
    -
    -  FORALLvertices
    -    vertex->seen= False;
    -  FOREACHvertex_i_(vertices) {
    -    if (vertex) {
    -      if (qh GOODvertex > 0 && qh_pointid(vertex->point)+1 != qh GOODvertex)
    -        continue;
    -      totcount += qh_eachvoronoi(fp, printvridge, vertex, !qh_ALL, innerouter, inorder);
    -    }
    -  }
    -  return totcount;
    -} /* printvdiagram2 */
    -
    -/*---------------------------------
    -
    -  qh_printvertex( fp, vertex )
    -    prints the information in a vertex
    -    Duplicated as operator<< [QhullVertex.cpp]
    -*/
    -void qh_printvertex(FILE *fp, vertexT *vertex) {
    -  pointT *point;
    -  int k, count= 0;
    -  facetT *neighbor, **neighborp;
    -  realT r; /*bug fix*/
    -
    -  if (!vertex) {
    -    qh_fprintf(fp, 9234, "  NULLvertex\n");
    -    return;
    -  }
    -  qh_fprintf(fp, 9235, "- p%d(v%d):", qh_pointid(vertex->point), vertex->id);
    -  point= vertex->point;
    -  if (point) {
    -    for (k=qh hull_dim; k--; ) {
    -      r= *point++;
    -      qh_fprintf(fp, 9236, " %5.2g", r);
    -    }
    -  }
    -  if (vertex->deleted)
    -    qh_fprintf(fp, 9237, " deleted");
    -  if (vertex->delridge)
    -    qh_fprintf(fp, 9238, " ridgedeleted");
    -  qh_fprintf(fp, 9239, "\n");
    -  if (vertex->neighbors) {
    -    qh_fprintf(fp, 9240, "  neighbors:");
    -    FOREACHneighbor_(vertex) {
    -      if (++count % 100 == 0)
    -        qh_fprintf(fp, 9241, "\n     ");
    -      qh_fprintf(fp, 9242, " f%d", neighbor->id);
    -    }
    -    qh_fprintf(fp, 9243, "\n");
    -  }
    -} /* printvertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_printvertexlist( fp, string, facetlist, facets, printall )
    -    prints vertices used by a facetlist or facet set
    -    tests qh_skipfacet() if !printall
    -*/
    -void qh_printvertexlist(FILE *fp, const char* string, facetT *facetlist,
    -                         setT *facets, boolT printall) {
    -  vertexT *vertex, **vertexp;
    -  setT *vertices;
    -
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  qh_fprintf(fp, 9244, "%s", string);
    -  FOREACHvertex_(vertices)
    -    qh_printvertex(fp, vertex);
    -  qh_settempfree(&vertices);
    -} /* printvertexlist */
    -
    -
    -/*---------------------------------
    -
    -  qh_printvertices( fp, string, vertices )
    -    prints vertices in a set
    -    duplicated as printVertexSet [QhullVertex.cpp]
    -*/
    -void qh_printvertices(FILE *fp, const char* string, setT *vertices) {
    -  vertexT *vertex, **vertexp;
    -
    -  qh_fprintf(fp, 9245, "%s", string);
    -  FOREACHvertex_(vertices)
    -    qh_fprintf(fp, 9246, " p%d(v%d)", qh_pointid(vertex->point), vertex->id);
    -  qh_fprintf(fp, 9247, "\n");
    -} /* printvertices */
    -
    -/*---------------------------------
    -
    -  qh_printvneighbors( fp, facetlist, facets, printall )
    -    print vertex neighbors of vertices in facetlist and facets ('FN')
    -
    -  notes:
    -    qh_countfacets clears facet->visitid for non-printed facets
    -
    -  design:
    -    collect facet count and related statistics
    -    if necessary, build neighbor sets for each vertex
    -    collect vertices in facetlist and facets
    -    build a point array for point->vertex and point->coplanar facet
    -    for each point
    -      list vertex neighbors or coplanar facet
    -*/
    -void qh_printvneighbors(FILE *fp, facetT* facetlist, setT *facets, boolT printall) {
    -  int numfacets, numsimplicial, numridges, totneighbors, numneighbors, numcoplanars, numtricoplanars;
    -  setT *vertices, *vertex_points, *coplanar_points;
    -  int numpoints= qh num_points + qh_setsize(qh other_points);
    -  vertexT *vertex, **vertexp;
    -  int vertex_i, vertex_n;
    -  facetT *facet, **facetp, *neighbor, **neighborp;
    -  pointT *point, **pointp;
    -
    -  qh_countfacets(facetlist, facets, printall, &numfacets, &numsimplicial,
    -      &totneighbors, &numridges, &numcoplanars, &numtricoplanars);  /* sets facet->visitid */
    -  qh_fprintf(fp, 9248, "%d\n", numpoints);
    -  qh_vertexneighbors();
    -  vertices= qh_facetvertices(facetlist, facets, printall);
    -  vertex_points= qh_settemp(numpoints);
    -  coplanar_points= qh_settemp(numpoints);
    -  qh_setzero(vertex_points, 0, numpoints);
    -  qh_setzero(coplanar_points, 0, numpoints);
    -  FOREACHvertex_(vertices)
    -    qh_point_add(vertex_points, vertex->point, vertex);
    -  FORALLfacet_(facetlist) {
    -    FOREACHpoint_(facet->coplanarset)
    -      qh_point_add(coplanar_points, point, facet);
    -  }
    -  FOREACHfacet_(facets) {
    -    FOREACHpoint_(facet->coplanarset)
    -      qh_point_add(coplanar_points, point, facet);
    -  }
    -  FOREACHvertex_i_(vertex_points) {
    -    if (vertex) {
    -      numneighbors= qh_setsize(vertex->neighbors);
    -      qh_fprintf(fp, 9249, "%d", numneighbors);
    -      if (qh hull_dim == 3)
    -        qh_order_vertexneighbors(vertex);
    -      else if (qh hull_dim >= 4)
    -        qsort(SETaddr_(vertex->neighbors, facetT), (size_t)numneighbors,
    -             sizeof(facetT *), qh_compare_facetvisit);
    -      FOREACHneighbor_(vertex)
    -        qh_fprintf(fp, 9250, " %d",
    -                 neighbor->visitid ? neighbor->visitid - 1 : 0 - neighbor->id);
    -      qh_fprintf(fp, 9251, "\n");
    -    }else if ((facet= SETelemt_(coplanar_points, vertex_i, facetT)))
    -      qh_fprintf(fp, 9252, "1 %d\n",
    -                  facet->visitid ? facet->visitid - 1 : 0 - facet->id);
    -    else
    -      qh_fprintf(fp, 9253, "0\n");
    -  }
    -  qh_settempfree(&coplanar_points);
    -  qh_settempfree(&vertex_points);
    -  qh_settempfree(&vertices);
    -} /* printvneighbors */
    -
    -/*---------------------------------
    -
    -  qh_printvoronoi( fp, format, facetlist, facets, printall )
    -    print voronoi diagram in 'o' or 'G' format
    -    for 'o' format
    -      prints voronoi centers for each facet and for infinity
    -      for each vertex, lists ids of printed facets or infinity
    -      assumes facetlist and facets are disjoint
    -    for 'G' format
    -      prints an OFF object
    -      adds a 0 coordinate to center
    -      prints infinity but does not list in vertices
    -
    -  see:
    -    qh_printvdiagram()
    -
    -  notes:
    -    if 'o',
    -      prints a line for each point except "at-infinity"
    -    if all facets are upperdelaunay,
    -      reverses lower and upper hull
    -*/
    -void qh_printvoronoi(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall) {
    -  int k, numcenters, numvertices= 0, numneighbors, numinf, vid=1, vertex_i, vertex_n;
    -  facetT *facet, **facetp, *neighbor, **neighborp;
    -  setT *vertices;
    -  vertexT *vertex;
    -  boolT isLower;
    -  unsigned int numfacets= (unsigned int) qh num_facets;
    -
    -  vertices= qh_markvoronoi(facetlist, facets, printall, &isLower, &numcenters);
    -  FOREACHvertex_i_(vertices) {
    -    if (vertex) {
    -      numvertices++;
    -      numneighbors = numinf = 0;
    -      FOREACHneighbor_(vertex) {
    -        if (neighbor->visitid == 0)
    -          numinf= 1;
    -        else if (neighbor->visitid < numfacets)
    -          numneighbors++;
    -      }
    -      if (numinf && !numneighbors) {
    -        SETelem_(vertices, vertex_i)= NULL;
    -        numvertices--;
    -      }
    -    }
    -  }
    -  if (format == qh_PRINTgeom)
    -    qh_fprintf(fp, 9254, "{appearance {+edge -face} OFF %d %d 1 # Voronoi centers and cells\n",
    -                numcenters, numvertices);
    -  else
    -    qh_fprintf(fp, 9255, "%d\n%d %d 1\n", qh hull_dim-1, numcenters, qh_setsize(vertices));
    -  if (format == qh_PRINTgeom) {
    -    for (k=qh hull_dim-1; k--; )
    -      qh_fprintf(fp, 9256, qh_REAL_1, 0.0);
    -    qh_fprintf(fp, 9257, " 0 # infinity not used\n");
    -  }else {
    -    for (k=qh hull_dim-1; k--; )
    -      qh_fprintf(fp, 9258, qh_REAL_1, qh_INFINITE);
    -    qh_fprintf(fp, 9259, "\n");
    -  }
    -  FORALLfacet_(facetlist) {
    -    if (facet->visitid && facet->visitid < numfacets) {
    -      if (format == qh_PRINTgeom)
    -        qh_fprintf(fp, 9260, "# %d f%d\n", vid++, facet->id);
    -      qh_printcenter(fp, format, NULL, facet);
    -    }
    -  }
    -  FOREACHfacet_(facets) {
    -    if (facet->visitid && facet->visitid < numfacets) {
    -      if (format == qh_PRINTgeom)
    -        qh_fprintf(fp, 9261, "# %d f%d\n", vid++, facet->id);
    -      qh_printcenter(fp, format, NULL, facet);
    -    }
    -  }
    -  FOREACHvertex_i_(vertices) {
    -    numneighbors= 0;
    -    numinf=0;
    -    if (vertex) {
    -      if (qh hull_dim == 3)
    -        qh_order_vertexneighbors(vertex);
    -      else if (qh hull_dim >= 4)
    -        qsort(SETaddr_(vertex->neighbors, facetT),
    -             (size_t)qh_setsize(vertex->neighbors),
    -             sizeof(facetT *), qh_compare_facetvisit);
    -      FOREACHneighbor_(vertex) {
    -        if (neighbor->visitid == 0)
    -          numinf= 1;
    -        else if (neighbor->visitid < numfacets)
    -          numneighbors++;
    -      }
    -    }
    -    if (format == qh_PRINTgeom) {
    -      if (vertex) {
    -        qh_fprintf(fp, 9262, "%d", numneighbors);
    -        FOREACHneighbor_(vertex) {
    -          if (neighbor->visitid && neighbor->visitid < numfacets)
    -            qh_fprintf(fp, 9263, " %d", neighbor->visitid);
    -        }
    -        qh_fprintf(fp, 9264, " # p%d(v%d)\n", vertex_i, vertex->id);
    -      }else
    -        qh_fprintf(fp, 9265, " # p%d is coplanar or isolated\n", vertex_i);
    -    }else {
    -      if (numinf)
    -        numneighbors++;
    -      qh_fprintf(fp, 9266, "%d", numneighbors);
    -      if (vertex) {
    -        FOREACHneighbor_(vertex) {
    -          if (neighbor->visitid == 0) {
    -            if (numinf) {
    -              numinf= 0;
    -              qh_fprintf(fp, 9267, " %d", neighbor->visitid);
    -            }
    -          }else if (neighbor->visitid < numfacets)
    -            qh_fprintf(fp, 9268, " %d", neighbor->visitid);
    -        }
    -      }
    -      qh_fprintf(fp, 9269, "\n");
    -    }
    -  }
    -  if (format == qh_PRINTgeom)
    -    qh_fprintf(fp, 9270, "}\n");
    -  qh_settempfree(&vertices);
    -} /* printvoronoi */
    -
    -/*---------------------------------
    -
    -  qh_printvnorm( fp, vertex, vertexA, centers, unbounded )
    -    print one separating plane of the Voronoi diagram for a pair of input sites
    -    unbounded==True if centers includes vertex-at-infinity
    -
    -  assumes:
    -    qh_ASvoronoi and qh_vertexneighbors() already set
    -
    -  note:
    -    parameter unbounded is UNUSED by this callback
    -
    -  see:
    -    qh_printvdiagram()
    -    qh_eachvoronoi()
    -*/
    -void qh_printvnorm(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded) {
    -  pointT *normal;
    -  realT offset;
    -  int k;
    -  QHULL_UNUSED(unbounded);
    -
    -  normal= qh_detvnorm(vertex, vertexA, centers, &offset);
    -  qh_fprintf(fp, 9271, "%d %d %d ",
    -      2+qh hull_dim, qh_pointid(vertex->point), qh_pointid(vertexA->point));
    -  for (k=0; k< qh hull_dim-1; k++)
    -    qh_fprintf(fp, 9272, qh_REAL_1, normal[k]);
    -  qh_fprintf(fp, 9273, qh_REAL_1, offset);
    -  qh_fprintf(fp, 9274, "\n");
    -} /* printvnorm */
    -
    -/*---------------------------------
    -
    -  qh_printvridge( fp, vertex, vertexA, centers, unbounded )
    -    print one ridge of the Voronoi diagram for a pair of input sites
    -    unbounded==True if centers includes vertex-at-infinity
    -
    -  see:
    -    qh_printvdiagram()
    -
    -  notes:
    -    the user may use a different function
    -    parameter unbounded is UNUSED
    -*/
    -void qh_printvridge(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded) {
    -  facetT *facet, **facetp;
    -  QHULL_UNUSED(unbounded);
    -
    -  qh_fprintf(fp, 9275, "%d %d %d", qh_setsize(centers)+2,
    -       qh_pointid(vertex->point), qh_pointid(vertexA->point));
    -  FOREACHfacet_(centers)
    -    qh_fprintf(fp, 9276, " %d", facet->visitid);
    -  qh_fprintf(fp, 9277, "\n");
    -} /* printvridge */
    -
    -/*---------------------------------
    -
    -  qh_projectdim3( source, destination )
    -    project 2-d 3-d or 4-d point to a 3-d point
    -    uses qh.DROPdim and qh.hull_dim
    -    source and destination may be the same
    -
    -  notes:
    -    allocate 4 elements to destination just in case
    -*/
    -void qh_projectdim3 (pointT *source, pointT *destination) {
    -  int i,k;
    -
    -  for (k=0, i=0; k < qh hull_dim; k++) {
    -    if (qh hull_dim == 4) {
    -      if (k != qh DROPdim)
    -        destination[i++]= source[k];
    -    }else if (k == qh DROPdim)
    -      destination[i++]= 0;
    -    else
    -      destination[i++]= source[k];
    -  }
    -  while (i < 3)
    -    destination[i++]= 0.0;
    -} /* projectdim3 */
    -
    -/*---------------------------------
    -
    -  qh_readfeasible( dim, curline )
    -    read feasible point from current line and qh.fin
    -
    -  returns:
    -    number of lines read from qh.fin
    -    sets qh.FEASIBLEpoint with malloc'd coordinates
    -
    -  notes:
    -    checks for qh.HALFspace
    -    assumes dim > 1
    -
    -  see:
    -    qh_setfeasible
    -*/
    -int qh_readfeasible(int dim, const char *curline) {
    -  boolT isfirst= True;
    -  int linecount= 0, tokcount= 0;
    -  const char *s;
    -  char *t, firstline[qh_MAXfirst+1];
    -  coordT *coords, value;
    -
    -  if (!qh HALFspace) {
    -    qh_fprintf(qh ferr, 6070, "qhull input error: feasible point(dim 1 coords) is only valid for halfspace intersection\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (qh feasible_string)
    -    qh_fprintf(qh ferr, 7057, "qhull input warning: feasible point(dim 1 coords) overrides 'Hn,n,n' feasible point for halfspace intersection\n");
    -  if (!(qh feasible_point= (coordT*)qh_malloc(dim* sizeof(coordT)))) {
    -    qh_fprintf(qh ferr, 6071, "qhull error: insufficient memory for feasible point\n");
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  coords= qh feasible_point;
    -  while ((s= (isfirst ?  curline : fgets(firstline, qh_MAXfirst, qh fin)))) {
    -    if (isfirst)
    -      isfirst= False;
    -    else
    -      linecount++;
    -    while (*s) {
    -      while (isspace(*s))
    -        s++;
    -      value= qh_strtod(s, &t);
    -      if (s == t)
    -        break;
    -      s= t;
    -      *(coords++)= value;
    -      if (++tokcount == dim) {
    -        while (isspace(*s))
    -          s++;
    -        qh_strtod(s, &t);
    -        if (s != t) {
    -          qh_fprintf(qh ferr, 6072, "qhull input error: coordinates for feasible point do not finish out the line: %s\n",
    -               s);
    -          qh_errexit(qh_ERRinput, NULL, NULL);
    -        }
    -        return linecount;
    -      }
    -    }
    -  }
    -  qh_fprintf(qh ferr, 6073, "qhull input error: only %d coordinates.  Could not read %d-d feasible point.\n",
    -           tokcount, dim);
    -  qh_errexit(qh_ERRinput, NULL, NULL);
    -  return 0;
    -} /* readfeasible */
    -
    -/*---------------------------------
    -
    -  qh_readpoints( numpoints, dimension, ismalloc )
    -    read points from qh.fin into qh.first_point, qh.num_points
    -    qh.fin is lines of coordinates, one per vertex, first line number of points
    -    if 'rbox D4',
    -      gives message
    -    if qh.ATinfinity,
    -      adds point-at-infinity for Delaunay triangulations
    -
    -  returns:
    -    number of points, array of point coordinates, dimension, ismalloc True
    -    if qh.DELAUNAY & !qh.PROJECTinput, projects points to paraboloid
    -        and clears qh.PROJECTdelaunay
    -    if qh.HALFspace, reads optional feasible point, reads halfspaces,
    -        converts to dual.
    -
    -  for feasible point in "cdd format" in 3-d:
    -    3 1
    -    coordinates
    -    comments
    -    begin
    -    n 4 real/integer
    -    ...
    -    end
    -
    -  notes:
    -    dimension will change in qh_initqhull_globals if qh.PROJECTinput
    -    uses malloc() since qh_mem not initialized
    -    FIXUP QH11012: qh_readpoints needs rewriting, too long
    -*/
    -coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc) {
    -  coordT *points, *coords, *infinity= NULL;
    -  realT paraboloid, maxboloid= -REALmax, value;
    -  realT *coordp= NULL, *offsetp= NULL, *normalp= NULL;
    -  char *s= 0, *t, firstline[qh_MAXfirst+1];
    -  int diminput=0, numinput=0, dimfeasible= 0, newnum, k, tempi;
    -  int firsttext=0, firstshort=0, firstlong=0, firstpoint=0;
    -  int tokcount= 0, linecount=0, maxcount, coordcount=0;
    -  boolT islong, isfirst= True, wasbegin= False;
    -  boolT isdelaunay= qh DELAUNAY && !qh PROJECTinput;
    -
    -  if (qh CDDinput) {
    -    while ((s= fgets(firstline, qh_MAXfirst, qh fin))) {
    -      linecount++;
    -      if (qh HALFspace && linecount == 1 && isdigit(*s)) {
    -        dimfeasible= qh_strtol(s, &s);
    -        while (isspace(*s))
    -          s++;
    -        if (qh_strtol(s, &s) == 1)
    -          linecount += qh_readfeasible(dimfeasible, s);
    -        else
    -          dimfeasible= 0;
    -      }else if (!memcmp(firstline, "begin", (size_t)5) || !memcmp(firstline, "BEGIN", (size_t)5))
    -        break;
    -      else if (!*qh rbox_command)
    -        strncat(qh rbox_command, s, sizeof(qh rbox_command)-1);
    -    }
    -    if (!s) {
    -      qh_fprintf(qh ferr, 6074, "qhull input error: missing \"begin\" for cdd-formated input\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -  }
    -  while (!numinput && (s= fgets(firstline, qh_MAXfirst, qh fin))) {
    -    linecount++;
    -    if (!memcmp(s, "begin", (size_t)5) || !memcmp(s, "BEGIN", (size_t)5))
    -      wasbegin= True;
    -    while (*s) {
    -      while (isspace(*s))
    -        s++;
    -      if (!*s)
    -        break;
    -      if (!isdigit(*s)) {
    -        if (!*qh rbox_command) {
    -          strncat(qh rbox_command, s, sizeof(qh rbox_command)-1);
    -          firsttext= linecount;
    -        }
    -        break;
    -      }
    -      if (!diminput)
    -        diminput= qh_strtol(s, &s);
    -      else {
    -        numinput= qh_strtol(s, &s);
    -        if (numinput == 1 && diminput >= 2 && qh HALFspace && !qh CDDinput) {
    -          linecount += qh_readfeasible(diminput, s); /* checks if ok */
    -          dimfeasible= diminput;
    -          diminput= numinput= 0;
    -        }else
    -          break;
    -      }
    -    }
    -  }
    -  if (!s) {
    -    qh_fprintf(qh ferr, 6075, "qhull input error: short input file.  Did not find dimension and number of points\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (diminput > numinput) {
    -    tempi= diminput;    /* exchange dim and n, e.g., for cdd input format */
    -    diminput= numinput;
    -    numinput= tempi;
    -  }
    -  if (diminput < 2) {
    -    qh_fprintf(qh ferr, 6220,"qhull input error: dimension %d(first number) should be at least 2\n",
    -            diminput);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (isdelaunay) {
    -    qh PROJECTdelaunay= False;
    -    if (qh CDDinput)
    -      *dimension= diminput;
    -    else
    -      *dimension= diminput+1;
    -    *numpoints= numinput;
    -    if (qh ATinfinity)
    -      (*numpoints)++;
    -  }else if (qh HALFspace) {
    -    *dimension= diminput - 1;
    -    *numpoints= numinput;
    -    if (diminput < 3) {
    -      qh_fprintf(qh ferr, 6221,"qhull input error: dimension %d(first number, includes offset) should be at least 3 for halfspaces\n",
    -            diminput);
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    if (dimfeasible) {
    -      if (dimfeasible != *dimension) {
    -        qh_fprintf(qh ferr, 6222,"qhull input error: dimension %d of feasible point is not one less than dimension %d for halfspaces\n",
    -          dimfeasible, diminput);
    -        qh_errexit(qh_ERRinput, NULL, NULL);
    -      }
    -    }else
    -      qh_setfeasible(*dimension);
    -  }else {
    -    if (qh CDDinput)
    -      *dimension= diminput-1;
    -    else
    -      *dimension= diminput;
    -    *numpoints= numinput;
    -  }
    -  qh normal_size= *dimension * sizeof(coordT); /* for tracing with qh_printpoint */
    -  if (qh HALFspace) {
    -    qh half_space= coordp= (coordT*)qh_malloc(qh normal_size + sizeof(coordT));
    -    if (qh CDDinput) {
    -      offsetp= qh half_space;
    -      normalp= offsetp + 1;
    -    }else {
    -      normalp= qh half_space;
    -      offsetp= normalp + *dimension;
    -    }
    -  }
    -  qh maxline= diminput * (qh_REALdigits + 5);
    -  maximize_(qh maxline, 500);
    -  qh line= (char*)qh_malloc((qh maxline+1) * sizeof(char));
    -  *ismalloc= True;  /* use malloc since memory not setup */
    -  coords= points= qh temp_malloc=
    -        (coordT*)qh_malloc((*numpoints)*(*dimension)*sizeof(coordT));
    -  if (!coords || !qh line || (qh HALFspace && !qh half_space)) {
    -    qh_fprintf(qh ferr, 6076, "qhull error: insufficient memory to read %d points\n",
    -            numinput);
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  if (isdelaunay && qh ATinfinity) {
    -    infinity= points + numinput * (*dimension);
    -    for (k= (*dimension) - 1; k--; )
    -      infinity[k]= 0.0;
    -  }
    -  maxcount= numinput * diminput;
    -  paraboloid= 0.0;
    -  while ((s= (isfirst ?  s : fgets(qh line, qh maxline, qh fin)))) {
    -    if (!isfirst) {
    -      linecount++;
    -      if (*s == 'e' || *s == 'E') {
    -        if (!memcmp(s, "end", (size_t)3) || !memcmp(s, "END", (size_t)3)) {
    -          if (qh CDDinput )
    -            break;
    -          else if (wasbegin)
    -            qh_fprintf(qh ferr, 7058, "qhull input warning: the input appears to be in cdd format.  If so, use 'Fd'\n");
    -        }
    -      }
    -    }
    -    islong= False;
    -    while (*s) {
    -      while (isspace(*s))
    -        s++;
    -      value= qh_strtod(s, &t);
    -      if (s == t) {
    -        if (!*qh rbox_command)
    -         strncat(qh rbox_command, s, sizeof(qh rbox_command)-1);
    -        if (*s && !firsttext)
    -          firsttext= linecount;
    -        if (!islong && !firstshort && coordcount)
    -          firstshort= linecount;
    -        break;
    -      }
    -      if (!firstpoint)
    -        firstpoint= linecount;
    -      s= t;
    -      if (++tokcount > maxcount)
    -        continue;
    -      if (qh HALFspace) {
    -        if (qh CDDinput)
    -          *(coordp++)= -value; /* both coefficients and offset */
    -        else
    -          *(coordp++)= value;
    -      }else {
    -        *(coords++)= value;
    -        if (qh CDDinput && !coordcount) {
    -          if (value != 1.0) {
    -            qh_fprintf(qh ferr, 6077, "qhull input error: for cdd format, point at line %d does not start with '1'\n",
    -                   linecount);
    -            qh_errexit(qh_ERRinput, NULL, NULL);
    -          }
    -          coords--;
    -        }else if (isdelaunay) {
    -          paraboloid += value * value;
    -          if (qh ATinfinity) {
    -            if (qh CDDinput)
    -              infinity[coordcount-1] += value;
    -            else
    -              infinity[coordcount] += value;
    -          }
    -        }
    -      }
    -      if (++coordcount == diminput) {
    -        coordcount= 0;
    -        if (isdelaunay) {
    -          *(coords++)= paraboloid;
    -          maximize_(maxboloid, paraboloid);
    -          paraboloid= 0.0;
    -        }else if (qh HALFspace) {
    -          if (!qh_sethalfspace(*dimension, coords, &coords, normalp, offsetp, qh feasible_point)) {
    -            qh_fprintf(qh ferr, 8048, "The halfspace was on line %d\n", linecount);
    -            if (wasbegin)
    -              qh_fprintf(qh ferr, 8049, "The input appears to be in cdd format.  If so, you should use option 'Fd'\n");
    -            qh_errexit(qh_ERRinput, NULL, NULL);
    -          }
    -          coordp= qh half_space;
    -        }
    -        while (isspace(*s))
    -          s++;
    -        if (*s) {
    -          islong= True;
    -          if (!firstlong)
    -            firstlong= linecount;
    -        }
    -      }
    -    }
    -    if (!islong && !firstshort && coordcount)
    -      firstshort= linecount;
    -    if (!isfirst && s - qh line >= qh maxline) {
    -      qh_fprintf(qh ferr, 6078, "qhull input error: line %d contained more than %d characters\n",
    -              linecount, (int) (s - qh line));   /* WARN64 */
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    isfirst= False;
    -  }
    -  if (tokcount != maxcount) {
    -    newnum= fmin_(numinput, tokcount/diminput);
    -    qh_fprintf(qh ferr, 7073,"\
    -qhull warning: instead of %d %d-dimensional points, input contains\n\
    -%d points and %d extra coordinates.  Line %d is the first\npoint",
    -       numinput, diminput, tokcount/diminput, tokcount % diminput, firstpoint);
    -    if (firsttext)
    -      qh_fprintf(qh ferr, 8051, ", line %d is the first comment", firsttext);
    -    if (firstshort)
    -      qh_fprintf(qh ferr, 8052, ", line %d is the first short\nline", firstshort);
    -    if (firstlong)
    -      qh_fprintf(qh ferr, 8053, ", line %d is the first long line", firstlong);
    -    qh_fprintf(qh ferr, 8054, ".  Continue with %d points.\n", newnum);
    -    numinput= newnum;
    -    if (isdelaunay && qh ATinfinity) {
    -      for (k= tokcount % diminput; k--; )
    -        infinity[k] -= *(--coords);
    -      *numpoints= newnum+1;
    -    }else {
    -      coords -= tokcount % diminput;
    -      *numpoints= newnum;
    -    }
    -  }
    -  if (isdelaunay && qh ATinfinity) {
    -    for (k= (*dimension) -1; k--; )
    -      infinity[k] /= numinput;
    -    if (coords == infinity)
    -      coords += (*dimension) -1;
    -    else {
    -      for (k=0; k < (*dimension) -1; k++)
    -        *(coords++)= infinity[k];
    -    }
    -    *(coords++)= maxboloid * 1.1;
    -  }
    -  if (qh rbox_command[0]) {
    -    qh rbox_command[strlen(qh rbox_command)-1]= '\0';
    -    if (!strcmp(qh rbox_command, "./rbox D4"))
    -      qh_fprintf(qh ferr, 8055, "\n\
    -This is the qhull test case.  If any errors or core dumps occur,\n\
    -recompile qhull with 'make new'.  If errors still occur, there is\n\
    -an incompatibility.  You should try a different compiler.  You can also\n\
    -change the choices in user.h.  If you discover the source of the problem,\n\
    -please send mail to qhull_bug@qhull.org.\n\
    -\n\
    -Type 'qhull' for a short list of options.\n");
    -  }
    -  qh_free(qh line);
    -  qh line= NULL;
    -  if (qh half_space) {
    -    qh_free(qh half_space);
    -    qh half_space= NULL;
    -  }
    -  qh temp_malloc= NULL;
    -  trace1((qh ferr, 1008,"qh_readpoints: read in %d %d-dimensional points\n",
    -          numinput, diminput));
    -  return(points);
    -} /* readpoints */
    -
    -
    -/*---------------------------------
    -
    -  qh_setfeasible( dim )
    -    set qh.FEASIBLEpoint from qh.feasible_string in "n,n,n" or "n n n" format
    -
    -  notes:
    -    "n,n,n" already checked by qh_initflags()
    -    see qh_readfeasible()
    -*/
    -void qh_setfeasible(int dim) {
    -  int tokcount= 0;
    -  char *s;
    -  coordT *coords, value;
    -
    -  if (!(s= qh feasible_string)) {
    -    qh_fprintf(qh ferr, 6223, "\
    -qhull input error: halfspace intersection needs a feasible point.\n\
    -Either prepend the input with 1 point or use 'Hn,n,n'.  See manual.\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (!(qh feasible_point= (pointT*)qh_malloc(dim * sizeof(coordT)))) {
    -    qh_fprintf(qh ferr, 6079, "qhull error: insufficient memory for 'Hn,n,n'\n");
    -    qh_errexit(qh_ERRmem, NULL, NULL);
    -  }
    -  coords= qh feasible_point;
    -  while (*s) {
    -    value= qh_strtod(s, &s);
    -    if (++tokcount > dim) {
    -      qh_fprintf(qh ferr, 7059, "qhull input warning: more coordinates for 'H%s' than dimension %d\n",
    -          qh feasible_string, dim);
    -      break;
    -    }
    -    *(coords++)= value;
    -    if (*s)
    -      s++;
    -  }
    -  while (++tokcount <= dim)
    -    *(coords++)= 0.0;
    -} /* setfeasible */
    -
    -/*---------------------------------
    -
    -  qh_skipfacet( facet )
    -    returns 'True' if this facet is not to be printed
    -
    -  notes:
    -    based on the user provided slice thresholds and 'good' specifications
    -*/
    -boolT qh_skipfacet(facetT *facet) {
    -  facetT *neighbor, **neighborp;
    -
    -  if (qh PRINTneighbors) {
    -    if (facet->good)
    -      return !qh PRINTgood;
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->good)
    -        return False;
    -    }
    -    return True;
    -  }else if (qh PRINTgood)
    -    return !facet->good;
    -  else if (!facet->normal)
    -    return True;
    -  return(!qh_inthresholds(facet->normal, NULL));
    -} /* skipfacet */
    -
    -/*---------------------------------
    -
    -  qh_skipfilename( string )
    -    returns pointer to character after filename
    -
    -  notes:
    -    skips leading spaces
    -    ends with spacing or eol
    -    if starts with ' or " ends with the same, skipping \' or \"
    -    For qhull, qh_argv_to_command() only uses double quotes
    -*/
    -char *qh_skipfilename(char *filename) {
    -  char *s= filename;  /* non-const due to return */
    -  char c;
    -
    -  while (*s && isspace(*s))
    -    s++;
    -  c= *s++;
    -  if (c == '\0') {
    -    qh_fprintf(qh ferr, 6204, "qhull input error: filename expected, none found.\n");
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  if (c == '\'' || c == '"') {
    -    while (*s !=c || s[-1] == '\\') {
    -      if (!*s) {
    -        qh_fprintf(qh ferr, 6203, "qhull input error: missing quote after filename -- %s\n", filename);
    -        qh_errexit(qh_ERRinput, NULL, NULL);
    -      }
    -      s++;
    -    }
    -    s++;
    -  }
    -  else while (*s && !isspace(*s))
    -      s++;
    -  return s;
    -} /* skipfilename */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.h
    deleted file mode 100644
    index 580d51b9b3..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/io.h
    +++ /dev/null
    @@ -1,159 +0,0 @@
    -/*
      ---------------------------------
    -
    -   io.h
    -   declarations of Input/Output functions
    -
    -   see README, libqhull.h and io.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/io.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFio
    -#define qhDEFio 1
    -
    -#include "libqhull.h"
    -
    -/*============ constants and flags ==================*/
    -
    -/*----------------------------------
    -
    -  qh_MAXfirst
    -    maximum length of first two lines of stdin
    -*/
    -#define qh_MAXfirst  200
    -
    -/*----------------------------------
    -
    -  qh_MINradius
    -    min radius for Gp and Gv, fraction of maxcoord
    -*/
    -#define qh_MINradius 0.02
    -
    -/*----------------------------------
    -
    -  qh_GEOMepsilon
    -    adjust outer planes for 'lines closer' and geomview roundoff.
    -    This prevents bleed through.
    -*/
    -#define qh_GEOMepsilon 2e-3
    -
    -/*----------------------------------
    -
    -  qh_WHITESPACE
    -    possible values of white space
    -*/
    -#define qh_WHITESPACE " \n\t\v\r\f"
    -
    -
    -/*----------------------------------
    -
    -  qh_RIDGE
    -    to select which ridges to print in qh_eachvoronoi
    -*/
    -typedef enum
    -{
    -    qh_RIDGEall = 0, qh_RIDGEinner, qh_RIDGEouter
    -}
    -qh_RIDGE;
    -
    -/*----------------------------------
    -
    -  printvridgeT
    -    prints results of qh_printvdiagram
    -
    -  see:
    -    qh_printvridge for an example
    -*/
    -typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
    -
    -/*============== -prototypes in alphabetical order =========*/
    -
    -void    dfacet(unsigned id);
    -void    dvertex(unsigned id);
    -int     qh_compare_facetarea(const void *p1, const void *p2);
    -int     qh_compare_facetmerge(const void *p1, const void *p2);
    -int     qh_compare_facetvisit(const void *p1, const void *p2);
    -int     qh_compare_vertexpoint(const void *p1, const void *p2); /* not used */
    -void    qh_copyfilename(char *filename, int size, const char* source, int length);
    -void    qh_countfacets(facetT *facetlist, setT *facets, boolT printall,
    -              int *numfacetsp, int *numsimplicialp, int *totneighborsp,
    -              int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp);
    -pointT *qh_detvnorm(vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp);
    -setT   *qh_detvridge(vertexT *vertex);
    -setT   *qh_detvridge3 (vertexT *atvertex, vertexT *vertex);
    -int     qh_eachvoronoi(FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder);
    -int     qh_eachvoronoi_all(FILE *fp, printvridgeT printvridge, boolT isUpper, qh_RIDGE innerouter, boolT inorder);
    -void    qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist);
    -setT   *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets);
    -void    qh_geomplanes(facetT *facet, realT *outerplane, realT *innerplane);
    -void    qh_markkeep(facetT *facetlist);
    -setT   *qh_markvoronoi(facetT *facetlist, setT *facets, boolT printall, boolT *isLowerp, int *numcentersp);
    -void    qh_order_vertexneighbors(vertexT *vertex);
    -void    qh_prepare_output(void);
    -void    qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT printall);
    -void    qh_printbegin(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facetT *facet);
    -void    qh_printcentrum(FILE *fp, facetT *facet, realT radius);
    -void    qh_printend(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printend4geom(FILE *fp, facetT *facet, int *num, boolT printall);
    -void    qh_printextremes(FILE *fp, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printextremes_2d(FILE *fp, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printextremes_d(FILE *fp, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printfacet(FILE *fp, facetT *facet);
    -void    qh_printfacet2math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst);
    -void    qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]);
    -void    qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2,
    -                               facetT *facet, realT offset, realT color[3]);
    -void    qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst);
    -void    qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
    -void    qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]);
    -void    qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
    -void    qh_printfacet3vertex(FILE *fp, facetT *facet, qh_PRINT format);
    -void    qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
    -void    qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
    -void    qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, qh_PRINT format);
    -void    qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, qh_PRINT format);
    -void    qh_printfacetheader(FILE *fp, facetT *facet);
    -void    qh_printfacetridges(FILE *fp, facetT *facet);
    -void    qh_printfacets(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2,
    -                   setT *vertices, realT color[3]);
    -void    qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall);
    -void    qh_printline3geom(FILE *fp, pointT *pointA, pointT *pointB, realT color[3]);
    -void    qh_printpoint(FILE *fp, const char *string, pointT *point);
    -void    qh_printpointid(FILE *fp, const char *string, int dim, pointT *point, int id);
    -void    qh_printpoint3 (FILE *fp, pointT *point);
    -void    qh_printpoints_out(FILE *fp, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printpointvect(FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]);
    -void    qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius);
    -void    qh_printridge(FILE *fp, ridgeT *ridge);
    -void    qh_printspheres(FILE *fp, setT *vertices, realT radius);
    -void    qh_printvdiagram(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
    -int     qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder);
    -void    qh_printvertex(FILE *fp, vertexT *vertex);
    -void    qh_printvertexlist(FILE *fp, const char* string, facetT *facetlist,
    -                         setT *facets, boolT printall);
    -void    qh_printvertices(FILE *fp, const char* string, setT *vertices);
    -void    qh_printvneighbors(FILE *fp, facetT* facetlist, setT *facets, boolT printall);
    -void    qh_printvoronoi(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printvnorm(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
    -void    qh_printvridge(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
    -void    qh_produce_output(void);
    -void    qh_produce_output2(void);
    -void    qh_projectdim3 (pointT *source, pointT *destination);
    -int     qh_readfeasible(int dim, const char *curline);
    -coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
    -void    qh_setfeasible(int dim);
    -boolT   qh_skipfacet(facetT *facet);
    -char   *qh_skipfilename(char *filename);
    -
    -#endif /* qhDEFio */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.c
    deleted file mode 100644
    index a7d86ced29..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.c
    +++ /dev/null
    @@ -1,1401 +0,0 @@
    -/*
      ---------------------------------
    -
    -   libqhull.c
    -   Quickhull algorithm for convex hulls
    -
    -   qhull() and top-level routines
    -
    -   see qh-qhull.htm, libqhull.h, unix.c
    -
    -   see qhull_a.h for internal functions
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/libqhull.c#4 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*============= functions in alphabetic order after qhull() =======*/
    -
    -/*---------------------------------
    -
    -  qh_qhull()
    -    compute DIM3 convex hull of qh.num_points starting at qh.first_point
    -    qh contains all global options and variables
    -
    -  returns:
    -    returns polyhedron
    -      qh.facet_list, qh.num_facets, qh.vertex_list, qh.num_vertices,
    -
    -    returns global variables
    -      qh.hulltime, qh.max_outside, qh.interior_point, qh.max_vertex, qh.min_vertex
    -
    -    returns precision constants
    -      qh.ANGLEround, centrum_radius, cos_max, DISTround, MAXabs_coord, ONEmerge
    -
    -  notes:
    -    unless needed for output
    -      qh.max_vertex and qh.min_vertex are max/min due to merges
    -
    -  see:
    -    to add individual points to either qh.num_points
    -      use qh_addpoint()
    -
    -    if qh.GETarea
    -      qh_produceoutput() returns qh.totarea and qh.totvol via qh_getarea()
    -
    -  design:
    -    record starting time
    -    initialize hull and partition points
    -    build convex hull
    -    unless early termination
    -      update facet->maxoutside for vertices, coplanar, and near-inside points
    -    error if temporary sets exist
    -    record end time
    -*/
    -
    -void qh_qhull(void) {
    -  int numoutside;
    -
    -  qh hulltime= qh_CPUclock;
    -  if (qh RERUN || qh JOGGLEmax < REALmax/2)
    -    qh_build_withrestart();
    -  else {
    -    qh_initbuild();
    -    qh_buildhull();
    -  }
    -  if (!qh STOPpoint && !qh STOPcone) {
    -    if (qh ZEROall_ok && !qh TESTvneighbors && qh MERGEexact)
    -      qh_checkzero( qh_ALL);
    -    if (qh ZEROall_ok && !qh TESTvneighbors && !qh WAScoplanar) {
    -      trace2((qh ferr, 2055, "qh_qhull: all facets are clearly convex and no coplanar points.  Post-merging and check of maxout not needed.\n"));
    -      qh DOcheckmax= False;
    -    }else {
    -      if (qh MERGEexact || (qh hull_dim > qh_DIMreduceBuild && qh PREmerge))
    -        qh_postmerge("First post-merge", qh premerge_centrum, qh premerge_cos,
    -             (qh POSTmerge ? False : qh TESTvneighbors));
    -      else if (!qh POSTmerge && qh TESTvneighbors)
    -        qh_postmerge("For testing vertex neighbors", qh premerge_centrum,
    -             qh premerge_cos, True);
    -      if (qh POSTmerge)
    -        qh_postmerge("For post-merging", qh postmerge_centrum,
    -             qh postmerge_cos, qh TESTvneighbors);
    -      if (qh visible_list == qh facet_list) { /* i.e., merging done */
    -        qh findbestnew= True;
    -        qh_partitionvisible(/*visible_list, newfacet_list*/ !qh_ALL, &numoutside);
    -        qh findbestnew= False;
    -        qh_deletevisible(/*qh visible_list*/);
    -        qh_resetlists(False, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */);
    -      }
    -    }
    -    if (qh DOcheckmax){
    -      if (qh REPORTfreq) {
    -        qh_buildtracing(NULL, NULL);
    -        qh_fprintf(qh ferr, 8115, "\nTesting all coplanar points.\n");
    -      }
    -      qh_check_maxout();
    -    }
    -    if (qh KEEPnearinside && !qh maxoutdone)
    -      qh_nearcoplanar();
    -  }
    -  if (qh_setsize(qhmem.tempstack) != 0) {
    -    qh_fprintf(qh ferr, 6164, "qhull internal error (qh_qhull): temporary sets not empty(%d)\n",
    -             qh_setsize(qhmem.tempstack));
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  qh hulltime= qh_CPUclock - qh hulltime;
    -  qh QHULLfinished= True;
    -  trace1((qh ferr, 1036, "Qhull: algorithm completed\n"));
    -} /* qhull */
    -
    -/*---------------------------------
    -
    -  qh_addpoint( furthest, facet, checkdist )
    -    add point (usually furthest point) above facet to hull
    -    if checkdist,
    -      check that point is above facet.
    -      if point is not outside of the hull, uses qh_partitioncoplanar()
    -      assumes that facet is defined by qh_findbestfacet()
    -    else if facet specified,
    -      assumes that point is above facet (major damage if below)
    -    for Delaunay triangulations,
    -      Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed
    -      Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates.
    -
    -  returns:
    -    returns False if user requested an early termination
    -     qh.visible_list, newfacet_list, delvertex_list, NEWfacets may be defined
    -    updates qh.facet_list, qh.num_facets, qh.vertex_list, qh.num_vertices
    -    clear qh.maxoutdone (will need to call qh_check_maxout() for facet->maxoutside)
    -    if unknown point, adds a pointer to qh.other_points
    -      do not deallocate the point's coordinates
    -
    -  notes:
    -    assumes point is near its best facet and not at a local minimum of a lens
    -      distributions.  Use qh_findbestfacet to avoid this case.
    -    uses qh.visible_list, qh.newfacet_list, qh.delvertex_list, qh.NEWfacets
    -
    -  see also:
    -    qh_triangulate() -- triangulate non-simplicial facets
    -
    -  design:
    -    add point to other_points if needed
    -    if checkdist
    -      if point not above facet
    -        partition coplanar point
    -        exit
    -    exit if pre STOPpoint requested
    -    find horizon and visible facets for point
    -    make new facets for point to horizon
    -    make hyperplanes for point
    -    compute balance statistics
    -    match neighboring new facets
    -    update vertex neighbors and delete interior vertices
    -    exit if STOPcone requested
    -    merge non-convex new facets
    -    if merge found, many merges, or 'Qf'
    -       use qh_findbestnew() instead of qh_findbest()
    -    partition outside points from visible facets
    -    delete visible facets
    -    check polyhedron if requested
    -    exit if post STOPpoint requested
    -    reset working lists of facets and vertices
    -*/
    -boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) {
    -  int goodvisible, goodhorizon;
    -  vertexT *vertex;
    -  facetT *newfacet;
    -  realT dist, newbalance, pbalance;
    -  boolT isoutside= False;
    -  int numpart, numpoints, numnew, firstnew;
    -
    -  qh maxoutdone= False;
    -  if (qh_pointid(furthest) == -1)
    -    qh_setappend(&qh other_points, furthest);
    -  if (!facet) {
    -    qh_fprintf(qh ferr, 6213, "qhull internal error (qh_addpoint): NULL facet.  Need to call qh_findbestfacet first\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  if (checkdist) {
    -    facet= qh_findbest(furthest, facet, !qh_ALL, !qh_ISnewfacets, !qh_NOupper,
    -                        &dist, &isoutside, &numpart);
    -    zzadd_(Zpartition, numpart);
    -    if (!isoutside) {
    -      zinc_(Znotmax);  /* last point of outsideset is no longer furthest. */
    -      facet->notfurthest= True;
    -      qh_partitioncoplanar(furthest, facet, &dist);
    -      return True;
    -    }
    -  }
    -  qh_buildtracing(furthest, facet);
    -  if (qh STOPpoint < 0 && qh furthest_id == -qh STOPpoint-1) {
    -    facet->notfurthest= True;
    -    return False;
    -  }
    -  qh_findhorizon(furthest, facet, &goodvisible, &goodhorizon);
    -  if (qh ONLYgood && !(goodvisible+goodhorizon) && !qh GOODclosest) {
    -    zinc_(Znotgood);
    -    facet->notfurthest= True;
    -    /* last point of outsideset is no longer furthest.  This is ok
    -       since all points of the outside are likely to be bad */
    -    qh_resetlists(False, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */);
    -    return True;
    -  }
    -  zzinc_(Zprocessed);
    -  firstnew= qh facet_id;
    -  vertex= qh_makenewfacets(furthest /*visible_list, attaches if !ONLYgood */);
    -  qh_makenewplanes(/* newfacet_list */);
    -  numnew= qh facet_id - firstnew;
    -  newbalance= numnew - (realT) (qh num_facets-qh num_visible)
    -                         * qh hull_dim/qh num_vertices;
    -  wadd_(Wnewbalance, newbalance);
    -  wadd_(Wnewbalance2, newbalance * newbalance);
    -  if (qh ONLYgood
    -  && !qh_findgood(qh newfacet_list, goodhorizon) && !qh GOODclosest) {
    -    FORALLnew_facets
    -      qh_delfacet(newfacet);
    -    qh_delvertex(vertex);
    -    qh_resetlists(True, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */);
    -    zinc_(Znotgoodnew);
    -    facet->notfurthest= True;
    -    return True;
    -  }
    -  if (qh ONLYgood)
    -    qh_attachnewfacets(/*visible_list*/);
    -  qh_matchnewfacets();
    -  qh_updatevertices();
    -  if (qh STOPcone && qh furthest_id == qh STOPcone-1) {
    -    facet->notfurthest= True;
    -    return False;  /* visible_list etc. still defined */
    -  }
    -  qh findbestnew= False;
    -  if (qh PREmerge || qh MERGEexact) {
    -    qh_premerge(vertex, qh premerge_centrum, qh premerge_cos);
    -    if (qh_USEfindbestnew)
    -      qh findbestnew= True;
    -    else {
    -      FORALLnew_facets {
    -        if (!newfacet->simplicial) {
    -          qh findbestnew= True;  /* use qh_findbestnew instead of qh_findbest*/
    -          break;
    -        }
    -      }
    -    }
    -  }else if (qh BESToutside)
    -    qh findbestnew= True;
    -  qh_partitionvisible(/*visible_list, newfacet_list*/ !qh_ALL, &numpoints);
    -  qh findbestnew= False;
    -  qh findbest_notsharp= False;
    -  zinc_(Zpbalance);
    -  pbalance= numpoints - (realT) qh hull_dim /* assumes all points extreme */
    -                * (qh num_points - qh num_vertices)/qh num_vertices;
    -  wadd_(Wpbalance, pbalance);
    -  wadd_(Wpbalance2, pbalance * pbalance);
    -  qh_deletevisible(/*qh visible_list*/);
    -  zmax_(Zmaxvertex, qh num_vertices);
    -  qh NEWfacets= False;
    -  if (qh IStracing >= 4) {
    -    if (qh num_facets < 2000)
    -      qh_printlists();
    -    qh_printfacetlist(qh newfacet_list, NULL, True);
    -    qh_checkpolygon(qh facet_list);
    -  }else if (qh CHECKfrequently) {
    -    if (qh num_facets < 50)
    -      qh_checkpolygon(qh facet_list);
    -    else
    -      qh_checkpolygon(qh newfacet_list);
    -  }
    -  if (qh STOPpoint > 0 && qh furthest_id == qh STOPpoint-1)
    -    return False;
    -  qh_resetlists(True, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */);
    -  /* qh_triangulate(); to test qh.TRInormals */
    -  trace2((qh ferr, 2056, "qh_addpoint: added p%d new facets %d new balance %2.2g point balance %2.2g\n",
    -    qh_pointid(furthest), numnew, newbalance, pbalance));
    -  return True;
    -} /* addpoint */
    -
    -/*---------------------------------
    -
    -  qh_build_withrestart()
    -    allow restarts due to qh.JOGGLEmax while calling qh_buildhull()
    -    qh.FIRSTpoint/qh.NUMpoints is point array
    -        it may be moved by qh_joggleinput()
    -*/
    -void qh_build_withrestart(void) {
    -  int restart;
    -
    -  qh ALLOWrestart= True;
    -  while (True) {
    -    restart= setjmp(qh restartexit); /* simple statement for CRAY J916 */
    -    if (restart) {       /* only from qh_precision() */
    -      zzinc_(Zretry);
    -      wmax_(Wretrymax, qh JOGGLEmax);
    -      /* QH7078 warns about using 'TCn' with 'QJn' */
    -      qh STOPcone= -1; /* if break from joggle, prevents normal output */
    -    }
    -    if (!qh RERUN && qh JOGGLEmax < REALmax/2) {
    -      if (qh build_cnt > qh_JOGGLEmaxretry) {
    -        qh_fprintf(qh ferr, 6229, "qhull precision error: %d attempts to construct a convex hull\n\
    -        with joggled input.  Increase joggle above 'QJ%2.2g'\n\
    -        or modify qh_JOGGLE... parameters in user.h\n",
    -           qh build_cnt, qh JOGGLEmax);
    -        qh_errexit(qh_ERRqhull, NULL, NULL);
    -      }
    -      if (qh build_cnt && !restart)
    -        break;
    -    }else if (qh build_cnt && qh build_cnt >= qh RERUN)
    -      break;
    -    qh STOPcone= 0;
    -    qh_freebuild(True);  /* first call is a nop */
    -    qh build_cnt++;
    -    if (!qh qhull_optionsiz)
    -      qh qhull_optionsiz= (int)strlen(qh qhull_options);   /* WARN64 */
    -    else {
    -      qh qhull_options [qh qhull_optionsiz]= '\0';
    -      qh qhull_optionlen= qh_OPTIONline;  /* starts a new line */
    -    }
    -    qh_option("_run", &qh build_cnt, NULL);
    -    if (qh build_cnt == qh RERUN) {
    -      qh IStracing= qh TRACElastrun;  /* duplicated from qh_initqhull_globals */
    -      if (qh TRACEpoint != -1 || qh TRACEdist < REALmax/2 || qh TRACEmerge) {
    -        qh TRACElevel= (qh IStracing? qh IStracing : 3);
    -        qh IStracing= 0;
    -      }
    -      qhmem.IStracing= qh IStracing;
    -    }
    -    if (qh JOGGLEmax < REALmax/2)
    -      qh_joggleinput();
    -    qh_initbuild();
    -    qh_buildhull();
    -    if (qh JOGGLEmax < REALmax/2 && !qh MERGING)
    -      qh_checkconvex(qh facet_list, qh_ALGORITHMfault);
    -  }
    -  qh ALLOWrestart= False;
    -} /* qh_build_withrestart */
    -
    -/*---------------------------------
    -
    -  qh_buildhull()
    -    construct a convex hull by adding outside points one at a time
    -
    -  returns:
    -
    -  notes:
    -    may be called multiple times
    -    checks facet and vertex lists for incorrect flags
    -    to recover from STOPcone, call qh_deletevisible and qh_resetlists
    -
    -  design:
    -    check visible facet and newfacet flags
    -    check newlist vertex flags and qh.STOPcone/STOPpoint
    -    for each facet with a furthest outside point
    -      add point to facet
    -      exit if qh.STOPcone or qh.STOPpoint requested
    -    if qh.NARROWhull for initial simplex
    -      partition remaining outside points to coplanar sets
    -*/
    -void qh_buildhull(void) {
    -  facetT *facet;
    -  pointT *furthest;
    -  vertexT *vertex;
    -  int id;
    -
    -  trace1((qh ferr, 1037, "qh_buildhull: start build hull\n"));
    -  FORALLfacets {
    -    if (facet->visible || facet->newfacet) {
    -      qh_fprintf(qh ferr, 6165, "qhull internal error (qh_buildhull): visible or new facet f%d in facet list\n",
    -                   facet->id);
    -      qh_errexit(qh_ERRqhull, facet, NULL);
    -    }
    -  }
    -  FORALLvertices {
    -    if (vertex->newlist) {
    -      qh_fprintf(qh ferr, 6166, "qhull internal error (qh_buildhull): new vertex f%d in vertex list\n",
    -                   vertex->id);
    -      qh_errprint("ERRONEOUS", NULL, NULL, NULL, vertex);
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -    id= qh_pointid(vertex->point);
    -    if ((qh STOPpoint>0 && id == qh STOPpoint-1) ||
    -        (qh STOPpoint<0 && id == -qh STOPpoint-1) ||
    -        (qh STOPcone>0 && id == qh STOPcone-1)) {
    -      trace1((qh ferr, 1038,"qh_buildhull: stop point or cone P%d in initial hull\n", id));
    -      return;
    -    }
    -  }
    -  qh facet_next= qh facet_list;      /* advance facet when processed */
    -  while ((furthest= qh_nextfurthest(&facet))) {
    -    qh num_outside--;  /* if ONLYmax, furthest may not be outside */
    -    if (!qh_addpoint(furthest, facet, qh ONLYmax))
    -      break;
    -  }
    -  if (qh NARROWhull) /* move points from outsideset to coplanarset */
    -    qh_outcoplanar( /* facet_list */ );
    -  if (qh num_outside && !furthest) {
    -    qh_fprintf(qh ferr, 6167, "qhull internal error (qh_buildhull): %d outside points were never processed.\n", qh num_outside);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  trace1((qh ferr, 1039, "qh_buildhull: completed the hull construction\n"));
    -} /* buildhull */
    -
    -
    -/*---------------------------------
    -
    -  qh_buildtracing( furthest, facet )
    -    trace an iteration of qh_buildhull() for furthest point and facet
    -    if !furthest, prints progress message
    -
    -  returns:
    -    tracks progress with qh.lastreport
    -    updates qh.furthest_id (-3 if furthest is NULL)
    -    also resets visit_id, vertext_visit on wrap around
    -
    -  see:
    -    qh_tracemerging()
    -
    -  design:
    -    if !furthest
    -      print progress message
    -      exit
    -    if 'TFn' iteration
    -      print progress message
    -    else if tracing
    -      trace furthest point and facet
    -    reset qh.visit_id and qh.vertex_visit if overflow may occur
    -    set qh.furthest_id for tracing
    -*/
    -void qh_buildtracing(pointT *furthest, facetT *facet) {
    -  realT dist= 0;
    -  float cpu;
    -  int total, furthestid;
    -  time_t timedata;
    -  struct tm *tp;
    -  vertexT *vertex;
    -
    -  qh old_randomdist= qh RANDOMdist;
    -  qh RANDOMdist= False;
    -  if (!furthest) {
    -    time(&timedata);
    -    tp= localtime(&timedata);
    -    cpu= (float)qh_CPUclock - (float)qh hulltime;
    -    cpu /= (float)qh_SECticks;
    -    total= zzval_(Ztotmerge) - zzval_(Zcyclehorizon) + zzval_(Zcyclefacettot);
    -    qh_fprintf(qh ferr, 8118, "\n\
    -At %02d:%02d:%02d & %2.5g CPU secs, qhull has created %d facets and merged %d.\n\
    - The current hull contains %d facets and %d vertices.  Last point was p%d\n",
    -      tp->tm_hour, tp->tm_min, tp->tm_sec, cpu, qh facet_id -1,
    -      total, qh num_facets, qh num_vertices, qh furthest_id);
    -    return;
    -  }
    -  furthestid= qh_pointid(furthest);
    -  if (qh TRACEpoint == furthestid) {
    -    qh IStracing= qh TRACElevel;
    -    qhmem.IStracing= qh TRACElevel;
    -  }else if (qh TRACEpoint != -1 && qh TRACEdist < REALmax/2) {
    -    qh IStracing= 0;
    -    qhmem.IStracing= 0;
    -  }
    -  if (qh REPORTfreq && (qh facet_id-1 > qh lastreport+qh REPORTfreq)) {
    -    qh lastreport= qh facet_id-1;
    -    time(&timedata);
    -    tp= localtime(&timedata);
    -    cpu= (float)qh_CPUclock - (float)qh hulltime;
    -    cpu /= (float)qh_SECticks;
    -    total= zzval_(Ztotmerge) - zzval_(Zcyclehorizon) + zzval_(Zcyclefacettot);
    -    zinc_(Zdistio);
    -    qh_distplane(furthest, facet, &dist);
    -    qh_fprintf(qh ferr, 8119, "\n\
    -At %02d:%02d:%02d & %2.5g CPU secs, qhull has created %d facets and merged %d.\n\
    - The current hull contains %d facets and %d vertices.  There are %d\n\
    - outside points.  Next is point p%d(v%d), %2.2g above f%d.\n",
    -      tp->tm_hour, tp->tm_min, tp->tm_sec, cpu, qh facet_id -1,
    -      total, qh num_facets, qh num_vertices, qh num_outside+1,
    -      furthestid, qh vertex_id, dist, getid_(facet));
    -  }else if (qh IStracing >=1) {
    -    cpu= (float)qh_CPUclock - (float)qh hulltime;
    -    cpu /= (float)qh_SECticks;
    -    qh_distplane(furthest, facet, &dist);
    -    qh_fprintf(qh ferr, 8120, "qh_addpoint: add p%d(v%d) to hull of %d facets(%2.2g above f%d) and %d outside at %4.4g CPU secs.  Previous was p%d.\n",
    -      furthestid, qh vertex_id, qh num_facets, dist,
    -      getid_(facet), qh num_outside+1, cpu, qh furthest_id);
    -  }
    -  zmax_(Zvisit2max, (int)qh visit_id/2);
    -  if (qh visit_id > (unsigned) INT_MAX) {
    -    zinc_(Zvisit);
    -    qh visit_id= 0;
    -    FORALLfacets
    -      facet->visitid= 0;
    -  }
    -  zmax_(Zvvisit2max, (int)qh vertex_visit/2);
    -  if (qh vertex_visit > (unsigned) INT_MAX/2) { /* 31 bits */
    -    zinc_(Zvvisit);
    -    qh vertex_visit= 0;
    -    FORALLvertices
    -      vertex->visitid= 0;
    -  }
    -  qh furthest_id= furthestid;
    -  qh RANDOMdist= qh old_randomdist;
    -} /* buildtracing */
    -
    -/*---------------------------------
    -
    -  qh_errexit2( exitcode, facet, otherfacet )
    -    return exitcode to system after an error
    -    report two facets
    -
    -  returns:
    -    assumes exitcode non-zero
    -
    -  see:
    -    normally use qh_errexit() in user.c(reports a facet and a ridge)
    -*/
    -void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet) {
    -
    -  qh_errprint("ERRONEOUS", facet, otherfacet, NULL, NULL);
    -  qh_errexit(exitcode, NULL, NULL);
    -} /* errexit2 */
    -
    -
    -/*---------------------------------
    -
    -  qh_findhorizon( point, facet, goodvisible, goodhorizon )
    -    given a visible facet, find the point's horizon and visible facets
    -    for all facets, !facet-visible
    -
    -  returns:
    -    returns qh.visible_list/num_visible with all visible facets
    -      marks visible facets with ->visible
    -    updates count of good visible and good horizon facets
    -    updates qh.max_outside, qh.max_vertex, facet->maxoutside
    -
    -  see:
    -    similar to qh_delpoint()
    -
    -  design:
    -    move facet to qh.visible_list at end of qh.facet_list
    -    for all visible facets
    -     for each unvisited neighbor of a visible facet
    -       compute distance of point to neighbor
    -       if point above neighbor
    -         move neighbor to end of qh.visible_list
    -       else if point is coplanar with neighbor
    -         update qh.max_outside, qh.max_vertex, neighbor->maxoutside
    -         mark neighbor coplanar (will create a samecycle later)
    -         update horizon statistics
    -*/
    -void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible, int *goodhorizon) {
    -  facetT *neighbor, **neighborp, *visible;
    -  int numhorizon= 0, coplanar= 0;
    -  realT dist;
    -
    -  trace1((qh ferr, 1040,"qh_findhorizon: find horizon for point p%d facet f%d\n",qh_pointid(point),facet->id));
    -  *goodvisible= *goodhorizon= 0;
    -  zinc_(Ztotvisible);
    -  qh_removefacet(facet);  /* visible_list at end of qh facet_list */
    -  qh_appendfacet(facet);
    -  qh num_visible= 1;
    -  if (facet->good)
    -    (*goodvisible)++;
    -  qh visible_list= facet;
    -  facet->visible= True;
    -  facet->f.replace= NULL;
    -  if (qh IStracing >=4)
    -    qh_errprint("visible", facet, NULL, NULL, NULL);
    -  qh visit_id++;
    -  FORALLvisible_facets {
    -    if (visible->tricoplanar && !qh TRInormals) {
    -      qh_fprintf(qh ferr, 6230, "Qhull internal error (qh_findhorizon): does not work for tricoplanar facets.  Use option 'Q11'\n");
    -      qh_errexit(qh_ERRqhull, visible, NULL);
    -    }
    -    visible->visitid= qh visit_id;
    -    FOREACHneighbor_(visible) {
    -      if (neighbor->visitid == qh visit_id)
    -        continue;
    -      neighbor->visitid= qh visit_id;
    -      zzinc_(Znumvisibility);
    -      qh_distplane(point, neighbor, &dist);
    -      if (dist > qh MINvisible) {
    -        zinc_(Ztotvisible);
    -        qh_removefacet(neighbor);  /* append to end of qh visible_list */
    -        qh_appendfacet(neighbor);
    -        neighbor->visible= True;
    -        neighbor->f.replace= NULL;
    -        qh num_visible++;
    -        if (neighbor->good)
    -          (*goodvisible)++;
    -        if (qh IStracing >=4)
    -          qh_errprint("visible", neighbor, NULL, NULL, NULL);
    -      }else {
    -        if (dist > - qh MAXcoplanar) {
    -          neighbor->coplanar= True;
    -          zzinc_(Zcoplanarhorizon);
    -          qh_precision("coplanar horizon");
    -          coplanar++;
    -          if (qh MERGING) {
    -            if (dist > 0) {
    -              maximize_(qh max_outside, dist);
    -              maximize_(qh max_vertex, dist);
    -#if qh_MAXoutside
    -              maximize_(neighbor->maxoutside, dist);
    -#endif
    -            }else
    -              minimize_(qh min_vertex, dist);  /* due to merge later */
    -          }
    -          trace2((qh ferr, 2057, "qh_findhorizon: point p%d is coplanar to horizon f%d, dist=%2.7g < qh MINvisible(%2.7g)\n",
    -              qh_pointid(point), neighbor->id, dist, qh MINvisible));
    -        }else
    -          neighbor->coplanar= False;
    -        zinc_(Ztothorizon);
    -        numhorizon++;
    -        if (neighbor->good)
    -          (*goodhorizon)++;
    -        if (qh IStracing >=4)
    -          qh_errprint("horizon", neighbor, NULL, NULL, NULL);
    -      }
    -    }
    -  }
    -  if (!numhorizon) {
    -    qh_precision("empty horizon");
    -    qh_fprintf(qh ferr, 6168, "qhull precision error (qh_findhorizon): empty horizon\n\
    -QhullPoint p%d was above all facets.\n", qh_pointid(point));
    -    qh_printfacetlist(qh facet_list, NULL, True);
    -    qh_errexit(qh_ERRprec, NULL, NULL);
    -  }
    -  trace1((qh ferr, 1041, "qh_findhorizon: %d horizon facets(good %d), %d visible(good %d), %d coplanar\n",
    -       numhorizon, *goodhorizon, qh num_visible, *goodvisible, coplanar));
    -  if (qh IStracing >= 4 && qh num_facets < 50)
    -    qh_printlists();
    -} /* findhorizon */
    -
    -/*---------------------------------
    -
    -  qh_nextfurthest( visible )
    -    returns next furthest point and visible facet for qh_addpoint()
    -    starts search at qh.facet_next
    -
    -  returns:
    -    removes furthest point from outside set
    -    NULL if none available
    -    advances qh.facet_next over facets with empty outside sets
    -
    -  design:
    -    for each facet from qh.facet_next
    -      if empty outside set
    -        advance qh.facet_next
    -      else if qh.NARROWhull
    -        determine furthest outside point
    -        if furthest point is not outside
    -          advance qh.facet_next(point will be coplanar)
    -    remove furthest point from outside set
    -*/
    -pointT *qh_nextfurthest(facetT **visible) {
    -  facetT *facet;
    -  int size, idx;
    -  realT randr, dist;
    -  pointT *furthest;
    -
    -  while ((facet= qh facet_next) != qh facet_tail) {
    -    if (!facet->outsideset) {
    -      qh facet_next= facet->next;
    -      continue;
    -    }
    -    SETreturnsize_(facet->outsideset, size);
    -    if (!size) {
    -      qh_setfree(&facet->outsideset);
    -      qh facet_next= facet->next;
    -      continue;
    -    }
    -    if (qh NARROWhull) {
    -      if (facet->notfurthest)
    -        qh_furthestout(facet);
    -      furthest= (pointT*)qh_setlast(facet->outsideset);
    -#if qh_COMPUTEfurthest
    -      qh_distplane(furthest, facet, &dist);
    -      zinc_(Zcomputefurthest);
    -#else
    -      dist= facet->furthestdist;
    -#endif
    -      if (dist < qh MINoutside) { /* remainder of outside set is coplanar for qh_outcoplanar */
    -        qh facet_next= facet->next;
    -        continue;
    -      }
    -    }
    -    if (!qh RANDOMoutside && !qh VIRTUALmemory) {
    -      if (qh PICKfurthest) {
    -        qh_furthestnext(/* qh facet_list */);
    -        facet= qh facet_next;
    -      }
    -      *visible= facet;
    -      return((pointT*)qh_setdellast(facet->outsideset));
    -    }
    -    if (qh RANDOMoutside) {
    -      int outcoplanar = 0;
    -      if (qh NARROWhull) {
    -        FORALLfacets {
    -          if (facet == qh facet_next)
    -            break;
    -          if (facet->outsideset)
    -            outcoplanar += qh_setsize( facet->outsideset);
    -        }
    -      }
    -      randr= qh_RANDOMint;
    -      randr= randr/(qh_RANDOMmax+1);
    -      idx= (int)floor((qh num_outside - outcoplanar) * randr);
    -      FORALLfacet_(qh facet_next) {
    -        if (facet->outsideset) {
    -          SETreturnsize_(facet->outsideset, size);
    -          if (!size)
    -            qh_setfree(&facet->outsideset);
    -          else if (size > idx) {
    -            *visible= facet;
    -            return((pointT*)qh_setdelnth(facet->outsideset, idx));
    -          }else
    -            idx -= size;
    -        }
    -      }
    -      qh_fprintf(qh ferr, 6169, "qhull internal error (qh_nextfurthest): num_outside %d is too low\nby at least %d, or a random real %g >= 1.0\n",
    -              qh num_outside, idx+1, randr);
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }else { /* VIRTUALmemory */
    -      facet= qh facet_tail->previous;
    -      if (!(furthest= (pointT*)qh_setdellast(facet->outsideset))) {
    -        if (facet->outsideset)
    -          qh_setfree(&facet->outsideset);
    -        qh_removefacet(facet);
    -        qh_prependfacet(facet, &qh facet_list);
    -        continue;
    -      }
    -      *visible= facet;
    -      return furthest;
    -    }
    -  }
    -  return NULL;
    -} /* nextfurthest */
    -
    -/*---------------------------------
    -
    -  qh_partitionall( vertices, points, numpoints )
    -    partitions all points in points/numpoints to the outsidesets of facets
    -    vertices= vertices in qh.facet_list(!partitioned)
    -
    -  returns:
    -    builds facet->outsideset
    -    does not partition qh.GOODpoint
    -    if qh.ONLYgood && !qh.MERGING,
    -      does not partition qh.GOODvertex
    -
    -  notes:
    -    faster if qh.facet_list sorted by anticipated size of outside set
    -
    -  design:
    -    initialize pointset with all points
    -    remove vertices from pointset
    -    remove qh.GOODpointp from pointset (unless it's qh.STOPcone or qh.STOPpoint)
    -    for all facets
    -      for all remaining points in pointset
    -        compute distance from point to facet
    -        if point is outside facet
    -          remove point from pointset (by not reappending)
    -          update bestpoint
    -          append point or old bestpoint to facet's outside set
    -      append bestpoint to facet's outside set (furthest)
    -    for all points remaining in pointset
    -      partition point into facets' outside sets and coplanar sets
    -*/
    -void qh_partitionall(setT *vertices, pointT *points, int numpoints){
    -  setT *pointset;
    -  vertexT *vertex, **vertexp;
    -  pointT *point, **pointp, *bestpoint;
    -  int size, point_i, point_n, point_end, remaining, i, id;
    -  facetT *facet;
    -  realT bestdist= -REALmax, dist, distoutside;
    -
    -  trace1((qh ferr, 1042, "qh_partitionall: partition all points into outside sets\n"));
    -  pointset= qh_settemp(numpoints);
    -  qh num_outside= 0;
    -  pointp= SETaddr_(pointset, pointT);
    -  for (i=numpoints, point= points; i--; point += qh hull_dim)
    -    *(pointp++)= point;
    -  qh_settruncate(pointset, numpoints);
    -  FOREACHvertex_(vertices) {
    -    if ((id= qh_pointid(vertex->point)) >= 0)
    -      SETelem_(pointset, id)= NULL;
    -  }
    -  id= qh_pointid(qh GOODpointp);
    -  if (id >=0 && qh STOPcone-1 != id && -qh STOPpoint-1 != id)
    -    SETelem_(pointset, id)= NULL;
    -  if (qh GOODvertexp && qh ONLYgood && !qh MERGING) { /* matches qhull()*/
    -    if ((id= qh_pointid(qh GOODvertexp)) >= 0)
    -      SETelem_(pointset, id)= NULL;
    -  }
    -  if (!qh BESToutside) {  /* matches conditional for qh_partitionpoint below */
    -    distoutside= qh_DISToutside; /* multiple of qh.MINoutside & qh.max_outside, see user.h */
    -    zval_(Ztotpartition)= qh num_points - qh hull_dim - 1; /*misses GOOD... */
    -    remaining= qh num_facets;
    -    point_end= numpoints;
    -    FORALLfacets {
    -      size= point_end/(remaining--) + 100;
    -      facet->outsideset= qh_setnew(size);
    -      bestpoint= NULL;
    -      point_end= 0;
    -      FOREACHpoint_i_(pointset) {
    -        if (point) {
    -          zzinc_(Zpartitionall);
    -          qh_distplane(point, facet, &dist);
    -          if (dist < distoutside)
    -            SETelem_(pointset, point_end++)= point;
    -          else {
    -            qh num_outside++;
    -            if (!bestpoint) {
    -              bestpoint= point;
    -              bestdist= dist;
    -            }else if (dist > bestdist) {
    -              qh_setappend(&facet->outsideset, bestpoint);
    -              bestpoint= point;
    -              bestdist= dist;
    -            }else
    -              qh_setappend(&facet->outsideset, point);
    -          }
    -        }
    -      }
    -      if (bestpoint) {
    -        qh_setappend(&facet->outsideset, bestpoint);
    -#if !qh_COMPUTEfurthest
    -        facet->furthestdist= bestdist;
    -#endif
    -      }else
    -        qh_setfree(&facet->outsideset);
    -      qh_settruncate(pointset, point_end);
    -    }
    -  }
    -  /* if !qh BESToutside, pointset contains points not assigned to outsideset */
    -  if (qh BESToutside || qh MERGING || qh KEEPcoplanar || qh KEEPinside) {
    -    qh findbestnew= True;
    -    FOREACHpoint_i_(pointset) {
    -      if (point)
    -        qh_partitionpoint(point, qh facet_list);
    -    }
    -    qh findbestnew= False;
    -  }
    -  zzadd_(Zpartitionall, zzval_(Zpartition));
    -  zzval_(Zpartition)= 0;
    -  qh_settempfree(&pointset);
    -  if (qh IStracing >= 4)
    -    qh_printfacetlist(qh facet_list, NULL, True);
    -} /* partitionall */
    -
    -
    -/*---------------------------------
    -
    -  qh_partitioncoplanar( point, facet, dist )
    -    partition coplanar point to a facet
    -    dist is distance from point to facet
    -    if dist NULL,
    -      searches for bestfacet and does nothing if inside
    -    if qh.findbestnew set,
    -      searches new facets instead of using qh_findbest()
    -
    -  returns:
    -    qh.max_ouside updated
    -    if qh.KEEPcoplanar or qh.KEEPinside
    -      point assigned to best coplanarset
    -
    -  notes:
    -    facet->maxoutside is updated at end by qh_check_maxout
    -
    -  design:
    -    if dist undefined
    -      find best facet for point
    -      if point sufficiently below facet (depends on qh.NEARinside and qh.KEEPinside)
    -        exit
    -    if keeping coplanar/nearinside/inside points
    -      if point is above furthest coplanar point
    -        append point to coplanar set (it is the new furthest)
    -        update qh.max_outside
    -      else
    -        append point one before end of coplanar set
    -    else if point is clearly outside of qh.max_outside and bestfacet->coplanarset
    -    and bestfacet is more than perpendicular to facet
    -      repartition the point using qh_findbest() -- it may be put on an outsideset
    -    else
    -      update qh.max_outside
    -*/
    -void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist) {
    -  facetT *bestfacet;
    -  pointT *oldfurthest;
    -  realT bestdist, dist2= 0, angle;
    -  int numpart= 0, oldfindbest;
    -  boolT isoutside;
    -
    -  qh WAScoplanar= True;
    -  if (!dist) {
    -    if (qh findbestnew)
    -      bestfacet= qh_findbestnew(point, facet, &bestdist, qh_ALL, &isoutside, &numpart);
    -    else
    -      bestfacet= qh_findbest(point, facet, qh_ALL, !qh_ISnewfacets, qh DELAUNAY,
    -                          &bestdist, &isoutside, &numpart);
    -    zinc_(Ztotpartcoplanar);
    -    zzadd_(Zpartcoplanar, numpart);
    -    if (!qh DELAUNAY && !qh KEEPinside) { /*  for 'd', bestdist skips upperDelaunay facets */
    -      if (qh KEEPnearinside) {
    -        if (bestdist < -qh NEARinside) {
    -          zinc_(Zcoplanarinside);
    -          trace4((qh ferr, 4062, "qh_partitioncoplanar: point p%d is more than near-inside facet f%d dist %2.2g findbestnew %d\n",
    -                  qh_pointid(point), bestfacet->id, bestdist, qh findbestnew));
    -          return;
    -        }
    -      }else if (bestdist < -qh MAXcoplanar) {
    -          trace4((qh ferr, 4063, "qh_partitioncoplanar: point p%d is inside facet f%d dist %2.2g findbestnew %d\n",
    -                  qh_pointid(point), bestfacet->id, bestdist, qh findbestnew));
    -        zinc_(Zcoplanarinside);
    -        return;
    -      }
    -    }
    -  }else {
    -    bestfacet= facet;
    -    bestdist= *dist;
    -  }
    -  if (bestdist > qh max_outside) {
    -    if (!dist && facet != bestfacet) {
    -      zinc_(Zpartangle);
    -      angle= qh_getangle(facet->normal, bestfacet->normal);
    -      if (angle < 0) {
    -        /* typically due to deleted vertex and coplanar facets, e.g.,
    -             RBOX 1000 s Z1 G1e-13 t1001185205 | QHULL Tv */
    -        zinc_(Zpartflip);
    -        trace2((qh ferr, 2058, "qh_partitioncoplanar: repartition point p%d from f%d.  It is above flipped facet f%d dist %2.2g\n",
    -                qh_pointid(point), facet->id, bestfacet->id, bestdist));
    -        oldfindbest= qh findbestnew;
    -        qh findbestnew= False;
    -        qh_partitionpoint(point, bestfacet);
    -        qh findbestnew= oldfindbest;
    -        return;
    -      }
    -    }
    -    qh max_outside= bestdist;
    -    if (bestdist > qh TRACEdist) {
    -      qh_fprintf(qh ferr, 8122, "qh_partitioncoplanar: ====== p%d from f%d increases max_outside to %2.2g of f%d last p%d\n",
    -                     qh_pointid(point), facet->id, bestdist, bestfacet->id, qh furthest_id);
    -      qh_errprint("DISTANT", facet, bestfacet, NULL, NULL);
    -    }
    -  }
    -  if (qh KEEPcoplanar + qh KEEPinside + qh KEEPnearinside) {
    -    oldfurthest= (pointT*)qh_setlast(bestfacet->coplanarset);
    -    if (oldfurthest) {
    -      zinc_(Zcomputefurthest);
    -      qh_distplane(oldfurthest, bestfacet, &dist2);
    -    }
    -    if (!oldfurthest || dist2 < bestdist)
    -      qh_setappend(&bestfacet->coplanarset, point);
    -    else
    -      qh_setappend2ndlast(&bestfacet->coplanarset, point);
    -  }
    -  trace4((qh ferr, 4064, "qh_partitioncoplanar: point p%d is coplanar with facet f%d(or inside) dist %2.2g\n",
    -          qh_pointid(point), bestfacet->id, bestdist));
    -} /* partitioncoplanar */
    -
    -/*---------------------------------
    -
    -  qh_partitionpoint( point, facet )
    -    assigns point to an outside set, coplanar set, or inside set (i.e., dropt)
    -    if qh.findbestnew
    -      uses qh_findbestnew() to search all new facets
    -    else
    -      uses qh_findbest()
    -
    -  notes:
    -    after qh_distplane(), this and qh_findbest() are most expensive in 3-d
    -
    -  design:
    -    find best facet for point
    -      (either exhaustive search of new facets or directed search from facet)
    -    if qh.NARROWhull
    -      retain coplanar and nearinside points as outside points
    -    if point is outside bestfacet
    -      if point above furthest point for bestfacet
    -        append point to outside set (it becomes the new furthest)
    -        if outside set was empty
    -          move bestfacet to end of qh.facet_list (i.e., after qh.facet_next)
    -        update bestfacet->furthestdist
    -      else
    -        append point one before end of outside set
    -    else if point is coplanar to bestfacet
    -      if keeping coplanar points or need to update qh.max_outside
    -        partition coplanar point into bestfacet
    -    else if near-inside point
    -      partition as coplanar point into bestfacet
    -    else is an inside point
    -      if keeping inside points
    -        partition as coplanar point into bestfacet
    -*/
    -void qh_partitionpoint(pointT *point, facetT *facet) {
    -  realT bestdist;
    -  boolT isoutside;
    -  facetT *bestfacet;
    -  int numpart;
    -#if qh_COMPUTEfurthest
    -  realT dist;
    -#endif
    -
    -  if (qh findbestnew)
    -    bestfacet= qh_findbestnew(point, facet, &bestdist, qh BESToutside, &isoutside, &numpart);
    -  else
    -    bestfacet= qh_findbest(point, facet, qh BESToutside, qh_ISnewfacets, !qh_NOupper,
    -                          &bestdist, &isoutside, &numpart);
    -  zinc_(Ztotpartition);
    -  zzadd_(Zpartition, numpart);
    -  if (qh NARROWhull) {
    -    if (qh DELAUNAY && !isoutside && bestdist >= -qh MAXcoplanar)
    -      qh_precision("nearly incident point(narrow hull)");
    -    if (qh KEEPnearinside) {
    -      if (bestdist >= -qh NEARinside)
    -        isoutside= True;
    -    }else if (bestdist >= -qh MAXcoplanar)
    -      isoutside= True;
    -  }
    -
    -  if (isoutside) {
    -    if (!bestfacet->outsideset
    -    || !qh_setlast(bestfacet->outsideset)) {
    -      qh_setappend(&(bestfacet->outsideset), point);
    -      if (!bestfacet->newfacet) {
    -        qh_removefacet(bestfacet);  /* make sure it's after qh facet_next */
    -        qh_appendfacet(bestfacet);
    -      }
    -#if !qh_COMPUTEfurthest
    -      bestfacet->furthestdist= bestdist;
    -#endif
    -    }else {
    -#if qh_COMPUTEfurthest
    -      zinc_(Zcomputefurthest);
    -      qh_distplane(oldfurthest, bestfacet, &dist);
    -      if (dist < bestdist)
    -        qh_setappend(&(bestfacet->outsideset), point);
    -      else
    -        qh_setappend2ndlast(&(bestfacet->outsideset), point);
    -#else
    -      if (bestfacet->furthestdist < bestdist) {
    -        qh_setappend(&(bestfacet->outsideset), point);
    -        bestfacet->furthestdist= bestdist;
    -      }else
    -        qh_setappend2ndlast(&(bestfacet->outsideset), point);
    -#endif
    -    }
    -    qh num_outside++;
    -    trace4((qh ferr, 4065, "qh_partitionpoint: point p%d is outside facet f%d new? %d (or narrowhull)\n",
    -          qh_pointid(point), bestfacet->id, bestfacet->newfacet));
    -  }else if (qh DELAUNAY || bestdist >= -qh MAXcoplanar) { /* for 'd', bestdist skips upperDelaunay facets */
    -    zzinc_(Zcoplanarpart);
    -    if (qh DELAUNAY)
    -      qh_precision("nearly incident point");
    -    if ((qh KEEPcoplanar + qh KEEPnearinside) || bestdist > qh max_outside)
    -      qh_partitioncoplanar(point, bestfacet, &bestdist);
    -    else {
    -      trace4((qh ferr, 4066, "qh_partitionpoint: point p%d is coplanar to facet f%d (dropped)\n",
    -          qh_pointid(point), bestfacet->id));
    -    }
    -  }else if (qh KEEPnearinside && bestdist > -qh NEARinside) {
    -    zinc_(Zpartnear);
    -    qh_partitioncoplanar(point, bestfacet, &bestdist);
    -  }else {
    -    zinc_(Zpartinside);
    -    trace4((qh ferr, 4067, "qh_partitionpoint: point p%d is inside all facets, closest to f%d dist %2.2g\n",
    -          qh_pointid(point), bestfacet->id, bestdist));
    -    if (qh KEEPinside)
    -      qh_partitioncoplanar(point, bestfacet, &bestdist);
    -  }
    -} /* partitionpoint */
    -
    -/*---------------------------------
    -
    -  qh_partitionvisible( allpoints, numoutside )
    -    partitions points in visible facets to qh.newfacet_list
    -    qh.visible_list= visible facets
    -    for visible facets
    -      1st neighbor (if any) points to a horizon facet or a new facet
    -    if allpoints(!used),
    -      repartitions coplanar points
    -
    -  returns:
    -    updates outside sets and coplanar sets of qh.newfacet_list
    -    updates qh.num_outside (count of outside points)
    -
    -  notes:
    -    qh.findbest_notsharp should be clear (extra work if set)
    -
    -  design:
    -    for all visible facets with outside set or coplanar set
    -      select a newfacet for visible facet
    -      if outside set
    -        partition outside set into new facets
    -      if coplanar set and keeping coplanar/near-inside/inside points
    -        if allpoints
    -          partition coplanar set into new facets, may be assigned outside
    -        else
    -          partition coplanar set into coplanar sets of new facets
    -    for each deleted vertex
    -      if allpoints
    -        partition vertex into new facets, may be assigned outside
    -      else
    -        partition vertex into coplanar sets of new facets
    -*/
    -void qh_partitionvisible(/*visible_list*/ boolT allpoints, int *numoutside) {
    -  facetT *visible, *newfacet;
    -  pointT *point, **pointp;
    -  int coplanar=0, size;
    -  unsigned count;
    -  vertexT *vertex, **vertexp;
    -
    -  if (qh ONLYmax)
    -    maximize_(qh MINoutside, qh max_vertex);
    -  *numoutside= 0;
    -  FORALLvisible_facets {
    -    if (!visible->outsideset && !visible->coplanarset)
    -      continue;
    -    newfacet= visible->f.replace;
    -    count= 0;
    -    while (newfacet && newfacet->visible) {
    -      newfacet= newfacet->f.replace;
    -      if (count++ > qh facet_id)
    -        qh_infiniteloop(visible);
    -    }
    -    if (!newfacet)
    -      newfacet= qh newfacet_list;
    -    if (newfacet == qh facet_tail) {
    -      qh_fprintf(qh ferr, 6170, "qhull precision error (qh_partitionvisible): all new facets deleted as\n        degenerate facets. Can not continue.\n");
    -      qh_errexit(qh_ERRprec, NULL, NULL);
    -    }
    -    if (visible->outsideset) {
    -      size= qh_setsize(visible->outsideset);
    -      *numoutside += size;
    -      qh num_outside -= size;
    -      FOREACHpoint_(visible->outsideset)
    -        qh_partitionpoint(point, newfacet);
    -    }
    -    if (visible->coplanarset && (qh KEEPcoplanar + qh KEEPinside + qh KEEPnearinside)) {
    -      size= qh_setsize(visible->coplanarset);
    -      coplanar += size;
    -      FOREACHpoint_(visible->coplanarset) {
    -        if (allpoints) /* not used */
    -          qh_partitionpoint(point, newfacet);
    -        else
    -          qh_partitioncoplanar(point, newfacet, NULL);
    -      }
    -    }
    -  }
    -  FOREACHvertex_(qh del_vertices) {
    -    if (vertex->point) {
    -      if (allpoints) /* not used */
    -        qh_partitionpoint(vertex->point, qh newfacet_list);
    -      else
    -        qh_partitioncoplanar(vertex->point, qh newfacet_list, NULL);
    -    }
    -  }
    -  trace1((qh ferr, 1043,"qh_partitionvisible: partitioned %d points from outsidesets and %d points from coplanarsets\n", *numoutside, coplanar));
    -} /* partitionvisible */
    -
    -
    -
    -/*---------------------------------
    -
    -  qh_precision( reason )
    -    restart on precision errors if not merging and if 'QJn'
    -*/
    -void qh_precision(const char *reason) {
    -
    -  if (qh ALLOWrestart && !qh PREmerge && !qh MERGEexact) {
    -    if (qh JOGGLEmax < REALmax/2) {
    -      trace0((qh ferr, 26, "qh_precision: qhull restart because of %s\n", reason));
    -      longjmp(qh restartexit, qh_ERRprec);
    -    }
    -  }
    -} /* qh_precision */
    -
    -/*---------------------------------
    -
    -  qh_printsummary( fp )
    -    prints summary to fp
    -
    -  notes:
    -    not in io.c so that user_eg.c can prevent io.c from loading
    -    qh_printsummary and qh_countfacets must match counts
    -
    -  design:
    -    determine number of points, vertices, and coplanar points
    -    print summary
    -*/
    -void qh_printsummary(FILE *fp) {
    -  realT ratio, outerplane, innerplane;
    -  float cpu;
    -  int size, id, nummerged, numvertices, numcoplanars= 0, nonsimplicial=0;
    -  int goodused;
    -  facetT *facet;
    -  const char *s;
    -  int numdel= zzval_(Zdelvertextot);
    -  int numtricoplanars= 0;
    -
    -  size= qh num_points + qh_setsize(qh other_points);
    -  numvertices= qh num_vertices - qh_setsize(qh del_vertices);
    -  id= qh_pointid(qh GOODpointp);
    -  FORALLfacets {
    -    if (facet->coplanarset)
    -      numcoplanars += qh_setsize( facet->coplanarset);
    -    if (facet->good) {
    -      if (facet->simplicial) {
    -        if (facet->keepcentrum && facet->tricoplanar)
    -          numtricoplanars++;
    -      }else if (qh_setsize(facet->vertices) != qh hull_dim)
    -        nonsimplicial++;
    -    }
    -  }
    -  if (id >=0 && qh STOPcone-1 != id && -qh STOPpoint-1 != id)
    -    size--;
    -  if (qh STOPcone || qh STOPpoint)
    -      qh_fprintf(fp, 9288, "\nAt a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'.");
    -  if (qh UPPERdelaunay)
    -    goodused= qh GOODvertex + qh GOODpoint + qh SPLITthresholds;
    -  else if (qh DELAUNAY)
    -    goodused= qh GOODvertex + qh GOODpoint + qh GOODthreshold;
    -  else
    -    goodused= qh num_good;
    -  nummerged= zzval_(Ztotmerge) - zzval_(Zcyclehorizon) + zzval_(Zcyclefacettot);
    -  if (qh VORONOI) {
    -    if (qh UPPERdelaunay)
    -      qh_fprintf(fp, 9289, "\n\
    -Furthest-site Voronoi vertices by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    else
    -      qh_fprintf(fp, 9290, "\n\
    -Voronoi diagram by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    qh_fprintf(fp, 9291, "  Number of Voronoi regions%s: %d\n",
    -              qh ATinfinity ? " and at-infinity" : "", numvertices);
    -    if (numdel)
    -      qh_fprintf(fp, 9292, "  Total number of deleted points due to merging: %d\n", numdel);
    -    if (numcoplanars - numdel > 0)
    -      qh_fprintf(fp, 9293, "  Number of nearly incident points: %d\n", numcoplanars - numdel);
    -    else if (size - numvertices - numdel > 0)
    -      qh_fprintf(fp, 9294, "  Total number of nearly incident points: %d\n", size - numvertices - numdel);
    -    qh_fprintf(fp, 9295, "  Number of%s Voronoi vertices: %d\n",
    -              goodused ? " 'good'" : "", qh num_good);
    -    if (nonsimplicial)
    -      qh_fprintf(fp, 9296, "  Number of%s non-simplicial Voronoi vertices: %d\n",
    -              goodused ? " 'good'" : "", nonsimplicial);
    -  }else if (qh DELAUNAY) {
    -    if (qh UPPERdelaunay)
    -      qh_fprintf(fp, 9297, "\n\
    -Furthest-site Delaunay triangulation by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    else
    -      qh_fprintf(fp, 9298, "\n\
    -Delaunay triangulation by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    qh_fprintf(fp, 9299, "  Number of input sites%s: %d\n",
    -              qh ATinfinity ? " and at-infinity" : "", numvertices);
    -    if (numdel)
    -      qh_fprintf(fp, 9300, "  Total number of deleted points due to merging: %d\n", numdel);
    -    if (numcoplanars - numdel > 0)
    -      qh_fprintf(fp, 9301, "  Number of nearly incident points: %d\n", numcoplanars - numdel);
    -    else if (size - numvertices - numdel > 0)
    -      qh_fprintf(fp, 9302, "  Total number of nearly incident points: %d\n", size - numvertices - numdel);
    -    qh_fprintf(fp, 9303, "  Number of%s Delaunay regions: %d\n",
    -              goodused ? " 'good'" : "", qh num_good);
    -    if (nonsimplicial)
    -      qh_fprintf(fp, 9304, "  Number of%s non-simplicial Delaunay regions: %d\n",
    -              goodused ? " 'good'" : "", nonsimplicial);
    -  }else if (qh HALFspace) {
    -    qh_fprintf(fp, 9305, "\n\
    -Halfspace intersection by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    qh_fprintf(fp, 9306, "  Number of halfspaces: %d\n", size);
    -    qh_fprintf(fp, 9307, "  Number of non-redundant halfspaces: %d\n", numvertices);
    -    if (numcoplanars) {
    -      if (qh KEEPinside && qh KEEPcoplanar)
    -        s= "similar and redundant";
    -      else if (qh KEEPinside)
    -        s= "redundant";
    -      else
    -        s= "similar";
    -      qh_fprintf(fp, 9308, "  Number of %s halfspaces: %d\n", s, numcoplanars);
    -    }
    -    qh_fprintf(fp, 9309, "  Number of intersection points: %d\n", qh num_facets - qh num_visible);
    -    if (goodused)
    -      qh_fprintf(fp, 9310, "  Number of 'good' intersection points: %d\n", qh num_good);
    -    if (nonsimplicial)
    -      qh_fprintf(fp, 9311, "  Number of%s non-simplicial intersection points: %d\n",
    -              goodused ? " 'good'" : "", nonsimplicial);
    -  }else {
    -    qh_fprintf(fp, 9312, "\n\
    -Convex hull of %d points in %d-d:\n\n", size, qh hull_dim);
    -    qh_fprintf(fp, 9313, "  Number of vertices: %d\n", numvertices);
    -    if (numcoplanars) {
    -      if (qh KEEPinside && qh KEEPcoplanar)
    -        s= "coplanar and interior";
    -      else if (qh KEEPinside)
    -        s= "interior";
    -      else
    -        s= "coplanar";
    -      qh_fprintf(fp, 9314, "  Number of %s points: %d\n", s, numcoplanars);
    -    }
    -    qh_fprintf(fp, 9315, "  Number of facets: %d\n", qh num_facets - qh num_visible);
    -    if (goodused)
    -      qh_fprintf(fp, 9316, "  Number of 'good' facets: %d\n", qh num_good);
    -    if (nonsimplicial)
    -      qh_fprintf(fp, 9317, "  Number of%s non-simplicial facets: %d\n",
    -              goodused ? " 'good'" : "", nonsimplicial);
    -  }
    -  if (numtricoplanars)
    -      qh_fprintf(fp, 9318, "  Number of triangulated facets: %d\n", numtricoplanars);
    -  qh_fprintf(fp, 9319, "\nStatistics for: %s | %s",
    -                      qh rbox_command, qh qhull_command);
    -  if (qh ROTATErandom != INT_MIN)
    -    qh_fprintf(fp, 9320, " QR%d\n\n", qh ROTATErandom);
    -  else
    -    qh_fprintf(fp, 9321, "\n\n");
    -  qh_fprintf(fp, 9322, "  Number of points processed: %d\n", zzval_(Zprocessed));
    -  qh_fprintf(fp, 9323, "  Number of hyperplanes created: %d\n", zzval_(Zsetplane));
    -  if (qh DELAUNAY)
    -    qh_fprintf(fp, 9324, "  Number of facets in hull: %d\n", qh num_facets - qh num_visible);
    -  qh_fprintf(fp, 9325, "  Number of distance tests for qhull: %d\n", zzval_(Zpartition)+
    -      zzval_(Zpartitionall)+zzval_(Znumvisibility)+zzval_(Zpartcoplanar));
    -#if 0  /* NOTE: must print before printstatistics() */
    -  {realT stddev, ave;
    -  qh_fprintf(fp, 9326, "  average new facet balance: %2.2g\n",
    -          wval_(Wnewbalance)/zval_(Zprocessed));
    -  stddev= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance),
    -                                 wval_(Wnewbalance2), &ave);
    -  qh_fprintf(fp, 9327, "  new facet standard deviation: %2.2g\n", stddev);
    -  qh_fprintf(fp, 9328, "  average partition balance: %2.2g\n",
    -          wval_(Wpbalance)/zval_(Zpbalance));
    -  stddev= qh_stddev(zval_(Zpbalance), wval_(Wpbalance),
    -                                 wval_(Wpbalance2), &ave);
    -  qh_fprintf(fp, 9329, "  partition standard deviation: %2.2g\n", stddev);
    -  }
    -#endif
    -  if (nummerged) {
    -    qh_fprintf(fp, 9330,"  Number of distance tests for merging: %d\n",zzval_(Zbestdist)+
    -          zzval_(Zcentrumtests)+zzval_(Zdistconvex)+zzval_(Zdistcheck)+
    -          zzval_(Zdistzero));
    -    qh_fprintf(fp, 9331,"  Number of distance tests for checking: %d\n",zzval_(Zcheckpart));
    -    qh_fprintf(fp, 9332,"  Number of merged facets: %d\n", nummerged);
    -  }
    -  if (!qh RANDOMoutside && qh QHULLfinished) {
    -    cpu= (float)qh hulltime;
    -    cpu /= (float)qh_SECticks;
    -    wval_(Wcpu)= cpu;
    -    qh_fprintf(fp, 9333, "  CPU seconds to compute hull (after input): %2.4g\n", cpu);
    -  }
    -  if (qh RERUN) {
    -    if (!qh PREmerge && !qh MERGEexact)
    -      qh_fprintf(fp, 9334, "  Percentage of runs with precision errors: %4.1f\n",
    -           zzval_(Zretry)*100.0/qh build_cnt);  /* careful of order */
    -  }else if (qh JOGGLEmax < REALmax/2) {
    -    if (zzval_(Zretry))
    -      qh_fprintf(fp, 9335, "  After %d retries, input joggled by: %2.2g\n",
    -         zzval_(Zretry), qh JOGGLEmax);
    -    else
    -      qh_fprintf(fp, 9336, "  Input joggled by: %2.2g\n", qh JOGGLEmax);
    -  }
    -  if (qh totarea != 0.0)
    -    qh_fprintf(fp, 9337, "  %s facet area:   %2.8g\n",
    -            zzval_(Ztotmerge) ? "Approximate" : "Total", qh totarea);
    -  if (qh totvol != 0.0)
    -    qh_fprintf(fp, 9338, "  %s volume:       %2.8g\n",
    -            zzval_(Ztotmerge) ? "Approximate" : "Total", qh totvol);
    -  if (qh MERGING) {
    -    qh_outerinner(NULL, &outerplane, &innerplane);
    -    if (outerplane > 2 * qh DISTround) {
    -      qh_fprintf(fp, 9339, "  Maximum distance of %spoint above facet: %2.2g",
    -            (qh QHULLfinished ? "" : "merged "), outerplane);
    -      ratio= outerplane/(qh ONEmerge + qh DISTround);
    -      /* don't report ratio if MINoutside is large */
    -      if (ratio > 0.05 && 2* qh ONEmerge > qh MINoutside && qh JOGGLEmax > REALmax/2)
    -        qh_fprintf(fp, 9340, " (%.1fx)\n", ratio);
    -      else
    -        qh_fprintf(fp, 9341, "\n");
    -    }
    -    if (innerplane < -2 * qh DISTround) {
    -      qh_fprintf(fp, 9342, "  Maximum distance of %svertex below facet: %2.2g",
    -            (qh QHULLfinished ? "" : "merged "), innerplane);
    -      ratio= -innerplane/(qh ONEmerge+qh DISTround);
    -      if (ratio > 0.05 && qh JOGGLEmax > REALmax/2)
    -        qh_fprintf(fp, 9343, " (%.1fx)\n", ratio);
    -      else
    -        qh_fprintf(fp, 9344, "\n");
    -    }
    -  }
    -  qh_fprintf(fp, 9345, "\n");
    -} /* printsummary */
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.h
    deleted file mode 100644
    index 7a132267bd..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.h
    +++ /dev/null
    @@ -1,1100 +0,0 @@
    -/*
      ---------------------------------
    -
    -   libqhull.h
    -   user-level header file for using qhull.a library
    -
    -   see qh-qhull.htm, qhull_a.h
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/libqhull.h#7 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -
    -   NOTE: access to qh_qh is via the 'qh' macro.  This allows
    -   qh_qh to be either a pointer or a structure.  An example
    -   of using qh is "qh DROPdim" which accesses the DROPdim
    -   field of qh_qh.  Similarly, access to qh_qhstat is via
    -   the 'qhstat' macro.
    -
    -   includes function prototypes for libqhull.c, geom.c, global.c, io.c, user.c
    -
    -   use mem.h for mem.c
    -   use qset.h for qset.c
    -
    -   see unix.c for an example of using libqhull.h
    -
    -   recompile qhull if you change this file
    -*/
    -
    -#ifndef qhDEFlibqhull
    -#define qhDEFlibqhull 1
    -
    -/*=========================== -included files ==============*/
    -
    -#include "user.h"      /* user definable constants (e.g., qh_QHpointer) */
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#if __MWERKS__ && __POWERPC__
    -#include  
    -#include  
    -#include        
    -#endif
    -
    -#ifndef __STDC__
    -#ifndef __cplusplus
    -#if     !_MSC_VER
    -#error  Neither __STDC__ nor __cplusplus is defined.  Please use strict ANSI C or C++ to compile
    -#error  Qhull.  You may need to turn off compiler extensions in your project configuration.  If
    -#error  your compiler is a standard C compiler, you can delete this warning from libqhull.h
    -#endif
    -#endif
    -#endif
    -
    -/*============ constants and basic types ====================*/
    -
    -extern const char *qh_version; /* defined in global.c */
    -
    -/*----------------------------------
    -
    -  coordT
    -    coordinates and coefficients are stored as realT (i.e., double)
    -
    -  notes:
    -    Qhull works well if realT is 'float'.  If so joggle (QJ) is not effective.
    -
    -    Could use 'float' for data and 'double' for calculations (realT vs. coordT)
    -      This requires many type casts, and adjusted error bounds.
    -      Also C compilers may do expressions in double anyway.
    -*/
    -#define coordT realT
    -
    -/*----------------------------------
    -
    -  pointT
    -    a point is an array of coordinates, usually qh.hull_dim
    -*/
    -#define pointT coordT
    -
    -/*----------------------------------
    -
    -  flagT
    -    Boolean flag as a bit
    -*/
    -#define flagT unsigned int
    -
    -/*----------------------------------
    -
    -  boolT
    -    boolean value, either True or False
    -
    -  notes:
    -    needed for portability
    -    Use qh_False/qh_True as synonyms
    -*/
    -#define boolT unsigned int
    -#ifdef False
    -#undef False
    -#endif
    -#ifdef True
    -#undef True
    -#endif
    -#define False 0
    -#define True 1
    -#define qh_False 0
    -#define qh_True 1
    -
    -/*----------------------------------
    -
    -  qh_CENTER
    -    to distinguish facet->center
    -*/
    -typedef enum
    -{
    -    qh_ASnone = 0, qh_ASvoronoi, qh_AScentrum
    -}
    -qh_CENTER;
    -
    -/*----------------------------------
    -
    -  qh_PRINT
    -    output formats for printing (qh.PRINTout).
    -    'Fa' 'FV' 'Fc' 'FC'
    -
    -
    -   notes:
    -   some of these names are similar to qh names.  The similar names are only
    -   used in switch statements in qh_printbegin() etc.
    -*/
    -typedef enum {qh_PRINTnone= 0,
    -  qh_PRINTarea, qh_PRINTaverage,           /* 'Fa' 'FV' 'Fc' 'FC' */
    -  qh_PRINTcoplanars, qh_PRINTcentrums,
    -  qh_PRINTfacets, qh_PRINTfacets_xridge,   /* 'f' 'FF' 'G' 'FI' 'Fi' 'Fn' */
    -  qh_PRINTgeom, qh_PRINTids, qh_PRINTinner, qh_PRINTneighbors,
    -  qh_PRINTnormals, qh_PRINTouter, qh_PRINTmaple, /* 'n' 'Fo' 'i' 'm' 'Fm' 'FM', 'o' */
    -  qh_PRINTincidences, qh_PRINTmathematica, qh_PRINTmerges, qh_PRINToff,
    -  qh_PRINToptions, qh_PRINTpointintersect, /* 'FO' 'Fp' 'FP' 'p' 'FQ' 'FS' */
    -  qh_PRINTpointnearest, qh_PRINTpoints, qh_PRINTqhull, qh_PRINTsize,
    -  qh_PRINTsummary, qh_PRINTtriangles,      /* 'Fs' 'Ft' 'Fv' 'FN' 'Fx' */
    -  qh_PRINTvertices, qh_PRINTvneighbors, qh_PRINTextremes,
    -  qh_PRINTEND} qh_PRINT;
    -
    -/*----------------------------------
    -
    -  qh_ALL
    -    argument flag for selecting everything
    -*/
    -#define qh_ALL      True
    -#define qh_NOupper  True     /* argument for qh_findbest */
    -#define qh_IScheckmax  True     /* argument for qh_findbesthorizon */
    -#define qh_ISnewfacets  True     /* argument for qh_findbest */
    -#define qh_RESETvisible  True     /* argument for qh_resetlists */
    -
    -/*----------------------------------
    -
    -  qh_ERR
    -    Qhull exit codes, for indicating errors
    -    See: MSG_ERROR and MSG_WARNING [user.h]
    -*/
    -#define qh_ERRnone  0    /* no error occurred during qhull */
    -#define qh_ERRinput 1    /* input inconsistency */
    -#define qh_ERRsingular 2 /* singular input data */
    -#define qh_ERRprec  3    /* precision error */
    -#define qh_ERRmem   4    /* insufficient memory, matches mem.h */
    -#define qh_ERRqhull 5    /* internal error detected, matches mem.h */
    -
    -/*----------------------------------
    -
    -qh_FILEstderr
    -Fake stderr to distinguish error output from normal output
    -For C++ interface.  Must redefine qh_fprintf_qhull
    -*/
    -#define qh_FILEstderr (FILE*)1
    -
    -/* ============ -structures- ====================
    -   each of the following structures is defined by a typedef
    -   all realT and coordT fields occur at the beginning of a structure
    -        (otherwise space may be wasted due to alignment)
    -   define all flags together and pack into 32-bit number
    -*/
    -
    -typedef struct vertexT vertexT;
    -typedef struct ridgeT ridgeT;
    -typedef struct facetT facetT;
    -#ifndef DEFsetT
    -#define DEFsetT 1
    -typedef struct setT setT;          /* defined in qset.h */
    -#endif
    -
    -#ifndef DEFqhstatT
    -#define DEFqhstatT 1
    -typedef struct qhstatT qhstatT;    /* defined in stat.h */
    -#endif
    -
    -/*----------------------------------
    -
    -  facetT
    -    defines a facet
    -
    -  notes:
    -   qhull() generates the hull as a list of facets.
    -
    -  topological information:
    -    f.previous,next     doubly-linked list of facets
    -    f.vertices          set of vertices
    -    f.ridges            set of ridges
    -    f.neighbors         set of neighbors
    -    f.toporient         True if facet has top-orientation (else bottom)
    -
    -  geometric information:
    -    f.offset,normal     hyperplane equation
    -    f.maxoutside        offset to outer plane -- all points inside
    -    f.center            centrum for testing convexity
    -    f.simplicial        True if facet is simplicial
    -    f.flipped           True if facet does not include qh.interior_point
    -
    -  for constructing hull:
    -    f.visible           True if facet on list of visible facets (will be deleted)
    -    f.newfacet          True if facet on list of newly created facets
    -    f.coplanarset       set of points coplanar with this facet
    -                        (includes near-inside points for later testing)
    -    f.outsideset        set of points outside of this facet
    -    f.furthestdist      distance to furthest point of outside set
    -    f.visitid           marks visited facets during a loop
    -    f.replace           replacement facet for to-be-deleted, visible facets
    -    f.samecycle,newcycle cycle of facets for merging into horizon facet
    -
    -  see below for other flags and fields
    -*/
    -struct facetT {
    -#if !qh_COMPUTEfurthest
    -  coordT   furthestdist;/* distance to furthest point of outsideset */
    -#endif
    -#if qh_MAXoutside
    -  coordT   maxoutside;  /* max computed distance of point to facet
    -                        Before QHULLfinished this is an approximation
    -                        since maxdist not always set for mergefacet
    -                        Actual outer plane is +DISTround and
    -                        computed outer plane is +2*DISTround */
    -#endif
    -  coordT   offset;      /* exact offset of hyperplane from origin */
    -  coordT  *normal;      /* normal of hyperplane, hull_dim coefficients */
    -                        /*   if tricoplanar, shared with a neighbor */
    -  union {               /* in order of testing */
    -   realT   area;        /* area of facet, only in io.c if  ->isarea */
    -   facetT *replace;     /*  replacement facet if ->visible and NEWfacets
    -                             is NULL only if qh_mergedegen_redundant or interior */
    -   facetT *samecycle;   /*  cycle of facets from the same visible/horizon intersection,
    -                             if ->newfacet */
    -   facetT *newcycle;    /*  in horizon facet, current samecycle of new facets */
    -   facetT *trivisible;  /* visible facet for ->tricoplanar facets during qh_triangulate() */
    -   facetT *triowner;    /* owner facet for ->tricoplanar, !isarea facets w/ ->keepcentrum */
    -  }f;
    -  coordT  *center;      /*  centrum for convexity, qh CENTERtype == qh_AScentrum */
    -                        /*  Voronoi center, qh CENTERtype == qh_ASvoronoi */
    -                        /*   if tricoplanar, shared with a neighbor */
    -  facetT  *previous;    /* previous facet in the facet_list */
    -  facetT  *next;        /* next facet in the facet_list */
    -  setT    *vertices;    /* vertices for this facet, inverse sorted by ID
    -                           if simplicial, 1st vertex was apex/furthest */
    -  setT    *ridges;      /* explicit ridges for nonsimplicial facets.
    -                           for simplicial facets, neighbors define the ridges */
    -  setT    *neighbors;   /* neighbors of the facet.  If simplicial, the kth
    -                           neighbor is opposite the kth vertex, and the first
    -                           neighbor is the horizon facet for the first vertex*/
    -  setT    *outsideset;  /* set of points outside this facet
    -                           if non-empty, last point is furthest
    -                           if NARROWhull, includes coplanars for partitioning*/
    -  setT    *coplanarset; /* set of points coplanar with this facet
    -                           > qh.min_vertex and <= facet->max_outside
    -                           a point is assigned to the furthest facet
    -                           if non-empty, last point is furthest away */
    -  unsigned visitid;     /* visit_id, for visiting all neighbors,
    -                           all uses are independent */
    -  unsigned id;          /* unique identifier from qh facet_id */
    -  unsigned nummerge:9;  /* number of merges */
    -#define qh_MAXnummerge 511 /*     2^9-1, 32 flags total, see "flags:" in io.c */
    -  flagT    tricoplanar:1; /* True if TRIangulate and simplicial and coplanar with a neighbor */
    -                          /*   all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */
    -                          /*   all tricoplanars share the same apex */
    -                          /*   if ->degenerate, does not span facet (one logical ridge) */
    -                          /*   one tricoplanar has ->keepcentrum and ->coplanarset */
    -                          /*   during qh_triangulate, f.trivisible points to original facet */
    -  flagT    newfacet:1;  /* True if facet on qh newfacet_list (new or merged) */
    -  flagT    visible:1;   /* True if visible facet (will be deleted) */
    -  flagT    toporient:1; /* True if created with top orientation
    -                           after merging, use ridge orientation */
    -  flagT    simplicial:1;/* True if simplicial facet, ->ridges may be implicit */
    -  flagT    seen:1;      /* used to perform operations only once, like visitid */
    -  flagT    seen2:1;     /* used to perform operations only once, like visitid */
    -  flagT    flipped:1;   /* True if facet is flipped */
    -  flagT    upperdelaunay:1; /* True if facet is upper envelope of Delaunay triangulation */
    -  flagT    notfurthest:1; /* True if last point of outsideset is not furthest*/
    -
    -/*-------- flags primarily for output ---------*/
    -  flagT    good:1;      /* True if a facet marked good for output */
    -  flagT    isarea:1;    /* True if facet->f.area is defined */
    -
    -/*-------- flags for merging ------------------*/
    -  flagT    dupridge:1;  /* True if duplicate ridge in facet */
    -  flagT    mergeridge:1; /* True if facet or neighbor contains a qh_MERGEridge
    -                            ->normal defined (also defined for mergeridge2) */
    -  flagT    mergeridge2:1; /* True if neighbor contains a qh_MERGEridge (mark_dupridges */
    -  flagT    coplanar:1;  /* True if horizon facet is coplanar at last use */
    -  flagT     mergehorizon:1; /* True if will merge into horizon (->coplanar) */
    -  flagT     cycledone:1;/* True if mergecycle_all already done */
    -  flagT    tested:1;    /* True if facet convexity has been tested (false after merge */
    -  flagT    keepcentrum:1; /* True if keep old centrum after a merge, or marks owner for ->tricoplanar */
    -  flagT    newmerge:1;  /* True if facet is newly merged for reducevertices */
    -  flagT    degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */
    -  flagT    redundant:1;  /* True if facet is redundant (degen_mergeset) */
    -};
    -
    -
    -/*----------------------------------
    -
    -  ridgeT
    -    defines a ridge
    -
    -  notes:
    -  a ridge is hull_dim-1 simplex between two neighboring facets.  If the
    -  facets are non-simplicial, there may be more than one ridge between
    -  two facets.  E.G. a 4-d hypercube has two triangles between each pair
    -  of neighboring facets.
    -
    -  topological information:
    -    vertices            a set of vertices
    -    top,bottom          neighboring facets with orientation
    -
    -  geometric information:
    -    tested              True if ridge is clearly convex
    -    nonconvex           True if ridge is non-convex
    -*/
    -struct ridgeT {
    -  setT    *vertices;    /* vertices belonging to this ridge, inverse sorted by ID
    -                           NULL if a degen ridge (matchsame) */
    -  facetT  *top;         /* top facet this ridge is part of */
    -  facetT  *bottom;      /* bottom facet this ridge is part of */
    -  unsigned id:24;       /* unique identifier, =>room for 8 flags, bit field matches qh.ridge_id */
    -  flagT    seen:1;      /* used to perform operations only once */
    -  flagT    tested:1;    /* True when ridge is tested for convexity */
    -  flagT    nonconvex:1; /* True if getmergeset detected a non-convex neighbor
    -                           only one ridge between neighbors may have nonconvex */
    -};
    -
    -/*----------------------------------
    -
    -  vertexT
    -     defines a vertex
    -
    -  topological information:
    -    next,previous       doubly-linked list of all vertices
    -    neighbors           set of adjacent facets (only if qh.VERTEXneighbors)
    -
    -  geometric information:
    -    point               array of DIM3 coordinates
    -*/
    -struct vertexT {
    -  vertexT *next;        /* next vertex in vertex_list */
    -  vertexT *previous;    /* previous vertex in vertex_list */
    -  pointT  *point;       /* hull_dim coordinates (coordT) */
    -  setT    *neighbors;   /* neighboring facets of vertex, qh_vertexneighbors()
    -                           inits in io.c or after first merge */
    -  unsigned visitid:31;  /* for use with qh vertex_visit, size must match */
    -  flagT    seen2:1;     /* another seen flag */
    -  unsigned id:24;       /* unique identifier, bit field matches qh.vertex_id */
    -  unsigned dim:4;       /* dimension of point if non-zero, used by cpp */
    -                        /* =>room for 4 flags */
    -  flagT    seen:1;      /* used to perform operations only once */
    -  flagT    delridge:1;  /* vertex was part of a deleted ridge */
    -  flagT    deleted:1;   /* true if vertex on qh del_vertices */
    -  flagT    newlist:1;   /* true if vertex on qh newvertex_list */
    -};
    -
    -#define MAX_vdim 15  /* Maximum size of vertex->dim */
    -
    -/*======= -global variables -qh ============================*/
    -
    -/*----------------------------------
    -
    -  qh
    -   all global variables for qhull are in qh, qhmem, and qhstat
    -
    -  notes:
    -   qhmem is defined in mem.h, qhstat is defined in stat.h, qhrbox is defined in rboxpoints.h
    -   Access to qh_qh is via the "qh" macro.  See qh_QHpointer in user.h
    -
    -   All global variables for qhull are in qh, qhmem, and qhstat
    -   qh must be unique for each instance of qhull
    -   qhstat may be shared between qhull instances.
    -   qhmem may be shared across multiple instances of Qhull.
    -   Rbox uses global variables rbox_inuse and rbox, but does not persist data across calls.
    -
    -   Qhull is not multithreaded.  Global state could be stored in thread-local storage.
    -*/
    -
    -extern int qhull_inuse;
    -
    -typedef struct qhT qhT;
    -#if qh_QHpointer_dllimport
    -#define qh qh_qh->
    -__declspec(dllimport) extern qhT *qh_qh;     /* allocated in global.c */
    -#elif qh_QHpointer
    -#define qh qh_qh->
    -extern qhT *qh_qh;     /* allocated in global.c */
    -#elif qh_dllimport
    -#define qh qh_qh.
    -__declspec(dllimport) extern qhT qh_qh;      /* allocated in global.c */
    -#else
    -#define qh qh_qh.
    -extern qhT qh_qh;
    -#endif
    -
    -struct qhT {
    -
    -/*----------------------------------
    -
    -  qh constants
    -    configuration flags and constants for Qhull
    -
    -  notes:
    -    The user configures Qhull by defining flags.  They are
    -    copied into qh by qh_setflags().  qh-quick.htm#options defines the flags.
    -*/
    -  boolT ALLpoints;        /* true 'Qs' if search all points for initial simplex */
    -  boolT ANGLEmerge;       /* true 'Qa' if sort potential merges by angle */
    -  boolT APPROXhull;       /* true 'Wn' if MINoutside set */
    -  realT   MINoutside;     /*   'Wn' min. distance for an outside point */
    -  boolT ANNOTATEoutput;   /* true 'Ta' if annotate output with message codes */
    -  boolT ATinfinity;       /* true 'Qz' if point num_points-1 is "at-infinity"
    -                             for improving precision in Delaunay triangulations */
    -  boolT AVOIDold;         /* true 'Q4' if avoid old->new merges */
    -  boolT BESToutside;      /* true 'Qf' if partition points into best outsideset */
    -  boolT CDDinput;         /* true 'Pc' if input uses CDD format (1.0/offset first) */
    -  boolT CDDoutput;        /* true 'PC' if print normals in CDD format (offset first) */
    -  boolT CHECKfrequently;  /* true 'Tc' if checking frequently */
    -  realT premerge_cos;     /*   'A-n'   cos_max when pre merging */
    -  realT postmerge_cos;    /*   'An'    cos_max when post merging */
    -  boolT DELAUNAY;         /* true 'd' if computing DELAUNAY triangulation */
    -  boolT DOintersections;  /* true 'Gh' if print hyperplane intersections */
    -  int   DROPdim;          /* drops dim 'GDn' for 4-d -> 3-d output */
    -  boolT FORCEoutput;      /* true 'Po' if forcing output despite degeneracies */
    -  int   GOODpoint;        /* 1+n for 'QGn', good facet if visible/not(-) from point n*/
    -  pointT *GOODpointp;     /*   the actual point */
    -  boolT GOODthreshold;    /* true if qh lower_threshold/upper_threshold defined
    -                             false if qh SPLITthreshold */
    -  int   GOODvertex;       /* 1+n, good facet if vertex for point n */
    -  pointT *GOODvertexp;     /*   the actual point */
    -  boolT HALFspace;        /* true 'Hn,n,n' if halfspace intersection */
    -  int   IStracing;        /* trace execution, 0=none, 1=least, 4=most, -1=events */
    -  int   KEEParea;         /* 'PAn' number of largest facets to keep */
    -  boolT KEEPcoplanar;     /* true 'Qc' if keeping nearest facet for coplanar points */
    -  boolT KEEPinside;       /* true 'Qi' if keeping nearest facet for inside points
    -                              set automatically if 'd Qc' */
    -  int   KEEPmerge;        /* 'PMn' number of facets to keep with most merges */
    -  realT KEEPminArea;      /* 'PFn' minimum facet area to keep */
    -  realT MAXcoplanar;      /* 'Un' max distance below a facet to be coplanar*/
    -  boolT MERGEexact;       /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */
    -  boolT MERGEindependent; /* true 'Q2' if merging independent sets */
    -  boolT MERGING;          /* true if exact-, pre- or post-merging, with angle and centrum tests */
    -  realT   premerge_centrum;  /*   'C-n' centrum_radius when pre merging.  Default is round-off */
    -  realT   postmerge_centrum; /*   'Cn' centrum_radius when post merging.  Default is round-off */
    -  boolT MERGEvertices;    /* true 'Q3' if merging redundant vertices */
    -  realT MINvisible;       /* 'Vn' min. distance for a facet to be visible */
    -  boolT NOnarrow;         /* true 'Q10' if no special processing for narrow distributions */
    -  boolT NOnearinside;     /* true 'Q8' if ignore near-inside points when partitioning */
    -  boolT NOpremerge;       /* true 'Q0' if no defaults for C-0 or Qx */
    -  boolT ONLYgood;         /* true 'Qg' if process points with good visible or horizon facets */
    -  boolT ONLYmax;          /* true 'Qm' if only process points that increase max_outside */
    -  boolT PICKfurthest;     /* true 'Q9' if process furthest of furthest points*/
    -  boolT POSTmerge;        /* true if merging after buildhull (Cn or An) */
    -  boolT PREmerge;         /* true if merging during buildhull (C-n or A-n) */
    -                        /* NOTE: some of these names are similar to qh_PRINT names */
    -  boolT PRINTcentrums;    /* true 'Gc' if printing centrums */
    -  boolT PRINTcoplanar;    /* true 'Gp' if printing coplanar points */
    -  int   PRINTdim;         /* print dimension for Geomview output */
    -  boolT PRINTdots;        /* true 'Ga' if printing all points as dots */
    -  boolT PRINTgood;        /* true 'Pg' if printing good facets */
    -  boolT PRINTinner;       /* true 'Gi' if printing inner planes */
    -  boolT PRINTneighbors;   /* true 'PG' if printing neighbors of good facets */
    -  boolT PRINTnoplanes;    /* true 'Gn' if printing no planes */
    -  boolT PRINToptions1st;  /* true 'FO' if printing options to stderr */
    -  boolT PRINTouter;       /* true 'Go' if printing outer planes */
    -  boolT PRINTprecision;   /* false 'Pp' if not reporting precision problems */
    -  qh_PRINT PRINTout[qh_PRINTEND]; /* list of output formats to print */
    -  boolT PRINTridges;      /* true 'Gr' if print ridges */
    -  boolT PRINTspheres;     /* true 'Gv' if print vertices as spheres */
    -  boolT PRINTstatistics;  /* true 'Ts' if printing statistics to stderr */
    -  boolT PRINTsummary;     /* true 's' if printing summary to stderr */
    -  boolT PRINTtransparent; /* true 'Gt' if print transparent outer ridges */
    -  boolT PROJECTdelaunay;  /* true if DELAUNAY, no readpoints() and
    -                             need projectinput() for Delaunay in qh_init_B */
    -  int   PROJECTinput;     /* number of projected dimensions 'bn:0Bn:0' */
    -  boolT QUICKhelp;        /* true if quick help message for degen input */
    -  boolT RANDOMdist;       /* true if randomly change distplane and setfacetplane */
    -  realT RANDOMfactor;     /*    maximum random perturbation */
    -  realT RANDOMa;          /*    qh_randomfactor is randr * RANDOMa + RANDOMb */
    -  realT RANDOMb;
    -  boolT RANDOMoutside;    /* true if select a random outside point */
    -  int   REPORTfreq;       /* buildtracing reports every n facets */
    -  int   REPORTfreq2;      /* tracemerging reports every REPORTfreq/2 facets */
    -  int   RERUN;            /* 'TRn' rerun qhull n times (qh.build_cnt) */
    -  int   ROTATErandom;     /* 'QRn' seed, 0 time, >= rotate input */
    -  boolT SCALEinput;       /* true 'Qbk' if scaling input */
    -  boolT SCALElast;        /* true 'Qbb' if scale last coord to max prev coord */
    -  boolT SETroundoff;      /* true 'E' if qh DISTround is predefined */
    -  boolT SKIPcheckmax;     /* true 'Q5' if skip qh_check_maxout */
    -  boolT SKIPconvex;       /* true 'Q6' if skip convexity testing during pre-merge */
    -  boolT SPLITthresholds;  /* true if upper_/lower_threshold defines a region
    -                               used only for printing (!for qh ONLYgood) */
    -  int   STOPcone;         /* 'TCn' 1+n for stopping after cone for point n */
    -                          /*       also used by qh_build_withresart for err exit*/
    -  int   STOPpoint;        /* 'TVn' 'TV-n' 1+n for stopping after/before(-)
    -                                        adding point n */
    -  int   TESTpoints;       /* 'QTn' num of test points after qh.num_points.  Test points always coplanar. */
    -  boolT TESTvneighbors;   /*  true 'Qv' if test vertex neighbors at end */
    -  int   TRACElevel;       /* 'Tn' conditional IStracing level */
    -  int   TRACElastrun;     /*  qh.TRACElevel applies to last qh.RERUN */
    -  int   TRACEpoint;       /* 'TPn' start tracing when point n is a vertex */
    -  realT TRACEdist;        /* 'TWn' start tracing when merge distance too big */
    -  int   TRACEmerge;       /* 'TMn' start tracing before this merge */
    -  boolT TRIangulate;      /* true 'Qt' if triangulate non-simplicial facets */
    -  boolT TRInormals;       /* true 'Q11' if triangulate duplicates normals (sets Qt) */
    -  boolT UPPERdelaunay;    /* true 'Qu' if computing furthest-site Delaunay */
    -  boolT USEstdout;        /* true 'Tz' if using stdout instead of stderr */
    -  boolT VERIFYoutput;     /* true 'Tv' if verify output at end of qhull */
    -  boolT VIRTUALmemory;    /* true 'Q7' if depth-first processing in buildhull */
    -  boolT VORONOI;          /* true 'v' if computing Voronoi diagram */
    -
    -  /*--------input constants ---------*/
    -  realT AREAfactor;       /* 1/(hull_dim-1)! for converting det's to area */
    -  boolT DOcheckmax;       /* true if calling qh_check_maxout (qh_initqhull_globals) */
    -  char  *feasible_string;  /* feasible point 'Hn,n,n' for halfspace intersection */
    -  coordT *feasible_point;  /*    as coordinates, both malloc'd */
    -  boolT GETarea;          /* true 'Fa', 'FA', 'FS', 'PAn', 'PFn' if compute facet area/Voronoi volume in io.c */
    -  boolT KEEPnearinside;   /* true if near-inside points in coplanarset */
    -  int   hull_dim;         /* dimension of hull, set by initbuffers */
    -  int   input_dim;        /* dimension of input, set by initbuffers */
    -  int   num_points;       /* number of input points */
    -  pointT *first_point;    /* array of input points, see POINTSmalloc */
    -  boolT POINTSmalloc;     /*   true if qh first_point/num_points allocated */
    -  pointT *input_points;   /* copy of original qh.first_point for input points for qh_joggleinput */
    -  boolT input_malloc;     /* true if qh input_points malloc'd */
    -  char  qhull_command[256];/* command line that invoked this program */
    -  int   qhull_commandsiz2; /*    size of qhull_command at qh_clear_outputflags */
    -  char  rbox_command[256]; /* command line that produced the input points */
    -  char  qhull_options[512];/* descriptive list of options */
    -  int   qhull_optionlen;  /*    length of last line */
    -  int   qhull_optionsiz;  /*    size of qhull_options at qh_build_withrestart */
    -  int   qhull_optionsiz2; /*    size of qhull_options at qh_clear_outputflags */
    -  int   run_id;           /* non-zero, random identifier for this instance of qhull */
    -  boolT VERTEXneighbors;  /* true if maintaining vertex neighbors */
    -  boolT ZEROcentrum;      /* true if 'C-0' or 'C-0 Qx'.  sets ZEROall_ok */
    -  realT *upper_threshold; /* don't print if facet->normal[k]>=upper_threshold[k]
    -                             must set either GOODthreshold or SPLITthreshold
    -                             if Delaunay, default is 0.0 for upper envelope */
    -  realT *lower_threshold; /* don't print if facet->normal[k] <=lower_threshold[k] */
    -  realT *upper_bound;     /* scale point[k] to new upper bound */
    -  realT *lower_bound;     /* scale point[k] to new lower bound
    -                             project if both upper_ and lower_bound == 0 */
    -
    -/*----------------------------------
    -
    -  qh precision constants
    -    precision constants for Qhull
    -
    -  notes:
    -    qh_detroundoff() computes the maximum roundoff error for distance
    -    and other computations.  It also sets default values for the
    -    qh constants above.
    -*/
    -  realT ANGLEround;       /* max round off error for angles */
    -  realT centrum_radius;   /* max centrum radius for convexity (roundoff added) */
    -  realT cos_max;          /* max cosine for convexity (roundoff added) */
    -  realT DISTround;        /* max round off error for distances, 'E' overrides */
    -  realT MAXabs_coord;     /* max absolute coordinate */
    -  realT MAXlastcoord;     /* max last coordinate for qh_scalelast */
    -  realT MAXsumcoord;      /* max sum of coordinates */
    -  realT MAXwidth;         /* max rectilinear width of point coordinates */
    -  realT MINdenom_1;       /* min. abs. value for 1/x */
    -  realT MINdenom;         /*    use divzero if denominator < MINdenom */
    -  realT MINdenom_1_2;     /* min. abs. val for 1/x that allows normalization */
    -  realT MINdenom_2;       /*    use divzero if denominator < MINdenom_2 */
    -  realT MINlastcoord;     /* min. last coordinate for qh_scalelast */
    -  boolT NARROWhull;       /* set in qh_initialhull if angle < qh_MAXnarrow */
    -  realT *NEARzero;        /* hull_dim array for near zero in gausselim */
    -  realT NEARinside;       /* keep points for qh_check_maxout if close to facet */
    -  realT ONEmerge;         /* max distance for merging simplicial facets */
    -  realT outside_err;      /* application's epsilon for coplanar points
    -                             qh_check_bestdist() qh_check_points() reports error if point outside */
    -  realT WIDEfacet;        /* size of wide facet for skipping ridge in
    -                             area computation and locking centrum */
    -
    -/*----------------------------------
    -
    -  qh internal constants
    -    internal constants for Qhull
    -*/
    -  char qhull[sizeof("qhull")]; /* "qhull" for checking ownership while debugging */
    -  jmp_buf errexit;        /* exit label for qh_errexit, defined by setjmp() */
    -  char jmpXtra[40];       /* extra bytes in case jmp_buf is defined wrong by compiler */
    -  jmp_buf restartexit;    /* restart label for qh_errexit, defined by setjmp() */
    -  char jmpXtra2[40];      /* extra bytes in case jmp_buf is defined wrong by compiler*/
    -  FILE *fin;              /* pointer to input file, init by qh_meminit */
    -  FILE *fout;             /* pointer to output file */
    -  FILE *ferr;             /* pointer to error file */
    -  pointT *interior_point; /* center point of the initial simplex*/
    -  int normal_size;     /* size in bytes for facet normals and point coords*/
    -  int center_size;     /* size in bytes for Voronoi centers */
    -  int   TEMPsize;         /* size for small, temporary sets (in quick mem) */
    -
    -/*----------------------------------
    -
    -  qh facet and vertex lists
    -    defines lists of facets, new facets, visible facets, vertices, and
    -    new vertices.  Includes counts, next ids, and trace ids.
    -  see:
    -    qh_resetlists()
    -*/
    -  facetT *facet_list;     /* first facet */
    -  facetT  *facet_tail;     /* end of facet_list (dummy facet) */
    -  facetT *facet_next;     /* next facet for buildhull()
    -                             previous facets do not have outside sets
    -                             NARROWhull: previous facets may have coplanar outside sets for qh_outcoplanar */
    -  facetT *newfacet_list;  /* list of new facets to end of facet_list */
    -  facetT *visible_list;   /* list of visible facets preceeding newfacet_list,
    -                             facet->visible set */
    -  int       num_visible;  /* current number of visible facets */
    -  unsigned tracefacet_id;  /* set at init, then can print whenever */
    -  facetT *tracefacet;     /*   set in newfacet/mergefacet, undone in delfacet*/
    -  unsigned tracevertex_id;  /* set at buildtracing, can print whenever */
    -  vertexT *tracevertex;     /*   set in newvertex, undone in delvertex*/
    -  vertexT *vertex_list;     /* list of all vertices, to vertex_tail */
    -  vertexT  *vertex_tail;    /*      end of vertex_list (dummy vertex) */
    -  vertexT *newvertex_list; /* list of vertices in newfacet_list, to vertex_tail
    -                             all vertices have 'newlist' set */
    -  int   num_facets;       /* number of facets in facet_list
    -                             includes visble faces (num_visible) */
    -  int   num_vertices;     /* number of vertices in facet_list */
    -  int   num_outside;      /* number of points in outsidesets (for tracing and RANDOMoutside)
    -                               includes coplanar outsideset points for NARROWhull/qh_outcoplanar() */
    -  int   num_good;         /* number of good facets (after findgood_all) */
    -  unsigned facet_id;      /* ID of next, new facet from newfacet() */
    -  unsigned ridge_id:24;   /* ID of next, new ridge from newridge() */
    -  unsigned vertex_id:24;  /* ID of next, new vertex from newvertex() */
    -
    -/*----------------------------------
    -
    -  qh global variables
    -    defines minimum and maximum distances, next visit ids, several flags,
    -    and other global variables.
    -    initialize in qh_initbuild or qh_maxmin if used in qh_buildhull
    -*/
    -  unsigned long hulltime; /* ignore time to set up input and randomize */
    -                          /*   use unsigned to avoid wrap-around errors */
    -  boolT ALLOWrestart;     /* true if qh_precision can use qh.restartexit */
    -  int   build_cnt;        /* number of calls to qh_initbuild */
    -  qh_CENTER CENTERtype;   /* current type of facet->center, qh_CENTER */
    -  int   furthest_id;      /* pointid of furthest point, for tracing */
    -  facetT *GOODclosest;    /* closest facet to GOODthreshold in qh_findgood */
    -  boolT hasAreaVolume;    /* true if totarea, totvol was defined by qh_getarea */
    -  boolT hasTriangulation; /* true if triangulation created by qh_triangulate */
    -  realT JOGGLEmax;        /* set 'QJn' if randomly joggle input */
    -  boolT maxoutdone;       /* set qh_check_maxout(), cleared by qh_addpoint() */
    -  realT max_outside;      /* maximum distance from a point to a facet,
    -                               before roundoff, not simplicial vertices
    -                               actual outer plane is +DISTround and
    -                               computed outer plane is +2*DISTround */
    -  realT max_vertex;       /* maximum distance (>0) from vertex to a facet,
    -                               before roundoff, due to a merge */
    -  realT min_vertex;       /* minimum distance (<0) from vertex to a facet,
    -                               before roundoff, due to a merge
    -                               if qh.JOGGLEmax, qh_makenewplanes sets it
    -                               recomputed if qh.DOcheckmax, default -qh.DISTround */
    -  boolT NEWfacets;        /* true while visible facets invalid due to new or merge
    -                              from makecone/attachnewfacets to deletevisible */
    -  boolT findbestnew;      /* true if partitioning calls qh_findbestnew */
    -  boolT findbest_notsharp; /* true if new facets are at least 90 degrees */
    -  boolT NOerrexit;        /* true if qh.errexit is not available */
    -  realT PRINTcradius;     /* radius for printing centrums */
    -  realT PRINTradius;      /* radius for printing vertex spheres and points */
    -  boolT POSTmerging;      /* true when post merging */
    -  int   printoutvar;      /* temporary variable for qh_printbegin, etc. */
    -  int   printoutnum;      /* number of facets printed */
    -  boolT QHULLfinished;    /* True after qhull() is finished */
    -  realT totarea;          /* 'FA': total facet area computed by qh_getarea, hasAreaVolume */
    -  realT totvol;           /* 'FA': total volume computed by qh_getarea, hasAreaVolume */
    -  unsigned int visit_id;  /* unique ID for searching neighborhoods, */
    -  unsigned int vertex_visit:31; /* unique ID for searching vertices, reset with qh_buildtracing */
    -  boolT ZEROall_ok;       /* True if qh_checkzero always succeeds */
    -  boolT WAScoplanar;      /* True if qh_partitioncoplanar (qh_check_maxout) */
    -
    -/*----------------------------------
    -
    -  qh global sets
    -    defines sets for merging, initial simplex, hashing, extra input points,
    -    and deleted vertices
    -*/
    -  setT *facet_mergeset;   /* temporary set of merges to be done */
    -  setT *degen_mergeset;   /* temporary set of degenerate and redundant merges */
    -  setT *hash_table;       /* hash table for matching ridges in qh_matchfacets
    -                             size is setsize() */
    -  setT *other_points;     /* additional points */
    -  setT *del_vertices;     /* vertices to partition and delete with visible
    -                             facets.  Have deleted set for checkfacet */
    -
    -/*----------------------------------
    -
    -  qh global buffers
    -    defines buffers for maxtrix operations, input, and error messages
    -*/
    -  coordT *gm_matrix;      /* (dim+1)Xdim matrix for geom.c */
    -  coordT **gm_row;        /* array of gm_matrix rows */
    -  char* line;             /* malloc'd input line of maxline+1 chars */
    -  int maxline;
    -  coordT *half_space;     /* malloc'd input array for halfspace (qh normal_size+coordT) */
    -  coordT *temp_malloc;    /* malloc'd input array for points */
    -
    -/*----------------------------------
    -
    -  qh static variables
    -    defines static variables for individual functions
    -
    -  notes:
    -    do not use 'static' within a function.  Multiple instances of qhull
    -    may exist.
    -
    -    do not assume zero initialization, 'QPn' may cause a restart
    -*/
    -  boolT ERREXITcalled;    /* true during qh_errexit (prevents duplicate calls */
    -  boolT firstcentrum;     /* for qh_printcentrum */
    -  boolT old_randomdist;   /* save RANDOMdist flag during io, tracing, or statistics */
    -  setT *coplanarfacetset;  /* set of coplanar facets for searching qh_findbesthorizon() */
    -  realT last_low;         /* qh_scalelast parameters for qh_setdelaunay */
    -  realT last_high;
    -  realT last_newhigh;
    -  unsigned lastreport;    /* for qh_buildtracing */
    -  int mergereport;        /* for qh_tracemerging */
    -  qhstatT *old_qhstat;    /* for saving qh_qhstat in save_qhull() and UsingLibQhull.  Free with qh_free() */
    -  setT *old_tempstack;    /* for saving qhmem.tempstack in save_qhull */
    -  int   ridgeoutnum;      /* number of ridges for 4OFF output (qh_printbegin,etc) */
    -};
    -
    -/*=========== -macros- =========================*/
    -
    -/*----------------------------------
    -
    -  otherfacet_(ridge, facet)
    -    return neighboring facet for a ridge in facet
    -*/
    -#define otherfacet_(ridge, facet) \
    -                        (((ridge)->top == (facet)) ? (ridge)->bottom : (ridge)->top)
    -
    -/*----------------------------------
    -
    -  getid_(p)
    -    return int ID for facet, ridge, or vertex
    -    return -1 if NULL
    -*/
    -#define getid_(p)       ((p) ? (int)((p)->id) : -1)
    -
    -/*============== FORALL macros ===================*/
    -
    -/*----------------------------------
    -
    -  FORALLfacets { ... }
    -    assign 'facet' to each facet in qh.facet_list
    -
    -  notes:
    -    uses 'facetT *facet;'
    -    assumes last facet is a sentinel
    -
    -  see:
    -    FORALLfacet_( facetlist )
    -*/
    -#define FORALLfacets for (facet=qh facet_list;facet && facet->next;facet=facet->next)
    -
    -/*----------------------------------
    -
    -  FORALLpoints { ... }
    -    assign 'point' to each point in qh.first_point, qh.num_points
    -
    -  declare:
    -    coordT *point, *pointtemp;
    -*/
    -#define FORALLpoints FORALLpoint_(qh first_point, qh num_points)
    -
    -/*----------------------------------
    -
    -  FORALLpoint_( points, num) { ... }
    -    assign 'point' to each point in points array of num points
    -
    -  declare:
    -    coordT *point, *pointtemp;
    -*/
    -#define FORALLpoint_(points, num) for (point= (points), \
    -      pointtemp= (points)+qh hull_dim*(num); point < pointtemp; point += qh hull_dim)
    -
    -/*----------------------------------
    -
    -  FORALLvertices { ... }
    -    assign 'vertex' to each vertex in qh.vertex_list
    -
    -  declare:
    -    vertexT *vertex;
    -
    -  notes:
    -    assumes qh.vertex_list terminated with a sentinel
    -*/
    -#define FORALLvertices for (vertex=qh vertex_list;vertex && vertex->next;vertex= vertex->next)
    -
    -/*----------------------------------
    -
    -  FOREACHfacet_( facets ) { ... }
    -    assign 'facet' to each facet in facets
    -
    -  declare:
    -    facetT *facet, **facetp;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHfacet_(facets)    FOREACHsetelement_(facetT, facets, facet)
    -
    -/*----------------------------------
    -
    -  FOREACHneighbor_( facet ) { ... }
    -    assign 'neighbor' to each neighbor in facet->neighbors
    -
    -  FOREACHneighbor_( vertex ) { ... }
    -    assign 'neighbor' to each neighbor in vertex->neighbors
    -
    -  declare:
    -    facetT *neighbor, **neighborp;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHneighbor_(facet)  FOREACHsetelement_(facetT, facet->neighbors, neighbor)
    -
    -/*----------------------------------
    -
    -  FOREACHpoint_( points ) { ... }
    -    assign 'point' to each point in points set
    -
    -  declare:
    -    pointT *point, **pointp;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHpoint_(points)    FOREACHsetelement_(pointT, points, point)
    -
    -/*----------------------------------
    -
    -  FOREACHridge_( ridges ) { ... }
    -    assign 'ridge' to each ridge in ridges set
    -
    -  declare:
    -    ridgeT *ridge, **ridgep;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHridge_(ridges)    FOREACHsetelement_(ridgeT, ridges, ridge)
    -
    -/*----------------------------------
    -
    -  FOREACHvertex_( vertices ) { ... }
    -    assign 'vertex' to each vertex in vertices set
    -
    -  declare:
    -    vertexT *vertex, **vertexp;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHvertex_(vertices) FOREACHsetelement_(vertexT, vertices,vertex)
    -
    -/*----------------------------------
    -
    -  FOREACHfacet_i_( facets ) { ... }
    -    assign 'facet' and 'facet_i' for each facet in facets set
    -
    -  declare:
    -    facetT *facet;
    -    int     facet_n, facet_i;
    -
    -  see:
    -    FOREACHsetelement_i_
    -*/
    -#define FOREACHfacet_i_(facets)    FOREACHsetelement_i_(facetT, facets, facet)
    -
    -/*----------------------------------
    -
    -  FOREACHneighbor_i_( facet ) { ... }
    -    assign 'neighbor' and 'neighbor_i' for each neighbor in facet->neighbors
    -
    -  FOREACHneighbor_i_( vertex ) { ... }
    -    assign 'neighbor' and 'neighbor_i' for each neighbor in vertex->neighbors
    -
    -  declare:
    -    facetT *neighbor;
    -    int     neighbor_n, neighbor_i;
    -
    -  see:
    -    FOREACHsetelement_i_
    -*/
    -#define FOREACHneighbor_i_(facet)  FOREACHsetelement_i_(facetT, facet->neighbors, neighbor)
    -
    -/*----------------------------------
    -
    -  FOREACHpoint_i_( points ) { ... }
    -    assign 'point' and 'point_i' for each point in points set
    -
    -  declare:
    -    pointT *point;
    -    int     point_n, point_i;
    -
    -  see:
    -    FOREACHsetelement_i_
    -*/
    -#define FOREACHpoint_i_(points)    FOREACHsetelement_i_(pointT, points, point)
    -
    -/*----------------------------------
    -
    -  FOREACHridge_i_( ridges ) { ... }
    -    assign 'ridge' and 'ridge_i' for each ridge in ridges set
    -
    -  declare:
    -    ridgeT *ridge;
    -    int     ridge_n, ridge_i;
    -
    -  see:
    -    FOREACHsetelement_i_
    -*/
    -#define FOREACHridge_i_(ridges)    FOREACHsetelement_i_(ridgeT, ridges, ridge)
    -
    -/*----------------------------------
    -
    -  FOREACHvertex_i_( vertices ) { ... }
    -    assign 'vertex' and 'vertex_i' for each vertex in vertices set
    -
    -  declare:
    -    vertexT *vertex;
    -    int     vertex_n, vertex_i;
    -
    -  see:
    -    FOREACHsetelement_i_
    -*/
    -#define FOREACHvertex_i_(vertices) FOREACHsetelement_i_(vertexT, vertices,vertex)
    -
    -/********* -libqhull.c prototypes (duplicated from qhull_a.h) **********************/
    -
    -void    qh_qhull(void);
    -boolT   qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist);
    -void    qh_printsummary(FILE *fp);
    -
    -/********* -user.c prototypes (alphabetical) **********************/
    -
    -void    qh_errexit(int exitcode, facetT *facet, ridgeT *ridge);
    -void    qh_errprint(const char* string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex);
    -int     qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc,
    -                char *qhull_cmd, FILE *outfile, FILE *errfile);
    -void    qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall);
    -void    qh_printhelp_degenerate(FILE *fp);
    -void    qh_printhelp_narrowhull(FILE *fp, realT minangle);
    -void    qh_printhelp_singular(FILE *fp);
    -void    qh_user_memsizes(void);
    -
    -/********* -usermem.c prototypes (alphabetical) **********************/
    -void    qh_exit(int exitcode);
    -void    qh_free(void *mem);
    -void   *qh_malloc(size_t size);
    -
    -/********* -userprintf.c and userprintf_rbox.c prototypes **********************/
    -void    qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... );
    -void    qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );
    -
    -/***** -geom.c/geom2.c/random.c prototypes (duplicated from geom.h, random.h) ****************/
    -
    -facetT *qh_findbest(pointT *point, facetT *startfacet,
    -                     boolT bestoutside, boolT newfacets, boolT noupper,
    -                     realT *dist, boolT *isoutside, int *numpart);
    -facetT *qh_findbestnew(pointT *point, facetT *startfacet,
    -                     realT *dist, boolT bestoutside, boolT *isoutside, int *numpart);
    -boolT   qh_gram_schmidt(int dim, realT **rows);
    -void    qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane);
    -void    qh_printsummary(FILE *fp);
    -void    qh_projectinput(void);
    -void    qh_randommatrix(realT *buffer, int dim, realT **row);
    -void    qh_rotateinput(realT **rows);
    -void    qh_scaleinput(void);
    -void    qh_setdelaunay(int dim, int count, pointT *points);
    -coordT  *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible);
    -
    -/***** -global.c prototypes (alphabetical) ***********************/
    -
    -unsigned long qh_clock(void);
    -void    qh_checkflags(char *command, char *hiddenflags);
    -void    qh_clear_outputflags(void);
    -void    qh_freebuffers(void);
    -void    qh_freeqhull(boolT allmem);
    -void    qh_freeqhull2(boolT allmem);
    -void    qh_init_A(FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[]);
    -void    qh_init_B(coordT *points, int numpoints, int dim, boolT ismalloc);
    -void    qh_init_qhull_command(int argc, char *argv[]);
    -void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
    -void    qh_initflags(char *command);
    -void    qh_initqhull_buffers(void);
    -void    qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc);
    -void    qh_initqhull_mem(void);
    -void    qh_initqhull_outputflags(void);
    -void    qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile);
    -void    qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile);
    -void    qh_initthresholds(char *command);
    -void    qh_option(const char *option, int *i, realT *r);
    -#if qh_QHpointer
    -void    qh_restore_qhull(qhT **oldqh);
    -qhT    *qh_save_qhull(void);
    -#endif
    -
    -/***** -io.c prototypes (duplicated from io.h) ***********************/
    -
    -void    dfacet( unsigned id);
    -void    dvertex( unsigned id);
    -void    qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall);
    -void    qh_produce_output(void);
    -coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
    -
    -
    -/********* -mem.c prototypes (duplicated from mem.h) **********************/
    -
    -void qh_meminit(FILE *ferr);
    -void qh_memfreeshort(int *curlong, int *totlong);
    -
    -/********* -poly.c/poly2.c prototypes (duplicated from poly.h) **********************/
    -
    -void    qh_check_output(void);
    -void    qh_check_points(void);
    -setT   *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets);
    -facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
    -           realT *bestdist, boolT *isoutside);
    -vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
    -pointT *qh_point(int id);
    -setT   *qh_pointfacet(void /*qh.facet_list*/);
    -int     qh_pointid(pointT *point);
    -setT   *qh_pointvertex(void /*qh.facet_list*/);
    -void    qh_setvoronoi_all(void);
    -void    qh_triangulate(void /*qh facet_list*/);
    -
    -/********* -rboxpoints.c prototypes **********************/
    -int     qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command);
    -void    qh_errexit_rbox(int exitcode);
    -
    -/********* -stat.c prototypes (duplicated from stat.h) **********************/
    -
    -void    qh_collectstatistics(void);
    -void    qh_printallstatistics(FILE *fp, const char *string);
    -
    -#endif /* qhDEFlibqhull */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.pro
    deleted file mode 100644
    index a15830e8b1..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/libqhull.pro
    +++ /dev/null
    @@ -1,66 +0,0 @@
    -# -------------------------------------------------
    -# libqhull.pro -- Qt project for Qhull shared library
    -#   Built with qh_QHpointer=1
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -
    -DESTDIR = ../../lib
    -DLLDESTDIR = ../../bin
    -TEMPLATE = lib
    -CONFIG += shared warn_on
    -CONFIG -= qt
    -
    -build_pass:CONFIG(debug, debug|release):{
    -    TARGET = qhull_d
    -    OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release):{
    -    TARGET = qhull
    -    OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -
    -win32-msvc* : DEF_FILE += ../../src/libqhull/qhull-exports.def
    -
    -# Order object files by frequency of execution.  Small files at end.
    -SOURCES += rboxlib.c
    -SOURCES += user.c
    -SOURCES += global.c
    -SOURCES += stat.c
    -SOURCES += io.c
    -SOURCES += geom2.c
    -SOURCES += poly2.c
    -SOURCES += merge.c
    -SOURCES += libqhull.c
    -SOURCES += geom.c
    -SOURCES += poly.c
    -SOURCES += qset.c
    -SOURCES += mem.c
    -SOURCES += usermem.c
    -SOURCES += userprintf.c
    -SOURCES += userprintf_rbox.c
    -SOURCES += random.c
    -
    -HEADERS += geom.h
    -HEADERS += io.h
    -HEADERS += libqhull.h
    -HEADERS += mem.h
    -HEADERS += merge.h
    -HEADERS += poly.h
    -HEADERS += random.h
    -HEADERS += qhull_a.h
    -HEADERS += qset.h
    -HEADERS += stat.h
    -HEADERS += user.h
    -
    -OTHER_FILES += Mborland
    -OTHER_FILES += qh-geom.htm
    -OTHER_FILES += qh-globa.htm
    -OTHER_FILES += qh-io.htm
    -OTHER_FILES += qh-mem.htm
    -OTHER_FILES += qh-merge.htm
    -OTHER_FILES += qh-poly.htm
    -OTHER_FILES += qh-qhull.htm
    -OTHER_FILES += qh-set.htm
    -OTHER_FILES += qh-stat.htm
    -OTHER_FILES += qh-user.htm
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.c
    deleted file mode 100644
    index 2b865aebdb..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.c
    +++ /dev/null
    @@ -1,543 +0,0 @@
    -/*
      ---------------------------------
    -
    -  mem.c
    -    memory management routines for qhull
    -
    -  This is a standalone program.
    -
    -  To initialize memory:
    -
    -    qh_meminit(stderr);
    -    qh_meminitbuffers(qh IStracing, qh_MEMalign, 7, qh_MEMbufsize,qh_MEMinitbuf);
    -    qh_memsize((int)sizeof(facetT));
    -    qh_memsize((int)sizeof(facetT));
    -    ...
    -    qh_memsetup();
    -
    -  To free up all memory buffers:
    -    qh_memfreeshort(&curlong, &totlong);
    -
    -  if qh_NOmem,
    -    malloc/free is used instead of mem.c
    -
    -  notes:
    -    uses Quickfit algorithm (freelists for commonly allocated sizes)
    -    assumes small sizes for freelists (it discards the tail of memory buffers)
    -
    -  see:
    -    qh-mem.htm and mem.h
    -    global.c (qh_initbuffers) for an example of using mem.c
    -
    -  Copyright (c) 1993-2012 The Geometry Center.
    -  $Id: //main/2011/qhull/src/libqhull/mem.c#4 $$Change: 1464 $
    -  $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "mem.h"
    -#include 
    -#include 
    -#include 
    -
    -#ifndef qhDEFlibqhull
    -typedef struct ridgeT ridgeT;
    -typedef struct facetT facetT;
    -#ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
    -#pragma warning( disable : 4127)  /* conditional expression is constant */
    -#pragma warning( disable : 4706)  /* assignment within conditional function */
    -#endif
    -void    qh_errexit(int exitcode, facetT *, ridgeT *);
    -void    qh_exit(int exitcode);
    -void    qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... );
    -void    qh_free(void *mem);
    -void   *qh_malloc(size_t size);
    -#endif
    -
    -/*============ -global data structure ==============
    -    see mem.h for definition
    -*/
    -
    -qhmemT qhmem= {0,0,0,0,0,0,0,0,0,0,0,
    -               0,0,0,0,0,0,0,0,0,0,0,
    -               0,0,0,0,0,0,0};     /* remove "= {0}" if this causes a compiler error */
    -
    -#ifndef qh_NOmem
    -
    -/*============= internal functions ==============*/
    -
    -static int qh_intcompare(const void *i, const void *j);
    -
    -/*========== functions in alphabetical order ======== */
    -
    -/*---------------------------------
    -
    -  qh_intcompare( i, j )
    -    used by qsort and bsearch to compare two integers
    -*/
    -static int qh_intcompare(const void *i, const void *j) {
    -  return(*((const int *)i) - *((const int *)j));
    -} /* intcompare */
    -
    -
    -/*----------------------------------
    -
    -  qh_memalloc( insize )
    -    returns object of insize bytes
    -    qhmem is the global memory structure
    -
    -  returns:
    -    pointer to allocated memory
    -    errors if insufficient memory
    -
    -  notes:
    -    use explicit type conversion to avoid type warnings on some compilers
    -    actual object may be larger than insize
    -    use qh_memalloc_() for inline code for quick allocations
    -    logs allocations if 'T5'
    -
    -  design:
    -    if size < qhmem.LASTsize
    -      if qhmem.freelists[size] non-empty
    -        return first object on freelist
    -      else
    -        round up request to size of qhmem.freelists[size]
    -        allocate new allocation buffer if necessary
    -        allocate object from allocation buffer
    -    else
    -      allocate object with qh_malloc() in user.c
    -*/
    -void *qh_memalloc(int insize) {
    -  void **freelistp, *newbuffer;
    -  int idx, size, n;
    -  int outsize, bufsize;
    -  void *object;
    -
    -  if (insize<0) {
    -      qh_fprintf(qhmem.ferr, 6235, "qhull error (qh_memalloc): negative request size (%d).  Did int overflow due to high-D?\n", insize); /* WARN64 */
    -      qh_errexit(qhmem_ERRmem, NULL, NULL);
    -  }
    -  if (insize>=0 && insize <= qhmem.LASTsize) {
    -    idx= qhmem.indextable[insize];
    -    outsize= qhmem.sizetable[idx];
    -    qhmem.totshort += outsize;
    -    freelistp= qhmem.freelists+idx;
    -    if ((object= *freelistp)) {
    -      qhmem.cntquick++;
    -      qhmem.totfree -= outsize;
    -      *freelistp= *((void **)*freelistp);  /* replace freelist with next object */
    -#ifdef qh_TRACEshort
    -      n= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort;
    -      if (qhmem.IStracing >= 5)
    -          qh_fprintf(qhmem.ferr, 8141, "qh_mem %p n %8d alloc quick: %d bytes (tot %d cnt %d)\n", object, n, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort);
    -#endif
    -      return(object);
    -    }else {
    -      qhmem.cntshort++;
    -      if (outsize > qhmem .freesize) {
    -        qhmem .totdropped += qhmem .freesize;
    -        if (!qhmem.curbuffer)
    -          bufsize= qhmem.BUFinit;
    -        else
    -          bufsize= qhmem.BUFsize;
    -        if (!(newbuffer= qh_malloc((size_t)bufsize))) {
    -          qh_fprintf(qhmem.ferr, 6080, "qhull error (qh_memalloc): insufficient memory to allocate short memory buffer (%d bytes)\n", bufsize);
    -          qh_errexit(qhmem_ERRmem, NULL, NULL);
    -        }
    -        *((void **)newbuffer)= qhmem.curbuffer;  /* prepend newbuffer to curbuffer
    -                                                    list */
    -        qhmem.curbuffer= newbuffer;
    -        size= (sizeof(void **) + qhmem.ALIGNmask) & ~qhmem.ALIGNmask;
    -        qhmem.freemem= (void *)((char *)newbuffer+size);
    -        qhmem.freesize= bufsize - size;
    -        qhmem.totbuffer += bufsize - size; /* easier to check */
    -        /* Periodically test totbuffer.  It matches at beginning and exit of every call */
    -        n = qhmem.totshort + qhmem.totfree + qhmem.totdropped + qhmem.freesize - outsize;
    -        if (qhmem.totbuffer != n) {
    -            qh_fprintf(qhmem.ferr, 6212, "qh_memalloc internal error: short totbuffer %d != totshort+totfree... %d\n", qhmem.totbuffer, n);
    -            qh_errexit(qhmem_ERRmem, NULL, NULL);
    -        }
    -      }
    -      object= qhmem.freemem;
    -      qhmem.freemem= (void *)((char *)qhmem.freemem + outsize);
    -      qhmem.freesize -= outsize;
    -      qhmem.totunused += outsize - insize;
    -#ifdef qh_TRACEshort
    -      n= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort;
    -      if (qhmem.IStracing >= 5)
    -          qh_fprintf(qhmem.ferr, 8140, "qh_mem %p n %8d alloc short: %d bytes (tot %d cnt %d)\n", object, n, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort);
    -#endif
    -      return object;
    -    }
    -  }else {                     /* long allocation */
    -    if (!qhmem.indextable) {
    -      qh_fprintf(qhmem.ferr, 6081, "qhull internal error (qh_memalloc): qhmem has not been initialized.\n");
    -      qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -    }
    -    outsize= insize;
    -    qhmem .cntlong++;
    -    qhmem .totlong += outsize;
    -    if (qhmem.maxlong < qhmem.totlong)
    -      qhmem.maxlong= qhmem.totlong;
    -    if (!(object= qh_malloc((size_t)outsize))) {
    -      qh_fprintf(qhmem.ferr, 6082, "qhull error (qh_memalloc): insufficient memory to allocate %d bytes\n", outsize);
    -      qh_errexit(qhmem_ERRmem, NULL, NULL);
    -    }
    -    if (qhmem.IStracing >= 5)
    -      qh_fprintf(qhmem.ferr, 8057, "qh_mem %p n %8d alloc long: %d bytes (tot %d cnt %d)\n", object, qhmem.cntlong+qhmem.freelong, outsize, qhmem.totlong, qhmem.cntlong-qhmem.freelong);
    -  }
    -  return(object);
    -} /* memalloc */
    -
    -
    -/*----------------------------------
    -
    -  qh_memfree( object, insize )
    -    free up an object of size bytes
    -    size is insize from qh_memalloc
    -
    -  notes:
    -    object may be NULL
    -    type checking warns if using (void **)object
    -    use qh_memfree_() for quick free's of small objects
    -
    -  design:
    -    if size <= qhmem.LASTsize
    -      append object to corresponding freelist
    -    else
    -      call qh_free(object)
    -*/
    -void qh_memfree(void *object, int insize) {
    -  void **freelistp;
    -  int idx, outsize;
    -
    -  if (!object)
    -    return;
    -  if (insize <= qhmem.LASTsize) {
    -    qhmem .freeshort++;
    -    idx= qhmem.indextable[insize];
    -    outsize= qhmem.sizetable[idx];
    -    qhmem .totfree += outsize;
    -    qhmem .totshort -= outsize;
    -    freelistp= qhmem.freelists + idx;
    -    *((void **)object)= *freelistp;
    -    *freelistp= object;
    -#ifdef qh_TRACEshort
    -    idx= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort;
    -    if (qhmem.IStracing >= 5)
    -        qh_fprintf(qhmem.ferr, 8142, "qh_mem %p n %8d free short: %d bytes (tot %d cnt %d)\n", object, idx, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort);
    -#endif
    -  }else {
    -    qhmem .freelong++;
    -    qhmem .totlong -= insize;
    -    qh_free(object);
    -    if (qhmem.IStracing >= 5)
    -      qh_fprintf(qhmem.ferr, 8058, "qh_mem %p n %8d free long: %d bytes (tot %d cnt %d)\n", object, qhmem.cntlong+qhmem.freelong, insize, qhmem.totlong, qhmem.cntlong-qhmem.freelong);
    -  }
    -} /* memfree */
    -
    -
    -/*---------------------------------
    -
    -  qh_memfreeshort( curlong, totlong )
    -    frees up all short and qhmem memory allocations
    -
    -  returns:
    -    number and size of current long allocations
    -
    -  see:
    -    qh_freeqhull(allMem)
    -    qh_memtotal(curlong, totlong, curshort, totshort, maxlong, totbuffer);
    -*/
    -void qh_memfreeshort(int *curlong, int *totlong) {
    -  void *buffer, *nextbuffer;
    -  FILE *ferr;
    -
    -  *curlong= qhmem .cntlong - qhmem .freelong;
    -  *totlong= qhmem .totlong;
    -  for (buffer= qhmem.curbuffer; buffer; buffer= nextbuffer) {
    -    nextbuffer= *((void **) buffer);
    -    qh_free(buffer);
    -  }
    -  qhmem.curbuffer= NULL;
    -  if (qhmem .LASTsize) {
    -    qh_free(qhmem .indextable);
    -    qh_free(qhmem .freelists);
    -    qh_free(qhmem .sizetable);
    -  }
    -  ferr= qhmem.ferr;
    -  memset((char *)&qhmem, 0, sizeof(qhmem));  /* every field is 0, FALSE, NULL */
    -  qhmem.ferr= ferr;
    -} /* memfreeshort */
    -
    -
    -/*----------------------------------
    -
    -  qh_meminit( ferr )
    -    initialize qhmem and test sizeof( void*)
    -*/
    -void qh_meminit(FILE *ferr) {
    -
    -  memset((char *)&qhmem, 0, sizeof(qhmem));  /* every field is 0, FALSE, NULL */
    -  qhmem.ferr= ferr;
    -  if (sizeof(void*) < sizeof(int)) {
    -    qh_fprintf(ferr, 6083, "qhull internal error (qh_meminit): sizeof(void*) %d < sizeof(int) %d.  qset.c will not work\n", (int)sizeof(void*), (int)sizeof(int));
    -    qh_exit(qhmem_ERRqhull);  /* can not use qh_errexit() */
    -  }
    -  if (sizeof(void*) > sizeof(ptr_intT)) {
    -      qh_fprintf(ferr, 6084, "qhull internal error (qh_meminit): sizeof(void*) %d > sizeof(ptr_intT) %d. Change ptr_intT in mem.h to 'long long'\n", (int)sizeof(void*), (int)sizeof(ptr_intT));
    -      qh_exit(qhmem_ERRqhull);  /* can not use qh_errexit() */
    -  }
    -} /* meminit */
    -
    -/*---------------------------------
    -
    -  qh_meminitbuffers( tracelevel, alignment, numsizes, bufsize, bufinit )
    -    initialize qhmem
    -    if tracelevel >= 5, trace memory allocations
    -    alignment= desired address alignment for memory allocations
    -    numsizes= number of freelists
    -    bufsize=  size of additional memory buffers for short allocations
    -    bufinit=  size of initial memory buffer for short allocations
    -*/
    -void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, int bufinit) {
    -
    -  qhmem.IStracing= tracelevel;
    -  qhmem.NUMsizes= numsizes;
    -  qhmem.BUFsize= bufsize;
    -  qhmem.BUFinit= bufinit;
    -  qhmem.ALIGNmask= alignment-1;
    -  if (qhmem.ALIGNmask & ~qhmem.ALIGNmask) {
    -    qh_fprintf(qhmem.ferr, 6085, "qhull internal error (qh_meminit): memory alignment %d is not a power of 2\n", alignment);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  qhmem.sizetable= (int *) calloc((size_t)numsizes, sizeof(int));
    -  qhmem.freelists= (void **) calloc((size_t)numsizes, sizeof(void *));
    -  if (!qhmem.sizetable || !qhmem.freelists) {
    -    qh_fprintf(qhmem.ferr, 6086, "qhull error (qh_meminit): insufficient memory\n");
    -    qh_errexit(qhmem_ERRmem, NULL, NULL);
    -  }
    -  if (qhmem.IStracing >= 1)
    -    qh_fprintf(qhmem.ferr, 8059, "qh_meminitbuffers: memory initialized with alignment %d\n", alignment);
    -} /* meminitbuffers */
    -
    -/*---------------------------------
    -
    -  qh_memsetup()
    -    set up memory after running memsize()
    -*/
    -void qh_memsetup(void) {
    -  int k,i;
    -
    -  qsort(qhmem.sizetable, (size_t)qhmem.TABLEsize, sizeof(int), qh_intcompare);
    -  qhmem.LASTsize= qhmem.sizetable[qhmem.TABLEsize-1];
    -  if (qhmem .LASTsize >= qhmem .BUFsize || qhmem.LASTsize >= qhmem .BUFinit) {
    -    qh_fprintf(qhmem.ferr, 6087, "qhull error (qh_memsetup): largest mem size %d is >= buffer size %d or initial buffer size %d\n",
    -            qhmem .LASTsize, qhmem .BUFsize, qhmem .BUFinit);
    -    qh_errexit(qhmem_ERRmem, NULL, NULL);
    -  }
    -  if (!(qhmem.indextable= (int *)qh_malloc((qhmem.LASTsize+1) * sizeof(int)))) {
    -    qh_fprintf(qhmem.ferr, 6088, "qhull error (qh_memsetup): insufficient memory\n");
    -    qh_errexit(qhmem_ERRmem, NULL, NULL);
    -  }
    -  for (k=qhmem.LASTsize+1; k--; )
    -    qhmem.indextable[k]= k;
    -  i= 0;
    -  for (k=0; k <= qhmem.LASTsize; k++) {
    -    if (qhmem.indextable[k] <= qhmem.sizetable[i])
    -      qhmem.indextable[k]= i;
    -    else
    -      qhmem.indextable[k]= ++i;
    -  }
    -} /* memsetup */
    -
    -/*---------------------------------
    -
    -  qh_memsize( size )
    -    define a free list for this size
    -*/
    -void qh_memsize(int size) {
    -  int k;
    -
    -  if (qhmem .LASTsize) {
    -    qh_fprintf(qhmem.ferr, 6089, "qhull error (qh_memsize): called after qhmem_setup\n");
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  size= (size + qhmem.ALIGNmask) & ~qhmem.ALIGNmask;
    -  for (k=qhmem.TABLEsize; k--; ) {
    -    if (qhmem.sizetable[k] == size)
    -      return;
    -  }
    -  if (qhmem.TABLEsize < qhmem.NUMsizes)
    -    qhmem.sizetable[qhmem.TABLEsize++]= size;
    -  else
    -    qh_fprintf(qhmem.ferr, 7060, "qhull warning (memsize): free list table has room for only %d sizes\n", qhmem.NUMsizes);
    -} /* memsize */
    -
    -
    -/*---------------------------------
    -
    -  qh_memstatistics( fp )
    -    print out memory statistics
    -
    -    Verifies that qhmem.totfree == sum of freelists
    -*/
    -void qh_memstatistics(FILE *fp) {
    -  int i, count, totfree= 0;
    -  void *object;
    -
    -  for (i=0; i < qhmem.TABLEsize; i++) {
    -    count=0;
    -    for (object= qhmem .freelists[i]; object; object= *((void **)object))
    -      count++;
    -    totfree += qhmem.sizetable[i] * count;
    -  }
    -  if (totfree != qhmem .totfree) {
    -      qh_fprintf(qhmem.ferr, 6211, "qh_memstatistics internal error: totfree %d not equal to freelist total %d\n", qhmem.totfree, totfree);
    -      qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  qh_fprintf(fp, 9278, "\nmemory statistics:\n\
    -%7d quick allocations\n\
    -%7d short allocations\n\
    -%7d long allocations\n\
    -%7d short frees\n\
    -%7d long frees\n\
    -%7d bytes of short memory in use\n\
    -%7d bytes of short memory in freelists\n\
    -%7d bytes of dropped short memory\n\
    -%7d bytes of unused short memory (estimated)\n\
    -%7d bytes of long memory allocated (max, except for input)\n\
    -%7d bytes of long memory in use (in %d pieces)\n\
    -%7d bytes of short memory buffers (minus links)\n\
    -%7d bytes per short memory buffer (initially %d bytes)\n",
    -           qhmem .cntquick, qhmem .cntshort, qhmem .cntlong,
    -           qhmem .freeshort, qhmem .freelong,
    -           qhmem .totshort, qhmem .totfree,
    -           qhmem .totdropped + qhmem .freesize, qhmem .totunused,
    -           qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong,
    -           qhmem .totbuffer, qhmem .BUFsize, qhmem .BUFinit);
    -  if (qhmem.cntlarger) {
    -    qh_fprintf(fp, 9279, "%7d calls to qh_setlarger\n%7.2g     average copy size\n",
    -           qhmem.cntlarger, ((float)qhmem.totlarger)/(float)qhmem.cntlarger);
    -    qh_fprintf(fp, 9280, "  freelists(bytes->count):");
    -  }
    -  for (i=0; i < qhmem.TABLEsize; i++) {
    -    count=0;
    -    for (object= qhmem .freelists[i]; object; object= *((void **)object))
    -      count++;
    -    qh_fprintf(fp, 9281, " %d->%d", qhmem.sizetable[i], count);
    -  }
    -  qh_fprintf(fp, 9282, "\n\n");
    -} /* memstatistics */
    -
    -
    -/*---------------------------------
    -
    -  qh_NOmem
    -    turn off quick-fit memory allocation
    -
    -  notes:
    -    uses qh_malloc() and qh_free() instead
    -*/
    -#else /* qh_NOmem */
    -
    -void *qh_memalloc(int insize) {
    -  void *object;
    -
    -  if (!(object= qh_malloc((size_t)insize))) {
    -    qh_fprintf(qhmem.ferr, 6090, "qhull error (qh_memalloc): insufficient memory\n");
    -    qh_errexit(qhmem_ERRmem, NULL, NULL);
    -  }
    -  qhmem .cntlong++;
    -  qhmem .totlong += insize;
    -  if (qhmem.maxlong < qhmem.totlong)
    -      qhmem.maxlong= qhmem.totlong;
    -  if (qhmem.IStracing >= 5)
    -    qh_fprintf(qhmem.ferr, 8060, "qh_mem %p n %8d alloc long: %d bytes (tot %d cnt %d)\n", object, qhmem.cntlong+qhmem.freelong, insize, qhmem.totlong, qhmem.cntlong-qhmem.freelong);
    -  return object;
    -}
    -
    -void qh_memfree(void *object, int insize) {
    -
    -  if (!object)
    -    return;
    -  qh_free(object);
    -  qhmem .freelong++;
    -  qhmem .totlong -= insize;
    -  if (qhmem.IStracing >= 5)
    -    qh_fprintf(qhmem.ferr, 8061, "qh_mem %p n %8d free long: %d bytes (tot %d cnt %d)\n", object, qhmem.cntlong+qhmem.freelong, insize, qhmem.totlong, qhmem.cntlong-qhmem.freelong);
    -}
    -
    -void qh_memfreeshort(int *curlong, int *totlong) {
    -  *totlong= qhmem .totlong;
    -  *curlong= qhmem .cntlong - qhmem .freelong;
    -  memset((char *)&qhmem, 0, sizeof(qhmem));  /* every field is 0, FALSE, NULL */
    -}
    -
    -void qh_meminit(FILE *ferr) {
    -
    -  memset((char *)&qhmem, 0, sizeof(qhmem));  /* every field is 0, FALSE, NULL */
    -  qhmem.ferr= ferr;
    -  if (sizeof(void*) < sizeof(int)) {
    -    qh_fprintf(ferr, 6091, "qhull internal error (qh_meminit): sizeof(void*) %d < sizeof(int) %d.  qset.c will not work\n", (int)sizeof(void*), (int)sizeof(int));
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -}
    -
    -void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, int bufinit) {
    -
    -  qhmem.IStracing= tracelevel;
    -}
    -
    -void qh_memsetup(void) {
    -
    -}
    -
    -void qh_memsize(int size) {
    -
    -}
    -
    -void qh_memstatistics(FILE *fp) {
    -
    -  qh_fprintf(fp, 9409, "\nmemory statistics:\n\
    -%7d long allocations\n\
    -%7d long frees\n\
    -%7d bytes of long memory allocated (max, except for input)\n\
    -%7d bytes of long memory in use (in %d pieces)\n",
    -           qhmem .cntlong,
    -           qhmem .freelong,
    -           qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong);
    -}
    -
    -#endif /* qh_NOmem */
    -
    -/*---------------------------------
    -
    -  qh_memtotal( totlong, curlong, totshort, curshort, maxlong, totbuffer )
    -    Return the total, allocated long and short memory
    -
    -  returns:
    -    Returns the total current bytes of long and short allocations
    -    Returns the current count of long and short allocations
    -    Returns the maximum long memory and total short buffer (minus one link per buffer)
    -    Does not error (UsingLibQhull.cpp)
    -*/
    -void qh_memtotal(int *totlong, int *curlong, int *totshort, int *curshort, int *maxlong, int *totbuffer) {
    -    *totlong= qhmem .totlong;
    -    *curlong= qhmem .cntlong - qhmem .freelong;
    -    *totshort= qhmem .totshort;
    -    *curshort= qhmem .cntshort + qhmem .cntquick - qhmem .freeshort;
    -    *maxlong= qhmem .maxlong;
    -    *totbuffer= qhmem .totbuffer;
    -} /* memtotlong */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.h
    deleted file mode 100644
    index ad89de81f3..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/mem.h
    +++ /dev/null
    @@ -1,219 +0,0 @@
    -/*
      ---------------------------------
    -
    -   mem.h
    -     prototypes for memory management functions
    -
    -   see qh-mem.htm, mem.c and qset.h
    -
    -   for error handling, writes message and calls
    -     qh_errexit(qhmem_ERRmem, NULL, NULL) if insufficient memory
    -       and
    -     qh_errexit(qhmem_ERRqhull, NULL, NULL) otherwise
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/mem.h#4 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFmem
    -#define qhDEFmem 1
    -
    -#include 
    -
    -/*---------------------------------
    -
    -  qh_NOmem
    -    turn off quick-fit memory allocation
    -
    -  notes:
    -    mem.c implements Quickfit memory allocation for about 20% time
    -    savings.  If it fails on your machine, try to locate the
    -    problem, and send the answer to qhull@qhull.org.  If this can
    -    not be done, define qh_NOmem to use malloc/free instead.
    -
    -   #define qh_NOmem
    -*/
    -
    -/*---------------------------------
    -
    -qh_TRACEshort
    -Trace short and quick memory allocations at T5
    -
    -*/
    -#define qh_TRACEshort
    -
    -/*-------------------------------------------
    -    to avoid bus errors, memory allocation must consider alignment requirements.
    -    malloc() automatically takes care of alignment.   Since mem.c manages
    -    its own memory, we need to explicitly specify alignment in
    -    qh_meminitbuffers().
    -
    -    A safe choice is sizeof(double).  sizeof(float) may be used if doubles
    -    do not occur in data structures and pointers are the same size.  Be careful
    -    of machines (e.g., DEC Alpha) with large pointers.  If gcc is available,
    -    use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void *)).
    -
    -   see qh_MEMalign in user.h for qhull's alignment
    -*/
    -
    -#define qhmem_ERRmem 4    /* matches qh_ERRmem in libqhull.h */
    -#define qhmem_ERRqhull 5  /* matches qh_ERRqhull in libqhull.h */
    -
    -/*----------------------------------
    -
    -  ptr_intT
    -    for casting a void * to an integer-type that holds a pointer
    -    Used for integer expressions (e.g., computing qh_gethash() in poly.c)
    -
    -  notes:
    -    WARN64 -- these notes indicate 64-bit issues
    -    On 64-bit machines, a pointer may be larger than an 'int'.
    -    qh_meminit()/mem.c checks that 'ptr_intT' holds a 'void*'
    -    ptr_intT is typically a signed value, but not necessarily so
    -    size_t is typically unsigned, but should match the parameter type
    -    Qhull uses int instead of size_t except for system calls such as malloc, qsort, qh_malloc, etc.
    -    This matches Qt convention and is easier to work with.  
    -*/
    -#if _MSC_VER && defined(_WIN64)
    -typedef long long ptr_intT;
    -#else
    -typedef long ptr_intT;
    -#endif
    -
    -/*----------------------------------
    -
    -  qhmemT
    -    global memory structure for mem.c
    -
    - notes:
    -   users should ignore qhmem except for writing extensions
    -   qhmem is allocated in mem.c
    -
    -   qhmem could be swapable like qh and qhstat, but then
    -   multiple qh's and qhmem's would need to keep in synch.
    -   A swapable qhmem would also waste memory buffers.  As long
    -   as memory operations are atomic, there is no problem with
    -   multiple qh structures being active at the same time.
    -   If you need separate address spaces, you can swap the
    -   contents of qhmem.
    -*/
    -typedef struct qhmemT qhmemT;
    -extern qhmemT qhmem;
    -
    -#ifndef DEFsetT
    -#define DEFsetT 1
    -typedef struct setT setT;          /* defined in qset.h */
    -#endif
    -
    -/* Update qhmem in mem.c if add or remove fields */
    -struct qhmemT {               /* global memory management variables */
    -  int      BUFsize;           /* size of memory allocation buffer */
    -  int      BUFinit;           /* initial size of memory allocation buffer */
    -  int      TABLEsize;         /* actual number of sizes in free list table */
    -  int      NUMsizes;          /* maximum number of sizes in free list table */
    -  int      LASTsize;          /* last size in free list table */
    -  int      ALIGNmask;         /* worst-case alignment, must be 2^n-1 */
    -  void   **freelists;          /* free list table, linked by offset 0 */
    -  int     *sizetable;         /* size of each freelist */
    -  int     *indextable;        /* size->index table */
    -  void    *curbuffer;         /* current buffer, linked by offset 0 */
    -  void    *freemem;           /*   free memory in curbuffer */
    -  int      freesize;          /*   size of freemem in bytes */
    -  setT    *tempstack;         /* stack of temporary memory, managed by users */
    -  FILE    *ferr;              /* file for reporting errors, only user is qh_fprintf() */
    -  int      IStracing;         /* =5 if tracing memory allocations */
    -  int      cntquick;          /* count of quick allocations */
    -                              /* Note: removing statistics doesn't effect speed */
    -  int      cntshort;          /* count of short allocations */
    -  int      cntlong;           /* count of long allocations */
    -  int      freeshort;         /* count of short memfrees */
    -  int      freelong;          /* count of long memfrees */
    -  int      totbuffer;         /* total short memory buffers minus buffer links */
    -  int      totdropped;        /* total dropped memory at end of short memory buffers (e.g., freesize) */
    -  int      totfree;           /* total size of free, short memory on freelists */
    -  int      totlong;           /* total size of long memory in use */
    -  int      maxlong;           /*   maximum totlong */
    -  int      totshort;          /* total size of short memory in use */
    -  int      totunused;         /* total unused short memory (estimated, short size - request size of first allocations) */
    -  int      cntlarger;         /* count of setlarger's */
    -  int      totlarger;         /* total copied by setlarger */
    -};
    -
    -
    -/*==================== -macros ====================*/
    -
    -/*----------------------------------
    -
    -  qh_memalloc_(insize, object, type)
    -    returns object of size bytes
    -        assumes size<=qhmem.LASTsize and void **freelistp is a temp
    -*/
    -
    -#if defined qh_NOmem
    -#define qh_memalloc_(insize, freelistp, object, type) {\
    -  object= (type*)qh_memalloc(insize); }
    -#elif defined qh_TRACEshort
    -#define qh_memalloc_(insize, freelistp, object, type) {\
    -    freelistp= NULL; /* Avoid warnings */ \
    -    object= (type*)qh_memalloc(insize); }
    -#else /* !qh_NOmem */
    -
    -#define qh_memalloc_(insize, freelistp, object, type) {\
    -  freelistp= qhmem.freelists + qhmem.indextable[insize];\
    -  if ((object= (type*)*freelistp)) {\
    -    qhmem.totshort += qhmem.sizetable[qhmem.indextable[insize]]; \
    -    qhmem.totfree -= qhmem.sizetable[qhmem.indextable[insize]]; \
    -    qhmem.cntquick++;  \
    -    *freelistp= *((void **)*freelistp);\
    -  }else object= (type*)qh_memalloc(insize);}
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_memfree_(object, insize)
    -    free up an object
    -
    -  notes:
    -    object may be NULL
    -    assumes size<=qhmem.LASTsize and void **freelistp is a temp
    -*/
    -#if defined qh_NOmem
    -#define qh_memfree_(object, insize, freelistp) {\
    -  qh_memfree(object, insize); }
    -#elif defined qh_TRACEshort
    -#define qh_memfree_(object, insize, freelistp) {\
    -    freelistp= NULL; /* Avoid warnings */ \
    -    qh_memfree(object, insize); }
    -#else /* !qh_NOmem */
    -
    -#define qh_memfree_(object, insize, freelistp) {\
    -  if (object) { \
    -    qhmem .freeshort++;\
    -    freelistp= qhmem.freelists + qhmem.indextable[insize];\
    -    qhmem.totshort -= qhmem.sizetable[qhmem.indextable[insize]]; \
    -    qhmem.totfree += qhmem.sizetable[qhmem.indextable[insize]]; \
    -    *((void **)object)= *freelistp;\
    -    *freelistp= object;}}
    -#endif
    -
    -/*=============== prototypes in alphabetical order ============*/
    -
    -void *qh_memalloc(int insize);
    -void qh_memfree(void *object, int insize);
    -void qh_memfreeshort(int *curlong, int *totlong);
    -void qh_meminit(FILE *ferr);
    -void qh_meminitbuffers(int tracelevel, int alignment, int numsizes,
    -                        int bufsize, int bufinit);
    -void qh_memsetup(void);
    -void qh_memsize(int size);
    -void qh_memstatistics(FILE *fp);
    -void qh_memtotal(int *totlong, int *curlong, int *totshort, int *curshort, int *maxlong, int *totbuffer);
    -
    -#endif /* qhDEFmem */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.c
    deleted file mode 100644
    index 70c7f5793e..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.c
    +++ /dev/null
    @@ -1,3623 +0,0 @@
    -/*
      ---------------------------------
    -
    -   merge.c
    -   merges non-convex facets
    -
    -   see qh-merge.htm and merge.h
    -
    -   other modules call qh_premerge() and qh_postmerge()
    -
    -   the user may call qh_postmerge() to perform additional merges.
    -
    -   To remove deleted facets and vertices (qhull() in libqhull.c):
    -     qh_partitionvisible(!qh_ALL, &numoutside);  // visible_list, newfacet_list
    -     qh_deletevisible();         // qh.visible_list
    -     qh_resetlists(False, qh_RESETvisible);       // qh.visible_list newvertex_list newfacet_list
    -
    -   assumes qh.CENTERtype= centrum
    -
    -   merges occur in qh_mergefacet and in qh_mergecycle
    -   vertex->neighbors not set until the first merge occurs
    -
    -   Copyright (c) 1993-2012 C.B. Barber.
    -   $Id: //main/2011/qhull/src/libqhull/merge.c#4 $$Change: 1490 $
    -   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -#ifndef qh_NOmerge
    -
    -/*===== functions(alphabetical after premerge and postmerge) ======*/
    -
    -/*---------------------------------
    -
    -  qh_premerge( apex, maxcentrum )
    -    pre-merge nonconvex facets in qh.newfacet_list for apex
    -    maxcentrum defines coplanar and concave (qh_test_appendmerge)
    -
    -  returns:
    -    deleted facets added to qh.visible_list with facet->visible set
    -
    -  notes:
    -    uses globals, qh.MERGEexact, qh.PREmerge
    -
    -  design:
    -    mark duplicate ridges in qh.newfacet_list
    -    merge facet cycles in qh.newfacet_list
    -    merge duplicate ridges and concave facets in qh.newfacet_list
    -    check merged facet cycles for degenerate and redundant facets
    -    merge degenerate and redundant facets
    -    collect coplanar and concave facets
    -    merge concave, coplanar, degenerate, and redundant facets
    -*/
    -void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) {
    -  boolT othermerge= False;
    -  facetT *newfacet;
    -
    -  if (qh ZEROcentrum && qh_checkzero(!qh_ALL))
    -    return;
    -  trace2((qh ferr, 2008, "qh_premerge: premerge centrum %2.2g angle %2.2g for apex v%d facetlist f%d\n",
    -            maxcentrum, maxangle, apex->id, getid_(qh newfacet_list)));
    -  if (qh IStracing >= 4 && qh num_facets < 50)
    -    qh_printlists();
    -  qh centrum_radius= maxcentrum;
    -  qh cos_max= maxangle;
    -  qh degen_mergeset= qh_settemp(qh TEMPsize);
    -  qh facet_mergeset= qh_settemp(qh TEMPsize);
    -  if (qh hull_dim >=3) {
    -    qh_mark_dupridges(qh newfacet_list); /* facet_mergeset */
    -    qh_mergecycle_all(qh newfacet_list, &othermerge);
    -    qh_forcedmerges(&othermerge /* qh facet_mergeset */);
    -    FORALLnew_facets {  /* test samecycle merges */
    -      if (!newfacet->simplicial && !newfacet->mergeridge)
    -        qh_degen_redundant_neighbors(newfacet, NULL);
    -    }
    -    if (qh_merge_degenredundant())
    -      othermerge= True;
    -  }else /* qh hull_dim == 2 */
    -    qh_mergecycle_all(qh newfacet_list, &othermerge);
    -  qh_flippedmerges(qh newfacet_list, &othermerge);
    -  if (!qh MERGEexact || zzval_(Ztotmerge)) {
    -    zinc_(Zpremergetot);
    -    qh POSTmerging= False;
    -    qh_getmergeset_initial(qh newfacet_list);
    -    qh_all_merges(othermerge, False);
    -  }
    -  qh_settempfree(&qh facet_mergeset);
    -  qh_settempfree(&qh degen_mergeset);
    -} /* premerge */
    -
    -/*---------------------------------
    -
    -  qh_postmerge( reason, maxcentrum, maxangle, vneighbors )
    -    post-merge nonconvex facets as defined by maxcentrum and maxangle
    -    'reason' is for reporting progress
    -    if vneighbors,
    -      calls qh_test_vneighbors at end of qh_all_merge
    -    if firstmerge,
    -      calls qh_reducevertices before qh_getmergeset
    -
    -  returns:
    -    if first call (qh.visible_list != qh.facet_list),
    -      builds qh.facet_newlist, qh.newvertex_list
    -    deleted facets added to qh.visible_list with facet->visible
    -    qh.visible_list == qh.facet_list
    -
    -  notes:
    -
    -
    -  design:
    -    if first call
    -      set qh.visible_list and qh.newfacet_list to qh.facet_list
    -      add all facets to qh.newfacet_list
    -      mark non-simplicial facets, facet->newmerge
    -      set qh.newvertext_list to qh.vertex_list
    -      add all vertices to qh.newvertex_list
    -      if a pre-merge occured
    -        set vertex->delridge {will retest the ridge}
    -        if qh.MERGEexact
    -          call qh_reducevertices()
    -      if no pre-merging
    -        merge flipped facets
    -    determine non-convex facets
    -    merge all non-convex facets
    -*/
    -void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
    -                      boolT vneighbors) {
    -  facetT *newfacet;
    -  boolT othermerges= False;
    -  vertexT *vertex;
    -
    -  if (qh REPORTfreq || qh IStracing) {
    -    qh_buildtracing(NULL, NULL);
    -    qh_printsummary(qh ferr);
    -    if (qh PRINTstatistics)
    -      qh_printallstatistics(qh ferr, "reason");
    -    qh_fprintf(qh ferr, 8062, "\n%s with 'C%.2g' and 'A%.2g'\n",
    -        reason, maxcentrum, maxangle);
    -  }
    -  trace2((qh ferr, 2009, "qh_postmerge: postmerge.  test vneighbors? %d\n",
    -            vneighbors));
    -  qh centrum_radius= maxcentrum;
    -  qh cos_max= maxangle;
    -  qh POSTmerging= True;
    -  qh degen_mergeset= qh_settemp(qh TEMPsize);
    -  qh facet_mergeset= qh_settemp(qh TEMPsize);
    -  if (qh visible_list != qh facet_list) {  /* first call */
    -    qh NEWfacets= True;
    -    qh visible_list= qh newfacet_list= qh facet_list;
    -    FORALLnew_facets {
    -      newfacet->newfacet= True;
    -       if (!newfacet->simplicial)
    -        newfacet->newmerge= True;
    -     zinc_(Zpostfacets);
    -    }
    -    qh newvertex_list= qh vertex_list;
    -    FORALLvertices
    -      vertex->newlist= True;
    -    if (qh VERTEXneighbors) { /* a merge has occurred */
    -      FORALLvertices
    -        vertex->delridge= True; /* test for redundant, needed? */
    -      if (qh MERGEexact) {
    -        if (qh hull_dim <= qh_DIMreduceBuild)
    -          qh_reducevertices(); /* was skipped during pre-merging */
    -      }
    -    }
    -    if (!qh PREmerge && !qh MERGEexact)
    -      qh_flippedmerges(qh newfacet_list, &othermerges);
    -  }
    -  qh_getmergeset_initial(qh newfacet_list);
    -  qh_all_merges(False, vneighbors);
    -  qh_settempfree(&qh facet_mergeset);
    -  qh_settempfree(&qh degen_mergeset);
    -} /* post_merge */
    -
    -/*---------------------------------
    -
    -  qh_all_merges( othermerge, vneighbors )
    -    merge all non-convex facets
    -
    -    set othermerge if already merged facets (for qh_reducevertices)
    -    if vneighbors
    -      tests vertex neighbors for convexity at end
    -    qh.facet_mergeset lists the non-convex ridges in qh_newfacet_list
    -    qh.degen_mergeset is defined
    -    if qh.MERGEexact && !qh.POSTmerging,
    -      does not merge coplanar facets
    -
    -  returns:
    -    deleted facets added to qh.visible_list with facet->visible
    -    deleted vertices added qh.delvertex_list with vertex->delvertex
    -
    -  notes:
    -    unless !qh.MERGEindependent,
    -      merges facets in independent sets
    -    uses qh.newfacet_list as argument since merges call qh_removefacet()
    -
    -  design:
    -    while merges occur
    -      for each merge in qh.facet_mergeset
    -        unless one of the facets was already merged in this pass
    -          merge the facets
    -        test merged facets for additional merges
    -        add merges to qh.facet_mergeset
    -      if vertices record neighboring facets
    -        rename redundant vertices
    -          update qh.facet_mergeset
    -    if vneighbors ??
    -      tests vertex neighbors for convexity at end
    -*/
    -void qh_all_merges(boolT othermerge, boolT vneighbors) {
    -  facetT *facet1, *facet2;
    -  mergeT *merge;
    -  boolT wasmerge= True, isreduce;
    -  void **freelistp;  /* used !qh_NOmem */
    -  vertexT *vertex;
    -  mergeType mergetype;
    -  int numcoplanar=0, numconcave=0, numdegenredun= 0, numnewmerges= 0;
    -
    -  trace2((qh ferr, 2010, "qh_all_merges: starting to merge facets beginning from f%d\n",
    -            getid_(qh newfacet_list)));
    -  while (True) {
    -    wasmerge= False;
    -    while (qh_setsize(qh facet_mergeset)) {
    -      while ((merge= (mergeT*)qh_setdellast(qh facet_mergeset))) {
    -        facet1= merge->facet1;
    -        facet2= merge->facet2;
    -        mergetype= merge->type;
    -        qh_memfree_(merge, (int)sizeof(mergeT), freelistp);
    -        if (facet1->visible || facet2->visible) /*deleted facet*/
    -          continue;
    -        if ((facet1->newfacet && !facet1->tested)
    -                || (facet2->newfacet && !facet2->tested)) {
    -          if (qh MERGEindependent && mergetype <= MRGanglecoplanar)
    -            continue;      /* perform independent sets of merges */
    -        }
    -        qh_merge_nonconvex(facet1, facet2, mergetype);
    -        numdegenredun += qh_merge_degenredundant();
    -        numnewmerges++;
    -        wasmerge= True;
    -        if (mergetype == MRGconcave)
    -          numconcave++;
    -        else /* MRGcoplanar or MRGanglecoplanar */
    -          numcoplanar++;
    -      } /* while setdellast */
    -      if (qh POSTmerging && qh hull_dim <= qh_DIMreduceBuild
    -      && numnewmerges > qh_MAXnewmerges) {
    -        numnewmerges= 0;
    -        qh_reducevertices();  /* otherwise large post merges too slow */
    -      }
    -      qh_getmergeset(qh newfacet_list); /* facet_mergeset */
    -    } /* while mergeset */
    -    if (qh VERTEXneighbors) {
    -      isreduce= False;
    -      if (qh hull_dim >=4 && qh POSTmerging) {
    -        FORALLvertices
    -          vertex->delridge= True;
    -        isreduce= True;
    -      }
    -      if ((wasmerge || othermerge) && (!qh MERGEexact || qh POSTmerging)
    -          && qh hull_dim <= qh_DIMreduceBuild) {
    -        othermerge= False;
    -        isreduce= True;
    -      }
    -      if (isreduce) {
    -        if (qh_reducevertices()) {
    -          qh_getmergeset(qh newfacet_list); /* facet_mergeset */
    -          continue;
    -        }
    -      }
    -    }
    -    if (vneighbors && qh_test_vneighbors(/* qh newfacet_list */))
    -      continue;
    -    break;
    -  } /* while (True) */
    -  if (qh CHECKfrequently && !qh MERGEexact) {
    -    qh old_randomdist= qh RANDOMdist;
    -    qh RANDOMdist= False;
    -    qh_checkconvex(qh newfacet_list, qh_ALGORITHMfault);
    -    /* qh_checkconnect(); [this is slow and it changes the facet order] */
    -    qh RANDOMdist= qh old_randomdist;
    -  }
    -  trace1((qh ferr, 1009, "qh_all_merges: merged %d coplanar facets %d concave facets and %d degen or redundant facets.\n",
    -    numcoplanar, numconcave, numdegenredun));
    -  if (qh IStracing >= 4 && qh num_facets < 50)
    -    qh_printlists();
    -} /* all_merges */
    -
    -
    -/*---------------------------------
    -
    -  qh_appendmergeset( facet, neighbor, mergetype, angle )
    -    appends an entry to qh.facet_mergeset or qh.degen_mergeset
    -
    -    angle ignored if NULL or !qh.ANGLEmerge
    -
    -  returns:
    -    merge appended to facet_mergeset or degen_mergeset
    -      sets ->degenerate or ->redundant if degen_mergeset
    -
    -  see:
    -    qh_test_appendmerge()
    -
    -  design:
    -    allocate merge entry
    -    if regular merge
    -      append to qh.facet_mergeset
    -    else if degenerate merge and qh.facet_mergeset is all degenerate
    -      append to qh.degen_mergeset
    -    else if degenerate merge
    -      prepend to qh.degen_mergeset
    -    else if redundant merge
    -      append to qh.degen_mergeset
    -*/
    -void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle) {
    -  mergeT *merge, *lastmerge;
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  if (facet->redundant)
    -    return;
    -  if (facet->degenerate && mergetype == MRGdegen)
    -    return;
    -  qh_memalloc_((int)sizeof(mergeT), freelistp, merge, mergeT);
    -  merge->facet1= facet;
    -  merge->facet2= neighbor;
    -  merge->type= mergetype;
    -  if (angle && qh ANGLEmerge)
    -    merge->angle= *angle;
    -  if (mergetype < MRGdegen)
    -    qh_setappend(&(qh facet_mergeset), merge);
    -  else if (mergetype == MRGdegen) {
    -    facet->degenerate= True;
    -    if (!(lastmerge= (mergeT*)qh_setlast(qh degen_mergeset))
    -    || lastmerge->type == MRGdegen)
    -      qh_setappend(&(qh degen_mergeset), merge);
    -    else
    -      qh_setaddnth(&(qh degen_mergeset), 0, merge);
    -  }else if (mergetype == MRGredundant) {
    -    facet->redundant= True;
    -    qh_setappend(&(qh degen_mergeset), merge);
    -  }else /* mergetype == MRGmirror */ {
    -    if (facet->redundant || neighbor->redundant) {
    -      qh_fprintf(qh ferr, 6092, "qhull error (qh_appendmergeset): facet f%d or f%d is already a mirrored facet\n",
    -           facet->id, neighbor->id);
    -      qh_errexit2 (qh_ERRqhull, facet, neighbor);
    -    }
    -    if (!qh_setequal(facet->vertices, neighbor->vertices)) {
    -      qh_fprintf(qh ferr, 6093, "qhull error (qh_appendmergeset): mirrored facets f%d and f%d do not have the same vertices\n",
    -           facet->id, neighbor->id);
    -      qh_errexit2 (qh_ERRqhull, facet, neighbor);
    -    }
    -    facet->redundant= True;
    -    neighbor->redundant= True;
    -    qh_setappend(&(qh degen_mergeset), merge);
    -  }
    -} /* appendmergeset */
    -
    -
    -/*---------------------------------
    -
    -  qh_basevertices( samecycle )
    -    return temporary set of base vertices for samecycle
    -    samecycle is first facet in the cycle
    -    assumes apex is SETfirst_( samecycle->vertices )
    -
    -  returns:
    -    vertices(settemp)
    -    all ->seen are cleared
    -
    -  notes:
    -    uses qh_vertex_visit;
    -
    -  design:
    -    for each facet in samecycle
    -      for each unseen vertex in facet->vertices
    -        append to result
    -*/
    -setT *qh_basevertices(facetT *samecycle) {
    -  facetT *same;
    -  vertexT *apex, *vertex, **vertexp;
    -  setT *vertices= qh_settemp(qh TEMPsize);
    -
    -  apex= SETfirstt_(samecycle->vertices, vertexT);
    -  apex->visitid= ++qh vertex_visit;
    -  FORALLsame_cycle_(samecycle) {
    -    if (same->mergeridge)
    -      continue;
    -    FOREACHvertex_(same->vertices) {
    -      if (vertex->visitid != qh vertex_visit) {
    -        qh_setappend(&vertices, vertex);
    -        vertex->visitid= qh vertex_visit;
    -        vertex->seen= False;
    -      }
    -    }
    -  }
    -  trace4((qh ferr, 4019, "qh_basevertices: found %d vertices\n",
    -         qh_setsize(vertices)));
    -  return vertices;
    -} /* basevertices */
    -
    -/*---------------------------------
    -
    -  qh_checkconnect()
    -    check that new facets are connected
    -    new facets are on qh.newfacet_list
    -
    -  notes:
    -    this is slow and it changes the order of the facets
    -    uses qh.visit_id
    -
    -  design:
    -    move first new facet to end of qh.facet_list
    -    for all newly appended facets
    -      append unvisited neighbors to end of qh.facet_list
    -    for all new facets
    -      report error if unvisited
    -*/
    -void qh_checkconnect(void /* qh newfacet_list */) {
    -  facetT *facet, *newfacet, *errfacet= NULL, *neighbor, **neighborp;
    -
    -  facet= qh newfacet_list;
    -  qh_removefacet(facet);
    -  qh_appendfacet(facet);
    -  facet->visitid= ++qh visit_id;
    -  FORALLfacet_(facet) {
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid != qh visit_id) {
    -        qh_removefacet(neighbor);
    -        qh_appendfacet(neighbor);
    -        neighbor->visitid= qh visit_id;
    -      }
    -    }
    -  }
    -  FORALLnew_facets {
    -    if (newfacet->visitid == qh visit_id)
    -      break;
    -    qh_fprintf(qh ferr, 6094, "qhull error: f%d is not attached to the new facets\n",
    -         newfacet->id);
    -    errfacet= newfacet;
    -  }
    -  if (errfacet)
    -    qh_errexit(qh_ERRqhull, errfacet, NULL);
    -} /* checkconnect */
    -
    -/*---------------------------------
    -
    -  qh_checkzero( testall )
    -    check that facets are clearly convex for qh.DISTround with qh.MERGEexact
    -
    -    if testall,
    -      test all facets for qh.MERGEexact post-merging
    -    else
    -      test qh.newfacet_list
    -
    -    if qh.MERGEexact,
    -      allows coplanar ridges
    -      skips convexity test while qh.ZEROall_ok
    -
    -  returns:
    -    True if all facets !flipped, !dupridge, normal
    -         if all horizon facets are simplicial
    -         if all vertices are clearly below neighbor
    -         if all opposite vertices of horizon are below
    -    clears qh.ZEROall_ok if any problems or coplanar facets
    -
    -  notes:
    -    uses qh.vertex_visit
    -    horizon facets may define multiple new facets
    -
    -  design:
    -    for all facets in qh.newfacet_list or qh.facet_list
    -      check for flagged faults (flipped, etc.)
    -    for all facets in qh.newfacet_list or qh.facet_list
    -      for each neighbor of facet
    -        skip horizon facets for qh.newfacet_list
    -        test the opposite vertex
    -      if qh.newfacet_list
    -        test the other vertices in the facet's horizon facet
    -*/
    -boolT qh_checkzero(boolT testall) {
    -  facetT *facet, *neighbor, **neighborp;
    -  facetT *horizon, *facetlist;
    -  int neighbor_i;
    -  vertexT *vertex, **vertexp;
    -  realT dist;
    -
    -  if (testall)
    -    facetlist= qh facet_list;
    -  else {
    -    facetlist= qh newfacet_list;
    -    FORALLfacet_(facetlist) {
    -      horizon= SETfirstt_(facet->neighbors, facetT);
    -      if (!horizon->simplicial)
    -        goto LABELproblem;
    -      if (facet->flipped || facet->dupridge || !facet->normal)
    -        goto LABELproblem;
    -    }
    -    if (qh MERGEexact && qh ZEROall_ok) {
    -      trace2((qh ferr, 2011, "qh_checkzero: skip convexity check until first pre-merge\n"));
    -      return True;
    -    }
    -  }
    -  FORALLfacet_(facetlist) {
    -    qh vertex_visit++;
    -    neighbor_i= 0;
    -    horizon= NULL;
    -    FOREACHneighbor_(facet) {
    -      if (!neighbor_i && !testall) {
    -        horizon= neighbor;
    -        neighbor_i++;
    -        continue; /* horizon facet tested in qh_findhorizon */
    -      }
    -      vertex= SETelemt_(facet->vertices, neighbor_i++, vertexT);
    -      vertex->visitid= qh vertex_visit;
    -      zzinc_(Zdistzero);
    -      qh_distplane(vertex->point, neighbor, &dist);
    -      if (dist >= -qh DISTround) {
    -        qh ZEROall_ok= False;
    -        if (!qh MERGEexact || testall || dist > qh DISTround)
    -          goto LABELnonconvex;
    -      }
    -    }
    -    if (!testall) {
    -      FOREACHvertex_(horizon->vertices) {
    -        if (vertex->visitid != qh vertex_visit) {
    -          zzinc_(Zdistzero);
    -          qh_distplane(vertex->point, facet, &dist);
    -          if (dist >= -qh DISTround) {
    -            qh ZEROall_ok= False;
    -            if (!qh MERGEexact || dist > qh DISTround)
    -              goto LABELnonconvex;
    -          }
    -          break;
    -        }
    -      }
    -    }
    -  }
    -  trace2((qh ferr, 2012, "qh_checkzero: testall %d, facets are %s\n", testall,
    -        (qh MERGEexact && !testall) ?
    -           "not concave, flipped, or duplicate ridged" : "clearly convex"));
    -  return True;
    -
    - LABELproblem:
    -  qh ZEROall_ok= False;
    -  trace2((qh ferr, 2013, "qh_checkzero: facet f%d needs pre-merging\n",
    -       facet->id));
    -  return False;
    -
    - LABELnonconvex:
    -  trace2((qh ferr, 2014, "qh_checkzero: facet f%d and f%d are not clearly convex.  v%d dist %.2g\n",
    -         facet->id, neighbor->id, vertex->id, dist));
    -  return False;
    -} /* checkzero */
    -
    -/*---------------------------------
    -
    -  qh_compareangle( angle1, angle2 )
    -    used by qsort() to order merges by angle
    -*/
    -int qh_compareangle(const void *p1, const void *p2) {
    -  const mergeT *a= *((mergeT *const*)p1), *b= *((mergeT *const*)p2);
    -
    -  return((a->angle > b->angle) ? 1 : -1);
    -} /* compareangle */
    -
    -/*---------------------------------
    -
    -  qh_comparemerge( merge1, merge2 )
    -    used by qsort() to order merges
    -*/
    -int qh_comparemerge(const void *p1, const void *p2) {
    -  const mergeT *a= *((mergeT *const*)p1), *b= *((mergeT *const*)p2);
    -
    -  return(a->type - b->type);
    -} /* comparemerge */
    -
    -/*---------------------------------
    -
    -  qh_comparevisit( vertex1, vertex2 )
    -    used by qsort() to order vertices by their visitid
    -*/
    -int qh_comparevisit(const void *p1, const void *p2) {
    -  const vertexT *a= *((vertexT *const*)p1), *b= *((vertexT *const*)p2);
    -
    -  return(a->visitid - b->visitid);
    -} /* comparevisit */
    -
    -/*---------------------------------
    -
    -  qh_copynonconvex( atridge )
    -    set non-convex flag on other ridges (if any) between same neighbors
    -
    -  notes:
    -    may be faster if use smaller ridge set
    -
    -  design:
    -    for each ridge of atridge's top facet
    -      if ridge shares the same neighbor
    -        set nonconvex flag
    -*/
    -void qh_copynonconvex(ridgeT *atridge) {
    -  facetT *facet, *otherfacet;
    -  ridgeT *ridge, **ridgep;
    -
    -  facet= atridge->top;
    -  otherfacet= atridge->bottom;
    -  FOREACHridge_(facet->ridges) {
    -    if (otherfacet == otherfacet_(ridge, facet) && ridge != atridge) {
    -      ridge->nonconvex= True;
    -      trace4((qh ferr, 4020, "qh_copynonconvex: moved nonconvex flag from r%d to r%d\n",
    -              atridge->id, ridge->id));
    -      break;
    -    }
    -  }
    -} /* copynonconvex */
    -
    -/*---------------------------------
    -
    -  qh_degen_redundant_facet( facet )
    -    check facet for degen. or redundancy
    -
    -  notes:
    -    bumps vertex_visit
    -    called if a facet was redundant but no longer is (qh_merge_degenredundant)
    -    qh_appendmergeset() only appends first reference to facet (i.e., redundant)
    -
    -  see:
    -    qh_degen_redundant_neighbors()
    -
    -  design:
    -    test for redundant neighbor
    -    test for degenerate facet
    -*/
    -void qh_degen_redundant_facet(facetT *facet) {
    -  vertexT *vertex, **vertexp;
    -  facetT *neighbor, **neighborp;
    -
    -  trace4((qh ferr, 4021, "qh_degen_redundant_facet: test facet f%d for degen/redundant\n",
    -          facet->id));
    -  FOREACHneighbor_(facet) {
    -    qh vertex_visit++;
    -    FOREACHvertex_(neighbor->vertices)
    -      vertex->visitid= qh vertex_visit;
    -    FOREACHvertex_(facet->vertices) {
    -      if (vertex->visitid != qh vertex_visit)
    -        break;
    -    }
    -    if (!vertex) {
    -      qh_appendmergeset(facet, neighbor, MRGredundant, NULL);
    -      trace2((qh ferr, 2015, "qh_degen_redundant_facet: f%d is contained in f%d.  merge\n", facet->id, neighbor->id));
    -      return;
    -    }
    -  }
    -  if (qh_setsize(facet->neighbors) < qh hull_dim) {
    -    qh_appendmergeset(facet, facet, MRGdegen, NULL);
    -    trace2((qh ferr, 2016, "qh_degen_redundant_neighbors: f%d is degenerate.\n", facet->id));
    -  }
    -} /* degen_redundant_facet */
    -
    -
    -/*---------------------------------
    -
    -  qh_degen_redundant_neighbors( facet, delfacet,  )
    -    append degenerate and redundant neighbors to facet_mergeset
    -    if delfacet,
    -      only checks neighbors of both delfacet and facet
    -    also checks current facet for degeneracy
    -
    -  notes:
    -    bumps vertex_visit
    -    called for each qh_mergefacet() and qh_mergecycle()
    -    merge and statistics occur in merge_nonconvex
    -    qh_appendmergeset() only appends first reference to facet (i.e., redundant)
    -      it appends redundant facets after degenerate ones
    -
    -    a degenerate facet has fewer than hull_dim neighbors
    -    a redundant facet's vertices is a subset of its neighbor's vertices
    -    tests for redundant merges first (appendmergeset is nop for others)
    -    in a merge, only needs to test neighbors of merged facet
    -
    -  see:
    -    qh_merge_degenredundant() and qh_degen_redundant_facet()
    -
    -  design:
    -    test for degenerate facet
    -    test for redundant neighbor
    -    test for degenerate neighbor
    -*/
    -void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) {
    -  vertexT *vertex, **vertexp;
    -  facetT *neighbor, **neighborp;
    -  int size;
    -
    -  trace4((qh ferr, 4022, "qh_degen_redundant_neighbors: test neighbors of f%d with delfacet f%d\n",
    -          facet->id, getid_(delfacet)));
    -  if ((size= qh_setsize(facet->neighbors)) < qh hull_dim) {
    -    qh_appendmergeset(facet, facet, MRGdegen, NULL);
    -    trace2((qh ferr, 2017, "qh_degen_redundant_neighbors: f%d is degenerate with %d neighbors.\n", facet->id, size));
    -  }
    -  if (!delfacet)
    -    delfacet= facet;
    -  qh vertex_visit++;
    -  FOREACHvertex_(facet->vertices)
    -    vertex->visitid= qh vertex_visit;
    -  FOREACHneighbor_(delfacet) {
    -    /* uses early out instead of checking vertex count */
    -    if (neighbor == facet)
    -      continue;
    -    FOREACHvertex_(neighbor->vertices) {
    -      if (vertex->visitid != qh vertex_visit)
    -        break;
    -    }
    -    if (!vertex) {
    -      qh_appendmergeset(neighbor, facet, MRGredundant, NULL);
    -      trace2((qh ferr, 2018, "qh_degen_redundant_neighbors: f%d is contained in f%d.  merge\n", neighbor->id, facet->id));
    -    }
    -  }
    -  FOREACHneighbor_(delfacet) {   /* redundant merges occur first */
    -    if (neighbor == facet)
    -      continue;
    -    if ((size= qh_setsize(neighbor->neighbors)) < qh hull_dim) {
    -      qh_appendmergeset(neighbor, neighbor, MRGdegen, NULL);
    -      trace2((qh ferr, 2019, "qh_degen_redundant_neighbors: f%d is degenerate with %d neighbors.  Neighbor of f%d.\n", neighbor->id, size, facet->id));
    -    }
    -  }
    -} /* degen_redundant_neighbors */
    -
    -
    -/*---------------------------------
    -
    -  qh_find_newvertex( oldvertex, vertices, ridges )
    -    locate new vertex for renaming old vertex
    -    vertices is a set of possible new vertices
    -      vertices sorted by number of deleted ridges
    -
    -  returns:
    -    newvertex or NULL
    -      each ridge includes both vertex and oldvertex
    -    vertices sorted by number of deleted ridges
    -
    -  notes:
    -    modifies vertex->visitid
    -    new vertex is in one of the ridges
    -    renaming will not cause a duplicate ridge
    -    renaming will minimize the number of deleted ridges
    -    newvertex may not be adjacent in the dual (though unlikely)
    -
    -  design:
    -    for each vertex in vertices
    -      set vertex->visitid to number of references in ridges
    -    remove unvisited vertices
    -    set qh.vertex_visit above all possible values
    -    sort vertices by number of references in ridges
    -    add each ridge to qh.hash_table
    -    for each vertex in vertices
    -      look for a vertex that would not cause a duplicate ridge after a rename
    -*/
    -vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges) {
    -  vertexT *vertex, **vertexp;
    -  setT *newridges;
    -  ridgeT *ridge, **ridgep;
    -  int size, hashsize;
    -  int hash;
    -
    -#ifndef qh_NOtrace
    -  if (qh IStracing >= 4) {
    -    qh_fprintf(qh ferr, 8063, "qh_find_newvertex: find new vertex for v%d from ",
    -             oldvertex->id);
    -    FOREACHvertex_(vertices)
    -      qh_fprintf(qh ferr, 8064, "v%d ", vertex->id);
    -    FOREACHridge_(ridges)
    -      qh_fprintf(qh ferr, 8065, "r%d ", ridge->id);
    -    qh_fprintf(qh ferr, 8066, "\n");
    -  }
    -#endif
    -  FOREACHvertex_(vertices)
    -    vertex->visitid= 0;
    -  FOREACHridge_(ridges) {
    -    FOREACHvertex_(ridge->vertices)
    -      vertex->visitid++;
    -  }
    -  FOREACHvertex_(vertices) {
    -    if (!vertex->visitid) {
    -      qh_setdelnth(vertices, SETindex_(vertices,vertex));
    -      vertexp--; /* repeat since deleted this vertex */
    -    }
    -  }
    -  qh vertex_visit += (unsigned int)qh_setsize(ridges);
    -  if (!qh_setsize(vertices)) {
    -    trace4((qh ferr, 4023, "qh_find_newvertex: vertices not in ridges for v%d\n",
    -            oldvertex->id));
    -    return NULL;
    -  }
    -  qsort(SETaddr_(vertices, vertexT), (size_t)qh_setsize(vertices),
    -                sizeof(vertexT *), qh_comparevisit);
    -  /* can now use qh vertex_visit */
    -  if (qh PRINTstatistics) {
    -    size= qh_setsize(vertices);
    -    zinc_(Zintersect);
    -    zadd_(Zintersecttot, size);
    -    zmax_(Zintersectmax, size);
    -  }
    -  hashsize= qh_newhashtable(qh_setsize(ridges));
    -  FOREACHridge_(ridges)
    -    qh_hashridge(qh hash_table, hashsize, ridge, oldvertex);
    -  FOREACHvertex_(vertices) {
    -    newridges= qh_vertexridges(vertex);
    -    FOREACHridge_(newridges) {
    -      if (qh_hashridge_find(qh hash_table, hashsize, ridge, vertex, oldvertex, &hash)) {
    -        zinc_(Zdupridge);
    -        break;
    -      }
    -    }
    -    qh_settempfree(&newridges);
    -    if (!ridge)
    -      break;  /* found a rename */
    -  }
    -  if (vertex) {
    -    /* counted in qh_renamevertex */
    -    trace2((qh ferr, 2020, "qh_find_newvertex: found v%d for old v%d from %d vertices and %d ridges.\n",
    -      vertex->id, oldvertex->id, qh_setsize(vertices), qh_setsize(ridges)));
    -  }else {
    -    zinc_(Zfindfail);
    -    trace0((qh ferr, 14, "qh_find_newvertex: no vertex for renaming v%d(all duplicated ridges) during p%d\n",
    -      oldvertex->id, qh furthest_id));
    -  }
    -  qh_setfree(&qh hash_table);
    -  return vertex;
    -} /* find_newvertex */
    -
    -/*---------------------------------
    -
    -  qh_findbest_test( testcentrum, facet, neighbor, bestfacet, dist, mindist, maxdist )
    -    test neighbor of facet for qh_findbestneighbor()
    -    if testcentrum,
    -      tests centrum (assumes it is defined)
    -    else
    -      tests vertices
    -
    -  returns:
    -    if a better facet (i.e., vertices/centrum of facet closer to neighbor)
    -      updates bestfacet, dist, mindist, and maxdist
    -*/
    -void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor,
    -      facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp) {
    -  realT dist, mindist, maxdist;
    -
    -  if (testcentrum) {
    -    zzinc_(Zbestdist);
    -    qh_distplane(facet->center, neighbor, &dist);
    -    dist *= qh hull_dim; /* estimate furthest vertex */
    -    if (dist < 0) {
    -      maxdist= 0;
    -      mindist= dist;
    -      dist= -dist;
    -    }else {
    -      mindist= 0;
    -      maxdist= dist;
    -    }
    -  }else
    -    dist= qh_getdistance(facet, neighbor, &mindist, &maxdist);
    -  if (dist < *distp) {
    -    *bestfacet= neighbor;
    -    *mindistp= mindist;
    -    *maxdistp= maxdist;
    -    *distp= dist;
    -  }
    -} /* findbest_test */
    -
    -/*---------------------------------
    -
    -  qh_findbestneighbor( facet, dist, mindist, maxdist )
    -    finds best neighbor (least dist) of a facet for merging
    -
    -  returns:
    -    returns min and max distances and their max absolute value
    -
    -  notes:
    -    avoids merging old into new
    -    assumes ridge->nonconvex only set on one ridge between a pair of facets
    -    could use an early out predicate but not worth it
    -
    -  design:
    -    if a large facet
    -      will test centrum
    -    else
    -      will test vertices
    -    if a large facet
    -      test nonconvex neighbors for best merge
    -    else
    -      test all neighbors for the best merge
    -    if testing centrum
    -      get distance information
    -*/
    -facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp) {
    -  facetT *neighbor, **neighborp, *bestfacet= NULL;
    -  ridgeT *ridge, **ridgep;
    -  boolT nonconvex= True, testcentrum= False;
    -  int size= qh_setsize(facet->vertices);
    -
    -  *distp= REALmax;
    -  if (size > qh_BESTcentrum2 * qh hull_dim + qh_BESTcentrum) {
    -    testcentrum= True;
    -    zinc_(Zbestcentrum);
    -    if (!facet->center)
    -       facet->center= qh_getcentrum(facet);
    -  }
    -  if (size > qh hull_dim + qh_BESTnonconvex) {
    -    FOREACHridge_(facet->ridges) {
    -      if (ridge->nonconvex) {
    -        neighbor= otherfacet_(ridge, facet);
    -        qh_findbest_test(testcentrum, facet, neighbor,
    -                          &bestfacet, distp, mindistp, maxdistp);
    -      }
    -    }
    -  }
    -  if (!bestfacet) {
    -    nonconvex= False;
    -    FOREACHneighbor_(facet)
    -      qh_findbest_test(testcentrum, facet, neighbor,
    -                        &bestfacet, distp, mindistp, maxdistp);
    -  }
    -  if (!bestfacet) {
    -    qh_fprintf(qh ferr, 6095, "qhull internal error (qh_findbestneighbor): no neighbors for f%d\n", facet->id);
    -
    -    qh_errexit(qh_ERRqhull, facet, NULL);
    -  }
    -  if (testcentrum)
    -    qh_getdistance(facet, bestfacet, mindistp, maxdistp);
    -  trace3((qh ferr, 3002, "qh_findbestneighbor: f%d is best neighbor for f%d testcentrum? %d nonconvex? %d dist %2.2g min %2.2g max %2.2g\n",
    -     bestfacet->id, facet->id, testcentrum, nonconvex, *distp, *mindistp, *maxdistp));
    -  return(bestfacet);
    -} /* findbestneighbor */
    -
    -
    -/*---------------------------------
    -
    -  qh_flippedmerges( facetlist, wasmerge )
    -    merge flipped facets into best neighbor
    -    assumes qh.facet_mergeset at top of temporary stack
    -
    -  returns:
    -    no flipped facets on facetlist
    -    sets wasmerge if merge occurred
    -    degen/redundant merges passed through
    -
    -  notes:
    -    othermerges not needed since qh.facet_mergeset is empty before & after
    -      keep it in case of change
    -
    -  design:
    -    append flipped facets to qh.facetmergeset
    -    for each flipped merge
    -      find best neighbor
    -      merge facet into neighbor
    -      merge degenerate and redundant facets
    -    remove flipped merges from qh.facet_mergeset
    -*/
    -void qh_flippedmerges(facetT *facetlist, boolT *wasmerge) {
    -  facetT *facet, *neighbor, *facet1;
    -  realT dist, mindist, maxdist;
    -  mergeT *merge, **mergep;
    -  setT *othermerges;
    -  int nummerge=0;
    -
    -  trace4((qh ferr, 4024, "qh_flippedmerges: begin\n"));
    -  FORALLfacet_(facetlist) {
    -    if (facet->flipped && !facet->visible)
    -      qh_appendmergeset(facet, facet, MRGflip, NULL);
    -  }
    -  othermerges= qh_settemppop(); /* was facet_mergeset */
    -  qh facet_mergeset= qh_settemp(qh TEMPsize);
    -  qh_settemppush(othermerges);
    -  FOREACHmerge_(othermerges) {
    -    facet1= merge->facet1;
    -    if (merge->type != MRGflip || facet1->visible)
    -      continue;
    -    if (qh TRACEmerge-1 == zzval_(Ztotmerge))
    -      qhmem.IStracing= qh IStracing= qh TRACElevel;
    -    neighbor= qh_findbestneighbor(facet1, &dist, &mindist, &maxdist);
    -    trace0((qh ferr, 15, "qh_flippedmerges: merge flipped f%d into f%d dist %2.2g during p%d\n",
    -      facet1->id, neighbor->id, dist, qh furthest_id));
    -    qh_mergefacet(facet1, neighbor, &mindist, &maxdist, !qh_MERGEapex);
    -    nummerge++;
    -    if (qh PRINTstatistics) {
    -      zinc_(Zflipped);
    -      wadd_(Wflippedtot, dist);
    -      wmax_(Wflippedmax, dist);
    -    }
    -    qh_merge_degenredundant();
    -  }
    -  FOREACHmerge_(othermerges) {
    -    if (merge->facet1->visible || merge->facet2->visible)
    -      qh_memfree(merge, (int)sizeof(mergeT));
    -    else
    -      qh_setappend(&qh facet_mergeset, merge);
    -  }
    -  qh_settempfree(&othermerges);
    -  if (nummerge)
    -    *wasmerge= True;
    -  trace1((qh ferr, 1010, "qh_flippedmerges: merged %d flipped facets into a good neighbor\n", nummerge));
    -} /* flippedmerges */
    -
    -
    -/*---------------------------------
    -
    -  qh_forcedmerges( wasmerge )
    -    merge duplicated ridges
    -
    -  returns:
    -    removes all duplicate ridges on facet_mergeset
    -    wasmerge set if merge
    -    qh.facet_mergeset may include non-forced merges(none for now)
    -    qh.degen_mergeset includes degen/redun merges
    -
    -  notes:
    -    duplicate ridges occur when the horizon is pinched,
    -        i.e. a subridge occurs in more than two horizon ridges.
    -     could rename vertices that pinch the horizon
    -    assumes qh_merge_degenredundant() has not be called
    -    othermerges isn't needed since facet_mergeset is empty afterwards
    -      keep it in case of change
    -
    -  design:
    -    for each duplicate ridge
    -      find current facets by chasing f.replace links
    -      determine best direction for facet
    -      merge one facet into the other
    -      remove duplicate ridges from qh.facet_mergeset
    -*/
    -void qh_forcedmerges(boolT *wasmerge) {
    -  facetT *facet1, *facet2;
    -  mergeT *merge, **mergep;
    -  realT dist1, dist2, mindist1, mindist2, maxdist1, maxdist2;
    -  setT *othermerges;
    -  int nummerge=0, numflip=0;
    -
    -  if (qh TRACEmerge-1 == zzval_(Ztotmerge))
    -    qhmem.IStracing= qh IStracing= qh TRACElevel;
    -  trace4((qh ferr, 4025, "qh_forcedmerges: begin\n"));
    -  othermerges= qh_settemppop(); /* was facet_mergeset */
    -  qh facet_mergeset= qh_settemp(qh TEMPsize);
    -  qh_settemppush(othermerges);
    -  FOREACHmerge_(othermerges) {
    -    if (merge->type != MRGridge)
    -        continue;
    -    facet1= merge->facet1;
    -    facet2= merge->facet2;
    -    while (facet1->visible)      /* must exist, no qh_merge_degenredunant */
    -      facet1= facet1->f.replace; /* previously merged facet */
    -    while (facet2->visible)
    -      facet2= facet2->f.replace; /* previously merged facet */
    -    if (facet1 == facet2)
    -      continue;
    -    if (!qh_setin(facet2->neighbors, facet1)) {
    -      qh_fprintf(qh ferr, 6096, "qhull internal error (qh_forcedmerges): f%d and f%d had a duplicate ridge but as f%d and f%d they are no longer neighbors\n",
    -               merge->facet1->id, merge->facet2->id, facet1->id, facet2->id);
    -      qh_errexit2 (qh_ERRqhull, facet1, facet2);
    -    }
    -    if (qh TRACEmerge-1 == zzval_(Ztotmerge))
    -      qhmem.IStracing= qh IStracing= qh TRACElevel;
    -    dist1= qh_getdistance(facet1, facet2, &mindist1, &maxdist1);
    -    dist2= qh_getdistance(facet2, facet1, &mindist2, &maxdist2);
    -    trace0((qh ferr, 16, "qh_forcedmerges: duplicate ridge between f%d and f%d, dist %2.2g and reverse dist %2.2g during p%d\n",
    -            facet1->id, facet2->id, dist1, dist2, qh furthest_id));
    -    if (dist1 < dist2)
    -      qh_mergefacet(facet1, facet2, &mindist1, &maxdist1, !qh_MERGEapex);
    -    else {
    -      qh_mergefacet(facet2, facet1, &mindist2, &maxdist2, !qh_MERGEapex);
    -      dist1= dist2;
    -      facet1= facet2;
    -    }
    -    if (facet1->flipped) {
    -      zinc_(Zmergeflipdup);
    -      numflip++;
    -    }else
    -      nummerge++;
    -    if (qh PRINTstatistics) {
    -      zinc_(Zduplicate);
    -      wadd_(Wduplicatetot, dist1);
    -      wmax_(Wduplicatemax, dist1);
    -    }
    -  }
    -  FOREACHmerge_(othermerges) {
    -    if (merge->type == MRGridge)
    -      qh_memfree(merge, (int)sizeof(mergeT));
    -    else
    -      qh_setappend(&qh facet_mergeset, merge);
    -  }
    -  qh_settempfree(&othermerges);
    -  if (nummerge)
    -    *wasmerge= True;
    -  trace1((qh ferr, 1011, "qh_forcedmerges: merged %d facets and %d flipped facets across duplicated ridges\n",
    -                nummerge, numflip));
    -} /* forcedmerges */
    -
    -
    -/*---------------------------------
    -
    -  qh_getmergeset( facetlist )
    -    determines nonconvex facets on facetlist
    -    tests !tested ridges and nonconvex ridges of !tested facets
    -
    -  returns:
    -    returns sorted qh.facet_mergeset of facet-neighbor pairs to be merged
    -    all ridges tested
    -
    -  notes:
    -    assumes no nonconvex ridges with both facets tested
    -    uses facet->tested/ridge->tested to prevent duplicate tests
    -    can not limit tests to modified ridges since the centrum changed
    -    uses qh.visit_id
    -
    -  see:
    -    qh_getmergeset_initial()
    -
    -  design:
    -    for each facet on facetlist
    -      for each ridge of facet
    -        if untested ridge
    -          test ridge for convexity
    -          if non-convex
    -            append ridge to qh.facet_mergeset
    -    sort qh.facet_mergeset by angle
    -*/
    -void qh_getmergeset(facetT *facetlist) {
    -  facetT *facet, *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -  int nummerges;
    -
    -  nummerges= qh_setsize(qh facet_mergeset);
    -  trace4((qh ferr, 4026, "qh_getmergeset: started.\n"));
    -  qh visit_id++;
    -  FORALLfacet_(facetlist) {
    -    if (facet->tested)
    -      continue;
    -    facet->visitid= qh visit_id;
    -    facet->tested= True;  /* must be non-simplicial due to merge */
    -    FOREACHneighbor_(facet)
    -      neighbor->seen= False;
    -    FOREACHridge_(facet->ridges) {
    -      if (ridge->tested && !ridge->nonconvex)
    -        continue;
    -      /* if tested & nonconvex, need to append merge */
    -      neighbor= otherfacet_(ridge, facet);
    -      if (neighbor->seen) {
    -        ridge->tested= True;
    -        ridge->nonconvex= False;
    -      }else if (neighbor->visitid != qh visit_id) {
    -        ridge->tested= True;
    -        ridge->nonconvex= False;
    -        neighbor->seen= True;      /* only one ridge is marked nonconvex */
    -        if (qh_test_appendmerge(facet, neighbor))
    -          ridge->nonconvex= True;
    -      }
    -    }
    -  }
    -  nummerges= qh_setsize(qh facet_mergeset);
    -  if (qh ANGLEmerge)
    -    qsort(SETaddr_(qh facet_mergeset, mergeT), (size_t)nummerges, sizeof(mergeT *), qh_compareangle);
    -  else
    -    qsort(SETaddr_(qh facet_mergeset, mergeT), (size_t)nummerges, sizeof(mergeT *), qh_comparemerge);
    -  if (qh POSTmerging) {
    -    zadd_(Zmergesettot2, nummerges);
    -  }else {
    -    zadd_(Zmergesettot, nummerges);
    -    zmax_(Zmergesetmax, nummerges);
    -  }
    -  trace2((qh ferr, 2021, "qh_getmergeset: %d merges found\n", nummerges));
    -} /* getmergeset */
    -
    -
    -/*---------------------------------
    -
    -  qh_getmergeset_initial( facetlist )
    -    determine initial qh.facet_mergeset for facets
    -    tests all facet/neighbor pairs on facetlist
    -
    -  returns:
    -    sorted qh.facet_mergeset with nonconvex ridges
    -    sets facet->tested, ridge->tested, and ridge->nonconvex
    -
    -  notes:
    -    uses visit_id, assumes ridge->nonconvex is False
    -
    -  see:
    -    qh_getmergeset()
    -
    -  design:
    -    for each facet on facetlist
    -      for each untested neighbor of facet
    -        test facet and neighbor for convexity
    -        if non-convex
    -          append merge to qh.facet_mergeset
    -          mark one of the ridges as nonconvex
    -    sort qh.facet_mergeset by angle
    -*/
    -void qh_getmergeset_initial(facetT *facetlist) {
    -  facetT *facet, *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -  int nummerges;
    -
    -  qh visit_id++;
    -  FORALLfacet_(facetlist) {
    -    facet->visitid= qh visit_id;
    -    facet->tested= True;
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->visitid != qh visit_id) {
    -        if (qh_test_appendmerge(facet, neighbor)) {
    -          FOREACHridge_(neighbor->ridges) {
    -            if (facet == otherfacet_(ridge, neighbor)) {
    -              ridge->nonconvex= True;
    -              break;    /* only one ridge is marked nonconvex */
    -            }
    -          }
    -        }
    -      }
    -    }
    -    FOREACHridge_(facet->ridges)
    -      ridge->tested= True;
    -  }
    -  nummerges= qh_setsize(qh facet_mergeset);
    -  if (qh ANGLEmerge)
    -    qsort(SETaddr_(qh facet_mergeset, mergeT), (size_t)nummerges, sizeof(mergeT *), qh_compareangle);
    -  else
    -    qsort(SETaddr_(qh facet_mergeset, mergeT), (size_t)nummerges, sizeof(mergeT *), qh_comparemerge);
    -  if (qh POSTmerging) {
    -    zadd_(Zmergeinittot2, nummerges);
    -  }else {
    -    zadd_(Zmergeinittot, nummerges);
    -    zmax_(Zmergeinitmax, nummerges);
    -  }
    -  trace2((qh ferr, 2022, "qh_getmergeset_initial: %d merges found\n", nummerges));
    -} /* getmergeset_initial */
    -
    -
    -/*---------------------------------
    -
    -  qh_hashridge( hashtable, hashsize, ridge, oldvertex )
    -    add ridge to hashtable without oldvertex
    -
    -  notes:
    -    assumes hashtable is large enough
    -
    -  design:
    -    determine hash value for ridge without oldvertex
    -    find next empty slot for ridge
    -*/
    -void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex) {
    -  int hash;
    -  ridgeT *ridgeA;
    -
    -  hash= qh_gethash(hashsize, ridge->vertices, qh hull_dim-1, 0, oldvertex);
    -  while (True) {
    -    if (!(ridgeA= SETelemt_(hashtable, hash, ridgeT))) {
    -      SETelem_(hashtable, hash)= ridge;
    -      break;
    -    }else if (ridgeA == ridge)
    -      break;
    -    if (++hash == hashsize)
    -      hash= 0;
    -  }
    -} /* hashridge */
    -
    -
    -/*---------------------------------
    -
    -  qh_hashridge_find( hashtable, hashsize, ridge, vertex, oldvertex, hashslot )
    -    returns matching ridge without oldvertex in hashtable
    -      for ridge without vertex
    -    if oldvertex is NULL
    -      matches with any one skip
    -
    -  returns:
    -    matching ridge or NULL
    -    if no match,
    -      if ridge already in   table
    -        hashslot= -1
    -      else
    -        hashslot= next NULL index
    -
    -  notes:
    -    assumes hashtable is large enough
    -    can't match ridge to itself
    -
    -  design:
    -    get hash value for ridge without vertex
    -    for each hashslot
    -      return match if ridge matches ridgeA without oldvertex
    -*/
    -ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge,
    -              vertexT *vertex, vertexT *oldvertex, int *hashslot) {
    -  int hash;
    -  ridgeT *ridgeA;
    -
    -  *hashslot= 0;
    -  zinc_(Zhashridge);
    -  hash= qh_gethash(hashsize, ridge->vertices, qh hull_dim-1, 0, vertex);
    -  while ((ridgeA= SETelemt_(hashtable, hash, ridgeT))) {
    -    if (ridgeA == ridge)
    -      *hashslot= -1;
    -    else {
    -      zinc_(Zhashridgetest);
    -      if (qh_setequal_except(ridge->vertices, vertex, ridgeA->vertices, oldvertex))
    -        return ridgeA;
    -    }
    -    if (++hash == hashsize)
    -      hash= 0;
    -  }
    -  if (!*hashslot)
    -    *hashslot= hash;
    -  return NULL;
    -} /* hashridge_find */
    -
    -
    -/*---------------------------------
    -
    -  qh_makeridges( facet )
    -    creates explicit ridges between simplicial facets
    -
    -  returns:
    -    facet with ridges and without qh_MERGEridge
    -    ->simplicial is False
    -
    -  notes:
    -    allows qh_MERGEridge flag
    -    uses existing ridges
    -    duplicate neighbors ok if ridges already exist (qh_mergecycle_ridges)
    -
    -  see:
    -    qh_mergecycle_ridges()
    -
    -  design:
    -    look for qh_MERGEridge neighbors
    -    mark neighbors that already have ridges
    -    for each unprocessed neighbor of facet
    -      create a ridge for neighbor and facet
    -    if any qh_MERGEridge neighbors
    -      delete qh_MERGEridge flags (already handled by qh_mark_dupridges)
    -*/
    -void qh_makeridges(facetT *facet) {
    -  facetT *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -  int neighbor_i, neighbor_n;
    -  boolT toporient, mergeridge= False;
    -
    -  if (!facet->simplicial)
    -    return;
    -  trace4((qh ferr, 4027, "qh_makeridges: make ridges for f%d\n", facet->id));
    -  facet->simplicial= False;
    -  FOREACHneighbor_(facet) {
    -    if (neighbor == qh_MERGEridge)
    -      mergeridge= True;
    -    else
    -      neighbor->seen= False;
    -  }
    -  FOREACHridge_(facet->ridges)
    -    otherfacet_(ridge, facet)->seen= True;
    -  FOREACHneighbor_i_(facet) {
    -    if (neighbor == qh_MERGEridge)
    -      continue;  /* fixed by qh_mark_dupridges */
    -    else if (!neighbor->seen) {  /* no current ridges */
    -      ridge= qh_newridge();
    -      ridge->vertices= qh_setnew_delnthsorted(facet->vertices, qh hull_dim,
    -                                                          neighbor_i, 0);
    -      toporient= facet->toporient ^ (neighbor_i & 0x1);
    -      if (toporient) {
    -        ridge->top= facet;
    -        ridge->bottom= neighbor;
    -      }else {
    -        ridge->top= neighbor;
    -        ridge->bottom= facet;
    -      }
    -#if 0 /* this also works */
    -      flip= (facet->toporient ^ neighbor->toporient)^(skip1 & 0x1) ^ (skip2 & 0x1);
    -      if (facet->toporient ^ (skip1 & 0x1) ^ flip) {
    -        ridge->top= neighbor;
    -        ridge->bottom= facet;
    -      }else {
    -        ridge->top= facet;
    -        ridge->bottom= neighbor;
    -      }
    -#endif
    -      qh_setappend(&(facet->ridges), ridge);
    -      qh_setappend(&(neighbor->ridges), ridge);
    -    }
    -  }
    -  if (mergeridge) {
    -    while (qh_setdel(facet->neighbors, qh_MERGEridge))
    -      ; /* delete each one */
    -  }
    -} /* makeridges */
    -
    -
    -/*---------------------------------
    -
    -  qh_mark_dupridges( facetlist )
    -    add duplicated ridges to qh.facet_mergeset
    -    facet->dupridge is true
    -
    -  returns:
    -    duplicate ridges on qh.facet_mergeset
    -    ->mergeridge/->mergeridge2 set
    -    duplicate ridges marked by qh_MERGEridge and both sides facet->dupridge
    -    no MERGEridges in neighbor sets
    -
    -  notes:
    -    duplicate ridges occur when the horizon is pinched,
    -        i.e. a subridge occurs in more than two horizon ridges.
    -    could rename vertices that pinch the horizon
    -    uses qh.visit_id
    -
    -  design:
    -    for all facets on facetlist
    -      if facet contains a duplicate ridge
    -        for each neighbor of facet
    -          if neighbor marked qh_MERGEridge (one side of the merge)
    -            set facet->mergeridge
    -          else
    -            if neighbor contains a duplicate ridge
    -            and the back link is qh_MERGEridge
    -              append duplicate ridge to qh.facet_mergeset
    -   for each duplicate ridge
    -     make ridge sets in preparation for merging
    -     remove qh_MERGEridge from neighbor set
    -   for each duplicate ridge
    -     restore the missing neighbor from the neighbor set that was qh_MERGEridge
    -     add the missing ridge for this neighbor
    -*/
    -void qh_mark_dupridges(facetT *facetlist) {
    -  facetT *facet, *neighbor, **neighborp;
    -  int nummerge=0;
    -  mergeT *merge, **mergep;
    -
    -
    -  trace4((qh ferr, 4028, "qh_mark_dupridges: identify duplicate ridges\n"));
    -  FORALLfacet_(facetlist) {
    -    if (facet->dupridge) {
    -      FOREACHneighbor_(facet) {
    -        if (neighbor == qh_MERGEridge) {
    -          facet->mergeridge= True;
    -          continue;
    -        }
    -        if (neighbor->dupridge
    -        && !qh_setin(neighbor->neighbors, facet)) { /* qh_MERGEridge */
    -          qh_appendmergeset(facet, neighbor, MRGridge, NULL);
    -          facet->mergeridge2= True;
    -          facet->mergeridge= True;
    -          nummerge++;
    -        }
    -      }
    -    }
    -  }
    -  if (!nummerge)
    -    return;
    -  FORALLfacet_(facetlist) {            /* gets rid of qh_MERGEridge */
    -    if (facet->mergeridge && !facet->mergeridge2)
    -      qh_makeridges(facet);
    -  }
    -  FOREACHmerge_(qh facet_mergeset) {   /* restore the missing neighbors */
    -    if (merge->type == MRGridge) {
    -      qh_setappend(&merge->facet2->neighbors, merge->facet1);
    -      qh_makeridges(merge->facet1);   /* and the missing ridges */
    -    }
    -  }
    -  trace1((qh ferr, 1012, "qh_mark_dupridges: found %d duplicated ridges\n",
    -                nummerge));
    -} /* mark_dupridges */
    -
    -/*---------------------------------
    -
    -  qh_maydropneighbor( facet )
    -    drop neighbor relationship if no ridge between facet and neighbor
    -
    -  returns:
    -    neighbor sets updated
    -    appends degenerate facets to qh.facet_mergeset
    -
    -  notes:
    -    won't cause redundant facets since vertex inclusion is the same
    -    may drop vertex and neighbor if no ridge
    -    uses qh.visit_id
    -
    -  design:
    -    visit all neighbors with ridges
    -    for each unvisited neighbor of facet
    -      delete neighbor and facet from the neighbor sets
    -      if neighbor becomes degenerate
    -        append neighbor to qh.degen_mergeset
    -    if facet is degenerate
    -      append facet to qh.degen_mergeset
    -*/
    -void qh_maydropneighbor(facetT *facet) {
    -  ridgeT *ridge, **ridgep;
    -  realT angledegen= qh_ANGLEdegen;
    -  facetT *neighbor, **neighborp;
    -
    -  qh visit_id++;
    -  trace4((qh ferr, 4029, "qh_maydropneighbor: test f%d for no ridges to a neighbor\n",
    -          facet->id));
    -  FOREACHridge_(facet->ridges) {
    -    ridge->top->visitid= qh visit_id;
    -    ridge->bottom->visitid= qh visit_id;
    -  }
    -  FOREACHneighbor_(facet) {
    -    if (neighbor->visitid != qh visit_id) {
    -      trace0((qh ferr, 17, "qh_maydropneighbor: facets f%d and f%d are no longer neighbors during p%d\n",
    -            facet->id, neighbor->id, qh furthest_id));
    -      zinc_(Zdropneighbor);
    -      qh_setdel(facet->neighbors, neighbor);
    -      neighborp--;  /* repeat, deleted a neighbor */
    -      qh_setdel(neighbor->neighbors, facet);
    -      if (qh_setsize(neighbor->neighbors) < qh hull_dim) {
    -        zinc_(Zdropdegen);
    -        qh_appendmergeset(neighbor, neighbor, MRGdegen, &angledegen);
    -        trace2((qh ferr, 2023, "qh_maydropneighbors: f%d is degenerate.\n", neighbor->id));
    -      }
    -    }
    -  }
    -  if (qh_setsize(facet->neighbors) < qh hull_dim) {
    -    zinc_(Zdropdegen);
    -    qh_appendmergeset(facet, facet, MRGdegen, &angledegen);
    -    trace2((qh ferr, 2024, "qh_maydropneighbors: f%d is degenerate.\n", facet->id));
    -  }
    -} /* maydropneighbor */
    -
    -
    -/*---------------------------------
    -
    -  qh_merge_degenredundant()
    -    merge all degenerate and redundant facets
    -    qh.degen_mergeset contains merges from qh_degen_redundant_neighbors()
    -
    -  returns:
    -    number of merges performed
    -    resets facet->degenerate/redundant
    -    if deleted (visible) facet has no neighbors
    -      sets ->f.replace to NULL
    -
    -  notes:
    -    redundant merges happen before degenerate ones
    -    merging and renaming vertices can result in degen/redundant facets
    -
    -  design:
    -    for each merge on qh.degen_mergeset
    -      if redundant merge
    -        if non-redundant facet merged into redundant facet
    -          recheck facet for redundancy
    -        else
    -          merge redundant facet into other facet
    -*/
    -int qh_merge_degenredundant(void) {
    -  int size;
    -  mergeT *merge;
    -  facetT *bestneighbor, *facet1, *facet2;
    -  realT dist, mindist, maxdist;
    -  vertexT *vertex, **vertexp;
    -  int nummerges= 0;
    -  mergeType mergetype;
    -
    -  while ((merge= (mergeT*)qh_setdellast(qh degen_mergeset))) {
    -    facet1= merge->facet1;
    -    facet2= merge->facet2;
    -    mergetype= merge->type;
    -    qh_memfree(merge, (int)sizeof(mergeT));
    -    if (facet1->visible)
    -      continue;
    -    facet1->degenerate= False;
    -    facet1->redundant= False;
    -    if (qh TRACEmerge-1 == zzval_(Ztotmerge))
    -      qhmem.IStracing= qh IStracing= qh TRACElevel;
    -    if (mergetype == MRGredundant) {
    -      zinc_(Zneighbor);
    -      while (facet2->visible) {
    -        if (!facet2->f.replace) {
    -          qh_fprintf(qh ferr, 6097, "qhull internal error (qh_merge_degenredunant): f%d redundant but f%d has no replacement\n",
    -               facet1->id, facet2->id);
    -          qh_errexit2 (qh_ERRqhull, facet1, facet2);
    -        }
    -        facet2= facet2->f.replace;
    -      }
    -      if (facet1 == facet2) {
    -        qh_degen_redundant_facet(facet1); /* in case of others */
    -        continue;
    -      }
    -      trace2((qh ferr, 2025, "qh_merge_degenredundant: facet f%d is contained in f%d, will merge\n",
    -            facet1->id, facet2->id));
    -      qh_mergefacet(facet1, facet2, NULL, NULL, !qh_MERGEapex);
    -      /* merge distance is already accounted for */
    -      nummerges++;
    -    }else {  /* mergetype == MRGdegen, other merges may have fixed */
    -      if (!(size= qh_setsize(facet1->neighbors))) {
    -        zinc_(Zdelfacetdup);
    -        trace2((qh ferr, 2026, "qh_merge_degenredundant: facet f%d has no neighbors.  Deleted\n", facet1->id));
    -        qh_willdelete(facet1, NULL);
    -        FOREACHvertex_(facet1->vertices) {
    -          qh_setdel(vertex->neighbors, facet1);
    -          if (!SETfirst_(vertex->neighbors)) {
    -            zinc_(Zdegenvertex);
    -            trace2((qh ferr, 2027, "qh_merge_degenredundant: deleted v%d because f%d has no neighbors\n",
    -                 vertex->id, facet1->id));
    -            vertex->deleted= True;
    -            qh_setappend(&qh del_vertices, vertex);
    -          }
    -        }
    -        nummerges++;
    -      }else if (size < qh hull_dim) {
    -        bestneighbor= qh_findbestneighbor(facet1, &dist, &mindist, &maxdist);
    -        trace2((qh ferr, 2028, "qh_merge_degenredundant: facet f%d has %d neighbors, merge into f%d dist %2.2g\n",
    -              facet1->id, size, bestneighbor->id, dist));
    -        qh_mergefacet(facet1, bestneighbor, &mindist, &maxdist, !qh_MERGEapex);
    -        nummerges++;
    -        if (qh PRINTstatistics) {
    -          zinc_(Zdegen);
    -          wadd_(Wdegentot, dist);
    -          wmax_(Wdegenmax, dist);
    -        }
    -      } /* else, another merge fixed the degeneracy and redundancy tested */
    -    }
    -  }
    -  return nummerges;
    -} /* merge_degenredundant */
    -
    -/*---------------------------------
    -
    -  qh_merge_nonconvex( facet1, facet2, mergetype )
    -    remove non-convex ridge between facet1 into facet2
    -    mergetype gives why the facet's are non-convex
    -
    -  returns:
    -    merges one of the facets into the best neighbor
    -
    -  design:
    -    if one of the facets is a new facet
    -      prefer merging new facet into old facet
    -    find best neighbors for both facets
    -    merge the nearest facet into its best neighbor
    -    update the statistics
    -*/
    -void qh_merge_nonconvex(facetT *facet1, facetT *facet2, mergeType mergetype) {
    -  facetT *bestfacet, *bestneighbor, *neighbor;
    -  realT dist, dist2, mindist, mindist2, maxdist, maxdist2;
    -
    -  if (qh TRACEmerge-1 == zzval_(Ztotmerge))
    -    qhmem.IStracing= qh IStracing= qh TRACElevel;
    -  trace3((qh ferr, 3003, "qh_merge_nonconvex: merge #%d for f%d and f%d type %d\n",
    -      zzval_(Ztotmerge) + 1, facet1->id, facet2->id, mergetype));
    -  /* concave or coplanar */
    -  if (!facet1->newfacet) {
    -    bestfacet= facet2;   /* avoid merging old facet if new is ok */
    -    facet2= facet1;
    -    facet1= bestfacet;
    -  }else
    -    bestfacet= facet1;
    -  bestneighbor= qh_findbestneighbor(bestfacet, &dist, &mindist, &maxdist);
    -  neighbor= qh_findbestneighbor(facet2, &dist2, &mindist2, &maxdist2);
    -  if (dist < dist2) {
    -    qh_mergefacet(bestfacet, bestneighbor, &mindist, &maxdist, !qh_MERGEapex);
    -  }else if (qh AVOIDold && !facet2->newfacet
    -  && ((mindist >= -qh MAXcoplanar && maxdist <= qh max_outside)
    -       || dist * 1.5 < dist2)) {
    -    zinc_(Zavoidold);
    -    wadd_(Wavoidoldtot, dist);
    -    wmax_(Wavoidoldmax, dist);
    -    trace2((qh ferr, 2029, "qh_merge_nonconvex: avoid merging old facet f%d dist %2.2g.  Use f%d dist %2.2g instead\n",
    -           facet2->id, dist2, facet1->id, dist2));
    -    qh_mergefacet(bestfacet, bestneighbor, &mindist, &maxdist, !qh_MERGEapex);
    -  }else {
    -    qh_mergefacet(facet2, neighbor, &mindist2, &maxdist2, !qh_MERGEapex);
    -    dist= dist2;
    -  }
    -  if (qh PRINTstatistics) {
    -    if (mergetype == MRGanglecoplanar) {
    -      zinc_(Zacoplanar);
    -      wadd_(Wacoplanartot, dist);
    -      wmax_(Wacoplanarmax, dist);
    -    }else if (mergetype == MRGconcave) {
    -      zinc_(Zconcave);
    -      wadd_(Wconcavetot, dist);
    -      wmax_(Wconcavemax, dist);
    -    }else { /* MRGcoplanar */
    -      zinc_(Zcoplanar);
    -      wadd_(Wcoplanartot, dist);
    -      wmax_(Wcoplanarmax, dist);
    -    }
    -  }
    -} /* merge_nonconvex */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle( samecycle, newfacet )
    -    merge a cycle of facets starting at samecycle into a newfacet
    -    newfacet is a horizon facet with ->normal
    -    samecycle facets are simplicial from an apex
    -
    -  returns:
    -    initializes vertex neighbors on first merge
    -    samecycle deleted (placed on qh.visible_list)
    -    newfacet at end of qh.facet_list
    -    deleted vertices on qh.del_vertices
    -
    -  see:
    -    qh_mergefacet()
    -    called by qh_mergecycle_all() for multiple, same cycle facets
    -
    -  design:
    -    make vertex neighbors if necessary
    -    make ridges for newfacet
    -    merge neighbor sets of samecycle into newfacet
    -    merge ridges of samecycle into newfacet
    -    merge vertex neighbors of samecycle into newfacet
    -    make apex of samecycle the apex of newfacet
    -    if newfacet wasn't a new facet
    -      add its vertices to qh.newvertex_list
    -    delete samecycle facets a make newfacet a newfacet
    -*/
    -void qh_mergecycle(facetT *samecycle, facetT *newfacet) {
    -  int traceonce= False, tracerestore= 0;
    -  vertexT *apex;
    -#ifndef qh_NOtrace
    -  facetT *same;
    -#endif
    -
    -  if (newfacet->tricoplanar) {
    -    if (!qh TRInormals) {
    -      qh_fprintf(qh ferr, 6224, "Qhull internal error (qh_mergecycle): does not work for tricoplanar facets.  Use option 'Q11'\n");
    -      qh_errexit(qh_ERRqhull, newfacet, NULL);
    -    }
    -    newfacet->tricoplanar= False;
    -    newfacet->keepcentrum= False;
    -  }
    -  if (!qh VERTEXneighbors)
    -    qh_vertexneighbors();
    -  zzinc_(Ztotmerge);
    -  if (qh REPORTfreq2 && qh POSTmerging) {
    -    if (zzval_(Ztotmerge) > qh mergereport + qh REPORTfreq2)
    -      qh_tracemerging();
    -  }
    -#ifndef qh_NOtrace
    -  if (qh TRACEmerge == zzval_(Ztotmerge))
    -    qhmem.IStracing= qh IStracing= qh TRACElevel;
    -  trace2((qh ferr, 2030, "qh_mergecycle: merge #%d for facets from cycle f%d into coplanar horizon f%d\n",
    -        zzval_(Ztotmerge), samecycle->id, newfacet->id));
    -  if (newfacet == qh tracefacet) {
    -    tracerestore= qh IStracing;
    -    qh IStracing= 4;
    -    qh_fprintf(qh ferr, 8068, "qh_mergecycle: ========= trace merge %d of samecycle %d into trace f%d, furthest is p%d\n",
    -               zzval_(Ztotmerge), samecycle->id, newfacet->id,  qh furthest_id);
    -    traceonce= True;
    -  }
    -  if (qh IStracing >=4) {
    -    qh_fprintf(qh ferr, 8069, "  same cycle:");
    -    FORALLsame_cycle_(samecycle)
    -      qh_fprintf(qh ferr, 8070, " f%d", same->id);
    -    qh_fprintf(qh ferr, 8071, "\n");
    -  }
    -  if (qh IStracing >=4)
    -    qh_errprint("MERGING CYCLE", samecycle, newfacet, NULL, NULL);
    -#endif /* !qh_NOtrace */
    -  apex= SETfirstt_(samecycle->vertices, vertexT);
    -  qh_makeridges(newfacet);
    -  qh_mergecycle_neighbors(samecycle, newfacet);
    -  qh_mergecycle_ridges(samecycle, newfacet);
    -  qh_mergecycle_vneighbors(samecycle, newfacet);
    -  if (SETfirstt_(newfacet->vertices, vertexT) != apex)
    -    qh_setaddnth(&newfacet->vertices, 0, apex);  /* apex has last id */
    -  if (!newfacet->newfacet)
    -    qh_newvertices(newfacet->vertices);
    -  qh_mergecycle_facets(samecycle, newfacet);
    -  qh_tracemerge(samecycle, newfacet);
    -  /* check for degen_redundant_neighbors after qh_forcedmerges() */
    -  if (traceonce) {
    -    qh_fprintf(qh ferr, 8072, "qh_mergecycle: end of trace facet\n");
    -    qh IStracing= tracerestore;
    -  }
    -} /* mergecycle */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle_all( facetlist, wasmerge )
    -    merge all samecycles of coplanar facets into horizon
    -    don't merge facets with ->mergeridge (these already have ->normal)
    -    all facets are simplicial from apex
    -    all facet->cycledone == False
    -
    -  returns:
    -    all newfacets merged into coplanar horizon facets
    -    deleted vertices on  qh.del_vertices
    -    sets wasmerge if any merge
    -
    -  see:
    -    calls qh_mergecycle for multiple, same cycle facets
    -
    -  design:
    -    for each facet on facetlist
    -      skip facets with duplicate ridges and normals
    -      check that facet is in a samecycle (->mergehorizon)
    -      if facet only member of samecycle
    -        sets vertex->delridge for all vertices except apex
    -        merge facet into horizon
    -      else
    -        mark all facets in samecycle
    -        remove facets with duplicate ridges from samecycle
    -        merge samecycle into horizon (deletes facets from facetlist)
    -*/
    -void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge) {
    -  facetT *facet, *same, *prev, *horizon;
    -  facetT *samecycle= NULL, *nextfacet, *nextsame;
    -  vertexT *apex, *vertex, **vertexp;
    -  int cycles=0, total=0, facets, nummerge;
    -
    -  trace2((qh ferr, 2031, "qh_mergecycle_all: begin\n"));
    -  for (facet= facetlist; facet && (nextfacet= facet->next); facet= nextfacet) {
    -    if (facet->normal)
    -      continue;
    -    if (!facet->mergehorizon) {
    -      qh_fprintf(qh ferr, 6225, "Qhull internal error (qh_mergecycle_all): f%d without normal\n", facet->id);
    -      qh_errexit(qh_ERRqhull, facet, NULL);
    -    }
    -    horizon= SETfirstt_(facet->neighbors, facetT);
    -    if (facet->f.samecycle == facet) {
    -      zinc_(Zonehorizon);
    -      /* merge distance done in qh_findhorizon */
    -      apex= SETfirstt_(facet->vertices, vertexT);
    -      FOREACHvertex_(facet->vertices) {
    -        if (vertex != apex)
    -          vertex->delridge= True;
    -      }
    -      horizon->f.newcycle= NULL;
    -      qh_mergefacet(facet, horizon, NULL, NULL, qh_MERGEapex);
    -    }else {
    -      samecycle= facet;
    -      facets= 0;
    -      prev= facet;
    -      for (same= facet->f.samecycle; same;  /* FORALLsame_cycle_(facet) */
    -           same= (same == facet ? NULL :nextsame)) { /* ends at facet */
    -        nextsame= same->f.samecycle;
    -        if (same->cycledone || same->visible)
    -          qh_infiniteloop(same);
    -        same->cycledone= True;
    -        if (same->normal) {
    -          prev->f.samecycle= same->f.samecycle; /* unlink ->mergeridge */
    -          same->f.samecycle= NULL;
    -        }else {
    -          prev= same;
    -          facets++;
    -        }
    -      }
    -      while (nextfacet && nextfacet->cycledone)  /* will delete samecycle */
    -        nextfacet= nextfacet->next;
    -      horizon->f.newcycle= NULL;
    -      qh_mergecycle(samecycle, horizon);
    -      nummerge= horizon->nummerge + facets;
    -      if (nummerge > qh_MAXnummerge)
    -        horizon->nummerge= qh_MAXnummerge;
    -      else
    -        horizon->nummerge= (short unsigned int)nummerge;
    -      zzinc_(Zcyclehorizon);
    -      total += facets;
    -      zzadd_(Zcyclefacettot, facets);
    -      zmax_(Zcyclefacetmax, facets);
    -    }
    -    cycles++;
    -  }
    -  if (cycles)
    -    *wasmerge= True;
    -  trace1((qh ferr, 1013, "qh_mergecycle_all: merged %d same cycles or facets into coplanar horizons\n", cycles));
    -} /* mergecycle_all */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle_facets( samecycle, newfacet )
    -    finish merge of samecycle into newfacet
    -
    -  returns:
    -    samecycle prepended to visible_list for later deletion and partitioning
    -      each facet->f.replace == newfacet
    -
    -    newfacet moved to end of qh.facet_list
    -      makes newfacet a newfacet (get's facet1->id if it was old)
    -      sets newfacet->newmerge
    -      clears newfacet->center (unless merging into a large facet)
    -      clears newfacet->tested and ridge->tested for facet1
    -
    -    adds neighboring facets to facet_mergeset if redundant or degenerate
    -
    -  design:
    -    make newfacet a new facet and set its flags
    -    move samecycle facets to qh.visible_list for later deletion
    -    unless newfacet is large
    -      remove its centrum
    -*/
    -void qh_mergecycle_facets(facetT *samecycle, facetT *newfacet) {
    -  facetT *same, *next;
    -
    -  trace4((qh ferr, 4030, "qh_mergecycle_facets: make newfacet new and samecycle deleted\n"));
    -  qh_removefacet(newfacet);  /* append as a newfacet to end of qh facet_list */
    -  qh_appendfacet(newfacet);
    -  newfacet->newfacet= True;
    -  newfacet->simplicial= False;
    -  newfacet->newmerge= True;
    -
    -  for (same= samecycle->f.samecycle; same; same= (same == samecycle ?  NULL : next)) {
    -    next= same->f.samecycle;  /* reused by willdelete */
    -    qh_willdelete(same, newfacet);
    -  }
    -  if (newfacet->center
    -      && qh_setsize(newfacet->vertices) <= qh hull_dim + qh_MAXnewcentrum) {
    -    qh_memfree(newfacet->center, qh normal_size);
    -    newfacet->center= NULL;
    -  }
    -  trace3((qh ferr, 3004, "qh_mergecycle_facets: merged facets from cycle f%d into f%d\n",
    -             samecycle->id, newfacet->id));
    -} /* mergecycle_facets */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle_neighbors( samecycle, newfacet )
    -    add neighbors for samecycle facets to newfacet
    -
    -  returns:
    -    newfacet with updated neighbors and vice-versa
    -    newfacet has ridges
    -    all neighbors of newfacet marked with qh.visit_id
    -    samecycle facets marked with qh.visit_id-1
    -    ridges updated for simplicial neighbors of samecycle with a ridge
    -
    -  notes:
    -    assumes newfacet not in samecycle
    -    usually, samecycle facets are new, simplicial facets without internal ridges
    -      not so if horizon facet is coplanar to two different samecycles
    -
    -  see:
    -    qh_mergeneighbors()
    -
    -  design:
    -    check samecycle
    -    delete neighbors from newfacet that are also in samecycle
    -    for each neighbor of a facet in samecycle
    -      if neighbor is simplicial
    -        if first visit
    -          move the neighbor relation to newfacet
    -          update facet links for its ridges
    -        else
    -          make ridges for neighbor
    -          remove samecycle reference
    -      else
    -        update neighbor sets
    -*/
    -void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet) {
    -  facetT *same, *neighbor, **neighborp;
    -  int delneighbors= 0, newneighbors= 0;
    -  unsigned int samevisitid;
    -  ridgeT *ridge, **ridgep;
    -
    -  samevisitid= ++qh visit_id;
    -  FORALLsame_cycle_(samecycle) {
    -    if (same->visitid == samevisitid || same->visible)
    -      qh_infiniteloop(samecycle);
    -    same->visitid= samevisitid;
    -  }
    -  newfacet->visitid= ++qh visit_id;
    -  trace4((qh ferr, 4031, "qh_mergecycle_neighbors: delete shared neighbors from newfacet\n"));
    -  FOREACHneighbor_(newfacet) {
    -    if (neighbor->visitid == samevisitid) {
    -      SETref_(neighbor)= NULL;  /* samecycle neighbors deleted */
    -      delneighbors++;
    -    }else
    -      neighbor->visitid= qh visit_id;
    -  }
    -  qh_setcompact(newfacet->neighbors);
    -
    -  trace4((qh ferr, 4032, "qh_mergecycle_neighbors: update neighbors\n"));
    -  FORALLsame_cycle_(samecycle) {
    -    FOREACHneighbor_(same) {
    -      if (neighbor->visitid == samevisitid)
    -        continue;
    -      if (neighbor->simplicial) {
    -        if (neighbor->visitid != qh visit_id) {
    -          qh_setappend(&newfacet->neighbors, neighbor);
    -          qh_setreplace(neighbor->neighbors, same, newfacet);
    -          newneighbors++;
    -          neighbor->visitid= qh visit_id;
    -          FOREACHridge_(neighbor->ridges) { /* update ridge in case of qh_makeridges */
    -            if (ridge->top == same) {
    -              ridge->top= newfacet;
    -              break;
    -            }else if (ridge->bottom == same) {
    -              ridge->bottom= newfacet;
    -              break;
    -            }
    -          }
    -        }else {
    -          qh_makeridges(neighbor);
    -          qh_setdel(neighbor->neighbors, same);
    -          /* same can't be horizon facet for neighbor */
    -        }
    -      }else { /* non-simplicial neighbor */
    -        qh_setdel(neighbor->neighbors, same);
    -        if (neighbor->visitid != qh visit_id) {
    -          qh_setappend(&neighbor->neighbors, newfacet);
    -          qh_setappend(&newfacet->neighbors, neighbor);
    -          neighbor->visitid= qh visit_id;
    -          newneighbors++;
    -        }
    -      }
    -    }
    -  }
    -  trace2((qh ferr, 2032, "qh_mergecycle_neighbors: deleted %d neighbors and added %d\n",
    -             delneighbors, newneighbors));
    -} /* mergecycle_neighbors */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle_ridges( samecycle, newfacet )
    -    add ridges/neighbors for facets in samecycle to newfacet
    -    all new/old neighbors of newfacet marked with qh.visit_id
    -    facets in samecycle marked with qh.visit_id-1
    -    newfacet marked with qh.visit_id
    -
    -  returns:
    -    newfacet has merged ridges
    -
    -  notes:
    -    ridge already updated for simplicial neighbors of samecycle with a ridge
    -
    -  see:
    -    qh_mergeridges()
    -    qh_makeridges()
    -
    -  design:
    -    remove ridges between newfacet and samecycle
    -    for each facet in samecycle
    -      for each ridge in facet
    -        update facet pointers in ridge
    -        skip ridges processed in qh_mergecycle_neighors
    -        free ridges between newfacet and samecycle
    -        free ridges between facets of samecycle (on 2nd visit)
    -        append remaining ridges to newfacet
    -      if simpilicial facet
    -        for each neighbor of facet
    -          if simplicial facet
    -          and not samecycle facet or newfacet
    -            make ridge between neighbor and newfacet
    -*/
    -void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet) {
    -  facetT *same, *neighbor= NULL;
    -  int numold=0, numnew=0;
    -  int neighbor_i, neighbor_n;
    -  unsigned int samevisitid;
    -  ridgeT *ridge, **ridgep;
    -  boolT toporient;
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  trace4((qh ferr, 4033, "qh_mergecycle_ridges: delete shared ridges from newfacet\n"));
    -  samevisitid= qh visit_id -1;
    -  FOREACHridge_(newfacet->ridges) {
    -    neighbor= otherfacet_(ridge, newfacet);
    -    if (neighbor->visitid == samevisitid)
    -      SETref_(ridge)= NULL; /* ridge free'd below */
    -  }
    -  qh_setcompact(newfacet->ridges);
    -
    -  trace4((qh ferr, 4034, "qh_mergecycle_ridges: add ridges to newfacet\n"));
    -  FORALLsame_cycle_(samecycle) {
    -    FOREACHridge_(same->ridges) {
    -      if (ridge->top == same) {
    -        ridge->top= newfacet;
    -        neighbor= ridge->bottom;
    -      }else if (ridge->bottom == same) {
    -        ridge->bottom= newfacet;
    -        neighbor= ridge->top;
    -      }else if (ridge->top == newfacet || ridge->bottom == newfacet) {
    -        qh_setappend(&newfacet->ridges, ridge);
    -        numold++;  /* already set by qh_mergecycle_neighbors */
    -        continue;
    -      }else {
    -        qh_fprintf(qh ferr, 6098, "qhull internal error (qh_mergecycle_ridges): bad ridge r%d\n", ridge->id);
    -        qh_errexit(qh_ERRqhull, NULL, ridge);
    -      }
    -      if (neighbor == newfacet) {
    -        qh_setfree(&(ridge->vertices));
    -        qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp);
    -        numold++;
    -      }else if (neighbor->visitid == samevisitid) {
    -        qh_setdel(neighbor->ridges, ridge);
    -        qh_setfree(&(ridge->vertices));
    -        qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp);
    -        numold++;
    -      }else {
    -        qh_setappend(&newfacet->ridges, ridge);
    -        numold++;
    -      }
    -    }
    -    if (same->ridges)
    -      qh_settruncate(same->ridges, 0);
    -    if (!same->simplicial)
    -      continue;
    -    FOREACHneighbor_i_(same) {       /* note: !newfact->simplicial */
    -      if (neighbor->visitid != samevisitid && neighbor->simplicial) {
    -        ridge= qh_newridge();
    -        ridge->vertices= qh_setnew_delnthsorted(same->vertices, qh hull_dim,
    -                                                          neighbor_i, 0);
    -        toporient= same->toporient ^ (neighbor_i & 0x1);
    -        if (toporient) {
    -          ridge->top= newfacet;
    -          ridge->bottom= neighbor;
    -        }else {
    -          ridge->top= neighbor;
    -          ridge->bottom= newfacet;
    -        }
    -        qh_setappend(&(newfacet->ridges), ridge);
    -        qh_setappend(&(neighbor->ridges), ridge);
    -        numnew++;
    -      }
    -    }
    -  }
    -
    -  trace2((qh ferr, 2033, "qh_mergecycle_ridges: found %d old ridges and %d new ones\n",
    -             numold, numnew));
    -} /* mergecycle_ridges */
    -
    -/*---------------------------------
    -
    -  qh_mergecycle_vneighbors( samecycle, newfacet )
    -    create vertex neighbors for newfacet from vertices of facets in samecycle
    -    samecycle marked with visitid == qh.visit_id - 1
    -
    -  returns:
    -    newfacet vertices with updated neighbors
    -    marks newfacet with qh.visit_id-1
    -    deletes vertices that are merged away
    -    sets delridge on all vertices (faster here than in mergecycle_ridges)
    -
    -  see:
    -    qh_mergevertex_neighbors()
    -
    -  design:
    -    for each vertex of samecycle facet
    -      set vertex->delridge
    -      delete samecycle facets from vertex neighbors
    -      append newfacet to vertex neighbors
    -      if vertex only in newfacet
    -        delete it from newfacet
    -        add it to qh.del_vertices for later deletion
    -*/
    -void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet) {
    -  facetT *neighbor, **neighborp;
    -  unsigned int mergeid;
    -  vertexT *vertex, **vertexp, *apex;
    -  setT *vertices;
    -
    -  trace4((qh ferr, 4035, "qh_mergecycle_vneighbors: update vertex neighbors for newfacet\n"));
    -  mergeid= qh visit_id - 1;
    -  newfacet->visitid= mergeid;
    -  vertices= qh_basevertices(samecycle); /* temp */
    -  apex= SETfirstt_(samecycle->vertices, vertexT);
    -  qh_setappend(&vertices, apex);
    -  FOREACHvertex_(vertices) {
    -    vertex->delridge= True;
    -    FOREACHneighbor_(vertex) {
    -      if (neighbor->visitid == mergeid)
    -        SETref_(neighbor)= NULL;
    -    }
    -    qh_setcompact(vertex->neighbors);
    -    qh_setappend(&vertex->neighbors, newfacet);
    -    if (!SETsecond_(vertex->neighbors)) {
    -      zinc_(Zcyclevertex);
    -      trace2((qh ferr, 2034, "qh_mergecycle_vneighbors: deleted v%d when merging cycle f%d into f%d\n",
    -        vertex->id, samecycle->id, newfacet->id));
    -      qh_setdelsorted(newfacet->vertices, vertex);
    -      vertex->deleted= True;
    -      qh_setappend(&qh del_vertices, vertex);
    -    }
    -  }
    -  qh_settempfree(&vertices);
    -  trace3((qh ferr, 3005, "qh_mergecycle_vneighbors: merged vertices from cycle f%d into f%d\n",
    -             samecycle->id, newfacet->id));
    -} /* mergecycle_vneighbors */
    -
    -/*---------------------------------
    -
    -  qh_mergefacet( facet1, facet2, mindist, maxdist, mergeapex )
    -    merges facet1 into facet2
    -    mergeapex==qh_MERGEapex if merging new facet into coplanar horizon
    -
    -  returns:
    -    qh.max_outside and qh.min_vertex updated
    -    initializes vertex neighbors on first merge
    -
    -  returns:
    -    facet2 contains facet1's vertices, neighbors, and ridges
    -      facet2 moved to end of qh.facet_list
    -      makes facet2 a newfacet
    -      sets facet2->newmerge set
    -      clears facet2->center (unless merging into a large facet)
    -      clears facet2->tested and ridge->tested for facet1
    -
    -    facet1 prepended to visible_list for later deletion and partitioning
    -      facet1->f.replace == facet2
    -
    -    adds neighboring facets to facet_mergeset if redundant or degenerate
    -
    -  notes:
    -    mindist/maxdist may be NULL (only if both NULL)
    -    traces merge if fmax_(maxdist,-mindist) > TRACEdist
    -
    -  see:
    -    qh_mergecycle()
    -
    -  design:
    -    trace merge and check for degenerate simplex
    -    make ridges for both facets
    -    update qh.max_outside, qh.max_vertex, qh.min_vertex
    -    update facet2->maxoutside and keepcentrum
    -    update facet2->nummerge
    -    update tested flags for facet2
    -    if facet1 is simplicial
    -      merge facet1 into facet2
    -    else
    -      merge facet1's neighbors into facet2
    -      merge facet1's ridges into facet2
    -      merge facet1's vertices into facet2
    -      merge facet1's vertex neighbors into facet2
    -      add facet2's vertices to qh.new_vertexlist
    -      unless qh_MERGEapex
    -        test facet2 for degenerate or redundant neighbors
    -      move facet1 to qh.visible_list for later deletion
    -      move facet2 to end of qh.newfacet_list
    -*/
    -void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex) {
    -  boolT traceonce= False;
    -  vertexT *vertex, **vertexp;
    -  int tracerestore=0, nummerge;
    -
    -  if (facet1->tricoplanar || facet2->tricoplanar) {
    -    if (!qh TRInormals) {
    -      qh_fprintf(qh ferr, 6226, "Qhull internal error (qh_mergefacet): does not work for tricoplanar facets.  Use option 'Q11'\n");
    -      qh_errexit2 (qh_ERRqhull, facet1, facet2);
    -    }
    -    if (facet2->tricoplanar) {
    -      facet2->tricoplanar= False;
    -      facet2->keepcentrum= False;
    -    }
    -  }
    -  zzinc_(Ztotmerge);
    -  if (qh REPORTfreq2 && qh POSTmerging) {
    -    if (zzval_(Ztotmerge) > qh mergereport + qh REPORTfreq2)
    -      qh_tracemerging();
    -  }
    -#ifndef qh_NOtrace
    -  if (qh build_cnt >= qh RERUN) {
    -    if (mindist && (-*mindist > qh TRACEdist || *maxdist > qh TRACEdist)) {
    -      tracerestore= 0;
    -      qh IStracing= qh TRACElevel;
    -      traceonce= True;
    -      qh_fprintf(qh ferr, 8075, "qh_mergefacet: ========= trace wide merge #%d(%2.2g) for f%d into f%d, last point was p%d\n", zzval_(Ztotmerge),
    -             fmax_(-*mindist, *maxdist), facet1->id, facet2->id, qh furthest_id);
    -    }else if (facet1 == qh tracefacet || facet2 == qh tracefacet) {
    -      tracerestore= qh IStracing;
    -      qh IStracing= 4;
    -      traceonce= True;
    -      qh_fprintf(qh ferr, 8076, "qh_mergefacet: ========= trace merge #%d involving f%d, furthest is p%d\n",
    -                 zzval_(Ztotmerge), qh tracefacet_id,  qh furthest_id);
    -    }
    -  }
    -  if (qh IStracing >= 2) {
    -    realT mergemin= -2;
    -    realT mergemax= -2;
    -
    -    if (mindist) {
    -      mergemin= *mindist;
    -      mergemax= *maxdist;
    -    }
    -    qh_fprintf(qh ferr, 8077, "qh_mergefacet: #%d merge f%d into f%d, mindist= %2.2g, maxdist= %2.2g\n",
    -    zzval_(Ztotmerge), facet1->id, facet2->id, mergemin, mergemax);
    -  }
    -#endif /* !qh_NOtrace */
    -  if (facet1 == facet2 || facet1->visible || facet2->visible) {
    -    qh_fprintf(qh ferr, 6099, "qhull internal error (qh_mergefacet): either f%d and f%d are the same or one is a visible facet\n",
    -             facet1->id, facet2->id);
    -    qh_errexit2 (qh_ERRqhull, facet1, facet2);
    -  }
    -  if (qh num_facets - qh num_visible <= qh hull_dim + 1) {
    -    qh_fprintf(qh ferr, 6227, "\n\
    -qhull precision error: Only %d facets remain.  Can not merge another\n\
    -pair.  The input is too degenerate or the convexity constraints are\n\
    -too strong.\n", qh hull_dim+1);
    -    if (qh hull_dim >= 5 && !qh MERGEexact)
    -      qh_fprintf(qh ferr, 8079, "Option 'Qx' may avoid this problem.\n");
    -    qh_errexit(qh_ERRprec, NULL, NULL);
    -  }
    -  if (!qh VERTEXneighbors)
    -    qh_vertexneighbors();
    -  qh_makeridges(facet1);
    -  qh_makeridges(facet2);
    -  if (qh IStracing >=4)
    -    qh_errprint("MERGING", facet1, facet2, NULL, NULL);
    -  if (mindist) {
    -    maximize_(qh max_outside, *maxdist);
    -    maximize_(qh max_vertex, *maxdist);
    -#if qh_MAXoutside
    -    maximize_(facet2->maxoutside, *maxdist);
    -#endif
    -    minimize_(qh min_vertex, *mindist);
    -    if (!facet2->keepcentrum
    -    && (*maxdist > qh WIDEfacet || *mindist < -qh WIDEfacet)) {
    -      facet2->keepcentrum= True;
    -      zinc_(Zwidefacet);
    -    }
    -  }
    -  nummerge= facet1->nummerge + facet2->nummerge + 1;
    -  if (nummerge >= qh_MAXnummerge)
    -    facet2->nummerge= qh_MAXnummerge;
    -  else
    -    facet2->nummerge= (short unsigned int)nummerge;
    -  facet2->newmerge= True;
    -  facet2->dupridge= False;
    -  qh_updatetested  (facet1, facet2);
    -  if (qh hull_dim > 2 && qh_setsize(facet1->vertices) == qh hull_dim)
    -    qh_mergesimplex(facet1, facet2, mergeapex);
    -  else {
    -    qh vertex_visit++;
    -    FOREACHvertex_(facet2->vertices)
    -      vertex->visitid= qh vertex_visit;
    -    if (qh hull_dim == 2)
    -      qh_mergefacet2d(facet1, facet2);
    -    else {
    -      qh_mergeneighbors(facet1, facet2);
    -      qh_mergevertices(facet1->vertices, &facet2->vertices);
    -    }
    -    qh_mergeridges(facet1, facet2);
    -    qh_mergevertex_neighbors(facet1, facet2);
    -    if (!facet2->newfacet)
    -      qh_newvertices(facet2->vertices);
    -  }
    -  if (!mergeapex)
    -    qh_degen_redundant_neighbors(facet2, facet1);
    -  if (facet2->coplanar || !facet2->newfacet) {
    -    zinc_(Zmergeintohorizon);
    -  }else if (!facet1->newfacet && facet2->newfacet) {
    -    zinc_(Zmergehorizon);
    -  }else {
    -    zinc_(Zmergenew);
    -  }
    -  qh_willdelete(facet1, facet2);
    -  qh_removefacet(facet2);  /* append as a newfacet to end of qh facet_list */
    -  qh_appendfacet(facet2);
    -  facet2->newfacet= True;
    -  facet2->tested= False;
    -  qh_tracemerge(facet1, facet2);
    -  if (traceonce) {
    -    qh_fprintf(qh ferr, 8080, "qh_mergefacet: end of wide tracing\n");
    -    qh IStracing= tracerestore;
    -  }
    -} /* mergefacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_mergefacet2d( facet1, facet2 )
    -    in 2d, merges neighbors and vertices of facet1 into facet2
    -
    -  returns:
    -    build ridges for neighbors if necessary
    -    facet2 looks like a simplicial facet except for centrum, ridges
    -      neighbors are opposite the corresponding vertex
    -      maintains orientation of facet2
    -
    -  notes:
    -    qh_mergefacet() retains non-simplicial structures
    -      they are not needed in 2d, but later routines may use them
    -    preserves qh.vertex_visit for qh_mergevertex_neighbors()
    -
    -  design:
    -    get vertices and neighbors
    -    determine new vertices and neighbors
    -    set new vertices and neighbors and adjust orientation
    -    make ridges for new neighbor if needed
    -*/
    -void qh_mergefacet2d(facetT *facet1, facetT *facet2) {
    -  vertexT *vertex1A, *vertex1B, *vertex2A, *vertex2B, *vertexA, *vertexB;
    -  facetT *neighbor1A, *neighbor1B, *neighbor2A, *neighbor2B, *neighborA, *neighborB;
    -
    -  vertex1A= SETfirstt_(facet1->vertices, vertexT);
    -  vertex1B= SETsecondt_(facet1->vertices, vertexT);
    -  vertex2A= SETfirstt_(facet2->vertices, vertexT);
    -  vertex2B= SETsecondt_(facet2->vertices, vertexT);
    -  neighbor1A= SETfirstt_(facet1->neighbors, facetT);
    -  neighbor1B= SETsecondt_(facet1->neighbors, facetT);
    -  neighbor2A= SETfirstt_(facet2->neighbors, facetT);
    -  neighbor2B= SETsecondt_(facet2->neighbors, facetT);
    -  if (vertex1A == vertex2A) {
    -    vertexA= vertex1B;
    -    vertexB= vertex2B;
    -    neighborA= neighbor2A;
    -    neighborB= neighbor1A;
    -  }else if (vertex1A == vertex2B) {
    -    vertexA= vertex1B;
    -    vertexB= vertex2A;
    -    neighborA= neighbor2B;
    -    neighborB= neighbor1A;
    -  }else if (vertex1B == vertex2A) {
    -    vertexA= vertex1A;
    -    vertexB= vertex2B;
    -    neighborA= neighbor2A;
    -    neighborB= neighbor1B;
    -  }else { /* 1B == 2B */
    -    vertexA= vertex1A;
    -    vertexB= vertex2A;
    -    neighborA= neighbor2B;
    -    neighborB= neighbor1B;
    -  }
    -  /* vertexB always from facet2, neighborB always from facet1 */
    -  if (vertexA->id > vertexB->id) {
    -    SETfirst_(facet2->vertices)= vertexA;
    -    SETsecond_(facet2->vertices)= vertexB;
    -    if (vertexB == vertex2A)
    -      facet2->toporient= !facet2->toporient;
    -    SETfirst_(facet2->neighbors)= neighborA;
    -    SETsecond_(facet2->neighbors)= neighborB;
    -  }else {
    -    SETfirst_(facet2->vertices)= vertexB;
    -    SETsecond_(facet2->vertices)= vertexA;
    -    if (vertexB == vertex2B)
    -      facet2->toporient= !facet2->toporient;
    -    SETfirst_(facet2->neighbors)= neighborB;
    -    SETsecond_(facet2->neighbors)= neighborA;
    -  }
    -  qh_makeridges(neighborB);
    -  qh_setreplace(neighborB->neighbors, facet1, facet2);
    -  trace4((qh ferr, 4036, "qh_mergefacet2d: merged v%d and neighbor f%d of f%d into f%d\n",
    -       vertexA->id, neighborB->id, facet1->id, facet2->id));
    -} /* mergefacet2d */
    -
    -
    -/*---------------------------------
    -
    -  qh_mergeneighbors( facet1, facet2 )
    -    merges the neighbors of facet1 into facet2
    -
    -  see:
    -    qh_mergecycle_neighbors()
    -
    -  design:
    -    for each neighbor of facet1
    -      if neighbor is also a neighbor of facet2
    -        if neighbor is simpilicial
    -          make ridges for later deletion as a degenerate facet
    -        update its neighbor set
    -      else
    -        move the neighbor relation to facet2
    -    remove the neighbor relation for facet1 and facet2
    -*/
    -void qh_mergeneighbors(facetT *facet1, facetT *facet2) {
    -  facetT *neighbor, **neighborp;
    -
    -  trace4((qh ferr, 4037, "qh_mergeneighbors: merge neighbors of f%d and f%d\n",
    -          facet1->id, facet2->id));
    -  qh visit_id++;
    -  FOREACHneighbor_(facet2) {
    -    neighbor->visitid= qh visit_id;
    -  }
    -  FOREACHneighbor_(facet1) {
    -    if (neighbor->visitid == qh visit_id) {
    -      if (neighbor->simplicial)    /* is degen, needs ridges */
    -        qh_makeridges(neighbor);
    -      if (SETfirstt_(neighbor->neighbors, facetT) != facet1) /*keep newfacet->horizon*/
    -        qh_setdel(neighbor->neighbors, facet1);
    -      else {
    -        qh_setdel(neighbor->neighbors, facet2);
    -        qh_setreplace(neighbor->neighbors, facet1, facet2);
    -      }
    -    }else if (neighbor != facet2) {
    -      qh_setappend(&(facet2->neighbors), neighbor);
    -      qh_setreplace(neighbor->neighbors, facet1, facet2);
    -    }
    -  }
    -  qh_setdel(facet1->neighbors, facet2);  /* here for makeridges */
    -  qh_setdel(facet2->neighbors, facet1);
    -} /* mergeneighbors */
    -
    -
    -/*---------------------------------
    -
    -  qh_mergeridges( facet1, facet2 )
    -    merges the ridge set of facet1 into facet2
    -
    -  returns:
    -    may delete all ridges for a vertex
    -    sets vertex->delridge on deleted ridges
    -
    -  see:
    -    qh_mergecycle_ridges()
    -
    -  design:
    -    delete ridges between facet1 and facet2
    -      mark (delridge) vertices on these ridges for later testing
    -    for each remaining ridge
    -      rename facet1 to facet2
    -*/
    -void qh_mergeridges(facetT *facet1, facetT *facet2) {
    -  ridgeT *ridge, **ridgep;
    -  vertexT *vertex, **vertexp;
    -
    -  trace4((qh ferr, 4038, "qh_mergeridges: merge ridges of f%d and f%d\n",
    -          facet1->id, facet2->id));
    -  FOREACHridge_(facet2->ridges) {
    -    if ((ridge->top == facet1) || (ridge->bottom == facet1)) {
    -      FOREACHvertex_(ridge->vertices)
    -        vertex->delridge= True;
    -      qh_delridge(ridge);  /* expensive in high-d, could rebuild */
    -      ridgep--; /*repeat*/
    -    }
    -  }
    -  FOREACHridge_(facet1->ridges) {
    -    if (ridge->top == facet1)
    -      ridge->top= facet2;
    -    else
    -      ridge->bottom= facet2;
    -    qh_setappend(&(facet2->ridges), ridge);
    -  }
    -} /* mergeridges */
    -
    -
    -/*---------------------------------
    -
    -  qh_mergesimplex( facet1, facet2, mergeapex )
    -    merge simplicial facet1 into facet2
    -    mergeapex==qh_MERGEapex if merging samecycle into horizon facet
    -      vertex id is latest (most recently created)
    -    facet1 may be contained in facet2
    -    ridges exist for both facets
    -
    -  returns:
    -    facet2 with updated vertices, ridges, neighbors
    -    updated neighbors for facet1's vertices
    -    facet1 not deleted
    -    sets vertex->delridge on deleted ridges
    -
    -  notes:
    -    special case code since this is the most common merge
    -    called from qh_mergefacet()
    -
    -  design:
    -    if qh_MERGEapex
    -      add vertices of facet2 to qh.new_vertexlist if necessary
    -      add apex to facet2
    -    else
    -      for each ridge between facet1 and facet2
    -        set vertex->delridge
    -      determine the apex for facet1 (i.e., vertex to be merged)
    -      unless apex already in facet2
    -        insert apex into vertices for facet2
    -      add vertices of facet2 to qh.new_vertexlist if necessary
    -      add apex to qh.new_vertexlist if necessary
    -      for each vertex of facet1
    -        if apex
    -          rename facet1 to facet2 in its vertex neighbors
    -        else
    -          delete facet1 from vertex neighors
    -          if only in facet2
    -            add vertex to qh.del_vertices for later deletion
    -      for each ridge of facet1
    -        delete ridges between facet1 and facet2
    -        append other ridges to facet2 after renaming facet to facet2
    -*/
    -void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex) {
    -  vertexT *vertex, **vertexp, *apex;
    -  ridgeT *ridge, **ridgep;
    -  boolT issubset= False;
    -  int vertex_i= -1, vertex_n;
    -  facetT *neighbor, **neighborp, *otherfacet;
    -
    -  if (mergeapex) {
    -    if (!facet2->newfacet)
    -      qh_newvertices(facet2->vertices);  /* apex is new */
    -    apex= SETfirstt_(facet1->vertices, vertexT);
    -    if (SETfirstt_(facet2->vertices, vertexT) != apex)
    -      qh_setaddnth(&facet2->vertices, 0, apex);  /* apex has last id */
    -    else
    -      issubset= True;
    -  }else {
    -    zinc_(Zmergesimplex);
    -    FOREACHvertex_(facet1->vertices)
    -      vertex->seen= False;
    -    FOREACHridge_(facet1->ridges) {
    -      if (otherfacet_(ridge, facet1) == facet2) {
    -        FOREACHvertex_(ridge->vertices) {
    -          vertex->seen= True;
    -          vertex->delridge= True;
    -        }
    -        break;
    -      }
    -    }
    -    FOREACHvertex_(facet1->vertices) {
    -      if (!vertex->seen)
    -        break;  /* must occur */
    -    }
    -    apex= vertex;
    -    trace4((qh ferr, 4039, "qh_mergesimplex: merge apex v%d of f%d into facet f%d\n",
    -          apex->id, facet1->id, facet2->id));
    -    FOREACHvertex_i_(facet2->vertices) {
    -      if (vertex->id < apex->id) {
    -        break;
    -      }else if (vertex->id == apex->id) {
    -        issubset= True;
    -        break;
    -      }
    -    }
    -    if (!issubset)
    -      qh_setaddnth(&facet2->vertices, vertex_i, apex);
    -    if (!facet2->newfacet)
    -      qh_newvertices(facet2->vertices);
    -    else if (!apex->newlist) {
    -      qh_removevertex(apex);
    -      qh_appendvertex(apex);
    -    }
    -  }
    -  trace4((qh ferr, 4040, "qh_mergesimplex: update vertex neighbors of f%d\n",
    -          facet1->id));
    -  FOREACHvertex_(facet1->vertices) {
    -    if (vertex == apex && !issubset)
    -      qh_setreplace(vertex->neighbors, facet1, facet2);
    -    else {
    -      qh_setdel(vertex->neighbors, facet1);
    -      if (!SETsecond_(vertex->neighbors))
    -        qh_mergevertex_del(vertex, facet1, facet2);
    -    }
    -  }
    -  trace4((qh ferr, 4041, "qh_mergesimplex: merge ridges and neighbors of f%d into f%d\n",
    -          facet1->id, facet2->id));
    -  qh visit_id++;
    -  FOREACHneighbor_(facet2)
    -    neighbor->visitid= qh visit_id;
    -  FOREACHridge_(facet1->ridges) {
    -    otherfacet= otherfacet_(ridge, facet1);
    -    if (otherfacet == facet2) {
    -      qh_setdel(facet2->ridges, ridge);
    -      qh_setfree(&(ridge->vertices));
    -      qh_memfree(ridge, (int)sizeof(ridgeT));
    -      qh_setdel(facet2->neighbors, facet1);
    -    }else {
    -      qh_setappend(&facet2->ridges, ridge);
    -      if (otherfacet->visitid != qh visit_id) {
    -        qh_setappend(&facet2->neighbors, otherfacet);
    -        qh_setreplace(otherfacet->neighbors, facet1, facet2);
    -        otherfacet->visitid= qh visit_id;
    -      }else {
    -        if (otherfacet->simplicial)    /* is degen, needs ridges */
    -          qh_makeridges(otherfacet);
    -        if (SETfirstt_(otherfacet->neighbors, facetT) != facet1)
    -          qh_setdel(otherfacet->neighbors, facet1);
    -        else {   /*keep newfacet->neighbors->horizon*/
    -          qh_setdel(otherfacet->neighbors, facet2);
    -          qh_setreplace(otherfacet->neighbors, facet1, facet2);
    -        }
    -      }
    -      if (ridge->top == facet1) /* wait until after qh_makeridges */
    -        ridge->top= facet2;
    -      else
    -        ridge->bottom= facet2;
    -    }
    -  }
    -  SETfirst_(facet1->ridges)= NULL; /* it will be deleted */
    -  trace3((qh ferr, 3006, "qh_mergesimplex: merged simplex f%d apex v%d into facet f%d\n",
    -          facet1->id, getid_(apex), facet2->id));
    -} /* mergesimplex */
    -
    -/*---------------------------------
    -
    -  qh_mergevertex_del( vertex, facet1, facet2 )
    -    delete a vertex because of merging facet1 into facet2
    -
    -  returns:
    -    deletes vertex from facet2
    -    adds vertex to qh.del_vertices for later deletion
    -*/
    -void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2) {
    -
    -  zinc_(Zmergevertex);
    -  trace2((qh ferr, 2035, "qh_mergevertex_del: deleted v%d when merging f%d into f%d\n",
    -          vertex->id, facet1->id, facet2->id));
    -  qh_setdelsorted(facet2->vertices, vertex);
    -  vertex->deleted= True;
    -  qh_setappend(&qh del_vertices, vertex);
    -} /* mergevertex_del */
    -
    -/*---------------------------------
    -
    -  qh_mergevertex_neighbors( facet1, facet2 )
    -    merge the vertex neighbors of facet1 to facet2
    -
    -  returns:
    -    if vertex is current qh.vertex_visit
    -      deletes facet1 from vertex->neighbors
    -    else
    -      renames facet1 to facet2 in vertex->neighbors
    -    deletes vertices if only one neighbor
    -
    -  notes:
    -    assumes vertex neighbor sets are good
    -*/
    -void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2) {
    -  vertexT *vertex, **vertexp;
    -
    -  trace4((qh ferr, 4042, "qh_mergevertex_neighbors: merge vertex neighbors of f%d and f%d\n",
    -          facet1->id, facet2->id));
    -  if (qh tracevertex) {
    -    qh_fprintf(qh ferr, 8081, "qh_mergevertex_neighbors: of f%d and f%d at furthest p%d f0= %p\n",
    -             facet1->id, facet2->id, qh furthest_id, qh tracevertex->neighbors->e[0].p);
    -    qh_errprint("TRACE", NULL, NULL, NULL, qh tracevertex);
    -  }
    -  FOREACHvertex_(facet1->vertices) {
    -    if (vertex->visitid != qh vertex_visit)
    -      qh_setreplace(vertex->neighbors, facet1, facet2);
    -    else {
    -      qh_setdel(vertex->neighbors, facet1);
    -      if (!SETsecond_(vertex->neighbors))
    -        qh_mergevertex_del(vertex, facet1, facet2);
    -    }
    -  }
    -  if (qh tracevertex)
    -    qh_errprint("TRACE", NULL, NULL, NULL, qh tracevertex);
    -} /* mergevertex_neighbors */
    -
    -
    -/*---------------------------------
    -
    -  qh_mergevertices( vertices1, vertices2 )
    -    merges the vertex set of facet1 into facet2
    -
    -  returns:
    -    replaces vertices2 with merged set
    -    preserves vertex_visit for qh_mergevertex_neighbors
    -    updates qh.newvertex_list
    -
    -  design:
    -    create a merged set of both vertices (in inverse id order)
    -*/
    -void qh_mergevertices(setT *vertices1, setT **vertices2) {
    -  int newsize= qh_setsize(vertices1)+qh_setsize(*vertices2) - qh hull_dim + 1;
    -  setT *mergedvertices;
    -  vertexT *vertex, **vertexp, **vertex2= SETaddr_(*vertices2, vertexT);
    -
    -  mergedvertices= qh_settemp(newsize);
    -  FOREACHvertex_(vertices1) {
    -    if (!*vertex2 || vertex->id > (*vertex2)->id)
    -      qh_setappend(&mergedvertices, vertex);
    -    else {
    -      while (*vertex2 && (*vertex2)->id > vertex->id)
    -        qh_setappend(&mergedvertices, *vertex2++);
    -      if (!*vertex2 || (*vertex2)->id < vertex->id)
    -        qh_setappend(&mergedvertices, vertex);
    -      else
    -        qh_setappend(&mergedvertices, *vertex2++);
    -    }
    -  }
    -  while (*vertex2)
    -    qh_setappend(&mergedvertices, *vertex2++);
    -  if (newsize < qh_setsize(mergedvertices)) {
    -    qh_fprintf(qh ferr, 6100, "qhull internal error (qh_mergevertices): facets did not share a ridge\n");
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  qh_setfree(vertices2);
    -  *vertices2= mergedvertices;
    -  qh_settemppop();
    -} /* mergevertices */
    -
    -
    -/*---------------------------------
    -
    -  qh_neighbor_intersections( vertex )
    -    return intersection of all vertices in vertex->neighbors except for vertex
    -
    -  returns:
    -    returns temporary set of vertices
    -    does not include vertex
    -    NULL if a neighbor is simplicial
    -    NULL if empty set
    -
    -  notes:
    -    used for renaming vertices
    -
    -  design:
    -    initialize the intersection set with vertices of the first two neighbors
    -    delete vertex from the intersection
    -    for each remaining neighbor
    -      intersect its vertex set with the intersection set
    -      return NULL if empty
    -    return the intersection set
    -*/
    -setT *qh_neighbor_intersections(vertexT *vertex) {
    -  facetT *neighbor, **neighborp, *neighborA, *neighborB;
    -  setT *intersect;
    -  int neighbor_i, neighbor_n;
    -
    -  FOREACHneighbor_(vertex) {
    -    if (neighbor->simplicial)
    -      return NULL;
    -  }
    -  neighborA= SETfirstt_(vertex->neighbors, facetT);
    -  neighborB= SETsecondt_(vertex->neighbors, facetT);
    -  zinc_(Zintersectnum);
    -  if (!neighborA)
    -    return NULL;
    -  if (!neighborB)
    -    intersect= qh_setcopy(neighborA->vertices, 0);
    -  else
    -    intersect= qh_vertexintersect_new(neighborA->vertices, neighborB->vertices);
    -  qh_settemppush(intersect);
    -  qh_setdelsorted(intersect, vertex);
    -  FOREACHneighbor_i_(vertex) {
    -    if (neighbor_i >= 2) {
    -      zinc_(Zintersectnum);
    -      qh_vertexintersect(&intersect, neighbor->vertices);
    -      if (!SETfirst_(intersect)) {
    -        zinc_(Zintersectfail);
    -        qh_settempfree(&intersect);
    -        return NULL;
    -      }
    -    }
    -  }
    -  trace3((qh ferr, 3007, "qh_neighbor_intersections: %d vertices in neighbor intersection of v%d\n",
    -          qh_setsize(intersect), vertex->id));
    -  return intersect;
    -} /* neighbor_intersections */
    -
    -/*---------------------------------
    -
    -  qh_newvertices( vertices )
    -    add vertices to end of qh.vertex_list (marks as new vertices)
    -
    -  returns:
    -    vertices on qh.newvertex_list
    -    vertex->newlist set
    -*/
    -void qh_newvertices(setT *vertices) {
    -  vertexT *vertex, **vertexp;
    -
    -  FOREACHvertex_(vertices) {
    -    if (!vertex->newlist) {
    -      qh_removevertex(vertex);
    -      qh_appendvertex(vertex);
    -    }
    -  }
    -} /* newvertices */
    -
    -/*---------------------------------
    -
    -  qh_reducevertices()
    -    reduce extra vertices, shared vertices, and redundant vertices
    -    facet->newmerge is set if merged since last call
    -    if !qh.MERGEvertices, only removes extra vertices
    -
    -  returns:
    -    True if also merged degen_redundant facets
    -    vertices are renamed if possible
    -    clears facet->newmerge and vertex->delridge
    -
    -  notes:
    -    ignored if 2-d
    -
    -  design:
    -    merge any degenerate or redundant facets
    -    for each newly merged facet
    -      remove extra vertices
    -    if qh.MERGEvertices
    -      for each newly merged facet
    -        for each vertex
    -          if vertex was on a deleted ridge
    -            rename vertex if it is shared
    -      remove delridge flag from new vertices
    -*/
    -boolT qh_reducevertices(void) {
    -  int numshare=0, numrename= 0;
    -  boolT degenredun= False;
    -  facetT *newfacet;
    -  vertexT *vertex, **vertexp;
    -
    -  if (qh hull_dim == 2)
    -    return False;
    -  if (qh_merge_degenredundant())
    -    degenredun= True;
    - LABELrestart:
    -  FORALLnew_facets {
    -    if (newfacet->newmerge) {
    -      if (!qh MERGEvertices)
    -        newfacet->newmerge= False;
    -      qh_remove_extravertices(newfacet);
    -    }
    -  }
    -  if (!qh MERGEvertices)
    -    return False;
    -  FORALLnew_facets {
    -    if (newfacet->newmerge) {
    -      newfacet->newmerge= False;
    -      FOREACHvertex_(newfacet->vertices) {
    -        if (vertex->delridge) {
    -          if (qh_rename_sharedvertex(vertex, newfacet)) {
    -            numshare++;
    -            vertexp--; /* repeat since deleted vertex */
    -          }
    -        }
    -      }
    -    }
    -  }
    -  FORALLvertex_(qh newvertex_list) {
    -    if (vertex->delridge && !vertex->deleted) {
    -      vertex->delridge= False;
    -      if (qh hull_dim >= 4 && qh_redundant_vertex(vertex)) {
    -        numrename++;
    -        if (qh_merge_degenredundant()) {
    -          degenredun= True;
    -          goto LABELrestart;
    -        }
    -      }
    -    }
    -  }
    -  trace1((qh ferr, 1014, "qh_reducevertices: renamed %d shared vertices and %d redundant vertices. Degen? %d\n",
    -          numshare, numrename, degenredun));
    -  return degenredun;
    -} /* reducevertices */
    -
    -/*---------------------------------
    -
    -  qh_redundant_vertex( vertex )
    -    detect and rename a redundant vertex
    -    vertices have full vertex->neighbors
    -
    -  returns:
    -    returns true if find a redundant vertex
    -      deletes vertex(vertex->deleted)
    -
    -  notes:
    -    only needed if vertex->delridge and hull_dim >= 4
    -    may add degenerate facets to qh.facet_mergeset
    -    doesn't change vertex->neighbors or create redundant facets
    -
    -  design:
    -    intersect vertices of all facet neighbors of vertex
    -    determine ridges for these vertices
    -    if find a new vertex for vertex amoung these ridges and vertices
    -      rename vertex to the new vertex
    -*/
    -vertexT *qh_redundant_vertex(vertexT *vertex) {
    -  vertexT *newvertex= NULL;
    -  setT *vertices, *ridges;
    -
    -  trace3((qh ferr, 3008, "qh_redundant_vertex: check if v%d can be renamed\n", vertex->id));
    -  if ((vertices= qh_neighbor_intersections(vertex))) {
    -    ridges= qh_vertexridges(vertex);
    -    if ((newvertex= qh_find_newvertex(vertex, vertices, ridges)))
    -      qh_renamevertex(vertex, newvertex, ridges, NULL, NULL);
    -    qh_settempfree(&ridges);
    -    qh_settempfree(&vertices);
    -  }
    -  return newvertex;
    -} /* redundant_vertex */
    -
    -/*---------------------------------
    -
    -  qh_remove_extravertices( facet )
    -    remove extra vertices from non-simplicial facets
    -
    -  returns:
    -    returns True if it finds them
    -
    -  design:
    -    for each vertex in facet
    -      if vertex not in a ridge (i.e., no longer used)
    -        delete vertex from facet
    -        delete facet from vertice's neighbors
    -        unless vertex in another facet
    -          add vertex to qh.del_vertices for later deletion
    -*/
    -boolT qh_remove_extravertices(facetT *facet) {
    -  ridgeT *ridge, **ridgep;
    -  vertexT *vertex, **vertexp;
    -  boolT foundrem= False;
    -
    -  trace4((qh ferr, 4043, "qh_remove_extravertices: test f%d for extra vertices\n",
    -          facet->id));
    -  FOREACHvertex_(facet->vertices)
    -    vertex->seen= False;
    -  FOREACHridge_(facet->ridges) {
    -    FOREACHvertex_(ridge->vertices)
    -      vertex->seen= True;
    -  }
    -  FOREACHvertex_(facet->vertices) {
    -    if (!vertex->seen) {
    -      foundrem= True;
    -      zinc_(Zremvertex);
    -      qh_setdelsorted(facet->vertices, vertex);
    -      qh_setdel(vertex->neighbors, facet);
    -      if (!qh_setsize(vertex->neighbors)) {
    -        vertex->deleted= True;
    -        qh_setappend(&qh del_vertices, vertex);
    -        zinc_(Zremvertexdel);
    -        trace2((qh ferr, 2036, "qh_remove_extravertices: v%d deleted because it's lost all ridges\n", vertex->id));
    -      }else
    -        trace3((qh ferr, 3009, "qh_remove_extravertices: v%d removed from f%d because it's lost all ridges\n", vertex->id, facet->id));
    -      vertexp--; /*repeat*/
    -    }
    -  }
    -  return foundrem;
    -} /* remove_extravertices */
    -
    -/*---------------------------------
    -
    -  qh_rename_sharedvertex( vertex, facet )
    -    detect and rename if shared vertex in facet
    -    vertices have full ->neighbors
    -
    -  returns:
    -    newvertex or NULL
    -    the vertex may still exist in other facets (i.e., a neighbor was pinched)
    -    does not change facet->neighbors
    -    updates vertex->neighbors
    -
    -  notes:
    -    a shared vertex for a facet is only in ridges to one neighbor
    -    this may undo a pinched facet
    -
    -    it does not catch pinches involving multiple facets.  These appear
    -      to be difficult to detect, since an exhaustive search is too expensive.
    -
    -  design:
    -    if vertex only has two neighbors
    -      determine the ridges that contain the vertex
    -      determine the vertices shared by both neighbors
    -      if can find a new vertex in this set
    -        rename the vertex to the new vertex
    -*/
    -vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet) {
    -  facetT *neighbor, **neighborp, *neighborA= NULL;
    -  setT *vertices, *ridges;
    -  vertexT *newvertex;
    -
    -  if (qh_setsize(vertex->neighbors) == 2) {
    -    neighborA= SETfirstt_(vertex->neighbors, facetT);
    -    if (neighborA == facet)
    -      neighborA= SETsecondt_(vertex->neighbors, facetT);
    -  }else if (qh hull_dim == 3)
    -    return NULL;
    -  else {
    -    qh visit_id++;
    -    FOREACHneighbor_(facet)
    -      neighbor->visitid= qh visit_id;
    -    FOREACHneighbor_(vertex) {
    -      if (neighbor->visitid == qh visit_id) {
    -        if (neighborA)
    -          return NULL;
    -        neighborA= neighbor;
    -      }
    -    }
    -    if (!neighborA) {
    -      qh_fprintf(qh ferr, 6101, "qhull internal error (qh_rename_sharedvertex): v%d's neighbors not in f%d\n",
    -        vertex->id, facet->id);
    -      qh_errprint("ERRONEOUS", facet, NULL, NULL, vertex);
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -    }
    -  }
    -  /* the vertex is shared by facet and neighborA */
    -  ridges= qh_settemp(qh TEMPsize);
    -  neighborA->visitid= ++qh visit_id;
    -  qh_vertexridges_facet(vertex, facet, &ridges);
    -  trace2((qh ferr, 2037, "qh_rename_sharedvertex: p%d(v%d) is shared by f%d(%d ridges) and f%d\n",
    -    qh_pointid(vertex->point), vertex->id, facet->id, qh_setsize(ridges), neighborA->id));
    -  zinc_(Zintersectnum);
    -  vertices= qh_vertexintersect_new(facet->vertices, neighborA->vertices);
    -  qh_setdel(vertices, vertex);
    -  qh_settemppush(vertices);
    -  if ((newvertex= qh_find_newvertex(vertex, vertices, ridges)))
    -    qh_renamevertex(vertex, newvertex, ridges, facet, neighborA);
    -  qh_settempfree(&vertices);
    -  qh_settempfree(&ridges);
    -  return newvertex;
    -} /* rename_sharedvertex */
    -
    -/*---------------------------------
    -
    -  qh_renameridgevertex( ridge, oldvertex, newvertex )
    -    renames oldvertex as newvertex in ridge
    -
    -  returns:
    -
    -  design:
    -    delete oldvertex from ridge
    -    if newvertex already in ridge
    -      copy ridge->noconvex to another ridge if possible
    -      delete the ridge
    -    else
    -      insert newvertex into the ridge
    -      adjust the ridge's orientation
    -*/
    -void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex) {
    -  int nth= 0, oldnth;
    -  facetT *temp;
    -  vertexT *vertex, **vertexp;
    -
    -  oldnth= qh_setindex(ridge->vertices, oldvertex);
    -  qh_setdelnthsorted(ridge->vertices, oldnth);
    -  FOREACHvertex_(ridge->vertices) {
    -    if (vertex == newvertex) {
    -      zinc_(Zdelridge);
    -      if (ridge->nonconvex) /* only one ridge has nonconvex set */
    -        qh_copynonconvex(ridge);
    -      qh_delridge(ridge);
    -      trace2((qh ferr, 2038, "qh_renameridgevertex: ridge r%d deleted.  It contained both v%d and v%d\n",
    -        ridge->id, oldvertex->id, newvertex->id));
    -      return;
    -    }
    -    if (vertex->id < newvertex->id)
    -      break;
    -    nth++;
    -  }
    -  qh_setaddnth(&ridge->vertices, nth, newvertex);
    -  if (abs(oldnth - nth)%2) {
    -    trace3((qh ferr, 3010, "qh_renameridgevertex: swapped the top and bottom of ridge r%d\n",
    -            ridge->id));
    -    temp= ridge->top;
    -    ridge->top= ridge->bottom;
    -    ridge->bottom= temp;
    -  }
    -} /* renameridgevertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_renamevertex( oldvertex, newvertex, ridges, oldfacet, neighborA )
    -    renames oldvertex as newvertex in ridges
    -    gives oldfacet/neighborA if oldvertex is shared between two facets
    -
    -  returns:
    -    oldvertex may still exist afterwards
    -
    -
    -  notes:
    -    can not change neighbors of newvertex (since it's a subset)
    -
    -  design:
    -    for each ridge in ridges
    -      rename oldvertex to newvertex and delete degenerate ridges
    -    if oldfacet not defined
    -      for each neighbor of oldvertex
    -        delete oldvertex from neighbor's vertices
    -        remove extra vertices from neighbor
    -      add oldvertex to qh.del_vertices
    -    else if oldvertex only between oldfacet and neighborA
    -      delete oldvertex from oldfacet and neighborA
    -      add oldvertex to qh.del_vertices
    -    else oldvertex is in oldfacet and neighborA and other facets (i.e., pinched)
    -      delete oldvertex from oldfacet
    -      delete oldfacet from oldvertice's neighbors
    -      remove extra vertices (e.g., oldvertex) from neighborA
    -*/
    -void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facetT *oldfacet, facetT *neighborA) {
    -  facetT *neighbor, **neighborp;
    -  ridgeT *ridge, **ridgep;
    -  boolT istrace= False;
    -
    -  if (qh IStracing >= 2 || oldvertex->id == qh tracevertex_id ||
    -        newvertex->id == qh tracevertex_id)
    -    istrace= True;
    -  FOREACHridge_(ridges)
    -    qh_renameridgevertex(ridge, oldvertex, newvertex);
    -  if (!oldfacet) {
    -    zinc_(Zrenameall);
    -    if (istrace)
    -      qh_fprintf(qh ferr, 8082, "qh_renamevertex: renamed v%d to v%d in several facets\n",
    -               oldvertex->id, newvertex->id);
    -    FOREACHneighbor_(oldvertex) {
    -      qh_maydropneighbor(neighbor);
    -      qh_setdelsorted(neighbor->vertices, oldvertex);
    -      if (qh_remove_extravertices(neighbor))
    -        neighborp--; /* neighbor may be deleted */
    -    }
    -    if (!oldvertex->deleted) {
    -      oldvertex->deleted= True;
    -      qh_setappend(&qh del_vertices, oldvertex);
    -    }
    -  }else if (qh_setsize(oldvertex->neighbors) == 2) {
    -    zinc_(Zrenameshare);
    -    if (istrace)
    -      qh_fprintf(qh ferr, 8083, "qh_renamevertex: renamed v%d to v%d in oldfacet f%d\n",
    -               oldvertex->id, newvertex->id, oldfacet->id);
    -    FOREACHneighbor_(oldvertex)
    -      qh_setdelsorted(neighbor->vertices, oldvertex);
    -    oldvertex->deleted= True;
    -    qh_setappend(&qh del_vertices, oldvertex);
    -  }else {
    -    zinc_(Zrenamepinch);
    -    if (istrace || qh IStracing)
    -      qh_fprintf(qh ferr, 8084, "qh_renamevertex: renamed pinched v%d to v%d between f%d and f%d\n",
    -               oldvertex->id, newvertex->id, oldfacet->id, neighborA->id);
    -    qh_setdelsorted(oldfacet->vertices, oldvertex);
    -    qh_setdel(oldvertex->neighbors, oldfacet);
    -    qh_remove_extravertices(neighborA);
    -  }
    -} /* renamevertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_test_appendmerge( facet, neighbor )
    -    tests facet/neighbor for convexity
    -    appends to mergeset if non-convex
    -    if pre-merging,
    -      nop if qh.SKIPconvex, or qh.MERGEexact and coplanar
    -
    -  returns:
    -    true if appends facet/neighbor to mergeset
    -    sets facet->center as needed
    -    does not change facet->seen
    -
    -  design:
    -    if qh.cos_max is defined
    -      if the angle between facet normals is too shallow
    -        append an angle-coplanar merge to qh.mergeset
    -        return True
    -    make facet's centrum if needed
    -    if facet's centrum is above the neighbor
    -      set isconcave
    -    else
    -      if facet's centrum is not below the neighbor
    -        set iscoplanar
    -      make neighbor's centrum if needed
    -      if neighbor's centrum is above the facet
    -        set isconcave
    -      else if neighbor's centrum is not below the facet
    -        set iscoplanar
    -   if isconcave or iscoplanar
    -     get angle if needed
    -     append concave or coplanar merge to qh.mergeset
    -*/
    -boolT qh_test_appendmerge(facetT *facet, facetT *neighbor) {
    -  realT dist, dist2= -REALmax, angle= -REALmax;
    -  boolT isconcave= False, iscoplanar= False, okangle= False;
    -
    -  if (qh SKIPconvex && !qh POSTmerging)
    -    return False;
    -  if ((!qh MERGEexact || qh POSTmerging) && qh cos_max < REALmax/2) {
    -    angle= qh_getangle(facet->normal, neighbor->normal);
    -    zinc_(Zangletests);
    -    if (angle > qh cos_max) {
    -      zinc_(Zcoplanarangle);
    -      qh_appendmergeset(facet, neighbor, MRGanglecoplanar, &angle);
    -      trace2((qh ferr, 2039, "qh_test_appendmerge: coplanar angle %4.4g between f%d and f%d\n",
    -         angle, facet->id, neighbor->id));
    -      return True;
    -    }else
    -      okangle= True;
    -  }
    -  if (!facet->center)
    -    facet->center= qh_getcentrum(facet);
    -  zzinc_(Zcentrumtests);
    -  qh_distplane(facet->center, neighbor, &dist);
    -  if (dist > qh centrum_radius)
    -    isconcave= True;
    -  else {
    -    if (dist > -qh centrum_radius)
    -      iscoplanar= True;
    -    if (!neighbor->center)
    -      neighbor->center= qh_getcentrum(neighbor);
    -    zzinc_(Zcentrumtests);
    -    qh_distplane(neighbor->center, facet, &dist2);
    -    if (dist2 > qh centrum_radius)
    -      isconcave= True;
    -    else if (!iscoplanar && dist2 > -qh centrum_radius)
    -      iscoplanar= True;
    -  }
    -  if (!isconcave && (!iscoplanar || (qh MERGEexact && !qh POSTmerging)))
    -    return False;
    -  if (!okangle && qh ANGLEmerge) {
    -    angle= qh_getangle(facet->normal, neighbor->normal);
    -    zinc_(Zangletests);
    -  }
    -  if (isconcave) {
    -    zinc_(Zconcaveridge);
    -    if (qh ANGLEmerge)
    -      angle += qh_ANGLEconcave + 0.5;
    -    qh_appendmergeset(facet, neighbor, MRGconcave, &angle);
    -    trace0((qh ferr, 18, "qh_test_appendmerge: concave f%d to f%d dist %4.4g and reverse dist %4.4g angle %4.4g during p%d\n",
    -           facet->id, neighbor->id, dist, dist2, angle, qh furthest_id));
    -  }else /* iscoplanar */ {
    -    zinc_(Zcoplanarcentrum);
    -    qh_appendmergeset(facet, neighbor, MRGcoplanar, &angle);
    -    trace2((qh ferr, 2040, "qh_test_appendmerge: coplanar f%d to f%d dist %4.4g, reverse dist %4.4g angle %4.4g\n",
    -              facet->id, neighbor->id, dist, dist2, angle));
    -  }
    -  return True;
    -} /* test_appendmerge */
    -
    -/*---------------------------------
    -
    -  qh_test_vneighbors()
    -    test vertex neighbors for convexity
    -    tests all facets on qh.newfacet_list
    -
    -  returns:
    -    true if non-convex vneighbors appended to qh.facet_mergeset
    -    initializes vertex neighbors if needed
    -
    -  notes:
    -    assumes all facet neighbors have been tested
    -    this can be expensive
    -    this does not guarantee that a centrum is below all facets
    -      but it is unlikely
    -    uses qh.visit_id
    -
    -  design:
    -    build vertex neighbors if necessary
    -    for all new facets
    -      for all vertices
    -        for each unvisited facet neighbor of the vertex
    -          test new facet and neighbor for convexity
    -*/
    -boolT qh_test_vneighbors(void /* qh newfacet_list */) {
    -  facetT *newfacet, *neighbor, **neighborp;
    -  vertexT *vertex, **vertexp;
    -  int nummerges= 0;
    -
    -  trace1((qh ferr, 1015, "qh_test_vneighbors: testing vertex neighbors for convexity\n"));
    -  if (!qh VERTEXneighbors)
    -    qh_vertexneighbors();
    -  FORALLnew_facets
    -    newfacet->seen= False;
    -  FORALLnew_facets {
    -    newfacet->seen= True;
    -    newfacet->visitid= qh visit_id++;
    -    FOREACHneighbor_(newfacet)
    -      newfacet->visitid= qh visit_id;
    -    FOREACHvertex_(newfacet->vertices) {
    -      FOREACHneighbor_(vertex) {
    -        if (neighbor->seen || neighbor->visitid == qh visit_id)
    -          continue;
    -        if (qh_test_appendmerge(newfacet, neighbor))
    -          nummerges++;
    -      }
    -    }
    -  }
    -  zadd_(Ztestvneighbor, nummerges);
    -  trace1((qh ferr, 1016, "qh_test_vneighbors: found %d non-convex, vertex neighbors\n",
    -           nummerges));
    -  return (nummerges > 0);
    -} /* test_vneighbors */
    -
    -/*---------------------------------
    -
    -  qh_tracemerge( facet1, facet2 )
    -    print trace message after merge
    -*/
    -void qh_tracemerge(facetT *facet1, facetT *facet2) {
    -  boolT waserror= False;
    -
    -#ifndef qh_NOtrace
    -  if (qh IStracing >= 4)
    -    qh_errprint("MERGED", facet2, NULL, NULL, NULL);
    -  if (facet2 == qh tracefacet || (qh tracevertex && qh tracevertex->newlist)) {
    -    qh_fprintf(qh ferr, 8085, "qh_tracemerge: trace facet and vertex after merge of f%d and f%d, furthest p%d\n", facet1->id, facet2->id, qh furthest_id);
    -    if (facet2 != qh tracefacet)
    -      qh_errprint("TRACE", qh tracefacet,
    -        (qh tracevertex && qh tracevertex->neighbors) ?
    -           SETfirstt_(qh tracevertex->neighbors, facetT) : NULL,
    -        NULL, qh tracevertex);
    -  }
    -  if (qh tracevertex) {
    -    if (qh tracevertex->deleted)
    -      qh_fprintf(qh ferr, 8086, "qh_tracemerge: trace vertex deleted at furthest p%d\n",
    -            qh furthest_id);
    -    else
    -      qh_checkvertex(qh tracevertex);
    -  }
    -  if (qh tracefacet) {
    -    qh_checkfacet(qh tracefacet, True, &waserror);
    -    if (waserror)
    -      qh_errexit(qh_ERRqhull, qh tracefacet, NULL);
    -  }
    -#endif /* !qh_NOtrace */
    -  if (qh CHECKfrequently || qh IStracing >= 4) { /* can't check polygon here */
    -    qh_checkfacet(facet2, True, &waserror);
    -    if (waserror)
    -      qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -} /* tracemerge */
    -
    -/*---------------------------------
    -
    -  qh_tracemerging()
    -    print trace message during POSTmerging
    -
    -  returns:
    -    updates qh.mergereport
    -
    -  notes:
    -    called from qh_mergecycle() and qh_mergefacet()
    -
    -  see:
    -    qh_buildtracing()
    -*/
    -void qh_tracemerging(void) {
    -  realT cpu;
    -  int total;
    -  time_t timedata;
    -  struct tm *tp;
    -
    -  qh mergereport= zzval_(Ztotmerge);
    -  time(&timedata);
    -  tp= localtime(&timedata);
    -  cpu= qh_CPUclock;
    -  cpu /= qh_SECticks;
    -  total= zzval_(Ztotmerge) - zzval_(Zcyclehorizon) + zzval_(Zcyclefacettot);
    -  qh_fprintf(qh ferr, 8087, "\n\
    -At %d:%d:%d & %2.5g CPU secs, qhull has merged %d facets.  The hull\n\
    -  contains %d facets and %d vertices.\n",
    -      tp->tm_hour, tp->tm_min, tp->tm_sec, cpu,
    -      total, qh num_facets - qh num_visible,
    -      qh num_vertices-qh_setsize(qh del_vertices));
    -} /* tracemerging */
    -
    -/*---------------------------------
    -
    -  qh_updatetested( facet1, facet2 )
    -    clear facet2->tested and facet1->ridge->tested for merge
    -
    -  returns:
    -    deletes facet2->center unless it's already large
    -      if so, clears facet2->ridge->tested
    -
    -  design:
    -    clear facet2->tested
    -    clear ridge->tested for facet1's ridges
    -    if facet2 has a centrum
    -      if facet2 is large
    -        set facet2->keepcentrum
    -      else if facet2 has 3 vertices due to many merges, or not large and post merging
    -        clear facet2->keepcentrum
    -      unless facet2->keepcentrum
    -        clear facet2->center to recompute centrum later
    -        clear ridge->tested for facet2's ridges
    -*/
    -void qh_updatetested(facetT *facet1, facetT *facet2) {
    -  ridgeT *ridge, **ridgep;
    -  int size;
    -
    -  facet2->tested= False;
    -  FOREACHridge_(facet1->ridges)
    -    ridge->tested= False;
    -  if (!facet2->center)
    -    return;
    -  size= qh_setsize(facet2->vertices);
    -  if (!facet2->keepcentrum) {
    -    if (size > qh hull_dim + qh_MAXnewcentrum) {
    -      facet2->keepcentrum= True;
    -      zinc_(Zwidevertices);
    -    }
    -  }else if (size <= qh hull_dim + qh_MAXnewcentrum) {
    -    /* center and keepcentrum was set */
    -    if (size == qh hull_dim || qh POSTmerging)
    -      facet2->keepcentrum= False; /* if many merges need to recompute centrum */
    -  }
    -  if (!facet2->keepcentrum) {
    -    qh_memfree(facet2->center, qh normal_size);
    -    facet2->center= NULL;
    -    FOREACHridge_(facet2->ridges)
    -      ridge->tested= False;
    -  }
    -} /* updatetested */
    -
    -/*---------------------------------
    -
    -  qh_vertexridges( vertex )
    -    return temporary set of ridges adjacent to a vertex
    -    vertex->neighbors defined
    -
    -  ntoes:
    -    uses qh.visit_id
    -    does not include implicit ridges for simplicial facets
    -
    -  design:
    -    for each neighbor of vertex
    -      add ridges that include the vertex to ridges
    -*/
    -setT *qh_vertexridges(vertexT *vertex) {
    -  facetT *neighbor, **neighborp;
    -  setT *ridges= qh_settemp(qh TEMPsize);
    -  int size;
    -
    -  qh visit_id++;
    -  FOREACHneighbor_(vertex)
    -    neighbor->visitid= qh visit_id;
    -  FOREACHneighbor_(vertex) {
    -    if (*neighborp)   /* no new ridges in last neighbor */
    -      qh_vertexridges_facet(vertex, neighbor, &ridges);
    -  }
    -  if (qh PRINTstatistics || qh IStracing) {
    -    size= qh_setsize(ridges);
    -    zinc_(Zvertexridge);
    -    zadd_(Zvertexridgetot, size);
    -    zmax_(Zvertexridgemax, size);
    -    trace3((qh ferr, 3011, "qh_vertexridges: found %d ridges for v%d\n",
    -             size, vertex->id));
    -  }
    -  return ridges;
    -} /* vertexridges */
    -
    -/*---------------------------------
    -
    -  qh_vertexridges_facet( vertex, facet, ridges )
    -    add adjacent ridges for vertex in facet
    -    neighbor->visitid==qh.visit_id if it hasn't been visited
    -
    -  returns:
    -    ridges updated
    -    sets facet->visitid to qh.visit_id-1
    -
    -  design:
    -    for each ridge of facet
    -      if ridge of visited neighbor (i.e., unprocessed)
    -        if vertex in ridge
    -          append ridge to vertex
    -    mark facet processed
    -*/
    -void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges) {
    -  ridgeT *ridge, **ridgep;
    -  facetT *neighbor;
    -
    -  FOREACHridge_(facet->ridges) {
    -    neighbor= otherfacet_(ridge, facet);
    -    if (neighbor->visitid == qh visit_id
    -    && qh_setin(ridge->vertices, vertex))
    -      qh_setappend(ridges, ridge);
    -  }
    -  facet->visitid= qh visit_id-1;
    -} /* vertexridges_facet */
    -
    -/*---------------------------------
    -
    -  qh_willdelete( facet, replace )
    -    moves facet to visible list
    -    sets facet->f.replace to replace (may be NULL)
    -
    -  returns:
    -    bumps qh.num_visible
    -*/
    -void qh_willdelete(facetT *facet, facetT *replace) {
    -
    -  qh_removefacet(facet);
    -  qh_prependfacet(facet, &qh visible_list);
    -  qh num_visible++;
    -  facet->visible= True;
    -  facet->f.replace= replace;
    -} /* willdelete */
    -
    -#else /* qh_NOmerge */
    -void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) {
    -}
    -void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
    -                      boolT vneighbors) {
    -}
    -boolT qh_checkzero(boolT testall) {
    -   }
    -#endif /* qh_NOmerge */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.h
    deleted file mode 100644
    index da0fb53e78..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/merge.h
    +++ /dev/null
    @@ -1,178 +0,0 @@
    -/*
      ---------------------------------
    -
    -   merge.h
    -   header file for merge.c
    -
    -   see qh-merge.htm and merge.c
    -
    -   Copyright (c) 1993-2012 C.B. Barber.
    -   $Id: //main/2011/qhull/src/libqhull/merge.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFmerge
    -#define qhDEFmerge 1
    -
    -#include "libqhull.h"
    -
    -
    -/*============ -constants- ==============*/
    -
    -/*----------------------------------
    -
    -  qh_ANGLEredundant
    -    indicates redundant merge in mergeT->angle
    -*/
    -#define qh_ANGLEredundant 6.0
    -
    -/*----------------------------------
    -
    -  qh_ANGLEdegen
    -    indicates degenerate facet in mergeT->angle
    -*/
    -#define qh_ANGLEdegen     5.0
    -
    -/*----------------------------------
    -
    -  qh_ANGLEconcave
    -    offset to indicate concave facets in mergeT->angle
    -
    -  notes:
    -    concave facets are assigned the range of [2,4] in mergeT->angle
    -    roundoff error may make the angle less than 2
    -*/
    -#define qh_ANGLEconcave  1.5
    -
    -/*----------------------------------
    -
    -  MRG... (mergeType)
    -    indicates the type of a merge (mergeT->type)
    -*/
    -typedef enum {  /* in sort order for facet_mergeset */
    -  MRGnone= 0,
    -  MRGcoplanar,          /* centrum coplanar */
    -  MRGanglecoplanar,     /* angle coplanar */
    -                        /* could detect half concave ridges */
    -  MRGconcave,           /* concave ridge */
    -  MRGflip,              /* flipped facet. facet1 == facet2 */
    -  MRGridge,             /* duplicate ridge (qh_MERGEridge) */
    -                        /* degen and redundant go onto degen_mergeset */
    -  MRGdegen,             /* degenerate facet (!enough neighbors) facet1 == facet2 */
    -  MRGredundant,         /* redundant facet (vertex subset) */
    -                        /* merge_degenredundant assumes degen < redundant */
    -  MRGmirror,            /* mirror facet from qh_triangulate */
    -  ENDmrg
    -} mergeType;
    -
    -/*----------------------------------
    -
    -  qh_MERGEapex
    -    flag for qh_mergefacet() to indicate an apex merge
    -*/
    -#define qh_MERGEapex     True
    -
    -/*============ -structures- ====================*/
    -
    -/*----------------------------------
    -
    -  mergeT
    -    structure used to merge facets
    -*/
    -
    -typedef struct mergeT mergeT;
    -struct mergeT {         /* initialize in qh_appendmergeset */
    -  realT   angle;        /* angle between normals of facet1 and facet2 */
    -  facetT *facet1;       /* will merge facet1 into facet2 */
    -  facetT *facet2;
    -  mergeType type;
    -};
    -
    -
    -/*=========== -macros- =========================*/
    -
    -/*----------------------------------
    -
    -  FOREACHmerge_( merges ) {...}
    -    assign 'merge' to each merge in merges
    -
    -  notes:
    -    uses 'mergeT *merge, **mergep;'
    -    if qh_mergefacet(),
    -      restart since qh.facet_mergeset may change
    -    see FOREACHsetelement_
    -*/
    -#define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
    -
    -/*============ prototypes in alphabetical order after pre/postmerge =======*/
    -
    -void    qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle);
    -void    qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
    -             boolT vneighbors);
    -void    qh_all_merges(boolT othermerge, boolT vneighbors);
    -void    qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
    -setT   *qh_basevertices( facetT *samecycle);
    -void    qh_checkconnect(void /* qh new_facets */);
    -boolT   qh_checkzero(boolT testall);
    -int     qh_compareangle(const void *p1, const void *p2);
    -int     qh_comparemerge(const void *p1, const void *p2);
    -int     qh_comparevisit(const void *p1, const void *p2);
    -void    qh_copynonconvex(ridgeT *atridge);
    -void    qh_degen_redundant_facet(facetT *facet);
    -void    qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet);
    -vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges);
    -void    qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor,
    -           facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
    -facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
    -void    qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
    -void    qh_forcedmerges( boolT *wasmerge);
    -void    qh_getmergeset(facetT *facetlist);
    -void    qh_getmergeset_initial(facetT *facetlist);
    -void    qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
    -ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge,
    -              vertexT *vertex, vertexT *oldvertex, int *hashslot);
    -void    qh_makeridges(facetT *facet);
    -void    qh_mark_dupridges(facetT *facetlist);
    -void    qh_maydropneighbor(facetT *facet);
    -int     qh_merge_degenredundant(void);
    -void    qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
    -void    qh_mergecycle(facetT *samecycle, facetT *newfacet);
    -void    qh_mergecycle_all(facetT *facetlist, boolT *wasmerge);
    -void    qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
    -void    qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
    -void    qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
    -void    qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
    -void    qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
    -void    qh_mergefacet2d(facetT *facet1, facetT *facet2);
    -void    qh_mergeneighbors(facetT *facet1, facetT *facet2);
    -void    qh_mergeridges(facetT *facet1, facetT *facet2);
    -void    qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
    -void    qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2);
    -void    qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
    -void    qh_mergevertices(setT *vertices1, setT **vertices);
    -setT   *qh_neighbor_intersections(vertexT *vertex);
    -void    qh_newvertices(setT *vertices);
    -boolT   qh_reducevertices(void);
    -vertexT *qh_redundant_vertex(vertexT *vertex);
    -boolT   qh_remove_extravertices(facetT *facet);
    -vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet);
    -void    qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
    -void    qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
    -                        facetT *oldfacet, facetT *neighborA);
    -boolT   qh_test_appendmerge(facetT *facet, facetT *neighbor);
    -boolT   qh_test_vneighbors(void /* qh newfacet_list */);
    -void    qh_tracemerge(facetT *facet1, facetT *facet2);
    -void    qh_tracemerging(void);
    -void    qh_updatetested( facetT *facet1, facetT *facet2);
    -setT   *qh_vertexridges(vertexT *vertex);
    -void    qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges);
    -void    qh_willdelete(facetT *facet, facetT *replace);
    -
    -#endif /* qhDEFmerge */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.c
    deleted file mode 100644
    index a3a0a48394..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.c
    +++ /dev/null
    @@ -1,1199 +0,0 @@
    -/*
      ---------------------------------
    -
    -   poly.c
    -   implements polygons and simplices
    -
    -   see qh-poly.htm, poly.h and libqhull.h
    -
    -   infrequent code is in poly2.c
    -   (all but top 50 and their callers 12/3/95)
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/poly.c#5 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*======== functions in alphabetical order ==========*/
    -
    -/*---------------------------------
    -
    -  qh_appendfacet( facet )
    -    appends facet to end of qh.facet_list,
    -
    -  returns:
    -    updates qh.newfacet_list, facet_next, facet_list
    -    increments qh.numfacets
    -
    -  notes:
    -    assumes qh.facet_list/facet_tail is defined (createsimplex)
    -
    -  see:
    -    qh_removefacet()
    -
    -*/
    -void qh_appendfacet(facetT *facet) {
    -  facetT *tail= qh facet_tail;
    -
    -  if (tail == qh newfacet_list)
    -    qh newfacet_list= facet;
    -  if (tail == qh facet_next)
    -    qh facet_next= facet;
    -  facet->previous= tail->previous;
    -  facet->next= tail;
    -  if (tail->previous)
    -    tail->previous->next= facet;
    -  else
    -    qh facet_list= facet;
    -  tail->previous= facet;
    -  qh num_facets++;
    -  trace4((qh ferr, 4044, "qh_appendfacet: append f%d to facet_list\n", facet->id));
    -} /* appendfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_appendvertex( vertex )
    -    appends vertex to end of qh.vertex_list,
    -
    -  returns:
    -    sets vertex->newlist
    -    updates qh.vertex_list, newvertex_list
    -    increments qh.num_vertices
    -
    -  notes:
    -    assumes qh.vertex_list/vertex_tail is defined (createsimplex)
    -
    -*/
    -void qh_appendvertex(vertexT *vertex) {
    -  vertexT *tail= qh vertex_tail;
    -
    -  if (tail == qh newvertex_list)
    -    qh newvertex_list= vertex;
    -  vertex->newlist= True;
    -  vertex->previous= tail->previous;
    -  vertex->next= tail;
    -  if (tail->previous)
    -    tail->previous->next= vertex;
    -  else
    -    qh vertex_list= vertex;
    -  tail->previous= vertex;
    -  qh num_vertices++;
    -  trace4((qh ferr, 4045, "qh_appendvertex: append v%d to vertex_list\n", vertex->id));
    -} /* appendvertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_attachnewfacets( )
    -    attach horizon facets to new facets in qh.newfacet_list
    -    newfacets have neighbor and ridge links to horizon but not vice versa
    -    only needed for qh.ONLYgood
    -
    -  returns:
    -    set qh.NEWfacets
    -    horizon facets linked to new facets
    -      ridges changed from visible facets to new facets
    -      simplicial ridges deleted
    -    qh.visible_list, no ridges valid
    -    facet->f.replace is a newfacet (if any)
    -
    -  design:
    -    delete interior ridges and neighbor sets by
    -      for each visible, non-simplicial facet
    -        for each ridge
    -          if last visit or if neighbor is simplicial
    -            if horizon neighbor
    -              delete ridge for horizon's ridge set
    -            delete ridge
    -        erase neighbor set
    -    attach horizon facets and new facets by
    -      for all new facets
    -        if corresponding horizon facet is simplicial
    -          locate corresponding visible facet {may be more than one}
    -          link visible facet to new facet
    -          replace visible facet with new facet in horizon
    -        else it's non-simplicial
    -          for all visible neighbors of the horizon facet
    -            link visible neighbor to new facet
    -            delete visible neighbor from horizon facet
    -          append new facet to horizon's neighbors
    -          the first ridge of the new facet is the horizon ridge
    -          link the new facet into the horizon ridge
    -*/
    -void qh_attachnewfacets(void ) {
    -  facetT *newfacet= NULL, *neighbor, **neighborp, *horizon, *visible;
    -  ridgeT *ridge, **ridgep;
    -
    -  qh NEWfacets= True;
    -  trace3((qh ferr, 3012, "qh_attachnewfacets: delete interior ridges\n"));
    -  qh visit_id++;
    -  FORALLvisible_facets {
    -    visible->visitid= qh visit_id;
    -    if (visible->ridges) {
    -      FOREACHridge_(visible->ridges) {
    -        neighbor= otherfacet_(ridge, visible);
    -        if (neighbor->visitid == qh visit_id
    -            || (!neighbor->visible && neighbor->simplicial)) {
    -          if (!neighbor->visible)  /* delete ridge for simplicial horizon */
    -            qh_setdel(neighbor->ridges, ridge);
    -          qh_setfree(&(ridge->vertices)); /* delete on 2nd visit */
    -          qh_memfree(ridge, (int)sizeof(ridgeT));
    -        }
    -      }
    -      SETfirst_(visible->ridges)= NULL;
    -    }
    -    SETfirst_(visible->neighbors)= NULL;
    -  }
    -  trace1((qh ferr, 1017, "qh_attachnewfacets: attach horizon facets to new facets\n"));
    -  FORALLnew_facets {
    -    horizon= SETfirstt_(newfacet->neighbors, facetT);
    -    if (horizon->simplicial) {
    -      visible= NULL;
    -      FOREACHneighbor_(horizon) {   /* may have more than one horizon ridge */
    -        if (neighbor->visible) {
    -          if (visible) {
    -            if (qh_setequal_skip(newfacet->vertices, 0, horizon->vertices,
    -                                  SETindex_(horizon->neighbors, neighbor))) {
    -              visible= neighbor;
    -              break;
    -            }
    -          }else
    -            visible= neighbor;
    -        }
    -      }
    -      if (visible) {
    -        visible->f.replace= newfacet;
    -        qh_setreplace(horizon->neighbors, visible, newfacet);
    -      }else {
    -        qh_fprintf(qh ferr, 6102, "qhull internal error (qh_attachnewfacets): couldn't find visible facet for horizon f%d of newfacet f%d\n",
    -                 horizon->id, newfacet->id);
    -        qh_errexit2 (qh_ERRqhull, horizon, newfacet);
    -      }
    -    }else { /* non-simplicial, with a ridge for newfacet */
    -      FOREACHneighbor_(horizon) {    /* may hold for many new facets */
    -        if (neighbor->visible) {
    -          neighbor->f.replace= newfacet;
    -          qh_setdelnth(horizon->neighbors,
    -                        SETindex_(horizon->neighbors, neighbor));
    -          neighborp--; /* repeat */
    -        }
    -      }
    -      qh_setappend(&horizon->neighbors, newfacet);
    -      ridge= SETfirstt_(newfacet->ridges, ridgeT);
    -      if (ridge->top == horizon)
    -        ridge->bottom= newfacet;
    -      else
    -        ridge->top= newfacet;
    -      }
    -  } /* newfacets */
    -  if (qh PRINTstatistics) {
    -    FORALLvisible_facets {
    -      if (!visible->f.replace)
    -        zinc_(Zinsidevisible);
    -    }
    -  }
    -} /* attachnewfacets */
    -
    -/*---------------------------------
    -
    -  qh_checkflipped( facet, dist, allerror )
    -    checks facet orientation to interior point
    -
    -    if allerror set,
    -      tests against qh.DISTround
    -    else
    -      tests against 0 since tested against DISTround before
    -
    -  returns:
    -    False if it flipped orientation (sets facet->flipped)
    -    distance if non-NULL
    -*/
    -boolT qh_checkflipped(facetT *facet, realT *distp, boolT allerror) {
    -  realT dist;
    -
    -  if (facet->flipped && !distp)
    -    return False;
    -  zzinc_(Zdistcheck);
    -  qh_distplane(qh interior_point, facet, &dist);
    -  if (distp)
    -    *distp= dist;
    -  if ((allerror && dist > -qh DISTround)|| (!allerror && dist >= 0.0)) {
    -    facet->flipped= True;
    -    zzinc_(Zflippedfacets);
    -    trace0((qh ferr, 19, "qh_checkflipped: facet f%d is flipped, distance= %6.12g during p%d\n",
    -              facet->id, dist, qh furthest_id));
    -    qh_precision("flipped facet");
    -    return False;
    -  }
    -  return True;
    -} /* checkflipped */
    -
    -/*---------------------------------
    -
    -  qh_delfacet( facet )
    -    removes facet from facet_list and frees up its memory
    -
    -  notes:
    -    assumes vertices and ridges already freed
    -*/
    -void qh_delfacet(facetT *facet) {
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  trace4((qh ferr, 4046, "qh_delfacet: delete f%d\n", facet->id));
    -  if (facet == qh tracefacet)
    -    qh tracefacet= NULL;
    -  if (facet == qh GOODclosest)
    -    qh GOODclosest= NULL;
    -  qh_removefacet(facet);
    -  if (!facet->tricoplanar || facet->keepcentrum) {
    -    qh_memfree_(facet->normal, qh normal_size, freelistp);
    -    if (qh CENTERtype == qh_ASvoronoi) {   /* uses macro calls */
    -      qh_memfree_(facet->center, qh center_size, freelistp);
    -    }else /* AScentrum */ {
    -      qh_memfree_(facet->center, qh normal_size, freelistp);
    -    }
    -  }
    -  qh_setfree(&(facet->neighbors));
    -  if (facet->ridges)
    -    qh_setfree(&(facet->ridges));
    -  qh_setfree(&(facet->vertices));
    -  if (facet->outsideset)
    -    qh_setfree(&(facet->outsideset));
    -  if (facet->coplanarset)
    -    qh_setfree(&(facet->coplanarset));
    -  qh_memfree_(facet, (int)sizeof(facetT), freelistp);
    -} /* delfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_deletevisible()
    -    delete visible facets and vertices
    -
    -  returns:
    -    deletes each facet and removes from facetlist
    -    at exit, qh.visible_list empty (== qh.newfacet_list)
    -
    -  notes:
    -    ridges already deleted
    -    horizon facets do not reference facets on qh.visible_list
    -    new facets in qh.newfacet_list
    -    uses   qh.visit_id;
    -*/
    -void qh_deletevisible(void /*qh visible_list*/) {
    -  facetT *visible, *nextfacet;
    -  vertexT *vertex, **vertexp;
    -  int numvisible= 0, numdel= qh_setsize(qh del_vertices);
    -
    -  trace1((qh ferr, 1018, "qh_deletevisible: delete %d visible facets and %d vertices\n",
    -         qh num_visible, numdel));
    -  for (visible= qh visible_list; visible && visible->visible;
    -                visible= nextfacet) { /* deleting current */
    -    nextfacet= visible->next;
    -    numvisible++;
    -    qh_delfacet(visible);
    -  }
    -  if (numvisible != qh num_visible) {
    -    qh_fprintf(qh ferr, 6103, "qhull internal error (qh_deletevisible): qh num_visible %d is not number of visible facets %d\n",
    -             qh num_visible, numvisible);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -  qh num_visible= 0;
    -  zadd_(Zvisfacettot, numvisible);
    -  zmax_(Zvisfacetmax, numvisible);
    -  zzadd_(Zdelvertextot, numdel);
    -  zmax_(Zdelvertexmax, numdel);
    -  FOREACHvertex_(qh del_vertices)
    -    qh_delvertex(vertex);
    -  qh_settruncate(qh del_vertices, 0);
    -} /* deletevisible */
    -
    -/*---------------------------------
    -
    -  qh_facetintersect( facetA, facetB, skipa, skipB, prepend )
    -    return vertices for intersection of two simplicial facets
    -    may include 1 prepended entry (if more, need to settemppush)
    -
    -  returns:
    -    returns set of qh.hull_dim-1 + prepend vertices
    -    returns skipped index for each test and checks for exactly one
    -
    -  notes:
    -    does not need settemp since set in quick memory
    -
    -  see also:
    -    qh_vertexintersect and qh_vertexintersect_new
    -    use qh_setnew_delnthsorted to get nth ridge (no skip information)
    -
    -  design:
    -    locate skipped vertex by scanning facet A's neighbors
    -    locate skipped vertex by scanning facet B's neighbors
    -    intersect the vertex sets
    -*/
    -setT *qh_facetintersect(facetT *facetA, facetT *facetB,
    -                         int *skipA,int *skipB, int prepend) {
    -  setT *intersect;
    -  int dim= qh hull_dim, i, j;
    -  facetT **neighborsA, **neighborsB;
    -
    -  neighborsA= SETaddr_(facetA->neighbors, facetT);
    -  neighborsB= SETaddr_(facetB->neighbors, facetT);
    -  i= j= 0;
    -  if (facetB == *neighborsA++)
    -    *skipA= 0;
    -  else if (facetB == *neighborsA++)
    -    *skipA= 1;
    -  else if (facetB == *neighborsA++)
    -    *skipA= 2;
    -  else {
    -    for (i=3; i < dim; i++) {
    -      if (facetB == *neighborsA++) {
    -        *skipA= i;
    -        break;
    -      }
    -    }
    -  }
    -  if (facetA == *neighborsB++)
    -    *skipB= 0;
    -  else if (facetA == *neighborsB++)
    -    *skipB= 1;
    -  else if (facetA == *neighborsB++)
    -    *skipB= 2;
    -  else {
    -    for (j=3; j < dim; j++) {
    -      if (facetA == *neighborsB++) {
    -        *skipB= j;
    -        break;
    -      }
    -    }
    -  }
    -  if (i >= dim || j >= dim) {
    -    qh_fprintf(qh ferr, 6104, "qhull internal error (qh_facetintersect): f%d or f%d not in others neighbors\n",
    -            facetA->id, facetB->id);
    -    qh_errexit2 (qh_ERRqhull, facetA, facetB);
    -  }
    -  intersect= qh_setnew_delnthsorted(facetA->vertices, qh hull_dim, *skipA, prepend);
    -  trace4((qh ferr, 4047, "qh_facetintersect: f%d skip %d matches f%d skip %d\n",
    -          facetA->id, *skipA, facetB->id, *skipB));
    -  return(intersect);
    -} /* facetintersect */
    -
    -/*---------------------------------
    -
    -  qh_gethash( hashsize, set, size, firstindex, skipelem )
    -    return hashvalue for a set with firstindex and skipelem
    -
    -  notes:
    -    returned hash is in [0,hashsize)
    -    assumes at least firstindex+1 elements
    -    assumes skipelem is NULL, in set, or part of hash
    -
    -    hashes memory addresses which may change over different runs of the same data
    -    using sum for hash does badly in high d
    -*/
    -int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem) {
    -  void **elemp= SETelemaddr_(set, firstindex, void);
    -  ptr_intT hash = 0, elem;
    -  unsigned result;
    -  int i;
    -#ifdef _MSC_VER                   /* Microsoft Visual C++ -- warn about 64-bit issues */
    -#pragma warning( push)            /* WARN64 -- ptr_intT holds a 64-bit pointer */
    -#pragma warning( disable : 4311)  /* 'type cast': pointer truncation from 'void*' to 'ptr_intT' */
    -#endif
    -
    -  switch (size-firstindex) {
    -  case 1:
    -    hash= (ptr_intT)(*elemp) - (ptr_intT) skipelem;
    -    break;
    -  case 2:
    -    hash= (ptr_intT)(*elemp) + (ptr_intT)elemp[1] - (ptr_intT) skipelem;
    -    break;
    -  case 3:
    -    hash= (ptr_intT)(*elemp) + (ptr_intT)elemp[1] + (ptr_intT)elemp[2]
    -      - (ptr_intT) skipelem;
    -    break;
    -  case 4:
    -    hash= (ptr_intT)(*elemp) + (ptr_intT)elemp[1] + (ptr_intT)elemp[2]
    -      + (ptr_intT)elemp[3] - (ptr_intT) skipelem;
    -    break;
    -  case 5:
    -    hash= (ptr_intT)(*elemp) + (ptr_intT)elemp[1] + (ptr_intT)elemp[2]
    -      + (ptr_intT)elemp[3] + (ptr_intT)elemp[4] - (ptr_intT) skipelem;
    -    break;
    -  case 6:
    -    hash= (ptr_intT)(*elemp) + (ptr_intT)elemp[1] + (ptr_intT)elemp[2]
    -      + (ptr_intT)elemp[3] + (ptr_intT)elemp[4]+ (ptr_intT)elemp[5]
    -      - (ptr_intT) skipelem;
    -    break;
    -  default:
    -    hash= 0;
    -    i= 3;
    -    do {     /* this is about 10% in 10-d */
    -      if ((elem= (ptr_intT)*elemp++) != (ptr_intT)skipelem) {
    -        hash ^= (elem << i) + (elem >> (32-i));
    -        i += 3;
    -        if (i >= 32)
    -          i -= 32;
    -      }
    -    }while (*elemp);
    -    break;
    -  }
    -  if (hashsize<0) {
    -    qh_fprintf(qh ferr, 6202, "qhull internal error: negative hashsize %d passed to qh_gethash [poly.c]\n", hashsize);
    -    qh_errexit2 (qh_ERRqhull, NULL, NULL);
    -  }
    -  result= (unsigned)hash;
    -  result %= (unsigned)hashsize;
    -  /* result= 0; for debugging */
    -  return result;
    -#ifdef _MSC_VER
    -#pragma warning( pop)
    -#endif
    -} /* gethash */
    -
    -/*---------------------------------
    -
    -  qh_makenewfacet( vertices, toporient, horizon )
    -    creates a toporient? facet from vertices
    -
    -  returns:
    -    returns newfacet
    -      adds newfacet to qh.facet_list
    -      newfacet->vertices= vertices
    -      if horizon
    -        newfacet->neighbor= horizon, but not vice versa
    -    newvertex_list updated with vertices
    -*/
    -facetT *qh_makenewfacet(setT *vertices, boolT toporient,facetT *horizon) {
    -  facetT *newfacet;
    -  vertexT *vertex, **vertexp;
    -
    -  FOREACHvertex_(vertices) {
    -    if (!vertex->newlist) {
    -      qh_removevertex(vertex);
    -      qh_appendvertex(vertex);
    -    }
    -  }
    -  newfacet= qh_newfacet();
    -  newfacet->vertices= vertices;
    -  newfacet->toporient= (unsigned char)toporient;
    -  if (horizon)
    -    qh_setappend(&(newfacet->neighbors), horizon);
    -  qh_appendfacet(newfacet);
    -  return(newfacet);
    -} /* makenewfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_makenewplanes()
    -    make new hyperplanes for facets on qh.newfacet_list
    -
    -  returns:
    -    all facets have hyperplanes or are marked for   merging
    -    doesn't create hyperplane if horizon is coplanar (will merge)
    -    updates qh.min_vertex if qh.JOGGLEmax
    -
    -  notes:
    -    facet->f.samecycle is defined for facet->mergehorizon facets
    -*/
    -void qh_makenewplanes(void /* newfacet_list */) {
    -  facetT *newfacet;
    -
    -  FORALLnew_facets {
    -    if (!newfacet->mergehorizon)
    -      qh_setfacetplane(newfacet);
    -  }
    -  if (qh JOGGLEmax < REALmax/2)
    -    minimize_(qh min_vertex, -wwval_(Wnewvertexmax));
    -} /* makenewplanes */
    -
    -/*---------------------------------
    -
    -  qh_makenew_nonsimplicial( visible, apex, numnew )
    -    make new facets for ridges of a visible facet
    -
    -  returns:
    -    first newfacet, bumps numnew as needed
    -    attaches new facets if !qh.ONLYgood
    -    marks ridge neighbors for simplicial visible
    -    if (qh.ONLYgood)
    -      ridges on newfacet, horizon, and visible
    -    else
    -      ridge and neighbors between newfacet and   horizon
    -      visible facet's ridges are deleted
    -
    -  notes:
    -    qh.visit_id if visible has already been processed
    -    sets neighbor->seen for building f.samecycle
    -      assumes all 'seen' flags initially false
    -
    -  design:
    -    for each ridge of visible facet
    -      get neighbor of visible facet
    -      if neighbor was already processed
    -        delete the ridge (will delete all visible facets later)
    -      if neighbor is a horizon facet
    -        create a new facet
    -        if neighbor coplanar
    -          adds newfacet to f.samecycle for later merging
    -        else
    -          updates neighbor's neighbor set
    -          (checks for non-simplicial facet with multiple ridges to visible facet)
    -        updates neighbor's ridge set
    -        (checks for simplicial neighbor to non-simplicial visible facet)
    -        (deletes ridge if neighbor is simplicial)
    -
    -*/
    -#ifndef qh_NOmerge
    -facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) {
    -  void **freelistp; /* used !qh_NOmem */
    -  ridgeT *ridge, **ridgep;
    -  facetT *neighbor, *newfacet= NULL, *samecycle;
    -  setT *vertices;
    -  boolT toporient;
    -  int ridgeid;
    -
    -  FOREACHridge_(visible->ridges) {
    -    ridgeid= ridge->id;
    -    neighbor= otherfacet_(ridge, visible);
    -    if (neighbor->visible) {
    -      if (!qh ONLYgood) {
    -        if (neighbor->visitid == qh visit_id) {
    -          qh_setfree(&(ridge->vertices));  /* delete on 2nd visit */
    -          qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp);
    -        }
    -      }
    -    }else {  /* neighbor is an horizon facet */
    -      toporient= (ridge->top == visible);
    -      vertices= qh_setnew(qh hull_dim); /* makes sure this is quick */
    -      qh_setappend(&vertices, apex);
    -      qh_setappend_set(&vertices, ridge->vertices);
    -      newfacet= qh_makenewfacet(vertices, toporient, neighbor);
    -      (*numnew)++;
    -      if (neighbor->coplanar) {
    -        newfacet->mergehorizon= True;
    -        if (!neighbor->seen) {
    -          newfacet->f.samecycle= newfacet;
    -          neighbor->f.newcycle= newfacet;
    -        }else {
    -          samecycle= neighbor->f.newcycle;
    -          newfacet->f.samecycle= samecycle->f.samecycle;
    -          samecycle->f.samecycle= newfacet;
    -        }
    -      }
    -      if (qh ONLYgood) {
    -        if (!neighbor->simplicial)
    -          qh_setappend(&(newfacet->ridges), ridge);
    -      }else {  /* qh_attachnewfacets */
    -        if (neighbor->seen) {
    -          if (neighbor->simplicial) {
    -            qh_fprintf(qh ferr, 6105, "qhull internal error (qh_makenew_nonsimplicial): simplicial f%d sharing two ridges with f%d\n",
    -                   neighbor->id, visible->id);
    -            qh_errexit2 (qh_ERRqhull, neighbor, visible);
    -          }
    -          qh_setappend(&(neighbor->neighbors), newfacet);
    -        }else
    -          qh_setreplace(neighbor->neighbors, visible, newfacet);
    -        if (neighbor->simplicial) {
    -          qh_setdel(neighbor->ridges, ridge);
    -          qh_setfree(&(ridge->vertices));
    -          qh_memfree(ridge, (int)sizeof(ridgeT));
    -        }else {
    -          qh_setappend(&(newfacet->ridges), ridge);
    -          if (toporient)
    -            ridge->top= newfacet;
    -          else
    -            ridge->bottom= newfacet;
    -        }
    -      trace4((qh ferr, 4048, "qh_makenew_nonsimplicial: created facet f%d from v%d and r%d of horizon f%d\n",
    -            newfacet->id, apex->id, ridgeid, neighbor->id));
    -      }
    -    }
    -    neighbor->seen= True;
    -  } /* for each ridge */
    -  if (!qh ONLYgood)
    -    SETfirst_(visible->ridges)= NULL;
    -  return newfacet;
    -} /* makenew_nonsimplicial */
    -#else /* qh_NOmerge */
    -facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) {
    -  return NULL;
    -}
    -#endif /* qh_NOmerge */
    -
    -/*---------------------------------
    -
    -  qh_makenew_simplicial( visible, apex, numnew )
    -    make new facets for simplicial visible facet and apex
    -
    -  returns:
    -    attaches new facets if (!qh.ONLYgood)
    -      neighbors between newfacet and horizon
    -
    -  notes:
    -    nop if neighbor->seen or neighbor->visible(see qh_makenew_nonsimplicial)
    -
    -  design:
    -    locate neighboring horizon facet for visible facet
    -    determine vertices and orientation
    -    create new facet
    -    if coplanar,
    -      add new facet to f.samecycle
    -    update horizon facet's neighbor list
    -*/
    -facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew) {
    -  facetT *neighbor, **neighborp, *newfacet= NULL;
    -  setT *vertices;
    -  boolT flip, toporient;
    -  int horizonskip, visibleskip;
    -
    -  FOREACHneighbor_(visible) {
    -    if (!neighbor->seen && !neighbor->visible) {
    -      vertices= qh_facetintersect(neighbor,visible, &horizonskip, &visibleskip, 1);
    -      SETfirst_(vertices)= apex;
    -      flip= ((horizonskip & 0x1) ^ (visibleskip & 0x1));
    -      if (neighbor->toporient)
    -        toporient= horizonskip & 0x1;
    -      else
    -        toporient= (horizonskip & 0x1) ^ 0x1;
    -      newfacet= qh_makenewfacet(vertices, toporient, neighbor);
    -      (*numnew)++;
    -      if (neighbor->coplanar && (qh PREmerge || qh MERGEexact)) {
    -#ifndef qh_NOmerge
    -        newfacet->f.samecycle= newfacet;
    -        newfacet->mergehorizon= True;
    -#endif
    -      }
    -      if (!qh ONLYgood)
    -        SETelem_(neighbor->neighbors, horizonskip)= newfacet;
    -      trace4((qh ferr, 4049, "qh_makenew_simplicial: create facet f%d top %d from v%d and horizon f%d skip %d top %d and visible f%d skip %d, flip? %d\n",
    -            newfacet->id, toporient, apex->id, neighbor->id, horizonskip,
    -              neighbor->toporient, visible->id, visibleskip, flip));
    -    }
    -  }
    -  return newfacet;
    -} /* makenew_simplicial */
    -
    -/*---------------------------------
    -
    -  qh_matchneighbor( newfacet, newskip, hashsize, hashcount )
    -    either match subridge of newfacet with neighbor or add to hash_table
    -
    -  returns:
    -    duplicate ridges are unmatched and marked by qh_DUPLICATEridge
    -
    -  notes:
    -    ridge is newfacet->vertices w/o newskip vertex
    -    do not allocate memory (need to free hash_table cleanly)
    -    uses linear hash chains
    -
    -  see also:
    -    qh_matchduplicates
    -
    -  design:
    -    for each possible matching facet in qh.hash_table
    -      if vertices match
    -        set ismatch, if facets have opposite orientation
    -        if ismatch and matching facet doesn't have a match
    -          match the facets by updating their neighbor sets
    -        else
    -          indicate a duplicate ridge
    -          set facet hyperplane for later testing
    -          add facet to hashtable
    -          unless the other facet was already a duplicate ridge
    -            mark both facets with a duplicate ridge
    -            add other facet (if defined) to hash table
    -*/
    -void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcount) {
    -  boolT newfound= False;   /* True, if new facet is already in hash chain */
    -  boolT same, ismatch;
    -  int hash, scan;
    -  facetT *facet, *matchfacet;
    -  int skip, matchskip;
    -
    -  hash= qh_gethash(hashsize, newfacet->vertices, qh hull_dim, 1,
    -                     SETelem_(newfacet->vertices, newskip));
    -  trace4((qh ferr, 4050, "qh_matchneighbor: newfacet f%d skip %d hash %d hashcount %d\n",
    -          newfacet->id, newskip, hash, *hashcount));
    -  zinc_(Zhashlookup);
    -  for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT));
    -       scan= (++scan >= hashsize ? 0 : scan)) {
    -    if (facet == newfacet) {
    -      newfound= True;
    -      continue;
    -    }
    -    zinc_(Zhashtests);
    -    if (qh_matchvertices(1, newfacet->vertices, newskip, facet->vertices, &skip, &same)) {
    -      if (SETelem_(newfacet->vertices, newskip) ==
    -          SETelem_(facet->vertices, skip)) {
    -        qh_precision("two facets with the same vertices");
    -        qh_fprintf(qh ferr, 6106, "qhull precision error: Vertex sets are the same for f%d and f%d.  Can not force output.\n",
    -          facet->id, newfacet->id);
    -        qh_errexit2 (qh_ERRprec, facet, newfacet);
    -      }
    -      ismatch= (same == (boolT)((newfacet->toporient ^ facet->toporient)));
    -      matchfacet= SETelemt_(facet->neighbors, skip, facetT);
    -      if (ismatch && !matchfacet) {
    -        SETelem_(facet->neighbors, skip)= newfacet;
    -        SETelem_(newfacet->neighbors, newskip)= facet;
    -        (*hashcount)--;
    -        trace4((qh ferr, 4051, "qh_matchneighbor: f%d skip %d matched with new f%d skip %d\n",
    -           facet->id, skip, newfacet->id, newskip));
    -        return;
    -      }
    -      if (!qh PREmerge && !qh MERGEexact) {
    -        qh_precision("a ridge with more than two neighbors");
    -        qh_fprintf(qh ferr, 6107, "qhull precision error: facets f%d, f%d and f%d meet at a ridge with more than 2 neighbors.  Can not continue.\n",
    -                 facet->id, newfacet->id, getid_(matchfacet));
    -        qh_errexit2 (qh_ERRprec, facet, newfacet);
    -      }
    -      SETelem_(newfacet->neighbors, newskip)= qh_DUPLICATEridge;
    -      newfacet->dupridge= True;
    -      if (!newfacet->normal)
    -        qh_setfacetplane(newfacet);
    -      qh_addhash(newfacet, qh hash_table, hashsize, hash);
    -      (*hashcount)++;
    -      if (!facet->normal)
    -        qh_setfacetplane(facet);
    -      if (matchfacet != qh_DUPLICATEridge) {
    -        SETelem_(facet->neighbors, skip)= qh_DUPLICATEridge;
    -        facet->dupridge= True;
    -        if (!facet->normal)
    -          qh_setfacetplane(facet);
    -        if (matchfacet) {
    -          matchskip= qh_setindex(matchfacet->neighbors, facet);
    -          SETelem_(matchfacet->neighbors, matchskip)= qh_DUPLICATEridge;
    -          matchfacet->dupridge= True;
    -          if (!matchfacet->normal)
    -            qh_setfacetplane(matchfacet);
    -          qh_addhash(matchfacet, qh hash_table, hashsize, hash);
    -          *hashcount += 2;
    -        }
    -      }
    -      trace4((qh ferr, 4052, "qh_matchneighbor: new f%d skip %d duplicates ridge for f%d skip %d matching f%d ismatch %d at hash %d\n",
    -           newfacet->id, newskip, facet->id, skip,
    -           (matchfacet == qh_DUPLICATEridge ? -2 : getid_(matchfacet)),
    -           ismatch, hash));
    -      return; /* end of duplicate ridge */
    -    }
    -  }
    -  if (!newfound)
    -    SETelem_(qh hash_table, scan)= newfacet;  /* same as qh_addhash */
    -  (*hashcount)++;
    -  trace4((qh ferr, 4053, "qh_matchneighbor: no match for f%d skip %d at hash %d\n",
    -           newfacet->id, newskip, hash));
    -} /* matchneighbor */
    -
    -
    -/*---------------------------------
    -
    -  qh_matchnewfacets()
    -    match newfacets in qh.newfacet_list to their newfacet neighbors
    -
    -  returns:
    -    qh.newfacet_list with full neighbor sets
    -      get vertices with nth neighbor by deleting nth vertex
    -    if qh.PREmerge/MERGEexact or qh.FORCEoutput
    -      sets facet->flippped if flipped normal (also prevents point partitioning)
    -    if duplicate ridges and qh.PREmerge/MERGEexact
    -      sets facet->dupridge
    -      missing neighbor links identifies extra ridges to be merging (qh_MERGEridge)
    -
    -  notes:
    -    newfacets already have neighbor[0] (horizon facet)
    -    assumes qh.hash_table is NULL
    -    vertex->neighbors has not been updated yet
    -    do not allocate memory after qh.hash_table (need to free it cleanly)
    -
    -  design:
    -    delete neighbor sets for all new facets
    -    initialize a hash table
    -    for all new facets
    -      match facet with neighbors
    -    if unmatched facets (due to duplicate ridges)
    -      for each new facet with a duplicate ridge
    -        match it with a facet
    -    check for flipped facets
    -*/
    -void qh_matchnewfacets(void /* qh newfacet_list */) {
    -  int numnew=0, hashcount=0, newskip;
    -  facetT *newfacet, *neighbor;
    -  int dim= qh hull_dim, hashsize, neighbor_i, neighbor_n;
    -  setT *neighbors;
    -#ifndef qh_NOtrace
    -  int facet_i, facet_n, numfree= 0;
    -  facetT *facet;
    -#endif
    -
    -  trace1((qh ferr, 1019, "qh_matchnewfacets: match neighbors for new facets.\n"));
    -  FORALLnew_facets {
    -    numnew++;
    -    {  /* inline qh_setzero(newfacet->neighbors, 1, qh hull_dim); */
    -      neighbors= newfacet->neighbors;
    -      neighbors->e[neighbors->maxsize].i= dim+1; /*may be overwritten*/
    -      memset((char *)SETelemaddr_(neighbors, 1, void), 0, dim * SETelemsize);
    -    }
    -  }
    -
    -  qh_newhashtable(numnew*(qh hull_dim-1)); /* twice what is normally needed,
    -                                     but every ridge could be DUPLICATEridge */
    -  hashsize= qh_setsize(qh hash_table);
    -  FORALLnew_facets {
    -    for (newskip=1; newskipneighbors, k, facetT);
    -          if (!neighbor || neighbor == qh_DUPLICATEridge)
    -            count++;
    -        }
    -        if (facet == newfacet)
    -          break;
    -      }
    -      if (count != hashcount) {
    -        qh_fprintf(qh ferr, 8088, "qh_matchnewfacets: after adding facet %d, hashcount %d != count %d\n",
    -                 newfacet->id, hashcount, count);
    -        qh_errexit(qh_ERRqhull, newfacet, NULL);
    -      }
    -    }
    -#endif  /* end of trap code */
    -  }
    -  if (hashcount) {
    -    FORALLnew_facets {
    -      if (newfacet->dupridge) {
    -        FOREACHneighbor_i_(newfacet) {
    -          if (neighbor == qh_DUPLICATEridge) {
    -            qh_matchduplicates(newfacet, neighbor_i, hashsize, &hashcount);
    -                    /* this may report MERGEfacet */
    -          }
    -        }
    -      }
    -    }
    -  }
    -  if (hashcount) {
    -    qh_fprintf(qh ferr, 6108, "qhull internal error (qh_matchnewfacets): %d neighbors did not match up\n",
    -        hashcount);
    -    qh_printhashtable(qh ferr);
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -  }
    -#ifndef qh_NOtrace
    -  if (qh IStracing >= 2) {
    -    FOREACHfacet_i_(qh hash_table) {
    -      if (!facet)
    -        numfree++;
    -    }
    -    qh_fprintf(qh ferr, 8089, "qh_matchnewfacets: %d new facets, %d unused hash entries .  hashsize %d\n",
    -             numnew, numfree, qh_setsize(qh hash_table));
    -  }
    -#endif /* !qh_NOtrace */
    -  qh_setfree(&qh hash_table);
    -  if (qh PREmerge || qh MERGEexact) {
    -    if (qh IStracing >= 4)
    -      qh_printfacetlist(qh newfacet_list, NULL, qh_ALL);
    -    FORALLnew_facets {
    -      if (newfacet->normal)
    -        qh_checkflipped(newfacet, NULL, qh_ALL);
    -    }
    -  }else if (qh FORCEoutput)
    -    qh_checkflipped_all(qh newfacet_list);  /* prints warnings for flipped */
    -} /* matchnewfacets */
    -
    -
    -/*---------------------------------
    -
    -  qh_matchvertices( firstindex, verticesA, skipA, verticesB, skipB, same )
    -    tests whether vertices match with a single skip
    -    starts match at firstindex since all new facets have a common vertex
    -
    -  returns:
    -    true if matched vertices
    -    skip index for each set
    -    sets same iff vertices have the same orientation
    -
    -  notes:
    -    assumes skipA is in A and both sets are the same size
    -
    -  design:
    -    set up pointers
    -    scan both sets checking for a match
    -    test orientation
    -*/
    -boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA,
    -       setT *verticesB, int *skipB, boolT *same) {
    -  vertexT **elemAp, **elemBp, **skipBp=NULL, **skipAp;
    -
    -  elemAp= SETelemaddr_(verticesA, firstindex, vertexT);
    -  elemBp= SETelemaddr_(verticesB, firstindex, vertexT);
    -  skipAp= SETelemaddr_(verticesA, skipA, vertexT);
    -  do if (elemAp != skipAp) {
    -    while (*elemAp != *elemBp++) {
    -      if (skipBp)
    -        return False;
    -      skipBp= elemBp;  /* one extra like FOREACH */
    -    }
    -  }while (*(++elemAp));
    -  if (!skipBp)
    -    skipBp= ++elemBp;
    -  *skipB= SETindex_(verticesB, skipB); /* i.e., skipBp - verticesB */
    -  *same= !((skipA & 0x1) ^ (*skipB & 0x1)); /* result is 0 or 1 */
    -  trace4((qh ferr, 4054, "qh_matchvertices: matched by skip %d(v%d) and skip %d(v%d) same? %d\n",
    -          skipA, (*skipAp)->id, *skipB, (*(skipBp-1))->id, *same));
    -  return(True);
    -} /* matchvertices */
    -
    -/*---------------------------------
    -
    -  qh_newfacet()
    -    return a new facet
    -
    -  returns:
    -    all fields initialized or cleared   (NULL)
    -    preallocates neighbors set
    -*/
    -facetT *qh_newfacet(void) {
    -  facetT *facet;
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  qh_memalloc_((int)sizeof(facetT), freelistp, facet, facetT);
    -  memset((char *)facet, (size_t)0, sizeof(facetT));
    -  if (qh facet_id == qh tracefacet_id)
    -    qh tracefacet= facet;
    -  facet->id= qh facet_id++;
    -  facet->neighbors= qh_setnew(qh hull_dim);
    -#if !qh_COMPUTEfurthest
    -  facet->furthestdist= 0.0;
    -#endif
    -#if qh_MAXoutside
    -  if (qh FORCEoutput && qh APPROXhull)
    -    facet->maxoutside= qh MINoutside;
    -  else
    -    facet->maxoutside= qh DISTround;
    -#endif
    -  facet->simplicial= True;
    -  facet->good= True;
    -  facet->newfacet= True;
    -  trace4((qh ferr, 4055, "qh_newfacet: created facet f%d\n", facet->id));
    -  return(facet);
    -} /* newfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_newridge()
    -    return a new ridge
    -*/
    -ridgeT *qh_newridge(void) {
    -  ridgeT *ridge;
    -  void **freelistp;   /* used !qh_NOmem */
    -
    -  qh_memalloc_((int)sizeof(ridgeT), freelistp, ridge, ridgeT);
    -  memset((char *)ridge, (size_t)0, sizeof(ridgeT));
    -  zinc_(Ztotridges);
    -  if (qh ridge_id == 0xFFFFFF) {
    -    qh_fprintf(qh ferr, 7074, "\
    -qhull warning: more than %d ridges.  ID field overflows and two ridges\n\
    -may have the same identifier.  Otherwise output ok.\n", 0xFFFFFF);
    -  }
    -  ridge->id= qh ridge_id++;
    -  trace4((qh ferr, 4056, "qh_newridge: created ridge r%d\n", ridge->id));
    -  return(ridge);
    -} /* newridge */
    -
    -
    -/*---------------------------------
    -
    -  qh_pointid(  )
    -    return id for a point,
    -    returns -3 if null, -2 if interior, or -1 if not known
    -
    -  alternative code:
    -    unsigned long id;
    -    id= ((unsigned long)point - (unsigned long)qh.first_point)/qh.normal_size;
    -
    -  notes:
    -    WARN64 -- id truncated to 32-bits, at most 2G points
    -    NOerrors returned (QhullPoint::id)
    -    if point not in point array
    -      the code does a comparison of unrelated pointers.
    -*/
    -int qh_pointid(pointT *point) {
    -  ptr_intT offset, id;
    -
    -  if (!point)
    -    return -3;
    -  else if (point == qh interior_point)
    -    return -2;
    -  else if (point >= qh first_point
    -  && point < qh first_point + qh num_points * qh hull_dim) {
    -    offset= (ptr_intT)(point - qh first_point);
    -    id= offset / qh hull_dim;
    -  }else if ((id= qh_setindex(qh other_points, point)) != -1)
    -    id += qh num_points;
    -  else
    -    return -1;
    -  return (int)id;
    -} /* pointid */
    -
    -/*---------------------------------
    -
    -  qh_removefacet( facet )
    -    unlinks facet from qh.facet_list,
    -
    -  returns:
    -    updates qh.facet_list .newfacet_list .facet_next visible_list
    -    decrements qh.num_facets
    -
    -  see:
    -    qh_appendfacet
    -*/
    -void qh_removefacet(facetT *facet) {
    -  facetT *next= facet->next, *previous= facet->previous;
    -
    -  if (facet == qh newfacet_list)
    -    qh newfacet_list= next;
    -  if (facet == qh facet_next)
    -    qh facet_next= next;
    -  if (facet == qh visible_list)
    -    qh visible_list= next;
    -  if (previous) {
    -    previous->next= next;
    -    next->previous= previous;
    -  }else {  /* 1st facet in qh facet_list */
    -    qh facet_list= next;
    -    qh facet_list->previous= NULL;
    -  }
    -  qh num_facets--;
    -  trace4((qh ferr, 4057, "qh_removefacet: remove f%d from facet_list\n", facet->id));
    -} /* removefacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_removevertex( vertex )
    -    unlinks vertex from qh.vertex_list,
    -
    -  returns:
    -    updates qh.vertex_list .newvertex_list
    -    decrements qh.num_vertices
    -*/
    -void qh_removevertex(vertexT *vertex) {
    -  vertexT *next= vertex->next, *previous= vertex->previous;
    -
    -  if (vertex == qh newvertex_list)
    -    qh newvertex_list= next;
    -  if (previous) {
    -    previous->next= next;
    -    next->previous= previous;
    -  }else {  /* 1st vertex in qh vertex_list */
    -    qh vertex_list= vertex->next;
    -    qh vertex_list->previous= NULL;
    -  }
    -  qh num_vertices--;
    -  trace4((qh ferr, 4058, "qh_removevertex: remove v%d from vertex_list\n", vertex->id));
    -} /* removevertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_updatevertices()
    -    update vertex neighbors and delete interior vertices
    -
    -  returns:
    -    if qh.VERTEXneighbors, updates neighbors for each vertex
    -      if qh.newvertex_list,
    -         removes visible neighbors  from vertex neighbors
    -      if qh.newfacet_list
    -         adds new facets to vertex neighbors
    -    if qh.visible_list
    -       interior vertices added to qh.del_vertices for later partitioning
    -
    -  design:
    -    if qh.VERTEXneighbors
    -      deletes references to visible facets from vertex neighbors
    -      appends new facets to the neighbor list for each vertex
    -      checks all vertices of visible facets
    -        removes visible facets from neighbor lists
    -        marks unused vertices for deletion
    -*/
    -void qh_updatevertices(void /*qh newvertex_list, newfacet_list, visible_list*/) {
    -  facetT *newfacet= NULL, *neighbor, **neighborp, *visible;
    -  vertexT *vertex, **vertexp;
    -
    -  trace3((qh ferr, 3013, "qh_updatevertices: delete interior vertices and update vertex->neighbors\n"));
    -  if (qh VERTEXneighbors) {
    -    FORALLvertex_(qh newvertex_list) {
    -      FOREACHneighbor_(vertex) {
    -        if (neighbor->visible)
    -          SETref_(neighbor)= NULL;
    -      }
    -      qh_setcompact(vertex->neighbors);
    -    }
    -    FORALLnew_facets {
    -      FOREACHvertex_(newfacet->vertices)
    -        qh_setappend(&vertex->neighbors, newfacet);
    -    }
    -    FORALLvisible_facets {
    -      FOREACHvertex_(visible->vertices) {
    -        if (!vertex->newlist && !vertex->deleted) {
    -          FOREACHneighbor_(vertex) { /* this can happen under merging */
    -            if (!neighbor->visible)
    -              break;
    -          }
    -          if (neighbor)
    -            qh_setdel(vertex->neighbors, visible);
    -          else {
    -            vertex->deleted= True;
    -            qh_setappend(&qh del_vertices, vertex);
    -            trace2((qh ferr, 2041, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n",
    -                  qh_pointid(vertex->point), vertex->id, visible->id));
    -          }
    -        }
    -      }
    -    }
    -  }else {  /* !VERTEXneighbors */
    -    FORALLvisible_facets {
    -      FOREACHvertex_(visible->vertices) {
    -        if (!vertex->newlist && !vertex->deleted) {
    -          vertex->deleted= True;
    -          qh_setappend(&qh del_vertices, vertex);
    -          trace2((qh ferr, 2042, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n",
    -                  qh_pointid(vertex->point), vertex->id, visible->id));
    -        }
    -      }
    -    }
    -  }
    -} /* updatevertices */
    -
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.h
    deleted file mode 100644
    index 9cf04cfbac..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly.h
    +++ /dev/null
    @@ -1,295 +0,0 @@
    -/*
      ---------------------------------
    -
    -   poly.h
    -   header file for poly.c and poly2.c
    -
    -   see qh-poly.htm, libqhull.h and poly.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/poly.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFpoly
    -#define qhDEFpoly 1
    -
    -#include "libqhull.h"
    -
    -/*===============   constants ========================== */
    -
    -/*----------------------------------
    -
    -  ALGORITHMfault
    -    use as argument to checkconvex() to report errors during buildhull
    -*/
    -#define qh_ALGORITHMfault 0
    -
    -/*----------------------------------
    -
    -  DATAfault
    -    use as argument to checkconvex() to report errors during initialhull
    -*/
    -#define qh_DATAfault 1
    -
    -/*----------------------------------
    -
    -  DUPLICATEridge
    -    special value for facet->neighbor to indicate a duplicate ridge
    -
    -  notes:
    -    set by matchneighbor, used by matchmatch and mark_dupridge
    -*/
    -#define qh_DUPLICATEridge (facetT *)1L
    -
    -/*----------------------------------
    -
    -  MERGEridge       flag in facet
    -    special value for facet->neighbor to indicate a merged ridge
    -
    -  notes:
    -    set by matchneighbor, used by matchmatch and mark_dupridge
    -*/
    -#define qh_MERGEridge (facetT *)2L
    -
    -
    -/*============ -structures- ====================*/
    -
    -/*=========== -macros- =========================*/
    -
    -/*----------------------------------
    -
    -  FORALLfacet_( facetlist ) { ... }
    -    assign 'facet' to each facet in facetlist
    -
    -  notes:
    -    uses 'facetT *facet;'
    -    assumes last facet is a sentinel
    -
    -  see:
    -    FORALLfacets
    -*/
    -#define FORALLfacet_( facetlist ) if (facetlist ) for ( facet=( facetlist ); facet && facet->next; facet= facet->next )
    -
    -/*----------------------------------
    -
    -  FORALLnew_facets { ... }
    -    assign 'newfacet' to each facet in qh.newfacet_list
    -
    -  notes:
    -    uses 'facetT *newfacet;'
    -    at exit, newfacet==NULL
    -*/
    -#define FORALLnew_facets for ( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
    -
    -/*----------------------------------
    -
    -  FORALLvertex_( vertexlist ) { ... }
    -    assign 'vertex' to each vertex in vertexlist
    -
    -  notes:
    -    uses 'vertexT *vertex;'
    -    at exit, vertex==NULL
    -*/
    -#define FORALLvertex_( vertexlist ) for (vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
    -
    -/*----------------------------------
    -
    -  FORALLvisible_facets { ... }
    -    assign 'visible' to each visible facet in qh.visible_list
    -
    -  notes:
    -    uses 'vacetT *visible;'
    -    at exit, visible==NULL
    -*/
    -#define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
    -
    -/*----------------------------------
    -
    -  FORALLsame_( newfacet ) { ... }
    -    assign 'same' to each facet in newfacet->f.samecycle
    -
    -  notes:
    -    uses 'facetT *same;'
    -    stops when it returns to newfacet
    -*/
    -#define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
    -
    -/*----------------------------------
    -
    -  FORALLsame_cycle_( newfacet ) { ... }
    -    assign 'same' to each facet in newfacet->f.samecycle
    -
    -  notes:
    -    uses 'facetT *same;'
    -    at exit, same == NULL
    -*/
    -#define FORALLsame_cycle_(newfacet) \
    -     for (same= newfacet->f.samecycle; \
    -         same; same= (same == newfacet ?  NULL : same->f.samecycle))
    -
    -/*----------------------------------
    -
    -  FOREACHneighborA_( facet ) { ... }
    -    assign 'neighborA' to each neighbor in facet->neighbors
    -
    -  FOREACHneighborA_( vertex ) { ... }
    -    assign 'neighborA' to each neighbor in vertex->neighbors
    -
    -  declare:
    -    facetT *neighborA, **neighborAp;
    -
    -  see:
    -    FOREACHsetelement_
    -*/
    -#define FOREACHneighborA_(facet)  FOREACHsetelement_(facetT, facet->neighbors, neighborA)
    -
    -/*----------------------------------
    -
    -  FOREACHvisible_( facets ) { ... }
    -    assign 'visible' to each facet in facets
    -
    -  notes:
    -    uses 'facetT *facet, *facetp;'
    -    see FOREACHsetelement_
    -*/
    -#define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
    -
    -/*----------------------------------
    -
    -  FOREACHnewfacet_( facets ) { ... }
    -    assign 'newfacet' to each facet in facets
    -
    -  notes:
    -    uses 'facetT *newfacet, *newfacetp;'
    -    see FOREACHsetelement_
    -*/
    -#define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
    -
    -/*----------------------------------
    -
    -  FOREACHvertexA_( vertices ) { ... }
    -    assign 'vertexA' to each vertex in vertices
    -
    -  notes:
    -    uses 'vertexT *vertexA, *vertexAp;'
    -    see FOREACHsetelement_
    -*/
    -#define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
    -
    -/*----------------------------------
    -
    -  FOREACHvertexreverse12_( vertices ) { ... }
    -    assign 'vertex' to each vertex in vertices
    -    reverse order of first two vertices
    -
    -  notes:
    -    uses 'vertexT *vertex, *vertexp;'
    -    see FOREACHsetelement_
    -*/
    -#define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
    -
    -
    -/*=============== prototypes poly.c in alphabetical order ================*/
    -
    -void    qh_appendfacet(facetT *facet);
    -void    qh_appendvertex(vertexT *vertex);
    -void    qh_attachnewfacets(void);
    -boolT   qh_checkflipped(facetT *facet, realT *dist, boolT allerror);
    -void    qh_delfacet(facetT *facet);
    -void    qh_deletevisible(void /*qh visible_list, qh horizon_list*/);
    -setT   *qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
    -int     qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem);
    -facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
    -void    qh_makenewplanes(void /* newfacet_list */);
    -facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew);
    -facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew);
    -void    qh_matchneighbor(facetT *newfacet, int newskip, int hashsize,
    -                          int *hashcount);
    -void    qh_matchnewfacets(void);
    -boolT   qh_matchvertices(int firstindex, setT *verticesA, int skipA,
    -                          setT *verticesB, int *skipB, boolT *same);
    -facetT *qh_newfacet(void);
    -ridgeT *qh_newridge(void);
    -int     qh_pointid(pointT *point);
    -void    qh_removefacet(facetT *facet);
    -void    qh_removevertex(vertexT *vertex);
    -void    qh_updatevertices(void);
    -
    -
    -/*========== -prototypes poly2.c in alphabetical order ===========*/
    -
    -void    qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash);
    -void    qh_check_bestdist(void);
    -void    qh_check_maxout(void);
    -void    qh_check_output(void);
    -void    qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
    -void    qh_check_points(void);
    -void    qh_checkconvex(facetT *facetlist, int fault);
    -void    qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
    -void    qh_checkflipped_all(facetT *facetlist);
    -void    qh_checkpolygon(facetT *facetlist);
    -void    qh_checkvertex(vertexT *vertex);
    -void    qh_clearcenters(qh_CENTER type);
    -void    qh_createsimplex(setT *vertices);
    -void    qh_delridge(ridgeT *ridge);
    -void    qh_delvertex(vertexT *vertex);
    -setT   *qh_facet3vertex(facetT *facet);
    -facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
    -           realT *bestdist, boolT *isoutside);
    -facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart);
    -facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside,
    -                          int *numpart);
    -int     qh_findgood(facetT *facetlist, int goodhorizon);
    -void    qh_findgood_all(facetT *facetlist);
    -void    qh_furthestnext(void /* qh facet_list */);
    -void    qh_furthestout(facetT *facet);
    -void    qh_infiniteloop(facetT *facet);
    -void    qh_initbuild(void);
    -void    qh_initialhull(setT *vertices);
    -setT   *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
    -vertexT *qh_isvertex(pointT *point, setT *vertices);
    -vertexT *qh_makenewfacets(pointT *point /*horizon_list, visible_list*/);
    -void    qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount);
    -void    qh_nearcoplanar(void /* qh.facet_list */);
    -vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
    -int     qh_newhashtable(int newsize);
    -vertexT *qh_newvertex(pointT *point);
    -ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp);
    -void    qh_outcoplanar(void /* facet_list */);
    -pointT *qh_point(int id);
    -void    qh_point_add(setT *set, pointT *point, void *elem);
    -setT   *qh_pointfacet(void /*qh facet_list*/);
    -setT   *qh_pointvertex(void /*qh facet_list*/);
    -void    qh_prependfacet(facetT *facet, facetT **facetlist);
    -void    qh_printhashtable(FILE *fp);
    -void    qh_printlists(void);
    -void    qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/);
    -void    qh_setvoronoi_all(void);
    -void    qh_triangulate(void /*qh facet_list*/);
    -void    qh_triangulate_facet(facetT *facetA, vertexT **first_vertex);
    -void    qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
    -void    qh_triangulate_mirror(facetT *facetA, facetT *facetB);
    -void    qh_triangulate_null(facetT *facetA);
    -void    qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
    -setT   *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
    -void    qh_vertexneighbors(void /*qh facet_list*/);
    -boolT   qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
    -
    -
    -#endif /* qhDEFpoly */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly2.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly2.c
    deleted file mode 100644
    index 317461fc54..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/poly2.c
    +++ /dev/null
    @@ -1,3154 +0,0 @@
    -/*
      ---------------------------------
    -
    -   poly2.c
    -   implements polygons and simplices
    -
    -   see qh-poly.htm, poly.h and libqhull.h
    -
    -   frequently used code is in poly.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/poly2.c#5 $$Change: 1490 $
    -   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*======== functions in alphabetical order ==========*/
    -
    -/*---------------------------------
    -
    -  qh_addhash( newelem, hashtable, hashsize, hash )
    -    add newelem to linear hash table at hash if not already there
    -*/
    -void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash) {
    -  int scan;
    -  void *elem;
    -
    -  for (scan= (int)hash; (elem= SETelem_(hashtable, scan));
    -       scan= (++scan >= hashsize ? 0 : scan)) {
    -    if (elem == newelem)
    -      break;
    -  }
    -  /* loop terminates because qh_HASHfactor >= 1.1 by qh_initbuffers */
    -  if (!elem)
    -    SETelem_(hashtable, scan)= newelem;
    -} /* addhash */
    -
    -/*---------------------------------
    -
    -  qh_check_bestdist()
    -    check that all points are within max_outside of the nearest facet
    -    if qh.ONLYgood,
    -      ignores !good facets
    -
    -  see:
    -    qh_check_maxout(), qh_outerinner()
    -
    -  notes:
    -    only called from qh_check_points()
    -      seldom used since qh.MERGING is almost always set
    -    if notverified>0 at end of routine
    -      some points were well inside the hull.  If the hull contains
    -      a lens-shaped component, these points were not verified.  Use
    -      options 'Qi Tv' to verify all points.  (Exhaustive check also verifies)
    -
    -  design:
    -    determine facet for each point (if any)
    -    for each point
    -      start with the assigned facet or with the first facet
    -      find the best facet for the point and check all coplanar facets
    -      error if point is outside of facet
    -*/
    -void qh_check_bestdist(void) {
    -  boolT waserror= False, unassigned;
    -  facetT *facet, *bestfacet, *errfacet1= NULL, *errfacet2= NULL;
    -  facetT *facetlist;
    -  realT dist, maxoutside, maxdist= -REALmax;
    -  pointT *point;
    -  int numpart= 0, facet_i, facet_n, notgood= 0, notverified= 0;
    -  setT *facets;
    -
    -  trace1((qh ferr, 1020, "qh_check_bestdist: check points below nearest facet.  Facet_list f%d\n",
    -      qh facet_list->id));
    -  maxoutside= qh_maxouter();
    -  maxoutside += qh DISTround;
    -  /* one more qh.DISTround for check computation */
    -  trace1((qh ferr, 1021, "qh_check_bestdist: check that all points are within %2.2g of best facet\n", maxoutside));
    -  facets= qh_pointfacet(/*qh facet_list*/);
    -  if (!qh_QUICKhelp && qh PRINTprecision)
    -    qh_fprintf(qh ferr, 8091, "\n\
    -qhull output completed.  Verifying that %d points are\n\
    -below %2.2g of the nearest %sfacet.\n",
    -             qh_setsize(facets), maxoutside, (qh ONLYgood ?  "good " : ""));
    -  FOREACHfacet_i_(facets) {  /* for each point with facet assignment */
    -    if (facet)
    -      unassigned= False;
    -    else {
    -      unassigned= True;
    -      facet= qh facet_list;
    -    }
    -    point= qh_point(facet_i);
    -    if (point == qh GOODpointp)
    -      continue;
    -    qh_distplane(point, facet, &dist);
    -    numpart++;
    -    bestfacet= qh_findbesthorizon(!qh_IScheckmax, point, facet, qh_NOupper, &dist, &numpart);
    -    /* occurs after statistics reported */
    -    maximize_(maxdist, dist);
    -    if (dist > maxoutside) {
    -      if (qh ONLYgood && !bestfacet->good
    -          && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist))
    -               && dist > maxoutside))
    -        notgood++;
    -      else {
    -        waserror= True;
    -        qh_fprintf(qh ferr, 6109, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n",
    -                facet_i, bestfacet->id, dist, maxoutside);
    -        if (errfacet1 != bestfacet) {
    -          errfacet2= errfacet1;
    -          errfacet1= bestfacet;
    -        }
    -      }
    -    }else if (unassigned && dist < -qh MAXcoplanar)
    -      notverified++;
    -  }
    -  qh_settempfree(&facets);
    -  if (notverified && !qh DELAUNAY && !qh_QUICKhelp && qh PRINTprecision)
    -    qh_fprintf(qh ferr, 8092, "\n%d points were well inside the hull.  If the hull contains\n\
    -a lens-shaped component, these points were not verified.  Use\n\
    -options 'Qci Tv' to verify all points.\n", notverified);
    -  if (maxdist > qh outside_err) {
    -    qh_fprintf(qh ferr, 6110, "qhull precision error (qh_check_bestdist): a coplanar point is %6.2g from convex hull.  The maximum value(qh.outside_err) is %6.2g\n",
    -              maxdist, qh outside_err);
    -    qh_errexit2 (qh_ERRprec, errfacet1, errfacet2);
    -  }else if (waserror && qh outside_err > REALmax/2)
    -    qh_errexit2 (qh_ERRprec, errfacet1, errfacet2);
    -  /* else if waserror, the error was logged to qh.ferr but does not effect the output */
    -  trace0((qh ferr, 20, "qh_check_bestdist: max distance outside %2.2g\n", maxdist));
    -} /* check_bestdist */
    -
    -/*---------------------------------
    -
    -  qh_check_maxout()
    -    updates qh.max_outside by checking all points against bestfacet
    -    if qh.ONLYgood, ignores !good facets
    -
    -  returns:
    -    updates facet->maxoutside via qh_findbesthorizon()
    -    sets qh.maxoutdone
    -    if printing qh.min_vertex (qh_outerinner),
    -      it is updated to the current vertices
    -    removes inside/coplanar points from coplanarset as needed
    -
    -  notes:
    -    defines coplanar as min_vertex instead of MAXcoplanar
    -    may not need to check near-inside points because of qh.MAXcoplanar
    -      and qh.KEEPnearinside (before it was -DISTround)
    -
    -  see also:
    -    qh_check_bestdist()
    -
    -  design:
    -    if qh.min_vertex is needed
    -      for all neighbors of all vertices
    -        test distance from vertex to neighbor
    -    determine facet for each point (if any)
    -    for each point with an assigned facet
    -      find the best facet for the point and check all coplanar facets
    -        (updates outer planes)
    -    remove near-inside points from coplanar sets
    -*/
    -#ifndef qh_NOmerge
    -void qh_check_maxout(void) {
    -  facetT *facet, *bestfacet, *neighbor, **neighborp, *facetlist;
    -  realT dist, maxoutside, minvertex, old_maxoutside;
    -  pointT *point;
    -  int numpart= 0, facet_i, facet_n, notgood= 0;
    -  setT *facets, *vertices;
    -  vertexT *vertex;
    -
    -  trace1((qh ferr, 1022, "qh_check_maxout: check and update maxoutside for each facet.\n"));
    -  maxoutside= minvertex= 0;
    -  if (qh VERTEXneighbors
    -  && (qh PRINTsummary || qh KEEPinside || qh KEEPcoplanar
    -        || qh TRACElevel || qh PRINTstatistics
    -        || qh PRINTout[0] == qh_PRINTsummary || qh PRINTout[0] == qh_PRINTnone)) {
    -    trace1((qh ferr, 1023, "qh_check_maxout: determine actual maxoutside and minvertex\n"));
    -    vertices= qh_pointvertex(/*qh facet_list*/);
    -    FORALLvertices {
    -      FOREACHneighbor_(vertex) {
    -        zinc_(Zdistvertex);  /* distance also computed by main loop below */
    -        qh_distplane(vertex->point, neighbor, &dist);
    -        minimize_(minvertex, dist);
    -        if (-dist > qh TRACEdist || dist > qh TRACEdist
    -        || neighbor == qh tracefacet || vertex == qh tracevertex)
    -          qh_fprintf(qh ferr, 8093, "qh_check_maxout: p%d(v%d) is %.2g from f%d\n",
    -                    qh_pointid(vertex->point), vertex->id, dist, neighbor->id);
    -      }
    -    }
    -    if (qh MERGING) {
    -      wmin_(Wminvertex, qh min_vertex);
    -    }
    -    qh min_vertex= minvertex;
    -    qh_settempfree(&vertices);
    -  }
    -  facets= qh_pointfacet(/*qh facet_list*/);
    -  do {
    -    old_maxoutside= fmax_(qh max_outside, maxoutside);
    -    FOREACHfacet_i_(facets) {     /* for each point with facet assignment */
    -      if (facet) {
    -        point= qh_point(facet_i);
    -        if (point == qh GOODpointp)
    -          continue;
    -        zzinc_(Ztotcheck);
    -        qh_distplane(point, facet, &dist);
    -        numpart++;
    -        bestfacet= qh_findbesthorizon(qh_IScheckmax, point, facet, !qh_NOupper, &dist, &numpart);
    -        if (bestfacet && dist > maxoutside) {
    -          if (qh ONLYgood && !bestfacet->good
    -          && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist))
    -               && dist > maxoutside))
    -            notgood++;
    -          else
    -            maxoutside= dist;
    -        }
    -        if (dist > qh TRACEdist || (bestfacet && bestfacet == qh tracefacet))
    -          qh_fprintf(qh ferr, 8094, "qh_check_maxout: p%d is %.2g above f%d\n",
    -                     qh_pointid(point), dist, bestfacet->id);
    -      }
    -    }
    -  }while
    -    (maxoutside > 2*old_maxoutside);
    -    /* if qh.maxoutside increases substantially, qh_SEARCHdist is not valid
    -          e.g., RBOX 5000 s Z1 G1e-13 t1001200614 | qhull */
    -  zzadd_(Zcheckpart, numpart);
    -  qh_settempfree(&facets);
    -  wval_(Wmaxout)= maxoutside - qh max_outside;
    -  wmax_(Wmaxoutside, qh max_outside);
    -  qh max_outside= maxoutside;
    -  qh_nearcoplanar(/*qh.facet_list*/);
    -  qh maxoutdone= True;
    -  trace1((qh ferr, 1024, "qh_check_maxout: maxoutside %2.2g, min_vertex %2.2g, outside of not good %d\n",
    -       maxoutside, qh min_vertex, notgood));
    -} /* check_maxout */
    -#else /* qh_NOmerge */
    -void qh_check_maxout(void) {
    -}
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_check_output()
    -    performs the checks at the end of qhull algorithm
    -    Maybe called after voronoi output.  Will recompute otherwise centrums are Voronoi centers instead
    -*/
    -void qh_check_output(void) {
    -  int i;
    -
    -  if (qh STOPcone)
    -    return;
    -  if (qh VERIFYoutput | qh IStracing | qh CHECKfrequently) {
    -    qh_checkpolygon(qh facet_list);
    -    qh_checkflipped_all(qh facet_list);
    -    qh_checkconvex(qh facet_list, qh_ALGORITHMfault);
    -  }else if (!qh MERGING && qh_newstats(qhstat precision, &i)) {
    -    qh_checkflipped_all(qh facet_list);
    -    qh_checkconvex(qh facet_list, qh_ALGORITHMfault);
    -  }
    -} /* check_output */
    -
    -
    -
    -/*---------------------------------
    -
    -  qh_check_point( point, facet, maxoutside, maxdist, errfacet1, errfacet2 )
    -    check that point is less than maxoutside from facet
    -*/
    -void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2) {
    -  realT dist;
    -
    -  /* occurs after statistics reported */
    -  qh_distplane(point, facet, &dist);
    -  if (dist > *maxoutside) {
    -    if (*errfacet1 != facet) {
    -      *errfacet2= *errfacet1;
    -      *errfacet1= facet;
    -    }
    -    qh_fprintf(qh ferr, 6111, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n",
    -              qh_pointid(point), facet->id, dist, *maxoutside);
    -  }
    -  maximize_(*maxdist, dist);
    -} /* qh_check_point */
    -
    -
    -/*---------------------------------
    -
    -  qh_check_points()
    -    checks that all points are inside all facets
    -
    -  notes:
    -    if many points and qh_check_maxout not called (i.e., !qh.MERGING),
    -       calls qh_findbesthorizon (seldom done).
    -    ignores flipped facets
    -    maxoutside includes 2 qh.DISTrounds
    -      one qh.DISTround for the computed distances in qh_check_points
    -    qh_printafacet and qh_printsummary needs only one qh.DISTround
    -    the computation for qh.VERIFYdirect does not account for qh.other_points
    -
    -  design:
    -    if many points
    -      use qh_check_bestdist()
    -    else
    -      for all facets
    -        for all points
    -          check that point is inside facet
    -*/
    -void qh_check_points(void) {
    -  facetT *facet, *errfacet1= NULL, *errfacet2= NULL;
    -  realT total, maxoutside, maxdist= -REALmax;
    -  pointT *point, **pointp, *pointtemp;
    -  boolT testouter;
    -
    -  maxoutside= qh_maxouter();
    -  maxoutside += qh DISTround;
    -  /* one more qh.DISTround for check computation */
    -  trace1((qh ferr, 1025, "qh_check_points: check all points below %2.2g of all facet planes\n",
    -          maxoutside));
    -  if (qh num_good)   /* miss counts other_points and !good facets */
    -     total= (float)qh num_good * (float)qh num_points;
    -  else
    -     total= (float)qh num_facets * (float)qh num_points;
    -  if (total >= qh_VERIFYdirect && !qh maxoutdone) {
    -    if (!qh_QUICKhelp && qh SKIPcheckmax && qh MERGING)
    -      qh_fprintf(qh ferr, 7075, "qhull input warning: merging without checking outer planes('Q5' or 'Po').\n\
    -Verify may report that a point is outside of a facet.\n");
    -    qh_check_bestdist();
    -  }else {
    -    if (qh_MAXoutside && qh maxoutdone)
    -      testouter= True;
    -    else
    -      testouter= False;
    -    if (!qh_QUICKhelp) {
    -      if (qh MERGEexact)
    -        qh_fprintf(qh ferr, 7076, "qhull input warning: exact merge ('Qx').  Verify may report that a point\n\
    -is outside of a facet.  See qh-optq.htm#Qx\n");
    -      else if (qh SKIPcheckmax || qh NOnearinside)
    -        qh_fprintf(qh ferr, 7077, "qhull input warning: no outer plane check ('Q5') or no processing of\n\
    -near-inside points ('Q8').  Verify may report that a point is outside\n\
    -of a facet.\n");
    -    }
    -    if (qh PRINTprecision) {
    -      if (testouter)
    -        qh_fprintf(qh ferr, 8098, "\n\
    -Output completed.  Verifying that all points are below outer planes of\n\
    -all %sfacets.  Will make %2.0f distance computations.\n",
    -              (qh ONLYgood ?  "good " : ""), total);
    -      else
    -        qh_fprintf(qh ferr, 8099, "\n\
    -Output completed.  Verifying that all points are below %2.2g of\n\
    -all %sfacets.  Will make %2.0f distance computations.\n",
    -              maxoutside, (qh ONLYgood ?  "good " : ""), total);
    -    }
    -    FORALLfacets {
    -      if (!facet->good && qh ONLYgood)
    -        continue;
    -      if (facet->flipped)
    -        continue;
    -      if (!facet->normal) {
    -        qh_fprintf(qh ferr, 7061, "qhull warning (qh_check_points): missing normal for facet f%d\n", facet->id);
    -        continue;
    -      }
    -      if (testouter) {
    -#if qh_MAXoutside
    -        maxoutside= facet->maxoutside + 2* qh DISTround;
    -        /* one DISTround to actual point and another to computed point */
    -#endif
    -      }
    -      FORALLpoints {
    -        if (point != qh GOODpointp)
    -          qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2);
    -      }
    -      FOREACHpoint_(qh other_points) {
    -        if (point != qh GOODpointp)
    -          qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2);
    -      }
    -    }
    -    if (maxdist > qh outside_err) {
    -      qh_fprintf(qh ferr, 6112, "qhull precision error (qh_check_points): a coplanar point is %6.2g from convex hull.  The maximum value(qh.outside_err) is %6.2g\n",
    -                maxdist, qh outside_err );
    -      qh_errexit2( qh_ERRprec, errfacet1, errfacet2 );
    -    }else if (errfacet1 && qh outside_err > REALmax/2)
    -        qh_errexit2( qh_ERRprec, errfacet1, errfacet2 );
    -    /* else if errfacet1, the error was logged to qh.ferr but does not effect the output */
    -    trace0((qh ferr, 21, "qh_check_points: max distance outside %2.2g\n", maxdist));
    -  }
    -} /* check_points */
    -
    -
    -/*---------------------------------
    -
    -  qh_checkconvex( facetlist, fault )
    -    check that each ridge in facetlist is convex
    -    fault = qh_DATAfault if reporting errors
    -          = qh_ALGORITHMfault otherwise
    -
    -  returns:
    -    counts Zconcaveridges and Zcoplanarridges
    -    errors if concaveridge or if merging an coplanar ridge
    -
    -  note:
    -    if not merging,
    -      tests vertices for neighboring simplicial facets
    -    else if ZEROcentrum,
    -      tests vertices for neighboring simplicial   facets
    -    else
    -      tests centrums of neighboring facets
    -
    -  design:
    -    for all facets
    -      report flipped facets
    -      if ZEROcentrum and simplicial neighbors
    -        test vertices for neighboring simplicial facets
    -      else
    -        test centrum against all neighbors
    -*/
    -void qh_checkconvex(facetT *facetlist, int fault) {
    -  facetT *facet, *neighbor, **neighborp, *errfacet1=NULL, *errfacet2=NULL;
    -  vertexT *vertex;
    -  realT dist;
    -  pointT *centrum;
    -  boolT waserror= False, centrum_warning= False, tempcentrum= False, allsimplicial;
    -  int neighbor_i;
    -
    -  trace1((qh ferr, 1026, "qh_checkconvex: check all ridges are convex\n"));
    -  if (!qh RERUN) {
    -    zzval_(Zconcaveridges)= 0;
    -    zzval_(Zcoplanarridges)= 0;
    -  }
    -  FORALLfacet_(facetlist) {
    -    if (facet->flipped) {
    -      qh_precision("flipped facet");
    -      qh_fprintf(qh ferr, 6113, "qhull precision error: f%d is flipped(interior point is outside)\n",
    -               facet->id);
    -      errfacet1= facet;
    -      waserror= True;
    -      continue;
    -    }
    -    if (qh MERGING && (!qh ZEROcentrum || !facet->simplicial || facet->tricoplanar))
    -      allsimplicial= False;
    -    else {
    -      allsimplicial= True;
    -      neighbor_i= 0;
    -      FOREACHneighbor_(facet) {
    -        vertex= SETelemt_(facet->vertices, neighbor_i++, vertexT);
    -        if (!neighbor->simplicial || neighbor->tricoplanar) {
    -          allsimplicial= False;
    -          continue;
    -        }
    -        qh_distplane(vertex->point, neighbor, &dist);
    -        if (dist > -qh DISTround) {
    -          if (fault == qh_DATAfault) {
    -            qh_precision("coplanar or concave ridge");
    -            qh_fprintf(qh ferr, 6114, "qhull precision error: initial simplex is not convex. Distance=%.2g\n", dist);
    -            qh_errexit(qh_ERRsingular, NULL, NULL);
    -          }
    -          if (dist > qh DISTround) {
    -            zzinc_(Zconcaveridges);
    -            qh_precision("concave ridge");
    -            qh_fprintf(qh ferr, 6115, "qhull precision error: f%d is concave to f%d, since p%d(v%d) is %6.4g above\n",
    -              facet->id, neighbor->id, qh_pointid(vertex->point), vertex->id, dist);
    -            errfacet1= facet;
    -            errfacet2= neighbor;
    -            waserror= True;
    -          }else if (qh ZEROcentrum) {
    -            if (dist > 0) {     /* qh_checkzero checks that dist < - qh DISTround */
    -              zzinc_(Zcoplanarridges);
    -              qh_precision("coplanar ridge");
    -              qh_fprintf(qh ferr, 6116, "qhull precision error: f%d is clearly not convex to f%d, since p%d(v%d) is %6.4g above\n",
    -                facet->id, neighbor->id, qh_pointid(vertex->point), vertex->id, dist);
    -              errfacet1= facet;
    -              errfacet2= neighbor;
    -              waserror= True;
    -            }
    -          }else {
    -            zzinc_(Zcoplanarridges);
    -            qh_precision("coplanar ridge");
    -            trace0((qh ferr, 22, "qhull precision error: f%d may be coplanar to f%d, since p%d(v%d) is within %6.4g during p%d\n",
    -              facet->id, neighbor->id, qh_pointid(vertex->point), vertex->id, dist, qh furthest_id));
    -          }
    -        }
    -      }
    -    }
    -    if (!allsimplicial) {
    -      if (qh CENTERtype == qh_AScentrum) {
    -        if (!facet->center)
    -          facet->center= qh_getcentrum(facet);
    -        centrum= facet->center;
    -      }else {
    -        if (!centrum_warning && (!facet->simplicial || facet->tricoplanar)) {
    -           centrum_warning= True;
    -           qh_fprintf(qh ferr, 7062, "qhull warning: recomputing centrums for convexity test.  This may lead to false, precision errors.\n");
    -        }
    -        centrum= qh_getcentrum(facet);
    -        tempcentrum= True;
    -      }
    -      FOREACHneighbor_(facet) {
    -        if (qh ZEROcentrum && facet->simplicial && neighbor->simplicial)
    -          continue;
    -        if (facet->tricoplanar || neighbor->tricoplanar)
    -          continue;
    -        zzinc_(Zdistconvex);
    -        qh_distplane(centrum, neighbor, &dist);
    -        if (dist > qh DISTround) {
    -          zzinc_(Zconcaveridges);
    -          qh_precision("concave ridge");
    -          qh_fprintf(qh ferr, 6117, "qhull precision error: f%d is concave to f%d.  Centrum of f%d is %6.4g above f%d\n",
    -            facet->id, neighbor->id, facet->id, dist, neighbor->id);
    -          errfacet1= facet;
    -          errfacet2= neighbor;
    -          waserror= True;
    -        }else if (dist >= 0.0) {   /* if arithmetic always rounds the same,
    -                                     can test against centrum radius instead */
    -          zzinc_(Zcoplanarridges);
    -          qh_precision("coplanar ridge");
    -          qh_fprintf(qh ferr, 6118, "qhull precision error: f%d is coplanar or concave to f%d.  Centrum of f%d is %6.4g above f%d\n",
    -            facet->id, neighbor->id, facet->id, dist, neighbor->id);
    -          errfacet1= facet;
    -          errfacet2= neighbor;
    -          waserror= True;
    -        }
    -      }
    -      if (tempcentrum)
    -        qh_memfree(centrum, qh normal_size);
    -    }
    -  }
    -  if (waserror && !qh FORCEoutput)
    -    qh_errexit2 (qh_ERRprec, errfacet1, errfacet2);
    -} /* checkconvex */
    -
    -
    -/*---------------------------------
    -
    -  qh_checkfacet( facet, newmerge, waserror )
    -    checks for consistency errors in facet
    -    newmerge set if from merge.c
    -
    -  returns:
    -    sets waserror if any error occurs
    -
    -  checks:
    -    vertex ids are inverse sorted
    -    unless newmerge, at least hull_dim neighbors and vertices (exactly if simplicial)
    -    if non-simplicial, at least as many ridges as neighbors
    -    neighbors are not duplicated
    -    ridges are not duplicated
    -    in 3-d, ridges=verticies
    -    (qh.hull_dim-1) ridge vertices
    -    neighbors are reciprocated
    -    ridge neighbors are facet neighbors and a ridge for every neighbor
    -    simplicial neighbors match facetintersect
    -    vertex intersection matches vertices of common ridges
    -    vertex neighbors and facet vertices agree
    -    all ridges have distinct vertex sets
    -
    -  notes:
    -    uses neighbor->seen
    -
    -  design:
    -    check sets
    -    check vertices
    -    check sizes of neighbors and vertices
    -    check for qh_MERGEridge and qh_DUPLICATEridge flags
    -    check neighbor set
    -    check ridge set
    -    check ridges, neighbors, and vertices
    -*/
    -void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) {
    -  facetT *neighbor, **neighborp, *errother=NULL;
    -  ridgeT *ridge, **ridgep, *errridge= NULL, *ridge2;
    -  vertexT *vertex, **vertexp;
    -  unsigned previousid= INT_MAX;
    -  int numneighbors, numvertices, numridges=0, numRvertices=0;
    -  boolT waserror= False;
    -  int skipA, skipB, ridge_i, ridge_n, i;
    -  setT *intersection;
    -
    -  if (facet->visible) {
    -    qh_fprintf(qh ferr, 6119, "qhull internal error (qh_checkfacet): facet f%d is on the visible_list\n",
    -      facet->id);
    -    qh_errexit(qh_ERRqhull, facet, NULL);
    -  }
    -  if (!facet->normal) {
    -    qh_fprintf(qh ferr, 6120, "qhull internal error (qh_checkfacet): facet f%d does not have  a normal\n",
    -      facet->id);
    -    waserror= True;
    -  }
    -  qh_setcheck(facet->vertices, "vertices for f", facet->id);
    -  qh_setcheck(facet->ridges, "ridges for f", facet->id);
    -  qh_setcheck(facet->outsideset, "outsideset for f", facet->id);
    -  qh_setcheck(facet->coplanarset, "coplanarset for f", facet->id);
    -  qh_setcheck(facet->neighbors, "neighbors for f", facet->id);
    -  FOREACHvertex_(facet->vertices) {
    -    if (vertex->deleted) {
    -      qh_fprintf(qh ferr, 6121, "qhull internal error (qh_checkfacet): deleted vertex v%d in f%d\n", vertex->id, facet->id);
    -      qh_errprint("ERRONEOUS", NULL, NULL, NULL, vertex);
    -      waserror= True;
    -    }
    -    if (vertex->id >= previousid) {
    -      qh_fprintf(qh ferr, 6122, "qhull internal error (qh_checkfacet): vertices of f%d are not in descending id order at v%d\n", facet->id, vertex->id);
    -      waserror= True;
    -      break;
    -    }
    -    previousid= vertex->id;
    -  }
    -  numneighbors= qh_setsize(facet->neighbors);
    -  numvertices= qh_setsize(facet->vertices);
    -  numridges= qh_setsize(facet->ridges);
    -  if (facet->simplicial) {
    -    if (numvertices+numneighbors != 2*qh hull_dim
    -    && !facet->degenerate && !facet->redundant) {
    -      qh_fprintf(qh ferr, 6123, "qhull internal error (qh_checkfacet): for simplicial facet f%d, #vertices %d + #neighbors %d != 2*qh hull_dim\n",
    -                facet->id, numvertices, numneighbors);
    -      qh_setprint(qh ferr, "", facet->neighbors);
    -      waserror= True;
    -    }
    -  }else { /* non-simplicial */
    -    if (!newmerge
    -    &&(numvertices < qh hull_dim || numneighbors < qh hull_dim)
    -    && !facet->degenerate && !facet->redundant) {
    -      qh_fprintf(qh ferr, 6124, "qhull internal error (qh_checkfacet): for facet f%d, #vertices %d or #neighbors %d < qh hull_dim\n",
    -         facet->id, numvertices, numneighbors);
    -       waserror= True;
    -    }
    -    /* in 3-d, can get a vertex twice in an edge list, e.g., RBOX 1000 s W1e-13 t995849315 D2 | QHULL d Tc Tv TP624 TW1e-13 T4 */
    -    if (numridges < numneighbors
    -    ||(qh hull_dim == 3 && numvertices > numridges && !qh NEWfacets)
    -    ||(qh hull_dim == 2 && numridges + numvertices + numneighbors != 6)) {
    -      if (!facet->degenerate && !facet->redundant) {
    -        qh_fprintf(qh ferr, 6125, "qhull internal error (qh_checkfacet): for facet f%d, #ridges %d < #neighbors %d or(3-d) > #vertices %d or(2-d) not all 2\n",
    -            facet->id, numridges, numneighbors, numvertices);
    -        waserror= True;
    -      }
    -    }
    -  }
    -  FOREACHneighbor_(facet) {
    -    if (neighbor == qh_MERGEridge || neighbor == qh_DUPLICATEridge) {
    -      qh_fprintf(qh ferr, 6126, "qhull internal error (qh_checkfacet): facet f%d still has a MERGE or DUP neighbor\n", facet->id);
    -      qh_errexit(qh_ERRqhull, facet, NULL);
    -    }
    -    neighbor->seen= True;
    -  }
    -  FOREACHneighbor_(facet) {
    -    if (!qh_setin(neighbor->neighbors, facet)) {
    -      qh_fprintf(qh ferr, 6127, "qhull internal error (qh_checkfacet): facet f%d has neighbor f%d, but f%d does not have neighbor f%d\n",
    -              facet->id, neighbor->id, neighbor->id, facet->id);
    -      errother= neighbor;
    -      waserror= True;
    -    }
    -    if (!neighbor->seen) {
    -      qh_fprintf(qh ferr, 6128, "qhull internal error (qh_checkfacet): facet f%d has a duplicate neighbor f%d\n",
    -              facet->id, neighbor->id);
    -      errother= neighbor;
    -      waserror= True;
    -    }
    -    neighbor->seen= False;
    -  }
    -  FOREACHridge_(facet->ridges) {
    -    qh_setcheck(ridge->vertices, "vertices for r", ridge->id);
    -    ridge->seen= False;
    -  }
    -  FOREACHridge_(facet->ridges) {
    -    if (ridge->seen) {
    -      qh_fprintf(qh ferr, 6129, "qhull internal error (qh_checkfacet): facet f%d has a duplicate ridge r%d\n",
    -              facet->id, ridge->id);
    -      errridge= ridge;
    -      waserror= True;
    -    }
    -    ridge->seen= True;
    -    numRvertices= qh_setsize(ridge->vertices);
    -    if (numRvertices != qh hull_dim - 1) {
    -      qh_fprintf(qh ferr, 6130, "qhull internal error (qh_checkfacet): ridge between f%d and f%d has %d vertices\n",
    -                ridge->top->id, ridge->bottom->id, numRvertices);
    -      errridge= ridge;
    -      waserror= True;
    -    }
    -    neighbor= otherfacet_(ridge, facet);
    -    neighbor->seen= True;
    -    if (!qh_setin(facet->neighbors, neighbor)) {
    -      qh_fprintf(qh ferr, 6131, "qhull internal error (qh_checkfacet): for facet f%d, neighbor f%d of ridge r%d not in facet\n",
    -           facet->id, neighbor->id, ridge->id);
    -      errridge= ridge;
    -      waserror= True;
    -    }
    -  }
    -  if (!facet->simplicial) {
    -    FOREACHneighbor_(facet) {
    -      if (!neighbor->seen) {
    -        qh_fprintf(qh ferr, 6132, "qhull internal error (qh_checkfacet): facet f%d does not have a ridge for neighbor f%d\n",
    -              facet->id, neighbor->id);
    -        errother= neighbor;
    -        waserror= True;
    -      }
    -      intersection= qh_vertexintersect_new(facet->vertices, neighbor->vertices);
    -      qh_settemppush(intersection);
    -      FOREACHvertex_(facet->vertices) {
    -        vertex->seen= False;
    -        vertex->seen2= False;
    -      }
    -      FOREACHvertex_(intersection)
    -        vertex->seen= True;
    -      FOREACHridge_(facet->ridges) {
    -        if (neighbor != otherfacet_(ridge, facet))
    -            continue;
    -        FOREACHvertex_(ridge->vertices) {
    -          if (!vertex->seen) {
    -            qh_fprintf(qh ferr, 6133, "qhull internal error (qh_checkfacet): vertex v%d in r%d not in f%d intersect f%d\n",
    -                  vertex->id, ridge->id, facet->id, neighbor->id);
    -            qh_errexit(qh_ERRqhull, facet, ridge);
    -          }
    -          vertex->seen2= True;
    -        }
    -      }
    -      if (!newmerge) {
    -        FOREACHvertex_(intersection) {
    -          if (!vertex->seen2) {
    -            if (qh IStracing >=3 || !qh MERGING) {
    -              qh_fprintf(qh ferr, 6134, "qhull precision error (qh_checkfacet): vertex v%d in f%d intersect f%d but\n\
    - not in a ridge.  This is ok under merging.  Last point was p%d\n",
    -                     vertex->id, facet->id, neighbor->id, qh furthest_id);
    -              if (!qh FORCEoutput && !qh MERGING) {
    -                qh_errprint("ERRONEOUS", facet, neighbor, NULL, vertex);
    -                if (!qh MERGING)
    -                  qh_errexit(qh_ERRqhull, NULL, NULL);
    -              }
    -            }
    -          }
    -        }
    -      }
    -      qh_settempfree(&intersection);
    -    }
    -  }else { /* simplicial */
    -    FOREACHneighbor_(facet) {
    -      if (neighbor->simplicial) {
    -        skipA= SETindex_(facet->neighbors, neighbor);
    -        skipB= qh_setindex(neighbor->neighbors, facet);
    -        if (!qh_setequal_skip(facet->vertices, skipA, neighbor->vertices, skipB)) {
    -          qh_fprintf(qh ferr, 6135, "qhull internal error (qh_checkfacet): facet f%d skip %d and neighbor f%d skip %d do not match \n",
    -                   facet->id, skipA, neighbor->id, skipB);
    -          errother= neighbor;
    -          waserror= True;
    -        }
    -      }
    -    }
    -  }
    -  if (qh hull_dim < 5 && (qh IStracing > 2 || qh CHECKfrequently)) {
    -    FOREACHridge_i_(facet->ridges) {           /* expensive */
    -      for (i=ridge_i+1; i < ridge_n; i++) {
    -        ridge2= SETelemt_(facet->ridges, i, ridgeT);
    -        if (qh_setequal(ridge->vertices, ridge2->vertices)) {
    -          qh_fprintf(qh ferr, 6227, "Qhull internal error (qh_checkfacet): ridges r%d and r%d have the same vertices\n",
    -                  ridge->id, ridge2->id);
    -          errridge= ridge;
    -          waserror= True;
    -        }
    -      }
    -    }
    -  }
    -  if (waserror) {
    -    qh_errprint("ERRONEOUS", facet, errother, errridge, NULL);
    -    *waserrorp= True;
    -  }
    -} /* checkfacet */
    -
    -
    -/*---------------------------------
    -
    -  qh_checkflipped_all( facetlist )
    -    checks orientation of facets in list against interior point
    -*/
    -void qh_checkflipped_all(facetT *facetlist) {
    -  facetT *facet;
    -  boolT waserror= False;
    -  realT dist;
    -
    -  if (facetlist == qh facet_list)
    -    zzval_(Zflippedfacets)= 0;
    -  FORALLfacet_(facetlist) {
    -    if (facet->normal && !qh_checkflipped(facet, &dist, !qh_ALL)) {
    -      qh_fprintf(qh ferr, 6136, "qhull precision error: facet f%d is flipped, distance= %6.12g\n",
    -              facet->id, dist);
    -      if (!qh FORCEoutput) {
    -        qh_errprint("ERRONEOUS", facet, NULL, NULL, NULL);
    -        waserror= True;
    -      }
    -    }
    -  }
    -  if (waserror) {
    -    qh_fprintf(qh ferr, 8101, "\n\
    -A flipped facet occurs when its distance to the interior point is\n\
    -greater than %2.2g, the maximum roundoff error.\n", -qh DISTround);
    -    qh_errexit(qh_ERRprec, NULL, NULL);
    -  }
    -} /* checkflipped_all */
    -
    -/*---------------------------------
    -
    -  qh_checkpolygon( facetlist )
    -    checks the correctness of the structure
    -
    -  notes:
    -    call with either qh.facet_list or qh.newfacet_list
    -    checks num_facets and num_vertices if qh.facet_list
    -
    -  design:
    -    for each facet
    -      checks facet and outside set
    -    initializes vertexlist
    -    for each facet
    -      checks vertex set
    -    if checking all facets(qh.facetlist)
    -      check facet count
    -      if qh.VERTEXneighbors
    -        check vertex neighbors and count
    -      check vertex count
    -*/
    -void qh_checkpolygon(facetT *facetlist) {
    -  facetT *facet;
    -  vertexT *vertex, **vertexp, *vertexlist;
    -  int numfacets= 0, numvertices= 0, numridges= 0;
    -  int totvneighbors= 0, totvertices= 0;
    -  boolT waserror= False, nextseen= False, visibleseen= False;
    -
    -  trace1((qh ferr, 1027, "qh_checkpolygon: check all facets from f%d\n", facetlist->id));
    -  if (facetlist != qh facet_list || qh ONLYgood)
    -    nextseen= True;
    -  FORALLfacet_(facetlist) {
    -    if (facet == qh visible_list)
    -      visibleseen= True;
    -    if (!facet->visible) {
    -      if (!nextseen) {
    -        if (facet == qh facet_next)
    -          nextseen= True;
    -        else if (qh_setsize(facet->outsideset)) {
    -          if (!qh NARROWhull
    -#if !qh_COMPUTEfurthest
    -               || facet->furthestdist >= qh MINoutside
    -#endif
    -                        ) {
    -            qh_fprintf(qh ferr, 6137, "qhull internal error (qh_checkpolygon): f%d has outside points before qh facet_next\n",
    -                     facet->id);
    -            qh_errexit(qh_ERRqhull, facet, NULL);
    -          }
    -        }
    -      }
    -      numfacets++;
    -      qh_checkfacet(facet, False, &waserror);
    -    }
    -  }
    -  if (qh visible_list && !visibleseen && facetlist == qh facet_list) {
    -    qh_fprintf(qh ferr, 6138, "qhull internal error (qh_checkpolygon): visible list f%d no longer on facet list\n", qh visible_list->id);
    -    qh_printlists();
    -    qh_errexit(qh_ERRqhull, qh visible_list, NULL);
    -  }
    -  if (facetlist == qh facet_list)
    -    vertexlist= qh vertex_list;
    -  else if (facetlist == qh newfacet_list)
    -    vertexlist= qh newvertex_list;
    -  else
    -    vertexlist= NULL;
    -  FORALLvertex_(vertexlist) {
    -    vertex->seen= False;
    -    vertex->visitid= 0;
    -  }
    -  FORALLfacet_(facetlist) {
    -    if (facet->visible)
    -      continue;
    -    if (facet->simplicial)
    -      numridges += qh hull_dim;
    -    else
    -      numridges += qh_setsize(facet->ridges);
    -    FOREACHvertex_(facet->vertices) {
    -      vertex->visitid++;
    -      if (!vertex->seen) {
    -        vertex->seen= True;
    -        numvertices++;
    -        if (qh_pointid(vertex->point) == -1) {
    -          qh_fprintf(qh ferr, 6139, "qhull internal error (qh_checkpolygon): unknown point %p for vertex v%d first_point %p\n",
    -                   vertex->point, vertex->id, qh first_point);
    -          waserror= True;
    -        }
    -      }
    -    }
    -  }
    -  qh vertex_visit += (unsigned int)numfacets;
    -  if (facetlist == qh facet_list) {
    -    if (numfacets != qh num_facets - qh num_visible) {
    -      qh_fprintf(qh ferr, 6140, "qhull internal error (qh_checkpolygon): actual number of facets is %d, cumulative facet count is %d - %d visible facets\n",
    -              numfacets, qh num_facets, qh num_visible);
    -      waserror= True;
    -    }
    -    qh vertex_visit++;
    -    if (qh VERTEXneighbors) {
    -      FORALLvertices {
    -        qh_setcheck(vertex->neighbors, "neighbors for v", vertex->id);
    -        if (vertex->deleted)
    -          continue;
    -        totvneighbors += qh_setsize(vertex->neighbors);
    -      }
    -      FORALLfacet_(facetlist)
    -        totvertices += qh_setsize(facet->vertices);
    -      if (totvneighbors != totvertices) {
    -        qh_fprintf(qh ferr, 6141, "qhull internal error (qh_checkpolygon): vertex neighbors inconsistent.  Totvneighbors %d, totvertices %d\n",
    -                totvneighbors, totvertices);
    -        waserror= True;
    -      }
    -    }
    -    if (numvertices != qh num_vertices - qh_setsize(qh del_vertices)) {
    -      qh_fprintf(qh ferr, 6142, "qhull internal error (qh_checkpolygon): actual number of vertices is %d, cumulative vertex count is %d\n",
    -              numvertices, qh num_vertices - qh_setsize(qh del_vertices));
    -      waserror= True;
    -    }
    -    if (qh hull_dim == 2 && numvertices != numfacets) {
    -      qh_fprintf(qh ferr, 6143, "qhull internal error (qh_checkpolygon): #vertices %d != #facets %d\n",
    -        numvertices, numfacets);
    -      waserror= True;
    -    }
    -    if (qh hull_dim == 3 && numvertices + numfacets - numridges/2 != 2) {
    -      qh_fprintf(qh ferr, 7063, "qhull warning: #vertices %d + #facets %d - #edges %d != 2\n\
    -        A vertex appears twice in a edge list.  May occur during merging.",
    -        numvertices, numfacets, numridges/2);
    -      /* occurs if lots of merging and a vertex ends up twice in an edge list.  e.g., RBOX 1000 s W1e-13 t995849315 D2 | QHULL d Tc Tv */
    -    }
    -  }
    -  if (waserror)
    -    qh_errexit(qh_ERRqhull, NULL, NULL);
    -} /* checkpolygon */
    -
    -
    -/*---------------------------------
    -
    -  qh_checkvertex( vertex )
    -    check vertex for consistency
    -    checks vertex->neighbors
    -
    -  notes:
    -    neighbors checked efficiently in checkpolygon
    -*/
    -void qh_checkvertex(vertexT *vertex) {
    -  boolT waserror= False;
    -  facetT *neighbor, **neighborp, *errfacet=NULL;
    -
    -  if (qh_pointid(vertex->point) == -1) {
    -    qh_fprintf(qh ferr, 6144, "qhull internal error (qh_checkvertex): unknown point id %p\n", vertex->point);
    -    waserror= True;
    -  }
    -  if (vertex->id >= qh vertex_id) {
    -    qh_fprintf(qh ferr, 6145, "qhull internal error (qh_checkvertex): unknown vertex id %d\n", vertex->id);
    -    waserror= True;
    -  }
    -  if (!waserror && !vertex->deleted) {
    -    if (qh_setsize(vertex->neighbors)) {
    -      FOREACHneighbor_(vertex) {
    -        if (!qh_setin(neighbor->vertices, vertex)) {
    -          qh_fprintf(qh ferr, 6146, "qhull internal error (qh_checkvertex): neighbor f%d does not contain v%d\n", neighbor->id, vertex->id);
    -          errfacet= neighbor;
    -          waserror= True;
    -        }
    -      }
    -    }
    -  }
    -  if (waserror) {
    -    qh_errprint("ERRONEOUS", NULL, NULL, NULL, vertex);
    -    qh_errexit(qh_ERRqhull, errfacet, NULL);
    -  }
    -} /* checkvertex */
    -
    -/*---------------------------------
    -
    -  qh_clearcenters( type )
    -    clear old data from facet->center
    -
    -  notes:
    -    sets new centertype
    -    nop if CENTERtype is the same
    -*/
    -void qh_clearcenters(qh_CENTER type) {
    -  facetT *facet;
    -
    -  if (qh CENTERtype != type) {
    -    FORALLfacets {
    -      if (facet->tricoplanar && !facet->keepcentrum)
    -          facet->center= NULL;
    -      else if (qh CENTERtype == qh_ASvoronoi){
    -        if (facet->center) {
    -          qh_memfree(facet->center, qh center_size);
    -          facet->center= NULL;
    -        }
    -      }else /* qh CENTERtype == qh_AScentrum */ {
    -        if (facet->center) {
    -          qh_memfree(facet->center, qh normal_size);
    -          facet->center= NULL;
    -        }
    -      }
    -    }
    -    qh CENTERtype= type;
    -  }
    -  trace2((qh ferr, 2043, "qh_clearcenters: switched to center type %d\n", type));
    -} /* clearcenters */
    -
    -/*---------------------------------
    -
    -  qh_createsimplex( vertices )
    -    creates a simplex from a set of vertices
    -
    -  returns:
    -    initializes qh.facet_list to the simplex
    -    initializes qh.newfacet_list, .facet_tail
    -    initializes qh.vertex_list, .newvertex_list, .vertex_tail
    -
    -  design:
    -    initializes lists
    -    for each vertex
    -      create a new facet
    -    for each new facet
    -      create its neighbor set
    -*/
    -void qh_createsimplex(setT *vertices) {
    -  facetT *facet= NULL, *newfacet;
    -  boolT toporient= True;
    -  int vertex_i, vertex_n, nth;
    -  setT *newfacets= qh_settemp(qh hull_dim+1);
    -  vertexT *vertex;
    -
    -  qh facet_list= qh newfacet_list= qh facet_tail= qh_newfacet();
    -  qh num_facets= qh num_vertices= qh num_visible= 0;
    -  qh vertex_list= qh newvertex_list= qh vertex_tail= qh_newvertex(NULL);
    -  FOREACHvertex_i_(vertices) {
    -    newfacet= qh_newfacet();
    -    newfacet->vertices= qh_setnew_delnthsorted(vertices, vertex_n,
    -                                                vertex_i, 0);
    -    newfacet->toporient= (unsigned char)toporient;
    -    qh_appendfacet(newfacet);
    -    newfacet->newfacet= True;
    -    qh_appendvertex(vertex);
    -    qh_setappend(&newfacets, newfacet);
    -    toporient ^= True;
    -  }
    -  FORALLnew_facets {
    -    nth= 0;
    -    FORALLfacet_(qh newfacet_list) {
    -      if (facet != newfacet)
    -        SETelem_(newfacet->neighbors, nth++)= facet;
    -    }
    -    qh_settruncate(newfacet->neighbors, qh hull_dim);
    -  }
    -  qh_settempfree(&newfacets);
    -  trace1((qh ferr, 1028, "qh_createsimplex: created simplex\n"));
    -} /* createsimplex */
    -
    -/*---------------------------------
    -
    -  qh_delridge( ridge )
    -    deletes ridge from data structures it belongs to
    -    frees up its memory
    -
    -  notes:
    -    in merge.c, caller sets vertex->delridge for each vertex
    -    ridges also freed in qh_freeqhull
    -*/
    -void qh_delridge(ridgeT *ridge) {
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  qh_setdel(ridge->top->ridges, ridge);
    -  qh_setdel(ridge->bottom->ridges, ridge);
    -  qh_setfree(&(ridge->vertices));
    -  qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp);
    -} /* delridge */
    -
    -
    -/*---------------------------------
    -
    -  qh_delvertex( vertex )
    -    deletes a vertex and frees its memory
    -
    -  notes:
    -    assumes vertex->adjacencies have been updated if needed
    -    unlinks from vertex_list
    -*/
    -void qh_delvertex(vertexT *vertex) {
    -
    -  if (vertex == qh tracevertex)
    -    qh tracevertex= NULL;
    -  qh_removevertex(vertex);
    -  qh_setfree(&vertex->neighbors);
    -  qh_memfree(vertex, (int)sizeof(vertexT));
    -} /* delvertex */
    -
    -
    -/*---------------------------------
    -
    -  qh_facet3vertex(  )
    -    return temporary set of 3-d vertices in qh_ORIENTclock order
    -
    -  design:
    -    if simplicial facet
    -      build set from facet->vertices with facet->toporient
    -    else
    -      for each ridge in order
    -        build set from ridge's vertices
    -*/
    -setT *qh_facet3vertex(facetT *facet) {
    -  ridgeT *ridge, *firstridge;
    -  vertexT *vertex;
    -  int cntvertices, cntprojected=0;
    -  setT *vertices;
    -
    -  cntvertices= qh_setsize(facet->vertices);
    -  vertices= qh_settemp(cntvertices);
    -  if (facet->simplicial) {
    -    if (cntvertices != 3) {
    -      qh_fprintf(qh ferr, 6147, "qhull internal error (qh_facet3vertex): only %d vertices for simplicial facet f%d\n",
    -                  cntvertices, facet->id);
    -      qh_errexit(qh_ERRqhull, facet, NULL);
    -    }
    -    qh_setappend(&vertices, SETfirst_(facet->vertices));
    -    if (facet->toporient ^ qh_ORIENTclock)
    -      qh_setappend(&vertices, SETsecond_(facet->vertices));
    -    else
    -      qh_setaddnth(&vertices, 0, SETsecond_(facet->vertices));
    -    qh_setappend(&vertices, SETelem_(facet->vertices, 2));
    -  }else {
    -    ridge= firstridge= SETfirstt_(facet->ridges, ridgeT);   /* no infinite */
    -    while ((ridge= qh_nextridge3d(ridge, facet, &vertex))) {
    -      qh_setappend(&vertices, vertex);
    -      if (++cntprojected > cntvertices || ridge == firstridge)
    -        break;
    -    }
    -    if (!ridge || cntprojected != cntvertices) {
    -      qh_fprintf(qh ferr, 6148, "qhull internal error (qh_facet3vertex): ridges for facet %d don't match up.  got at least %d\n",
    -                  facet->id, cntprojected);
    -      qh_errexit(qh_ERRqhull, facet, ridge);
    -    }
    -  }
    -  return vertices;
    -} /* facet3vertex */
    -
    -/*---------------------------------
    -
    -  qh_findbestfacet( point, bestoutside, bestdist, isoutside )
    -    find facet that is furthest below a point
    -
    -    for Delaunay triangulations,
    -      Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed
    -      Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates.
    -
    -  returns:
    -    if bestoutside is set (e.g., qh_ALL)
    -      returns best facet that is not upperdelaunay
    -      if Delaunay and inside, point is outside circumsphere of bestfacet
    -    else
    -      returns first facet below point
    -      if point is inside, returns nearest, !upperdelaunay facet
    -    distance to facet
    -    isoutside set if outside of facet
    -
    -  notes:
    -    For tricoplanar facets, this finds one of the tricoplanar facets closest
    -    to the point.  For Delaunay triangulations, the point may be inside a
    -    different tricoplanar facet. See locate a facet with qh_findbestfacet()
    -
    -    If inside, qh_findbestfacet performs an exhaustive search
    -       this may be too conservative.  Sometimes it is clearly required.
    -
    -    qh_findbestfacet is not used by qhull.
    -    uses qh.visit_id and qh.coplanarset
    -
    -  see:
    -    qh_findbest
    -*/
    -facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
    -           realT *bestdist, boolT *isoutside) {
    -  facetT *bestfacet= NULL;
    -  int numpart, totpart= 0;
    -
    -  bestfacet= qh_findbest(point, qh facet_list,
    -                            bestoutside, !qh_ISnewfacets, bestoutside /* qh_NOupper */,
    -                            bestdist, isoutside, &totpart);
    -  if (*bestdist < -qh DISTround) {
    -    bestfacet= qh_findfacet_all(point, bestdist, isoutside, &numpart);
    -    totpart += numpart;
    -    if ((isoutside && bestoutside)
    -    || (!isoutside && bestfacet->upperdelaunay)) {
    -      bestfacet= qh_findbest(point, bestfacet,
    -                            bestoutside, False, bestoutside,
    -                            bestdist, isoutside, &totpart);
    -      totpart += numpart;
    -    }
    -  }
    -  trace3((qh ferr, 3014, "qh_findbestfacet: f%d dist %2.2g isoutside %d totpart %d\n",
    -          bestfacet->id, *bestdist, *isoutside, totpart));
    -  return bestfacet;
    -} /* findbestfacet */
    -
    -/*---------------------------------
    -
    -  qh_findbestlower( facet, point, bestdist, numpart )
    -    returns best non-upper, non-flipped neighbor of facet for point
    -    if needed, searches vertex neighbors
    -
    -  returns:
    -    returns bestdist and updates numpart
    -
    -  notes:
    -    if Delaunay and inside, point is outside of circumsphere of bestfacet
    -    called by qh_findbest() for points above an upperdelaunay facet
    -
    -*/
    -facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart) {
    -  facetT *neighbor, **neighborp, *bestfacet= NULL;
    -  realT bestdist= -REALmax/2 /* avoid underflow */;
    -  realT dist;
    -  vertexT *vertex;
    -
    -  zinc_(Zbestlower);
    -  FOREACHneighbor_(upperfacet) {
    -    if (neighbor->upperdelaunay || neighbor->flipped)
    -      continue;
    -    (*numpart)++;
    -    qh_distplane(point, neighbor, &dist);
    -    if (dist > bestdist) {
    -      bestfacet= neighbor;
    -      bestdist= dist;
    -    }
    -  }
    -  if (!bestfacet) {
    -    zinc_(Zbestlowerv);
    -    /* rarely called, numpart does not count nearvertex computations */
    -    vertex= qh_nearvertex(upperfacet, point, &dist);
    -    qh_vertexneighbors();
    -    FOREACHneighbor_(vertex) {
    -      if (neighbor->upperdelaunay || neighbor->flipped)
    -        continue;
    -      (*numpart)++;
    -      qh_distplane(point, neighbor, &dist);
    -      if (dist > bestdist) {
    -        bestfacet= neighbor;
    -        bestdist= dist;
    -      }
    -    }
    -  }
    -  if (!bestfacet) {
    -    qh_fprintf(qh ferr, 6228, "\n\
    -Qhull internal error (qh_findbestlower): all neighbors of facet %d are flipped or upper Delaunay.\n\
    -Please report this error to qhull_bug@qhull.org with the input and all of the output.\n",
    -       upperfacet->id);
    -    qh_errexit(qh_ERRqhull, upperfacet, NULL);
    -  }
    -  *bestdistp= bestdist;
    -  trace3((qh ferr, 3015, "qh_findbestlower: f%d dist %2.2g for f%d p%d\n",
    -          bestfacet->id, bestdist, upperfacet->id, qh_pointid(point)));
    -  return bestfacet;
    -} /* findbestlower */
    -
    -/*---------------------------------
    -
    -  qh_findfacet_all( point, bestdist, isoutside, numpart )
    -    exhaustive search for facet below a point
    -
    -    for Delaunay triangulations,
    -      Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed
    -      Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates.
    -
    -  returns:
    -    returns first facet below point
    -    if point is inside,
    -      returns nearest facet
    -    distance to facet
    -    isoutside if point is outside of the hull
    -    number of distance tests
    -
    -  notes:
    -    for library users, not used by Qhull
    -*/
    -facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside,
    -                          int *numpart) {
    -  facetT *bestfacet= NULL, *facet;
    -  realT dist;
    -  int totpart= 0;
    -
    -  *bestdist= -REALmax;
    -  *isoutside= False;
    -  FORALLfacets {
    -    if (facet->flipped || !facet->normal)
    -      continue;
    -    totpart++;
    -    qh_distplane(point, facet, &dist);
    -    if (dist > *bestdist) {
    -      *bestdist= dist;
    -      bestfacet= facet;
    -      if (dist > qh MINoutside) {
    -        *isoutside= True;
    -        break;
    -      }
    -    }
    -  }
    -  *numpart= totpart;
    -  trace3((qh ferr, 3016, "qh_findfacet_all: f%d dist %2.2g isoutside %d totpart %d\n",
    -          getid_(bestfacet), *bestdist, *isoutside, totpart));
    -  return bestfacet;
    -} /* findfacet_all */
    -
    -/*---------------------------------
    -
    -  qh_findgood( facetlist, goodhorizon )
    -    identify good facets for qh.PRINTgood
    -    if qh.GOODvertex>0
    -      facet includes point as vertex
    -      if !match, returns goodhorizon
    -      inactive if qh.MERGING
    -    if qh.GOODpoint
    -      facet is visible or coplanar (>0) or not visible (<0)
    -    if qh.GOODthreshold
    -      facet->normal matches threshold
    -    if !goodhorizon and !match,
    -      selects facet with closest angle
    -      sets GOODclosest
    -
    -  returns:
    -    number of new, good facets found
    -    determines facet->good
    -    may update qh.GOODclosest
    -
    -  notes:
    -    qh_findgood_all further reduces the good region
    -
    -  design:
    -    count good facets
    -    mark good facets for qh.GOODpoint
    -    mark good facets for qh.GOODthreshold
    -    if necessary
    -      update qh.GOODclosest
    -*/
    -int qh_findgood(facetT *facetlist, int goodhorizon) {
    -  facetT *facet, *bestfacet= NULL;
    -  realT angle, bestangle= REALmax, dist;
    -  int  numgood=0;
    -
    -  FORALLfacet_(facetlist) {
    -    if (facet->good)
    -      numgood++;
    -  }
    -  if (qh GOODvertex>0 && !qh MERGING) {
    -    FORALLfacet_(facetlist) {
    -      if (!qh_isvertex(qh GOODvertexp, facet->vertices)) {
    -        facet->good= False;
    -        numgood--;
    -      }
    -    }
    -  }
    -  if (qh GOODpoint && numgood) {
    -    FORALLfacet_(facetlist) {
    -      if (facet->good && facet->normal) {
    -        zinc_(Zdistgood);
    -        qh_distplane(qh GOODpointp, facet, &dist);
    -        if ((qh GOODpoint > 0) ^ (dist > 0.0)) {
    -          facet->good= False;
    -          numgood--;
    -        }
    -      }
    -    }
    -  }
    -  if (qh GOODthreshold && (numgood || goodhorizon || qh GOODclosest)) {
    -    FORALLfacet_(facetlist) {
    -      if (facet->good && facet->normal) {
    -        if (!qh_inthresholds(facet->normal, &angle)) {
    -          facet->good= False;
    -          numgood--;
    -          if (angle < bestangle) {
    -            bestangle= angle;
    -            bestfacet= facet;
    -          }
    -        }
    -      }
    -    }
    -    if (!numgood && (!goodhorizon || qh GOODclosest)) {
    -      if (qh GOODclosest) {
    -        if (qh GOODclosest->visible)
    -          qh GOODclosest= NULL;
    -        else {
    -          qh_inthresholds(qh GOODclosest->normal, &angle);
    -          if (angle < bestangle)
    -            bestfacet= qh GOODclosest;
    -        }
    -      }
    -      if (bestfacet && bestfacet != qh GOODclosest) {
    -        if (qh GOODclosest)
    -          qh GOODclosest->good= False;
    -        qh GOODclosest= bestfacet;
    -        bestfacet->good= True;
    -        numgood++;
    -        trace2((qh ferr, 2044, "qh_findgood: f%d is closest(%2.2g) to thresholds\n",
    -           bestfacet->id, bestangle));
    -        return numgood;
    -      }
    -    }else if (qh GOODclosest) { /* numgood > 0 */
    -      qh GOODclosest->good= False;
    -      qh GOODclosest= NULL;
    -    }
    -  }
    -  zadd_(Zgoodfacet, numgood);
    -  trace2((qh ferr, 2045, "qh_findgood: found %d good facets with %d good horizon\n",
    -               numgood, goodhorizon));
    -  if (!numgood && qh GOODvertex>0 && !qh MERGING)
    -    return goodhorizon;
    -  return numgood;
    -} /* findgood */
    -
    -/*---------------------------------
    -
    -  qh_findgood_all( facetlist )
    -    apply other constraints for good facets (used by qh.PRINTgood)
    -    if qh.GOODvertex
    -      facet includes (>0) or doesn't include (<0) point as vertex
    -      if last good facet and ONLYgood, prints warning and continues
    -    if qh.SPLITthresholds
    -      facet->normal matches threshold, or if none, the closest one
    -    calls qh_findgood
    -    nop if good not used
    -
    -  returns:
    -    clears facet->good if not good
    -    sets qh.num_good
    -
    -  notes:
    -    this is like qh_findgood but more restrictive
    -
    -  design:
    -    uses qh_findgood to mark good facets
    -    marks facets for qh.GOODvertex
    -    marks facets for qh.SPLITthreholds
    -*/
    -void qh_findgood_all(facetT *facetlist) {
    -  facetT *facet, *bestfacet=NULL;
    -  realT angle, bestangle= REALmax;
    -  int  numgood=0, startgood;
    -
    -  if (!qh GOODvertex && !qh GOODthreshold && !qh GOODpoint
    -  && !qh SPLITthresholds)
    -    return;
    -  if (!qh ONLYgood)
    -    qh_findgood(qh facet_list, 0);
    -  FORALLfacet_(facetlist) {
    -    if (facet->good)
    -      numgood++;
    -  }
    -  if (qh GOODvertex <0 || (qh GOODvertex > 0 && qh MERGING)) {
    -    FORALLfacet_(facetlist) {
    -      if (facet->good && ((qh GOODvertex > 0) ^ !!qh_isvertex(qh GOODvertexp, facet->vertices))) {
    -        if (!--numgood) {
    -          if (qh ONLYgood) {
    -            qh_fprintf(qh ferr, 7064, "qhull warning: good vertex p%d does not match last good facet f%d.  Ignored.\n",
    -               qh_pointid(qh GOODvertexp), facet->id);
    -            return;
    -          }else if (qh GOODvertex > 0)
    -            qh_fprintf(qh ferr, 7065, "qhull warning: point p%d is not a vertex('QV%d').\n",
    -                qh GOODvertex-1, qh GOODvertex-1);
    -          else
    -            qh_fprintf(qh ferr, 7066, "qhull warning: point p%d is a vertex for every facet('QV-%d').\n",
    -                -qh GOODvertex - 1, -qh GOODvertex - 1);
    -        }
    -        facet->good= False;
    -      }
    -    }
    -  }
    -  startgood= numgood;
    -  if (qh SPLITthresholds) {
    -    FORALLfacet_(facetlist) {
    -      if (facet->good) {
    -        if (!qh_inthresholds(facet->normal, &angle)) {
    -          facet->good= False;
    -          numgood--;
    -          if (angle < bestangle) {
    -            bestangle= angle;
    -            bestfacet= facet;
    -          }
    -        }
    -      }
    -    }
    -    if (!numgood && bestfacet) {
    -      bestfacet->good= True;
    -      numgood++;
    -      trace0((qh ferr, 23, "qh_findgood_all: f%d is closest(%2.2g) to thresholds\n",
    -           bestfacet->id, bestangle));
    -      return;
    -    }
    -  }
    -  qh num_good= numgood;
    -  trace0((qh ferr, 24, "qh_findgood_all: %d good facets remain out of %d facets\n",
    -        numgood, startgood));
    -} /* findgood_all */
    -
    -/*---------------------------------
    -
    -  qh_furthestnext()
    -    set qh.facet_next to facet with furthest of all furthest points
    -    searches all facets on qh.facet_list
    -
    -  notes:
    -    this may help avoid precision problems
    -*/
    -void qh_furthestnext(void /* qh facet_list */) {
    -  facetT *facet, *bestfacet= NULL;
    -  realT dist, bestdist= -REALmax;
    -
    -  FORALLfacets {
    -    if (facet->outsideset) {
    -#if qh_COMPUTEfurthest
    -      pointT *furthest;
    -      furthest= (pointT*)qh_setlast(facet->outsideset);
    -      zinc_(Zcomputefurthest);
    -      qh_distplane(furthest, facet, &dist);
    -#else
    -      dist= facet->furthestdist;
    -#endif
    -      if (dist > bestdist) {
    -        bestfacet= facet;
    -        bestdist= dist;
    -      }
    -    }
    -  }
    -  if (bestfacet) {
    -    qh_removefacet(bestfacet);
    -    qh_prependfacet(bestfacet, &qh facet_next);
    -    trace1((qh ferr, 1029, "qh_furthestnext: made f%d next facet(dist %.2g)\n",
    -            bestfacet->id, bestdist));
    -  }
    -} /* furthestnext */
    -
    -/*---------------------------------
    -
    -  qh_furthestout( facet )
    -    make furthest outside point the last point of outsideset
    -
    -  returns:
    -    updates facet->outsideset
    -    clears facet->notfurthest
    -    sets facet->furthestdist
    -
    -  design:
    -    determine best point of outsideset
    -    make it the last point of outsideset
    -*/
    -void qh_furthestout(facetT *facet) {
    -  pointT *point, **pointp, *bestpoint= NULL;
    -  realT dist, bestdist= -REALmax;
    -
    -  FOREACHpoint_(facet->outsideset) {
    -    qh_distplane(point, facet, &dist);
    -    zinc_(Zcomputefurthest);
    -    if (dist > bestdist) {
    -      bestpoint= point;
    -      bestdist= dist;
    -    }
    -  }
    -  if (bestpoint) {
    -    qh_setdel(facet->outsideset, point);
    -    qh_setappend(&facet->outsideset, point);
    -#if !qh_COMPUTEfurthest
    -    facet->furthestdist= bestdist;
    -#endif
    -  }
    -  facet->notfurthest= False;
    -  trace3((qh ferr, 3017, "qh_furthestout: p%d is furthest outside point of f%d\n",
    -          qh_pointid(point), facet->id));
    -} /* furthestout */
    -
    -
    -/*---------------------------------
    -
    -  qh_infiniteloop( facet )
    -    report infinite loop error due to facet
    -*/
    -void qh_infiniteloop(facetT *facet) {
    -
    -  qh_fprintf(qh ferr, 6149, "qhull internal error (qh_infiniteloop): potential infinite loop detected\n");
    -  qh_errexit(qh_ERRqhull, facet, NULL);
    -} /* qh_infiniteloop */
    -
    -/*---------------------------------
    -
    -  qh_initbuild()
    -    initialize hull and outside sets with point array
    -    qh.FIRSTpoint/qh.NUMpoints is point array
    -    if qh.GOODpoint
    -      adds qh.GOODpoint to initial hull
    -
    -  returns:
    -    qh_facetlist with initial hull
    -    points partioned into outside sets, coplanar sets, or inside
    -    initializes qh.GOODpointp, qh.GOODvertexp,
    -
    -  design:
    -    initialize global variables used during qh_buildhull
    -    determine precision constants and points with max/min coordinate values
    -      if qh.SCALElast, scale last coordinate(for 'd')
    -    build initial simplex
    -    partition input points into facets of initial simplex
    -    set up lists
    -    if qh.ONLYgood
    -      check consistency
    -      add qh.GOODvertex if defined
    -*/
    -void qh_initbuild( void) {
    -  setT *maxpoints, *vertices;
    -  facetT *facet;
    -  int i, numpart;
    -  realT dist;
    -  boolT isoutside;
    -
    -  qh furthest_id= -1;
    -  qh lastreport= 0;
    -  qh facet_id= qh vertex_id= qh ridge_id= 0;
    -  qh visit_id= qh vertex_visit= 0;
    -  qh maxoutdone= False;
    -
    -  if (qh GOODpoint > 0)
    -    qh GOODpointp= qh_point(qh GOODpoint-1);
    -  else if (qh GOODpoint < 0)
    -    qh GOODpointp= qh_point(-qh GOODpoint-1);
    -  if (qh GOODvertex > 0)
    -    qh GOODvertexp= qh_point(qh GOODvertex-1);
    -  else if (qh GOODvertex < 0)
    -    qh GOODvertexp= qh_point(-qh GOODvertex-1);
    -  if ((qh GOODpoint
    -       && (qh GOODpointp < qh first_point  /* also catches !GOODpointp */
    -           || qh GOODpointp > qh_point(qh num_points-1)))
    -    || (qh GOODvertex
    -        && (qh GOODvertexp < qh first_point  /* also catches !GOODvertexp */
    -            || qh GOODvertexp > qh_point(qh num_points-1)))) {
    -    qh_fprintf(qh ferr, 6150, "qhull input error: either QGn or QVn point is > p%d\n",
    -             qh num_points-1);
    -    qh_errexit(qh_ERRinput, NULL, NULL);
    -  }
    -  maxpoints= qh_maxmin(qh first_point, qh num_points, qh hull_dim);
    -  if (qh SCALElast)
    -    qh_scalelast(qh first_point, qh num_points, qh hull_dim,
    -               qh MINlastcoord, qh MAXlastcoord, qh MAXwidth);
    -  qh_detroundoff();
    -  if (qh DELAUNAY && qh upper_threshold[qh hull_dim-1] > REALmax/2
    -                  && qh lower_threshold[qh hull_dim-1] < -REALmax/2) {
    -    for (i=qh_PRINTEND; i--; ) {
    -      if (qh PRINTout[i] == qh_PRINTgeom && qh DROPdim < 0
    -          && !qh GOODthreshold && !qh SPLITthresholds)
    -        break;  /* in this case, don't set upper_threshold */
    -    }
    -    if (i < 0) {
    -      if (qh UPPERdelaunay) { /* matches qh.upperdelaunay in qh_setfacetplane */
    -        qh lower_threshold[qh hull_dim-1]= qh ANGLEround * qh_ZEROdelaunay;
    -        qh GOODthreshold= True;
    -      }else {
    -        qh upper_threshold[qh hull_dim-1]= -qh ANGLEround * qh_ZEROdelaunay;
    -        if (!qh GOODthreshold)
    -          qh SPLITthresholds= True; /* build upper-convex hull even if Qg */
    -          /* qh_initqhull_globals errors if Qg without Pdk/etc. */
    -      }
    -    }
    -  }
    -  vertices= qh_initialvertices(qh hull_dim, maxpoints, qh first_point, qh num_points);
    -  qh_initialhull(vertices);  /* initial qh facet_list */
    -  qh_partitionall(vertices, qh first_point, qh num_points);
    -  if (qh PRINToptions1st || qh TRACElevel || qh IStracing) {
    -    if (qh TRACElevel || qh IStracing)
    -      qh_fprintf(qh ferr, 8103, "\nTrace level %d for %s | %s\n",
    -         qh IStracing ? qh IStracing : qh TRACElevel, qh rbox_command, qh qhull_command);
    -    qh_fprintf(qh ferr, 8104, "Options selected for Qhull %s:\n%s\n", qh_version, qh qhull_options);
    -  }
    -  qh_resetlists(False, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */);
    -  qh facet_next= qh facet_list;
    -  qh_furthestnext(/* qh facet_list */);
    -  if (qh PREmerge) {
    -    qh cos_max= qh premerge_cos;
    -    qh centrum_radius= qh premerge_centrum;
    -  }
    -  if (qh ONLYgood) {
    -    if (qh GOODvertex > 0 && qh MERGING) {
    -      qh_fprintf(qh ferr, 6151, "qhull input error: 'Qg QVn' (only good vertex) does not work with merging.\nUse 'QJ' to joggle the input or 'Q0' to turn off merging.\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    if (!(qh GOODthreshold || qh GOODpoint
    -         || (!qh MERGEexact && !qh PREmerge && qh GOODvertexp))) {
    -      qh_fprintf(qh ferr, 6152, "qhull input error: 'Qg' (ONLYgood) needs a good threshold('Pd0D0'), a\n\
    -good point(QGn or QG-n), or a good vertex with 'QJ' or 'Q0' (QVn).\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    if (qh GOODvertex > 0  && !qh MERGING  /* matches qh_partitionall */
    -        && !qh_isvertex(qh GOODvertexp, vertices)) {
    -      facet= qh_findbestnew(qh GOODvertexp, qh facet_list,
    -                          &dist, !qh_ALL, &isoutside, &numpart);
    -      zadd_(Zdistgood, numpart);
    -      if (!isoutside) {
    -        qh_fprintf(qh ferr, 6153, "qhull input error: point for QV%d is inside initial simplex.  It can not be made a vertex.\n",
    -               qh_pointid(qh GOODvertexp));
    -        qh_errexit(qh_ERRinput, NULL, NULL);
    -      }
    -      if (!qh_addpoint(qh GOODvertexp, facet, False)) {
    -        qh_settempfree(&vertices);
    -        qh_settempfree(&maxpoints);
    -        return;
    -      }
    -    }
    -    qh_findgood(qh facet_list, 0);
    -  }
    -  qh_settempfree(&vertices);
    -  qh_settempfree(&maxpoints);
    -  trace1((qh ferr, 1030, "qh_initbuild: initial hull created and points partitioned\n"));
    -} /* initbuild */
    -
    -/*---------------------------------
    -
    -  qh_initialhull( vertices )
    -    constructs the initial hull as a DIM3 simplex of vertices
    -
    -  design:
    -    creates a simplex (initializes lists)
    -    determines orientation of simplex
    -    sets hyperplanes for facets
    -    doubles checks orientation (in case of axis-parallel facets with Gaussian elimination)
    -    checks for flipped facets and qh.NARROWhull
    -    checks the result
    -*/
    -void qh_initialhull(setT *vertices) {
    -  facetT *facet, *firstfacet, *neighbor, **neighborp;
    -  realT dist, angle, minangle= REALmax;
    -#ifndef qh_NOtrace
    -  int k;
    -#endif
    -
    -  qh_createsimplex(vertices);  /* qh facet_list */
    -  qh_resetlists(False, qh_RESETvisible);
    -  qh facet_next= qh facet_list;      /* advance facet when processed */
    -  qh interior_point= qh_getcenter(vertices);
    -  firstfacet= qh facet_list;
    -  qh_setfacetplane(firstfacet);
    -  zinc_(Znumvisibility); /* needs to be in printsummary */
    -  qh_distplane(qh interior_point, firstfacet, &dist);
    -  if (dist > 0) {
    -    FORALLfacets
    -      facet->toporient ^= (unsigned char)True;
    -  }
    -  FORALLfacets
    -    qh_setfacetplane(facet);
    -  FORALLfacets {
    -    if (!qh_checkflipped(facet, NULL, qh_ALL)) {/* due to axis-parallel facet */
    -      trace1((qh ferr, 1031, "qh_initialhull: initial orientation incorrect.  Correct all facets\n"));
    -      facet->flipped= False;
    -      FORALLfacets {
    -        facet->toporient ^= (unsigned char)True;
    -        qh_orientoutside(facet);
    -      }
    -      break;
    -    }
    -  }
    -  FORALLfacets {
    -    if (!qh_checkflipped(facet, NULL, !qh_ALL)) {  /* can happen with 'R0.1' */
    -      if (qh DELAUNAY && ! qh ATinfinity) {
    -        if (qh UPPERdelaunay)
    -          qh_fprintf(qh ferr, 6240, "Qhull input error: Can not compute the upper Delaunay triangulation or upper Voronoi diagram of cocircular/cospherical points.\n");
    -        else
    -          qh_fprintf(qh ferr, 6239, "Qhull input error: Use option 'Qz' for the Delaunay triangulation or Voronoi diagram of cocircular/cospherical points.  Option 'Qz' adds a point \"at infinity\" (above the corresponding paraboloid).\n");
    -        qh_errexit(qh_ERRinput, NULL, NULL);
    -      }
    -      qh_precision("initial facet is coplanar with interior point");
    -      qh_fprintf(qh ferr, 6154, "qhull precision error: initial facet %d is coplanar with the interior point\n",
    -                   facet->id);
    -      qh_errexit(qh_ERRsingular, facet, NULL);
    -    }
    -    FOREACHneighbor_(facet) {
    -      angle= qh_getangle(facet->normal, neighbor->normal);
    -      minimize_( minangle, angle);
    -    }
    -  }
    -  if (minangle < qh_MAXnarrow && !qh NOnarrow) {
    -    realT diff= 1.0 + minangle;
    -
    -    qh NARROWhull= True;
    -    qh_option("_narrow-hull", NULL, &diff);
    -    if (minangle < qh_WARNnarrow && !qh RERUN && qh PRINTprecision)
    -      qh_printhelp_narrowhull(qh ferr, minangle);
    -  }
    -  zzval_(Zprocessed)= qh hull_dim+1;
    -  qh_checkpolygon(qh facet_list);
    -  qh_checkconvex(qh facet_list,   qh_DATAfault);
    -#ifndef qh_NOtrace
    -  if (qh IStracing >= 1) {
    -    qh_fprintf(qh ferr, 8105, "qh_initialhull: simplex constructed, interior point:");
    -    for (k=0; k < qh hull_dim; k++)
    -      qh_fprintf(qh ferr, 8106, " %6.4g", qh interior_point[k]);
    -    qh_fprintf(qh ferr, 8107, "\n");
    -  }
    -#endif
    -} /* initialhull */
    -
    -/*---------------------------------
    -
    -  qh_initialvertices( dim, maxpoints, points, numpoints )
    -    determines a non-singular set of initial vertices
    -    maxpoints may include duplicate points
    -
    -  returns:
    -    temporary set of dim+1 vertices in descending order by vertex id
    -    if qh.RANDOMoutside && !qh.ALLpoints
    -      picks random points
    -    if dim >= qh_INITIALmax,
    -      uses min/max x and max points with non-zero determinants
    -
    -  notes:
    -    unless qh.ALLpoints,
    -      uses maxpoints as long as determinate is non-zero
    -*/
    -setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints) {
    -  pointT *point, **pointp;
    -  setT *vertices, *simplex, *tested;
    -  realT randr;
    -  int idx, point_i, point_n, k;
    -  boolT nearzero= False;
    -
    -  vertices= qh_settemp(dim + 1);
    -  simplex= qh_settemp(dim+1);
    -  if (qh ALLpoints)
    -    qh_maxsimplex(dim, NULL, points, numpoints, &simplex);
    -  else if (qh RANDOMoutside) {
    -    while (qh_setsize(simplex) != dim+1) {
    -      randr= qh_RANDOMint;
    -      randr= randr/(qh_RANDOMmax+1);
    -      idx= (int)floor(qh num_points * randr);
    -      while (qh_setin(simplex, qh_point(idx))) {
    -            idx++; /* in case qh_RANDOMint always returns the same value */
    -        idx= idx < qh num_points ? idx : 0;
    -      }
    -      qh_setappend(&simplex, qh_point(idx));
    -    }
    -  }else if (qh hull_dim >= qh_INITIALmax) {
    -    tested= qh_settemp(dim+1);
    -    qh_setappend(&simplex, SETfirst_(maxpoints));   /* max and min X coord */
    -    qh_setappend(&simplex, SETsecond_(maxpoints));
    -    qh_maxsimplex(fmin_(qh_INITIALsearch, dim), maxpoints, points, numpoints, &simplex);
    -    k= qh_setsize(simplex);
    -    FOREACHpoint_i_(maxpoints) {
    -      if (point_i & 0x1) {     /* first pick up max. coord. points */
    -        if (!qh_setin(simplex, point) && !qh_setin(tested, point)){
    -          qh_detsimplex(point, simplex, k, &nearzero);
    -          if (nearzero)
    -            qh_setappend(&tested, point);
    -          else {
    -            qh_setappend(&simplex, point);
    -            if (++k == dim)  /* use search for last point */
    -              break;
    -          }
    -        }
    -      }
    -    }
    -    while (k != dim && (point= (pointT*)qh_setdellast(maxpoints))) {
    -      if (!qh_setin(simplex, point) && !qh_setin(tested, point)){
    -        qh_detsimplex(point, simplex, k, &nearzero);
    -        if (nearzero)
    -          qh_setappend(&tested, point);
    -        else {
    -          qh_setappend(&simplex, point);
    -          k++;
    -        }
    -      }
    -    }
    -    idx= 0;
    -    while (k != dim && (point= qh_point(idx++))) {
    -      if (!qh_setin(simplex, point) && !qh_setin(tested, point)){
    -        qh_detsimplex(point, simplex, k, &nearzero);
    -        if (!nearzero){
    -          qh_setappend(&simplex, point);
    -          k++;
    -        }
    -      }
    -    }
    -    qh_settempfree(&tested);
    -    qh_maxsimplex(dim, maxpoints, points, numpoints, &simplex);
    -  }else
    -    qh_maxsimplex(dim, maxpoints, points, numpoints, &simplex);
    -  FOREACHpoint_(simplex)
    -    qh_setaddnth(&vertices, 0, qh_newvertex(point)); /* descending order */
    -  qh_settempfree(&simplex);
    -  return vertices;
    -} /* initialvertices */
    -
    -
    -/*---------------------------------
    -
    -  qh_isvertex(  )
    -    returns vertex if point is in vertex set, else returns NULL
    -
    -  notes:
    -    for qh.GOODvertex
    -*/
    -vertexT *qh_isvertex(pointT *point, setT *vertices) {
    -  vertexT *vertex, **vertexp;
    -
    -  FOREACHvertex_(vertices) {
    -    if (vertex->point == point)
    -      return vertex;
    -  }
    -  return NULL;
    -} /* isvertex */
    -
    -/*---------------------------------
    -
    -  qh_makenewfacets( point )
    -    make new facets from point and qh.visible_list
    -
    -  returns:
    -    qh.newfacet_list= list of new facets with hyperplanes and ->newfacet
    -    qh.newvertex_list= list of vertices in new facets with ->newlist set
    -
    -    if (qh.ONLYgood)
    -      newfacets reference horizon facets, but not vice versa
    -      ridges reference non-simplicial horizon ridges, but not vice versa
    -      does not change existing facets
    -    else
    -      sets qh.NEWfacets
    -      new facets attached to horizon facets and ridges
    -      for visible facets,
    -        visible->r.replace is corresponding new facet
    -
    -  see also:
    -    qh_makenewplanes() -- make hyperplanes for facets
    -    qh_attachnewfacets() -- attachnewfacets if not done here(qh ONLYgood)
    -    qh_matchnewfacets() -- match up neighbors
    -    qh_updatevertices() -- update vertex neighbors and delvertices
    -    qh_deletevisible() -- delete visible facets
    -    qh_checkpolygon() --check the result
    -    qh_triangulate() -- triangulate a non-simplicial facet
    -
    -  design:
    -    for each visible facet
    -      make new facets to its horizon facets
    -      update its f.replace
    -      clear its neighbor set
    -*/
    -vertexT *qh_makenewfacets(pointT *point /*visible_list*/) {
    -  facetT *visible, *newfacet= NULL, *newfacet2= NULL, *neighbor, **neighborp;
    -  vertexT *apex;
    -  int numnew=0;
    -
    -  qh newfacet_list= qh facet_tail;
    -  qh newvertex_list= qh vertex_tail;
    -  apex= qh_newvertex(point);
    -  qh_appendvertex(apex);
    -  qh visit_id++;
    -  if (!qh ONLYgood)
    -    qh NEWfacets= True;
    -  FORALLvisible_facets {
    -    FOREACHneighbor_(visible)
    -      neighbor->seen= False;
    -    if (visible->ridges) {
    -      visible->visitid= qh visit_id;
    -      newfacet2= qh_makenew_nonsimplicial(visible, apex, &numnew);
    -    }
    -    if (visible->simplicial)
    -      newfacet= qh_makenew_simplicial(visible, apex, &numnew);
    -    if (!qh ONLYgood) {
    -      if (newfacet2)  /* newfacet is null if all ridges defined */
    -        newfacet= newfacet2;
    -      if (newfacet)
    -        visible->f.replace= newfacet;
    -      else
    -        zinc_(Zinsidevisible);
    -      SETfirst_(visible->neighbors)= NULL;
    -    }
    -  }
    -  trace1((qh ferr, 1032, "qh_makenewfacets: created %d new facets from point p%d to horizon\n",
    -          numnew, qh_pointid(point)));
    -  if (qh IStracing >= 4)
    -    qh_printfacetlist(qh newfacet_list, NULL, qh_ALL);
    -  return apex;
    -} /* makenewfacets */
    -
    -/*---------------------------------
    -
    -  qh_matchduplicates( atfacet, atskip, hashsize, hashcount )
    -    match duplicate ridges in qh.hash_table for atfacet/atskip
    -    duplicates marked with ->dupridge and qh_DUPLICATEridge
    -
    -  returns:
    -    picks match with worst merge (min distance apart)
    -    updates hashcount
    -
    -  see also:
    -    qh_matchneighbor
    -
    -  notes:
    -
    -  design:
    -    compute hash value for atfacet and atskip
    -    repeat twice -- once to make best matches, once to match the rest
    -      for each possible facet in qh.hash_table
    -        if it is a matching facet and pass 2
    -          make match
    -          unless tricoplanar, mark match for merging (qh_MERGEridge)
    -          [e.g., tricoplanar RBOX s 1000 t993602376 | QHULL C-1e-3 d Qbb FA Qt]
    -        if it is a matching facet and pass 1
    -          test if this is a better match
    -      if pass 1,
    -        make best match (it will not be merged)
    -*/
    -#ifndef qh_NOmerge
    -void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount) {
    -  boolT same, ismatch;
    -  int hash, scan;
    -  facetT *facet, *newfacet, *maxmatch= NULL, *maxmatch2= NULL, *nextfacet;
    -  int skip, newskip, nextskip= 0, maxskip= 0, maxskip2= 0, makematch;
    -  realT maxdist= -REALmax, mindist, dist2, low, high;
    -
    -  hash= qh_gethash(hashsize, atfacet->vertices, qh hull_dim, 1,
    -                     SETelem_(atfacet->vertices, atskip));
    -  trace2((qh ferr, 2046, "qh_matchduplicates: find duplicate matches for f%d skip %d hash %d hashcount %d\n",
    -          atfacet->id, atskip, hash, *hashcount));
    -  for (makematch= 0; makematch < 2; makematch++) {
    -    qh visit_id++;
    -    for (newfacet= atfacet, newskip= atskip; newfacet; newfacet= nextfacet, newskip= nextskip) {
    -      zinc_(Zhashlookup);
    -      nextfacet= NULL;
    -      newfacet->visitid= qh visit_id;
    -      for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT));
    -           scan= (++scan >= hashsize ? 0 : scan)) {
    -        if (!facet->dupridge || facet->visitid == qh visit_id)
    -          continue;
    -        zinc_(Zhashtests);
    -        if (qh_matchvertices(1, newfacet->vertices, newskip, facet->vertices, &skip, &same)) {
    -          ismatch= (same == (boolT)(newfacet->toporient ^ facet->toporient));
    -          if (SETelemt_(facet->neighbors, skip, facetT) != qh_DUPLICATEridge) {
    -            if (!makematch) {
    -              qh_fprintf(qh ferr, 6155, "qhull internal error (qh_matchduplicates): missing dupridge at f%d skip %d for new f%d skip %d hash %d\n",
    -                     facet->id, skip, newfacet->id, newskip, hash);
    -              qh_errexit2 (qh_ERRqhull, facet, newfacet);
    -            }
    -          }else if (ismatch && makematch) {
    -            if (SETelemt_(newfacet->neighbors, newskip, facetT) == qh_DUPLICATEridge) {
    -              SETelem_(facet->neighbors, skip)= newfacet;
    -              if (newfacet->tricoplanar)
    -                SETelem_(newfacet->neighbors, newskip)= facet;
    -              else
    -                SETelem_(newfacet->neighbors, newskip)= qh_MERGEridge;
    -              *hashcount -= 2; /* removed two unmatched facets */
    -              trace4((qh ferr, 4059, "qh_matchduplicates: duplicate f%d skip %d matched with new f%d skip %d merge\n",
    -                    facet->id, skip, newfacet->id, newskip));
    -            }
    -          }else if (ismatch) {
    -            mindist= qh_getdistance(facet, newfacet, &low, &high);
    -            dist2= qh_getdistance(newfacet, facet, &low, &high);
    -            minimize_(mindist, dist2);
    -            if (mindist > maxdist) {
    -              maxdist= mindist;
    -              maxmatch= facet;
    -              maxskip= skip;
    -              maxmatch2= newfacet;
    -              maxskip2= newskip;
    -            }
    -            trace3((qh ferr, 3018, "qh_matchduplicates: duplicate f%d skip %d new f%d skip %d at dist %2.2g, max is now f%d f%d\n",
    -                    facet->id, skip, newfacet->id, newskip, mindist,
    -                    maxmatch->id, maxmatch2->id));
    -          }else { /* !ismatch */
    -            nextfacet= facet;
    -            nextskip= skip;
    -          }
    -        }
    -        if (makematch && !facet
    -        && SETelemt_(facet->neighbors, skip, facetT) == qh_DUPLICATEridge) {
    -          qh_fprintf(qh ferr, 6156, "qhull internal error (qh_matchduplicates): no MERGEridge match for duplicate f%d skip %d at hash %d\n",
    -                     newfacet->id, newskip, hash);
    -          qh_errexit(qh_ERRqhull, newfacet, NULL);
    -        }
    -      }
    -    } /* end of for each new facet at hash */
    -    if (!makematch) {
    -      if (!maxmatch) {
    -        qh_fprintf(qh ferr, 6157, "qhull internal error (qh_matchduplicates): no maximum match at duplicate f%d skip %d at hash %d\n",
    -                     atfacet->id, atskip, hash);
    -        qh_errexit(qh_ERRqhull, atfacet, NULL);
    -      }
    -      SETelem_(maxmatch->neighbors, maxskip)= maxmatch2;
    -      SETelem_(maxmatch2->neighbors, maxskip2)= maxmatch;
    -      *hashcount -= 2; /* removed two unmatched facets */
    -      zzinc_(Zmultiridge);
    -      trace0((qh ferr, 25, "qh_matchduplicates: duplicate f%d skip %d matched with new f%d skip %d keep\n",
    -              maxmatch->id, maxskip, maxmatch2->id, maxskip2));
    -      qh_precision("ridge with multiple neighbors");
    -      if (qh IStracing >= 4)
    -        qh_errprint("DUPLICATED/MATCH", maxmatch, maxmatch2, NULL, NULL);
    -    }
    -  }
    -} /* matchduplicates */
    -
    -/*---------------------------------
    -
    -  qh_nearcoplanar()
    -    for all facets, remove near-inside points from facet->coplanarset
  • - coplanar points defined by innerplane from qh_outerinner() - - returns: - if qh KEEPcoplanar && !qh KEEPinside - facet->coplanarset only contains coplanar points - if qh.JOGGLEmax - drops inner plane by another qh.JOGGLEmax diagonal since a - vertex could shift out while a coplanar point shifts in - - notes: - used for qh.PREmerge and qh.JOGGLEmax - must agree with computation of qh.NEARcoplanar in qh_detroundoff() - design: - if not keeping coplanar or inside points - free all coplanar sets - else if not keeping both coplanar and inside points - remove !coplanar or !inside points from coplanar sets -*/ -void qh_nearcoplanar(void /* qh.facet_list */) { - facetT *facet; - pointT *point, **pointp; - int numpart; - realT dist, innerplane; - - if (!qh KEEPcoplanar && !qh KEEPinside) { - FORALLfacets { - if (facet->coplanarset) - qh_setfree( &facet->coplanarset); - } - }else if (!qh KEEPcoplanar || !qh KEEPinside) { - qh_outerinner(NULL, NULL, &innerplane); - if (qh JOGGLEmax < REALmax/2) - innerplane -= qh JOGGLEmax * sqrt((realT)qh hull_dim); - numpart= 0; - FORALLfacets { - if (facet->coplanarset) { - FOREACHpoint_(facet->coplanarset) { - numpart++; - qh_distplane(point, facet, &dist); - if (dist < innerplane) { - if (!qh KEEPinside) - SETref_(point)= NULL; - }else if (!qh KEEPcoplanar) - SETref_(point)= NULL; - } - qh_setcompact(facet->coplanarset); - } - } - zzadd_(Zcheckpart, numpart); - } -} /* nearcoplanar */ - -/*--------------------------------- - - qh_nearvertex( facet, point, bestdist ) - return nearest vertex in facet to point - - returns: - vertex and its distance - - notes: - if qh.DELAUNAY - distance is measured in the input set - searches neighboring tricoplanar facets (requires vertexneighbors) - Slow implementation. Recomputes vertex set for each point. - The vertex set could be stored in the qh.keepcentrum facet. -*/ -vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp) { - realT bestdist= REALmax, dist; - vertexT *bestvertex= NULL, *vertex, **vertexp, *apex; - coordT *center; - facetT *neighbor, **neighborp; - setT *vertices; - int dim= qh hull_dim; - - if (qh DELAUNAY) - dim--; - if (facet->tricoplanar) { - if (!qh VERTEXneighbors || !facet->center) { - qh_fprintf(qh ferr, 6158, "qhull internal error (qh_nearvertex): qh.VERTEXneighbors and facet->center required for tricoplanar facets\n"); - qh_errexit(qh_ERRqhull, facet, NULL); - } - vertices= qh_settemp(qh TEMPsize); - apex= SETfirstt_(facet->vertices, vertexT); - center= facet->center; - FOREACHneighbor_(apex) { - if (neighbor->center == center) { - FOREACHvertex_(neighbor->vertices) - qh_setappend(&vertices, vertex); - } - } - }else - vertices= facet->vertices; - FOREACHvertex_(vertices) { - dist= qh_pointdist(vertex->point, point, -dim); - if (dist < bestdist) { - bestdist= dist; - bestvertex= vertex; - } - } - if (facet->tricoplanar) - qh_settempfree(&vertices); - *bestdistp= sqrt(bestdist); - trace3((qh ferr, 3019, "qh_nearvertex: v%d dist %2.2g for f%d p%d\n", - bestvertex->id, *bestdistp, facet->id, qh_pointid(point))); - return bestvertex; -} /* nearvertex */ - -/*--------------------------------- - - qh_newhashtable( newsize ) - returns size of qh.hash_table of at least newsize slots - - notes: - assumes qh.hash_table is NULL - qh_HASHfactor determines the number of extra slots - size is not divisible by 2, 3, or 5 -*/ -int qh_newhashtable(int newsize) { - int size; - - size= ((newsize+1)*qh_HASHfactor) | 0x1; /* odd number */ - while (True) { - if (newsize<0 || size<0) { - qh_fprintf(qhmem.ferr, 6236, "qhull error (qh_newhashtable): negative request (%d) or size (%d). Did int overflow due to high-D?\n", newsize, size); /* WARN64 */ - qh_errexit(qhmem_ERRmem, NULL, NULL); - } - if ((size%3) && (size%5)) - break; - size += 2; - /* loop terminates because there is an infinite number of primes */ - } - qh hash_table= qh_setnew(size); - qh_setzero(qh hash_table, 0, size); - return size; -} /* newhashtable */ - -/*--------------------------------- - - qh_newvertex( point ) - returns a new vertex for point -*/ -vertexT *qh_newvertex(pointT *point) { - vertexT *vertex; - - zinc_(Ztotvertices); - vertex= (vertexT *)qh_memalloc((int)sizeof(vertexT)); - memset((char *) vertex, (size_t)0, sizeof(vertexT)); - if (qh vertex_id == 0xFFFFFF) { - qh_fprintf(qh ferr, 6159, "qhull error: more than %d vertices. ID field overflows and two vertices\n\ -may have the same identifier. Vertices will not be sorted correctly.\n", 0xFFFFFF); - qh_errexit(qh_ERRqhull, NULL, NULL); - } - if (qh vertex_id == qh tracevertex_id) - qh tracevertex= vertex; - vertex->id= qh vertex_id++; - vertex->point= point; - vertex->dim= (unsigned char)(qh hull_dim <= MAX_vdim ? qh hull_dim : 0); - trace4((qh ferr, 4060, "qh_newvertex: vertex p%d(v%d) created\n", qh_pointid(vertex->point), - vertex->id)); - return(vertex); -} /* newvertex */ - -/*--------------------------------- - - qh_nextridge3d( atridge, facet, vertex ) - return next ridge and vertex for a 3d facet - returns NULL on error - [for QhullFacet::nextRidge3d] Does not call qh_errexit nor access qh_qh. - - notes: - in qh_ORIENTclock order - this is a O(n^2) implementation to trace all ridges - be sure to stop on any 2nd visit - same as QhullRidge::nextRidge3d - does not use qh_qh or qh_errexit [QhullFacet.cpp] - - design: - for each ridge - exit if it is the ridge after atridge -*/ -ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp) { - vertexT *atvertex, *vertex, *othervertex; - ridgeT *ridge, **ridgep; - - if ((atridge->top == facet) ^ qh_ORIENTclock) - atvertex= SETsecondt_(atridge->vertices, vertexT); - else - atvertex= SETfirstt_(atridge->vertices, vertexT); - FOREACHridge_(facet->ridges) { - if (ridge == atridge) - continue; - if ((ridge->top == facet) ^ qh_ORIENTclock) { - othervertex= SETsecondt_(ridge->vertices, vertexT); - vertex= SETfirstt_(ridge->vertices, vertexT); - }else { - vertex= SETsecondt_(ridge->vertices, vertexT); - othervertex= SETfirstt_(ridge->vertices, vertexT); - } - if (vertex == atvertex) { - if (vertexp) - *vertexp= othervertex; - return ridge; - } - } - return NULL; -} /* nextridge3d */ -#else /* qh_NOmerge */ -void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount) { -} -ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp) { - - return NULL; -} -#endif /* qh_NOmerge */ - -/*--------------------------------- - - qh_outcoplanar() - move points from all facets' outsidesets to their coplanarsets - - notes: - for post-processing under qh.NARROWhull - - design: - for each facet - for each outside point for facet - partition point into coplanar set -*/ -void qh_outcoplanar(void /* facet_list */) { - pointT *point, **pointp; - facetT *facet; - realT dist; - - trace1((qh ferr, 1033, "qh_outcoplanar: move outsideset to coplanarset for qh NARROWhull\n")); - FORALLfacets { - FOREACHpoint_(facet->outsideset) { - qh num_outside--; - if (qh KEEPcoplanar || qh KEEPnearinside) { - qh_distplane(point, facet, &dist); - zinc_(Zpartition); - qh_partitioncoplanar(point, facet, &dist); - } - } - qh_setfree(&facet->outsideset); - } -} /* outcoplanar */ - -/*--------------------------------- - - qh_point( id ) - return point for a point id, or NULL if unknown - - alternative code: - return((pointT *)((unsigned long)qh.first_point - + (unsigned long)((id)*qh.normal_size))); -*/ -pointT *qh_point(int id) { - - if (id < 0) - return NULL; - if (id < qh num_points) - return qh first_point + id * qh hull_dim; - id -= qh num_points; - if (id < qh_setsize(qh other_points)) - return SETelemt_(qh other_points, id, pointT); - return NULL; -} /* point */ - -/*--------------------------------- - - qh_point_add( set, point, elem ) - stores elem at set[point.id] - - returns: - access function for qh_pointfacet and qh_pointvertex - - notes: - checks point.id -*/ -void qh_point_add(setT *set, pointT *point, void *elem) { - int id, size; - - SETreturnsize_(set, size); - if ((id= qh_pointid(point)) < 0) - qh_fprintf(qh ferr, 7067, "qhull internal warning (point_add): unknown point %p id %d\n", - point, id); - else if (id >= size) { - qh_fprintf(qh ferr, 6160, "qhull internal errror(point_add): point p%d is out of bounds(%d)\n", - id, size); - qh_errexit(qh_ERRqhull, NULL, NULL); - }else - SETelem_(set, id)= elem; -} /* point_add */ - - -/*--------------------------------- - - qh_pointfacet() - return temporary set of facet for each point - the set is indexed by point id - - notes: - vertices assigned to one of the facets - coplanarset assigned to the facet - outside set assigned to the facet - NULL if no facet for point (inside) - includes qh.GOODpointp - - access: - FOREACHfacet_i_(facets) { ... } - SETelem_(facets, i) - - design: - for each facet - add each vertex - add each coplanar point - add each outside point -*/ -setT *qh_pointfacet(void /*qh facet_list*/) { - int numpoints= qh num_points + qh_setsize(qh other_points); - setT *facets; - facetT *facet; - vertexT *vertex, **vertexp; - pointT *point, **pointp; - - facets= qh_settemp(numpoints); - qh_setzero(facets, 0, numpoints); - qh vertex_visit++; - FORALLfacets { - FOREACHvertex_(facet->vertices) { - if (vertex->visitid != qh vertex_visit) { - vertex->visitid= qh vertex_visit; - qh_point_add(facets, vertex->point, facet); - } - } - FOREACHpoint_(facet->coplanarset) - qh_point_add(facets, point, facet); - FOREACHpoint_(facet->outsideset) - qh_point_add(facets, point, facet); - } - return facets; -} /* pointfacet */ - -/*--------------------------------- - - qh_pointvertex( ) - return temporary set of vertices indexed by point id - entry is NULL if no vertex for a point - this will include qh.GOODpointp - - access: - FOREACHvertex_i_(vertices) { ... } - SETelem_(vertices, i) -*/ -setT *qh_pointvertex(void /*qh facet_list*/) { - int numpoints= qh num_points + qh_setsize(qh other_points); - setT *vertices; - vertexT *vertex; - - vertices= qh_settemp(numpoints); - qh_setzero(vertices, 0, numpoints); - FORALLvertices - qh_point_add(vertices, vertex->point, vertex); - return vertices; -} /* pointvertex */ - - -/*--------------------------------- - - qh_prependfacet( facet, facetlist ) - prepend facet to the start of a facetlist - - returns: - increments qh.numfacets - updates facetlist, qh.facet_list, facet_next - - notes: - be careful of prepending since it can lose a pointer. - e.g., can lose _next by deleting and then prepending before _next -*/ -void qh_prependfacet(facetT *facet, facetT **facetlist) { - facetT *prevfacet, *list; - - - trace4((qh ferr, 4061, "qh_prependfacet: prepend f%d before f%d\n", - facet->id, getid_(*facetlist))); - if (!*facetlist) - (*facetlist)= qh facet_tail; - list= *facetlist; - prevfacet= list->previous; - facet->previous= prevfacet; - if (prevfacet) - prevfacet->next= facet; - list->previous= facet; - facet->next= *facetlist; - if (qh facet_list == list) /* this may change *facetlist */ - qh facet_list= facet; - if (qh facet_next == list) - qh facet_next= facet; - *facetlist= facet; - qh num_facets++; -} /* prependfacet */ - - -/*--------------------------------- - - qh_printhashtable( fp ) - print hash table to fp - - notes: - not in I/O to avoid bringing io.c in - - design: - for each hash entry - if defined - if unmatched or will merge (NULL, qh_MERGEridge, qh_DUPLICATEridge) - print entry and neighbors -*/ -void qh_printhashtable(FILE *fp) { - facetT *facet, *neighbor; - int id, facet_i, facet_n, neighbor_i= 0, neighbor_n= 0; - vertexT *vertex, **vertexp; - - FOREACHfacet_i_(qh hash_table) { - if (facet) { - FOREACHneighbor_i_(facet) { - if (!neighbor || neighbor == qh_MERGEridge || neighbor == qh_DUPLICATEridge) - break; - } - if (neighbor_i == neighbor_n) - continue; - qh_fprintf(fp, 9283, "hash %d f%d ", facet_i, facet->id); - FOREACHvertex_(facet->vertices) - qh_fprintf(fp, 9284, "v%d ", vertex->id); - qh_fprintf(fp, 9285, "\n neighbors:"); - FOREACHneighbor_i_(facet) { - if (neighbor == qh_MERGEridge) - id= -3; - else if (neighbor == qh_DUPLICATEridge) - id= -2; - else - id= getid_(neighbor); - qh_fprintf(fp, 9286, " %d", id); - } - qh_fprintf(fp, 9287, "\n"); - } - } -} /* printhashtable */ - - -/*--------------------------------- - - qh_printlists( fp ) - print out facet and vertex list for debugging (without 'f/v' tags) -*/ -void qh_printlists(void) { - facetT *facet; - vertexT *vertex; - int count= 0; - - qh_fprintf(qh ferr, 8108, "qh_printlists: facets:"); - FORALLfacets { - if (++count % 100 == 0) - qh_fprintf(qh ferr, 8109, "\n "); - qh_fprintf(qh ferr, 8110, " %d", facet->id); - } - qh_fprintf(qh ferr, 8111, "\n new facets %d visible facets %d next facet for qh_addpoint %d\n vertices(new %d):", - getid_(qh newfacet_list), getid_(qh visible_list), getid_(qh facet_next), - getid_(qh newvertex_list)); - count = 0; - FORALLvertices { - if (++count % 100 == 0) - qh_fprintf(qh ferr, 8112, "\n "); - qh_fprintf(qh ferr, 8113, " %d", vertex->id); - } - qh_fprintf(qh ferr, 8114, "\n"); -} /* printlists */ - -/*--------------------------------- - - qh_resetlists( stats, qh_RESETvisible ) - reset newvertex_list, newfacet_list, visible_list - if stats, - maintains statistics - - returns: - visible_list is empty if qh_deletevisible was called -*/ -void qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/) { - vertexT *vertex; - facetT *newfacet, *visible; - int totnew=0, totver=0; - - if (stats) { - FORALLvertex_(qh newvertex_list) - totver++; - FORALLnew_facets - totnew++; - zadd_(Zvisvertextot, totver); - zmax_(Zvisvertexmax, totver); - zadd_(Znewfacettot, totnew); - zmax_(Znewfacetmax, totnew); - } - FORALLvertex_(qh newvertex_list) - vertex->newlist= False; - qh newvertex_list= NULL; - FORALLnew_facets - newfacet->newfacet= False; - qh newfacet_list= NULL; - if (resetVisible) { - FORALLvisible_facets { - visible->f.replace= NULL; - visible->visible= False; - } - qh num_visible= 0; - } - qh visible_list= NULL; /* may still have visible facets via qh_triangulate */ - qh NEWfacets= False; -} /* resetlists */ - -/*--------------------------------- - - qh_setvoronoi_all() - compute Voronoi centers for all facets - includes upperDelaunay facets if qh.UPPERdelaunay ('Qu') - - returns: - facet->center is the Voronoi center - - notes: - this is unused/untested code - please email bradb@shore.net if this works ok for you - - use: - FORALLvertices {...} to locate the vertex for a point. - FOREACHneighbor_(vertex) {...} to visit the Voronoi centers for a Voronoi cell. -*/ -void qh_setvoronoi_all(void) { - facetT *facet; - - qh_clearcenters(qh_ASvoronoi); - qh_vertexneighbors(); - - FORALLfacets { - if (!facet->normal || !facet->upperdelaunay || qh UPPERdelaunay) { - if (!facet->center) - facet->center= qh_facetcenter(facet->vertices); - } - } -} /* setvoronoi_all */ - -#ifndef qh_NOmerge - -/*--------------------------------- - - qh_triangulate() - triangulate non-simplicial facets on qh.facet_list, - if qh VORONOI, sets Voronoi centers of non-simplicial facets - nop if hasTriangulation - - returns: - all facets simplicial - each tricoplanar facet has ->f.triowner == owner of ->center,normal,etc. - - notes: - call after qh_check_output since may switch to Voronoi centers - Output may overwrite ->f.triowner with ->f.area -*/ -void qh_triangulate(void /*qh facet_list*/) { - facetT *facet, *nextfacet, *owner; - int onlygood= qh ONLYgood; - facetT *neighbor, *visible= NULL, *facet1, *facet2, *new_facet_list= NULL; - facetT *orig_neighbor= NULL, *otherfacet; - vertexT *new_vertex_list= NULL; - mergeT *merge; - mergeType mergetype; - int neighbor_i, neighbor_n; - - if (qh hasTriangulation) - return; - trace1((qh ferr, 1034, "qh_triangulate: triangulate non-simplicial facets\n")); - if (qh hull_dim == 2) - return; - if (qh VORONOI) { /* otherwise lose Voronoi centers [could rebuild vertex set from tricoplanar] */ - qh_clearcenters(qh_ASvoronoi); - qh_vertexneighbors(); - } - qh ONLYgood= False; /* for makenew_nonsimplicial */ - qh visit_id++; - qh NEWfacets= True; - qh degen_mergeset= qh_settemp(qh TEMPsize); - qh newvertex_list= qh vertex_tail; - for (facet= qh facet_list; facet && facet->next; facet= nextfacet) { /* non-simplicial facets moved to end */ - nextfacet= facet->next; - if (facet->visible || facet->simplicial) - continue; - /* triangulate all non-simplicial facets, otherwise merging does not work, e.g., RBOX c P-0.1 P+0.1 P+0.1 D3 | QHULL d Qt Tv */ - if (!new_facet_list) - new_facet_list= facet; /* will be moved to end */ - qh_triangulate_facet(facet, &new_vertex_list); - } - trace2((qh ferr, 2047, "qh_triangulate: delete null facets from f%d -- apex same as second vertex\n", getid_(new_facet_list))); - for (facet= new_facet_list; facet && facet->next; facet= nextfacet) { /* null facets moved to end */ - nextfacet= facet->next; - if (facet->visible) - continue; - if (facet->ridges) { - if (qh_setsize(facet->ridges) > 0) { - qh_fprintf(qh ferr, 6161, "qhull error (qh_triangulate): ridges still defined for f%d\n", facet->id); - qh_errexit(qh_ERRqhull, facet, NULL); - } - qh_setfree(&facet->ridges); - } - if (SETfirst_(facet->vertices) == SETsecond_(facet->vertices)) { - zinc_(Ztrinull); - qh_triangulate_null(facet); - } - } - trace2((qh ferr, 2048, "qh_triangulate: delete %d or more mirror facets -- same vertices and neighbors\n", qh_setsize(qh degen_mergeset))); - qh visible_list= qh facet_tail; - while ((merge= (mergeT*)qh_setdellast(qh degen_mergeset))) { - facet1= merge->facet1; - facet2= merge->facet2; - mergetype= merge->type; - qh_memfree(merge, (int)sizeof(mergeT)); - if (mergetype == MRGmirror) { - zinc_(Ztrimirror); - qh_triangulate_mirror(facet1, facet2); - } - } - qh_settempfree(&qh degen_mergeset); - trace2((qh ferr, 2049, "qh_triangulate: update neighbor lists for vertices from v%d\n", getid_(new_vertex_list))); - qh newvertex_list= new_vertex_list; /* all vertices of new facets */ - qh visible_list= NULL; - qh_updatevertices(/*qh newvertex_list, empty newfacet_list and visible_list*/); - qh_resetlists(False, !qh_RESETvisible /*qh newvertex_list, empty newfacet_list and visible_list*/); - - trace2((qh ferr, 2050, "qh_triangulate: identify degenerate tricoplanar facets from f%d\n", getid_(new_facet_list))); - trace2((qh ferr, 2051, "qh_triangulate: and replace facet->f.triowner with tricoplanar facets that own center, normal, etc.\n")); - FORALLfacet_(new_facet_list) { - if (facet->tricoplanar && !facet->visible) { - FOREACHneighbor_i_(facet) { - if (neighbor_i == 0) { /* first iteration */ - if (neighbor->tricoplanar) - orig_neighbor= neighbor->f.triowner; - else - orig_neighbor= neighbor; - }else { - if (neighbor->tricoplanar) - otherfacet= neighbor->f.triowner; - else - otherfacet= neighbor; - if (orig_neighbor == otherfacet) { - zinc_(Ztridegen); - facet->degenerate= True; - break; - } - } - } - } - } - - trace2((qh ferr, 2052, "qh_triangulate: delete visible facets -- non-simplicial, null, and mirrored facets\n")); - owner= NULL; - visible= NULL; - for (facet= new_facet_list; facet && facet->next; facet= nextfacet) { /* may delete facet */ - nextfacet= facet->next; - if (facet->visible) { - if (facet->tricoplanar) { /* a null or mirrored facet */ - qh_delfacet(facet); - qh num_visible--; - }else { /* a non-simplicial facet followed by its tricoplanars */ - if (visible && !owner) { - /* RBOX 200 s D5 t1001471447 | QHULL Qt C-0.01 Qx Qc Tv Qt -- f4483 had 6 vertices/neighbors and 8 ridges */ - trace2((qh ferr, 2053, "qh_triangulate: all tricoplanar facets degenerate for non-simplicial facet f%d\n", - visible->id)); - qh_delfacet(visible); - qh num_visible--; - } - visible= facet; - owner= NULL; - } - }else if (facet->tricoplanar) { - if (facet->f.triowner != visible) { - qh_fprintf(qh ferr, 6162, "qhull error (qh_triangulate): tricoplanar facet f%d not owned by its visible, non-simplicial facet f%d\n", facet->id, getid_(visible)); - qh_errexit2 (qh_ERRqhull, facet, visible); - } - if (owner) - facet->f.triowner= owner; - else if (!facet->degenerate) { - owner= facet; - nextfacet= visible->next; /* rescan tricoplanar facets with owner */ - facet->keepcentrum= True; /* one facet owns ->normal, etc. */ - facet->coplanarset= visible->coplanarset; - facet->outsideset= visible->outsideset; - visible->coplanarset= NULL; - visible->outsideset= NULL; - if (!qh TRInormals) { /* center and normal copied to tricoplanar facets */ - visible->center= NULL; - visible->normal= NULL; - } - qh_delfacet(visible); - qh num_visible--; - } - } - } - if (visible && !owner) { - trace2((qh ferr, 2054, "qh_triangulate: all tricoplanar facets degenerate for last non-simplicial facet f%d\n", - visible->id)); - qh_delfacet(visible); - qh num_visible--; - } - qh NEWfacets= False; - qh ONLYgood= onlygood; /* restore value */ - if (qh CHECKfrequently) - qh_checkpolygon(qh facet_list); - qh hasTriangulation= True; -} /* triangulate */ - - -/*--------------------------------- - - qh_triangulate_facet(facetA) - triangulate a non-simplicial facet - if qh.CENTERtype=qh_ASvoronoi, sets its Voronoi center - returns: - qh.newfacet_list == simplicial facets - facet->tricoplanar set and ->keepcentrum false - facet->degenerate set if duplicated apex - facet->f.trivisible set to facetA - facet->center copied from facetA (created if qh_ASvoronoi) - qh_eachvoronoi, qh_detvridge, qh_detvridge3 assume centers copied - facet->normal,offset,maxoutside copied from facetA - - notes: - qh_makenew_nonsimplicial uses neighbor->seen for the same - - see also: - qh_addpoint() -- add a point - qh_makenewfacets() -- construct a cone of facets for a new vertex - - design: - if qh_ASvoronoi, - compute Voronoi center (facet->center) - select first vertex (highest ID to preserve ID ordering of ->vertices) - triangulate from vertex to ridges - copy facet->center, normal, offset - update vertex neighbors -*/ -void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex) { - facetT *newfacet; - facetT *neighbor, **neighborp; - vertexT *apex; - int numnew=0; - - trace3((qh ferr, 3020, "qh_triangulate_facet: triangulate facet f%d\n", facetA->id)); - - if (qh IStracing >= 4) - qh_printfacet(qh ferr, facetA); - FOREACHneighbor_(facetA) { - neighbor->seen= False; - neighbor->coplanar= False; - } - if (qh CENTERtype == qh_ASvoronoi && !facetA->center /* matches upperdelaunay in qh_setfacetplane() */ - && fabs_(facetA->normal[qh hull_dim -1]) >= qh ANGLEround * qh_ZEROdelaunay) { - facetA->center= qh_facetcenter(facetA->vertices); - } - qh_willdelete(facetA, NULL); - qh newfacet_list= qh facet_tail; - facetA->visitid= qh visit_id; - apex= SETfirstt_(facetA->vertices, vertexT); - qh_makenew_nonsimplicial(facetA, apex, &numnew); - SETfirst_(facetA->neighbors)= NULL; - FORALLnew_facets { - newfacet->tricoplanar= True; - newfacet->f.trivisible= facetA; - newfacet->degenerate= False; - newfacet->upperdelaunay= facetA->upperdelaunay; - newfacet->good= facetA->good; - if (qh TRInormals) { - newfacet->keepcentrum= True; - newfacet->normal= qh_copypoints(facetA->normal, 1, qh hull_dim); - if (qh CENTERtype == qh_AScentrum) - newfacet->center= qh_getcentrum(newfacet); - else - newfacet->center= qh_copypoints(facetA->center, 1, qh hull_dim); - }else { - newfacet->keepcentrum= False; - newfacet->normal= facetA->normal; - newfacet->center= facetA->center; - } - newfacet->offset= facetA->offset; -#if qh_MAXoutside - newfacet->maxoutside= facetA->maxoutside; -#endif - } - qh_matchnewfacets(/*qh newfacet_list*/); - zinc_(Ztricoplanar); - zadd_(Ztricoplanartot, numnew); - zmax_(Ztricoplanarmax, numnew); - qh visible_list= NULL; - if (!(*first_vertex)) - (*first_vertex)= qh newvertex_list; - qh newvertex_list= NULL; - qh_updatevertices(/*qh newfacet_list, empty visible_list and newvertex_list*/); - qh_resetlists(False, !qh_RESETvisible /*qh newfacet_list, empty visible_list and newvertex_list*/); -} /* triangulate_facet */ - -/*--------------------------------- - - qh_triangulate_link(oldfacetA, facetA, oldfacetB, facetB) - relink facetA to facetB via oldfacets - returns: - adds mirror facets to qh degen_mergeset (4-d and up only) - design: - if they are already neighbors, the opposing neighbors become MRGmirror facets -*/ -void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB) { - int errmirror= False; - - trace3((qh ferr, 3021, "qh_triangulate_link: relink old facets f%d and f%d between neighbors f%d and f%d\n", - oldfacetA->id, oldfacetB->id, facetA->id, facetB->id)); - if (qh_setin(facetA->neighbors, facetB)) { - if (!qh_setin(facetB->neighbors, facetA)) - errmirror= True; - else - qh_appendmergeset(facetA, facetB, MRGmirror, NULL); - }else if (qh_setin(facetB->neighbors, facetA)) - errmirror= True; - if (errmirror) { - qh_fprintf(qh ferr, 6163, "qhull error (qh_triangulate_link): mirror facets f%d and f%d do not match for old facets f%d and f%d\n", - facetA->id, facetB->id, oldfacetA->id, oldfacetB->id); - qh_errexit2 (qh_ERRqhull, facetA, facetB); - } - qh_setreplace(facetB->neighbors, oldfacetB, facetA); - qh_setreplace(facetA->neighbors, oldfacetA, facetB); -} /* triangulate_link */ - -/*--------------------------------- - - qh_triangulate_mirror(facetA, facetB) - delete mirrored facets from qh_triangulate_null() and qh_triangulate_mirror - a mirrored facet shares the same vertices of a logical ridge - design: - since a null facet duplicates the first two vertices, the opposing neighbors absorb the null facet - if they are already neighbors, the opposing neighbors become MRGmirror facets -*/ -void qh_triangulate_mirror(facetT *facetA, facetT *facetB) { - facetT *neighbor, *neighborB; - int neighbor_i, neighbor_n; - - trace3((qh ferr, 3022, "qh_triangulate_mirror: delete mirrored facets f%d and f%d\n", - facetA->id, facetB->id)); - FOREACHneighbor_i_(facetA) { - neighborB= SETelemt_(facetB->neighbors, neighbor_i, facetT); - if (neighbor == neighborB) - continue; /* occurs twice */ - qh_triangulate_link(facetA, neighbor, facetB, neighborB); - } - qh_willdelete(facetA, NULL); - qh_willdelete(facetB, NULL); -} /* triangulate_mirror */ - -/*--------------------------------- - - qh_triangulate_null(facetA) - remove null facetA from qh_triangulate_facet() - a null facet has vertex #1 (apex) == vertex #2 - returns: - adds facetA to ->visible for deletion after qh_updatevertices - qh degen_mergeset contains mirror facets (4-d and up only) - design: - since a null facet duplicates the first two vertices, the opposing neighbors absorb the null facet - if they are already neighbors, the opposing neighbors become MRGmirror facets -*/ -void qh_triangulate_null(facetT *facetA) { - facetT *neighbor, *otherfacet; - - trace3((qh ferr, 3023, "qh_triangulate_null: delete null facet f%d\n", facetA->id)); - neighbor= SETfirstt_(facetA->neighbors, facetT); - otherfacet= SETsecondt_(facetA->neighbors, facetT); - qh_triangulate_link(facetA, neighbor, facetA, otherfacet); - qh_willdelete(facetA, NULL); -} /* triangulate_null */ - -#else /* qh_NOmerge */ -void qh_triangulate(void) { -} -#endif /* qh_NOmerge */ - - /*--------------------------------- - - qh_vertexintersect( vertexsetA, vertexsetB ) - intersects two vertex sets (inverse id ordered) - vertexsetA is a temporary set at the top of qhmem.tempstack - - returns: - replaces vertexsetA with the intersection - - notes: - could overwrite vertexsetA if currently too slow -*/ -void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB) { - setT *intersection; - - intersection= qh_vertexintersect_new(*vertexsetA, vertexsetB); - qh_settempfree(vertexsetA); - *vertexsetA= intersection; - qh_settemppush(intersection); -} /* vertexintersect */ - -/*--------------------------------- - - qh_vertexintersect_new( ) - intersects two vertex sets (inverse id ordered) - - returns: - a new set -*/ -setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB) { - setT *intersection= qh_setnew(qh hull_dim - 1); - vertexT **vertexA= SETaddr_(vertexsetA, vertexT); - vertexT **vertexB= SETaddr_(vertexsetB, vertexT); - - while (*vertexA && *vertexB) { - if (*vertexA == *vertexB) { - qh_setappend(&intersection, *vertexA); - vertexA++; vertexB++; - }else { - if ((*vertexA)->id > (*vertexB)->id) - vertexA++; - else - vertexB++; - } - } - return intersection; -} /* vertexintersect_new */ - -/*--------------------------------- - - qh_vertexneighbors() - for each vertex in qh.facet_list, - determine its neighboring facets - - returns: - sets qh.VERTEXneighbors - nop if qh.VERTEXneighbors already set - qh_addpoint() will maintain them - - notes: - assumes all vertex->neighbors are NULL - - design: - for each facet - for each vertex - append facet to vertex->neighbors -*/ -void qh_vertexneighbors(void /*qh facet_list*/) { - facetT *facet; - vertexT *vertex, **vertexp; - - if (qh VERTEXneighbors) - return; - trace1((qh ferr, 1035, "qh_vertexneighbors: determing neighboring facets for each vertex\n")); - qh vertex_visit++; - FORALLfacets { - if (facet->visible) - continue; - FOREACHvertex_(facet->vertices) { - if (vertex->visitid != qh vertex_visit) { - vertex->visitid= qh vertex_visit; - vertex->neighbors= qh_setnew(qh hull_dim); - } - qh_setappend(&vertex->neighbors, facet); - } - } - qh VERTEXneighbors= True; -} /* vertexneighbors */ - -/*--------------------------------- - - qh_vertexsubset( vertexsetA, vertexsetB ) - returns True if vertexsetA is a subset of vertexsetB - assumes vertexsets are sorted - - note: - empty set is a subset of any other set -*/ -boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB) { - vertexT **vertexA= (vertexT **) SETaddr_(vertexsetA, vertexT); - vertexT **vertexB= (vertexT **) SETaddr_(vertexsetB, vertexT); - - while (True) { - if (!*vertexA) - return True; - if (!*vertexB) - return False; - if ((*vertexA)->id > (*vertexB)->id) - return False; - if (*vertexA == *vertexB) - vertexA++; - vertexB++; - } - return False; /* avoid warnings */ -} /* vertexsubset */ diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-geom.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-geom.htm deleted file mode 100644 index 8aeab33c56..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-geom.htm +++ /dev/null @@ -1,293 +0,0 @@ - - - - -geom.c, geom2.c -- geometric and floating point routines - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    - -
    - - -

    geom.c, geom2.c, random.c -- geometric and floating point routines

    -
    -

    Geometrically, a vertex is a point with d coordinates -and a facet is a halfspace. A halfspace is defined by an -oriented hyperplane through the facet's vertices. A hyperplane -is defined by d normalized coefficients and an offset. A -point is above a facet if its distance to the facet is -positive.

    - -

    Qhull uses floating point coordinates for input points, -vertices, halfspace equations, centrums, and an interior point.

    - -

    Qhull may be configured for single precision or double -precision floating point arithmetic (see realT -).

    - -

    Each floating point operation may incur round-off error (see -Merge). The maximum error for distance -computations is determined at initialization. The roundoff error -in halfspace computation is accounted for by computing the -distance from vertices to the halfspace.

    -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global • -IoMem • -MergePoly • -QhullSet • -StatUser

    - -

    Index to geom.c, -geom2.c, geom.h, -random.c, random.h -

    - - - -

    »geometric data types -and constants

    - -
      -
    • coordT coordinates and -coefficients are stored as realT
    • -
    • pointT a point is an array -of DIM3 coordinates
    • -
    - -

    »mathematical macros

    - -
      -
    • fabs_ returns the absolute -value of a
    • -
    • fmax_ returns the maximum -value of a and b
    • -
    • fmin_ returns the minimum -value of a and b
    • -
    • maximize_ maximize a value -
    • -
    • minimize_ minimize a value -
    • -
    • det2_ compute a 2-d -determinate
    • -
    • det3_ compute a 3-d -determinate
    • -
    • dX, dY, dZ compute the difference -between two coordinates
    • -
    - -

    »mathematical functions

    - - - -

    »computational geometry functions

    - - - -

    »point array functions

    - - -

    »geometric facet functions

    - - -

    »geometric roundoff functions

    -
      -
    • qh_detjoggle determine -default joggle for points and distance roundoff error
    • -
    • qh_detroundoff -determine maximum roundoff error and other precision constants
    • -
    • qh_distround compute -maximum roundoff error due to a distance computation to a -normalized hyperplane
    • -
    • qh_divzero divide by a -number that is nearly zero
    • -
    • qh_maxouter return maximum outer -plane
    • -
    • qh_outerinner return actual -outer and inner planes -
    - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    - - -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-globa.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-globa.htm deleted file mode 100644 index d89f59c68c..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-globa.htm +++ /dev/null @@ -1,161 +0,0 @@ - - - - -global.c -- global variables and their functions - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    - -
    - - -

    global.c -- global variables and their functions

    -
    -

    Qhull uses a global data structure, qh, to store -globally defined constants, lists, sets, and variables. This -allows multiple instances of Qhull to execute at the same time. -The structure may be statically allocated or -dynamically allocated with malloc(). See -QHpointer. -

    -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global • -IoMem • -MergePoly • -QhullSet • -StatUser

    - -

    Index to global.c and -libqhull.h

    - - - -

    »Qhull's global -variables

    - - - -

    »Global variable and -initialization routines

    - - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-io.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-io.htm deleted file mode 100644 index 0ea8f4856d..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-io.htm +++ /dev/null @@ -1,303 +0,0 @@ - - - - -io.c -- input and output operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    io.c -- input and output operations

    -
    - -

    Qhull provides a wide range of input -and output options. To organize the code, most output formats use -the same driver:

    - -
    -    qh_printbegin( fp, format, facetlist, facets, printall );
    -
    -    FORALLfacet_( facetlist )
    -      qh_printafacet( fp, format, facet, printall );
    -
    -    FOREACHfacet_( facets )
    -      qh_printafacet( fp, format, facet, printall );
    -
    -    qh_printend( fp, format );
    -
    - -

    Note the 'printall' flag. It selects whether or not -qh_skipfacet() is tested.

    - -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom -GlobalIo • -MemMerge • -PolyQhull • -SetStat • -User

    - -

    Index to io.c and io.h

    - - - -

    »io.h constants and types

    - -
      -
    • qh_MAXfirst maximum length -of first two lines of stdin
    • -
    • qh_WHITESPACE possible -values of white space
    • -
    • printvridgeT function to -print results of qh_printvdiagram or qh_eachvoronoi
    • -
    - -

    »User level functions

    - - - -

    »Print functions for all -output formats

    - - - -

    »Text output functions

    - - -

    »Text utility functions

    - - -

    »Geomview output functions

    - -

    »Geomview utility functions

    - -

    -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-mem.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-mem.htm deleted file mode 100644 index 4bba0af9ca..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-mem.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - - -mem.c -- memory operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    mem.c -- memory operations

    -
    -

    Qhull uses quick-fit memory allocation. It maintains a -set of free lists for a variety of small allocations. A -small request returns a block from the best fitting free -list. If the free list is empty, Qhull allocates a block -from a reserved buffer.

    -

    Use 'T5' to trace memory allocations.

    - -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global • -IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to mem.c and -mem.h

    - -

    »mem.h data types and constants

    -
      -
    • ptr_intT for casting -a void* to an integer-type
    • -
    • qhmemT global memory -structure for mem.c
    • -
    • qh_NOmem disable memory allocation
    • -
    -

    »mem.h macros

    - -

    »User level -functions

    - - -

    »Initialization and -termination functions

    - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-merge.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-merge.htm deleted file mode 100644 index 2bc92b43bb..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-merge.htm +++ /dev/null @@ -1,364 +0,0 @@ - - - - -merge.c -- facet merge operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    merge.c -- facet merge operations

    -
    -

    Qhull handles precision problems by merged facets or joggled input. -Except for redundant vertices, it corrects a problem by -merging two facets. When done, all facets are clearly -convex. See Imprecision in Qhull -for further information.

    -

    Users may joggle the input ('QJn') -instead of merging facets.

    -

    Qhull detects and corrects the following problems:

    -
      -
    • More than two facets meeting at a ridge. When -Qhull creates facets, it creates an even number -of facets for each ridge. A convex hull always -has two facets for each ridge. More than two -facets may be created if non-adjacent facets -share a vertex. This is called a duplicate -ridge. In 2-d, a duplicate ridge would -create a loop of facets.
    • -
    -
      -
    • A facet contained in another facet. Facet -merging may leave all vertices of one facet as a -subset of the vertices of another facet. This is -called a redundant facet.
    • -
    -
      -
    • A facet with fewer than three neighbors. Facet -merging may leave a facet with one or two -neighbors. This is called a degenerate facet. -
    • -
    -
      -
    • A facet with flipped orientation. A -facet's hyperplane may define a halfspace that -does not include the interior point.This is -called a flipped facet.
    • -
    -
      -
    • A coplanar horizon facet. A -newly processed point may be coplanar with an -horizon facet. Qhull creates a new facet without -a hyperplane. It links new facets for the same -horizon facet together. This is called a samecycle. -The new facet or samecycle is merged into the -horizon facet.
    • -
    -
      -
    • Concave facets. A facet's centrum may be -above a neighboring facet. If so, the facets meet -at a concave angle.
    • -
    -
      -
    • Coplanar facets. A facet's centrum may be -coplanar with a neighboring facet (i.e., it is -neither clearly below nor clearly above the -facet's hyperplane). Qhull removes coplanar -facets in independent sets sorted by angle.
    • -
    -
      -
    • Redundant vertex. A vertex may have fewer -than three neighboring facets. If so, it is -redundant and may be renamed to an adjacent -vertex without changing the topological -structure.This is called a redundant vertex. -
    • -
    -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to merge.c and -merge.h

    - - -

    »merge.h data -types, macros, and global sets

    -
      -
    • mergeT structure to -identify a merge of two facets
    • -
    • FOREACHmerge_ -assign 'merge' to each merge in merges
    • -
    • qh global sets -qh.facet_mergeset contains non-convex merges -while qh.degen_mergeset contains degenerate and -redundant facets
    • -
    -

    »merge.h -constants

    - -

    »top-level merge -functions

    - - -

    »functions for -identifying merges

    - - -

    »functions for -determining the best merge

    - - -

    »functions for -merging facets

    - - -

    »functions for -merging a cycle of facets

    -

    If a point is coplanar with an horizon facet, the -corresponding new facets are linked together (a samecycle) -for merging.

    - -

    »functions -for renaming a vertex

    - - -

    »functions -for identifying vertices for renaming

    - - -

    »functions for check and -trace

    - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-poly.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-poly.htm deleted file mode 100644 index 1bb5937278..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-poly.htm +++ /dev/null @@ -1,481 +0,0 @@ - - - - -poly.c, poly2.c -- polyhedron operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    poly.c, poly2.c -- polyhedron operations

    -
    - -

    Qhull uses dimension-free terminology. Qhull builds a -polyhedron in dimension d. A polyhedron is a -simplicial complex of faces with geometric information for the -top and bottom-level faces. A (d-1)-face is a facet, -a (d-2)-face is a ridge, and a 0-face -is a vertex. For example in 3-d, a facet is a polygon -and a ridge is an edge. A facet is built from a ridge (the base) -and a vertex (the apex). See -Qhull's data structures.

    - -

    Qhull's primary data structure is a polyhedron. A -polyhedron is a list of facets. Each facet has a set of -neighboring facets and a set of vertices. Each facet has a -hyperplane. For example, a tetrahedron has four facets. -If its vertices are a, b, c, d, and its facets -are 1, 2, 3, 4, the tetrahedron is

    -
    -
      -
    • facet 1
        -
      • vertices: b c d
      • -
      • neighbors: 2 3 4
      • -
      -
    • -
    • facet 2
        -
      • vertices: a c d
      • -
      • neighbors: 1 3 4
      • -
      -
    • -
    • facet 3
        -
      • vertices: a b d
      • -
      • neighbors: 1 2 4
      • -
      -
    • -
    • facet 4
        -
      • vertices: a b c
      • -
      • neighbors: 1 2 3
      • -
      -
    • -
    -
    -

    A facet may be simplicial or non-simplicial. In 3-d, a -simplicial facet has three vertices and three -neighbors. A nonsimplicial facet has more than -three vertices and more than three neighbors. A -nonsimplicial facet has a set of ridges and a centrum.

    -

    -A simplicial facet has an orientation. An orientation -is either top or bottom. -The flag, facet->toporient, -defines the orientation of the facet's vertices. For example in 3-d, -'top' is left-handed orientation (i.e., the vertex order follows the direction -of the left-hand fingers when the thumb is pointing away from the center). -Except for axis-parallel facets in 5-d and higher, topological orientation -determines the geometric orientation of the facet's hyperplane. - -

    A nonsimplicial facet is due to merging two or more -facets. The facet's ridge set determine a simplicial -decomposition of the facet. Each ridge is a 1-face (i.e., -it has two vertices and two neighboring facets). The -orientation of a ridge is determined by the order of the -neighboring facets. The flag, facet->toporient,is -ignored.

    -

    A nonsimplicial facet has a centrum for testing -convexity. A centrum is a point on the facet's -hyperplane that is near the center of the facet. Except -for large facets, it is the arithmetic average of the -facet's vertices.

    -

    A nonsimplicial facet is an approximation that is -defined by offsets from the facet's hyperplane. When -Qhull finishes, the outer plane is above all -points while the inner plane is below the facet's -vertices. This guarantees that any exact convex hull -passes between the inner and outer planes. The outer -plane is defined by facet->maxoutside while -the inner plane is computed from the facet's vertices.

    - -

    Qhull 3.1 includes triangulation of non-simplicial facets -('Qt'). -These facets, -called tricoplanar, share the same normal. centrum, and Voronoi center. -One facet (keepcentrum) owns these data structures. -While tricoplanar facets are more accurate than the simplicial facets from -joggled input, they -may have zero area or flipped orientation. - -

    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to poly.c, -poly2.c, poly.h, -and libqhull.h

    - -

    »Data -types and global lists for polyhedrons

    - -

    »poly.h constants

    -
      -
    • ALGORITHMfault -flag to not report errors in qh_checkconvex()
    • -
    • DATAfault flag to -report errors in qh_checkconvex()
    • -
    • DUPLICATEridge -special value for facet->neighbor to indicate -a duplicate ridge
    • -
    • MERGEridge -special value for facet->neighbor to indicate -a merged ridge
    • -
    -

    »Global FORALL -macros

    - -

    »FORALL macros

    - -

    »FOREACH macros

    - -

    »Indexed -FOREACH macros

    -
      -
    • FOREACHfacet_i_ -assign 'facet' and 'facet_i' to each facet in -facet set
    • -
    • FOREACHneighbor_i_ -assign 'neighbor' and 'neighbor_i' to each facet -in facet->neighbors or vertex->neighbors
    • -
    • FOREACHpoint_i_ -assign 'point' and 'point_i' to each point in -points set
    • -
    • FOREACHridge_i_ -assign 'ridge' and 'ridge_i' to each ridge in -ridges set
    • -
    • FOREACHvertex_i_ -assign 'vertex' and 'vertex_i' to each vertex in -vertices set
    • -
    • FOREACHvertexreverse12_ -assign 'vertex' to each vertex in vertex set; -reverse the order of first two vertices
    • -
    -

    »Other macros for polyhedrons

    -
      -
    • getid_ return ID for -a facet, ridge, or vertex
    • -
    • otherfacet_ -return neighboring facet for a ridge in a facet
    • -
    -

    »Facetlist -functions

    - -

    »Facet -functions

    - -

    »Vertex, -ridge, and point functions

    - -

    »Hashtable functions

    - -

    »Allocation and -deallocation functions

    - -

    »Check -functions

    - - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-qhull.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-qhull.htm deleted file mode 100644 index df877f37ea..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-qhull.htm +++ /dev/null @@ -1,277 +0,0 @@ - - - - -libqhull.c -- top-level functions and basic data types - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    libqhull.c -- top-level functions and basic data types

    -
    -

    Qhull implements the Quickhull algorithm for computing -the convex hull. The Quickhull algorithm combines two -well-known algorithms: the 2-d quickhull algorithm and -the n-d beneath-beyond algorithm. See -Description of Qhull.

    -

    This section provides an index to the top-level -functions and base data types. The top-level header file, libqhull.h, -contains prototypes for these functions.

    -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to libqhull.c, -libqhull.h, and -unix.c

    - - -

    »libqhull.h and unix.c -data types and constants

    -
      -
    • flagT Boolean flag as -a bit
    • -
    • boolT boolean value, -either True or False
    • -
    • CENTERtype to -distinguish facet->center
    • -
    • qh_PRINT output -formats for printing (qh.PRINTout)
    • -
    • qh_ALL argument flag -for selecting everything
    • -
    • qh_ERR Qhull exit -codes for indicating errors
    • -
    • qh_FILEstderr Fake stderr -to distinguish error output from normal output [C++ only]
    • -
    • qh_prompt version and long prompt for Qhull
    • -
    • qh_prompt2 synopsis for Qhull
    • -
    • qh_prompt3 concise prompt for Qhull
    • -
    • qh_version version stamp
    • -
    - -

    »libqhull.h other -macros

    -
      -
    • traceN print trace -message if qh.IStracing >= N.
    • -
    • QHULL_UNUSED declare an - unused variable to avoid warnings.
    • -
    - -

    »Quickhull -routines in call order

    - - -

    »Top-level routines for initializing and terminating Qhull (in other modules)

    - - -

    »Top-level routines for reading and modifying the input (in other modules)

    - - -

    »Top-level routines for calling Qhull (in other modules)

    - - -

    »Top-level routines for returning results (in other modules)

    - - -

    »Top-level routines for testing and debugging (in other modules)

    - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-set.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-set.htm deleted file mode 100644 index 1fbd3661c4..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-set.htm +++ /dev/null @@ -1,306 +0,0 @@ - - - - -qset.c -- set data type and operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    qset.c -- set data type and operations

    -
    -

    Qhull's data structures are constructed from sets. The -functions and macros in qset.c construct, iterate, and -modify these sets. They are the most frequently called -functions in Qhull. For this reason, efficiency is the -primary concern.

    -

    In Qhull, a set is represented by an unordered -array of pointers with a maximum size and a NULL -terminator (setT). -Most sets correspond to mathematical sets -(i.e., the pointers are unique). Some sets are sorted to -enforce uniqueness. Some sets are ordered. For example, -the order of vertices in a ridge determine the ridge's -orientation. If you reverse the order of adjacent -vertices, the orientation reverses. Some sets are not -mathematical sets. They may be indexed as an array and -they may include NULL pointers.

    -

    The most common operation on a set is to iterate its -members. This is done with a 'FOREACH...' macro. Each set -has a custom macro. For example, 'FOREACHvertex_' -iterates over a set of vertices. Each vertex is assigned -to the variable 'vertex' from the pointer 'vertexp'.

    -

    Most sets are constructed by appending elements to the -set. The last element of a set is either NULL or the -index of the terminating NULL for a partially full set. -If a set is full, appending an element copies the set to -a larger array.

    - -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global • -IoMem • -MergePoly -• QhullSet -• StatUser -

    -

    Index to qset.c and -qset.h

    - -

    »Data types and -constants

    -
      -
    • SETelemsize size -of a set element in bytes
    • -
    • setT a set with a -maximum size and a current size
    • -
    • qh global sets -global sets for temporary sets, etc.
    • -
    -

    »FOREACH macros

    - -

    »Access and -size macros

    - -

    »Internal macros

    -
      -
    • SETsizeaddr_ -return pointer to end element of a set (indicates -current size)
    • -
    - -

    »address macros

    -
      -
    • SETaddr_ return -address of a set's elements
    • -
    • SETelemaddr_ -return address of the n'th element of a set
    • -
    • SETref_ l.h.s. for -modifying the current element in a FOREACH -iteration
    • -
    - -

    »Allocation and -deallocation functions

    - - -

    »Access and -predicate functions

    - - -

    »Add functions

    - - -

    »Check and print functions

    - - -

    »Copy, compact, and zero functions

    - - -

    »Delete functions

    - - -

    »Temporary set functions

    - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-stat.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-stat.htm deleted file mode 100644 index 53c61583ae..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-stat.htm +++ /dev/null @@ -1,161 +0,0 @@ - - - - -stat.c -- statistical operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    - -

    stat.c -- statistical operations

    -
    -

    Qhull records many statistics. These functions and -macros make it inexpensive to add a statistic. -

    As with Qhull's global variables, the statistics data structure is -accessed by a macro, 'qhstat'. If qh_QHpointer is defined, the macro -is 'qh_qhstat->', otherwise the macro is 'qh_qhstat.'. -Statistics -may be turned off in user.h. If so, all but the 'zz' -statistics are ignored.

    -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to stat.c and -stat.h

    - - -

    »stat.h types

    -
      -
    • intrealT union of -integer and real
    • -
    • qhstat global data -structure for statistics
    • -
    -

    »stat.h -constants

    -
      -
    • qh_KEEPstatistics 0 turns off most statistics
    • -
    • Z..., W... integer (Z) and real (W) statistics -
    • -
    • ZZstat Z.../W... statistics that -remain defined if qh_KEEPstatistics=0 -
    • -
    • ztype zdoc, zinc, etc. -for definining statistics
    • -
    -

    »stat.h macros

    -
      -
    • MAYdebugx called -frequently for error trapping
    • -
    • zadd_/wadd_ add value -to an integer or real statistic
    • -
    • zdef_ define a -statistic
    • -
    • zinc_ increment an -integer statistic
    • -
    • zmax_/wmax_ update -integer or real maximum statistic
    • -
    • zmin_/wmin_ update -integer or real minimum statistic
    • -
    • zval_/wval_ set or -return value of a statistic
    • -
    - -

    »stat.c -functions

    - - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-user.htm b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-user.htm deleted file mode 100644 index a8afed491e..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qh-user.htm +++ /dev/null @@ -1,263 +0,0 @@ - - - - -user.c -- user-definable operations - - - - -

    Up: Home page for Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: GeomGlobal -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -
    -

    user.c -- user-definable operations

    -
    -

    This section contains functions and constants that the -user may want to change.

    - -
    -

    Copyright © 1995-2012 C.B. Barber

    -
    -

    » Geom - Global -• IoMem -• MergePoly -• QhullSet -• StatUser -

    -

    Index to user.c, usermem.c, userprintf.c, userprintf_rbox.c and -user.h

    - - -

    »Qhull library constants

    - - - -

    »user.h data -types and configuration macros

    - - -

    »definition constants

    -
      -
    • qh_DEFAULTbox -define default box size for rbox, 'Qbb', and 'QbB' (Geomview expects 0.5)
    • -
    • qh_INFINITE on -output, indicates Voronoi center at infinity
    • -
    • qh_ORIENTclock -define convention for orienting facets
    • -
    • qh_ZEROdelaunay -define facets that are ignored in Delaunay triangulations
    • -
    - -

    »joggle constants

    - - -

    »performance -related constants

    - - -

    »memory constants

    - - -

    »conditional compilation

    -
      -
    • compiler defined symbols, -e.g., _STDC_ and _cplusplus - -
    • qh_COMPUTEfurthest - compute furthest distance to an outside point instead of storing it with the facet -
    • qh_KEEPstatistics - enable statistic gathering and reporting with option 'Ts' -
    • qh_MAXoutside -record outer plane for each facet -
    • qh_NOmerge -disable facet merging -
    • qh_NOtrace -disable tracing with option 'T4' -
    • qh_QHpointer -access global data with pointer or static structure -
    • qh_QUICKhelp -use abbreviated help messages, e.g., for degenerate inputs -
    - -

    »merge -constants

    - - -

    »user.c -functions

    - - -

    »usermem.c -functions

    -
      -
    • qh_exit exit program, same as exit().
    • -
    • qh_free free memory, same as free().
    • -
    • qh_malloc allocate memory, same as malloc()
    • -
    - -

    »userprintf.c - and userprintf_rbox,c functions

    -
      -
    • qh_fprintf print -information from Qhull, sames as fprintf().
    • -
    • qh_fprintf_rbox print -information from Rbox, sames as fprintf().
    • -
    - -

    -
    -

    Up: -Home page for -Qhull
    -Up: Qhull manual: Table of Contents
    -Up: Programs -• Options -• Output -• Formats -• Geomview -• Print -• Qhull -• Precision -• Trace
    -Up: Qhull code: Table of Contents
    -To: Qhull functions, macros, and data structures
    -To: Geom • -GlobalIo -• MemMerge -• PolyQhull -• SetStat -• User
    -

    -

    -
    -

    The -Geometry Center Home Page

    -

    Comments to: qhull@qhull.org -
    -Created: May 2, 1997 --- Last modified: see top

    - - diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull-exports.def b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull-exports.def deleted file mode 100644 index 002acb83ff..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull-exports.def +++ /dev/null @@ -1,412 +0,0 @@ -; qhull-exports.def -- msvc module-definition file -; -; Generated from depends.exe by cut-and-paste of exported symbols by mingw gcc -; [mar'11] 399 symbols -; Annotate as DATA qh_qh qh_qhstat qhmem qhull_inuse rbox_inuse -; Same as ../libqhullp/qhull_p-exports.def without qh_save_qhull and qh_restore_qhull -; -; $Id: //main/2011/qhull/src/libqhull/qhull-exports.def#4 $$Change: 1468 $ -; $DateTime: 2012/01/26 23:42:31 $$Author: bbarber $ -; -; Define qhull_VERSION in CMakeLists.txt, Makefile, qhull-exports.def, qhull_p-exports.def, and qhull-warn.pri -VERSION 6.3 -EXPORTS -dfacet -dvertex -out1 -out2n -out3n -qh_addhash -qh_addpoint -qh_all_merges -qh_allstatA -qh_allstatB -qh_allstatC -qh_allstatD -qh_allstatE -qh_allstatE2 -qh_allstatF -qh_allstatG -qh_allstatH -qh_allstatI -qh_allstatistics -qh_appendfacet -qh_appendmergeset -qh_appendprint -qh_appendvertex -qh_argv_to_command -qh_argv_to_command_size -qh_attachnewfacets -qh_backnormal -qh_basevertices -qh_build_withrestart -qh_buildhull -qh_buildtracing -qh_check_bestdist -qh_check_maxout -qh_check_output -qh_check_point -qh_check_points -qh_checkconnect -qh_checkconvex -qh_checkfacet -qh_checkflags -qh_checkflipped -qh_checkflipped_all -qh_checkpolygon -qh_checkvertex -qh_checkzero -qh_clear_outputflags -qh_clearcenters -qh_clock -qh_collectstatistics -qh_compare_facetarea -qh_compare_facetmerge -qh_compare_facetvisit -qh_compare_vertexpoint -qh_compareangle -qh_comparemerge -qh_comparevisit -qh_copyfilename -qh_copynonconvex -qh_copypoints -qh_countfacets -qh_createsimplex -qh_crossproduct -qh_degen_redundant_facet -qh_degen_redundant_neighbors -qh_deletevisible -qh_delfacet -qh_delridge -qh_delvertex -qh_determinant -qh_detjoggle -qh_detroundoff -qh_detsimplex -qh_detvnorm -qh_detvridge -qh_detvridge3 -qh_distnorm -qh_distplane -qh_distround -qh_divzero -qh_eachvoronoi -qh_eachvoronoi_all -qh_errexit -qh_errexit2 -qh_errexit_rbox -qh_errprint -qh_exit -qh_facet2point -qh_facet3vertex -qh_facetarea -qh_facetarea_simplex -qh_facetcenter -qh_facetintersect -qh_facetvertices -qh_find_newvertex -qh_findbest -qh_findbest_test -qh_findbestfacet -qh_findbesthorizon -qh_findbestlower -qh_findbestneighbor -qh_findbestnew -qh_findfacet_all -qh_findgood -qh_findgood_all -qh_findgooddist -qh_findhorizon -qh_flippedmerges -qh_forcedmerges -qh_fprintf -qh_fprintf_rbox -qh_free -qh_freebuffers -qh_freebuild -qh_freeqhull -qh_freeqhull2 -qh_freestatistics -qh_furthestnext -qh_furthestout -qh_gausselim -qh_geomplanes -qh_getangle -qh_getarea -qh_getcenter -qh_getcentrum -qh_getdistance -qh_gethash -qh_getmergeset -qh_getmergeset_initial -qh_gram_schmidt -qh_hashridge -qh_hashridge_find -qh_infiniteloop -qh_init_A -qh_init_B -qh_init_qhull_command -qh_initbuild -qh_initflags -qh_initialhull -qh_initialvertices -qh_initqhull_buffers -qh_initqhull_globals -qh_initqhull_mem -qh_initqhull_outputflags -qh_initqhull_start -qh_initqhull_start2 -qh_initstatistics -qh_initthresholds -qh_inthresholds -qh_isvertex -qh_joggleinput -qh_makenew_nonsimplicial -qh_makenew_simplicial -qh_makenewfacet -qh_makenewfacets -qh_makenewplanes -qh_makeridges -qh_malloc -qh_mark_dupridges -qh_markkeep -qh_markvoronoi -qh_matchduplicates -qh_matchneighbor -qh_matchnewfacets -qh_matchvertices -qh_maxabsval -qh_maxmin -qh_maxouter -qh_maxsimplex -qh_maydropneighbor -qh_memalloc -qh_memfree -qh_memfreeshort -qh_meminit -qh_meminitbuffers -qh_memsetup -qh_memsize -qh_memstatistics -qh_memtotal -qh_merge_degenredundant -qh_merge_nonconvex -qh_mergecycle -qh_mergecycle_all -qh_mergecycle_facets -qh_mergecycle_neighbors -qh_mergecycle_ridges -qh_mergecycle_vneighbors -qh_mergefacet -qh_mergefacet2d -qh_mergeneighbors -qh_mergeridges -qh_mergesimplex -qh_mergevertex_del -qh_mergevertex_neighbors -qh_mergevertices -qh_minabsval -qh_mindiff -qh_nearcoplanar -qh_nearvertex -qh_neighbor_intersections -qh_new_qhull -qh_newfacet -qh_newhashtable -qh_newridge -qh_newstats -qh_newvertex -qh_newvertices -qh_nextfurthest -qh_nextridge3d -qh_normalize -qh_normalize2 -qh_nostatistic -qh_option -qh_order_vertexneighbors -qh_orientoutside -qh_outcoplanar -qh_outerinner -qh_partitionall -qh_partitioncoplanar -qh_partitionpoint -qh_partitionvisible -qh_point -qh_point_add -qh_pointdist -qh_pointfacet -qh_pointid -qh_pointvertex -qh_postmerge -qh_precision -qh_premerge -qh_prepare_output -qh_prependfacet -qh_printafacet -qh_printallstatistics -qh_printbegin -qh_printcenter -qh_printcentrum -qh_printend -qh_printend4geom -qh_printextremes -qh_printextremes_2d -qh_printextremes_d -qh_printfacet -qh_printfacet2geom -qh_printfacet2geom_points -qh_printfacet2math -qh_printfacet3geom_nonsimplicial -qh_printfacet3geom_points -qh_printfacet3geom_simplicial -qh_printfacet3math -qh_printfacet3vertex -qh_printfacet4geom_nonsimplicial -qh_printfacet4geom_simplicial -qh_printfacetNvertex_nonsimplicial -qh_printfacetNvertex_simplicial -qh_printfacetheader -qh_printfacetlist -qh_printfacetridges -qh_printfacets -qh_printhashtable -qh_printhelp_degenerate -qh_printhelp_narrowhull -qh_printhelp_singular -qh_printhyperplaneintersection -qh_printline3geom -qh_printlists -qh_printmatrix -qh_printneighborhood -qh_printpoint -qh_printpoint3 -qh_printpointid -qh_printpoints -qh_printpoints_out -qh_printpointvect -qh_printpointvect2 -qh_printridge -qh_printspheres -qh_printstatistics -qh_printstatlevel -qh_printstats -qh_printsummary -qh_printvdiagram -qh_printvdiagram2 -qh_printvertex -qh_printvertexlist -qh_printvertices -qh_printvneighbors -qh_printvnorm -qh_printvoronoi -qh_printvridge -qh_produce_output -qh_produce_output2 -qh_projectdim3 -qh_projectinput -qh_projectpoint -qh_projectpoints -; Mark as DATA, otherwise links a separate qh_qh. Requires __dcelspec -qh_qh DATA -qh_qhstat DATA -qh_qhull -qh_rand -qh_rand_seed -qh_randomfactor -qh_randommatrix -qh_rboxpoints -qh_readfeasible -qh_readpoints -qh_reducevertices -qh_redundant_vertex -qh_remove_extravertices -qh_removefacet -qh_removevertex -qh_rename_sharedvertex -qh_renameridgevertex -qh_renamevertex -qh_resetlists -qh_rotateinput -qh_rotatepoints -qh_scaleinput -qh_scalelast -qh_scalepoints -qh_setaddnth -qh_setaddsorted -qh_setappend -qh_setappend2ndlast -qh_setappend_set -qh_setcheck -qh_setcompact -qh_setcopy -qh_setdel -qh_setdelaunay -qh_setdellast -qh_setdelnth -qh_setdelnthsorted -qh_setdelsorted -qh_setduplicate -qh_setequal -qh_setequal_except -qh_setequal_skip -qh_setfacetplane -qh_setfeasible -qh_setfree -qh_setfree2 -qh_setfreelong -qh_sethalfspace -qh_sethalfspace_all -qh_sethyperplane_det -qh_sethyperplane_gauss -qh_setin -qh_setindex -qh_setlarger -qh_setlast -qh_setnew -qh_setnew_delnthsorted -qh_setprint -qh_setreplace -qh_setsize -qh_settemp -qh_settempfree -qh_settempfree_all -qh_settemppop -qh_settemppush -qh_settruncate -qh_setunique -qh_setvoronoi_all -qh_setzero -qh_sharpnewfacets -qh_skipfacet -qh_skipfilename -qh_srand -qh_stddev -qh_strtod -qh_strtol -qh_test_appendmerge -qh_test_vneighbors -qh_tracemerge -qh_tracemerging -qh_triangulate -qh_triangulate_facet -qh_triangulate_link -qh_triangulate_mirror -qh_triangulate_null -qh_updatetested -qh_updatevertices -qh_user_memsizes -qh_version -qh_vertexintersect -qh_vertexintersect_new -qh_vertexneighbors -qh_vertexridges -qh_vertexridges_facet -qh_vertexsubset -qh_voronoi_center -qh_willdelete -; Mark as DATA, otherwise links a separate qhmem. Requires __dcelspec -qhmem DATA -qhull_inuse DATA -rbox -rbox_inuse DATA -roundi diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull_a.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull_a.h deleted file mode 100644 index 27021b2524..0000000000 --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qhull_a.h +++ /dev/null @@ -1,151 +0,0 @@ -/*
      ---------------------------------
    -
    -   qhull_a.h
    -   all header files for compiling qhull
    -
    -   see qh-qhull.htm
    -
    -   see libqhull.h for user-level definitions
    -
    -   see user.h for user-defineable constants
    -
    -   defines internal functions for libqhull.c global.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/qhull_a.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -
    -   Notes:  grep for ((" and (" to catch fprintf("lkasdjf");
    -           full parens around (x?y:z)
    -           use '#include qhull/qhull_a.h' to avoid name clashes
    -*/
    -
    -#ifndef qhDEFqhulla
    -#define qhDEFqhulla 1
    -
    -#include "libqhull.h"  /* Defines data types */
    -
    -#include "stat.h"
    -#include "random.h"
    -#include "mem.h"
    -#include "qset.h"
    -#include "geom.h"
    -#include "merge.h"
    -#include "poly.h"
    -#include "io.h"
    -
    -#include 
    -#include 
    -#include 
    -#include     /* some compilers will not need float.h */
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -/*** uncomment here and qset.c
    -     if string.h does not define memcpy()
    -#include 
    -*/
    -
    -#if qh_CLOCKtype == 2  /* defined in user.h from libqhull.h */
    -#include 
    -#include 
    -#include 
    -#endif
    -
    -#ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
    -#pragma warning( disable : 4100)  /* unreferenced formal parameter */
    -#pragma warning( disable : 4127)  /* conditional expression is constant */
    -#pragma warning( disable : 4706)  /* assignment within conditional function */
    -#pragma warning( disable : 4996)  /* function was declared deprecated(strcpy, localtime, etc.) */
    -#endif
    -
    -/* ======= -macros- =========== */
    -
    -/*----------------------------------
    -
    -  traceN((qh ferr, 0Nnnn, "format\n", vars));
    -    calls qh_fprintf if qh.IStracing >= N
    -
    -    Add debugging traps to the end of qh_fprintf
    -
    -  notes:
    -    removing tracing reduces code size but doesn't change execution speed
    -*/
    -#ifndef qh_NOtrace
    -#define trace0(args) {if (qh IStracing) qh_fprintf args;}
    -#define trace1(args) {if (qh IStracing >= 1) qh_fprintf args;}
    -#define trace2(args) {if (qh IStracing >= 2) qh_fprintf args;}
    -#define trace3(args) {if (qh IStracing >= 3) qh_fprintf args;}
    -#define trace4(args) {if (qh IStracing >= 4) qh_fprintf args;}
    -#define trace5(args) {if (qh IStracing >= 5) qh_fprintf args;}
    -#else /* qh_NOtrace */
    -#define trace0(args) {}
    -#define trace1(args) {}
    -#define trace2(args) {}
    -#define trace3(args) {}
    -#define trace4(args) {}
    -#define trace5(args) {}
    -#endif /* qh_NOtrace */
    -
    -/*----------------------------------
    -
    -*/
    -
    -/* See Qt's qglobal.h */
    -#if !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
    -#   define QHULL_OS_WIN
    -#elif defined(__MWERKS__) && defined(__INTEL__)
    -#   define QHULL_OS_WIN
    -#endif
    -#if defined(__INTEL_COMPILER) && !defined(QHULL_OS_WIN)
    -template 
    -inline void qhullUnused(T &x) { (void)x; }
    -#  define QHULL_UNUSED(x) qhullUnused(x);
    -#else
    -#  define QHULL_UNUSED(x) (void)x;
    -#endif
    -
    -/***** -libqhull.c prototypes (alphabetical after qhull) ********************/
    -
    -void    qh_qhull(void);
    -boolT   qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist);
    -void    qh_buildhull(void);
    -void    qh_buildtracing(pointT *furthest, facetT *facet);
    -void    qh_build_withrestart(void);
    -void    qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet);
    -void    qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int *goodhorizon);
    -pointT *qh_nextfurthest(facetT **visible);
    -void    qh_partitionall(setT *vertices, pointT *points,int npoints);
    -void    qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist);
    -void    qh_partitionpoint(pointT *point, facetT *facet);
    -void    qh_partitionvisible(boolT allpoints, int *numpoints);
    -void    qh_precision(const char *reason);
    -void    qh_printsummary(FILE *fp);
    -
    -/***** -global.c internal prototypes (alphabetical) ***********************/
    -
    -void    qh_appendprint(qh_PRINT format);
    -void    qh_freebuild(boolT allmem);
    -void    qh_freebuffers(void);
    -void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
    -
    -/***** -stat.c internal prototypes (alphabetical) ***********************/
    -
    -void    qh_allstatA(void);
    -void    qh_allstatB(void);
    -void    qh_allstatC(void);
    -void    qh_allstatD(void);
    -void    qh_allstatE(void);
    -void    qh_allstatE2 (void);
    -void    qh_allstatF(void);
    -void    qh_allstatG(void);
    -void    qh_allstatH(void);
    -void    qh_freebuffers(void);
    -void    qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc);
    -
    -#endif /* qhDEFqhulla */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.c
    deleted file mode 100644
    index 8da46fb23a..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.c
    +++ /dev/null
    @@ -1,1339 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qset.c
    -   implements set manipulations needed for quickhull
    -
    -   see qh-set.htm and qset.h
    -
    -   Be careful of strict aliasing (two pointers of different types
    -   that reference the same location).  The last slot of a set is
    -   either the actual size of the set plus 1, or the NULL terminator
    -   of the set (i.e., setelemT).
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/qset.c#6 $$Change: 1475 $
    -   $DateTime: 2012/01/27 22:32:16 $$Author: bbarber $
    -*/
    -
    -#include "qset.h"
    -#include "mem.h"
    -#include 
    -#include 
    -/*** uncomment here and qhull_a.h
    -     if string.h does not define memcpy()
    -#include 
    -*/
    -
    -#ifndef qhDEFlibqhull
    -typedef struct ridgeT ridgeT;
    -typedef struct facetT facetT;
    -void    qh_errexit(int exitcode, facetT *, ridgeT *);
    -void    qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... );
    -#  ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
    -#  pragma warning( disable : 4127)  /* conditional expression is constant */
    -#  pragma warning( disable : 4706)  /* assignment within conditional function */
    -#  endif
    -#endif
    -
    -/*=============== internal macros ===========================*/
    -
    -/*============ functions in alphabetical order ===================*/
    -
    -/*----------------------------------
    -
    -  qh_setaddnth( setp, nth, newelem)
    -    adds newelem as n'th element of sorted or unsorted *setp
    -
    -  notes:
    -    *setp and newelem must be defined
    -    *setp may be a temp set
    -    nth=0 is first element
    -    errors if nth is out of bounds
    -
    -  design:
    -    expand *setp if empty or full
    -    move tail of *setp up one
    -    insert newelem
    -*/
    -void qh_setaddnth(setT **setp, int nth, void *newelem) {
    -  int oldsize, i;
    -  setelemT *sizep;          /* avoid strict aliasing */
    -  setelemT *oldp, *newp;
    -
    -  if (!*setp || (sizep= SETsizeaddr_(*setp))->i==0) {
    -    qh_setlarger(setp);
    -    sizep= SETsizeaddr_(*setp);
    -  }
    -  oldsize= sizep->i - 1;
    -  if (nth < 0 || nth > oldsize) {
    -    qh_fprintf(qhmem.ferr, 6171, "qhull internal error (qh_setaddnth): nth %d is out-of-bounds for set:\n", nth);
    -    qh_setprint(qhmem.ferr, "", *setp);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  sizep->i++;
    -  oldp= (setelemT *)SETelemaddr_(*setp, oldsize, void);   /* NULL */
    -  newp= oldp+1;
    -  for (i=oldsize-nth+1; i--; )  /* move at least NULL  */
    -    (newp--)->p= (oldp--)->p;       /* may overwrite *sizep */
    -  newp->p= newelem;
    -} /* setaddnth */
    -
    -
    -/*----------------------------------
    -
    -  setaddsorted( setp, newelem )
    -    adds an newelem into sorted *setp
    -
    -  notes:
    -    *setp and newelem must be defined
    -    *setp may be a temp set
    -    nop if newelem already in set
    -
    -  design:
    -    find newelem's position in *setp
    -    insert newelem
    -*/
    -void qh_setaddsorted(setT **setp, void *newelem) {
    -  int newindex=0;
    -  void *elem, **elemp;
    -
    -  FOREACHelem_(*setp) {          /* could use binary search instead */
    -    if (elem < newelem)
    -      newindex++;
    -    else if (elem == newelem)
    -      return;
    -    else
    -      break;
    -  }
    -  qh_setaddnth(setp, newindex, newelem);
    -} /* setaddsorted */
    -
    -
    -/*---------------------------------
    -
    -  qh_setappend( setp, newelem)
    -    append newelem to *setp
    -
    -  notes:
    -    *setp may be a temp set
    -    *setp and newelem may be NULL
    -
    -  design:
    -    expand *setp if empty or full
    -    append newelem to *setp
    -
    -*/
    -void qh_setappend(setT **setp, void *newelem) {
    -  setelemT *sizep;  /* Avoid strict aliasing.  Writing to *endp may overwrite *sizep */
    -  setelemT *endp;
    -  int count;
    -
    -  if (!newelem)
    -    return;
    -  if (!*setp || (sizep= SETsizeaddr_(*setp))->i==0) {
    -    qh_setlarger(setp);
    -    sizep= SETsizeaddr_(*setp);
    -  }
    -  count= (sizep->i)++ - 1;
    -  endp= (setelemT *)SETelemaddr_(*setp, count, void);
    -  (endp++)->p= newelem;
    -  endp->p= NULL;
    -} /* setappend */
    -
    -/*---------------------------------
    -
    -  qh_setappend_set( setp, setA)
    -    appends setA to *setp
    -
    -  notes:
    -    *setp can not be a temp set
    -    *setp and setA may be NULL
    -
    -  design:
    -    setup for copy
    -    expand *setp if it is too small
    -    append all elements of setA to *setp
    -*/
    -void qh_setappend_set(setT **setp, setT *setA) {
    -  int sizeA, size;
    -  setT *oldset;
    -  setelemT *sizep;
    -
    -  if (!setA)
    -    return;
    -  SETreturnsize_(setA, sizeA);
    -  if (!*setp)
    -    *setp= qh_setnew(sizeA);
    -  sizep= SETsizeaddr_(*setp);
    -  if (!(size= sizep->i))
    -    size= (*setp)->maxsize;
    -  else
    -    size--;
    -  if (size + sizeA > (*setp)->maxsize) {
    -    oldset= *setp;
    -    *setp= qh_setcopy(oldset, sizeA);
    -    qh_setfree(&oldset);
    -    sizep= SETsizeaddr_(*setp);
    -  }
    -  if (sizeA > 0) {
    -    sizep->i= size+sizeA+1;   /* memcpy may overwrite */
    -    memcpy((char *)&((*setp)->e[size].p), (char *)&(setA->e[0].p), (size_t)(sizeA+1) * SETelemsize);
    -  }
    -} /* setappend_set */
    -
    -
    -/*---------------------------------
    -
    -  qh_setappend2ndlast( setp, newelem )
    -    makes newelem the next to the last element in *setp
    -
    -  notes:
    -    *setp must have at least one element
    -    newelem must be defined
    -    *setp may be a temp set
    -
    -  design:
    -    expand *setp if empty or full
    -    move last element of *setp up one
    -    insert newelem
    -*/
    -void qh_setappend2ndlast(setT **setp, void *newelem) {
    -    setelemT *sizep;  /* Avoid strict aliasing.  Writing to *endp may overwrite *sizep */
    -    setelemT *endp, *lastp;
    -    int count;
    -
    -    if (!*setp || (sizep= SETsizeaddr_(*setp))->i==0) {
    -        qh_setlarger(setp);
    -        sizep= SETsizeaddr_(*setp);
    -    }
    -    count= (sizep->i)++ - 1;
    -    endp= (setelemT *)SETelemaddr_(*setp, count, void); /* NULL */
    -    lastp= endp-1;
    -    *(endp++)= *lastp;
    -    endp->p= NULL;    /* may overwrite *sizep */
    -    lastp->p= newelem;
    -} /* setappend2ndlast */
    -
    -/*---------------------------------
    -
    -  qh_setcheck( set, typename, id )
    -    check set for validity
    -    report errors with typename and id
    -
    -  design:
    -    checks that maxsize, actual size, and NULL terminator agree
    -*/
    -void qh_setcheck(setT *set, const char *tname, unsigned id) {
    -  int maxsize, size;
    -  int waserr= 0;
    -
    -  if (!set)
    -    return;
    -  SETreturnsize_(set, size);
    -  maxsize= set->maxsize;
    -  if (size > maxsize || !maxsize) {
    -    qh_fprintf(qhmem.ferr, 6172, "qhull internal error (qh_setcheck): actual size %d of %s%d is greater than max size %d\n",
    -             size, tname, id, maxsize);
    -    waserr= 1;
    -  }else if (set->e[size].p) {
    -    qh_fprintf(qhmem.ferr, 6173, "qhull internal error (qh_setcheck): %s%d(size %d max %d) is not null terminated.\n",
    -             tname, id, size-1, maxsize);
    -    waserr= 1;
    -  }
    -  if (waserr) {
    -    qh_setprint(qhmem.ferr, "ERRONEOUS", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -} /* setcheck */
    -
    -
    -/*---------------------------------
    -
    -  qh_setcompact( set )
    -    remove internal NULLs from an unsorted set
    -
    -  returns:
    -    updated set
    -
    -  notes:
    -    set may be NULL
    -    it would be faster to swap tail of set into holes, like qh_setdel
    -
    -  design:
    -    setup pointers into set
    -    skip NULLs while copying elements to start of set
    -    update the actual size
    -*/
    -void qh_setcompact(setT *set) {
    -  int size;
    -  void **destp, **elemp, **endp, **firstp;
    -
    -  if (!set)
    -    return;
    -  SETreturnsize_(set, size);
    -  destp= elemp= firstp= SETaddr_(set, void);
    -  endp= destp + size;
    -  while (1) {
    -    if (!(*destp++ = *elemp++)) {
    -      destp--;
    -      if (elemp > endp)
    -        break;
    -    }
    -  }
    -  qh_settruncate(set, (int)(destp-firstp));   /* WARN64 */
    -} /* setcompact */
    -
    -
    -/*---------------------------------
    -
    -  qh_setcopy( set, extra )
    -    make a copy of a sorted or unsorted set with extra slots
    -
    -  returns:
    -    new set
    -
    -  design:
    -    create a newset with extra slots
    -    copy the elements to the newset
    -
    -*/
    -setT *qh_setcopy(setT *set, int extra) {
    -  setT *newset;
    -  int size;
    -
    -  if (extra < 0)
    -    extra= 0;
    -  SETreturnsize_(set, size);
    -  newset= qh_setnew(size+extra);
    -  SETsizeaddr_(newset)->i= size+1;    /* memcpy may overwrite */
    -  memcpy((char *)&(newset->e[0].p), (char *)&(set->e[0].p), (size_t)(size+1) * SETelemsize);
    -  return(newset);
    -} /* setcopy */
    -
    -
    -/*---------------------------------
    -
    -  qh_setdel( set, oldelem )
    -    delete oldelem from an unsorted set
    -
    -  returns:
    -    returns oldelem if found
    -    returns NULL otherwise
    -
    -  notes:
    -    set may be NULL
    -    oldelem must not be NULL;
    -    only deletes one copy of oldelem in set
    -
    -  design:
    -    locate oldelem
    -    update actual size if it was full
    -    move the last element to the oldelem's location
    -*/
    -void *qh_setdel(setT *set, void *oldelem) {
    -  setelemT *sizep;
    -  setelemT *elemp;
    -  setelemT *lastp;
    -
    -  if (!set)
    -    return NULL;
    -  elemp= (setelemT *)SETaddr_(set, void);
    -  while (elemp->p != oldelem && elemp->p)
    -    elemp++;
    -  if (elemp->p) {
    -    sizep= SETsizeaddr_(set);
    -    if (!(sizep->i)--)         /*  if was a full set */
    -      sizep->i= set->maxsize;  /*     *sizep= (maxsize-1)+ 1 */
    -    lastp= (setelemT *)SETelemaddr_(set, sizep->i-1, void);
    -    elemp->p= lastp->p;      /* may overwrite itself */
    -    lastp->p= NULL;
    -    return oldelem;
    -  }
    -  return NULL;
    -} /* setdel */
    -
    -
    -/*---------------------------------
    -
    -  qh_setdellast( set)
    -    return last element of set or NULL
    -
    -  notes:
    -    deletes element from set
    -    set may be NULL
    -
    -  design:
    -    return NULL if empty
    -    if full set
    -      delete last element and set actual size
    -    else
    -      delete last element and update actual size
    -*/
    -void *qh_setdellast(setT *set) {
    -  int setsize;  /* actually, actual_size + 1 */
    -  int maxsize;
    -  setelemT *sizep;
    -  void *returnvalue;
    -
    -  if (!set || !(set->e[0].p))
    -    return NULL;
    -  sizep= SETsizeaddr_(set);
    -  if ((setsize= sizep->i)) {
    -    returnvalue= set->e[setsize - 2].p;
    -    set->e[setsize - 2].p= NULL;
    -    sizep->i--;
    -  }else {
    -    maxsize= set->maxsize;
    -    returnvalue= set->e[maxsize - 1].p;
    -    set->e[maxsize - 1].p= NULL;
    -    sizep->i= maxsize;
    -  }
    -  return returnvalue;
    -} /* setdellast */
    -
    -
    -/*---------------------------------
    -
    -  qh_setdelnth( set, nth )
    -    deletes nth element from unsorted set
    -    0 is first element
    -
    -  returns:
    -    returns the element (needs type conversion)
    -
    -  notes:
    -    errors if nth invalid
    -
    -  design:
    -    setup points and check nth
    -    delete nth element and overwrite with last element
    -*/
    -void *qh_setdelnth(setT *set, int nth) {
    -  void *elem;
    -  setelemT *sizep;
    -  setelemT *elemp, *lastp;
    -
    -  elemp= (setelemT *)SETelemaddr_(set, nth, void);
    -  sizep= SETsizeaddr_(set);
    -  if ((sizep->i--)==0)         /*  if was a full set */
    -    sizep->i= set->maxsize;  /*     *sizep= (maxsize-1)+ 1 */
    -  if (nth < 0 || nth >= sizep->i) {
    -    qh_fprintf(qhmem.ferr, 6174, "qhull internal error (qh_setdelnth): nth %d is out-of-bounds for set:\n", nth);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  lastp= (setelemT *)SETelemaddr_(set, sizep->i-1, void);
    -  elem= elemp->p;
    -  elemp->p= lastp->p;      /* may overwrite itself */
    -  lastp->p= NULL;
    -  return elem;
    -} /* setdelnth */
    -
    -/*---------------------------------
    -
    -  qh_setdelnthsorted( set, nth )
    -    deletes nth element from sorted set
    -
    -  returns:
    -    returns the element (use type conversion)
    -
    -  notes:
    -    errors if nth invalid
    -
    -  see also:
    -    setnew_delnthsorted
    -
    -  design:
    -    setup points and check nth
    -    copy remaining elements down one
    -    update actual size
    -*/
    -void *qh_setdelnthsorted(setT *set, int nth) {
    -  void *elem;
    -  setelemT *sizep;
    -  setelemT *newp, *oldp;
    -
    -  sizep= SETsizeaddr_(set);
    -  if (nth < 0 || (sizep->i && nth >= sizep->i-1) || nth >= set->maxsize) {
    -    qh_fprintf(qhmem.ferr, 6175, "qhull internal error (qh_setdelnthsorted): nth %d is out-of-bounds for set:\n", nth);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  newp= (setelemT *)SETelemaddr_(set, nth, void);
    -  elem= newp->p;
    -  oldp= newp+1;
    -  while (((newp++)->p= (oldp++)->p))
    -    ; /* copy remaining elements and NULL */
    -  if ((sizep->i--)==0)         /*  if was a full set */
    -    sizep->i= set->maxsize;  /*     *sizep= (max size-1)+ 1 */
    -  return elem;
    -} /* setdelnthsorted */
    -
    -
    -/*---------------------------------
    -
    -  qh_setdelsorted( set, oldelem )
    -    deletes oldelem from sorted set
    -
    -  returns:
    -    returns oldelem if it was deleted
    -
    -  notes:
    -    set may be NULL
    -
    -  design:
    -    locate oldelem in set
    -    copy remaining elements down one
    -    update actual size
    -*/
    -void *qh_setdelsorted(setT *set, void *oldelem) {
    -  setelemT *sizep;
    -  setelemT *newp, *oldp;
    -
    -  if (!set)
    -    return NULL;
    -  newp= (setelemT *)SETaddr_(set, void);
    -  while(newp->p != oldelem && newp->p)
    -    newp++;
    -  if (newp->p) {
    -    oldp= newp+1;
    -    while (((newp++)->p= (oldp++)->p))
    -      ; /* copy remaining elements */
    -    sizep= SETsizeaddr_(set);
    -    if ((sizep->i--)==0)    /*  if was a full set */
    -      sizep->i= set->maxsize;  /*     *sizep= (max size-1)+ 1 */
    -    return oldelem;
    -  }
    -  return NULL;
    -} /* setdelsorted */
    -
    -
    -/*---------------------------------
    -
    -  qh_setduplicate( set, elemsize )
    -    duplicate a set of elemsize elements
    -
    -  notes:
    -    use setcopy if retaining old elements
    -
    -  design:
    -    create a new set
    -    for each elem of the old set
    -      create a newelem
    -      append newelem to newset
    -*/
    -setT *qh_setduplicate(setT *set, int elemsize) {
    -  void          *elem, **elemp, *newElem;
    -  setT          *newSet;
    -  int           size;
    -
    -  if (!(size= qh_setsize(set)))
    -    return NULL;
    -  newSet= qh_setnew(size);
    -  FOREACHelem_(set) {
    -    newElem= qh_memalloc(elemsize);
    -    memcpy(newElem, elem, (size_t)elemsize);
    -    qh_setappend(&newSet, newElem);
    -  }
    -  return newSet;
    -} /* setduplicate */
    -
    -
    -/*---------------------------------
    -
    -  qh_setendpointer( set )
    -    Returns pointer to NULL terminator of a set's elements
    -    set can not be NULL
    -
    -*/
    -void **qh_setendpointer(setT *set) {
    -
    -  setelemT *sizep= SETsizeaddr_(set);
    -  int n= sizep->i;
    -  return (n ? &set->e[n-1].p : &sizep->p);
    -} /* qh_setendpointer */
    -
    -/*---------------------------------
    -
    -  qh_setequal(  )
    -    returns 1 if two sorted sets are equal, otherwise returns 0
    -
    -  notes:
    -    either set may be NULL
    -
    -  design:
    -    check size of each set
    -    setup pointers
    -    compare elements of each set
    -*/
    -int qh_setequal(setT *setA, setT *setB) {
    -  void **elemAp, **elemBp;
    -  int sizeA= 0, sizeB= 0;
    -
    -  if (setA) {
    -    SETreturnsize_(setA, sizeA);
    -  }
    -  if (setB) {
    -    SETreturnsize_(setB, sizeB);
    -  }
    -  if (sizeA != sizeB)
    -    return 0;
    -  if (!sizeA)
    -    return 1;
    -  elemAp= SETaddr_(setA, void);
    -  elemBp= SETaddr_(setB, void);
    -  if (!memcmp((char *)elemAp, (char *)elemBp, sizeA*SETelemsize))
    -    return 1;
    -  return 0;
    -} /* setequal */
    -
    -
    -/*---------------------------------
    -
    -  qh_setequal_except( setA, skipelemA, setB, skipelemB )
    -    returns 1 if sorted setA and setB are equal except for skipelemA & B
    -
    -  returns:
    -    false if either skipelemA or skipelemB are missing
    -
    -  notes:
    -    neither set may be NULL
    -
    -    if skipelemB is NULL,
    -      can skip any one element of setB
    -
    -  design:
    -    setup pointers
    -    search for skipelemA, skipelemB, and mismatches
    -    check results
    -*/
    -int qh_setequal_except(setT *setA, void *skipelemA, setT *setB, void *skipelemB) {
    -  void **elemA, **elemB;
    -  int skip=0;
    -
    -  elemA= SETaddr_(setA, void);
    -  elemB= SETaddr_(setB, void);
    -  while (1) {
    -    if (*elemA == skipelemA) {
    -      skip++;
    -      elemA++;
    -    }
    -    if (skipelemB) {
    -      if (*elemB == skipelemB) {
    -        skip++;
    -        elemB++;
    -      }
    -    }else if (*elemA != *elemB) {
    -      skip++;
    -      if (!(skipelemB= *elemB++))
    -        return 0;
    -    }
    -    if (!*elemA)
    -      break;
    -    if (*elemA++ != *elemB++)
    -      return 0;
    -  }
    -  if (skip != 2 || *elemB)
    -    return 0;
    -  return 1;
    -} /* setequal_except */
    -
    -
    -/*---------------------------------
    -
    -  qh_setequal_skip( setA, skipA, setB, skipB )
    -    returns 1 if sorted setA and setB are equal except for elements skipA & B
    -
    -  returns:
    -    false if different size
    -
    -  notes:
    -    neither set may be NULL
    -
    -  design:
    -    setup pointers
    -    search for mismatches while skipping skipA and skipB
    -*/
    -int qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB) {
    -  void **elemA, **elemB, **skipAp, **skipBp;
    -
    -  elemA= SETaddr_(setA, void);
    -  elemB= SETaddr_(setB, void);
    -  skipAp= SETelemaddr_(setA, skipA, void);
    -  skipBp= SETelemaddr_(setB, skipB, void);
    -  while (1) {
    -    if (elemA == skipAp)
    -      elemA++;
    -    if (elemB == skipBp)
    -      elemB++;
    -    if (!*elemA)
    -      break;
    -    if (*elemA++ != *elemB++)
    -      return 0;
    -  }
    -  if (*elemB)
    -    return 0;
    -  return 1;
    -} /* setequal_skip */
    -
    -
    -/*---------------------------------
    -
    -  qh_setfree( setp )
    -    frees the space occupied by a sorted or unsorted set
    -
    -  returns:
    -    sets setp to NULL
    -
    -  notes:
    -    set may be NULL
    -
    -  design:
    -    free array
    -    free set
    -*/
    -void qh_setfree(setT **setp) {
    -  int size;
    -  void **freelistp;  /* used !qh_NOmem */
    -
    -  if (*setp) {
    -    size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize;
    -    if (size <= qhmem.LASTsize) {
    -      qh_memfree_(*setp, size, freelistp);
    -    }else
    -      qh_memfree(*setp, size);
    -    *setp= NULL;
    -  }
    -} /* setfree */
    -
    -
    -/*---------------------------------
    -
    -  qh_setfree2( setp, elemsize )
    -    frees the space occupied by a set and its elements
    -
    -  notes:
    -    set may be NULL
    -
    -  design:
    -    free each element
    -    free set
    -*/
    -void qh_setfree2 (setT **setp, int elemsize) {
    -  void          *elem, **elemp;
    -
    -  FOREACHelem_(*setp)
    -    qh_memfree(elem, elemsize);
    -  qh_setfree(setp);
    -} /* setfree2 */
    -
    -
    -
    -/*---------------------------------
    -
    -  qh_setfreelong( setp )
    -    frees a set only if it's in long memory
    -
    -  returns:
    -    sets setp to NULL if it is freed
    -
    -  notes:
    -    set may be NULL
    -
    -  design:
    -    if set is large
    -      free it
    -*/
    -void qh_setfreelong(setT **setp) {
    -  int size;
    -
    -  if (*setp) {
    -    size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize;
    -    if (size > qhmem.LASTsize) {
    -      qh_memfree(*setp, size);
    -      *setp= NULL;
    -    }
    -  }
    -} /* setfreelong */
    -
    -
    -/*---------------------------------
    -
    -  qh_setin( set, setelem )
    -    returns 1 if setelem is in a set, 0 otherwise
    -
    -  notes:
    -    set may be NULL or unsorted
    -
    -  design:
    -    scans set for setelem
    -*/
    -int qh_setin(setT *set, void *setelem) {
    -  void *elem, **elemp;
    -
    -  FOREACHelem_(set) {
    -    if (elem == setelem)
    -      return 1;
    -  }
    -  return 0;
    -} /* setin */
    -
    -
    -/*---------------------------------
    -
    -  qh_setindex( set, atelem )
    -    returns the index of atelem in set.
    -    returns -1, if not in set or maxsize wrong
    -
    -  notes:
    -    set may be NULL and may contain nulls.
    -    NOerrors returned (qh_pointid, QhullPoint::id)
    -
    -  design:
    -    checks maxsize
    -    scans set for atelem
    -*/
    -int qh_setindex(setT *set, void *atelem) {
    -  void **elem;
    -  int size, i;
    -
    -  if (!set)
    -    return -1;
    -  SETreturnsize_(set, size);
    -  if (size > set->maxsize)
    -    return -1;
    -  elem= SETaddr_(set, void);
    -  for (i=0; i < size; i++) {
    -    if (*elem++ == atelem)
    -      return i;
    -  }
    -  return -1;
    -} /* setindex */
    -
    -
    -/*---------------------------------
    -
    -  qh_setlarger( oldsetp )
    -    returns a larger set that contains all elements of *oldsetp
    -
    -  notes:
    -    the set is at least twice as large
    -    if temp set, updates qhmem.tempstack
    -
    -  design:
    -    creates a new set
    -    copies the old set to the new set
    -    updates pointers in tempstack
    -    deletes the old set
    -*/
    -void qh_setlarger(setT **oldsetp) {
    -  int size= 1;
    -  setT *newset, *set, **setp, *oldset;
    -  setelemT *sizep;
    -  setelemT *newp, *oldp;
    -
    -  if (*oldsetp) {
    -    oldset= *oldsetp;
    -    SETreturnsize_(oldset, size);
    -    qhmem.cntlarger++;
    -    qhmem.totlarger += size+1;
    -    newset= qh_setnew(2 * size);
    -    oldp= (setelemT *)SETaddr_(oldset, void);
    -    newp= (setelemT *)SETaddr_(newset, void);
    -    memcpy((char *)newp, (char *)oldp, (size_t)(size+1) * SETelemsize);
    -    sizep= SETsizeaddr_(newset);
    -    sizep->i= size+1;
    -    FOREACHset_((setT *)qhmem.tempstack) {
    -      if (set == oldset)
    -        *(setp-1)= newset;
    -    }
    -    qh_setfree(oldsetp);
    -  }else
    -    newset= qh_setnew(3);
    -  *oldsetp= newset;
    -} /* setlarger */
    -
    -
    -/*---------------------------------
    -
    -  qh_setlast(  )
    -    return last element of set or NULL (use type conversion)
    -
    -  notes:
    -    set may be NULL
    -
    -  design:
    -    return last element
    -*/
    -void *qh_setlast(setT *set) {
    -  int size;
    -
    -  if (set) {
    -    size= SETsizeaddr_(set)->i;
    -    if (!size)
    -      return SETelem_(set, set->maxsize - 1);
    -    else if (size > 1)
    -      return SETelem_(set, size - 2);
    -  }
    -  return NULL;
    -} /* setlast */
    -
    -
    -/*---------------------------------
    -
    -  qh_setnew( setsize )
    -    creates and allocates space for a set
    -
    -  notes:
    -    setsize means the number of elements (!including the NULL terminator)
    -    use qh_settemp/qh_setfreetemp if set is temporary
    -
    -  design:
    -    allocate memory for set
    -    roundup memory if small set
    -    initialize as empty set
    -*/
    -setT *qh_setnew(int setsize) {
    -  setT *set;
    -  int sizereceived; /* used !qh_NOmem */
    -  int size;
    -  void **freelistp; /* used !qh_NOmem */
    -
    -  if (!setsize)
    -    setsize++;
    -  size= sizeof(setT) + setsize * SETelemsize;
    -  if (size>0 && size <= qhmem.LASTsize) {
    -    qh_memalloc_(size, freelistp, set, setT);
    -#ifndef qh_NOmem
    -    sizereceived= qhmem.sizetable[ qhmem.indextable[size]];
    -    if (sizereceived > size)
    -      setsize += (sizereceived - size)/SETelemsize;
    -#endif
    -  }else
    -    set= (setT*)qh_memalloc(size);
    -  set->maxsize= setsize;
    -  set->e[setsize].i= 1;
    -  set->e[0].p= NULL;
    -  return(set);
    -} /* setnew */
    -
    -
    -/*---------------------------------
    -
    -  qh_setnew_delnthsorted( set, size, nth, prepend )
    -    creates a sorted set not containing nth element
    -    if prepend, the first prepend elements are undefined
    -
    -  notes:
    -    set must be defined
    -    checks nth
    -    see also: setdelnthsorted
    -
    -  design:
    -    create new set
    -    setup pointers and allocate room for prepend'ed entries
    -    append head of old set to new set
    -    append tail of old set to new set
    -*/
    -setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend) {
    -  setT *newset;
    -  void **oldp, **newp;
    -  int tailsize= size - nth -1, newsize;
    -
    -  if (tailsize < 0) {
    -    qh_fprintf(qhmem.ferr, 6176, "qhull internal error (qh_setnew_delnthsorted): nth %d is out-of-bounds for set:\n", nth);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  newsize= size-1 + prepend;
    -  newset= qh_setnew(newsize);
    -  newset->e[newset->maxsize].i= newsize+1;  /* may be overwritten */
    -  oldp= SETaddr_(set, void);
    -  newp= SETaddr_(newset, void) + prepend;
    -  switch (nth) {
    -  case 0:
    -    break;
    -  case 1:
    -    *(newp++)= *oldp++;
    -    break;
    -  case 2:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  case 3:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  case 4:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  default:
    -    memcpy((char *)newp, (char *)oldp, (size_t)nth * SETelemsize);
    -    newp += nth;
    -    oldp += nth;
    -    break;
    -  }
    -  oldp++;
    -  switch (tailsize) {
    -  case 0:
    -    break;
    -  case 1:
    -    *(newp++)= *oldp++;
    -    break;
    -  case 2:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  case 3:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  case 4:
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    *(newp++)= *oldp++;
    -    break;
    -  default:
    -    memcpy((char *)newp, (char *)oldp, (size_t)tailsize * SETelemsize);
    -    newp += tailsize;
    -  }
    -  *newp= NULL;
    -  return(newset);
    -} /* setnew_delnthsorted */
    -
    -
    -/*---------------------------------
    -
    -  qh_setprint( fp, string, set )
    -    print set elements to fp with identifying string
    -
    -  notes:
    -    never errors
    -*/
    -void qh_setprint(FILE *fp, const char* string, setT *set) {
    -  int size, k;
    -
    -  if (!set)
    -    qh_fprintf(fp, 9346, "%s set is null\n", string);
    -  else {
    -    SETreturnsize_(set, size);
    -    qh_fprintf(fp, 9347, "%s set=%p maxsize=%d size=%d elems=",
    -             string, set, set->maxsize, size);
    -    if (size > set->maxsize)
    -      size= set->maxsize+1;
    -    for (k=0; k < size; k++)
    -      qh_fprintf(fp, 9348, " %p", set->e[k].p);
    -    qh_fprintf(fp, 9349, "\n");
    -  }
    -} /* setprint */
    -
    -/*---------------------------------
    -
    -  qh_setreplace( set, oldelem, newelem )
    -    replaces oldelem in set with newelem
    -
    -  notes:
    -    errors if oldelem not in the set
    -    newelem may be NULL, but it turns the set into an indexed set (no FOREACH)
    -
    -  design:
    -    find oldelem
    -    replace with newelem
    -*/
    -void qh_setreplace(setT *set, void *oldelem, void *newelem) {
    -  void **elemp;
    -
    -  elemp= SETaddr_(set, void);
    -  while (*elemp != oldelem && *elemp)
    -    elemp++;
    -  if (*elemp)
    -    *elemp= newelem;
    -  else {
    -    qh_fprintf(qhmem.ferr, 6177, "qhull internal error (qh_setreplace): elem %p not found in set\n",
    -       oldelem);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -} /* setreplace */
    -
    -
    -/*---------------------------------
    -
    -  qh_setsize( set )
    -    returns the size of a set
    -
    -  notes:
    -    errors if set's maxsize is incorrect
    -    same as SETreturnsize_(set)
    -    same code for qh_setsize [qset.c] and QhullSetBase::count
    -
    -  design:
    -    determine actual size of set from maxsize
    -*/
    -int qh_setsize(setT *set) {
    -  int size;
    -  setelemT *sizep;
    -
    -  if (!set)
    -    return(0);
    -  sizep= SETsizeaddr_(set);
    -  if ((size= sizep->i)) {
    -    size--;
    -    if (size > set->maxsize) {
    -      qh_fprintf(qhmem.ferr, 6178, "qhull internal error (qh_setsize): current set size %d is greater than maximum size %d\n",
    -               size, set->maxsize);
    -      qh_setprint(qhmem.ferr, "set: ", set);
    -      qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -    }
    -  }else
    -    size= set->maxsize;
    -  return size;
    -} /* setsize */
    -
    -/*---------------------------------
    -
    -  qh_settemp( setsize )
    -    return a stacked, temporary set of upto setsize elements
    -
    -  notes:
    -    use settempfree or settempfree_all to release from qhmem.tempstack
    -    see also qh_setnew
    -
    -  design:
    -    allocate set
    -    append to qhmem.tempstack
    -
    -*/
    -setT *qh_settemp(int setsize) {
    -  setT *newset;
    -
    -  newset= qh_setnew(setsize);
    -  qh_setappend(&qhmem.tempstack, newset);
    -  if (qhmem.IStracing >= 5)
    -    qh_fprintf(qhmem.ferr, 8123, "qh_settemp: temp set %p of %d elements, depth %d\n",
    -       newset, newset->maxsize, qh_setsize(qhmem.tempstack));
    -  return newset;
    -} /* settemp */
    -
    -/*---------------------------------
    -
    -  qh_settempfree( set )
    -    free temporary set at top of qhmem.tempstack
    -
    -  notes:
    -    nop if set is NULL
    -    errors if set not from previous   qh_settemp
    -
    -  to locate errors:
    -    use 'T2' to find source and then find mis-matching qh_settemp
    -
    -  design:
    -    check top of qhmem.tempstack
    -    free it
    -*/
    -void qh_settempfree(setT **set) {
    -  setT *stackedset;
    -
    -  if (!*set)
    -    return;
    -  stackedset= qh_settemppop();
    -  if (stackedset != *set) {
    -    qh_settemppush(stackedset);
    -    qh_fprintf(qhmem.ferr, 6179, "qhull internal error (qh_settempfree): set %p(size %d) was not last temporary allocated(depth %d, set %p, size %d)\n",
    -             *set, qh_setsize(*set), qh_setsize(qhmem.tempstack)+1,
    -             stackedset, qh_setsize(stackedset));
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  qh_setfree(set);
    -} /* settempfree */
    -
    -/*---------------------------------
    -
    -  qh_settempfree_all(  )
    -    free all temporary sets in qhmem.tempstack
    -
    -  design:
    -    for each set in tempstack
    -      free set
    -    free qhmem.tempstack
    -*/
    -void qh_settempfree_all(void) {
    -  setT *set, **setp;
    -
    -  FOREACHset_(qhmem.tempstack)
    -    qh_setfree(&set);
    -  qh_setfree(&qhmem.tempstack);
    -} /* settempfree_all */
    -
    -/*---------------------------------
    -
    -  qh_settemppop(  )
    -    pop and return temporary set from qhmem.tempstack
    -
    -  notes:
    -    the returned set is permanent
    -
    -  design:
    -    pop and check top of qhmem.tempstack
    -*/
    -setT *qh_settemppop(void) {
    -  setT *stackedset;
    -
    -  stackedset= (setT*)qh_setdellast(qhmem.tempstack);
    -  if (!stackedset) {
    -    qh_fprintf(qhmem.ferr, 6180, "qhull internal error (qh_settemppop): pop from empty temporary stack\n");
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  if (qhmem.IStracing >= 5)
    -    qh_fprintf(qhmem.ferr, 8124, "qh_settemppop: depth %d temp set %p of %d elements\n",
    -       qh_setsize(qhmem.tempstack)+1, stackedset, qh_setsize(stackedset));
    -  return stackedset;
    -} /* settemppop */
    -
    -/*---------------------------------
    -
    -  qh_settemppush( set )
    -    push temporary set unto qhmem.tempstack (makes it temporary)
    -
    -  notes:
    -    duplicates settemp() for tracing
    -
    -  design:
    -    append set to tempstack
    -*/
    -void qh_settemppush(setT *set) {
    -    if (!set) {
    -        fprintf (qhmem.ferr, "qhull error (qh_settemppush): can not push a NULL temp\n");
    -        qh_errexit (qhmem_ERRqhull, NULL, NULL);
    -    }
    -  qh_setappend(&qhmem.tempstack, set);
    -  if (qhmem.IStracing >= 5)
    -    qh_fprintf(qhmem.ferr, 8125, "qh_settemppush: depth %d temp set %p of %d elements\n",
    -      qh_setsize(qhmem.tempstack), set, qh_setsize(set));
    -} /* settemppush */
    -
    -
    -/*---------------------------------
    -
    -  qh_settruncate( set, size )
    -    truncate set to size elements
    -
    -  notes:
    -    set must be defined
    -
    -  see:
    -    SETtruncate_
    -
    -  design:
    -    check size
    -    update actual size of set
    -*/
    -void qh_settruncate(setT *set, int size) {
    -
    -  if (size < 0 || size > set->maxsize) {
    -    qh_fprintf(qhmem.ferr, 6181, "qhull internal error (qh_settruncate): size %d out of bounds for set:\n", size);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  set->e[set->maxsize].i= size+1;   /* maybe overwritten */
    -  set->e[size].p= NULL;
    -} /* settruncate */
    -
    -/*---------------------------------
    -
    -  qh_setunique( set, elem )
    -    add elem to unsorted set unless it is already in set
    -
    -  notes:
    -    returns 1 if it is appended
    -
    -  design:
    -    if elem not in set
    -      append elem to set
    -*/
    -int qh_setunique(setT **set, void *elem) {
    -
    -  if (!qh_setin(*set, elem)) {
    -    qh_setappend(set, elem);
    -    return 1;
    -  }
    -  return 0;
    -} /* setunique */
    -
    -/*---------------------------------
    -
    -  qh_setzero( set, index, size )
    -    zero elements from index on
    -    set actual size of set to size
    -
    -  notes:
    -    set must be defined
    -    the set becomes an indexed set (can not use FOREACH...)
    -
    -  see also:
    -    qh_settruncate
    -
    -  design:
    -    check index and size
    -    update actual size
    -    zero elements starting at e[index]
    -*/
    -void qh_setzero(setT *set, int idx, int size) {
    -  int count;
    -
    -  if (idx < 0 || idx >= size || size > set->maxsize) {
    -    qh_fprintf(qhmem.ferr, 6182, "qhull internal error (qh_setzero): index %d or size %d out of bounds for set:\n", idx, size);
    -    qh_setprint(qhmem.ferr, "", set);
    -    qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -  }
    -  set->e[set->maxsize].i=  size+1;  /* may be overwritten */
    -  count= size - idx + 1;   /* +1 for NULL terminator */
    -  memset((char *)SETelemaddr_(set, idx, void), 0, (size_t)count * SETelemsize);
    -} /* setzero */
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.h
    deleted file mode 100644
    index 759b501a80..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/qset.h
    +++ /dev/null
    @@ -1,488 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qset.h
    -     header file for qset.c that implements set
    -
    -   see qh-set.htm and qset.c
    -
    -   only uses mem.c, malloc/free
    -
    -   for error handling, writes message and calls
    -      qh_errexit(qhmem_ERRqhull, NULL, NULL);
    -
    -   set operations satisfy the following properties:
    -    - sets have a max size, the actual size (if different) is stored at the end
    -    - every set is NULL terminated
    -    - sets may be sorted or unsorted, the caller must distinguish this
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/qset.h#4 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFset
    -#define qhDEFset 1
    -
    -#include 
    -
    -/*================= -structures- ===============*/
    -
    -#ifndef DEFsetT
    -#define DEFsetT 1
    -typedef struct setT setT;   /* a set is a sorted or unsorted array of pointers */
    -#endif
    -
    -/*------------------------------------------
    -
    -setT
    -  a set or list of pointers with maximum size and actual size.
    -
    -variations:
    -  unsorted, unique   -- a list of unique pointers with NULL terminator
    -                           user guarantees uniqueness
    -  sorted             -- a sorted list of unique pointers with NULL terminator
    -                           qset.c guarantees uniqueness
    -  unsorted           -- a list of pointers terminated with NULL
    -  indexed            -- an array of pointers with NULL elements
    -
    -structure for set of n elements:
    -
    -        --------------
    -        |  maxsize
    -        --------------
    -        |  e[0] - a pointer, may be NULL for indexed sets
    -        --------------
    -        |  e[1]
    -
    -        --------------
    -        |  ...
    -        --------------
    -        |  e[n-1]
    -        --------------
    -        |  e[n] = NULL
    -        --------------
    -        |  ...
    -        --------------
    -        |  e[maxsize] - n+1 or NULL (determines actual size of set)
    -        --------------
    -
    -*/
    -
    -/*-- setelemT -- internal type to allow both pointers and indices
    -*/
    -typedef union setelemT setelemT;
    -union setelemT {
    -  void    *p;
    -  int      i;         /* integer used for e[maxSize] */
    -};
    -
    -struct setT {
    -  int maxsize;          /* maximum number of elements (except NULL) */
    -  setelemT e[1];        /* array of pointers, tail is NULL */
    -                        /* last slot (unless NULL) is actual size+1
    -                           e[maxsize]==NULL or e[e[maxsize]-1]==NULL */
    -                        /* this may generate a warning since e[] contains
    -                           maxsize elements */
    -};
    -
    -/*=========== -constants- =========================*/
    -
    -/*-------------------------------------
    -
    -  SETelemsize
    -    size of a set element in bytes
    -*/
    -#define SETelemsize ((int)sizeof(setelemT))
    -
    -
    -/*=========== -macros- =========================*/
    -
    -/*-------------------------------------
    -
    -   FOREACHsetelement_(type, set, variable)
    -     define FOREACH iterator
    -
    -   declare:
    -     assumes *variable and **variablep are declared
    -     no space in "variable)" [DEC Alpha cc compiler]
    -
    -   each iteration:
    -     variable is set element
    -     variablep is one beyond variable.
    -
    -   to repeat an element:
    -     variablep--; / *repeat* /
    -
    -   at exit:
    -     variable is NULL at end of loop
    -
    -   example:
    -     #define FOREACHfacet_( facets ) FOREACHsetelement_( facetT, facets, facet )
    -
    -   notes:
    -     use FOREACHsetelement_i_() if need index or include NULLs
    -
    -   WARNING:
    -     nested loops can't use the same variable (define another FOREACH)
    -
    -     needs braces if nested inside another FOREACH
    -     this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
    -*/
    -#define FOREACHsetelement_(type, set, variable) \
    -        if (((variable= NULL), set)) for (\
    -          variable##p= (type **)&((set)->e[0].p); \
    -          (variable= *variable##p++);)
    -
    -/*------------------------------------------
    -
    -   FOREACHsetelement_i_(type, set, variable)
    -     define indexed FOREACH iterator
    -
    -   declare:
    -     type *variable, variable_n, variable_i;
    -
    -   each iteration:
    -     variable is set element, may be NULL
    -     variable_i is index, variable_n is qh_setsize()
    -
    -   to repeat an element:
    -     variable_i--; variable_n-- repeats for deleted element
    -
    -   at exit:
    -     variable==NULL and variable_i==variable_n
    -
    -   example:
    -     #define FOREACHfacet_i_( facets ) FOREACHsetelement_i_( facetT, facets, facet )
    -
    -   WARNING:
    -     nested loops can't use the same variable (define another FOREACH)
    -
    -     needs braces if nested inside another FOREACH
    -     this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
    -*/
    -#define FOREACHsetelement_i_(type, set, variable) \
    -        if (((variable= NULL), set)) for (\
    -          variable##_i= 0, variable= (type *)((set)->e[0].p), \
    -                   variable##_n= qh_setsize(set);\
    -          variable##_i < variable##_n;\
    -          variable= (type *)((set)->e[++variable##_i].p) )
    -
    -/*----------------------------------------
    -
    -   FOREACHsetelementreverse_(type, set, variable)-
    -     define FOREACH iterator in reverse order
    -
    -   declare:
    -     assumes *variable and **variablep are declared
    -     also declare 'int variabletemp'
    -
    -   each iteration:
    -     variable is set element
    -
    -   to repeat an element:
    -     variabletemp++; / *repeat* /
    -
    -   at exit:
    -     variable is NULL
    -
    -   example:
    -     #define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( vertexT, vertices, vertex )
    -
    -   notes:
    -     use FOREACHsetelementreverse12_() to reverse first two elements
    -     WARNING: needs braces if nested inside another FOREACH
    -*/
    -#define FOREACHsetelementreverse_(type, set, variable) \
    -        if (((variable= NULL), set)) for (\
    -           variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\
    -           variable; variable= \
    -           ((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : NULL))
    -
    -/*-------------------------------------
    -
    -   FOREACHsetelementreverse12_(type, set, variable)-
    -     define FOREACH iterator with e[1] and e[0] reversed
    -
    -   declare:
    -     assumes *variable and **variablep are declared
    -
    -   each iteration:
    -     variable is set element
    -     variablep is one after variable.
    -
    -   to repeat an element:
    -     variablep--; / *repeat* /
    -
    -   at exit:
    -     variable is NULL at end of loop
    -
    -   example
    -     #define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12_( vertexT, vertices, vertex )
    -
    -   notes:
    -     WARNING: needs braces if nested inside another FOREACH
    -*/
    -#define FOREACHsetelementreverse12_(type, set, variable) \
    -        if (((variable= NULL), set)) for (\
    -          variable##p= (type **)&((set)->e[1].p); \
    -          (variable= *variable##p); \
    -          variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \
    -              (variable##p == ((type **)&((set)->e[1].p))?variable##p--:variable##p++))
    -
    -/*-------------------------------------
    -
    -   FOREACHelem_( set )-
    -     iterate elements in a set
    -
    -   declare:
    -     void *elem, *elemp;
    -
    -   each iteration:
    -     elem is set element
    -     elemp is one beyond
    -
    -   to repeat an element:
    -     elemp--; / *repeat* /
    -
    -   at exit:
    -     elem == NULL at end of loop
    -
    -   example:
    -     FOREACHelem_(set) {
    -
    -   notes:
    -     WARNING: needs braces if nested inside another FOREACH
    -*/
    -#define FOREACHelem_(set) FOREACHsetelement_(void, set, elem)
    -
    -/*-------------------------------------
    -
    -   FOREACHset_( set )-
    -     iterate a set of sets
    -
    -   declare:
    -     setT *set, **setp;
    -
    -   each iteration:
    -     set is set element
    -     setp is one beyond
    -
    -   to repeat an element:
    -     setp--; / *repeat* /
    -
    -   at exit:
    -     set == NULL at end of loop
    -
    -   example
    -     FOREACHset_(sets) {
    -
    -   notes:
    -     WARNING: needs braces if nested inside another FOREACH
    -*/
    -#define FOREACHset_(sets) FOREACHsetelement_(setT, sets, set)
    -
    -/*-------------------------------------------
    -
    -   SETindex_( set, elem )
    -     return index of elem in set
    -
    -   notes:
    -     for use with FOREACH iteration
    -     WARN64 -- Maximum set size is 2G
    -
    -   example:
    -     i= SETindex_(ridges, ridge)
    -*/
    -#define SETindex_(set, elem) ((int)((void **)elem##p - (void **)&(set)->e[1].p))
    -
    -/*-----------------------------------------
    -
    -   SETref_( elem )
    -     l.h.s. for modifying the current element in a FOREACH iteration
    -
    -   example:
    -     SETref_(ridge)= anotherridge;
    -*/
    -#define SETref_(elem) (elem##p[-1])
    -
    -/*-----------------------------------------
    -
    -   SETelem_(set, n)
    -     return the n'th element of set
    -
    -   notes:
    -      assumes that n is valid [0..size] and that set is defined
    -      use SETelemt_() for type cast
    -*/
    -#define SETelem_(set, n)           ((set)->e[n].p)
    -
    -/*-----------------------------------------
    -
    -   SETelemt_(set, n, type)
    -     return the n'th element of set as a type
    -
    -   notes:
    -      assumes that n is valid [0..size] and that set is defined
    -*/
    -#define SETelemt_(set, n, type)    ((type*)((set)->e[n].p))
    -
    -/*-----------------------------------------
    -
    -   SETelemaddr_(set, n, type)
    -     return address of the n'th element of a set
    -
    -   notes:
    -      assumes that n is valid [0..size] and set is defined
    -*/
    -#define SETelemaddr_(set, n, type) ((type **)(&((set)->e[n].p)))
    -
    -/*-----------------------------------------
    -
    -   SETfirst_(set)
    -     return first element of set
    -
    -*/
    -#define SETfirst_(set)             ((set)->e[0].p)
    -
    -/*-----------------------------------------
    -
    -   SETfirstt_(set, type)
    -     return first element of set as a type
    -
    -*/
    -#define SETfirstt_(set, type)      ((type*)((set)->e[0].p))
    -
    -/*-----------------------------------------
    -
    -   SETsecond_(set)
    -     return second element of set
    -
    -*/
    -#define SETsecond_(set)            ((set)->e[1].p)
    -
    -/*-----------------------------------------
    -
    -   SETsecondt_(set, type)
    -     return second element of set as a type
    -*/
    -#define SETsecondt_(set, type)     ((type*)((set)->e[1].p))
    -
    -/*-----------------------------------------
    -
    -   SETaddr_(set, type)
    -       return address of set's elements
    -*/
    -#define SETaddr_(set,type)         ((type **)(&((set)->e[0].p)))
    -
    -/*-----------------------------------------
    -
    -   SETreturnsize_(set, size)
    -     return size of a set
    -
    -   notes:
    -      set must be defined
    -      use qh_setsize(set) unless speed is critical
    -*/
    -#define SETreturnsize_(set, size) (((size)= ((set)->e[(set)->maxsize].i))?(--(size)):((size)= (set)->maxsize))
    -
    -/*-----------------------------------------
    -
    -   SETempty_(set)
    -     return true(1) if set is empty
    -
    -   notes:
    -      set may be NULL
    -*/
    -#define SETempty_(set)            (!set || (SETfirst_(set) ? 0 : 1))
    -
    -/*---------------------------------
    -
    -  SETsizeaddr_(set)
    -    return pointer to 'actual size+1' of set (set CANNOT be NULL!!)
    -    Its type is setelemT* for strict aliasing
    -    All SETelemaddr_ must be cast to setelemT
    -
    -
    -  notes:
    -    *SETsizeaddr==NULL or e[*SETsizeaddr-1].p==NULL
    -*/
    -#define SETsizeaddr_(set) (&((set)->e[(set)->maxsize]))
    -
    -/*-----------------------------------------
    -
    -   SETtruncate_(set, size)
    -     truncate set to size
    -
    -   see:
    -     qh_settruncate()
    -
    -*/
    -#define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe overwritten */ \
    -      set->e[size].p= NULL;}
    -
    -/*======= prototypes in alphabetical order ============*/
    -
    -void  qh_setaddsorted(setT **setp, void *elem);
    -void  qh_setaddnth(setT **setp, int nth, void *newelem);
    -void  qh_setappend(setT **setp, void *elem);
    -void  qh_setappend_set(setT **setp, setT *setA);
    -void  qh_setappend2ndlast(setT **setp, void *elem);
    -void  qh_setcheck(setT *set, const char *tname, unsigned id);
    -void  qh_setcompact(setT *set);
    -setT *qh_setcopy(setT *set, int extra);
    -void *qh_setdel(setT *set, void *elem);
    -void *qh_setdellast(setT *set);
    -void *qh_setdelnth(setT *set, int nth);
    -void *qh_setdelnthsorted(setT *set, int nth);
    -void *qh_setdelsorted(setT *set, void *newelem);
    -setT *qh_setduplicate( setT *set, int elemsize);
    -int   qh_setequal(setT *setA, setT *setB);
    -int   qh_setequal_except(setT *setA, void *skipelemA, setT *setB, void *skipelemB);
    -int   qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB);
    -void **qh_setendpointer(setT *set);
    -void  qh_setfree(setT **set);
    -void  qh_setfree2( setT **setp, int elemsize);
    -void  qh_setfreelong(setT **set);
    -int   qh_setin(setT *set, void *setelem);
    -int   qh_setindex(setT *set, void *setelem);
    -void  qh_setlarger(setT **setp);
    -void *qh_setlast(setT *set);
    -setT *qh_setnew(int size);
    -setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend);
    -void  qh_setprint(FILE *fp, const char* string, setT *set);
    -void  qh_setreplace(setT *set, void *oldelem, void *newelem);
    -int   qh_setsize(setT *set);
    -setT *qh_settemp(int setsize);
    -void  qh_settempfree(setT **set);
    -void  qh_settempfree_all(void);
    -setT *qh_settemppop(void);
    -void  qh_settemppush(setT *set);
    -void  qh_settruncate(setT *set, int size);
    -int   qh_setunique(setT **set, void *elem);
    -void  qh_setzero(setT *set, int idx, int size);
    -
    -
    -#endif /* qhDEFset */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.c
    deleted file mode 100644
    index d2af5dd016..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.c
    +++ /dev/null
    @@ -1,243 +0,0 @@
    -/*
      ---------------------------------
    -
    -   random.c -- utilities
    -     Park & Miller's minimimal standard random number generator
    -     argc/argv conversion
    -
    -     Used by rbox.  Do not use 'qh' 
    -*/
    -
    -#include "libqhull.h"
    -#include 
    -#include 
    -#include 
    -
    -#ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
    -#pragma warning( disable : 4706)  /* assignment within conditional function */
    -#pragma warning( disable : 4996)  /* function was declared deprecated(strcpy, localtime, etc.) */
    -#endif
    -
    -/*---------------------------------
    -
    - qh_argv_to_command( argc, argv, command, max_size )
    -
    -    build command from argc/argv
    -    max_size is at least
    -
    - returns:
    -    a space-delimited string of options (just as typed)
    -    returns false if max_size is too short
    -
    - notes:
    -    silently removes
    -    makes option string easy to input and output
    -    matches qh_argv_to_command_size()
    -
    -    argc may be 0
    -*/
    -int qh_argv_to_command(int argc, char *argv[], char* command, int max_size) {
    -  int i, remaining;
    -  char *s;
    -  *command= '\0';  /* max_size > 0 */
    -
    -  if (argc) {
    -    if ((s= strrchr( argv[0], '\\')) /* get filename w/o .exe extension */
    -    || (s= strrchr( argv[0], '/')))
    -        s++;
    -    else
    -        s= argv[0];
    -    if ((int)strlen(s) < max_size)   /* WARN64 */
    -        strcpy(command, s);
    -    else
    -        goto error_argv;
    -    if ((s= strstr(command, ".EXE"))
    -    ||  (s= strstr(command, ".exe")))
    -        *s= '\0';
    -  }
    -  for (i=1; i < argc; i++) {
    -    s= argv[i];
    -    remaining= max_size - (int)strlen(command) - (int)strlen(s) - 2;   /* WARN64 */
    -    if (!*s || strchr(s, ' ')) {
    -      char *t= command + strlen(command);
    -      remaining -= 2;
    -      if (remaining < 0) {
    -        goto error_argv;
    -      }
    -      *t++= ' ';
    -      *t++= '"';
    -      while (*s) {
    -        if (*s == '"') {
    -          if (--remaining < 0)
    -            goto error_argv;
    -          *t++= '\\';
    -        }
    -        *t++= *s++;
    -      }
    -      *t++= '"';
    -      *t= '\0';
    -    }else if (remaining < 0) {
    -      goto error_argv;
    -    }else
    -      strcat(command, " ");
    -      strcat(command, s);
    -  }
    -  return 1;
    -
    -error_argv:
    -  return 0;
    -} /* argv_to_command */
    -
    -/*---------------------------------
    -
    -qh_argv_to_command_size( argc, argv )
    -
    -    return size to allocate for qh_argv_to_command()
    -
    -notes:
    -    argc may be 0
    -    actual size is usually shorter
    -*/
    -int qh_argv_to_command_size(int argc, char *argv[]) {
    -    unsigned int count= 1; /* null-terminator if argc==0 */
    -    int i;
    -    char *s;
    -
    -    for (i=0; i0 && strchr(argv[i], ' ')) {
    -        count += 2;  /* quote delimiters */
    -        for (s=argv[i]; *s; s++) {
    -          if (*s == '"') {
    -            count++;
    -          }
    -        }
    -      }
    -    }
    -    return count;
    -} /* argv_to_command_size */
    -
    -/*---------------------------------
    -
    -  qh_rand()
    -  qh_srand( seed )
    -    generate pseudo-random number between 1 and 2^31 -2
    -
    -  notes:
    -    For qhull and rbox, called from qh_RANDOMint(),etc. [user.h]
    -
    -    From Park & Miller's minimal standard random number generator
    -      Communications of the ACM, 31:1192-1201, 1988.
    -    Does not use 0 or 2^31 -1
    -      this is silently enforced by qh_srand()
    -    Can make 'Rn' much faster by moving qh_rand to qh_distplane
    -*/
    -
    -/* Global variables and constants */
    -
    -int qh_rand_seed= 1;  /* define as global variable instead of using qh */
    -
    -#define qh_rand_a 16807
    -#define qh_rand_m 2147483647
    -#define qh_rand_q 127773  /* m div a */
    -#define qh_rand_r 2836    /* m mod a */
    -
    -int qh_rand( void) {
    -    int lo, hi, test;
    -    int seed = qh_rand_seed;
    -
    -    hi = seed / qh_rand_q;  /* seed div q */
    -    lo = seed % qh_rand_q;  /* seed mod q */
    -    test = qh_rand_a * lo - qh_rand_r * hi;
    -    if (test > 0)
    -        seed= test;
    -    else
    -        seed= test + qh_rand_m;
    -    qh_rand_seed= seed;
    -    /* seed = seed < qh_RANDOMmax/2 ? 0 : qh_RANDOMmax;  for testing */
    -    /* seed = qh_RANDOMmax;  for testing */
    -    return seed;
    -} /* rand */
    -
    -void qh_srand( int seed) {
    -    if (seed < 1)
    -        qh_rand_seed= 1;
    -    else if (seed >= qh_rand_m)
    -        qh_rand_seed= qh_rand_m - 1;
    -    else
    -        qh_rand_seed= seed;
    -} /* qh_srand */
    -
    -/*---------------------------------
    -
    -qh_randomfactor( scale, offset )
    -return a random factor r * scale + offset
    -
    -notes:
    -qh.RANDOMa/b are defined in global.c
    -*/
    -realT qh_randomfactor(realT scale, realT offset) {
    -    realT randr;
    -
    -    randr= qh_RANDOMint;
    -    return randr * scale + offset;
    -} /* randomfactor */
    -
    -/*---------------------------------
    -
    -qh_randommatrix( buffer, dim, rows )
    -generate a random dim X dim matrix in range [-1,1]
    -assumes buffer is [dim+1, dim]
    -
    -returns:
    -sets buffer to random numbers
    -sets rows to rows of buffer
    -sets row[dim] as scratch row
    -*/
    -void qh_randommatrix(realT *buffer, int dim, realT **rows) {
    -    int i, k;
    -    realT **rowi, *coord, realr;
    -
    -    coord= buffer;
    -    rowi= rows;
    -    for (i=0; i < dim; i++) {
    -        *(rowi++)= coord;
    -        for (k=0; k < dim; k++) {
    -            realr= qh_RANDOMint;
    -            *(coord++)= 2.0 * realr/(qh_RANDOMmax+1) - 1.0;
    -        }
    -    }
    -    *rowi= coord;
    -} /* randommatrix */
    -
    -/*---------------------------------
    -
    -  qh_strtol( s, endp) qh_strtod( s, endp)
    -    internal versions of strtol() and strtod()
    -    does not skip trailing spaces
    -  notes:
    -    some implementations of strtol()/strtod() skip trailing spaces
    -*/
    -double qh_strtod(const char *s, char **endp) {
    -  double result;
    -
    -  result= strtod(s, endp);
    -  if (s < (*endp) && (*endp)[-1] == ' ')
    -    (*endp)--;
    -  return result;
    -} /* strtod */
    -
    -int qh_strtol(const char *s, char **endp) {
    -  int result;
    -
    -  result= (int) strtol(s, endp, 10);     /* WARN64 */
    -  if (s< (*endp) && (*endp)[-1] == ' ')
    -    (*endp)--;
    -  return result;
    -} /* strtol */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.h
    deleted file mode 100644
    index 87371db079..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/random.h
    +++ /dev/null
    @@ -1,34 +0,0 @@
    -/*
      ---------------------------------
    -
    -  random.h
    -    header file for random routines
    -
    -   see qh-geom.htm and random.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/random.h#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#ifndef qhDEFrandom
    -#define qhDEFrandom 1
    -
    -#include "libqhull.h"
    -
    -/*============= prototypes in alphabetical order ======= */
    -
    -
    -int     qh_argv_to_command(int argc, char *argv[], char* command, int max_size);
    -int     qh_argv_to_command_size(int argc, char *argv[]);
    -int     qh_rand( void);
    -void    qh_srand( int seed);
    -realT   qh_randomfactor(realT scale, realT offset);
    -void    qh_randommatrix(realT *buffer, int dim, realT **row);
    -int     qh_strtol(const char *s, char **endp);
    -double  qh_strtod(const char *s, char **endp);
    -
    -#endif /* qhDEFrandom */
    -
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/rboxlib.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/rboxlib.c
    deleted file mode 100644
    index 0fafeec1c4..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/rboxlib.c
    +++ /dev/null
    @@ -1,795 +0,0 @@
    -/*
      ---------------------------------
    -
    -   rboxlib.c
    -     Generate input points
    -
    -   notes:
    -     For documentation, see prompt[] of rbox.c
    -     50 points generated for 'rbox D4'
    -
    -   WARNING:
    -     incorrect range if qh_RANDOMmax is defined wrong (user.h)
    -*/
    -
    -#include "random.h"
    -#include "libqhull.h"
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#ifdef _MSC_VER  /* Microsoft Visual C++ */
    -#pragma warning( disable : 4706)  /* assignment within conditional expression. */
    -#pragma warning( disable : 4996)  /* this function (strncat,sprintf,strcpy) or variable may be unsafe. */
    -#endif
    -
    -#define MAXdim 200
    -#define PI 3.1415926535897932384
    -
    -/* ------------------------------ prototypes ----------------*/
    -int roundi( double a);
    -void out1( double a);
    -void out2n( double a, double b);
    -void out3n( double a, double b, double c);
    -
    -void    qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );
    -void    qh_free(void *mem);
    -void   *qh_malloc(size_t size);
    -int     qh_rand( void);
    -void    qh_srand( int seed);
    -
    -
    -/* ------------------------------ globals -------------------*/
    -
    -/* No state is carried between rbox requests */
    -typedef struct rboxT rboxT;
    -struct rboxT {
    -  FILE *fout;
    -  FILE *ferr;
    -  int isinteger;
    -  double out_offset;
    -  jmp_buf errexit;        /* exit label for rboxpoints, defined by setjmp(), called by qh_errexit_rbox() */
    -};
    -
    -
    -int rbox_inuse= 0;
    -rboxT rbox;
    -
    -/*---------------------------------
    -
    -  qh_rboxpoints( fout, ferr, rbox_command )
    -    Generate points to fout according to rbox options
    -    Report errors on ferr
    -
    -  returns:
    -    0 (qh_ERRnone) on success
    -    1 (qh_ERRinput) on input error
    -    4 (qh_ERRmem) on memory error
    -    5 (qh_ERRqhull) on internal error
    -
    -  notes:
    -    To avoid stdio, redefine qh_malloc, qh_free, and qh_fprintf_rbox (user.c)
    -    Rbox is not multithreaded.
    -
    -  design:
    -    Straight line code (consider defining a struct and functions):
    -
    -    Parse arguments into variables
    -    Determine the number of points
    -    Generate the points
    -*/
    -int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) {
    -  int i,j,k;
    -  int gendim;
    -  int cubesize, diamondsize, seed=0, count, apex;
    -  int dim=3 , numpoints= 0, totpoints, addpoints=0;
    -  int issphere=0, isaxis=0,  iscdd= 0, islens= 0, isregular=0, iswidth=0, addcube=0;
    -  int isgap=0, isspiral=0, NOcommand= 0, adddiamond=0;
    -  int israndom=0, istime=0;
    -  int isbox=0, issimplex=0, issimplex2=0, ismesh=0;
    -  double width=0.0, gap=0.0, radius= 0.0;
    -  double coord[MAXdim], offset, meshm=3.0, meshn=4.0, meshr=5.0;
    -  double *simplex= NULL, *simplexp;
    -  int nthroot, mult[MAXdim];
    -  double norm, factor, randr, rangap, lensangle= 0, lensbase= 1;
    -  double anglediff, angle, x, y, cube= 0.0, diamond= 0.0;
    -  double box= qh_DEFAULTbox; /* scale all numbers before output */
    -  double randmax= qh_RANDOMmax;
    -  char command[200], seedbuf[200];
    -  char *s= command, *t, *first_point= NULL;
    -  time_t timedata;
    -  int exitcode;
    -
    -  if (rbox_inuse) {
    -    qh_fprintf_rbox(rbox.ferr, 6188, "rbox error: rbox in use by another process.  Please lock calls to rbox.\n");
    -    return qh_ERRqhull;
    -  }
    -  rbox_inuse= True;
    -  rbox.ferr= ferr;
    -  rbox.fout= fout;
    -
    -  exitcode= setjmp(rbox.errexit);
    -  if (exitcode) {
    -    /* same code for error exit and normal return */
    -    if (simplex)
    -        qh_free(simplex);
    -    rbox_inuse= False;
    -    return exitcode;
    -  }
    -
    -  *command= '\0';
    -  strncat(command, rbox_command, sizeof(command)-strlen(command)-1);
    -
    -  while (*s && !isspace(*s))  /* skip program name */
    -    s++;
    -  while (*s) {
    -    while (*s && isspace(*s))
    -      s++;
    -    if (*s == '-')
    -      s++;
    -    if (!*s)
    -      break;
    -    if (isdigit(*s)) {
    -      numpoints= qh_strtol(s, &s);
    -      continue;
    -    }
    -    /* ============= read flags =============== */
    -    switch (*s++) {
    -    case 'c':
    -      addcube= 1;
    -      t= s;
    -      while (isspace(*t))
    -        t++;
    -      if (*t == 'G')
    -        cube= qh_strtod(++t, &s);
    -      break;
    -    case 'd':
    -      adddiamond= 1;
    -      t= s;
    -      while (isspace(*t))
    -        t++;
    -      if (*t == 'G')
    -        diamond= qh_strtod(++t, &s);
    -      break;
    -    case 'h':
    -      iscdd= 1;
    -      break;
    -    case 'l':
    -      isspiral= 1;
    -      break;
    -    case 'n':
    -      NOcommand= 1;
    -      break;
    -    case 'r':
    -      isregular= 1;
    -      break;
    -    case 's':
    -      issphere= 1;
    -      break;
    -    case 't':
    -      istime= 1;
    -      if (isdigit(*s)) {
    -        seed= qh_strtol(s, &s);
    -        israndom= 0;
    -      }else
    -        israndom= 1;
    -      break;
    -    case 'x':
    -      issimplex= 1;
    -      break;
    -    case 'y':
    -      issimplex2= 1;
    -      break;
    -    case 'z':
    -      rbox.isinteger= 1;
    -      break;
    -    case 'B':
    -      box= qh_strtod(s, &s);
    -      isbox= 1;
    -      break;
    -    case 'D':
    -      dim= qh_strtol(s, &s);
    -      if (dim < 1
    -      || dim > MAXdim) {
    -        qh_fprintf_rbox(rbox.ferr, 6189, "rbox error: dimension, D%d, out of bounds (>=%d or <=0)", dim, MAXdim);
    -        qh_errexit_rbox(qh_ERRinput);
    -      }
    -      break;
    -    case 'G':
    -      if (isdigit(*s))
    -        gap= qh_strtod(s, &s);
    -      else
    -        gap= 0.5;
    -      isgap= 1;
    -      break;
    -    case 'L':
    -      if (isdigit(*s))
    -        radius= qh_strtod(s, &s);
    -      else
    -        radius= 10;
    -      islens= 1;
    -      break;
    -    case 'M':
    -      ismesh= 1;
    -      if (*s)
    -        meshn= qh_strtod(s, &s);
    -      if (*s == ',') {
    -        ++s;
    -        meshm= qh_strtod(s, &s);
    -      }else
    -        meshm= 0.0;
    -      if (*s == ',') {
    -        ++s;
    -        meshr= qh_strtod(s, &s);
    -      }else
    -        meshr= sqrt(meshn*meshn + meshm*meshm);
    -      if (*s && !isspace(*s)) {
    -        qh_fprintf_rbox(rbox.ferr, 7069, "rbox warning: assuming 'M3,4,5' since mesh args are not integers or reals\n");
    -        meshn= 3.0, meshm=4.0, meshr=5.0;
    -      }
    -      break;
    -    case 'O':
    -      rbox.out_offset= qh_strtod(s, &s);
    -      break;
    -    case 'P':
    -      if (!first_point)
    -        first_point= s-1;
    -      addpoints++;
    -      while (*s && !isspace(*s))   /* read points later */
    -        s++;
    -      break;
    -    case 'W':
    -      width= qh_strtod(s, &s);
    -      iswidth= 1;
    -      break;
    -    case 'Z':
    -      if (isdigit(*s))
    -        radius= qh_strtod(s, &s);
    -      else
    -        radius= 1.0;
    -      isaxis= 1;
    -      break;
    -    default:
    -      qh_fprintf_rbox(rbox.ferr, 7070, "rbox error: unknown flag at %s.\nExecute 'rbox' without arguments for documentation.\n", s);
    -      qh_errexit_rbox(qh_ERRinput);
    -    }
    -    if (*s && !isspace(*s)) {
    -      qh_fprintf_rbox(rbox.ferr, 7071, "rbox error: missing space between flags at %s.\n", s);
    -      qh_errexit_rbox(qh_ERRinput);
    -    }
    -  }
    -
    -  /* ============= defaults, constants, and sizes =============== */
    -  if (rbox.isinteger && !isbox)
    -    box= qh_DEFAULTzbox;
    -  if (addcube) {
    -    cubesize= (int)floor(ldexp(1.0,dim)+0.5);
    -    if (cube == 0.0)
    -      cube= box;
    -  }else
    -    cubesize= 0;
    -  if (adddiamond) {
    -    diamondsize= 2*dim;
    -    if (diamond == 0.0)
    -      diamond= box;
    -  }else
    -    diamondsize= 0;
    -  if (islens) {
    -    if (isaxis) {
    -        qh_fprintf_rbox(rbox.ferr, 6190, "rbox error: can not combine 'Ln' with 'Zn'\n");
    -        qh_errexit_rbox(qh_ERRinput);
    -    }
    -    if (radius <= 1.0) {
    -        qh_fprintf_rbox(rbox.ferr, 6191, "rbox error: lens radius %.2g should be greater than 1.0\n",
    -               radius);
    -        qh_errexit_rbox(qh_ERRinput);
    -    }
    -    lensangle= asin(1.0/radius);
    -    lensbase= radius * cos(lensangle);
    -  }
    -
    -  if (!numpoints) {
    -    if (issimplex2)
    -        ; /* ok */
    -    else if (isregular + issimplex + islens + issphere + isaxis + isspiral + iswidth + ismesh) {
    -        qh_fprintf_rbox(rbox.ferr, 6192, "rbox error: missing count\n");
    -        qh_errexit_rbox(qh_ERRinput);
    -    }else if (adddiamond + addcube + addpoints)
    -        ; /* ok */
    -    else {
    -        numpoints= 50;  /* ./rbox D4 is the test case */
    -        issphere= 1;
    -    }
    -  }
    -  if ((issimplex + islens + isspiral + ismesh > 1)
    -  || (issimplex + issphere + isspiral + ismesh > 1)) {
    -    qh_fprintf_rbox(rbox.ferr, 6193, "rbox error: can only specify one of 'l', 's', 'x', 'Ln', or 'Mn,m,r' ('Ln s' is ok).\n");
    -    qh_errexit_rbox(qh_ERRinput);
    -  }
    -
    -  /* ============= print header with total points =============== */
    -  if (issimplex || ismesh)
    -    totpoints= numpoints;
    -  else if (issimplex2)
    -    totpoints= numpoints+dim+1;
    -  else if (isregular) {
    -    totpoints= numpoints;
    -    if (dim == 2) {
    -        if (islens)
    -          totpoints += numpoints - 2;
    -    }else if (dim == 3) {
    -        if (islens)
    -          totpoints += 2 * numpoints;
    -      else if (isgap)
    -        totpoints += 1 + numpoints;
    -      else
    -        totpoints += 2;
    -    }
    -  }else
    -    totpoints= numpoints + isaxis;
    -  totpoints += cubesize + diamondsize + addpoints;
    -
    -  /* ============= seed randoms =============== */
    -  if (istime == 0) {
    -    for (s=command; *s; s++) {
    -      if (issimplex2 && *s == 'y') /* make 'y' same seed as 'x' */
    -        i= 'x';
    -      else
    -        i= *s;
    -      seed= 11*seed + i;
    -    }
    -  }else if (israndom) {
    -    seed= (int)time(&timedata);
    -    sprintf(seedbuf, " t%d", seed);  /* appends an extra t, not worth removing */
    -    strncat(command, seedbuf, sizeof(command)-strlen(command)-1);
    -    t= strstr(command, " t ");
    -    if (t)
    -      strcpy(t+1, t+3); /* remove " t " */
    -  } /* else, seed explicitly set to n */
    -  qh_RANDOMseed_(seed);
    -
    -  /* ============= print header =============== */
    -
    -  if (iscdd)
    -      qh_fprintf_rbox(rbox.fout, 9391, "%s\nbegin\n        %d %d %s\n",
    -      NOcommand ? "" : command,
    -      totpoints, dim+1,
    -      rbox.isinteger ? "integer" : "real");
    -  else if (NOcommand)
    -      qh_fprintf_rbox(rbox.fout, 9392, "%d\n%d\n", dim, totpoints);
    -  else
    -      qh_fprintf_rbox(rbox.fout, 9393, "%d %s\n%d\n", dim, command, totpoints);
    -
    -  /* ============= explicit points =============== */
    -  if ((s= first_point)) {
    -    while (s && *s) { /* 'P' */
    -      count= 0;
    -      if (iscdd)
    -        out1( 1.0);
    -      while (*++s) {
    -        out1( qh_strtod(s, &s));
    -        count++;
    -        if (isspace(*s) || !*s)
    -          break;
    -        if (*s != ',') {
    -          qh_fprintf_rbox(rbox.ferr, 6194, "rbox error: missing comma after coordinate in %s\n\n", s);
    -          qh_errexit_rbox(qh_ERRinput);
    -        }
    -      }
    -      if (count < dim) {
    -        for (k=dim-count; k--; )
    -          out1( 0.0);
    -      }else if (count > dim) {
    -        qh_fprintf_rbox(rbox.ferr, 6195, "rbox error: %d coordinates instead of %d coordinates in %s\n\n",
    -                  count, dim, s);
    -        qh_errexit_rbox(qh_ERRinput);
    -      }
    -      qh_fprintf_rbox(rbox.fout, 9394, "\n");
    -      while ((s= strchr(s, 'P'))) {
    -        if (isspace(s[-1]))
    -          break;
    -      }
    -    }
    -  }
    -
    -  /* ============= simplex distribution =============== */
    -  if (issimplex+issimplex2) {
    -    if (!(simplex= (double*)qh_malloc( dim * (dim+1) * sizeof(double)))) {
    -      qh_fprintf_rbox(rbox.ferr, 6196, "rbox error: insufficient memory for simplex\n");
    -      qh_errexit_rbox(qh_ERRmem); /* qh_ERRmem */
    -    }
    -    simplexp= simplex;
    -    if (isregular) {
    -      for (i=0; i randmax/2)
    -          coord[dim-1]= -coord[dim-1];
    -      /* ============= project 'Wn' point toward boundary =============== */
    -      }else if (iswidth && !issphere) {
    -        j= qh_RANDOMint % gendim;
    -        if (coord[j] < 0)
    -          coord[j]= -1.0 - coord[j] * width;
    -        else
    -          coord[j]= 1.0 - coord[j] * width;
    -      }
    -      /* ============= write point =============== */
    -      if (iscdd)
    -        out1( 1.0);
    -      for (k=0; k < dim; k++)
    -        out1( coord[k] * box);
    -      qh_fprintf_rbox(rbox.fout, 9399, "\n");
    -    }
    -  }
    -
    -  /* ============= write cube vertices =============== */
    -  if (addcube) {
    -    for (j=0; j=0; k--) {
    -        if (j & ( 1 << k))
    -          out1( cube);
    -        else
    -          out1( -cube);
    -      }
    -      qh_fprintf_rbox(rbox.fout, 9400, "\n");
    -    }
    -  }
    -
    -  /* ============= write diamond vertices =============== */
    -  if (adddiamond) {
    -    for (j=0; j=0; k--) {
    -        if (j/2 != k)
    -          out1( 0.0);
    -        else if (j & 0x1)
    -          out1( diamond);
    -        else
    -          out1( -diamond);
    -      }
    -      qh_fprintf_rbox(rbox.fout, 9401, "\n");
    -    }
    -  }
    -
    -  if (iscdd)
    -    qh_fprintf_rbox(rbox.fout, 9402, "end\nhull\n");
    -
    -  /* same code for error exit and normal return */
    -  if (simplex)
    -    qh_free(simplex);
    -  rbox_inuse= False;
    -  return qh_ERRnone;
    -} /* rboxpoints */
    -
    -/*------------------------------------------------
    -outxxx - output functions
    -*/
    -int roundi( double a) {
    -  if (a < 0.0) {
    -    if (a - 0.5 < INT_MIN) {
    -      qh_fprintf_rbox(rbox.ferr, 6200, "rbox input error: negative coordinate %2.2g is too large.  Reduce 'Bn'\n", a);
    -      qh_errexit_rbox(qh_ERRinput);
    -    }
    -    return (int)(a - 0.5);
    -  }else {
    -    if (a + 0.5 > INT_MAX) {
    -      qh_fprintf_rbox(rbox.ferr, 6201, "rbox input error: coordinate %2.2g is too large.  Reduce 'Bn'\n", a);
    -      qh_errexit_rbox(qh_ERRinput);
    -    }
    -    return (int)(a + 0.5);
    -  }
    -} /* roundi */
    -
    -void out1(double a) {
    -
    -  if (rbox.isinteger)
    -    qh_fprintf_rbox(rbox.fout, 9403, "%d ", roundi( a+rbox.out_offset));
    -  else
    -    qh_fprintf_rbox(rbox.fout, 9404, qh_REAL_1, a+rbox.out_offset);
    -} /* out1 */
    -
    -void out2n( double a, double b) {
    -
    -  if (rbox.isinteger)
    -    qh_fprintf_rbox(rbox.fout, 9405, "%d %d\n", roundi(a+rbox.out_offset), roundi(b+rbox.out_offset));
    -  else
    -    qh_fprintf_rbox(rbox.fout, 9406, qh_REAL_2n, a+rbox.out_offset, b+rbox.out_offset);
    -} /* out2n */
    -
    -void out3n( double a, double b, double c) {
    -
    -  if (rbox.isinteger)
    -    qh_fprintf_rbox(rbox.fout, 9407, "%d %d %d\n", roundi(a+rbox.out_offset), roundi(b+rbox.out_offset), roundi(c+rbox.out_offset));
    -  else
    -    qh_fprintf_rbox(rbox.fout, 9408, qh_REAL_3n, a+rbox.out_offset, b+rbox.out_offset, c+rbox.out_offset);
    -} /* out3n */
    -
    -void qh_errexit_rbox(int exitcode)
    -{
    -    longjmp(rbox.errexit, exitcode);
    -} /* rbox_errexit */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.c
    deleted file mode 100644
    index 7dc60b9349..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.c
    +++ /dev/null
    @@ -1,714 +0,0 @@
    -/*
      ---------------------------------
    -
    -   stat.c
    -   contains all statistics that are collected for qhull
    -
    -   see qh-stat.htm and stat.h
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/stat.c#3 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*============ global data structure ==========*/
    -
    -#if qh_QHpointer
    -qhstatT *qh_qhstat=NULL;  /* global data structure */
    -#else
    -qhstatT qh_qhstat;   /* add "={0}" if this causes a compiler error */
    -#endif
    -
    -/*========== functions in alphabetic order ================*/
    -
    -/*---------------------------------
    -
    -  qh_allstatA()
    -    define statistics in groups of 20
    -
    -  notes:
    -    (otherwise, 'gcc -O2' uses too much memory)
    -    uses qhstat.next
    -*/
    -void qh_allstatA(void) {
    -
    -   /* zdef_(type,name,doc,average) */
    -  zzdef_(zdoc, Zdoc2, "precision statistics", -1);
    -  zdef_(zinc, Znewvertex, NULL, -1);
    -  zdef_(wadd, Wnewvertex, "ave. distance of a new vertex to a facet(!0s)", Znewvertex);
    -  zzdef_(wmax, Wnewvertexmax, "max. distance of a new vertex to a facet", -1);
    -  zdef_(wmax, Wvertexmax, "max. distance of an output vertex to a facet", -1);
    -  zdef_(wmin, Wvertexmin, "min. distance of an output vertex to a facet", -1);
    -  zdef_(wmin, Wmindenom, "min. denominator in hyperplane computation", -1);
    -
    -  qhstat precision= qhstat next;  /* call qh_precision for each of these */
    -  zzdef_(zdoc, Zdoc3, "precision problems (corrected unless 'Q0' or an error)", -1);
    -  zzdef_(zinc, Zcoplanarridges, "coplanar half ridges in output", -1);
    -  zzdef_(zinc, Zconcaveridges, "concave half ridges in output", -1);
    -  zzdef_(zinc, Zflippedfacets, "flipped facets", -1);
    -  zzdef_(zinc, Zcoplanarhorizon, "coplanar horizon facets for new vertices", -1);
    -  zzdef_(zinc, Zcoplanarpart, "coplanar points during partitioning", -1);
    -  zzdef_(zinc, Zminnorm, "degenerate hyperplanes recomputed with gaussian elimination", -1);
    -  zzdef_(zinc, Znearlysingular, "nearly singular or axis-parallel hyperplanes", -1);
    -  zzdef_(zinc, Zback0, "zero divisors during back substitute", -1);
    -  zzdef_(zinc, Zgauss0, "zero divisors during gaussian elimination", -1);
    -  zzdef_(zinc, Zmultiridge, "ridges with multiple neighbors", -1);
    -}
    -void qh_allstatB(void) {
    -  zzdef_(zdoc, Zdoc1, "summary information", -1);
    -  zdef_(zinc, Zvertices, "number of vertices in output", -1);
    -  zdef_(zinc, Znumfacets, "number of facets in output", -1);
    -  zdef_(zinc, Znonsimplicial, "number of non-simplicial facets in output", -1);
    -  zdef_(zinc, Znowsimplicial, "number of simplicial facets that were merged", -1);
    -  zdef_(zinc, Znumridges, "number of ridges in output", -1);
    -  zdef_(zadd, Znumridges, "average number of ridges per facet", Znumfacets);
    -  zdef_(zmax, Zmaxridges, "maximum number of ridges", -1);
    -  zdef_(zadd, Znumneighbors, "average number of neighbors per facet", Znumfacets);
    -  zdef_(zmax, Zmaxneighbors, "maximum number of neighbors", -1);
    -  zdef_(zadd, Znumvertices, "average number of vertices per facet", Znumfacets);
    -  zdef_(zmax, Zmaxvertices, "maximum number of vertices", -1);
    -  zdef_(zadd, Znumvneighbors, "average number of neighbors per vertex", Zvertices);
    -  zdef_(zmax, Zmaxvneighbors, "maximum number of neighbors", -1);
    -  zdef_(wadd, Wcpu, "cpu seconds for qhull after input", -1);
    -  zdef_(zinc, Ztotvertices, "vertices created altogether", -1);
    -  zzdef_(zinc, Zsetplane, "facets created altogether", -1);
    -  zdef_(zinc, Ztotridges, "ridges created altogether", -1);
    -  zdef_(zinc, Zpostfacets, "facets before post merge", -1);
    -  zdef_(zadd, Znummergetot, "average merges per facet(at most 511)", Znumfacets);
    -  zdef_(zmax, Znummergemax, "  maximum merges for a facet(at most 511)", -1);
    -  zdef_(zinc, Zangle, NULL, -1);
    -  zdef_(wadd, Wangle, "average angle(cosine) of facet normals for all ridges", Zangle);
    -  zdef_(wmax, Wanglemax, "  maximum angle(cosine) of facet normals across a ridge", -1);
    -  zdef_(wmin, Wanglemin, "  minimum angle(cosine) of facet normals across a ridge", -1);
    -  zdef_(wadd, Wareatot, "total area of facets", -1);
    -  zdef_(wmax, Wareamax, "  maximum facet area", -1);
    -  zdef_(wmin, Wareamin, "  minimum facet area", -1);
    -}
    -void qh_allstatC(void) {
    -  zdef_(zdoc, Zdoc9, "build hull statistics", -1);
    -  zzdef_(zinc, Zprocessed, "points processed", -1);
    -  zzdef_(zinc, Zretry, "retries due to precision problems", -1);
    -  zdef_(wmax, Wretrymax, "  max. random joggle", -1);
    -  zdef_(zmax, Zmaxvertex, "max. vertices at any one time", -1);
    -  zdef_(zinc, Ztotvisible, "ave. visible facets per iteration", Zprocessed);
    -  zdef_(zinc, Zinsidevisible, "  ave. visible facets without an horizon neighbor", Zprocessed);
    -  zdef_(zadd, Zvisfacettot,  "  ave. facets deleted per iteration", Zprocessed);
    -  zdef_(zmax, Zvisfacetmax,  "    maximum", -1);
    -  zdef_(zadd, Zvisvertextot, "ave. visible vertices per iteration", Zprocessed);
    -  zdef_(zmax, Zvisvertexmax, "    maximum", -1);
    -  zdef_(zinc, Ztothorizon, "ave. horizon facets per iteration", Zprocessed);
    -  zdef_(zadd, Znewfacettot,  "ave. new or merged facets per iteration", Zprocessed);
    -  zdef_(zmax, Znewfacetmax,  "    maximum(includes initial simplex)", -1);
    -  zdef_(wadd, Wnewbalance, "average new facet balance", Zprocessed);
    -  zdef_(wadd, Wnewbalance2, "  standard deviation", -1);
    -  zdef_(wadd, Wpbalance, "average partition balance", Zpbalance);
    -  zdef_(wadd, Wpbalance2, "  standard deviation", -1);
    -  zdef_(zinc, Zpbalance, "  number of trials", -1);
    -  zdef_(zinc, Zsearchpoints, "searches of all points for initial simplex", -1);
    -  zdef_(zinc, Zdetsimplex, "determinants computed(area & initial hull)", -1);
    -  zdef_(zinc, Znoarea, "determinants not computed because vertex too low", -1);
    -  zdef_(zinc, Znotmax, "points ignored(!above max_outside)", -1);
    -  zdef_(zinc, Znotgood, "points ignored(!above a good facet)", -1);
    -  zdef_(zinc, Znotgoodnew, "points ignored(didn't create a good new facet)", -1);
    -  zdef_(zinc, Zgoodfacet, "good facets found", -1);
    -  zzdef_(zinc, Znumvisibility, "distance tests for facet visibility", -1);
    -  zdef_(zinc, Zdistvertex, "distance tests to report minimum vertex", -1);
    -  zzdef_(zinc, Ztotcheck, "points checked for facets' outer planes", -1);
    -  zzdef_(zinc, Zcheckpart, "  ave. distance tests per check", Ztotcheck);
    -}
    -void qh_allstatD(void) {
    -  zdef_(zinc, Zvisit, "resets of visit_id", -1);
    -  zdef_(zinc, Zvvisit, "  resets of vertex_visit", -1);
    -  zdef_(zmax, Zvisit2max, "  max visit_id/2", -1);
    -  zdef_(zmax, Zvvisit2max, "  max vertex_visit/2", -1);
    -
    -  zdef_(zdoc, Zdoc4, "partitioning statistics(see previous for outer planes)", -1);
    -  zzdef_(zadd, Zdelvertextot, "total vertices deleted", -1);
    -  zdef_(zmax, Zdelvertexmax, "    maximum vertices deleted per iteration", -1);
    -  zdef_(zinc, Zfindbest, "calls to findbest", -1);
    -  zdef_(zadd, Zfindbesttot, " ave. facets tested", Zfindbest);
    -  zdef_(zmax, Zfindbestmax, " max. facets tested", -1);
    -  zdef_(zadd, Zfindcoplanar, " ave. coplanar search", Zfindbest);
    -  zdef_(zinc, Zfindnew, "calls to findbestnew", -1);
    -  zdef_(zadd, Zfindnewtot, " ave. facets tested", Zfindnew);
    -  zdef_(zmax, Zfindnewmax, " max. facets tested", -1);
    -  zdef_(zinc, Zfindnewjump, " ave. clearly better", Zfindnew);
    -  zdef_(zinc, Zfindnewsharp, " calls due to qh_sharpnewfacets", -1);
    -  zdef_(zinc, Zfindhorizon, "calls to findhorizon", -1);
    -  zdef_(zadd, Zfindhorizontot, " ave. facets tested", Zfindhorizon);
    -  zdef_(zmax, Zfindhorizonmax, " max. facets tested", -1);
    -  zdef_(zinc, Zfindjump,       " ave. clearly better", Zfindhorizon);
    -  zdef_(zinc, Zparthorizon, " horizon facets better than bestfacet", -1);
    -  zdef_(zinc, Zpartangle, "angle tests for repartitioned coplanar points", -1);
    -  zdef_(zinc, Zpartflip, "  repartitioned coplanar points for flipped orientation", -1);
    -}
    -void qh_allstatE(void) {
    -  zdef_(zinc, Zpartinside, "inside points", -1);
    -  zdef_(zinc, Zpartnear, "  inside points kept with a facet", -1);
    -  zdef_(zinc, Zcoplanarinside, "  inside points that were coplanar with a facet", -1);
    -  zdef_(zinc, Zbestlower, "calls to findbestlower", -1);
    -  zdef_(zinc, Zbestlowerv, "  with search of vertex neighbors", -1);
    -  zdef_(wadd, Wmaxout, "difference in max_outside at final check", -1);
    -  zzdef_(zinc, Zpartitionall, "distance tests for initial partition", -1);
    -  zdef_(zinc, Ztotpartition, "partitions of a point", -1);
    -  zzdef_(zinc, Zpartition, "distance tests for partitioning", -1);
    -  zzdef_(zinc, Zdistcheck, "distance tests for checking flipped facets", -1);
    -  zzdef_(zinc, Zdistconvex, "distance tests for checking convexity", -1);
    -  zdef_(zinc, Zdistgood, "distance tests for checking good point", -1);
    -  zdef_(zinc, Zdistio, "distance tests for output", -1);
    -  zdef_(zinc, Zdiststat, "distance tests for statistics", -1);
    -  zdef_(zinc, Zdistplane, "total number of distance tests", -1);
    -  zdef_(zinc, Ztotpartcoplanar, "partitions of coplanar points or deleted vertices", -1);
    -  zzdef_(zinc, Zpartcoplanar, "   distance tests for these partitions", -1);
    -  zdef_(zinc, Zcomputefurthest, "distance tests for computing furthest", -1);
    -}
    -void qh_allstatE2(void) {
    -  zdef_(zdoc, Zdoc5, "statistics for matching ridges", -1);
    -  zdef_(zinc, Zhashlookup, "total lookups for matching ridges of new facets", -1);
    -  zdef_(zinc, Zhashtests, "average number of tests to match a ridge", Zhashlookup);
    -  zdef_(zinc, Zhashridge, "total lookups of subridges(duplicates and boundary)", -1);
    -  zdef_(zinc, Zhashridgetest, "average number of tests per subridge", Zhashridge);
    -  zdef_(zinc, Zdupsame, "duplicated ridges in same merge cycle", -1);
    -  zdef_(zinc, Zdupflip, "duplicated ridges with flipped facets", -1);
    -
    -  zdef_(zdoc, Zdoc6, "statistics for determining merges", -1);
    -  zdef_(zinc, Zangletests, "angles computed for ridge convexity", -1);
    -  zdef_(zinc, Zbestcentrum, "best merges used centrum instead of vertices",-1);
    -  zzdef_(zinc, Zbestdist, "distance tests for best merge", -1);
    -  zzdef_(zinc, Zcentrumtests, "distance tests for centrum convexity", -1);
    -  zzdef_(zinc, Zdistzero, "distance tests for checking simplicial convexity", -1);
    -  zdef_(zinc, Zcoplanarangle, "coplanar angles in getmergeset", -1);
    -  zdef_(zinc, Zcoplanarcentrum, "coplanar centrums in getmergeset", -1);
    -  zdef_(zinc, Zconcaveridge, "concave ridges in getmergeset", -1);
    -}
    -void qh_allstatF(void) {
    -  zdef_(zdoc, Zdoc7, "statistics for merging", -1);
    -  zdef_(zinc, Zpremergetot, "merge iterations", -1);
    -  zdef_(zadd, Zmergeinittot, "ave. initial non-convex ridges per iteration", Zpremergetot);
    -  zdef_(zadd, Zmergeinitmax, "  maximum", -1);
    -  zdef_(zadd, Zmergesettot, "  ave. additional non-convex ridges per iteration", Zpremergetot);
    -  zdef_(zadd, Zmergesetmax, "  maximum additional in one pass", -1);
    -  zdef_(zadd, Zmergeinittot2, "initial non-convex ridges for post merging", -1);
    -  zdef_(zadd, Zmergesettot2, "  additional non-convex ridges", -1);
    -  zdef_(wmax, Wmaxoutside, "max distance of vertex or coplanar point above facet(w/roundoff)", -1);
    -  zdef_(wmin, Wminvertex, "max distance of merged vertex below facet(or roundoff)", -1);
    -  zdef_(zinc, Zwidefacet, "centrums frozen due to a wide merge", -1);
    -  zdef_(zinc, Zwidevertices, "centrums frozen due to extra vertices", -1);
    -  zzdef_(zinc, Ztotmerge, "total number of facets or cycles of facets merged", -1);
    -  zdef_(zinc, Zmergesimplex, "merged a simplex", -1);
    -  zdef_(zinc, Zonehorizon, "simplices merged into coplanar horizon", -1);
    -  zzdef_(zinc, Zcyclehorizon, "cycles of facets merged into coplanar horizon", -1);
    -  zzdef_(zadd, Zcyclefacettot, "  ave. facets per cycle", Zcyclehorizon);
    -  zdef_(zmax, Zcyclefacetmax, "  max. facets", -1);
    -  zdef_(zinc, Zmergeintohorizon, "new facets merged into horizon", -1);
    -  zdef_(zinc, Zmergenew, "new facets merged", -1);
    -  zdef_(zinc, Zmergehorizon, "horizon facets merged into new facets", -1);
    -  zdef_(zinc, Zmergevertex, "vertices deleted by merging", -1);
    -  zdef_(zinc, Zcyclevertex, "vertices deleted by merging into coplanar horizon", -1);
    -  zdef_(zinc, Zdegenvertex, "vertices deleted by degenerate facet", -1);
    -  zdef_(zinc, Zmergeflipdup, "merges due to flipped facets in duplicated ridge", -1);
    -  zdef_(zinc, Zneighbor, "merges due to redundant neighbors", -1);
    -  zdef_(zadd, Ztestvneighbor, "non-convex vertex neighbors", -1);
    -}
    -void qh_allstatG(void) {
    -  zdef_(zinc, Zacoplanar, "merges due to angle coplanar facets", -1);
    -  zdef_(wadd, Wacoplanartot, "  average merge distance", Zacoplanar);
    -  zdef_(wmax, Wacoplanarmax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zcoplanar, "merges due to coplanar facets", -1);
    -  zdef_(wadd, Wcoplanartot, "  average merge distance", Zcoplanar);
    -  zdef_(wmax, Wcoplanarmax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zconcave, "merges due to concave facets", -1);
    -  zdef_(wadd, Wconcavetot, "  average merge distance", Zconcave);
    -  zdef_(wmax, Wconcavemax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zavoidold, "coplanar/concave merges due to avoiding old merge", -1);
    -  zdef_(wadd, Wavoidoldtot, "  average merge distance", Zavoidold);
    -  zdef_(wmax, Wavoidoldmax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zdegen, "merges due to degenerate facets", -1);
    -  zdef_(wadd, Wdegentot, "  average merge distance", Zdegen);
    -  zdef_(wmax, Wdegenmax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zflipped, "merges due to removing flipped facets", -1);
    -  zdef_(wadd, Wflippedtot, "  average merge distance", Zflipped);
    -  zdef_(wmax, Wflippedmax, "  maximum merge distance", -1);
    -  zdef_(zinc, Zduplicate, "merges due to duplicated ridges", -1);
    -  zdef_(wadd, Wduplicatetot, "  average merge distance", Zduplicate);
    -  zdef_(wmax, Wduplicatemax, "  maximum merge distance", -1);
    -}
    -void qh_allstatH(void) {
    -  zdef_(zdoc, Zdoc8, "renamed vertex statistics", -1);
    -  zdef_(zinc, Zrenameshare, "renamed vertices shared by two facets", -1);
    -  zdef_(zinc, Zrenamepinch, "renamed vertices in a pinched facet", -1);
    -  zdef_(zinc, Zrenameall, "renamed vertices shared by multiple facets", -1);
    -  zdef_(zinc, Zfindfail, "rename failures due to duplicated ridges", -1);
    -  zdef_(zinc, Zdupridge, "  duplicate ridges detected", -1);
    -  zdef_(zinc, Zdelridge, "deleted ridges due to renamed vertices", -1);
    -  zdef_(zinc, Zdropneighbor, "dropped neighbors due to renamed vertices", -1);
    -  zdef_(zinc, Zdropdegen, "degenerate facets due to dropped neighbors", -1);
    -  zdef_(zinc, Zdelfacetdup, "  facets deleted because of no neighbors", -1);
    -  zdef_(zinc, Zremvertex, "vertices removed from facets due to no ridges", -1);
    -  zdef_(zinc, Zremvertexdel, "  deleted", -1);
    -  zdef_(zinc, Zintersectnum, "vertex intersections for locating redundant vertices", -1);
    -  zdef_(zinc, Zintersectfail, "intersections failed to find a redundant vertex", -1);
    -  zdef_(zinc, Zintersect, "intersections found redundant vertices", -1);
    -  zdef_(zadd, Zintersecttot, "   ave. number found per vertex", Zintersect);
    -  zdef_(zmax, Zintersectmax, "   max. found for a vertex", -1);
    -  zdef_(zinc, Zvertexridge, NULL, -1);
    -  zdef_(zadd, Zvertexridgetot, "  ave. number of ridges per tested vertex", Zvertexridge);
    -  zdef_(zmax, Zvertexridgemax, "  max. number of ridges per tested vertex", -1);
    -
    -  zdef_(zdoc, Zdoc10, "memory usage statistics(in bytes)", -1);
    -  zdef_(zadd, Zmemfacets, "for facets and their normals, neighbor and vertex sets", -1);
    -  zdef_(zadd, Zmemvertices, "for vertices and their neighbor sets", -1);
    -  zdef_(zadd, Zmempoints, "for input points and outside and coplanar sets",-1);
    -  zdef_(zadd, Zmemridges, "for ridges and their vertex sets", -1);
    -} /* allstat */
    -
    -void qh_allstatI(void) {
    -  qhstat vridges= qhstat next;
    -  zzdef_(zdoc, Zdoc11, "Voronoi ridge statistics", -1);
    -  zzdef_(zinc, Zridge, "non-simplicial Voronoi vertices for all ridges", -1);
    -  zzdef_(wadd, Wridge, "  ave. distance to ridge", Zridge);
    -  zzdef_(wmax, Wridgemax, "  max. distance to ridge", -1);
    -  zzdef_(zinc, Zridgemid, "bounded ridges", -1);
    -  zzdef_(wadd, Wridgemid, "  ave. distance of midpoint to ridge", Zridgemid);
    -  zzdef_(wmax, Wridgemidmax, "  max. distance of midpoint to ridge", -1);
    -  zzdef_(zinc, Zridgeok, "bounded ridges with ok normal", -1);
    -  zzdef_(wadd, Wridgeok, "  ave. angle to ridge", Zridgeok);
    -  zzdef_(wmax, Wridgeokmax, "  max. angle to ridge", -1);
    -  zzdef_(zinc, Zridge0, "bounded ridges with near-zero normal", -1);
    -  zzdef_(wadd, Wridge0, "  ave. angle to ridge", Zridge0);
    -  zzdef_(wmax, Wridge0max, "  max. angle to ridge", -1);
    -
    -  zdef_(zdoc, Zdoc12, "Triangulation statistics(Qt)", -1);
    -  zdef_(zinc, Ztricoplanar, "non-simplicial facets triangulated", -1);
    -  zdef_(zadd, Ztricoplanartot, "  ave. new facets created(may be deleted)", Ztricoplanar);
    -  zdef_(zmax, Ztricoplanarmax, "  max. new facets created", -1);
    -  zdef_(zinc, Ztrinull, "null new facets deleted(duplicated vertex)", -1);
    -  zdef_(zinc, Ztrimirror, "mirrored pairs of new facets deleted(same vertices)", -1);
    -  zdef_(zinc, Ztridegen, "degenerate new facets in output(same ridge)", -1);
    -} /* allstat */
    -
    -/*---------------------------------
    -
    -  qh_allstatistics()
    -    reset printed flag for all statistics
    -*/
    -void qh_allstatistics(void) {
    -  int i;
    -
    -  for(i=ZEND; i--; )
    -    qhstat printed[i]= False;
    -} /* allstatistics */
    -
    -#if qh_KEEPstatistics
    -/*---------------------------------
    -
    -  qh_collectstatistics()
    -    collect statistics for qh.facet_list
    -
    -*/
    -void qh_collectstatistics(void) {
    -  facetT *facet, *neighbor, **neighborp;
    -  vertexT *vertex, **vertexp;
    -  realT dotproduct, dist;
    -  int sizneighbors, sizridges, sizvertices, i;
    -
    -  qh old_randomdist= qh RANDOMdist;
    -  qh RANDOMdist= False;
    -  zval_(Zmempoints)= qh num_points * qh normal_size +
    -                             sizeof(qhT) + sizeof(qhstatT);
    -  zval_(Zmemfacets)= 0;
    -  zval_(Zmemridges)= 0;
    -  zval_(Zmemvertices)= 0;
    -  zval_(Zangle)= 0;
    -  wval_(Wangle)= 0.0;
    -  zval_(Znumridges)= 0;
    -  zval_(Znumfacets)= 0;
    -  zval_(Znumneighbors)= 0;
    -  zval_(Znumvertices)= 0;
    -  zval_(Znumvneighbors)= 0;
    -  zval_(Znummergetot)= 0;
    -  zval_(Znummergemax)= 0;
    -  zval_(Zvertices)= qh num_vertices - qh_setsize(qh del_vertices);
    -  if (qh MERGING || qh APPROXhull || qh JOGGLEmax < REALmax/2)
    -    wmax_(Wmaxoutside, qh max_outside);
    -  if (qh MERGING)
    -    wmin_(Wminvertex, qh min_vertex);
    -  FORALLfacets
    -    facet->seen= False;
    -  if (qh DELAUNAY) {
    -    FORALLfacets {
    -      if (facet->upperdelaunay != qh UPPERdelaunay)
    -        facet->seen= True; /* remove from angle statistics */
    -    }
    -  }
    -  FORALLfacets {
    -    if (facet->visible && qh NEWfacets)
    -      continue;
    -    sizvertices= qh_setsize(facet->vertices);
    -    sizneighbors= qh_setsize(facet->neighbors);
    -    sizridges= qh_setsize(facet->ridges);
    -    zinc_(Znumfacets);
    -    zadd_(Znumvertices, sizvertices);
    -    zmax_(Zmaxvertices, sizvertices);
    -    zadd_(Znumneighbors, sizneighbors);
    -    zmax_(Zmaxneighbors, sizneighbors);
    -    zadd_(Znummergetot, facet->nummerge);
    -    i= facet->nummerge; /* avoid warnings */
    -    zmax_(Znummergemax, i);
    -    if (!facet->simplicial) {
    -      if (sizvertices == qh hull_dim) {
    -        zinc_(Znowsimplicial);
    -      }else {
    -        zinc_(Znonsimplicial);
    -      }
    -    }
    -    if (sizridges) {
    -      zadd_(Znumridges, sizridges);
    -      zmax_(Zmaxridges, sizridges);
    -    }
    -    zadd_(Zmemfacets, sizeof(facetT) + qh normal_size + 2*sizeof(setT)
    -       + SETelemsize * (sizneighbors + sizvertices));
    -    if (facet->ridges) {
    -      zadd_(Zmemridges,
    -         sizeof(setT) + SETelemsize * sizridges + sizridges *
    -         (sizeof(ridgeT) + sizeof(setT) + SETelemsize * (qh hull_dim-1))/2);
    -    }
    -    if (facet->outsideset)
    -      zadd_(Zmempoints, sizeof(setT) + SETelemsize * qh_setsize(facet->outsideset));
    -    if (facet->coplanarset)
    -      zadd_(Zmempoints, sizeof(setT) + SETelemsize * qh_setsize(facet->coplanarset));
    -    if (facet->seen) /* Delaunay upper envelope */
    -      continue;
    -    facet->seen= True;
    -    FOREACHneighbor_(facet) {
    -      if (neighbor == qh_DUPLICATEridge || neighbor == qh_MERGEridge
    -          || neighbor->seen || !facet->normal || !neighbor->normal)
    -        continue;
    -      dotproduct= qh_getangle(facet->normal, neighbor->normal);
    -      zinc_(Zangle);
    -      wadd_(Wangle, dotproduct);
    -      wmax_(Wanglemax, dotproduct)
    -      wmin_(Wanglemin, dotproduct)
    -    }
    -    if (facet->normal) {
    -      FOREACHvertex_(facet->vertices) {
    -        zinc_(Zdiststat);
    -        qh_distplane(vertex->point, facet, &dist);
    -        wmax_(Wvertexmax, dist);
    -        wmin_(Wvertexmin, dist);
    -      }
    -    }
    -  }
    -  FORALLvertices {
    -    if (vertex->deleted)
    -      continue;
    -    zadd_(Zmemvertices, sizeof(vertexT));
    -    if (vertex->neighbors) {
    -      sizneighbors= qh_setsize(vertex->neighbors);
    -      zadd_(Znumvneighbors, sizneighbors);
    -      zmax_(Zmaxvneighbors, sizneighbors);
    -      zadd_(Zmemvertices, sizeof(vertexT) + SETelemsize * sizneighbors);
    -    }
    -  }
    -  qh RANDOMdist= qh old_randomdist;
    -} /* collectstatistics */
    -#endif /* qh_KEEPstatistics */
    -
    -/*---------------------------------
    -
    -  qh_freestatistics(  )
    -    free memory used for statistics
    -*/
    -void qh_freestatistics(void) {
    -
    -#if qh_QHpointer
    -  qh_free(qh_qhstat);
    -  qh_qhstat= NULL;
    -#endif
    -} /* freestatistics */
    -
    -/*---------------------------------
    -
    -  qh_initstatistics(  )
    -    allocate and initialize statistics
    -
    -  notes:
    -    uses qh_malloc() instead of qh_memalloc() since mem.c not set up yet
    -    NOerrors -- qh_initstatistics can not use qh_errexit().  One first call, qh_memalloc is not initialized.  Also invoked by QhullQh().
    -*/
    -void qh_initstatistics(void) {
    -  int i;
    -  realT realx;
    -  int intx;
    -
    -#if qh_QHpointer
    -  if(qh_qhstat){  /* qh_initstatistics may be called from Qhull::resetStatistics() */
    -      qh_free(qh_qhstat);
    -      qh_qhstat= 0;
    -  }
    -  if (!(qh_qhstat= (qhstatT *)qh_malloc(sizeof(qhstatT)))) {
    -    qh_fprintf(qhmem.ferr, 6183, "qhull error (qh_initstatistics): insufficient memory\n");
    -    qh_exit(qh_ERRmem);  /* can not use qh_errexit() */
    -  }
    -#endif
    -
    -  qhstat next= 0;
    -  qh_allstatA();
    -  qh_allstatB();
    -  qh_allstatC();
    -  qh_allstatD();
    -  qh_allstatE();
    -  qh_allstatE2();
    -  qh_allstatF();
    -  qh_allstatG();
    -  qh_allstatH();
    -  qh_allstatI();
    -  if (qhstat next > (int)sizeof(qhstat id)) {
    -    qh_fprintf(qhmem.ferr, 6184, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\
    -      qhstat.next %d should be <= sizeof(qhstat id) %d\n", qhstat next, (int)sizeof(qhstat id));
    -#if 0 /* for locating error, Znumridges should be duplicated */
    -    for(i=0; i < ZEND; i++) {
    -      int j;
    -      for(j=i+1; j < ZEND; j++) {
    -        if (qhstat id[i] == qhstat id[j]) {
    -          qh_fprintf(qhmem.ferr, 6185, "qhull error (qh_initstatistics): duplicated statistic %d at indices %d and %d\n",
    -              qhstat id[i], i, j);
    -        }
    -      }
    -    }
    -#endif
    -    qh_exit(qh_ERRqhull);  /* can not use qh_errexit() */
    -  }
    -  qhstat init[zinc].i= 0;
    -  qhstat init[zadd].i= 0;
    -  qhstat init[zmin].i= INT_MAX;
    -  qhstat init[zmax].i= INT_MIN;
    -  qhstat init[wadd].r= 0;
    -  qhstat init[wmin].r= REALmax;
    -  qhstat init[wmax].r= -REALmax;
    -  for(i=0; i < ZEND; i++) {
    -    if (qhstat type[i] > ZTYPEreal) {
    -      realx= qhstat init[(unsigned char)(qhstat type[i])].r;
    -      qhstat stats[i].r= realx;
    -    }else if (qhstat type[i] != zdoc) {
    -      intx= qhstat init[(unsigned char)(qhstat type[i])].i;
    -      qhstat stats[i].i= intx;
    -    }
    -  }
    -} /* initstatistics */
    -
    -/*---------------------------------
    -
    -  qh_newstats(  )
    -    returns True if statistics for zdoc
    -
    -  returns:
    -    next zdoc
    -*/
    -boolT qh_newstats(int idx, int *nextindex) {
    -  boolT isnew= False;
    -  int start, i;
    -
    -  if (qhstat type[qhstat id[idx]] == zdoc)
    -    start= idx+1;
    -  else
    -    start= idx;
    -  for(i= start; i < qhstat next && qhstat type[qhstat id[i]] != zdoc; i++) {
    -    if (!qh_nostatistic(qhstat id[i]) && !qhstat printed[qhstat id[i]])
    -        isnew= True;
    -  }
    -  *nextindex= i;
    -  return isnew;
    -} /* newstats */
    -
    -/*---------------------------------
    -
    -  qh_nostatistic( index )
    -    true if no statistic to print
    -*/
    -boolT qh_nostatistic(int i) {
    -
    -  if ((qhstat type[i] > ZTYPEreal
    -       &&qhstat stats[i].r == qhstat init[(unsigned char)(qhstat type[i])].r)
    -      || (qhstat type[i] < ZTYPEreal
    -          &&qhstat stats[i].i == qhstat init[(unsigned char)(qhstat type[i])].i))
    -    return True;
    -  return False;
    -} /* nostatistic */
    -
    -#if qh_KEEPstatistics
    -/*---------------------------------
    -
    -  qh_printallstatistics( fp, string )
    -    print all statistics with header 'string'
    -*/
    -void qh_printallstatistics(FILE *fp, const char *string) {
    -
    -  qh_allstatistics();
    -  qh_collectstatistics();
    -  qh_printstatistics(fp, string);
    -  qh_memstatistics(fp);
    -}
    -
    -
    -/*---------------------------------
    -
    -  qh_printstatistics( fp, string )
    -    print statistics to a file with header 'string'
    -    skips statistics with qhstat.printed[] (reset with qh_allstatistics)
    -
    -  see:
    -    qh_printallstatistics()
    -*/
    -void qh_printstatistics(FILE *fp, const char *string) {
    -  int i, k;
    -  realT ave;
    -
    -  if (qh num_points != qh num_vertices) {
    -    wval_(Wpbalance)= 0;
    -    wval_(Wpbalance2)= 0;
    -  }else
    -    wval_(Wpbalance2)= qh_stddev(zval_(Zpbalance), wval_(Wpbalance),
    -                                 wval_(Wpbalance2), &ave);
    -  wval_(Wnewbalance2)= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance),
    -                                 wval_(Wnewbalance2), &ave);
    -  qh_fprintf(fp, 9350, "\n\
    -%s\n\
    - qhull invoked by: %s | %s\n%s with options:\n%s\n", string, qh rbox_command,
    -     qh qhull_command, qh_version, qh qhull_options);
    -  qh_fprintf(fp, 9351, "\nprecision constants:\n\
    - %6.2g max. abs. coordinate in the (transformed) input('Qbd:n')\n\
    - %6.2g max. roundoff error for distance computation('En')\n\
    - %6.2g max. roundoff error for angle computations\n\
    - %6.2g min. distance for outside points ('Wn')\n\
    - %6.2g min. distance for visible facets ('Vn')\n\
    - %6.2g max. distance for coplanar facets ('Un')\n\
    - %6.2g max. facet width for recomputing centrum and area\n\
    -",
    -  qh MAXabs_coord, qh DISTround, qh ANGLEround, qh MINoutside,
    -        qh MINvisible, qh MAXcoplanar, qh WIDEfacet);
    -  if (qh KEEPnearinside)
    -    qh_fprintf(fp, 9352, "\
    - %6.2g max. distance for near-inside points\n", qh NEARinside);
    -  if (qh premerge_cos < REALmax/2) qh_fprintf(fp, 9353, "\
    - %6.2g max. cosine for pre-merge angle\n", qh premerge_cos);
    -  if (qh PREmerge) qh_fprintf(fp, 9354, "\
    - %6.2g radius of pre-merge centrum\n", qh premerge_centrum);
    -  if (qh postmerge_cos < REALmax/2) qh_fprintf(fp, 9355, "\
    - %6.2g max. cosine for post-merge angle\n", qh postmerge_cos);
    -  if (qh POSTmerge) qh_fprintf(fp, 9356, "\
    - %6.2g radius of post-merge centrum\n", qh postmerge_centrum);
    -  qh_fprintf(fp, 9357, "\
    - %6.2g max. distance for merging two simplicial facets\n\
    - %6.2g max. roundoff error for arithmetic operations\n\
    - %6.2g min. denominator for divisions\n\
    -  zero diagonal for Gauss: ", qh ONEmerge, REALepsilon, qh MINdenom);
    -  for(k=0; k < qh hull_dim; k++)
    -    qh_fprintf(fp, 9358, "%6.2e ", qh NEARzero[k]);
    -  qh_fprintf(fp, 9359, "\n\n");
    -  for(i=0 ; i < qhstat next; )
    -    qh_printstats(fp, i, &i);
    -} /* printstatistics */
    -#endif /* qh_KEEPstatistics */
    -
    -/*---------------------------------
    -
    -  qh_printstatlevel( fp, id )
    -    print level information for a statistic
    -
    -  notes:
    -    nop if id >= ZEND, printed, or same as initial value
    -*/
    -void qh_printstatlevel(FILE *fp, int id, int start) {
    -#define NULLfield "       "
    -
    -  if (id >= ZEND || qhstat printed[id])
    -    return;
    -  if (qhstat type[id] == zdoc) {
    -    qh_fprintf(fp, 9360, "%s\n", qhstat doc[id]);
    -    return;
    -  }
    -  start= 0; /* not used */
    -  if (qh_nostatistic(id) || !qhstat doc[id])
    -    return;
    -  qhstat printed[id]= True;
    -  if (qhstat count[id] != -1
    -      && qhstat stats[(unsigned char)(qhstat count[id])].i == 0)
    -    qh_fprintf(fp, 9361, " *0 cnt*");
    -  else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] == -1)
    -    qh_fprintf(fp, 9362, "%7.2g", qhstat stats[id].r);
    -  else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] != -1)
    -    qh_fprintf(fp, 9363, "%7.2g", qhstat stats[id].r/ qhstat stats[(unsigned char)(qhstat count[id])].i);
    -  else if (qhstat type[id] < ZTYPEreal && qhstat count[id] == -1)
    -    qh_fprintf(fp, 9364, "%7d", qhstat stats[id].i);
    -  else if (qhstat type[id] < ZTYPEreal && qhstat count[id] != -1)
    -    qh_fprintf(fp, 9365, "%7.3g", (realT) qhstat stats[id].i / qhstat stats[(unsigned char)(qhstat count[id])].i);
    -  qh_fprintf(fp, 9366, " %s\n", qhstat doc[id]);
    -} /* printstatlevel */
    -
    -
    -/*---------------------------------
    -
    -  qh_printstats( fp, index, nextindex )
    -    print statistics for a zdoc group
    -
    -  returns:
    -    next zdoc if non-null
    -*/
    -void qh_printstats(FILE *fp, int idx, int *nextindex) {
    -  int j, nexti;
    -
    -  if (qh_newstats(idx, &nexti)) {
    -    qh_fprintf(fp, 9367, "\n");
    -    for (j=idx; j--------------------------------
    -
    -  qh_stddev( num, tot, tot2, ave )
    -    compute the standard deviation and average from statistics
    -
    -    tot2 is the sum of the squares
    -  notes:
    -    computes r.m.s.:
    -      (x-ave)^2
    -      == x^2 - 2x tot/num +   (tot/num)^2
    -      == tot2 - 2 tot tot/num + tot tot/num
    -      == tot2 - tot ave
    -*/
    -realT qh_stddev(int num, realT tot, realT tot2, realT *ave) {
    -  realT stddev;
    -
    -  *ave= tot/num;
    -  stddev= sqrt(tot2/num - *ave * *ave);
    -  return stddev;
    -} /* stddev */
    -
    -#endif /* qh_KEEPstatistics */
    -
    -#if !qh_KEEPstatistics
    -void    qh_collectstatistics(void) {}
    -void    qh_printallstatistics(FILE *fp, char *string) {};
    -void    qh_printstatistics(FILE *fp, char *string) {}
    -#endif
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.h
    deleted file mode 100644
    index 97d8efa585..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/stat.h
    +++ /dev/null
    @@ -1,541 +0,0 @@
    -/*
      ---------------------------------
    -
    -   stat.h
    -     contains all statistics that are collected for qhull
    -
    -   see qh-stat.htm and stat.c
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/libqhull/stat.h#5 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -
    -   recompile qhull if you change this file
    -
    -   Integer statistics are Z* while real statistics are W*.
    -
    -   define maydebugx to call a routine at every statistic event
    -
    -*/
    -
    -#ifndef qhDEFstat
    -#define qhDEFstat 1
    -
    -#include "libqhull.h"
    -
    -/*---------------------------------
    -
    -  qh_KEEPstatistics
    -    0 turns off statistic gathering (except zzdef/zzinc/zzadd/zzval/wwval)
    -*/
    -#ifndef qh_KEEPstatistics
    -#define qh_KEEPstatistics 1
    -#endif
    -
    -/*---------------------------------
    -
    -  Zxxx for integers, Wxxx for reals
    -
    -  notes:
    -    be sure that all statistics are defined in stat.c
    -      otherwise initialization may core dump
    -    can pick up all statistics by:
    -      grep '[zw].*_[(][ZW]' *.c >z.x
    -    remove trailers with query">-
    -    remove leaders with  query-replace-regexp [ ^I]+  (
    -*/
    -#if qh_KEEPstatistics
    -enum statistics {     /* alphabetical after Z/W */
    -    Zacoplanar,
    -    Wacoplanarmax,
    -    Wacoplanartot,
    -    Zangle,
    -    Wangle,
    -    Wanglemax,
    -    Wanglemin,
    -    Zangletests,
    -    Wareatot,
    -    Wareamax,
    -    Wareamin,
    -    Zavoidold,
    -    Wavoidoldmax,
    -    Wavoidoldtot,
    -    Zback0,
    -    Zbestcentrum,
    -    Zbestdist,
    -    Zbestlower,
    -    Zbestlowerv,
    -    Zcentrumtests,
    -    Zcheckpart,
    -    Zcomputefurthest,
    -    Zconcave,
    -    Wconcavemax,
    -    Wconcavetot,
    -    Zconcaveridges,
    -    Zconcaveridge,
    -    Zcoplanar,
    -    Wcoplanarmax,
    -    Wcoplanartot,
    -    Zcoplanarangle,
    -    Zcoplanarcentrum,
    -    Zcoplanarhorizon,
    -    Zcoplanarinside,
    -    Zcoplanarpart,
    -    Zcoplanarridges,
    -    Wcpu,
    -    Zcyclefacetmax,
    -    Zcyclefacettot,
    -    Zcyclehorizon,
    -    Zcyclevertex,
    -    Zdegen,
    -    Wdegenmax,
    -    Wdegentot,
    -    Zdegenvertex,
    -    Zdelfacetdup,
    -    Zdelridge,
    -    Zdelvertextot,
    -    Zdelvertexmax,
    -    Zdetsimplex,
    -    Zdistcheck,
    -    Zdistconvex,
    -    Zdistgood,
    -    Zdistio,
    -    Zdistplane,
    -    Zdiststat,
    -    Zdistvertex,
    -    Zdistzero,
    -    Zdoc1,
    -    Zdoc2,
    -    Zdoc3,
    -    Zdoc4,
    -    Zdoc5,
    -    Zdoc6,
    -    Zdoc7,
    -    Zdoc8,
    -    Zdoc9,
    -    Zdoc10,
    -    Zdoc11,
    -    Zdoc12,
    -    Zdropdegen,
    -    Zdropneighbor,
    -    Zdupflip,
    -    Zduplicate,
    -    Wduplicatemax,
    -    Wduplicatetot,
    -    Zdupridge,
    -    Zdupsame,
    -    Zflipped,
    -    Wflippedmax,
    -    Wflippedtot,
    -    Zflippedfacets,
    -    Zfindbest,
    -    Zfindbestmax,
    -    Zfindbesttot,
    -    Zfindcoplanar,
    -    Zfindfail,
    -    Zfindhorizon,
    -    Zfindhorizonmax,
    -    Zfindhorizontot,
    -    Zfindjump,
    -    Zfindnew,
    -    Zfindnewmax,
    -    Zfindnewtot,
    -    Zfindnewjump,
    -    Zfindnewsharp,
    -    Zgauss0,
    -    Zgoodfacet,
    -    Zhashlookup,
    -    Zhashridge,
    -    Zhashridgetest,
    -    Zhashtests,
    -    Zinsidevisible,
    -    Zintersect,
    -    Zintersectfail,
    -    Zintersectmax,
    -    Zintersectnum,
    -    Zintersecttot,
    -    Zmaxneighbors,
    -    Wmaxout,
    -    Wmaxoutside,
    -    Zmaxridges,
    -    Zmaxvertex,
    -    Zmaxvertices,
    -    Zmaxvneighbors,
    -    Zmemfacets,
    -    Zmempoints,
    -    Zmemridges,
    -    Zmemvertices,
    -    Zmergeflipdup,
    -    Zmergehorizon,
    -    Zmergeinittot,
    -    Zmergeinitmax,
    -    Zmergeinittot2,
    -    Zmergeintohorizon,
    -    Zmergenew,
    -    Zmergesettot,
    -    Zmergesetmax,
    -    Zmergesettot2,
    -    Zmergesimplex,
    -    Zmergevertex,
    -    Wmindenom,
    -    Wminvertex,
    -    Zminnorm,
    -    Zmultiridge,
    -    Znearlysingular,
    -    Zneighbor,
    -    Wnewbalance,
    -    Wnewbalance2,
    -    Znewfacettot,
    -    Znewfacetmax,
    -    Znewvertex,
    -    Wnewvertex,
    -    Wnewvertexmax,
    -    Znoarea,
    -    Znonsimplicial,
    -    Znowsimplicial,
    -    Znotgood,
    -    Znotgoodnew,
    -    Znotmax,
    -    Znumfacets,
    -    Znummergemax,
    -    Znummergetot,
    -    Znumneighbors,
    -    Znumridges,
    -    Znumvertices,
    -    Znumvisibility,
    -    Znumvneighbors,
    -    Zonehorizon,
    -    Zpartangle,
    -    Zpartcoplanar,
    -    Zpartflip,
    -    Zparthorizon,
    -    Zpartinside,
    -    Zpartition,
    -    Zpartitionall,
    -    Zpartnear,
    -    Zpbalance,
    -    Wpbalance,
    -    Wpbalance2,
    -    Zpostfacets,
    -    Zpremergetot,
    -    Zprocessed,
    -    Zremvertex,
    -    Zremvertexdel,
    -    Zrenameall,
    -    Zrenamepinch,
    -    Zrenameshare,
    -    Zretry,
    -    Wretrymax,
    -    Zridge,
    -    Wridge,
    -    Wridgemax,
    -    Zridge0,
    -    Wridge0,
    -    Wridge0max,
    -    Zridgemid,
    -    Wridgemid,
    -    Wridgemidmax,
    -    Zridgeok,
    -    Wridgeok,
    -    Wridgeokmax,
    -    Zsearchpoints,
    -    Zsetplane,
    -    Ztestvneighbor,
    -    Ztotcheck,
    -    Ztothorizon,
    -    Ztotmerge,
    -    Ztotpartcoplanar,
    -    Ztotpartition,
    -    Ztotridges,
    -    Ztotvertices,
    -    Ztotvisible,
    -    Ztricoplanar,
    -    Ztricoplanarmax,
    -    Ztricoplanartot,
    -    Ztridegen,
    -    Ztrimirror,
    -    Ztrinull,
    -    Wvertexmax,
    -    Wvertexmin,
    -    Zvertexridge,
    -    Zvertexridgetot,
    -    Zvertexridgemax,
    -    Zvertices,
    -    Zvisfacettot,
    -    Zvisfacetmax,
    -    Zvisit,
    -    Zvisit2max,
    -    Zvisvertextot,
    -    Zvisvertexmax,
    -    Zvvisit,
    -    Zvvisit2max,
    -    Zwidefacet,
    -    Zwidevertices,
    -    ZEND};
    -
    -/*---------------------------------
    -
    -  Zxxx/Wxxx statistics that remain defined if qh_KEEPstatistics=0
    -
    -  notes:
    -    be sure to use zzdef, zzinc, etc. with these statistics (no double checking!)
    -*/
    -#else
    -enum statistics {     /* for zzdef etc. macros */
    -  Zback0,
    -  Zbestdist,
    -  Zcentrumtests,
    -  Zcheckpart,
    -  Zconcaveridges,
    -  Zcoplanarhorizon,
    -  Zcoplanarpart,
    -  Zcoplanarridges,
    -  Zcyclefacettot,
    -  Zcyclehorizon,
    -  Zdelvertextot,
    -  Zdistcheck,
    -  Zdistconvex,
    -  Zdistzero,
    -  Zdoc1,
    -  Zdoc2,
    -  Zdoc3,
    -  Zdoc11,
    -  Zflippedfacets,
    -  Zgauss0,
    -  Zminnorm,
    -  Zmultiridge,
    -  Znearlysingular,
    -  Wnewvertexmax,
    -  Znumvisibility,
    -  Zpartcoplanar,
    -  Zpartition,
    -  Zpartitionall,
    -  Zprocessed,
    -  Zretry,
    -  Zridge,
    -  Wridge,
    -  Wridgemax,
    -  Zridge0,
    -  Wridge0,
    -  Wridge0max,
    -  Zridgemid,
    -  Wridgemid,
    -  Wridgemidmax,
    -  Zridgeok,
    -  Wridgeok,
    -  Wridgeokmax,
    -  Zsetplane,
    -  Ztotcheck,
    -  Ztotmerge,
    -    ZEND};
    -#endif
    -
    -/*---------------------------------
    -
    -  ztype
    -    the type of a statistic sets its initial value.
    -
    -  notes:
    -    The type should be the same as the macro for collecting the statistic
    -*/
    -enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend};
    -
    -/*========== macros and constants =============*/
    -
    -/*----------------------------------
    -
    -  MAYdebugx
    -    define as maydebug() to be called frequently for error trapping
    -*/
    -#define MAYdebugx
    -
    -/*----------------------------------
    -
    -  zzdef_, zdef_( type, name, doc, -1)
    -    define a statistic (assumes 'qhstat.next= 0;')
    -
    -  zdef_( type, name, doc, count)
    -    define an averaged statistic
    -    printed as name/count
    -*/
    -#define zzdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
    -   qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
    -#if qh_KEEPstatistics
    -#define zdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
    -   qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
    -#else
    -#define zdef_(type,name,doc,count)
    -#endif
    -
    -/*----------------------------------
    -
    -  zzinc_( name ), zinc_( name)
    -    increment an integer statistic
    -*/
    -#define zzinc_(id) {MAYdebugx; qhstat stats[id].i++;}
    -#if qh_KEEPstatistics
    -#define zinc_(id) {MAYdebugx; qhstat stats[id].i++;}
    -#else
    -#define zinc_(id) {}
    -#endif
    -
    -/*----------------------------------
    -
    -  zzadd_( name, value ), zadd_( name, value ), wadd_( name, value )
    -    add value to an integer or real statistic
    -*/
    -#define zzadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
    -#define wwadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
    -#if qh_KEEPstatistics
    -#define zadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
    -#define wadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
    -#else
    -#define zadd_(id, val) {}
    -#define wadd_(id, val) {}
    -#endif
    -
    -/*----------------------------------
    -
    -  zzval_( name ), zval_( name ), wwval_( name )
    -    set or return value of a statistic
    -*/
    -#define zzval_(id) ((qhstat stats[id]).i)
    -#define wwval_(id) ((qhstat stats[id]).r)
    -#if qh_KEEPstatistics
    -#define zval_(id) ((qhstat stats[id]).i)
    -#define wval_(id) ((qhstat stats[id]).r)
    -#else
    -#define zval_(id) qhstat tempi
    -#define wval_(id) qhstat tempr
    -#endif
    -
    -/*----------------------------------
    -
    -  zmax_( id, val ), wmax_( id, value )
    -    maximize id with val
    -*/
    -#define wwmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
    -#if qh_KEEPstatistics
    -#define zmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].i,(val));}
    -#define wmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
    -#else
    -#define zmax_(id, val) {}
    -#define wmax_(id, val) {}
    -#endif
    -
    -/*----------------------------------
    -
    -  zmin_( id, val ), wmin_( id, value )
    -    minimize id with val
    -*/
    -#if qh_KEEPstatistics
    -#define zmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].i,(val));}
    -#define wmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].r,(val));}
    -#else
    -#define zmin_(id, val) {}
    -#define wmin_(id, val) {}
    -#endif
    -
    -/*================== stat.h types ==============*/
    -
    -
    -/*----------------------------------
    -
    -  intrealT
    -    union of integer and real, used for statistics
    -*/
    -typedef union intrealT intrealT;    /* union of int and realT */
    -union intrealT {
    -    int i;
    -    realT r;
    -};
    -
    -/*----------------------------------
    -
    -  qhstat
    -    global data structure for statistics, similar to qh and qhrbox
    -
    -  notes:
    -   access to qh_qhstat is via the "qhstat" macro.  There are two choices
    -   qh_QHpointer = 1     access globals via a pointer
    -                        enables qh_saveqhull() and qh_restoreqhull()
    -                = 0     qh_qhstat is a static data structure
    -                        only one instance of qhull() can be active at a time
    -                        default value
    -   qh_QHpointer is defined in libqhull.h
    -   qh_QHpointer_dllimport and qh_dllimport define qh_qh as __declspec(dllimport) [libqhull.h]
    -
    -   allocated in stat.c using qh_malloc()
    -*/
    -#ifndef DEFqhstatT
    -#define DEFqhstatT 1
    -typedef struct qhstatT qhstatT;
    -#endif
    -
    -#if qh_QHpointer_dllimport
    -#define qhstat qh_qhstat->
    -__declspec(dllimport) extern qhstatT *qh_qhstat;
    -#elif qh_QHpointer
    -#define qhstat qh_qhstat->
    -extern qhstatT *qh_qhstat;
    -#elif qh_dllimport
    -#define qhstat qh_qhstat.
    -__declspec(dllimport) extern qhstatT qh_qhstat;
    -#else
    -#define qhstat qh_qhstat.
    -extern qhstatT qh_qhstat;
    -#endif
    -struct qhstatT {
    -  intrealT   stats[ZEND];     /* integer and real statistics */
    -  unsigned   char id[ZEND+10]; /* id's in print order */
    -  const char *doc[ZEND];       /* array of documentation strings */
    -  short int  count[ZEND];     /* -1 if none, else index of count to use */
    -  char       type[ZEND];      /* type, see ztypes above */
    -  char       printed[ZEND];   /* true, if statistic has been printed */
    -  intrealT   init[ZTYPEend];  /* initial values by types, set initstatistics */
    -
    -  int        next;            /* next index for zdef_ */
    -  int        precision;       /* index for precision problems */
    -  int        vridges;         /* index for Voronoi ridges */
    -  int        tempi;
    -  realT      tempr;
    -};
    -
    -/*========== function prototypes ===========*/
    -
    -void    qh_allstatA(void);
    -void    qh_allstatB(void);
    -void    qh_allstatC(void);
    -void    qh_allstatD(void);
    -void    qh_allstatE(void);
    -void    qh_allstatE2(void);
    -void    qh_allstatF(void);
    -void    qh_allstatG(void);
    -void    qh_allstatH(void);
    -void    qh_allstatI(void);
    -void    qh_allstatistics(void);
    -void    qh_collectstatistics(void);
    -void    qh_freestatistics(void);
    -void    qh_initstatistics(void);
    -boolT   qh_newstats(int idx, int *nextindex);
    -boolT   qh_nostatistic(int i);
    -void    qh_printallstatistics(FILE *fp, const char *string);
    -void    qh_printstatistics(FILE *fp, const char *string);
    -void    qh_printstatlevel(FILE *fp, int id, int start);
    -void    qh_printstats(FILE *fp, int idx, int *nextindex);
    -realT   qh_stddev(int num, realT tot, realT tot2, realT *ave);
    -
    -#endif   /* qhDEFstat */
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.c
    deleted file mode 100644
    index 653c5a4ac4..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.c
    +++ /dev/null
    @@ -1,527 +0,0 @@
    -/*
      ---------------------------------
    -
    -   user.c
    -   user redefinable functions
    -
    -   see user2.c for qh_fprintf, qh_malloc, qh_free
    -
    -   see README.txt  see COPYING.txt for copyright information.
    -
    -   see libqhull.h for data structures, macros, and user-callable functions.
    -
    -   see user_eg.c, unix.c, and qhull_interface.cpp for examples.
    -
    -   see user.h for user-definable constants
    -
    -      use qh_NOmem in mem.h to turn off memory management
    -      use qh_NOmerge in user.h to turn off facet merging
    -      set qh_KEEPstatistics in user.h to 0 to turn off statistics
    -
    -   This is unsupported software.  You're welcome to make changes,
    -   but you're on your own if something goes wrong.  Use 'Tc' to
    -   check frequently.  Usually qhull will report an error if
    -   a data structure becomes inconsistent.  If so, it also reports
    -   the last point added to the hull, e.g., 102.  You can then trace
    -   the execution of qhull with "T4P102".
    -
    -   Please report any errors that you fix to qhull@qhull.org
    -
    -   call_qhull is a template for calling qhull from within your application
    -
    -   if you recompile and load this module, then user.o will not be loaded
    -   from qhull.a
    -
    -   you can add additional quick allocation sizes in qh_user_memsizes
    -
    -   if the other functions here are redefined to not use qh_print...,
    -   then io.o will not be loaded from qhull.a.  See user_eg.c for an
    -   example.  We recommend keeping io.o for the extra debugging
    -   information it supplies.
    -*/
    -
    -#include "qhull_a.h"
    -
    -#include 
    -
    -/*---------------------------------
    -
    -  qh_call_qhull( void )
    -    template for calling qhull from inside your program
    -    remove #if 0, #endif to compile
    -
    -  returns:
    -    exit code(see qh_ERR... in libqhull.h)
    -    all memory freed
    -
    -  notes:
    -    This can be called any number of times.
    -
    -  see:
    -    qh_call_qhull_once()
    -
    -*/
    -#if 0
    -{
    -  int dim;                  /* dimension of points */
    -  int numpoints;            /* number of points */
    -  coordT *points;           /* array of coordinates for each point */
    -  boolT ismalloc;           /* True if qhull should free points in qh_freeqhull() or reallocation */
    -  char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */
    -  FILE *outfile= stdout;    /* output from qh_produce_output()
    -                               use NULL to skip qh_produce_output() */
    -  FILE *errfile= stderr;    /* error messages from qhull code */
    -  int exitcode;             /* 0 if no error from qhull */
    -  facetT *facet;            /* set by FORALLfacets */
    -  int curlong, totlong;     /* memory remaining after qh_memfreeshort */
    -
    -#if qh_QHpointer  /* see user.h */
    -  if (qh_qh){
    -      printf ("QH6238: Qhull link error.  The global variable qh_qh was not initialized\n\
    -              to NULL by global.c.  Please compile this program with -Dqh_QHpointer_dllimport\n\
    -              as well as -Dqh_QHpointer, or use libqhullstatic, or use a different tool chain.\n\n");
    -      exit -1;
    -  }
    -#endif
    -
    -  /* initialize dim, numpoints, points[], ismalloc here */
    -  exitcode= qh_new_qhull(dim, numpoints, points, ismalloc,
    -                      flags, outfile, errfile);
    -  if (!exitcode) {                  /* if no error */
    -    /* 'qh facet_list' contains the convex hull */
    -    FORALLfacets {
    -       /* ... your code ... */
    -    }
    -  }
    -  qh_freeqhull(!qh_ALL);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    qh_fprintf(errfile, 7068, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong);
    -}
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_new_qhull( dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile )
    -    build new qhull data structure and return exitcode (0 if no errors)
    -
    -  notes:
    -    do not modify points until finished with results.
    -      The qhull data structure contains pointers into the points array.
    -    do not call qhull functions before qh_new_qhull().
    -      The qhull data structure is not initialized until qh_new_qhull().
    -
    -    outfile may be null
    -    qhull_cmd must start with "qhull "
    -    projects points to a new point array for Delaunay triangulations ('d' and 'v')
    -    transforms points into a new point array for halfspace intersection ('H')
    -
    -
    -  To allow multiple, concurrent calls to qhull()
    -    - set qh_QHpointer in user.h
    -    - use qh_save_qhull and qh_restore_qhull to swap the global data structure between calls.
    -    - use qh_freeqhull(qh_ALL) to free intermediate convex hulls
    -
    -  see:
    -    user_eg.c for an example
    -*/
    -int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc,
    -                char *qhull_cmd, FILE *outfile, FILE *errfile) {
    -  int exitcode, hulldim;
    -  boolT new_ismalloc;
    -  static boolT firstcall = True;
    -  coordT *new_points;
    -
    -  if (firstcall) {
    -    qh_meminit(errfile);
    -    firstcall= False;
    -  }
    -  if (strncmp(qhull_cmd,"qhull ", (size_t)6)) {
    -    qh_fprintf(errfile, 6186, "qhull error (qh_new_qhull): start qhull_cmd argument with \"qhull \"\n");
    -    qh_exit(qh_ERRinput);
    -  }
    -  qh_initqhull_start(NULL, outfile, errfile);
    -  trace1((qh ferr, 1044, "qh_new_qhull: build new Qhull for %d %d-d points with %s\n", numpoints, dim, qhull_cmd));
    -  exitcode = setjmp(qh errexit);
    -  if (!exitcode)
    -  {
    -    qh NOerrexit = False;
    -    qh_initflags(qhull_cmd);
    -    if (qh DELAUNAY)
    -      qh PROJECTdelaunay= True;
    -    if (qh HALFspace) {
    -      /* points is an array of halfspaces,
    -         the last coordinate of each halfspace is its offset */
    -      hulldim= dim-1;
    -      qh_setfeasible(hulldim);
    -      new_points= qh_sethalfspace_all(dim, numpoints, points, qh feasible_point);
    -      new_ismalloc= True;
    -      if (ismalloc)
    -        qh_free(points);
    -    }else {
    -      hulldim= dim;
    -      new_points= points;
    -      new_ismalloc= ismalloc;
    -    }
    -    qh_init_B(new_points, numpoints, hulldim, new_ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    if (outfile) {
    -      qh_produce_output();
    -    }else {
    -      qh_prepare_output();
    -    }
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -  }
    -  qh NOerrexit = True;
    -  return exitcode;
    -} /* new_qhull */
    -
    -/*---------------------------------
    -
    -  qh_errexit( exitcode, facet, ridge )
    -    report and exit from an error
    -    report facet and ridge if non-NULL
    -    reports useful information such as last point processed
    -    set qh.FORCEoutput to print neighborhood of facet
    -
    -  see:
    -    qh_errexit2() in libqhull.c for printing 2 facets
    -
    -  design:
    -    check for error within error processing
    -    compute qh.hulltime
    -    print facet and ridge (if any)
    -    report commandString, options, qh.furthest_id
    -    print summary and statistics (including precision statistics)
    -    if qh_ERRsingular
    -      print help text for singular data set
    -    exit program via long jump (if defined) or exit()
    -*/
    -void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) {
    -
    -  if (qh ERREXITcalled) {
    -    qh_fprintf(qh ferr, 8126, "\nqhull error while processing previous error.  Exit program\n");
    -    qh_exit(qh_ERRqhull);
    -  }
    -  qh ERREXITcalled= True;
    -  if (!qh QHULLfinished)
    -    qh hulltime= qh_CPUclock - qh hulltime;
    -  qh_errprint("ERRONEOUS", facet, NULL, ridge, NULL);
    -  qh_fprintf(qh ferr, 8127, "\nWhile executing: %s | %s\n", qh rbox_command, qh qhull_command);
    -  qh_fprintf(qh ferr, 8128, "Options selected for Qhull %s:\n%s\n", qh_version, qh qhull_options);
    -  if (qh furthest_id >= 0) {
    -    qh_fprintf(qh ferr, 8129, "Last point added to hull was p%d.", qh furthest_id);
    -    if (zzval_(Ztotmerge))
    -      qh_fprintf(qh ferr, 8130, "  Last merge was #%d.", zzval_(Ztotmerge));
    -    if (qh QHULLfinished)
    -      qh_fprintf(qh ferr, 8131, "\nQhull has finished constructing the hull.");
    -    else if (qh POSTmerging)
    -      qh_fprintf(qh ferr, 8132, "\nQhull has started post-merging.");
    -    qh_fprintf(qh ferr, 8133, "\n");
    -  }
    -  if (qh FORCEoutput && (qh QHULLfinished || (!facet && !ridge)))
    -    qh_produce_output();
    -  else if (exitcode != qh_ERRinput) {
    -    if (exitcode != qh_ERRsingular && zzval_(Zsetplane) > qh hull_dim+1) {
    -      qh_fprintf(qh ferr, 8134, "\nAt error exit:\n");
    -      qh_printsummary(qh ferr);
    -      if (qh PRINTstatistics) {
    -        qh_collectstatistics();
    -        qh_printstatistics(qh ferr, "at error exit");
    -        qh_memstatistics(qh ferr);
    -      }
    -    }
    -    if (qh PRINTprecision)
    -      qh_printstats(qh ferr, qhstat precision, NULL);
    -  }
    -  if (!exitcode)
    -    exitcode= qh_ERRqhull;
    -  else if (exitcode == qh_ERRsingular)
    -    qh_printhelp_singular(qh ferr);
    -  else if (exitcode == qh_ERRprec && !qh PREmerge)
    -    qh_printhelp_degenerate(qh ferr);
    -  if (qh NOerrexit) {
    -    qh_fprintf(qh ferr, 6187, "qhull error while ending program.  Exit program\n");
    -    qh_exit(qh_ERRqhull);
    -  }
    -  qh ERREXITcalled= False;
    -  qh NOerrexit= True;
    -  longjmp(qh errexit, exitcode);
    -} /* errexit */
    -
    -
    -/*---------------------------------
    -
    -  qh_errprint( fp, string, atfacet, otherfacet, atridge, atvertex )
    -    prints out the information of facets and ridges to fp
    -    also prints neighbors and geomview output
    -
    -  notes:
    -    except for string, any parameter may be NULL
    -*/
    -void qh_errprint(const char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex) {
    -  int i;
    -
    -  if (atfacet) {
    -    qh_fprintf(qh ferr, 8135, "%s FACET:\n", string);
    -    qh_printfacet(qh ferr, atfacet);
    -  }
    -  if (otherfacet) {
    -    qh_fprintf(qh ferr, 8136, "%s OTHER FACET:\n", string);
    -    qh_printfacet(qh ferr, otherfacet);
    -  }
    -  if (atridge) {
    -    qh_fprintf(qh ferr, 8137, "%s RIDGE:\n", string);
    -    qh_printridge(qh ferr, atridge);
    -    if (atridge->top && atridge->top != atfacet && atridge->top != otherfacet)
    -      qh_printfacet(qh ferr, atridge->top);
    -    if (atridge->bottom
    -        && atridge->bottom != atfacet && atridge->bottom != otherfacet)
    -      qh_printfacet(qh ferr, atridge->bottom);
    -    if (!atfacet)
    -      atfacet= atridge->top;
    -    if (!otherfacet)
    -      otherfacet= otherfacet_(atridge, atfacet);
    -  }
    -  if (atvertex) {
    -    qh_fprintf(qh ferr, 8138, "%s VERTEX:\n", string);
    -    qh_printvertex(qh ferr, atvertex);
    -  }
    -  if (qh fout && qh FORCEoutput && atfacet && !qh QHULLfinished && !qh IStracing) {
    -    qh_fprintf(qh ferr, 8139, "ERRONEOUS and NEIGHBORING FACETS to output\n");
    -    for (i=0; i < qh_PRINTEND; i++)  /* use fout for geomview output */
    -      qh_printneighborhood(qh fout, qh PRINTout[i], atfacet, otherfacet,
    -                            !qh_ALL);
    -  }
    -} /* errprint */
    -
    -
    -/*---------------------------------
    -
    -  qh_printfacetlist( fp, facetlist, facets, printall )
    -    print all fields for a facet list and/or set of facets to fp
    -    if !printall,
    -      only prints good facets
    -
    -  notes:
    -    also prints all vertices
    -*/
    -void qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall) {
    -  facetT *facet, **facetp;
    -
    -  qh_printbegin(qh ferr, qh_PRINTfacets, facetlist, facets, printall);
    -  FORALLfacet_(facetlist)
    -    qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
    -  FOREACHfacet_(facets)
    -    qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
    -  qh_printend(qh ferr, qh_PRINTfacets, facetlist, facets, printall);
    -} /* printfacetlist */
    -
    -
    -/*---------------------------------
    -
    -  qh_printhelp_degenerate( fp )
    -    prints descriptive message for precision error
    -
    -  notes:
    -    no message if qh_QUICKhelp
    -*/
    -void qh_printhelp_degenerate(FILE *fp) {
    -
    -  if (qh MERGEexact || qh PREmerge || qh JOGGLEmax < REALmax/2)
    -    qh_fprintf(fp, 9368, "\n\
    -A Qhull error has occurred.  Qhull should have corrected the above\n\
    -precision error.  Please send the input and all of the output to\n\
    -qhull_bug@qhull.org\n");
    -  else if (!qh_QUICKhelp) {
    -    qh_fprintf(fp, 9369, "\n\
    -Precision problems were detected during construction of the convex hull.\n\
    -This occurs because convex hull algorithms assume that calculations are\n\
    -exact, but floating-point arithmetic has roundoff errors.\n\
    -\n\
    -To correct for precision problems, do not use 'Q0'.  By default, Qhull\n\
    -selects 'C-0' or 'Qx' and merges non-convex facets.  With option 'QJ',\n\
    -Qhull joggles the input to prevent precision problems.  See \"Imprecision\n\
    -in Qhull\" (qh-impre.htm).\n\
    -\n\
    -If you use 'Q0', the output may include\n\
    -coplanar ridges, concave ridges, and flipped facets.  In 4-d and higher,\n\
    -Qhull may produce a ridge with four neighbors or two facets with the same \n\
    -vertices.  Qhull reports these events when they occur.  It stops when a\n\
    -concave ridge, flipped facet, or duplicate facet occurs.\n");
    -#if REALfloat
    -    qh_fprintf(fp, 9370, "\
    -\n\
    -Qhull is currently using single precision arithmetic.  The following\n\
    -will probably remove the precision problems:\n\
    -  - recompile qhull for realT precision(#define REALfloat 0 in user.h).\n");
    -#endif
    -    if (qh DELAUNAY && !qh SCALElast && qh MAXabs_coord > 1e4)
    -      qh_fprintf(fp, 9371, "\
    -\n\
    -When computing the Delaunay triangulation of coordinates > 1.0,\n\
    -  - use 'Qbb' to scale the last coordinate to [0,m] (max previous coordinate)\n");
    -    if (qh DELAUNAY && !qh ATinfinity)
    -      qh_fprintf(fp, 9372, "\
    -When computing the Delaunay triangulation:\n\
    -  - use 'Qz' to add a point at-infinity.  This reduces precision problems.\n");
    -
    -    qh_fprintf(fp, 9373, "\
    -\n\
    -If you need triangular output:\n\
    -  - use option 'Qt' to triangulate the output\n\
    -  - use option 'QJ' to joggle the input points and remove precision errors\n\
    -  - use option 'Ft'.  It triangulates non-simplicial facets with added points.\n\
    -\n\
    -If you must use 'Q0',\n\
    -try one or more of the following options.  They can not guarantee an output.\n\
    -  - use 'QbB' to scale the input to a cube.\n\
    -  - use 'Po' to produce output and prevent partitioning for flipped facets\n\
    -  - use 'V0' to set min. distance to visible facet as 0 instead of roundoff\n\
    -  - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
    -  - options 'Qf', 'Qbb', and 'QR0' may also help\n",
    -               qh DISTround);
    -    qh_fprintf(fp, 9374, "\
    -\n\
    -To guarantee simplicial output:\n\
    -  - use option 'Qt' to triangulate the output\n\
    -  - use option 'QJ' to joggle the input points and remove precision errors\n\
    -  - use option 'Ft' to triangulate the output by adding points\n\
    -  - use exact arithmetic (see \"Imprecision in Qhull\", qh-impre.htm)\n\
    -");
    -  }
    -} /* printhelp_degenerate */
    -
    -
    -/*---------------------------------
    -
    -  qh_printhelp_narrowhull( minangle )
    -    Warn about a narrow hull
    -
    -  notes:
    -    Alternatively, reduce qh_WARNnarrow in user.h
    -
    -*/
    -void qh_printhelp_narrowhull(FILE *fp, realT minangle) {
    -
    -    qh_fprintf(fp, 9375, "qhull precision warning: \n\
    -The initial hull is narrow (cosine of min. angle is %.16f).\n\
    -Is the input lower dimensional (e.g., on a plane in 3-d)?  Qhull may\n\
    -produce a wide facet.  Options 'QbB' (scale to unit box) or 'Qbb' (scale\n\
    -last coordinate) may remove this warning.  Use 'Pp' to skip this warning.\n\
    -See 'Limitations' in qh-impre.htm.\n",
    -          -minangle);   /* convert from angle between normals to angle between facets */
    -} /* printhelp_narrowhull */
    -
    -/*---------------------------------
    -
    -  qh_printhelp_singular( fp )
    -    prints descriptive message for singular input
    -*/
    -void qh_printhelp_singular(FILE *fp) {
    -  facetT *facet;
    -  vertexT *vertex, **vertexp;
    -  realT min, max, *coord, dist;
    -  int i,k;
    -
    -  qh_fprintf(fp, 9376, "\n\
    -The input to qhull appears to be less than %d dimensional, or a\n\
    -computation has overflowed.\n\n\
    -Qhull could not construct a clearly convex simplex from points:\n",
    -           qh hull_dim);
    -  qh_printvertexlist(fp, "", qh facet_list, NULL, qh_ALL);
    -  if (!qh_QUICKhelp)
    -    qh_fprintf(fp, 9377, "\n\
    -The center point is coplanar with a facet, or a vertex is coplanar\n\
    -with a neighboring facet.  The maximum round off error for\n\
    -computing distances is %2.2g.  The center point, facets and distances\n\
    -to the center point are as follows:\n\n", qh DISTround);
    -  qh_printpointid(fp, "center point", qh hull_dim, qh interior_point, -1);
    -  qh_fprintf(fp, 9378, "\n");
    -  FORALLfacets {
    -    qh_fprintf(fp, 9379, "facet");
    -    FOREACHvertex_(facet->vertices)
    -      qh_fprintf(fp, 9380, " p%d", qh_pointid(vertex->point));
    -    zinc_(Zdistio);
    -    qh_distplane(qh interior_point, facet, &dist);
    -    qh_fprintf(fp, 9381, " distance= %4.2g\n", dist);
    -  }
    -  if (!qh_QUICKhelp) {
    -    if (qh HALFspace)
    -      qh_fprintf(fp, 9382, "\n\
    -These points are the dual of the given halfspaces.  They indicate that\n\
    -the intersection is degenerate.\n");
    -    qh_fprintf(fp, 9383,"\n\
    -These points either have a maximum or minimum x-coordinate, or\n\
    -they maximize the determinant for k coordinates.  Trial points\n\
    -are first selected from points that maximize a coordinate.\n");
    -    if (qh hull_dim >= qh_INITIALmax)
    -      qh_fprintf(fp, 9384, "\n\
    -Because of the high dimension, the min x-coordinate and max-coordinate\n\
    -points are used if the determinant is non-zero.  Option 'Qs' will\n\
    -do a better, though much slower, job.  Instead of 'Qs', you can change\n\
    -the points by randomly rotating the input with 'QR0'.\n");
    -  }
    -  qh_fprintf(fp, 9385, "\nThe min and max coordinates for each dimension are:\n");
    -  for (k=0; k < qh hull_dim; k++) {
    -    min= REALmax;
    -    max= -REALmin;
    -    for (i=qh num_points, coord= qh first_point+k; i--; coord += qh hull_dim) {
    -      maximize_(max, *coord);
    -      minimize_(min, *coord);
    -    }
    -    qh_fprintf(fp, 9386, "  %d:  %8.4g  %8.4g  difference= %4.4g\n", k, min, max, max-min);
    -  }
    -  if (!qh_QUICKhelp) {
    -    qh_fprintf(fp, 9387, "\n\
    -If the input should be full dimensional, you have several options that\n\
    -may determine an initial simplex:\n\
    -  - use 'QJ'  to joggle the input and make it full dimensional\n\
    -  - use 'QbB' to scale the points to the unit cube\n\
    -  - use 'QR0' to randomly rotate the input for different maximum points\n\
    -  - use 'Qs'  to search all points for the initial simplex\n\
    -  - use 'En'  to specify a maximum roundoff error less than %2.2g.\n\
    -  - trace execution with 'T3' to see the determinant for each point.\n",
    -                     qh DISTround);
    -#if REALfloat
    -    qh_fprintf(fp, 9388, "\
    -  - recompile qhull for realT precision(#define REALfloat 0 in libqhull.h).\n");
    -#endif
    -    qh_fprintf(fp, 9389, "\n\
    -If the input is lower dimensional:\n\
    -  - use 'QJ' to joggle the input and make it full dimensional\n\
    -  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should\n\
    -    pick the coordinate with the least range.  The hull will have the\n\
    -    correct topology.\n\
    -  - determine the flat containing the points, rotate the points\n\
    -    into a coordinate plane, and delete the other coordinates.\n\
    -  - add one or more points to make the input full dimensional.\n\
    -");
    -  }
    -} /* printhelp_singular */
    -
    -/*---------------------------------
    -
    -  qh_user_memsizes()
    -    allocate up to 10 additional, quick allocation sizes
    -
    -  notes:
    -    increase maximum number of allocations in qh_initqhull_mem()
    -*/
    -void qh_user_memsizes(void) {
    -
    -  /* qh_memsize(size); */
    -} /* user_memsizes */
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.h
    deleted file mode 100644
    index a3322aa07b..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/user.h
    +++ /dev/null
    @@ -1,858 +0,0 @@
    -/*
      ---------------------------------
    -
    -   user.h
    -   user redefinable constants
    -
    -   see qh-user.htm.  see COPYING for copyright information.
    -
    -   before reading any code, review libqhull.h for data structure definitions and
    -   the "qh" macro.
    -
    -Sections:
    -   ============= qhull library constants ======================
    -   ============= data types and configuration macros ==========
    -   ============= performance related constants ================
    -   ============= memory constants =============================
    -   ============= joggle constants =============================
    -   ============= conditional compilation ======================
    -   ============= -merge constants- ============================
    -
    -Code flags --
    -  NOerrors -- the code does not call qh_errexit()
    -  WARN64 -- the code may be incompatible with 64-bit pointers
    -
    -*/
    -
    -#include 
    -
    -#ifndef qhDEFuser
    -#define qhDEFuser 1
    -
    -/*============================================================*/
    -/*============= qhull library constants ======================*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -  FILENAMElen -- max length for TI and TO filenames
    -
    -*/
    -
    -#define qh_FILENAMElen 500
    -
    -/*----------------------------------
    -
    -  msgcode -- Unique message codes for qh_fprintf
    -
    -  If add new messages, assign these values and increment.
    -
    -  def counters =  [27, 1047, 2059, 3025, 4068, 5003,
    -     6241, 7079, 8143, 9410, 10000, 11026]
    -
    -  See: qh_ERR* [libqhull.h]
    -*/
    -
    -#define MSG_TRACE0 0
    -#define MSG_TRACE1 1000
    -#define MSG_TRACE2 2000
    -#define MSG_TRACE3 3000
    -#define MSG_TRACE4 4000
    -#define MSG_TRACE5 5000
    -#define MSG_ERROR  6000   /* errors written to qh.ferr */
    -#define MSG_WARNING 7000
    -#define MSG_STDERR  8000  /* log messages Written to qh.ferr */
    -#define MSG_OUTPUT  9000
    -#define MSG_QHULL_ERROR 10000 /* errors thrown by QhullError [QhullError.h] */
    -#define MSG_FIXUP  11000  /* FIXUP QH11... */
    -#define MSG_MAXLEN  3000 /* qh_printhelp_degenerate() in user.c */
    -
    -
    -/*----------------------------------
    -
    -  qh_OPTIONline -- max length of an option line 'FO'
    -*/
    -#define qh_OPTIONline 80
    -
    -/*============================================================*/
    -/*============= data types and configuration macros ==========*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -  realT
    -    set the size of floating point numbers
    -
    -  qh_REALdigits
    -    maximimum number of significant digits
    -
    -  qh_REAL_1, qh_REAL_2n, qh_REAL_3n
    -    format strings for printf
    -
    -  qh_REALmax, qh_REALmin
    -    maximum and minimum (near zero) values
    -
    -  qh_REALepsilon
    -    machine roundoff.  Maximum roundoff error for addition and multiplication.
    -
    -  notes:
    -   Select whether to store floating point numbers in single precision (float)
    -   or double precision (double).
    -
    -   Use 'float' to save about 8% in time and 25% in space.  This is particularly
    -   helpful if high-d where convex hulls are space limited.  Using 'float' also
    -   reduces the printed size of Qhull's output since numbers have 8 digits of
    -   precision.
    -
    -   Use 'double' when greater arithmetic precision is needed.  This is needed
    -   for Delaunay triangulations and Voronoi diagrams when you are not merging
    -   facets.
    -
    -   If 'double' gives insufficient precision, your data probably includes
    -   degeneracies.  If so you should use facet merging (done by default)
    -   or exact arithmetic (see imprecision section of manual, qh-impre.htm).
    -   You may also use option 'Po' to force output despite precision errors.
    -
    -   You may use 'long double', but many format statements need to be changed
    -   and you may need a 'long double' square root routine.  S. Grundmann
    -   (sg@eeiwzb.et.tu-dresden.de) has done this.  He reports that the code runs
    -   much slower with little gain in precision.
    -
    -   WARNING: on some machines,    int f(){realT a= REALmax;return (a == REALmax);}
    -      returns False.  Use (a > REALmax/2) instead of (a == REALmax).
    -
    -   REALfloat =   1      all numbers are 'float' type
    -             =   0      all numbers are 'double' type
    -*/
    -#define REALfloat 0
    -
    -#if (REALfloat == 1)
    -#define realT float
    -#define REALmax FLT_MAX
    -#define REALmin FLT_MIN
    -#define REALepsilon FLT_EPSILON
    -#define qh_REALdigits 8   /* maximum number of significant digits */
    -#define qh_REAL_1 "%6.8g "
    -#define qh_REAL_2n "%6.8g %6.8g\n"
    -#define qh_REAL_3n "%6.8g %6.8g %6.8g\n"
    -
    -#elif (REALfloat == 0)
    -#define realT double
    -#define REALmax DBL_MAX
    -#define REALmin DBL_MIN
    -#define REALepsilon DBL_EPSILON
    -#define qh_REALdigits 16    /* maximum number of significant digits */
    -#define qh_REAL_1 "%6.16g "
    -#define qh_REAL_2n "%6.16g %6.16g\n"
    -#define qh_REAL_3n "%6.16g %6.16g %6.16g\n"
    -
    -#else
    -#error unknown float option
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_CPUclock
    -    define the clock() function for reporting the total time spent by Qhull
    -    returns CPU ticks as a 'long int'
    -    qh_CPUclock is only used for reporting the total time spent by Qhull
    -
    -  qh_SECticks
    -    the number of clock ticks per second
    -
    -  notes:
    -    looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds
    -    to define a custom clock, set qh_CLOCKtype to 0
    -
    -    if your system does not use clock() to return CPU ticks, replace
    -    qh_CPUclock with the corresponding function.  It is converted
    -    to 'unsigned long' to prevent wrap-around during long runs.  By default,
    -     defines clock_t as 'long'
    -
    -   Set qh_CLOCKtype to
    -
    -     1          for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond
    -                Note:  may fail if more than 1 hour elapsed time
    -
    -     2          use qh_clock() with POSIX times() (see global.c)
    -*/
    -#define qh_CLOCKtype 1  /* change to the desired number */
    -
    -#if (qh_CLOCKtype == 1)
    -
    -#if defined(CLOCKS_PER_SECOND)
    -#define qh_CPUclock    ((unsigned long)clock())  /* return CPU clock */
    -#define qh_SECticks CLOCKS_PER_SECOND
    -
    -#elif defined(CLOCKS_PER_SEC)
    -#define qh_CPUclock    ((unsigned long)clock())  /* return CPU clock */
    -#define qh_SECticks CLOCKS_PER_SEC
    -
    -#elif defined(CLK_TCK)
    -#define qh_CPUclock    ((unsigned long)clock())  /* return CPU clock */
    -#define qh_SECticks CLK_TCK
    -
    -#else
    -#define qh_CPUclock    ((unsigned long)clock())  /* return CPU clock */
    -#define qh_SECticks 1E6
    -#endif
    -
    -#elif (qh_CLOCKtype == 2)
    -#define qh_CPUclock    qh_clock()  /* return CPU clock */
    -#define qh_SECticks 100
    -
    -#else /* qh_CLOCKtype == ? */
    -#error unknown clock option
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed
    -    define random number generator
    -
    -    qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax.
    -    qh_RANDOMseed sets the random number seed for qh_RANDOMint
    -
    -  Set qh_RANDOMtype (default 5) to:
    -    1       for random() with 31 bits (UCB)
    -    2       for rand() with RAND_MAX or 15 bits (system 5)
    -    3       for rand() with 31 bits (Sun)
    -    4       for lrand48() with 31 bits (Solaris)
    -    5       for qh_rand() with 31 bits (included with Qhull)
    -
    -  notes:
    -    Random numbers are used by rbox to generate point sets.  Random
    -    numbers are used by Qhull to rotate the input ('QRn' option),
    -    simulate a randomized algorithm ('Qr' option), and to simulate
    -    roundoff errors ('Rn' option).
    -
    -    Random number generators differ between systems.  Most systems provide
    -    rand() but the period varies.  The period of rand() is not critical
    -    since qhull does not normally use random numbers.
    -
    -    The default generator is Park & Miller's minimal standard random
    -    number generator [CACM 31:1195 '88].  It is included with Qhull.
    -
    -    If qh_RANDOMmax is wrong, qhull will report a warning and Geomview
    -    output will likely be invisible.
    -*/
    -#define qh_RANDOMtype 5   /* *** change to the desired number *** */
    -
    -#if (qh_RANDOMtype == 1)
    -#define qh_RANDOMmax ((realT)0x7fffffffUL)  /* 31 bits, random()/MAX */
    -#define qh_RANDOMint random()
    -#define qh_RANDOMseed_(seed) srandom(seed);
    -
    -#elif (qh_RANDOMtype == 2)
    -#ifdef RAND_MAX
    -#define qh_RANDOMmax ((realT)RAND_MAX)
    -#else
    -#define qh_RANDOMmax ((realT)32767)   /* 15 bits (System 5) */
    -#endif
    -#define qh_RANDOMint  rand()
    -#define qh_RANDOMseed_(seed) srand((unsigned)seed);
    -
    -#elif (qh_RANDOMtype == 3)
    -#define qh_RANDOMmax ((realT)0x7fffffffUL)  /* 31 bits, Sun */
    -#define qh_RANDOMint  rand()
    -#define qh_RANDOMseed_(seed) srand((unsigned)seed);
    -
    -#elif (qh_RANDOMtype == 4)
    -#define qh_RANDOMmax ((realT)0x7fffffffUL)  /* 31 bits, lrand38()/MAX */
    -#define qh_RANDOMint lrand48()
    -#define qh_RANDOMseed_(seed) srand48(seed);
    -
    -#elif (qh_RANDOMtype == 5)
    -#define qh_RANDOMmax ((realT)2147483646UL)  /* 31 bits, qh_rand/MAX */
    -#define qh_RANDOMint qh_rand()
    -#define qh_RANDOMseed_(seed) qh_srand(seed);
    -/* unlike rand(), never returns 0 */
    -
    -#else
    -#error: unknown random option
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_ORIENTclock
    -    0 for inward pointing normals by Geomview convention
    -*/
    -#define qh_ORIENTclock 0
    -
    -
    -/*============================================================*/
    -/*============= joggle constants =============================*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -qh_JOGGLEdefault
    -default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault
    -
    -notes:
    -rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16
    -rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
    -rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
    -rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
    -rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
    -rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
    -rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
    -rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
    -rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
    -the later have about 20 points per facet, each of which may interfere
    -
    -pick a value large enough to avoid retries on most inputs
    -*/
    -#define qh_JOGGLEdefault 30000.0
    -
    -/*----------------------------------
    -
    -qh_JOGGLEincrease
    -factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain
    -*/
    -#define qh_JOGGLEincrease 10.0
    -
    -/*----------------------------------
    -
    -qh_JOGGLEretry
    -if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax
    -
    -notes:
    -try twice at the original value in case of bad luck the first time
    -*/
    -#define qh_JOGGLEretry 2
    -
    -/*----------------------------------
    -
    -qh_JOGGLEagain
    -every following qh_JOGGLEagain, increase qh.JOGGLEmax
    -
    -notes:
    -1 is OK since it's already failed qh_JOGGLEretry times
    -*/
    -#define qh_JOGGLEagain 1
    -
    -/*----------------------------------
    -
    -qh_JOGGLEmaxincrease
    -maximum qh.JOGGLEmax due to qh_JOGGLEincrease
    -relative to qh.MAXwidth
    -
    -notes:
    -qh.joggleinput will retry at this value until qh_JOGGLEmaxretry
    -*/
    -#define qh_JOGGLEmaxincrease 1e-2
    -
    -/*----------------------------------
    -
    -qh_JOGGLEmaxretry
    -stop after qh_JOGGLEmaxretry attempts
    -*/
    -#define qh_JOGGLEmaxretry 100
    -
    -/*============================================================*/
    -/*============= performance related constants ================*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -  qh_HASHfactor
    -    total hash slots / used hash slots.  Must be at least 1.1.
    -
    -  notes:
    -    =2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy
    -*/
    -#define qh_HASHfactor 2
    -
    -/*----------------------------------
    -
    -  qh_VERIFYdirect
    -    with 'Tv' verify all points against all facets if op count is smaller
    -
    -  notes:
    -    if greater, calls qh_check_bestdist() instead
    -*/
    -#define qh_VERIFYdirect 1000000
    -
    -/*----------------------------------
    -
    -  qh_INITIALsearch
    -     if qh_INITIALmax, search points up to this dimension
    -*/
    -#define qh_INITIALsearch 6
    -
    -/*----------------------------------
    -
    -  qh_INITIALmax
    -    if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex
    -
    -  notes:
    -    from points with non-zero determinants
    -    use option 'Qs' to override (much slower)
    -*/
    -#define qh_INITIALmax 8
    -
    -/*============================================================*/
    -/*============= memory constants =============================*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -  qh_MEMalign
    -    memory alignment for qh_meminitbuffers() in global.c
    -
    -  notes:
    -    to avoid bus errors, memory allocation must consider alignment requirements.
    -    malloc() automatically takes care of alignment.   Since mem.c manages
    -    its own memory, we need to explicitly specify alignment in
    -    qh_meminitbuffers().
    -
    -    A safe choice is sizeof(double).  sizeof(float) may be used if doubles
    -    do not occur in data structures and pointers are the same size.  Be careful
    -    of machines (e.g., DEC Alpha) with large pointers.
    -
    -    If using gcc, best alignment is
    -              #define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *))
    -*/
    -#define qh_MEMalign ((int)(fmax_(sizeof(realT), sizeof(void *))))
    -
    -/*----------------------------------
    -
    -  qh_MEMbufsize
    -    size of additional memory buffers
    -
    -  notes:
    -    used for qh_meminitbuffers() in global.c
    -*/
    -#define qh_MEMbufsize 0x10000       /* allocate 64K memory buffers */
    -
    -/*----------------------------------
    -
    -  qh_MEMinitbuf
    -    size of initial memory buffer
    -
    -  notes:
    -    use for qh_meminitbuffers() in global.c
    -*/
    -#define qh_MEMinitbuf 0x20000      /* initially allocate 128K buffer */
    -
    -/*----------------------------------
    -
    -  qh_INFINITE
    -    on output, indicates Voronoi center at infinity
    -*/
    -#define qh_INFINITE  -10.101
    -
    -/*----------------------------------
    -
    -  qh_DEFAULTbox
    -    default box size (Geomview expects 0.5)
    -
    -  qh_DEFAULTbox
    -    default box size for integer coorindate (rbox only)
    -*/
    -#define qh_DEFAULTbox 0.5
    -#define qh_DEFAULTzbox 1e6
    -
    -/*============================================================*/
    -/*============= conditional compilation ======================*/
    -/*============================================================*/
    -
    -/*----------------------------------
    -
    -  __cplusplus
    -    defined by C++ compilers
    -
    -  __MSC_VER
    -    defined by Microsoft Visual C++
    -
    -  __MWERKS__ && __POWERPC__
    -    defined by Metrowerks when compiling for the Power Macintosh
    -
    -  __STDC__
    -    defined for strict ANSI C
    -*/
    -
    -/*----------------------------------
    -
    -  qh_COMPUTEfurthest
    -    compute furthest distance to an outside point instead of storing it with the facet
    -    =1 to compute furthest
    -
    -  notes:
    -    computing furthest saves memory but costs time
    -      about 40% more distance tests for partitioning
    -      removes facet->furthestdist
    -*/
    -#define qh_COMPUTEfurthest 0
    -
    -/*----------------------------------
    -
    -  qh_KEEPstatistics
    -    =0 removes most of statistic gathering and reporting
    -
    -  notes:
    -    if 0, code size is reduced by about 4%.
    -*/
    -#define qh_KEEPstatistics 1
    -
    -/*----------------------------------
    -
    -  qh_MAXoutside
    -    record outer plane for each facet
    -    =1 to record facet->maxoutside
    -
    -  notes:
    -    this takes a realT per facet and slightly slows down qhull
    -    it produces better outer planes for geomview output
    -*/
    -#define qh_MAXoutside 1
    -
    -/*----------------------------------
    -
    -  qh_NOmerge
    -    disables facet merging if defined
    -
    -  notes:
    -    This saves about 10% space.
    -
    -    Unless 'Q0'
    -      qh_NOmerge sets 'QJ' to avoid precision errors
    -
    -    #define qh_NOmerge
    -
    -  see:
    -    qh_NOmem in mem.c
    -
    -    see user.c/user_eg.c for removing io.o
    -*/
    -
    -/*----------------------------------
    -
    -  qh_NOtrace
    -    no tracing if defined
    -
    -  notes:
    -    This saves about 5% space.
    -
    -    #define qh_NOtrace
    -*/
    -
    -/*----------------------------------
    -
    -  qh_QHpointer
    -    access global data with pointer or static structure
    -
    -  qh_QHpointer  = 1     access globals via a pointer to allocated memory
    -                        enables qh_saveqhull() and qh_restoreqhull()
    -                        [2010, gcc] costs about 4% in time and 4% in space
    -                        [2003, msvc] costs about 8% in time and 2% in space
    -
    -                = 0     qh_qh and qh_qhstat are static data structures
    -                        only one instance of qhull() can be active at a time
    -                        default value
    -
    -  qh_QHpointer_dllimport and qh_dllimport define qh_qh as __declspec(dllimport) [libqhull.h]
    -  It is required for msvc-2005.  It is not needed for gcc.
    -
    -  notes:
    -    all global variables for qhull are in qh, qhmem, and qhstat
    -    qh is defined in libqhull.h
    -    qhmem is defined in mem.h
    -    qhstat is defined in stat.h
    -    C++ build defines qh_QHpointer [libqhullp.pro, libqhullcpp.pro]
    -
    -  see:
    -    user_eg.c for an example
    -*/
    -#ifdef qh_QHpointer
    -#if qh_dllimport
    -#error QH6207 Qhull error: Use qh_QHpointer_dllimport instead of qh_dllimport with qh_QHpointer
    -#endif
    -#else
    -#define qh_QHpointer 0
    -#if qh_QHpointer_dllimport
    -#error QH6234 Qhull error: Use qh_dllimport instead of qh_QHpointer_dllimport when qh_QHpointer is not defined
    -#endif
    -#endif
    -#if 0  /* sample code */
    -    qhT *oldqhA, *oldqhB;
    -
    -    exitcode= qh_new_qhull(dim, numpoints, points, ismalloc,
    -                      flags, outfile, errfile);
    -    /* use results from first call to qh_new_qhull */
    -    oldqhA= qh_save_qhull();
    -    exitcode= qh_new_qhull(dimB, numpointsB, pointsB, ismalloc,
    -                      flags, outfile, errfile);
    -    /* use results from second call to qh_new_qhull */
    -    oldqhB= qh_save_qhull();
    -    qh_restore_qhull(&oldqhA);
    -    /* use results from first call to qh_new_qhull */
    -    qh_freeqhull(qh_ALL);  /* frees all memory used by first call */
    -    qh_restore_qhull(&oldqhB);
    -    /* use results from second call to qh_new_qhull */
    -    qh_freeqhull(!qh_ALL); /* frees long memory used by second call */
    -    qh_memfreeshort(&curlong, &totlong);  /* frees short memory and memory allocator */
    -#endif
    -
    -/*----------------------------------
    -
    -  qh_QUICKhelp
    -    =1 to use abbreviated help messages, e.g., for degenerate inputs
    -*/
    -#define qh_QUICKhelp    0
    -
    -/*============================================================*/
    -/*============= -merge constants- ============================*/
    -/*============================================================*/
    -/*
    -   These constants effect facet merging.  You probably will not need
    -   to modify them.  They effect the performance of facet merging.
    -*/
    -
    -/*----------------------------------
    -
    -  qh_DIMmergeVertex
    -    max dimension for vertex merging (it is not effective in high-d)
    -*/
    -#define qh_DIMmergeVertex 6
    -
    -/*----------------------------------
    -
    -  qh_DIMreduceBuild
    -     max dimension for vertex reduction during build (slow in high-d)
    -*/
    -#define qh_DIMreduceBuild 5
    -
    -/*----------------------------------
    -
    -  qh_BESTcentrum
    -     if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster)
    -     else, qh_findbestneighbor() tests all vertices (much better merges)
    -
    -  qh_BESTcentrum2
    -     if qh_BESTcentrum2 * DIM3 + BESTcentrum < #vertices tests centrums
    -*/
    -#define qh_BESTcentrum 20
    -#define qh_BESTcentrum2 2
    -
    -/*----------------------------------
    -
    -  qh_BESTnonconvex
    -    if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges.
    -
    -  notes:
    -    It is needed because qh_findbestneighbor is slow for large facets
    -*/
    -#define qh_BESTnonconvex 15
    -
    -/*----------------------------------
    -
    -  qh_MAXnewmerges
    -    if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums.
    -
    -  notes:
    -    It is needed because postmerge can merge many facets at once
    -*/
    -#define qh_MAXnewmerges 2
    -
    -/*----------------------------------
    -
    -  qh_MAXnewcentrum
    -    if <= dim+n vertices (n approximates the number of merges),
    -      reset the centrum in qh_updatetested() and qh_mergecycle_facets()
    -
    -  notes:
    -    needed to reduce cost and because centrums may move too much if
    -    many vertices in high-d
    -*/
    -#define qh_MAXnewcentrum 5
    -
    -/*----------------------------------
    -
    -  qh_COPLANARratio
    -    for 3-d+ merging, qh.MINvisible is n*premerge_centrum
    -
    -  notes:
    -    for non-merging, it's DISTround
    -*/
    -#define qh_COPLANARratio 3
    -
    -/*----------------------------------
    -
    -  qh_DISToutside
    -    When is a point clearly outside of a facet?
    -    Stops search in qh_findbestnew or qh_partitionall
    -    qh_findbest uses qh.MINoutside since since it is only called if no merges.
    -
    -  notes:
    -    'Qf' always searches for best facet
    -    if !qh.MERGING, same as qh.MINoutside.
    -    if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved
    -      [Note: Zdelvertextot occurs normally with interior points]
    -            RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv
    -    When there is a sharp edge, need to move points to a
    -    clearly good facet; otherwise may be lost in another partitioning.
    -    if too big then O(n^2) behavior for partitioning in cone
    -    if very small then important points not processed
    -    Needed in qh_partitionall for
    -      RBOX 1000 s Z1 G1e-13 t1001032651 | QHULL Tv
    -    Needed in qh_findbestnew for many instances of
    -      RBOX 1000 s Z1 G1e-13 t | QHULL Tv
    -
    -  See:
    -    qh_DISToutside -- when is a point clearly outside of a facet
    -    qh_SEARCHdist -- when is facet coplanar with the best facet?
    -    qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
    -*/
    -#define qh_DISToutside ((qh_USEfindbestnew ? 2 : 1) * \
    -     fmax_((qh MERGING ? 2 : 1)*qh MINoutside, qh max_outside))
    -
    -/*----------------------------------
    -
    -  qh_RATIOnearinside
    -    ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for
    -    qh_check_maxout().
    -
    -  notes:
    -    This is overkill since do not know the correct value.
    -    It effects whether 'Qc' reports all coplanar points
    -    Not used for 'd' since non-extreme points are coplanar
    -*/
    -#define qh_RATIOnearinside 5
    -
    -/*----------------------------------
    -
    -  qh_SEARCHdist
    -    When is a facet coplanar with the best facet?
    -    qh_findbesthorizon: all coplanar facets of the best facet need to be searched.
    -
    -  See:
    -    qh_DISToutside -- when is a point clearly outside of a facet
    -    qh_SEARCHdist -- when is facet coplanar with the best facet?
    -    qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
    -*/
    -#define qh_SEARCHdist ((qh_USEfindbestnew ? 2 : 1) * \
    -      (qh max_outside + 2 * qh DISTround + fmax_( qh MINvisible, qh MAXcoplanar)));
    -
    -/*----------------------------------
    -
    -  qh_USEfindbestnew
    -     Always use qh_findbestnew for qh_partitionpoint, otherwise use
    -     qh_findbestnew if merged new facet or sharpnewfacets.
    -
    -  See:
    -    qh_DISToutside -- when is a point clearly outside of a facet
    -    qh_SEARCHdist -- when is facet coplanar with the best facet?
    -    qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
    -*/
    -#define qh_USEfindbestnew (zzval_(Ztotmerge) > 50)
    -
    -/*----------------------------------
    -
    -  qh_WIDEcoplanar
    -    n*MAXcoplanar or n*MINvisible for a WIDEfacet
    -
    -    if vertex is further than qh.WIDEfacet from the hyperplane
    -    then its ridges are not counted in computing the area, and
    -    the facet's centrum is frozen.
    -
    -  notes:
    -   qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar,
    -      qh_WIDEcoplanar * qh.MINvisible);
    -*/
    -#define qh_WIDEcoplanar 6
    -
    -/*----------------------------------
    -
    -  qh_MAXnarrow
    -    max. cosine in initial hull that sets qh.NARROWhull
    -
    -  notes:
    -    If qh.NARROWhull, the initial partition does not make
    -    coplanar points.  If narrow, a coplanar point can be
    -    coplanar to two facets of opposite orientations and
    -    distant from the exact convex hull.
    -
    -    Conservative estimate.  Don't actually see problems until it is -1.0
    -*/
    -#define qh_MAXnarrow -0.99999999
    -
    -/*----------------------------------
    -
    -  qh_WARNnarrow
    -    max. cosine in initial hull to warn about qh.NARROWhull
    -
    -  notes:
    -    this is a conservative estimate.
    -    Don't actually see problems until it is -1.0.  See qh-impre.htm
    -*/
    -#define qh_WARNnarrow -0.999999999999999
    -
    -/*----------------------------------
    -
    -  qh_ZEROdelaunay
    -    a zero Delaunay facet occurs for input sites coplanar with their convex hull
    -    the last normal coefficient of a zero Delaunay facet is within
    -        qh_ZEROdelaunay * qh.ANGLEround of 0
    -
    -  notes:
    -    qh_ZEROdelaunay does not allow for joggled input ('QJ').
    -
    -    You can avoid zero Delaunay facets by surrounding the input with a box.
    -
    -    Use option 'PDk:-n' to explicitly define zero Delaunay facets
    -      k= dimension of input sites (e.g., 3 for 3-d Delaunay triangulation)
    -      n= the cutoff for zero Delaunay facets (e.g., 'PD3:-1e-12')
    -*/
    -#define qh_ZEROdelaunay 2
    -
    -#endif /* qh_DEFuser */
    -
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/usermem.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/usermem.c
    deleted file mode 100644
    index 8cb6ba48a8..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/usermem.c
    +++ /dev/null
    @@ -1,64 +0,0 @@
    -/*
      ---------------------------------
    -
    -   usermem.c
    -   qh_exit(), qh_free(), and qh_malloc()
    -
    -   See README.txt.
    -
    -   If you redefine one of these functions you must redefine all of them.
    -   If you recompile and load this file, then usermem.o will not be loaded
    -   from qhull.a or qhull.lib
    -
    -   See libqhull.h for data structures, macros, and user-callable functions.
    -   See user.c for qhull-related, redefinable functions
    -   see user.h for user-definable constants
    -   See userprintf.c for qh_fprintf and userprintf_rbox,c for qh_fprintf_rbox
    -
    -   Please report any errors that you fix to qhull@qhull.org
    -*/
    -
    -#include "libqhull.h"
    -
    -#include 
    -
    -/*---------------------------------
    -
    -  qh_exit( exitcode )
    -    exit program
    -
    -  notes:
    -    same as exit()
    -*/
    -void qh_exit(int exitcode) {
    -    exit(exitcode);
    -} /* exit */
    -
    -/*---------------------------------
    -
    -qh_free( mem )
    -free memory
    -
    -notes:
    -same as free()
    -*/
    -void qh_free(void *mem) {
    -    free(mem);
    -} /* free */
    -
    -/*---------------------------------
    -
    -    qh_malloc( mem )
    -      allocate memory
    -
    -    notes:
    -      same as malloc()
    -*/
    -void *qh_malloc(size_t size) {
    -    return malloc(size);
    -} /* malloc */
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf.c
    deleted file mode 100644
    index 88ead2f70c..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf.c
    +++ /dev/null
    @@ -1,63 +0,0 @@
    -/*
      ---------------------------------
    -
    -   userprintf.c
    -   qh_fprintf()
    -
    -   see README.txt  see COPYING.txt for copyright information.
    -
    -   If you recompile and load this file, then userprintf.o will not be loaded
    -   from qhull.a or qhull.lib
    -
    -   See libqhull.h for data structures, macros, and user-callable functions.
    -   See user.c for qhull-related, redefinable functions
    -   see user.h for user-definable constants
    -   See usermem.c for qh_exit(), qh_free(), and qh_malloc()
    -   see Qhull.cpp and RboxPoints.cpp for examples.
    -
    -   Please report any errors that you fix to qhull@qhull.org
    -*/
    -
    -#include "libqhull.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -/*---------------------------------
    -
    -   qh_fprintf(fp, msgcode, format, list of args )
    -     print arguments to *fp according to format
    -     Use qh_fprintf_rbox() for rboxlib.c
    -
    -   notes:
    -     same as fprintf()
    -     fgets() is not trapped like fprintf()
    -     exit qh_fprintf via qh_errexit()
    -*/
    -
    -void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) {
    -    va_list args;
    -
    -    if (!fp) {
    -        fprintf(stderr, "QH6232 Qhull internal error (userprintf.c): fp is 0.  Wrong qh_fprintf called.\n");
    -        qh_errexit(6232, NULL, NULL);
    -    }
    -    va_start(args, fmt);
    -#if qh_QHpointer
    -    if (qh_qh && qh ANNOTATEoutput) {
    -#else
    -    if (qh ANNOTATEoutput) {
    -#endif
    -      fprintf(fp, "[QH%.4d]", msgcode);
    -    }else if (msgcode >= MSG_ERROR && msgcode < MSG_STDERR ) {
    -      fprintf(fp, "QH%.4d ", msgcode);
    -    }
    -    vfprintf(fp, fmt, args);
    -    va_end(args);
    -
    -    /* Place debugging traps here. Use with option 'Tn' */
    -
    -} /* qh_fprintf */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf_rbox.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf_rbox.c
    deleted file mode 100644
    index 92c3572d41..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhull/userprintf_rbox.c
    +++ /dev/null
    @@ -1,53 +0,0 @@
    -/*
      ---------------------------------
    -
    -   userprintf_rbox.c
    -   qh_fprintf_rbox()
    -
    -   see README.txt  see COPYING.txt for copyright information.
    -
    -   If you recompile and load this file, then userprintf_rbox.o will not be loaded
    -   from qhull.a or qhull.lib
    -
    -   See libqhull.h for data structures, macros, and user-callable functions.
    -   See user.c for qhull-related, redefinable functions
    -   see user.h for user-definable constants
    -   See usermem.c for qh_exit(), qh_free(), and qh_malloc()
    -   see Qhull.cpp and RboxPoints.cpp for examples.
    -
    -   Please report any errors that you fix to qhull@qhull.org
    -*/
    -
    -#include "libqhull.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -/*---------------------------------
    -
    -   qh_fprintf_rbox(fp, msgcode, format, list of args )
    -     print arguments to *fp according to format
    -     Use qh_fprintf_rbox() for rboxlib.c
    -
    -   notes:
    -     same as fprintf()
    -     fgets() is not trapped like fprintf()
    -     exit qh_fprintf_rbox via qh_errexit_rbox()
    -*/
    -
    -void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ) {
    -    va_list args;
    -
    -    if (!fp) {
    -        fprintf(stderr, "QH6231 Qhull internal error (userprintf.c): fp is 0.  Wrong qh_fprintf_rbox called.\n");
    -        qh_errexit_rbox(6231);
    -    }
    -    if (msgcode >= MSG_ERROR && msgcode < MSG_STDERR)
    -      fprintf(fp, "QH%.4d ", msgcode);
    -    va_start(args, fmt);
    -    vfprintf(fp, fmt, args);
    -    va_end(args);
    -} /* qh_fprintf_rbox */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.cpp
    deleted file mode 100644
    index fc7ae7257b..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.cpp
    +++ /dev/null
    @@ -1,184 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/Coordinates.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "functionObjects.h"
    -#include "QhullError.h"
    -#include "Coordinates.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//! Coordinates -- vector of coordT (normally double)
    -
    -#//Element access
    -
    -// Inefficient without result-value-optimization or implicitly shared object
    -Coordinates Coordinates::
    -mid(int idx, int length) const
    -{
    -    int newLength= length;
    -    if(length<0 || idx+length > count()){
    -        newLength= count()-idx;
    -    }
    -    Coordinates result;
    -    if(newLength>0){
    -        std::copy(begin()+idx, begin()+(idx+newLength), std::back_inserter(result));
    -    }
    -    return result;
    -}//mid
    -
    -coordT Coordinates::
    -value(int idx, const coordT &defaultValue) const
    -{
    -    return ((idx < 0 || idx >= count()) ? defaultValue : (*this)[idx]);
    -}//value
    -
    -#//Operator
    -
    -Coordinates Coordinates::
    -operator+(const Coordinates &other) const
    -{
    -    Coordinates result(*this);
    -    std::copy(other.begin(), other.end(), std::back_inserter(result));
    -    return result;
    -}//operator+
    -
    -Coordinates & Coordinates::
    -operator+=(const Coordinates &other)
    -{
    -    if(&other==this){
    -        Coordinates clone(other);
    -        std::copy(clone.begin(), clone.end(), std::back_inserter(*this));
    -    }else{
    -        std::copy(other.begin(), other.end(), std::back_inserter(*this));
    -    }
    -    return *this;
    -}//operator+=
    -
    -#//Read-write
    -
    -coordT Coordinates::
    -takeAt(int idx)
    -{
    -    coordT c= at(idx);
    -    erase(begin()+idx);
    -    return c;
    -}//takeAt
    -
    -coordT Coordinates::
    -takeLast()
    -{
    -    coordT c= last();
    -    removeLast();
    -    return c;
    -}//takeLast
    -
    -void Coordinates::
    -swap(int idx, int other)
    -{
    -    coordT c= at(idx);
    -    at(idx)= at(other);
    -    at(other)= c;
    -}//swap
    -
    -#//Search
    -
    -bool Coordinates::
    -contains(const coordT &t) const
    -{
    -    CoordinatesIterator i(*this);
    -    return i.findNext(t);
    -}//contains
    -
    -int Coordinates::
    -count(const coordT &t) const
    -{
    -    CoordinatesIterator i(*this);
    -    int result= 0;
    -    while(i.findNext(t)){
    -        ++result;
    -    }
    -    return result;
    -}//count
    -
    -int Coordinates::
    -indexOf(const coordT &t, int from) const
    -{
    -    if(from<0){
    -        from += count();
    -        if(from<0){
    -            from= 0;
    -        }
    -    }
    -    if(from(i-begin())); // WARN64
    -            }
    -            ++i;
    -        }
    -    }
    -    return -1;
    -}//indexOf
    -
    -int Coordinates::
    -lastIndexOf(const coordT &t, int from) const
    -{
    -    if(from<0){
    -        from += count();
    -    }else if(from>=count()){
    -        from= count()-1;
    -    }
    -    if(from>=0){
    -        const_iterator i= begin()+from+1;
    -        while(i-- != constBegin()){
    -            if(*i==t){
    -                return (static_cast(i-begin())); // WARN64
    -            }
    -        }
    -    }
    -    return -1;
    -}//lastIndexOf
    -
    -void Coordinates::
    -removeAll(const coordT &t)
    -{
    -    MutableCoordinatesIterator i(*this);
    -    while(i.findNext(t)){
    -        i.remove();
    -    }
    -}//removeAll
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::istream;
    -using std::ostream;
    -using std::string;
    -using std::ws;
    -using orgQhull::Coordinates;
    -
    -ostream &
    -operator<<(ostream &os, const Coordinates &cs)
    -{
    -    Coordinates::const_iterator c= cs.begin();
    -    for(int i=cs.count(); i--; ){
    -        os << *c++ << " ";
    -    }
    -    return os;
    -}//operator<<
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.h
    deleted file mode 100644
    index 8bb144ff33..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Coordinates.h
    +++ /dev/null
    @@ -1,311 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/Coordinates.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHCOORDINATES_H
    -#define QHCOORDINATES_H
    -
    -#include "QhullError.h"
    -#include "QhullIterator.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -
    -#include  // ptrdiff_t, size_t
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! an allocated vector of point coordinates
    -    //!  Used by PointCoordinates for RboxPoints
    -    //!  A QhullPoint refers to previously allocated coordinates
    -    class  Coordinates;
    -    class  MutableCoordinatesIterator;
    -
    -
    -class Coordinates {
    -
    -private:
    -#//Fields
    -    std::vector coordinate_array;
    -
    -public:
    -#//Subtypes
    -
    -    class                       const_iterator;
    -    class                       iterator;
    -    typedef iterator Iterator;
    -    typedef const_iterator ConstIterator;
    -
    -    typedef coordT              value_type;
    -    typedef const value_type   *const_pointer;
    -    typedef const value_type   &const_reference;
    -    typedef value_type         *pointer;
    -    typedef value_type         &reference;
    -    typedef ptrdiff_t           difference_type;
    -    typedef int                 size_type;
    -
    -#//Construct
    -                        Coordinates() {};
    -    explicit            Coordinates(const std::vector &other) : coordinate_array(other) {}
    -                        Coordinates(const Coordinates &other) : coordinate_array(other.coordinate_array) {}
    -    Coordinates        &operator=(const Coordinates &other) { coordinate_array= other.coordinate_array; return *this; }
    -    Coordinates        &operator=(const std::vector &other) { coordinate_array= other; return *this; }
    -                       ~Coordinates() {}
    -
    -#//Conversion
    -
    -    coordT             *data() { return isEmpty() ? 0 : &at(0); }
    -    const coordT       *data() const { return const_cast(isEmpty() ? 0 : &at(0)); }
    -
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const { return coordinate_array; }
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList      toQList() const;
    -#endif //QHULL_USES_QT
    -
    -#//GetSet
    -    int                count() const { return static_cast(size()); }
    -    bool               empty() const { return coordinate_array.empty(); }
    -    bool               isEmpty() const { return empty(); }
    -    bool               operator==(const Coordinates &other) const  { return coordinate_array==other.coordinate_array; }
    -    bool               operator!=(const Coordinates &other) const  { return coordinate_array!=other.coordinate_array; }
    -    size_t             size() const { return coordinate_array.size(); }
    -
    -#//Element access
    -    coordT             &at(int idx) { return coordinate_array.at(idx); }
    -    const coordT       &at(int idx) const { return coordinate_array.at(idx); }
    -    coordT             &back() { return coordinate_array.back(); }
    -    const coordT       &back() const { return coordinate_array.back(); }
    -    coordT             &first() { return front(); }
    -    const coordT       &first() const { return front(); }
    -    coordT             &front() { return coordinate_array.front(); }
    -    const coordT       &front() const { return coordinate_array.front(); }
    -    coordT             &last() { return back(); }
    -    const coordT       &last() const { return back(); }
    -    Coordinates        mid(int idx, int length= -1) const;
    -    coordT            &operator[](int idx) { return coordinate_array.operator[](idx); }
    -    const coordT      &operator[](int idx) const { return coordinate_array.operator[](idx); }
    -    coordT             value(int idx, const coordT &defaultValue) const;
    -
    -#//Iterator
    -    iterator            begin() { return iterator(coordinate_array.begin()); }
    -    const_iterator      begin() const { return const_iterator(coordinate_array.begin()); }
    -    const_iterator      constBegin() const { return begin(); }
    -    const_iterator      constEnd() const { return end(); }
    -    iterator            end() { return iterator(coordinate_array.end()); }
    -    const_iterator      end() const { return const_iterator(coordinate_array.end()); }
    -
    -#//Read-only
    -    Coordinates         operator+(const Coordinates &other) const;
    -
    -#//Modify
    -    void                append(const coordT &c) { push_back(c); }
    -    void                clear() { coordinate_array.clear(); }
    -    iterator            erase(iterator idx) { return iterator(coordinate_array.erase(idx.base())); }
    -    iterator            erase(iterator beginIterator, iterator endIterator) { return iterator(coordinate_array.erase(beginIterator.base(), endIterator.base())); }
    -    void                insert(int before, const coordT &c) { insert(begin()+before, c); }
    -    iterator            insert(iterator before, const coordT &c) { return iterator(coordinate_array.insert(before.base(), c)); }
    -    void                move(int from, int to) { insert(to, takeAt(from)); }
    -    Coordinates        &operator+=(const Coordinates &other);
    -    Coordinates        &operator+=(const coordT &c) { append(c); return *this; }
    -    Coordinates        &operator<<(const Coordinates &other) { return *this += other; }
    -    Coordinates        &operator<<(const coordT &c) { return *this += c; }
    -    void                pop_back() { coordinate_array.pop_back(); }
    -    void                pop_front() { removeFirst(); }
    -    void                prepend(const coordT &c) { insert(begin(), c); }
    -    void                push_back(const coordT &c) { coordinate_array.push_back(c); }
    -    void                push_front(const coordT &c) { insert(begin(), c); }
    -                        //removeAll below
    -    void                removeAt(int idx) { erase(begin()+idx); }
    -    void                removeFirst() { erase(begin()); }
    -    void                removeLast() { erase(--end()); }
    -    void                replace(int idx, const coordT &c) { (*this)[idx]= c; }
    -    void                reserve(int i) { coordinate_array.reserve(i); }
    -    void                swap(int idx, int other);
    -    coordT              takeAt(int idx);
    -    coordT              takeFirst() { return takeAt(0); }
    -    coordT              takeLast();
    -
    -#//Search
    -    bool                contains(const coordT &t) const;
    -    int                 count(const coordT &t) const;
    -    int                 indexOf(const coordT &t, int from = 0) const;
    -    int                 lastIndexOf(const coordT &t, int from = -1) const;
    -    void                removeAll(const coordT &t);
    -
    -#//Coordinates::iterator -- from QhullPoints, forwarding to coordinate_array
    -    // before const_iterator for conversion with comparison operators
    -    class iterator {
    -
    -    private:
    -        std::vector::iterator i;
    -        friend class    const_iterator;
    -
    -    public:
    -        typedef std::random_access_iterator_tag  iterator_category;
    -        typedef coordT      value_type;
    -        typedef value_type *pointer;
    -        typedef value_type &reference;
    -        typedef ptrdiff_t   difference_type;
    -
    -                        iterator() {}
    -                        iterator(const iterator &other) { i= other.i; }
    -        explicit        iterator(const std::vector::iterator &vi) { i= vi; }
    -        iterator       &operator=(const iterator &other) { i= other.i; return *this; }
    -        std::vector::iterator &base() { return i; }
    -                        // No operator-> for base types
    -        coordT         &operator*() const { return *i; }
    -        coordT         &operator[](int idx) const { return i[idx]; }
    -
    -        bool            operator==(const iterator &other) const { return i==other.i; }
    -        bool            operator!=(const iterator &other) const { return i!=other.i; }
    -        bool            operator<(const iterator &other) const { return i(const iterator &other) const { return i>other.i; }
    -        bool            operator>=(const iterator &other) const { return i>=other.i; }
    -              // reinterpret_cast to break circular dependency
    -        bool            operator==(const Coordinates::const_iterator &other) const { return *this==reinterpret_cast(other); }
    -        bool            operator!=(const Coordinates::const_iterator &other) const { return *this!=reinterpret_cast(other); }
    -        bool            operator<(const Coordinates::const_iterator &other) const { return *this(other); }
    -        bool            operator<=(const Coordinates::const_iterator &other) const { return *this<=reinterpret_cast(other); }
    -        bool            operator>(const Coordinates::const_iterator &other) const { return *this>reinterpret_cast(other); }
    -        bool            operator>=(const Coordinates::const_iterator &other) const { return *this>=reinterpret_cast(other); }
    -
    -        iterator        operator++() { return iterator(++i); } //FIXUP QH11012 Should return reference, but get reference to temporary
    -        iterator        operator++(int) { return iterator(i++); }
    -        iterator        operator--() { return iterator(--i); }
    -        iterator        operator--(int) { return iterator(i--); }
    -        iterator        operator+=(int idx) { return iterator(i += idx); }
    -        iterator        operator-=(int idx) { return iterator(i -= idx); }
    -        iterator        operator+(int idx) const { return iterator(i+idx); }
    -        iterator        operator-(int idx) const { return iterator(i-idx); }
    -        difference_type operator-(iterator other) const { return i-other.i; }
    -    };//Coordinates::iterator
    -
    -#//Coordinates::const_iterator
    -    class const_iterator {
    -
    -    private:
    -        std::vector::const_iterator i;
    -
    -    public:
    -        typedef std::random_access_iterator_tag  iterator_category;
    -        typedef coordT            value_type;
    -        typedef const value_type *pointer;
    -        typedef const value_type &reference;
    -        typedef ptrdiff_t         difference_type;
    -
    -                        const_iterator() {}
    -                        const_iterator(const const_iterator &other) { i= other.i; }
    -                        const_iterator(iterator o) : i(o.i) {}
    -        explicit        const_iterator(const std::vector::const_iterator &vi) { i= vi; }
    -        const_iterator &operator=(const const_iterator &other) { i= other.i; return *this; }
    -                        // No operator-> for base types
    -                        // No reference to a base type for () and []
    -        const coordT   &operator*() const { return *i; }
    -        const coordT   &operator[](int idx) const { return i[idx]; }
    -
    -        bool            operator==(const const_iterator &other) const { return i==other.i; }
    -        bool            operator!=(const const_iterator &other) const { return i!=other.i; }
    -        bool            operator<(const const_iterator &other) const { return i(const const_iterator &other) const { return i>other.i; }
    -        bool            operator>=(const const_iterator &other) const { return i>=other.i; }
    -
    -        const_iterator  operator++() { return const_iterator(++i); } //FIXUP QH11014 -- too much copying
    -        const_iterator  operator++(int) { return const_iterator(i++); }
    -        const_iterator  operator--() { return const_iterator(--i); }
    -        const_iterator  operator--(int) { return const_iterator(i--); }
    -        const_iterator  operator+=(int idx) { return const_iterator(i += idx); }
    -        const_iterator  operator-=(int idx) { return const_iterator(i -= idx); }
    -        const_iterator  operator+(int idx) const { return const_iterator(i+idx); }
    -        const_iterator  operator-(int idx) const { return const_iterator(i-idx); }
    -        difference_type operator-(const_iterator other) const { return i-other.i; }
    -    };//Coordinates::const_iterator
    -
    -};//Coordinates
    -
    -//class CoordinatesIterator
    -//QHULL_DECLARE_SEQUENTIAL_ITERATOR(Coordinates, coordT)
    -
    -class CoordinatesIterator
    -{
    -    typedef Coordinates::const_iterator const_iterator;
    -    const Coordinates *c;
    -    const_iterator i;
    -    public:
    -    inline CoordinatesIterator(const Coordinates &container)
    -    : c(&container), i(c->constBegin()) {}
    -    inline CoordinatesIterator &operator=(const Coordinates &container)
    -    { c = &container; i = c->constBegin(); return *this; }
    -    inline void toFront() { i = c->constBegin(); }
    -    inline void toBack() { i = c->constEnd(); }
    -    inline bool hasNext() const { return i != c->constEnd(); }
    -    inline const coordT &next() { return *i++; }
    -    inline const coordT &peekNext() const { return *i; }
    -    inline bool hasPrevious() const { return i != c->constBegin(); }
    -    inline const coordT &previous() { return *--i; }
    -    inline const coordT &peekPrevious() const { const_iterator p = i; return *--p; }
    -    inline bool findNext(const coordT &t)
    -    { while (i != c->constEnd()) if (*i++ == t) return true; return false; }
    -    inline bool findPrevious(const coordT &t)
    -    { while (i != c->constBegin()) if (*(--i) == t) return true;
    -    return false;  }
    -};//CoordinatesIterator
    -
    -//class MutableCoordinatesIterator
    -//QHULL_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(Coordinates, coordT)
    -class MutableCoordinatesIterator
    -{
    -    typedef Coordinates::iterator iterator;
    -    typedef Coordinates::const_iterator const_iterator;
    -    Coordinates *c;
    -    iterator i, n;
    -    inline bool item_exists() const { return const_iterator(n) != c->constEnd(); }
    -    public:
    -    inline MutableCoordinatesIterator(Coordinates &container)
    -    : c(&container)
    -    { i = c->begin(); n = c->end(); }
    -    inline ~MutableCoordinatesIterator()
    -    {}
    -    inline MutableCoordinatesIterator &operator=(Coordinates &container)
    -    { c = &container;
    -    i = c->begin(); n = c->end(); return *this; }
    -    inline void toFront() { i = c->begin(); n = c->end(); }
    -    inline void toBack() { i = c->end(); n = i; }
    -    inline bool hasNext() const { return c->constEnd() != const_iterator(i); }
    -    inline coordT &next() { n = i++; return *n; }
    -    inline coordT &peekNext() const { return *i; }
    -    inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); }
    -    inline coordT &previous() { n = --i; return *n; }
    -    inline coordT &peekPrevious() const { iterator p = i; return *--p; }
    -    inline void remove()
    -    { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } }
    -    inline void setValue(const coordT &t) const { if (c->constEnd() != const_iterator(n)) *n = t; }
    -    inline coordT &value() { QHULL_ASSERT(item_exists()); return *n; }
    -    inline const coordT &value() const { QHULL_ASSERT(item_exists()); return *n; }
    -    inline void insert(const coordT &t) { n = i = c->insert(i, t); ++i; }
    -    inline bool findNext(const coordT &t)
    -    { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; }
    -    inline bool findPrevious(const coordT &t)
    -    { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true;
    -    n = c->end(); return false;  }
    -};//MutableCoordinatesIterator
    -
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::Coordinates &c);
    -
    -#endif // QHCOORDINATES_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/PointCoordinates.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/PointCoordinates.cpp
    deleted file mode 100644
    index 549f9d3397..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/PointCoordinates.cpp
    +++ /dev/null
    @@ -1,294 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/PointCoordinates.cpp#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "QhullError.h"
    -#include "QhullPoint.h"
    -#include "PointCoordinates.h"
    -
    -#include 
    -#include 
    -
    -using std::istream;
    -using std::string;
    -using std::ws;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//! PointCoordinates -- vector of PointCoordinates
    -
    -#//Construct
    -PointCoordinates::
    -PointCoordinates()
    -: QhullPoints()
    -, point_coordinates()
    -, point_comment()
    -{
    -    makeValid();
    -}
    -
    -#//Construct
    -PointCoordinates::
    -PointCoordinates(int pointDimension)
    -: QhullPoints(pointDimension)
    -, point_coordinates()
    -, point_comment()
    -{
    -    makeValid();
    -}
    -
    -PointCoordinates::
    -PointCoordinates(const std::string &aComment)
    -: QhullPoints()
    -, point_coordinates()
    -, point_comment(aComment)
    -{
    -    makeValid();
    -}
    -
    -PointCoordinates::
    -PointCoordinates(int pointDimension, const std::string &aComment)
    -: QhullPoints(pointDimension)
    -, point_coordinates()
    -, point_comment(aComment)
    -{
    -    makeValid();
    -}
    -
    -PointCoordinates::
    -PointCoordinates(int pointDimension, const std::string &aComment, int coordinatesCount, const coordT *c)
    -: QhullPoints(pointDimension)
    -, point_coordinates()
    -, point_comment(aComment)
    -{
    -    append(coordinatesCount, c);
    -}
    -
    -PointCoordinates::
    -PointCoordinates(const PointCoordinates &other)
    -: QhullPoints(other)
    -, point_coordinates(other.point_coordinates)
    -, point_comment(other.point_comment)
    -{
    -    makeValid();
    -}
    -
    -PointCoordinates & PointCoordinates::
    -operator=(const PointCoordinates &other)
    -{
    -    point_coordinates= other.point_coordinates;
    -    point_comment= other.point_comment;
    -    makeValid();
    -    return *this;
    -}//operator=
    -
    -PointCoordinates::
    -~PointCoordinates()
    -{ }
    -
    -#//GetSet
    -
    -void PointCoordinates::
    -checkValid() const
    -{
    -    if(getCoordinates().data()!=data()
    -    || getCoordinates().count()!=coordinateCount()){
    -        throw QhullError(10060, "Qhull error: first point (%x) is not PointCoordinates.data() or count (%d) is not PointCoordinates.count (%d)", coordinateCount(), getCoordinates().count(), 0.0, data());
    -    }
    -}//checkValid
    -
    -void PointCoordinates::
    -setDimension(int i)
    -{
    -    if(i<0){
    -        throw QhullError(10062, "Qhull error: can not set PointCoordinates dimension to %d", i);
    -    }
    -    int currentDimension=QhullPoints::dimension();
    -    if(currentDimension!=0 && i!=currentDimension){
    -        throw QhullError(10063, "Qhull error: can not change PointCoordinates dimension (from %d to %d)", currentDimension, i);
    -    }
    -    QhullPoints::setDimension(i);
    -}//setDimension
    -
    -//#Foreach
    -
    -Coordinates::ConstIterator PointCoordinates::
    -beginCoordinates(int pointIndex) const
    -{
    -    return point_coordinates.begin()+indexOffset(pointIndex);
    -}
    -
    -Coordinates::Iterator PointCoordinates::
    -beginCoordinates(int pointIndex)
    -{
    -    return point_coordinates.begin()+indexOffset(pointIndex);
    -}
    -
    -#//Modify
    -
    -void PointCoordinates::
    -append(int coordinatesCount, const coordT *c)
    -{
    -    if(coordinatesCount<=0){
    -        return;
    -    }
    -    if(includesCoordinates(c)){
    -        throw QhullError(10065, "Qhull error: can not append a subset of PointCoordinates to itself.  The coordinates for point %d may move.", indexOf(c, QhullError::NOthrow));
    -    }
    -    reserveCoordinates(coordinatesCount);
    -    std::copy(c, c+coordinatesCount, std::back_inserter(point_coordinates));
    -    makeValid();
    -}//append coordT
    -
    -void PointCoordinates::
    -append(const PointCoordinates &other)
    -{
    -    setDimension(other.dimension());
    -    append(other.coordinateCount(), other.data());
    -}//append PointCoordinates
    -
    -void PointCoordinates::
    -append(const QhullPoint &p)
    -{
    -    setDimension(p.dimension());
    -    append(p.dimension(), p.coordinates());
    -}//append QhullPoint
    -
    -void PointCoordinates::
    -appendComment(const std::string &s){
    -    if(char c= s[0] && point_comment.empty()){
    -        if(c=='-' || isdigit(c)){
    -            throw QhullError(10028, "Qhull argument error: comments can not start with a number or minus, %s", 0, 0, 0.0, s.c_str());
    -        }
    -    }
    -    point_comment += s;
    -}//appendComment
    -
    -//! Read PointCoordinates from istream.  First two numbers are dimension and count.  A non-digit starts a rboxCommand.
    -//! Overwrites point_comment.  See qh_readpoints [io.c]
    -void PointCoordinates::
    -appendPoints(istream &in)
    -{
    -    int inDimension, inCount;
    -    in >> ws >> inDimension >> ws;
    -    if(!in.good()){
    -        in.clear();
    -        string remainder;
    -        getline(in, remainder);
    -        throw QhullError(10005, "Qhull error: input did not start with dimension or count -- %s", 0, 0, 0, remainder.c_str());
    -    }
    -    char c= (char)in.peek();
    -    if(c!='-' && !isdigit(c)){         // Comments start with a non-digit
    -        getline(in, point_comment);
    -        in >> ws;
    -    }
    -    in >> inCount >> ws;
    -    if(!in.good()){
    -        in.clear();
    -        string remainder;
    -        getline(in, remainder);
    -        throw QhullError(10009, "Qhull error: input did not start with dimension and count -- %d %s", inDimension, 0, 0, remainder.c_str());
    -    }
    -    c= (char)in.peek();
    -    if(c!='-' && !isdigit(c)){         // Comments start with a non-digit
    -        getline(in, point_comment);
    -        in >> ws;
    -    }
    -    if(inCount> p >> ws;
    -        if(in.fail()){
    -            in.clear();
    -            string remainder;
    -            getline(in, remainder);
    -            throw QhullError(10008, "Qhull error: failed to read coordinate %d  of point %d\n   %s", coordinatesCount % inDimension, coordinatesCount/inDimension, 0, remainder.c_str());
    -        }else{
    -            point_coordinates.push_back(p);
    -            coordinatesCount++;
    -        }
    -    }
    -    if(coordinatesCount != inCount*inDimension){
    -        if(coordinatesCount%inDimension==0){
    -            throw QhullError(10006, "Qhull error: expected %d %d-d PointCoordinates but read %i PointCoordinates", int(inCount), inDimension, 0.0, int(coordinatesCount/inDimension));
    -        }else{
    -            throw QhullError(10012, "Qhull error: expected %d %d-d PointCoordinates but read %i PointCoordinates plus %f extra coordinates", inCount, inDimension, float(coordinatesCount%inDimension), coordinatesCount/inDimension);
    -        }
    -    }
    -    makeValid();
    -}//appendPoints istream
    -
    -PointCoordinates PointCoordinates::
    -operator+(const PointCoordinates &other) const
    -{
    -    PointCoordinates pc= *this;
    -    pc << other;
    -    return pc;
    -}//operator+
    -
    -void PointCoordinates::
    -reserveCoordinates(int newCoordinates)
    -{
    -    // vector::reserve is not const
    -    point_coordinates.reserve((int)point_coordinates.size()+newCoordinates); // WARN64
    -    makeValid();
    -}//reserveCoordinates
    -
    -#//Helpers
    -
    -int PointCoordinates::
    -indexOffset(int i) const {
    -    int n= i*dimension();
    -    int coordinatesCount= point_coordinates.count();
    -    if(i<0 || n>coordinatesCount){
    -        throw QhullError(10061, "Qhull error: point_coordinates is too short (%d) for point %d", coordinatesCount, i);
    -    }
    -    return n;
    -}
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -
    -using orgQhull::Coordinates;
    -using orgQhull::PointCoordinates;
    -
    -ostream&
    -operator<<(ostream &os, const PointCoordinates &p)
    -{
    -    p.checkValid();
    -    int count= p.count();
    -    int dimension= p.dimension();
    -    string comment= p.comment();
    -    if(comment.empty()){
    -        os << dimension << endl;
    -    }else{
    -        os << dimension << " " << comment << endl;
    -    }
    -    os << count << endl;
    -    Coordinates::ConstIterator c= p.beginCoordinates();
    -    for(int i=0; i
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! Zero or more points with Coordinates, count, and dimension
    -    class PointCoordinates;
    -
    -class PointCoordinates : public QhullPoints {
    -
    -private:
    -#//Field
    -    Coordinates         point_coordinates;      //! array of point coordinates
    -                                                //! may have extraCoordinates()
    -    std::string         point_comment;          //! Comment describing PointCoordinates
    -
    -public:
    -#//Construct
    -                        PointCoordinates();
    -    explicit            PointCoordinates(int pointDimension);
    -    explicit            PointCoordinates(const std::string &aComment);
    -                        PointCoordinates(int pointDimension, const std::string &aComment);
    -                        PointCoordinates(int pointDimension, const std::string &aComment, int coordinatesCount, const coordT *c); // may be invalid
    -                        //! Use append() and appendPoints() for Coordinates and vector
    -                        PointCoordinates(const PointCoordinates &other);
    -    PointCoordinates   &operator=(const PointCoordinates &other);
    -    ~PointCoordinates();
    -
    -#//Convert
    -    //! QhullPoints coordinates, constData, data, count, size
    -#ifndef QHULL_NO_STL
    -    void                append(const std::vector &otherCoordinates) { if(!otherCoordinates.empty()){ append((int)otherCoordinates.size(), &otherCoordinates[0]); } }
    -    std::vector toStdVector() const { return point_coordinates.toStdVector(); }
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    void                append(const QList &pointCoordinates) { if(!pointCoordinates.isEmpty()){ append(pointCoordinates.count(), &pointCoordinates[0]); } }
    -    QList       toQList() const { return point_coordinates.toQList(); }
    -#endif //QHULL_USES_QT
    -
    -#//GetSet
    -    //! See QhullPoints for coordinates, coordinateCount, dimension, empty, isEmpty, ==, !=
    -    void                checkValid() const;
    -    std::string         comment() const { return point_comment; }
    -    void                makeValid() { defineAs(point_coordinates.count(), point_coordinates.data()); }
    -    const Coordinates  &getCoordinates() const { return point_coordinates; }
    -    void                setComment(const std::string &s) { point_comment= s; }
    -    void                setDimension(int i);
    -
    -private:
    -    void                defineAs(int coordinatesCount, coordT *c) { QhullPoints::defineAs(coordinatesCount, c); }
    -    //! defineAs() otherwise disabled
    -public:
    -
    -#//ElementAccess
    -    //! See QhullPoints for at, back, first, front, last, mid, [], value
    -
    -#//Foreach
    -    //! See QhullPoints for begin, constBegin, end
    -    Coordinates::ConstIterator  beginCoordinates() const { return point_coordinates.begin(); }
    -    Coordinates::Iterator       beginCoordinates() { return point_coordinates.begin(); }
    -    Coordinates::ConstIterator  beginCoordinates(int pointIndex) const;
    -    Coordinates::Iterator       beginCoordinates(int pointIndex);
    -    Coordinates::ConstIterator  endCoordinates() const { return point_coordinates.end(); }
    -    Coordinates::Iterator       endCoordinates() { return point_coordinates.end(); }
    -
    -#//Search
    -    //! See QhullPoints for contains, count, indexOf, lastIndexOf
    -
    -#//Read-only
    -    PointCoordinates    operator+(const PointCoordinates &other) const;
    -
    -#//Modify
    -    //FIXUP QH11001: Add clear() and other modify operators from Coordinates.h.  Include QhullPoint::operator=()
    -    void                append(int coordinatesCount, const coordT *c);  //! Dimension previously defined
    -    void                append(const coordT &c) { append(1, &c); } //! Dimension previously defined
    -    void                append(const QhullPoint &p);
    -    //! See convert for std::vector and QList
    -    void                append(const Coordinates &c) { append(c.count(), c.data()); }
    -    void                append(const PointCoordinates &other);
    -    void                appendComment(const std::string &s);
    -    void                appendPoints(std::istream &in);
    -    PointCoordinates   &operator+=(const PointCoordinates &other) { append(other); return *this; }
    -    PointCoordinates   &operator+=(const coordT &c) { append(c); return *this; }
    -    PointCoordinates   &operator+=(const QhullPoint &p) { append(p); return *this; }
    -    PointCoordinates   &operator<<(const PointCoordinates &other) { return *this += other; }
    -    PointCoordinates   &operator<<(const coordT &c) { return *this += c; }
    -    PointCoordinates   &operator<<(const QhullPoint &p) { return *this += p; }
    -    // reserve() is non-const
    -    void                reserveCoordinates(int newCoordinates);
    -
    -#//Helpers
    -private:
    -    int                 indexOffset(int i) const;
    -
    -};//PointCoordinates
    -
    -// No references to QhullPoint.  Prevents use of QHULL_DECLARE_SEQUENTIAL_ITERATOR(PointCoordinates, QhullPoint)
    -class PointCoordinatesIterator
    -{
    -    typedef PointCoordinates::const_iterator const_iterator;
    -    const PointCoordinates *c;
    -    const_iterator i;
    -    public:
    -    inline PointCoordinatesIterator(const PointCoordinates &container)
    -    : c(&container), i(c->constBegin()) {}
    -    inline PointCoordinatesIterator &operator=(const PointCoordinates &container)
    -    { c = &container; i = c->constBegin(); return *this; }
    -    inline void toFront() { i = c->constBegin(); }
    -    inline void toBack() { i = c->constEnd(); }
    -    inline bool hasNext() const { return i != c->constEnd(); }
    -    inline const QhullPoint next() { return *i++; }
    -    inline const QhullPoint peekNext() const { return *i; }
    -    inline bool hasPrevious() const { return i != c->constBegin(); }
    -    inline const QhullPoint previous() { return *--i; }
    -    inline const QhullPoint peekPrevious() const { const_iterator p = i; return *--p; }
    -    inline bool findNext(const QhullPoint &t)
    -    { while (i != c->constEnd()) if (*i++ == t) return true; return false; }
    -    inline bool findPrevious(const QhullPoint &t)
    -    { while (i != c->constBegin()) if (*(--i) == t) return true;
    -    return false;  }
    -};//CoordinatesIterator
    -
    -// FIXUP QH11002:  Add MutablePointCoordinatesIterator after adding modify operators
    -\
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -std::ostream           &operator<<(std::ostream &os, const orgQhull::PointCoordinates &p);
    -
    -#endif // QHPOINTCOORDINATES_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.cpp
    deleted file mode 100644
    index 9923059e96..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.cpp
    +++ /dev/null
    @@ -1,543 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/Qhull.cpp#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! Qhull -- invoke qhull from C++
    -#//! Compile libqhull and Qhull together due to use of setjmp/longjmp()
    -
    -#include "QhullError.h"
    -#include "UsingLibQhull.h"
    -#include "RboxPoints.h"
    -#include "QhullQh.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetList.h"
    -#include "Qhull.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -
    -using std::cerr;
    -using std::string;
    -using std::vector;
    -using std::ostream;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Global variables
    -
    -char s_unsupported_options[]=" Fd TI ";
    -char s_not_output_options[]= " Fd TI A C d E H P Qb QbB Qbb Qc Qf Qg Qi Qm QJ Qr QR Qs Qt Qv Qx Qz Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 R Tc TC TM TP TR Tv TV TW U v V W ";
    -
    -#//Constructor, destructor, etc.
    -Qhull::
    -Qhull()
    -: qhull_qh(0)
    -, qhull_run_id(UsingLibQhull::NOqhRunId)
    -, origin_point()
    -, qhull_status(qh_ERRnone)
    -, qhull_dimension(0)
    -, run_called(false)
    -, qh_active(false)
    -, qhull_message()
    -, error_stream(0)
    -, output_stream(0)
    -, feasiblePoint()
    -, useOutputStream(false)
    -{
    -    initializeQhull();
    -}//Qhull
    -
    -Qhull::
    -Qhull(const RboxPoints &rboxPoints, const char *qhullCommand2)
    -: qhull_qh(0)
    -, qhull_run_id(UsingLibQhull::NOqhRunId)
    -, origin_point()
    -, qhull_status(qh_ERRnone)
    -, qhull_dimension(0)
    -, run_called(false)
    -, qh_active(false)
    -, qhull_message()
    -, error_stream(0)
    -, output_stream(0)
    -, feasiblePoint()
    -, useOutputStream(false)
    -{
    -    initializeQhull();
    -    runQhull(rboxPoints, qhullCommand2);
    -}//Qhull rbox
    -
    -Qhull::
    -Qhull(const char *rboxCommand2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2)
    -: qhull_qh(0)
    -, qhull_run_id(UsingLibQhull::NOqhRunId)
    -, origin_point()
    -, qhull_status(qh_ERRnone)
    -, qhull_dimension(0)
    -, run_called(false)
    -, qh_active(false)
    -, qhull_message()
    -, error_stream(0)
    -, output_stream(0)
    -, feasiblePoint()
    -, useOutputStream(false)
    -{
    -    initializeQhull();
    -    runQhull(rboxCommand2, pointDimension, pointCount, pointCoordinates, qhullCommand2);
    -}//Qhull points
    -
    -Qhull::
    -Qhull(const Qhull &other)
    -: qhull_qh(0)
    -, qhull_run_id(UsingLibQhull::NOqhRunId)
    -, origin_point()
    -, qhull_status(qh_ERRnone)
    -, qhull_dimension(0)
    -, run_called(false)
    -, qh_active(false)
    -, qhull_message(other.qhull_message)
    -, error_stream(other.error_stream)
    -, output_stream(other.output_stream)
    -, feasiblePoint(other.feasiblePoint)
    -, useOutputStream(other.useOutputStream)
    -{
    -    if(other.initialized()){
    -        throw QhullError(10069, "Qhull error: can not use Qhull copy constructor if initialized() is true");
    -    }
    -    initializeQhull();
    -}//copy constructor
    -
    -Qhull & Qhull::
    -operator=(const Qhull &other)
    -{
    -    if(other.initialized() || initialized()){
    -        throw QhullError(10070, "Qhull error: can not use Qhull copy assignment if initialized() is true");
    -    }
    -    qhull_message= other.qhull_message;
    -    error_stream= other.error_stream;
    -    output_stream= other.output_stream;
    -    feasiblePoint= other.feasiblePoint;
    -    useOutputStream= other.useOutputStream;
    -    return *this;
    -}//copy constructor
    -
    -void Qhull::
    -initializeQhull()
    -{
    -    #if qh_QHpointer
    -        qhull_qh= new QhullQh;
    -        qhull_qh->old_qhstat= qh_qhstat;
    -        qhull_qh->old_tempstack= qhmem.tempstack;
    -        qh_qh= 0;
    -        qh_qhstat= 0;
    -    #else
    -        qhull_qh= new (&qh_qh) QhullQh;
    -        qhull_qh->old_qhstat= &qh_qhstat;
    -        qhull_qh->old_tempstack= qhmem.tempstack;
    -    #endif
    -    qhmem.tempstack= 0;
    -    qhull_run_id= qhull_qh->run_id;
    -}//initializeQhull
    -
    -Qhull::
    -~Qhull() throw()
    -{
    -    //! UsingLibQhull is required by ~QhullQh
    -    UsingLibQhull q(this, QhullError::NOthrow);
    -    if(q.defined()){
    -        int exitCode = setjmp(qh errexit);
    -        if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -#if qh_QHpointer
    -            delete qhull_qh;
    -            // clears qhull_qh and qh_qh
    -            qh_qh= 0;
    -#else
    -            qhull_qh->~QhullQh();
    -            qhull_qh= 0;
    -#endif
    -            qhull_run_id= UsingLibQhull::NOqhRunId;
    -            // Except for cerr, does not throw errors
    -            if(hasQhullMessage()){
    -                cerr<< "\nQhull output at end\n"; //FIXUP QH11005: where should error and log messages go on ~Qhull?
    -                cerr<num_points*hullDimension(), qhull_qh->first_point);
    -}//points
    -
    -QhullPointSet Qhull::
    -otherPoints() const
    -{
    -    return QhullPointSet(hullDimension(), qhull_qh->other_points);
    -}//otherPoints
    -
    -//! Return vertices of the convex hull.
    -QhullVertexList Qhull::
    -vertexList() const{
    -    return QhullVertexList(beginVertex(), endVertex());
    -}//vertexList
    -
    -#//Modify
    -
    -void Qhull::
    -outputQhull()
    -{
    -    checkIfQhullInitialized();
    -    UsingLibQhull q(this);
    -    int exitCode = setjmp(qh errexit);
    -    if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -        qh_produce_output2();
    -    }
    -    maybeThrowQhullMessage(exitCode);
    -}//outputQhull
    -
    -void Qhull::
    -outputQhull(const char *outputflags)
    -{
    -    checkIfQhullInitialized();
    -    UsingLibQhull q(this);
    -    string cmd(" "); // qh_checkflags skips first word
    -    cmd += outputflags;
    -    char *command= const_cast(cmd.c_str());
    -    int exitCode = setjmp(qh errexit);
    -    if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -        qh_clear_outputflags();
    -        char *s = qh qhull_command + strlen(qh qhull_command) + 1; //space
    -        strncat(qh qhull_command, command, sizeof(qh qhull_command)-strlen(qh qhull_command)-1);
    -        qh_checkflags(command, s_not_output_options);
    -        qh_initflags(s);
    -        qh_initqhull_outputflags();
    -        if(qh KEEPminArea < REALmax/2
    -           || (0 != qh KEEParea + qh KEEPmerge + qh GOODvertex
    -                    + qh GOODthreshold + qh GOODpoint + qh SPLITthresholds)){
    -            facetT *facet;
    -            qh ONLYgood= False;
    -            FORALLfacet_(qh facet_list) {
    -                facet->good= True;
    -            }
    -            qh_prepare_output();
    -        }
    -        qh_produce_output2();
    -        if(qh VERIFYoutput && !qh STOPpoint && !qh STOPcone){
    -            qh_check_points();
    -        }
    -    }
    -    maybeThrowQhullMessage(exitCode);
    -}//outputQhull
    -
    -void Qhull::
    -runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2)
    -{
    -    runQhull(rboxPoints.comment().c_str(), rboxPoints.dimension(), rboxPoints.count(), &*rboxPoints.coordinates(), qhullCommand2);
    -}//runQhull, RboxPoints
    -
    -//! points is a array of points, input sites ('d' or 'v'), or halfspaces with offset last ('H')
    -//! Derived from qh_new_qhull [user.c]
    -void Qhull::
    -runQhull(const char *rboxCommand2, int pointDimension, int pointCount, const realT *rboxPoints, const char *qhullCommand2)
    -{
    -    if(run_called){
    -        throw QhullError(10027, "Qhull error: runQhull called twice.  Only one call allowed.");
    -    }
    -    run_called= true;
    -    string s("qhull ");
    -    s += qhullCommand2;
    -    char *command= const_cast(s.c_str());
    -    UsingLibQhull q(this);
    -    int exitCode = setjmp(qh errexit);
    -    if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -        qh_checkflags(command, s_unsupported_options);
    -        qh_initflags(command);
    -        *qh rbox_command= '\0';
    -        strncat( qh rbox_command, rboxCommand2, sizeof(qh rbox_command)-1);
    -        if(qh DELAUNAY){
    -            qh PROJECTdelaunay= True;   // qh_init_B() calls qh_projectinput()
    -        }
    -        pointT *newPoints= const_cast(rboxPoints);
    -        int newDimension= pointDimension;
    -        int newIsMalloc= False;
    -        if(qh HALFspace){
    -            --newDimension;
    -            initializeFeasiblePoint(newDimension);
    -            newPoints= qh_sethalfspace_all(pointDimension, pointCount, newPoints, qh feasible_point);
    -            newIsMalloc= True;
    -        }
    -        qh_init_B(newPoints, pointCount, newDimension, newIsMalloc);
    -        qhull_dimension= (qh DELAUNAY ? qh hull_dim - 1 : qh hull_dim);
    -        qh_qhull();
    -        qh_check_output();
    -        qh_prepare_output();
    -        if(qh VERIFYoutput && !qh STOPpoint && !qh STOPcone){
    -            qh_check_points();
    -        }
    -    }
    -    for(int k= qhull_dimension; k--; ){  // Do not move up (may throw)
    -        origin_point << 0.0;
    -    }
    -    maybeThrowQhullMessage(exitCode);
    -}//runQhull
    -
    -#//Helpers -- be careful of allocating C++ objects due to setjmp/longjmp() error handling by qh_... routines
    -
    -void Qhull::
    -initializeFeasiblePoint(int hulldim)
    -{
    -    if(qh feasible_string){
    -        qh_setfeasible(hulldim);
    -    }else{
    -        if(feasiblePoint.empty()){
    -            qh_fprintf(qh ferr, 6209, "qhull error: missing feasible point for halfspace intersection.  Use option 'Hn,n' or set qh.feasiblePoint\n");
    -            qh_errexit(qh_ERRmem, NULL, NULL);
    -        }
    -        if(feasiblePoint.size()!=(size_t)hulldim){
    -            qh_fprintf(qh ferr, 6210, "qhull error: dimension of feasiblePoint should be %d.  It is %u", hulldim, feasiblePoint.size());
    -            qh_errexit(qh_ERRmem, NULL, NULL);
    -        }
    -        if (!(qh feasible_point= (coordT*)qh_malloc(hulldim * sizeof(coordT)))) {
    -            qh_fprintf(qh ferr, 6202, "qhull error: insufficient memory for feasible point\n");
    -            qh_errexit(qh_ERRmem, NULL, NULL);
    -        }
    -        coordT *t= qh feasible_point;
    -        // No qh_... routines after here -- longjmp() ignores destructor
    -        for(Coordinates::ConstIterator p=feasiblePoint.begin(); p--------------------------------
    -
    -  qh_fprintf(fp, msgcode, format, list of args )
    -    fp is ignored (replaces qh_fprintf() in userprintf.c)
    -    s_qhull_output == Qhull
    -
    -notes:
    -    only called from libqhull
    -    same as fprintf() and RboxPoints::qh_fprintf_rbox()
    -    fgets() is not trapped like fprintf()
    -    Do not throw errors from here.  Use qh_errexit;
    -*/
    -extern "C"
    -void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) {
    -    va_list args;
    -
    -    using namespace orgQhull;
    -
    -    if(!s_qhull_output){
    -        fprintf(stderr, "QH10025 Qhull error: UsingLibQhull not declared prior to calling qh_...().  s_qhull_output==NULL.\n");
    -        qh_exit(10025);
    -    }
    -    Qhull *out= s_qhull_output;
    -    va_start(args, fmt);
    -    if(msgcode=MSG_ERROR && msgcodeqhull_statusqhull_status>=MSG_WARNING){
    -                out->qhull_status= msgcode;
    -            }
    -        }
    -        char newMessage[MSG_MAXLEN];
    -        // RoadError will add the message tag
    -        vsnprintf(newMessage, sizeof(newMessage), fmt, args);
    -        out->appendQhullMessage(newMessage);
    -        va_end(args);
    -        return;
    -    }
    -    if(out->output_stream && out->useOutputStream){
    -        char newMessage[MSG_MAXLEN];
    -        vsnprintf(newMessage, sizeof(newMessage), fmt, args);
    -        *out->output_stream << newMessage;
    -        va_end(args);
    -        return;
    -    }
    -    // FIXUP QH11008: how do users trap messages and handle input?  A callback?
    -    char newMessage[MSG_MAXLEN];
    -    vsnprintf(newMessage, sizeof(newMessage), fmt, args);
    -    out->appendQhullMessage(newMessage);
    -    va_end(args);
    -} /* qh_fprintf */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.h
    deleted file mode 100644
    index c9eed9fcdc..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/Qhull.h
    +++ /dev/null
    @@ -1,147 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/Qhull.h#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLCPP_H
    -#define QHULLCPP_H
    -
    -#include "QhullQh.h"
    -#include "RboxPoints.h"
    -#include "QhullLinkedList.h"
    -#include "QhullPoint.h"
    -#include "QhullPoints.h"
    -#include "QhullVertex.h"
    -#include "QhullFacet.h"
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#if qh_QHpointer != 1
    -#error  qh_QHpointer is not set.  Please set it in user.h or
    -#error  compile Qhull with -Dqh_QHpointer.  The C++ classes
    -#error  require dynamic allocation for Qhulls global data
    -#error  structure qhT (QhullQh).
    -#endif
    -
    -namespace orgQhull {
    -
    -/***
    -   Compile qhullcpp and libqhull with the same compiler.  setjmp() and longjmp() must be the same.
    -*/
    -
    -#//Types
    -    //! Qhull -- run Qhull from C++
    -    class Qhull;
    -
    -    //Defined elsewhere
    -    class QhullFacetList;
    -    class RboxPoints;
    -
    -class Qhull {
    -
    -private:
    -#//Members and friends
    -    QhullQh            *qhull_qh;       //! qh_qh for this instance
    -    int                 qhull_run_id;    //! qh.run_id at initialization (catch multiple runs if !qh_QHpointer)
    -    Coordinates         origin_point;   //! origin for qhull_dimension.  Set by runQhull()
    -    int                 qhull_status;   //! qh_ERRnone if valid
    -    int                 qhull_dimension; //! Dimension of result (qh.hull_dim or one less for Delaunay/Voronoi)
    -    bool                run_called;     //! True at start of runQhull.  Errors if call again.
    -    bool                qh_active;      //! True if global pointer qh_qh equals qhull_qh
    -    std::string         qhull_message;
    -    std::ostream       *error_stream;   //! overrides errorMessage, use appendQhullMessage()
    -    std::ostream       *output_stream;  //! send output to stream
    -
    -    friend void       ::qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... );
    -    friend class        UsingLibQhull;
    -
    -#//Attribute
    -public:
    -    Coordinates         feasiblePoint;  //! feasible point for half-space intersection
    -    bool                useOutputStream; //! Set if using outputStream
    -    // FIXUP QH11003 feasiblePoint useOutputStream as field or getter?
    -
    -#//constructor, assignment, destructor, invariant
    -                        Qhull();      //! Qhull::runQhull() must be called next
    -                        Qhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
    -                        Qhull(const char *rboxCommand2, int pointDimension, int pointCount, const realT *pointCoordinates, const char *qhullCommand2);
    -                        // Throws error if other.initialized().  Needed for return by value and parameter passing
    -                        Qhull(const Qhull &other);
    -                        // Throws error if initialized() or other.initialized().  Needed for vector
    -    Qhull              &operator=(const Qhull &other);
    -                       ~Qhull() throw();
    -private:
    -    void                initializeQhull();
    -
    -public:
    -#//virtual methods
    -    //FIXUP QH11004 -- qh_memfree, etc. as virtual?
    -
    -#//Messaging
    -    void                appendQhullMessage(const std::string &s);
    -    void                clearQhullMessage();
    -    std::string         qhullMessage() const;
    -    bool                hasQhullMessage() const;
    -    int                 qhullStatus() const;
    -    void                setErrorStream(std::ostream *os);
    -    void                setOutputStream(std::ostream *os);
    -
    -#//GetSet
    -    void                checkIfQhullInitialized();
    -    bool                initialized() const { return qhull_dimension>0; }
    -    int                 dimension() const { return qhull_dimension; }
    -    int                 hullDimension() const { return qhullQh()->hull_dim; }
    -                        // non-const due to QhullPoint
    -    QhullPoint          origin() { QHULL_ASSERT(initialized()); return QhullPoint(dimension(), origin_point.data()); }
    -    QhullQh            *qhullQh() const { return qhull_qh; };
    -    int                 runId(); // Modifies my_qhull
    -
    -#//GetQh -- access to qhT (Qhull's global data structure)
    -    const char         *qhullCommand() const { return qhull_qh->qhull_command; }
    -    const char         *rboxCommand() const { return qhull_qh->rbox_command; }
    -    int                 facetCount() const { return qhull_qh->num_facets; }
    -    int                 vertexCount() const { return qhull_qh->num_vertices; }
    -
    -#//GetValue
    -    double              area();
    -    double              volume();
    -
    -#//ForEach
    -    QhullFacet          beginFacet() const { return QhullFacet(qhull_qh->facet_list); }
    -    QhullVertex         beginVertex() const { return QhullVertex(qhull_qh->vertex_list); }
    -    void                defineVertexNeighborFacets(); //!< Automatically called if merging facets or Voronoi diagram
    -    QhullFacet          endFacet() const { return QhullFacet(qhull_qh->facet_tail); }
    -    QhullVertex         endVertex() const { return QhullVertex(qhull_qh->vertex_tail); }
    -    QhullFacetList      facetList() const;
    -    QhullFacet          firstFacet() const { return beginFacet(); }
    -    QhullVertex         firstVertex() const { return beginVertex(); }
    -    QhullPoints         points() const;
    -    QhullPointSet       otherPoints() const;
    -                        //! Same as points().coordinates()
    -    coordT             *pointCoordinateBegin() const { return qhull_qh->first_point; }
    -    coordT             *pointCoordinateEnd() const { return qhull_qh->first_point + qhull_qh->num_points*qhull_qh->hull_dim; }
    -    QhullVertexList     vertexList() const;
    -
    -#//Modify
    -    void                outputQhull();
    -    void                outputQhull(const char * outputflags);
    -    void                runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2);
    -    void                runQhull(const char *rboxCommand2, int pointDimension, int pointCount, const realT *rboxPoints, const char *qhullCommand2);
    -
    -private:
    -#//Helpers
    -    void                initializeFeasiblePoint(int hulldim);
    -    void                maybeThrowQhullMessage(int exitCode);
    -    void                maybeThrowQhullMessage(int exitCode, int noThrow) throw();
    -};//Qhull
    -
    -}//namespace orgQhull
    -
    -#endif // QHULLCPP_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullError.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullError.h
    deleted file mode 100644
    index 861737b372..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullError.h
    +++ /dev/null
    @@ -1,64 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullError.h#5 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLERROR_H
    -#define QHULLERROR_H
    -
    -#include "RoadError.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! QhullError -- std::exception class for Qhull
    -    class QhullError;
    -
    -class QhullError : public RoadError {
    -
    -public:
    -#//Constants
    -    enum {
    -        QHULLfirstError= 10000, //MSG_QHULL_ERROR in Qhull's user.h
    -        QHULLlastError= 10070,
    -        NOthrow= 1 //! For flag to UsingLibQhull()
    -    };
    -
    -#//Constructors
    -    // default constructors
    -    QhullError() : RoadError() {};
    -    QhullError(const QhullError &other) : RoadError(other) {}
    -    QhullError(int code, const std::string &message) : RoadError(code, message) {};
    -    QhullError(int code, const char *fmt) : RoadError(code, fmt) {};
    -    QhullError(int code, const char *fmt, int d) : RoadError(code, fmt, d) {};
    -    QhullError(int code, const char *fmt, int d, int d2) : RoadError(code, fmt, d, d2) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f) : RoadError(code, fmt, d, d2, f) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f, const char *s) : RoadError(code, fmt, d, d2, f, s) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f, const void *x) : RoadError(code, fmt, d, d2, f, x) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f, int i) : RoadError(code, fmt, d, d2, f, i) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f, long long i) : RoadError(code, fmt, d, d2, f, i) {};
    -    QhullError(int code, const char *fmt, int d, int d2, float f, double e) : RoadError(code, fmt, d, d2, f, e) {};
    -    QhullError &operator=(const QhullError &other) { this->RoadError::operator=(other); return *this; }
    -    ~QhullError() throw() {}
    -
    -};//class QhullError
    -
    -#ifndef QHULL_1
    -    #define QHULL_ASSERT assert
    -
    -#endif
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullError &e) { return os << e.what(); }
    -
    -#endif // QHULLERROR_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.cpp
    deleted file mode 100644
    index 5f2c69738c..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.cpp
    +++ /dev/null
    @@ -1,524 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacet.cpp#7 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullFacet -- Qhull's facet structure, facetT, as a C++ class
    -
    -#include "QhullError.h"
    -#include "QhullSet.h"
    -#include "QhullPoint.h"
    -#include "QhullPointSet.h"
    -#include "QhullRidge.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetSet.h"
    -#include "QhullVertex.h"
    -
    -#include 
    -
    -using std::endl;
    -using std::string;
    -using std::vector;
    -using std::ostream;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//class statics
    -facetT QhullFacet::
    -        s_empty_facet= {0,0,0,0,{0},
    -                0,0,0,0,0,
    -                0,0,0,0,0,
    -                0,0,0,0,0,
    -                0,0,0,0,0,
    -                0,0,0,0,0,
    -                0,0,0,0,0,
    -                0,0,0,0};
    -
    -#//GetSet
    -
    -int QhullFacet::
    -dimension() const
    -{
    -    if(qh_facet->ridges){
    -        setT *s= qh_facet->ridges;
    -        ridgeT *r= reinterpret_cast(SETfirst_(s));
    -        return r ? QhullSetBase::count(r->vertices)+1 : 0;
    -    }else{
    -        return QhullSetBase::count(qh_facet->vertices);
    -    }
    -}//dimension
    -
    -//! Return voronoi center or facet centrum.  Derived from qh_printcenter [io.c]
    -//! printFormat=qh_PRINTtriangles if return centrum of a Delaunay facet
    -//! Sets center if needed
    -//! Code duplicated for PrintCenter and getCenter
    -//! .empty() if none or qh_INFINITE
    -QhullPoint QhullFacet::
    -getCenter(int qhRunId, qh_PRINT printFormat)
    -{
    -    UsingLibQhull q(qhRunId);
    -
    -    if(qh CENTERtype==qh_ASvoronoi){
    -        if(!qh_facet->normal || !qh_facet->upperdelaunay || !qh ATinfinity){
    -            if(!qh_facet->center){
    -                int exitCode = setjmp(qh errexit);
    -                if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -                    qh_facet->center= qh_facetcenter(qh_facet->vertices);
    -                }
    -                q.maybeThrowQhullMessage(exitCode);
    -            }
    -            return QhullPoint(qh hull_dim-1, qh_facet->center);
    -        }
    -    }else if(qh CENTERtype==qh_AScentrum){
    -        volatile int numCoords= qh hull_dim;
    -        if(printFormat==qh_PRINTtriangles && qh DELAUNAY){
    -            numCoords--;
    -        }
    -        if(!qh_facet->center){
    -            int exitCode = setjmp(qh errexit);
    -            if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -                qh_facet->center= qh_getcentrum(getFacetT());
    -            }
    -            q.maybeThrowQhullMessage(exitCode);
    -        }
    -        return QhullPoint(numCoords, qh_facet->center);
    -    }
    -    return QhullPoint();
    - }//getCenter
    -
    -//! Return innerplane clearly below the vertices
    -//! from io.c[qh_PRINTinner]
    -QhullHyperplane QhullFacet::
    -innerplane(int qhRunId) const{
    -    UsingLibQhull q(qhRunId);
    -    realT inner;
    -    // Does not error
    -    qh_outerinner(const_cast(getFacetT()), NULL, &inner);
    -    QhullHyperplane h= hyperplane();
    -    h.setOffset(h.offset()-inner); //inner is negative
    -    return h;
    -}//innerplane
    -
    -//! Return outerplane clearly above all points
    -//! from io.c[qh_PRINTouter]
    -QhullHyperplane QhullFacet::
    -outerplane(int qhRunId) const{
    -    UsingLibQhull q(qhRunId);
    -    realT outer;
    -    // Does not error
    -    qh_outerinner(const_cast(getFacetT()), &outer, NULL);
    -    QhullHyperplane h= hyperplane();
    -    h.setOffset(h.offset()-outer); //outer is positive
    -    return h;
    -}//outerplane
    -
    -//! Set by qh_triangulate for option 'Qt'.
    -//! Errors if tricoplanar and facetArea() or qh_getarea() called first.
    -QhullFacet QhullFacet::
    -tricoplanarOwner() const
    -{
    -    if(qh_facet->tricoplanar){
    -        if(qh_facet->isarea){
    -            throw QhullError(10018, "Qhull error: facetArea() or qh_getarea() previously called.  triCoplanarOwner() is not available.");
    -        }
    -        return qh_facet->f.triowner;
    -    }
    -    return 0; // FIXUP QH11009 Should false be the NULL facet or empty facet
    -}//tricoplanarOwner
    -
    -QhullPoint QhullFacet::
    -voronoiVertex(int qhRunId)
    -{
    -    if(
    -#if qh_QHpointer
    -      !qh_qh ||
    -#endif
    -      qh CENTERtype!=qh_ASvoronoi){
    -          throw QhullError(10052, "Error: QhullFacet.voronoiVertex() requires option 'v' (qh_ASvoronoi)");
    -    }
    -    return getCenter(qhRunId);
    -}//voronoiVertex
    -
    -#//Value
    -
    -//! Disables tricoplanarOwner()
    -double QhullFacet::
    -facetArea(int qhRunId)
    -{
    -    if(!qh_facet->isarea){
    -        UsingLibQhull q(qhRunId);
    -        int exitCode = setjmp(qh errexit);
    -        if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -            qh_facet->f.area= qh_facetarea(qh_facet);
    -            qh_facet->isarea= True;
    -        }
    -        q.maybeThrowQhullMessage(exitCode);
    -    }
    -    return qh_facet->f.area;
    -}//facetArea
    -
    -#//Foreach
    -
    -QhullPointSet QhullFacet::
    -coplanarPoints() const
    -{
    -    return QhullPointSet(dimension(), qh_facet->coplanarset);
    -}//coplanarPoints
    -
    -QhullFacetSet QhullFacet::
    -neighborFacets() const
    -{
    -    return QhullFacetSet(qh_facet->neighbors);
    -}//neighborFacets
    -
    -QhullPointSet QhullFacet::
    -outsidePoints() const
    -{
    -    return QhullPointSet(dimension(), qh_facet->outsideset);
    -}//outsidePoints
    -
    -QhullRidgeSet QhullFacet::
    -ridges() const
    -{
    -    return QhullRidgeSet(qh_facet->ridges);
    -}//ridges
    -
    -QhullVertexSet QhullFacet::
    -vertices() const
    -{
    -    return QhullVertexSet(qh_facet->vertices);
    -}//vertices
    -
    -
    -}//namespace orgQhull
    -
    -#//operator<<
    -
    -using std::ostream;
    -
    -using orgQhull::QhullFacet;
    -using orgQhull::QhullFacetSet;
    -using orgQhull::QhullPoint;
    -using orgQhull::QhullPointSet;
    -using orgQhull::QhullRidge;
    -using orgQhull::QhullRidgeSet;
    -using orgQhull::QhullSetBase;
    -using orgQhull::QhullVertexSet;
    -using orgQhull::UsingLibQhull;
    -
    -ostream &
    -operator<<(ostream &os, const QhullFacet::PrintFacet &pr)
    -{
    -    QhullFacet f= *pr.facet;
    -    if(f.getFacetT()==0){ // Special values from set iterator
    -        os << " NULLfacet" << endl;
    -        return os;
    -    }
    -    if(f.getFacetT()==qh_MERGEridge){
    -        os << " MERGEridge" << endl;
    -        return os;
    -    }
    -    if(f.getFacetT()==qh_DUPLICATEridge){
    -        os << " DUPLICATEridge" << endl;
    -        return os;
    -    }
    -    os << f.printHeader(pr.run_id);
    -    if(!f.ridges().isEmpty()){
    -        os << f.printRidges(pr.run_id);
    -    }
    -    return os;
    -}//operator<< PrintFacet
    -
    -//! Print Voronoi center or facet centrum to stream.  Same as qh_printcenter [io.c]
    -//! Code duplicated for PrintCenter and getCenter
    -//! Sets center if needed
    -ostream &
    -operator<<(ostream &os, const QhullFacet::PrintCenter &pr)
    -{
    -    facetT *f= pr.facet->getFacetT();
    -    if(qh CENTERtype!=qh_ASvoronoi && qh CENTERtype!=qh_AScentrum){
    -        return os;
    -    }
    -    if (pr.message){
    -        os << pr.message;
    -    }
    -    int numCoords;
    -    if(qh CENTERtype==qh_ASvoronoi){
    -        numCoords= qh hull_dim-1;
    -        if(!f->normal || !f->upperdelaunay || !qh ATinfinity){
    -            if(!f->center){
    -                f->center= qh_facetcenter(f->vertices);
    -            }
    -            for(int k=0; kcenter[k] << " "; // FIXUP QH11010 qh_REAL_1
    -            }
    -        }else{
    -            for(int k=0; kcenter){
    -            f->center= qh_getcentrum(f);
    -        }
    -        for(int k=0; kcenter[k] << " "; // FIXUP QH11010 qh_REAL_1
    -        }
    -    }
    -    if(pr.print_format==qh_PRINTgeom && numCoords==2){
    -        os << " 0";
    -    }
    -    os << endl;
    -    return os;
    -}//operator<< PrintCenter
    -
    -//! Print flags for facet to stream.  Space prefix.  From qh_printfacetheader [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullFacet::PrintFlags &p)
    -{
    -    const facetT *f= p.facet->getFacetT();
    -    if(p.message){
    -        os << p.message;
    -    }
    -
    -    os << (p.facet->isTopOrient() ? " top" : " bottom");
    -    if(p.facet->isSimplicial()){
    -        os << " simplicial";
    -    }
    -    if(p.facet->isTriCoplanar()){
    -        os << " tricoplanar";
    -    }
    -    if(p.facet->isUpperDelaunay()){
    -        os << " upperDelaunay";
    -    }
    -    if(f->visible){
    -        os << " visible";
    -    }
    -    if(f->newfacet){
    -        os << " new";
    -    }
    -    if(f->tested){
    -        os << " tested";
    -    }
    -    if(!f->good){
    -        os << " notG";
    -    }
    -    if(f->seen){
    -        os << " seen";
    -    }
    -    if(f->coplanar){
    -        os << " coplanar";
    -    }
    -    if(f->mergehorizon){
    -        os << " mergehorizon";
    -    }
    -    if(f->keepcentrum){
    -        os << " keepcentrum";
    -    }
    -    if(f->dupridge){
    -        os << " dupridge";
    -    }
    -    if(f->mergeridge && !f->mergeridge2){
    -        os << " mergeridge1";
    -    }
    -    if(f->mergeridge2){
    -        os << " mergeridge2";
    -    }
    -    if(f->newmerge){
    -        os << " newmerge";
    -    }
    -    if(f->flipped){
    -        os << " flipped";
    -    }
    -    if(f->notfurthest){
    -        os << " notfurthest";
    -    }
    -    if(f->degenerate){
    -        os << " degenerate";
    -    }
    -    if(f->redundant){
    -        os << " redundant";
    -    }
    -    os << endl;
    -    return os;
    -}//operator<< PrintFlags
    -
    -//! Print header for facet to stream. Space prefix.  From qh_printfacetheader [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullFacet::PrintHeader &pr)
    -{
    -    QhullFacet facet= *pr.facet;
    -    facetT *f= facet.getFacetT();
    -    os << "- f" << facet.id() << endl;
    -    os << facet.printFlags("    - flags:");
    -    if(f->isarea){
    -        os << "    - area: " << f->f.area << endl; //FIXUP QH11010 2.2g
    -    }else if(qh NEWfacets && f->visible && f->f.replace){
    -        os << "    - replacement: f" << f->f.replace->id << endl;
    -    }else if(f->newfacet){
    -        if(f->f.samecycle && f->f.samecycle != f){
    -            os << "    - shares same visible/horizon as f" << f->f.samecycle->id << endl;
    -        }
    -    }else if(f->tricoplanar /* !isarea */){
    -        if(f->f.triowner){
    -            os << "    - owner of normal & centrum is facet f" << f->f.triowner->id << endl;
    -        }
    -    }else if(f->f.newcycle){
    -        os << "    - was horizon to f" << f->f.newcycle->id << endl;
    -    }
    -    if(f->nummerge){
    -        os << "    - merges: " << f->nummerge << endl;
    -    }
    -    os << facet.hyperplane().print("    - normal: ", "\n    - offset: "); // FIXUP QH11010 %10.7g
    -    if(qh CENTERtype==qh_ASvoronoi || f->center){
    -        os << facet.printCenter(pr.run_id, qh_PRINTfacets, "    - center: ");
    -    }
    -#if qh_MAXoutside
    -    if(f->maxoutside > qh DISTround){
    -        os << "    - maxoutside: " << f->maxoutside << endl; //FIXUP QH11010 %10.7g
    -    }
    -#endif
    -    QhullPointSet ps= facet.outsidePoints();
    -    if(!ps.isEmpty()){
    -        QhullPoint furthest= ps.last();
    -        if (ps.size() < 6) {
    -            os << "    - outside set(furthest p" << furthest.id(pr.run_id) << "):" << endl;
    -            for(QhullPointSet::iterator i=ps.begin(); i!=ps.end(); ++i){
    -                QhullPoint p= *i;
    -                os << p.print(pr.run_id, "     ");
    -            }
    -        }else if(ps.size()<21){
    -            os << ps.print(pr.run_id, "    - outside set:");
    -        }else{
    -            os << "    - outside set:  " << ps.size() << " points.";
    -            os << furthest.print(pr.run_id, "  Furthest");
    -        }
    -#if !qh_COMPUTEfurthest
    -        os << "    - furthest distance= " << f->furthestdist << endl; //FIXUP QH11010 %2.2g
    -#endif
    -    }
    -    QhullPointSet cs= facet.coplanarPoints();
    -    if(!cs.isEmpty()){
    -        QhullPoint furthest= cs.last();
    -        if (cs.size() < 6) {
    -            os << "    - coplanar set(furthest p" << furthest.id(pr.run_id) << "):" << endl;
    -            for(QhullPointSet::iterator i=cs.begin(); i!=cs.end(); ++i){
    -                QhullPoint p= *i;
    -                os << p.print(pr.run_id, "     ");
    -            }
    -        }else if(cs.size()<21){
    -            os << cs.print(pr.run_id, "    - coplanar set:");
    -        }else{
    -            os << "    - coplanar set:  " << cs.size() << " points.";
    -            os << furthest.print(pr.run_id, "  Furthest");
    -        }
    -        zinc_(Zdistio);
    -        double d= facet.distance(furthest);
    -        os << "      furthest distance= " << d << endl; //FIXUP QH11010 %2.2g
    -    }
    -    QhullVertexSet vs= facet.vertices();
    -    if(!vs.isEmpty()){
    -        os << vs.print(pr.run_id, "    - vertices:");
    -    }
    -    QhullFacetSet fs= facet.neighborFacets();
    -    fs.selectAll();
    -    if(!fs.isEmpty()){
    -        os << fs.printIdentifiers("    - neighboring facets:");
    -    }
    -    return os;
    -}//operator<< PrintHeader
    -
    -
    -//! Print ridges of facet to stream.  Same as qh_printfacetridges [io.c]
    -//! If qhRunId==UsingLibQhull::NOqhRunId, does not use qh
    -ostream &
    -operator<<(ostream &os, const QhullFacet::PrintRidges &pr)
    -{
    -    const QhullFacet facet= *pr.facet;
    -    facetT *f= facet.getFacetT();
    -    QhullRidgeSet rs= facet.ridges();
    -    if(!rs.isEmpty()){
    -        if(pr.run_id!=UsingLibQhull::NOqhRunId){
    -            UsingLibQhull q(pr.run_id);
    -            // No calls to libqhull
    -            if(f->visible && qh NEWfacets){
    -                os << "    - ridges(ids may be garbage):";
    -                for(QhullRidgeSet::iterator i=rs.begin(); i!=rs.end(); ++i){
    -                    QhullRidge r= *i;
    -                    os << " r" << r.id();
    -                }
    -                os << endl;
    -            }else{
    -                os << "    - ridges:" << endl;
    -            }
    -        }else{
    -            os << "    - ridges:" << endl;
    -        }
    -
    -        // Keep track of printed ridges
    -        for(QhullRidgeSet::iterator i=rs.begin(); i!=rs.end(); ++i){
    -            QhullRidge r= *i;
    -            r.getRidgeT()->seen= false;
    -        }
    -        int ridgeCount= 0;
    -        if(facet.dimension()==3){
    -            for(QhullRidge r= rs.first(); !r.getRidgeT()->seen; r= r.nextRidge3d(facet)){
    -                r.getRidgeT()->seen= true;
    -                os << r.print(pr.run_id);
    -                ++ridgeCount;
    -                if(!r.hasNextRidge3d(facet)){
    -                    break;
    -                }
    -            }
    -        }else {
    -            QhullFacetSet ns(facet.neighborFacets());
    -            for(QhullFacetSet::iterator i=ns.begin(); i!=ns.end(); ++i){
    -                QhullFacet neighbor= *i;
    -                QhullRidgeSet nrs(neighbor.ridges());
    -                for(QhullRidgeSet::iterator j=nrs.begin(); j!=nrs.end(); ++j){
    -                    QhullRidge r= *j;
    -                    if(r.otherFacet(neighbor)==facet){
    -                        r.getRidgeT()->seen= true;
    -                        os << r.print(pr.run_id);
    -                        ridgeCount++;
    -                    }
    -                }
    -            }
    -        }
    -        if(ridgeCount!=rs.count()){
    -            os << "     - all ridges:";
    -            for(QhullRidgeSet::iterator i=rs.begin(); i!=rs.end(); ++i){
    -                QhullRidge r= *i;
    -                os << " r" << r.id();
    -            }
    -            os << endl;
    -        }
    -        for(QhullRidgeSet::iterator i=rs.begin(); i!=rs.end(); ++i){
    -            QhullRidge r= *i;
    -            if(!r.getRidgeT()->seen){
    -                os << r.print(pr.run_id);
    -            }
    -        }
    -    }
    -    return os;
    -}//operator<< PrintRidges
    -
    -// "No conversion" error if defined inline
    -ostream &
    -operator<<(ostream &os, QhullFacet &f)
    -{
    -    os << f.print(UsingLibQhull::NOqhRunId);
    -    return os;
    -}//<< QhullFacet
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.h
    deleted file mode 100644
    index 5f4433713e..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacet.h
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacet.h#7 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLFACET_H
    -#define QHULLFACET_H
    -
    -#include "Coordinates.h"
    -#include "QhullHyperplane.h"
    -#include "QhullPoint.h"
    -#include "QhullSet.h"
    -#include "QhullPointSet.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class QhullFacetSet;
    -    class QhullRidge;
    -    typedef QhullSet  QhullRidgeSet;
    -    class QhullVertex;
    -    class QhullVertexSet;
    -
    -#//Types
    -    //! QhullFacet -- Qhull's facet structure, facetT [libqhull.h], as a C++ class
    -    class QhullFacet;
    -
    -//! A QhullFacet is the C++ equivalent to Qhull's facetT*
    -class QhullFacet {
    -
    -private:
    -#//Fields -- no additions (QhullFacetSet of facetT*)
    -    facetT             *qh_facet;  //! May be 0 (!isDefined) for corner cases (e.g., *facetSet.end()==0) and tricoplanarOwner()
    -
    -#//Class objects
    -    static facetT       s_empty_facet; // needed for shallow copy
    -
    -public:
    -#//Constants
    -
    -#//Constructors
    -                        QhullFacet() : qh_facet(&s_empty_facet) {}
    -                        // Creates an alias.  Does not copy QhullFacet.  Needed for return by value and parameter passing
    -                        QhullFacet(const QhullFacet &o) : qh_facet(o.qh_facet ? o.qh_facet : &s_empty_facet) {}
    -                        // Creates an alias.  Does not copy QhullFacet.  Needed for vector
    -    QhullFacet         &operator=(const QhullFacet &o) { qh_facet= o.qh_facet ? o.qh_facet : &s_empty_facet; return *this; }
    -                       ~QhullFacet() {}
    -
    -#//Conversion
    -                        //Implicit conversion from facetT
    -                        QhullFacet(facetT *f) : qh_facet(f ? f : &s_empty_facet) {}
    -                        // Do not define facetT().  It conflicts with return type facetT*
    -    facetT             *getFacetT() const { return qh_facet; }
    -
    -#//QhullSet
    -    facetT             *getBaseT() const { return getFacetT(); }
    -
    -#//getSet
    -    int                 dimension() const;
    -    QhullPoint          getCenter(int qhRunId) { return getCenter(qhRunId, qh_PRINTpoints); }
    -    QhullPoint          getCenter(int qhRunId, qh_PRINT printFormat);
    -    QhullHyperplane     hyperplane() const { return QhullHyperplane(dimension(), qh_facet->normal, qh_facet->offset); }
    -    int                 id() const { return qh_facet ? qh_facet->id : -1; }
    -    QhullHyperplane     innerplane(int qhRunId) const;
    -    bool                isDefined() const { return qh_facet && qh_facet != &s_empty_facet; }
    -    bool                isGood() const { return qh_facet && qh_facet->good; }
    -    bool                isSimplicial() const { return qh_facet->simplicial; }
    -    bool                isTopOrient() const { return qh_facet->toporient; }
    -    bool                isTriCoplanar() const { return qh_facet->tricoplanar; }
    -    bool                isUpperDelaunay() const { return qh_facet->upperdelaunay; }
    -    QhullFacet          next() const { return qh_facet->next; }
    -    bool                operator==(const QhullFacet &o) const { return qh_facet==o.qh_facet; }
    -    bool                operator!=(const QhullFacet &o) const { return !operator==(o); }
    -    QhullHyperplane     outerplane(int qhRunId) const;
    -    QhullFacet          previous() const { return qh_facet->previous; }
    -    QhullFacet          tricoplanarOwner() const;
    -    QhullPoint          voronoiVertex(int qhRunId);
    -
    -#//value
    -    //! Undefined if c.size() != dimension()
    -    double              distance(const Coordinates &c) const { return distance(c.data()); }
    -    double              distance(const pointT *p) const { return distance(QhullPoint(dimension(), const_cast(p))); }
    -    double              distance(const QhullPoint &p) const { return hyperplane().distance(p); }
    -    double              facetArea(int qhRunId);
    -
    -#//foreach
    -    // Can not inline.  Otherwise circular reference
    -    QhullPointSet       coplanarPoints() const;
    -    QhullFacetSet       neighborFacets() const;
    -    QhullPointSet       outsidePoints() const;
    -    QhullRidgeSet       ridges() const;
    -    QhullVertexSet      vertices() const;
    -
    -#//IO
    -    struct PrintCenter{
    -        QhullFacet     *facet;  // non-const due to facet.center()
    -        const char     *message;
    -        int             run_id;
    -        qh_PRINT        print_format;
    -                        PrintCenter(int qhRunId, QhullFacet &f, qh_PRINT printFormat, const char * s) : facet(&f), message(s), run_id(qhRunId), print_format(printFormat){}
    -    };//PrintCenter
    -    PrintCenter         printCenter(int qhRunId, qh_PRINT printFormat, const char *message) { return PrintCenter(qhRunId, *this, printFormat, message); }
    -
    -    struct PrintFacet{
    -        QhullFacet     *facet;  // non-const due to f->center()
    -        int             run_id;
    -                        PrintFacet(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {}
    -    };//PrintFacet
    -    PrintFacet          print(int qhRunId) { return PrintFacet(qhRunId, *this); }
    -
    -    struct PrintFlags{
    -        const QhullFacet *facet;
    -        const char     *message;
    -                        PrintFlags(const QhullFacet &f, const char *s) : facet(&f), message(s) {}
    -    };//PrintFlags
    -    PrintFlags          printFlags(const char *message) const { return PrintFlags(*this, message); }
    -
    -    struct PrintHeader{
    -        QhullFacet     *facet;  // non-const due to f->center()
    -        int             run_id;
    -                        PrintHeader(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {}
    -    };//PrintHeader
    -    PrintHeader         printHeader(int qhRunId) { return PrintHeader(qhRunId, *this); }
    -
    -    struct PrintRidges{
    -        const QhullFacet *facet;
    -        int             run_id;
    -                        PrintRidges(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {}
    -    };//PrintRidges
    -    PrintRidges         printRidges(int qhRunId) { return PrintRidges(qhRunId, *this); }
    -
    -};//class QhullFacet
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintCenter &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintFlags &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintHeader &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintRidges &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintFacet &pr);
    -std::ostream &operator<<(std::ostream &os, orgQhull::QhullFacet &f); // non-const due to qh_getcenter()
    -
    -#endif // QHULLFACET_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.cpp
    deleted file mode 100644
    index 171c91dcd2..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.cpp
    +++ /dev/null
    @@ -1,164 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacetList.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullFacetList -- Qhull's linked facets, as a C++ class
    -
    -#include "QhullFacet.h"
    -#include "QhullFacetList.h"
    -#include "QhullPoint.h"
    -#include "QhullRidge.h"
    -#include "QhullVertex.h"
    -
    -using std::string;
    -using std::vector;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Conversion
    -
    -// See qt_qhull.cpp for QList conversions
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullFacetList::
    -toStdVector() const
    -{
    -    QhullLinkedListIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.push_back(f);
    -        }
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#ifndef QHULL_NO_STL
    -//! Same as PrintVertices
    -std::vector QhullFacetList::
    -vertices_toStdVector(int qhRunId) const
    -{
    -    std::vector vs;
    -    QhullVertexSet qvs(qhRunId, first().getFacetT(), NULL, isSelectAll());
    -
    -    for(QhullVertexSet::iterator i=qvs.begin(); i!=qvs.end(); ++i){
    -        vs.push_back(*i);
    -    }
    -    return vs;
    -}//vertices_toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Read-only
    -
    -bool QhullFacetList::
    -contains(const QhullFacet &facet) const
    -{
    -    if(isSelectAll()){
    -        return QhullLinkedList::contains(facet);
    -    }
    -    for(QhullFacetList::const_iterator i=begin(); i != end(); ++i){
    -        QhullFacet f= *i;
    -        if(f==facet && f.isGood()){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//contains
    -
    -int QhullFacetList::
    -count() const
    -{
    -    if(isSelectAll()){
    -        return QhullLinkedList::count();
    -    }
    -    int counter= 0;
    -    for(QhullFacetList::const_iterator i=begin(); i != end(); ++i){
    -        if((*i).isGood()){
    -            counter++;
    -        }
    -    }
    -    return counter;
    -}//count
    -
    -int QhullFacetList::
    -count(const QhullFacet &facet) const
    -{
    -    if(isSelectAll()){
    -        return QhullLinkedList::count(facet);
    -    }
    -    int counter= 0;
    -    for(QhullFacetList::const_iterator i=begin(); i != end(); ++i){
    -        QhullFacet f= *i;
    -        if(f==facet && f.isGood()){
    -            counter++;
    -        }
    -    }
    -    return counter;
    -}//count
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using orgQhull::QhullFacet;
    -using orgQhull::QhullFacetList;
    -using orgQhull::QhullVertex;
    -using orgQhull::QhullVertexSet;
    -using orgQhull::UsingLibQhull;
    -
    -ostream &
    -operator<<(ostream &os, const QhullFacetList::PrintFacetList &pr)
    -{
    -    QhullFacetList fs= *pr.facet_list;
    -    os << "Vertices for " << fs.count() << " facets" << endl;
    -    os << fs.printVertices(pr.run_id);
    -    os << fs.printFacets(pr.run_id);
    -    return os;
    -}//operator<<
    -
    -//! Print facet list to stream.  From qh_printafacet [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullFacetList::PrintFacets &pr)
    -{
    -    for(QhullFacetList::const_iterator i= pr.facet_list->begin(); i != pr.facet_list->end(); ++i){
    -        QhullFacet f= *i;
    -        if(pr.facet_list->isSelectAll() || f.isGood()){
    -            os << f.print(pr.run_id);
    -        }
    -    }
    -    return os;
    -}//printFacets
    -
    -//! Print vertices of good faces in facet list to stream.  From qh_printvertexlist [io.c]
    -//! Same as vertices_toStdVector
    -ostream &
    -operator<<(ostream &os, const QhullFacetList::PrintVertices &pr)
    -{
    -    QhullVertexSet vs(pr.run_id, pr.facet_list->first().getFacetT(), NULL, pr.facet_list->isSelectAll());
    -    for(QhullVertexSet::iterator i=vs.begin(); i!=vs.end(); ++i){
    -        QhullVertex v= *i;
    -        os << v.print(pr.run_id);
    -    }
    -    return os;
    -}//printVertices
    -
    -std::ostream &
    -operator<<(ostream &os, const QhullFacetList &fs)
    -{
    -    os << fs.printFacets(UsingLibQhull::NOqhRunId);
    -    return os;
    -}//QhullFacetList
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.h
    deleted file mode 100644
    index 46664f31b0..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetList.h
    +++ /dev/null
    @@ -1,102 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacetList.h#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLFACETLIST_H
    -#define QHULLFACETLIST_H
    -
    -#include "QhullLinkedList.h"
    -#include "QhullFacet.h"
    -
    -#include 
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class               QhullFacet;
    -
    -#//Types
    -    //! QhullFacetList -- List of Qhull facets, as a C++ class.  See QhullFacetSet.h
    -    class               QhullFacetList;
    -    //! QhullFacetListIterator -- if(f.isGood()){ ... }
    -    typedef QhullLinkedListIterator
    -                        QhullFacetListIterator;
    -
    -class QhullFacetList : public QhullLinkedList {
    -
    -#// Fields
    -private:
    -    bool                select_all;   //! True if include bad facets.  Default is false.
    -
    -#//Constructors
    -public:
    -                        QhullFacetList(QhullFacet b, QhullFacet e) : QhullLinkedList(b, e), select_all(false) {}
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
    -                        QhullFacetList(const QhullFacetList &o) : QhullLinkedList(*o.begin(), *o.end()), select_all(o.select_all) {}
    -                       ~QhullFacetList() {}
    -
    -private:
    -                        //!Disable default constructor and copy assignment.  See QhullLinkedList
    -                        QhullFacetList();
    -    QhullFacetList     &operator=(const QhullFacetList &);
    -public:
    -
    -#//Conversion
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -    std::vector vertices_toStdVector(int qhRunId) const;
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList   toQList() const;
    -    QList  vertices_toQList(int qhRunId) const;
    -#endif //QHULL_USES_QT
    -
    -#//GetSet
    -    bool                isSelectAll() const { return select_all; }
    -    void                selectAll() { select_all= true; }
    -    void                selectGood() { select_all= false; }
    -
    -#//Read-only
    -                        //! Filtered by facet.isGood().  May be 0 when !isEmpty().
    -    int                 count() const;
    -    bool                contains(const QhullFacet &f) const;
    -    int                 count(const QhullFacet &f) const;
    -                        //! operator==() does not depend on isGood()
    -
    -#//IO
    -    struct PrintFacetList{
    -        const QhullFacetList *facet_list;
    -        int             run_id;
    -                        PrintFacetList(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
    -    };//PrintFacetList
    -    PrintFacetList     print(int qhRunId) const  { return PrintFacetList(qhRunId, *this); }
    -
    -    struct PrintFacets{
    -        const QhullFacetList *facet_list;
    -        int             run_id;
    -                        PrintFacets(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
    -    };//PrintFacets
    -    PrintFacets     printFacets(int qhRunId) const { return PrintFacets(qhRunId, *this); }
    -
    -    struct PrintVertices{
    -        const QhullFacetList *facet_list;
    -        int             run_id;   //! Can not be NOrunId due to qh_facetvertices
    -                        PrintVertices(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
    -    };//PrintVertices
    -    PrintVertices   printVertices(int qhRunId) const { return PrintVertices(qhRunId, *this); }
    -};//class QhullFacetList
    -
    -}//namespace orgQhull
    -
    -#//== Global namespace =========================================
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacetList &p);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacets &p);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintVertices &p);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs);
    -
    -#endif // QHULLFACETLIST_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetSet.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetSet.cpp
    deleted file mode 100644
    index 6a1f8c53d0..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullFacetSet.cpp
    +++ /dev/null
    @@ -1,145 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacetSet.cpp#5 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullFacetSet -- Qhull's linked facets, as a C++ class
    -
    -#include "QhullFacet.h"
    -#include "QhullFacetSet.h"
    -#include "QhullPoint.h"
    -#include "QhullRidge.h"
    -#include "QhullVertex.h"
    -
    -using std::string;
    -using std::vector;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Conversion
    -
    -// See qt-qhull.cpp for QList conversions
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullFacetSet::
    -toStdVector() const
    -{
    -    QhullSetIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.push_back(f);
    -        }
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Read-only
    -
    -bool QhullFacetSet::
    -contains(const QhullFacet &facet) const
    -{
    -    if(isSelectAll()){
    -        return QhullSet::contains(facet);
    -    }
    -    for(QhullFacetSet::const_iterator i=begin(); i != end(); ++i){
    -        QhullFacet f= *i;
    -        if(f==facet && f.isGood()){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//contains
    -
    -int QhullFacetSet::
    -count() const
    -{
    -    if(isSelectAll()){
    -        return QhullSet::count();
    -    }
    -    int counter= 0;
    -    for(QhullFacetSet::const_iterator i=begin(); i != end(); ++i){
    -        QhullFacet f= *i;
    -        if(f.isGood()){
    -            counter++;
    -        }
    -    }
    -    return counter;
    -}//count
    -
    -int QhullFacetSet::
    -count(const QhullFacet &facet) const
    -{
    -    if(isSelectAll()){
    -        return QhullSet::count(facet);
    -    }
    -    int counter= 0;
    -    for(QhullFacetSet::const_iterator i=begin(); i != end(); ++i){
    -        QhullFacet f= *i;
    -        if(f==facet && f.isGood()){
    -            counter++;
    -        }
    -    }
    -    return counter;
    -}//count
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using orgQhull::QhullFacet;
    -using orgQhull::QhullFacetSet;
    -using orgQhull::UsingLibQhull;
    -
    -ostream &
    -operator<<(ostream &os, const QhullFacetSet &fs)
    -{
    -    os << fs.print(UsingLibQhull::NOqhRunId, "");
    -    return os;
    -}//<begin(); i!=p.facet_set->end(); ++i){
    -        const QhullFacet f= *i;
    -        if(f.getFacetT()==qh_MERGEridge){
    -            os << " MERGE";
    -        }else if(f.getFacetT()==qh_DUPLICATEridge){
    -            os << " DUP";
    -        }else if(p.facet_set->isSelectAll() || f.isGood()){
    -            os << " f" << f.id();
    -        }
    -    }
    -    os << endl;
    -    return os;
    -}//<
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class               QhullFacet;
    -
    -#//Types
    -    //! QhullFacetSet -- a set of Qhull facets, as a C++ class.  See QhullFacetList.h
    -    class               QhullFacetSet;
    -    typedef QhullSetIterator
    -                        QhullFacetSetIterator;
    -
    -class QhullFacetSet : public QhullSet {
    -
    -private:
    -#//Fields
    -    bool                select_all;   //! True if include bad facets.  Default is false.
    -
    -public:
    -#//Constructor
    -                        //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
    -   explicit             QhullFacetSet(setT *s) : QhullSet(s), select_all(false) {}
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
    -                        QhullFacetSet(const QhullFacetSet &o) : QhullSet(o), select_all(o.select_all) {}
    -
    -private:
    -                        //!Disable default constructor and copy assignment.  See QhullSetBase
    -                        QhullFacetSet();
    -    QhullFacetSet      &operator=(const QhullFacetSet &);
    -public:
    -
    -#//Conversion
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList   toQList() const;
    -#endif //QHULL_USES_QT
    -
    -#//GetSet
    -    bool                isSelectAll() const { return select_all; }
    -    void                selectAll() { select_all= true; }
    -    void                selectGood() { select_all= false; }
    -
    -#//Read-only
    -                        //! Filtered by facet.isGood().  May be 0 when !isEmpty().
    -    int                 count() const;
    -    bool                contains(const QhullFacet &f) const;
    -    int                 count(const QhullFacet &f) const;
    -                        //! operator==() does not depend on isGood()
    -
    -#//IO
    -    // Not same as QhullFacetList#IO.  A QhullFacetSet is a component of a QhullFacetList.
    -
    -    struct PrintFacetSet{
    -        const QhullFacetSet *facet_set;
    -        const char     *print_message;
    -        int             run_id;
    -                        PrintFacetSet(int qhRunId, const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message), run_id(qhRunId) {}
    -    };//PrintFacetSet
    -    const PrintFacetSet       print(int qhRunId, const char *message) const { return PrintFacetSet(qhRunId, message, this); }
    -
    -    struct PrintIdentifiers{
    -        const QhullFacetSet *facet_set;
    -        const char     *print_message;
    -                        PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message) {}
    -    };//PrintIdentifiers
    -    PrintIdentifiers    printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
    -
    -};//class QhullFacetSet
    -
    -}//namespace orgQhull
    -
    -#//== Global namespace =========================================
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintFacetSet &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintIdentifiers &p);
    -
    -#endif // QHULLFACETSET_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.cpp
    deleted file mode 100644
    index c69d6e55ca..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.cpp
    +++ /dev/null
    @@ -1,166 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullHyperplane.cpp#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "QhullHyperplane.h"
    -#include "QhullPoint.h"
    -
    -#include 
    -
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Conversion
    -
    -// See qt-qhull.cpp for QList conversions
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullHyperplane::
    -toStdVector() const
    -{
    -    QhullHyperplaneIterator i(*this);
    -    std::vector fs;
    -    while(i.hasNext()){
    -        fs.push_back(i.next());
    -    }
    -    fs.push_back(hyperplane_offset);
    -    return fs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Value
    -
    -//! Return distance from point to hyperplane.
    -//!   If greater than zero, the point is above the facet (i.e., outside).
    -// qh_distplane [geom.c], QhullFacet::distance, and QhullHyperplane::distance are copies
    -//    Does not support RANDOMdist or logging
    -double QhullHyperplane::
    -distance(const QhullPoint &p) const
    -{
    -    const coordT *point= p.coordinates();
    -    int dim= p.dimension();
    -    QHULL_ASSERT(dim==dimension());
    -    const coordT *normal= coordinates();
    -    double dist;
    -
    -    switch (dim){
    -  case 2:
    -      dist= offset() + point[0] * normal[0] + point[1] * normal[1];
    -      break;
    -  case 3:
    -      dist= offset() + point[0] * normal[0] + point[1] * normal[1] + point[2] * normal[2];
    -      break;
    -  case 4:
    -      dist= offset()+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3];
    -      break;
    -  case 5:
    -      dist= offset()+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4];
    -      break;
    -  case 6:
    -      dist= offset()+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5];
    -      break;
    -  case 7:
    -      dist= offset()+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5]+point[6]*normal[6];
    -      break;
    -  case 8:
    -      dist= offset()+point[0]*normal[0]+point[1]*normal[1]+point[2]*normal[2]+point[3]*normal[3]+point[4]*normal[4]+point[5]*normal[5]+point[6]*normal[6]+point[7]*normal[7];
    -      break;
    -  default:
    -      dist= offset();
    -      for (int k=dim; k--; )
    -          dist += *point++ * *normal++;
    -      break;
    -    }
    -    return dist;
    -}//distance
    -
    -double QhullHyperplane::
    -norm() const {
    -    double d= 0.0;
    -    const coordT *c= coordinates();
    -    for (int k=dimension(); k--; ){
    -        d += *c * *c;
    -        ++c;
    -    }
    -    return sqrt(d);
    -}//norm
    -
    -#//Operator
    -
    -bool QhullHyperplane::
    -operator==(const QhullHyperplane &other) const
    -{
    -    if(hyperplane_dimension!=other.hyperplane_dimension){
    -        return false;
    -    }
    -    double d= fabs(hyperplane_offset-other.hyperplane_offset);
    -    if(d>UsingLibQhull::globalDistanceEpsilon()){
    -        return false;
    -    }
    -    const coordT *c= hyperplane_coordinates;
    -    const coordT *c2= other.hyperplane_coordinates;
    -    if(c==c2){
    -        return true;
    -    }
    -    double dist2= 0.0;
    -    for(int k= hyperplane_dimension; k--; ){
    -        double diff= *c++ - *c2++;
    -        dist2 += diff*diff;
    -    }
    -    if(dist2 > UsingLibQhull::globalAngleEpsilon()){
    -        return false;
    -    }
    -    return true;
    -}//operator==
    -
    -#//GetSet
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::ostream;
    -using orgQhull::QhullHyperplane;
    -using orgQhull::UsingLibQhull;
    -
    -#//operator<<
    -
    -ostream &
    -operator<<(ostream &os, const QhullHyperplane &p)
    -{
    -    os << p.print();
    -    return os;
    -}
    -
    -ostream &
    -operator<<(ostream &os, const QhullHyperplane::PrintHyperplane &pr)
    -{
    -    QhullHyperplane p= *pr.hyperplane;
    -    if(pr.print_message){
    -        os << pr.print_message;
    -    }
    -    const realT *c= p.coordinates();
    -    for(int k=p.dimension(); k--; ){
    -        realT r= *c++;
    -        if(pr.print_message){
    -            os << " " << r; // FIXUP QH11010 %8.4g
    -        }else{
    -            os << " " << r; // FIXUP QH11010 qh_REAL_1
    -        }
    -    }
    -    if(pr.hyperplane_offset_message){
    -        os << pr.hyperplane_offset_message << " " << p.offset();
    -    }else{
    -        os << " " << p.offset();
    -    }
    -    os << std::endl;
    -    return os;
    -}//PrintHyperplane
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.h
    deleted file mode 100644
    index 0d3c59e90a..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullHyperplane.h
    +++ /dev/null
    @@ -1,122 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullHyperplane.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHHYPERPLANE_H
    -#define QHHYPERPLANE_H
    -
    -#include "QhullError.h"
    -#include "QhullIterator.h"
    -#include "UsingLibQhull.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -
    -namespace orgQhull {
    -#//ClassRef
    -    class QhullPoint;
    -
    -#//Types
    -    //! QhullHyperplane as an offset, dimension, and pointer to coordinates
    -    class QhullHyperplane;
    -    //! Java-style iterator for QhullHyperplane coordinates
    -    class QhullHyperplaneIterator;
    -
    -class QhullHyperplane { // Similar to QhullPoint
    -
    -private:
    -#//Fields
    -    coordT             *hyperplane_coordinates;  // Keep pointers aligned
    -    int                 hyperplane_dimension;
    -    coordT              hyperplane_offset;
    -
    -public:
    -#//Subtypes
    -    typedef const coordT *                  iterator;
    -    typedef const coordT *                  const_iterator;
    -    typedef QhullHyperplane::iterator       Iterator;
    -    typedef QhullHyperplane::const_iterator ConstIterator;
    -
    -#//Construct
    -                        QhullHyperplane() : hyperplane_coordinates(0), hyperplane_dimension(0), hyperplane_offset(0.0) {};
    -                        QhullHyperplane(int hyperplaneDimension, coordT *c, coordT hyperplaneOffset) : hyperplane_coordinates(c), hyperplane_dimension(hyperplaneDimension), hyperplane_offset(hyperplaneOffset) {}
    -                        // Creates an alias.  Does not copy the hyperplane's coordinates.  Needed for return by value and parameter passing.
    -                        QhullHyperplane(const QhullHyperplane &other)  : hyperplane_coordinates(other.hyperplane_coordinates), hyperplane_dimension(other.hyperplane_dimension), hyperplane_offset(other.hyperplane_offset) {}
    -                        // Creates an alias.  Does not copy the hyperplane's coordinates.  Needed for vector
    -    QhullHyperplane    &operator=(const QhullHyperplane &other) { hyperplane_coordinates= other.hyperplane_coordinates; hyperplane_dimension= other.hyperplane_dimension; hyperplane_offset= other.hyperplane_offset; return *this; }
    -                       ~QhullHyperplane() {}
    -
    -#//Conversions --
    -//! Includes offset at end
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList       toQList() const;
    -#endif //QHULL_USES_QT
    -
    -#//Read-only
    -public:
    -    const coordT       *coordinates() const { return hyperplane_coordinates; }
    -    coordT             *coordinates() { return hyperplane_coordinates; }
    -    int                 dimension() const { return hyperplane_dimension; }
    -    bool                isDefined() const { return hyperplane_coordinates!=0 && hyperplane_dimension>0; }
    -    coordT              offset() const { return hyperplane_offset; }
    -
    -#//Define
    -    void                defineAs(int hyperplaneDimension, coordT *c, coordT hyperplaneOffset) { QHULL_ASSERT(hyperplaneDimension>=0); hyperplane_coordinates= c; hyperplane_dimension= hyperplaneDimension; hyperplane_offset= hyperplaneOffset; }
    -    //! Creates an alias to other
    -    void                defineAs(QhullHyperplane &other) { hyperplane_coordinates= other.coordinates(); hyperplane_dimension= other.dimension();  hyperplane_offset= other.offset(); }
    -    void                setCoordinates(coordT *c) { hyperplane_coordinates= c; }
    -    void                setDimension(int hyperplaneDimension) { hyperplane_dimension= hyperplaneDimension; }
    -    void                setOffset(coordT hyperplaneOffset) { hyperplane_offset= hyperplaneOffset; }
    -
    -#//value
    -    double              distance(const QhullPoint &p) const;
    -    double              norm() const;
    -
    -#//iterator
    -    iterator            begin() { return hyperplane_coordinates; }
    -    const_iterator      begin() const { return hyperplane_coordinates; }
    -    const_iterator      constBegin() const { return hyperplane_coordinates; }
    -    const_iterator      constEnd() const { return hyperplane_coordinates+hyperplane_dimension; }
    -    int                 count() { return dimension(); }
    -    iterator            end() { return hyperplane_coordinates+hyperplane_dimension; }
    -    const_iterator      end() const { return hyperplane_coordinates+hyperplane_dimension; }
    -    size_t              size() { return (size_t)dimension(); }
    -
    -#//Operator
    -    bool                operator==(const QhullHyperplane &other) const;
    -    bool                operator!=(const QhullHyperplane &other) const { return !operator==(other); }
    -    const coordT       &operator[](int idx) const { QHULL_ASSERT(idx>=0 && idx=0 && idx
    -#include 
    -#include 
    -//! Avoid dependence on 
    -namespace std { struct bidirectional_iterator_tag; struct random_access_iterator_tag; }
    -
    -namespace orgQhull {
    -
    -#//Defined here
    -    //! QHULL_DECLARE_SEQUENTIAL_ITERATOR(C) -- Declare a Java-style iterator
    -    //! QHULL_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(C) -- Declare a mutable Java-style iterator
    -    //! QHULL_DECLARE_SET_ITERATOR(C) -- Declare a set iterator
    -    //! QHULL_DECLARE_MUTABLE_SET_ITERATOR(C) -- Declare a mutable set iterator
    -    //! Derived from Qt/core/tools/qiterator.h and qset.h/FOREACHsetelement_()
    -
    -// Changed c to C* as in Mutable...  Assumes c does not go away.
    -#define QHULL_DECLARE_SEQUENTIAL_ITERATOR(C, T) \
    -    \
    -    class C##Iterator \
    -    { \
    -        typedef C::const_iterator const_iterator; \
    -        const C *c; \
    -        const_iterator i; \
    -        public: \
    -        inline C##Iterator(const C &container) \
    -        : c(&container), i(c->constBegin()) {} \
    -        inline C##Iterator &operator=(const C &container) \
    -        { c = &container; i = c->constBegin(); return *this; } \
    -        inline void toFront() { i = c->constBegin(); } \
    -        inline void toBack() { i = c->constEnd(); } \
    -        inline bool hasNext() const { return i != c->constEnd(); } \
    -        inline const T &next() { return *i++; } \
    -        inline const T &peekNext() const { return *i; } \
    -        inline bool hasPrevious() const { return i != c->constBegin(); } \
    -        inline const T &previous() { return *--i; } \
    -        inline const T &peekPrevious() const { const_iterator p = i; return *--p; } \
    -        inline bool findNext(const T &t) \
    -        { while (i != c->constEnd()) if (*i++ == t) return true; return false; } \
    -        inline bool findPrevious(const T &t) \
    -        { while (i != c->constBegin()) if (*(--i) == t) return true; \
    -        return false;  } \
    -    };//C##Iterator
    -
    -// Remove setShareable() from Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR
    -// Uses QHULL_ASSERT (assert.h)
    -// Duplicated in MutablePointIterator without insert or remove
    -#define QHULL_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(C, T) \
    -    class Mutable##C##Iterator \
    -    { \
    -        typedef C::iterator iterator; \
    -        typedef C::const_iterator const_iterator; \
    -        C *c; \
    -        iterator i, n; \
    -        inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } \
    -        public: \
    -        inline Mutable##C##Iterator(C &container) \
    -        : c(&container) \
    -        { i = c->begin(); n = c->end(); } \
    -        inline ~Mutable##C##Iterator() \
    -        {} \
    -        inline Mutable##C##Iterator &operator=(C &container) \
    -        { c = &container; \
    -        i = c->begin(); n = c->end(); return *this; } \
    -        inline void toFront() { i = c->begin(); n = c->end(); } \
    -        inline void toBack() { i = c->end(); n = i; } \
    -        inline bool hasNext() const { return c->constEnd() != const_iterator(i); } \
    -        inline T &next() { n = i++; return *n; } \
    -        inline T &peekNext() const { return *i; } \
    -        inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } \
    -        inline T &previous() { n = --i; return *n; } \
    -        inline T &peekPrevious() const { iterator p = i; return *--p; } \
    -        inline void remove() \
    -        { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } \
    -        inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } \
    -        inline T &value() { QHULL_ASSERT(item_exists()); return *n; } \
    -        inline const T &value() const { QHULL_ASSERT(item_exists()); return *n; } \
    -        inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } \
    -        inline bool findNext(const T &t) \
    -        { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } \
    -        inline bool findPrevious(const T &t) \
    -        { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; \
    -        n = c->end(); return false;  } \
    -    };//Mutable##C##Iterator
    -
    -#define QHULL_DECLARE_SET_ITERATOR(C) \
    -\
    -    template  \
    -    class Qhull##C##Iterator \
    -    { \
    -        typedef typename Qhull##C::const_iterator const_iterator; \
    -        Qhull##C c; \
    -        const_iterator i; \
    -    public: \
    -        inline Qhull##C##Iterator(const Qhull##C &container) \
    -        : c(container), i(c.constBegin()) {} \
    -        inline Qhull##C##Iterator &operator=(const Qhull##C &container) \
    -        { c = container; i = c.constBegin(); return *this; } \
    -        inline void toFront() { i = c.constBegin(); } \
    -        inline void toBack() { i = c.constEnd(); } \
    -        inline bool hasNext() const { return i != c.constEnd(); } \
    -        inline const T &next() { return *i++; } \
    -        inline const T &peekNext() const { return *i; } \
    -        inline bool hasPrevious() const { return i != c.constBegin(); } \
    -        inline const T &previous() { return *--i; } \
    -        inline const T &peekPrevious() const { const_iterator p = i; return *--p; } \
    -        inline bool findNext(const T &t) \
    -        { while (i != c.constEnd()) if (*i++ == t) return true; return false; } \
    -        inline bool findPrevious(const T &t) \
    -        { while (i != c.constBegin()) if (*(--i) == t) return true; \
    -        return false;  } \
    -    };//Qhull##C##Iterator
    -
    -#define QHULL_DECLARE_MUTABLE_SET_ITERATOR(C) \
    -\
    -template  \
    -class QhullMutable##C##Iterator \
    -{ \
    -    typedef typename Qhull##C::iterator iterator; \
    -    typedef typename Qhull##C::const_iterator const_iterator; \
    -    Qhull##C *c; \
    -    iterator i, n; \
    -    inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } \
    -public: \
    -    inline Mutable##C##Iterator(Qhull##C &container) \
    -        : c(&container) \
    -    { c->setSharable(false); i = c->begin(); n = c->end(); } \
    -    inline ~Mutable##C##Iterator() \
    -    { c->setSharable(true); } \
    -    inline Mutable##C##Iterator &operator=(Qhull##C &container) \
    -    { c->setSharable(true); c = &container; c->setSharable(false); \
    -      i = c->begin(); n = c->end(); return *this; } \
    -    inline void toFront() { i = c->begin(); n = c->end(); } \
    -    inline void toBack() { i = c->end(); n = i; } \
    -    inline bool hasNext() const { return c->constEnd() != const_iterator(i); } \
    -    inline T &next() { n = i++; return *n; } \
    -    inline T &peekNext() const { return *i; } \
    -    inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } \
    -    inline T &previous() { n = --i; return *n; } \
    -    inline T &peekPrevious() const { iterator p = i; return *--p; } \
    -    inline void remove() \
    -    { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } \
    -    inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } \
    -    inline T &value() { Q_ASSERT(item_exists()); return *n; } \
    -    inline const T &value() const { Q_ASSERT(item_exists()); return *n; } \
    -    inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } \
    -    inline bool findNext(const T &t) \
    -    { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } \
    -    inline bool findPrevious(const T &t) \
    -    { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; \
    -      n = c->end(); return false;  } \
    -};//QhullMutable##C##Iterator
    -
    -}//namespace orgQhull
    -
    -#endif // QHULLITERATOR_H
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullLinkedList.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullLinkedList.h
    deleted file mode 100644
    index 9f05dc9ae4..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullLinkedList.h
    +++ /dev/null
    @@ -1,377 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullLinkedList.h#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLLINKEDLIST_H
    -#define QHULLLINKEDLIST_H
    -
    -namespace std { struct bidirectional_iterator_tag; struct random_access_iterator_tag; }
    -
    -#include "QhullError.h"
    -
    -#ifdef QHULL_USES_QT
    -#include 
    -#endif
    -
    -#ifndef QHULL_NO_STL
    -#include 
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Type
    -    //! QhullLinkedList -- A linked list modeled on QLinkedList.
    -    //!   T is an opaque type with T(B *b), b=t.getBaseT(), t=t.next(), and t=t.prev().  The end node is a sentinel.
    -    //!   libqhull owns the contents.
    -    //!   QhullLinkedList does not define erase(), clear(), removeFirst(), removeLast(), pop_back(), pop_front(), fromStdList()
    -    //!   Derived from Qt/core/tools/qlinkedlist.h and libqhull.h/FORALLfacets_()
    -    //! QhullLinkedList::const_iterator -- STL-style iterator
    -    //! QhullLinkedList::iterator -- STL-style iterator
    -    //! QhullLinkedListIterator -- Java-style iterator
    -    //!   Derived from Qt/core/tools/qiterator.h
    -    //!   Works with Qt's foreach keyword [Qt/src/corelib/global/qglobal.h]
    -
    -template 
    -class QhullLinkedList
    -{
    -private:
    -#//Fields
    -    T                   begin_node;
    -    T                   end_node;     //! Sentinel node at end of list
    -
    -public:
    -#//Subtypes and types
    -    class               const_iterator;
    -    class               iterator;
    -    typedef const_iterator  ConstIterator;
    -    typedef iterator    Iterator;
    -    typedef ptrdiff_t   difference_type;
    -    typedef int         size_type;
    -    typedef T           value_type;
    -    typedef const value_type *const_pointer;
    -    typedef const value_type &const_reference;
    -    typedef value_type *pointer;
    -    typedef value_type &reference;
    -
    -#//Constructors
    -                        QhullLinkedList(T b, T e) : begin_node(b), end_node(e) {}
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
    -                        QhullLinkedList(const QhullLinkedList &o) : begin_node(o.begin_node), end_node(o.end_node) {}
    -                       ~QhullLinkedList() {}
    -
    -private:
    -                        //!disabled since a sentinel must be allocated as the private type
    -                        QhullLinkedList() {}
    -                        //!disabled since qs= qs2 is ambiguous (pointer vs. contents)
    -    QhullLinkedList &operator=(const QhullLinkedList &l) {}
    -public:
    -
    -#//Conversions
    -#ifndef QHULL_NO_STL
    -    std::vector      toStdVector() const;
    -#endif
    -#ifdef QHULL_USES_QT
    -    QList            toQList() const;
    -#endif
    -
    -#//Read-only
    -    int                 count() const;
    -                        //count(t) under #//Search
    -    bool                empty() const { return isEmpty(); }
    -    bool                isEmpty() const { return (begin_node==end_node); }
    -    bool                operator==(const QhullLinkedList &o) const;
    -    bool                operator!=(const QhullLinkedList &o) const { return !operator==(o); }
    -    size_t              size() const { return count(); }
    -
    -#//Element access
    -    //! Return by value which contains a pointer (e.g., typedef vertexT * QhullVertex).  A reference does not make sense.
    -    T                   back() const { return last(); }
    -    T                   first() const { QHULL_ASSERT(!isEmpty()); return *begin(); }
    -    T                   front() const { return first(); }
    -    T                   last() const { QHULL_ASSERT(!isEmpty()); return *--end(); }
    -
    -#//Modify -- Allocation of opaque types not implemented.
    -
    -#//Search
    -    bool                contains(const T &t) const;
    -    int                 count(const T &t) const;
    -
    -#//Iterator
    -    iterator            begin() { return begin_node; }
    -    const_iterator      begin() const { return begin_node; }
    -    const_iterator      constBegin() const { return begin_node; }
    -    const_iterator      constEnd() const { return end_node; }
    -    iterator            end() { return end_node; }
    -    const_iterator      end() const { return end_node; }
    -
    -    class iterator {
    -
    -    private:
    -        T               i;
    -        friend class    const_iterator;
    -
    -    public:
    -        typedef std::bidirectional_iterator_tag  iterator_category;
    -        typedef T           value_type;
    -        typedef value_type *pointer;
    -        typedef value_type &reference;
    -        typedef ptrdiff_t   difference_type;
    -
    -                        iterator() : i() {}
    -                        iterator(T t) : i(t) {}
    -                        iterator(const iterator &o) : i(o.i) {}
    -        iterator       &operator=(const iterator &o) { i= o.i; return *this; }
    -
    -        T               operator*() const { return i; }
    -        T               operator->() const { return i; }
    -        bool            operator==(const iterator &o) const { return i == o.i; }
    -        bool            operator!=(const iterator &o) const { return !operator==(o); }
    -        bool            operator==(const const_iterator &o) const { return i==reinterpret_cast(o).i; }
    -        bool            operator!=(const const_iterator &o) const { return !operator==(o); }
    -        iterator       &operator++() { i= i.next(); return *this; }
    -        iterator        operator++(int) { iterator o= i; i= i.next(); return o; }
    -        iterator       &operator--() { i= i.previous(); return *this; }
    -        iterator        operator--(int) { iterator o= i; i= i.previous(); return o; }
    -        iterator        operator+(int j) const;
    -        iterator        operator-(int j) const { return operator+(-j); }
    -        iterator       &operator+=(int j) { return *this= *this + j; }
    -        iterator       &operator-=(int j) { return *this= *this - j; }
    -    };//QhullLinkedList::iterator
    -
    -    class const_iterator {
    -
    -    private:
    -        T               i;
    -
    -    public:
    -        typedef std::bidirectional_iterator_tag  iterator_category;
    -        typedef T                 value_type;
    -        typedef const value_type *pointer;
    -        typedef const value_type &reference;
    -        typedef ptrdiff_t         difference_type;
    -
    -                        const_iterator() : i() {}
    -                        const_iterator(T t) : i(t) {}
    -                        const_iterator(const const_iterator &o) : i(o.i) {}
    -                        const_iterator(iterator o) : i(o.i) {}
    -        const_iterator &operator=(const const_iterator &o) { i= o.i; return *this; }
    -
    -        T               operator*() const { return i; }
    -        T               operator->() const { return i; }
    -        bool            operator==(const const_iterator &o) const { return i == o.i; }
    -        bool            operator!=(const const_iterator &o) const { return !operator==(o); }
    -                        // No comparisons or iterator diff
    -        const_iterator &operator++() { i= i.next(); return *this; }
    -        const_iterator  operator++(int) { const_iterator o= i; i= i.next(); return o; }
    -        const_iterator &operator--() { i= i.previous(); return *this; }
    -        const_iterator  operator--(int) { const_iterator o= i; i= i.previous(); return o; }
    -        const_iterator  operator+(int j) const;
    -        const_iterator  operator-(int j) const { return operator+(-j); }
    -        const_iterator &operator+=(int j) { return *this= *this + j; }
    -        const_iterator &operator-=(int j) { return *this= *this - j; }
    -    };//QhullLinkedList::const_iterator
    -
    -};//QhullLinkedList
    -
    -template 
    -class QhullLinkedListIterator // FIXUP QH11016 define QhullMutableLinkedListIterator
    -{
    -    typedef typename QhullLinkedList::const_iterator const_iterator;
    -    const QhullLinkedList *c;
    -    const_iterator      i;
    -
    -public:
    -                        QhullLinkedListIterator(const QhullLinkedList &container) : c(&container), i(c->constBegin()) {}
    -                        QhullLinkedListIterator &operator=(const QhullLinkedList &container) { c= &container; i= c->constBegin(); return *this; }
    -    bool                findNext(const T &t);
    -    bool                findPrevious(const T &t);
    -    bool                hasNext() const { return i != c->constEnd(); }
    -    bool                hasPrevious() const { return i != c->constBegin(); }
    -    T                   next() { return *i++; }
    -    T                   peekNext() const { return *i; }
    -    T                   peekPrevious() const { const_iterator p= i; return *--p; }
    -    T                   previous() { return *--i; }
    -    void                toFront() { i= c->constBegin(); }
    -    void                toBack() { i= c->constEnd(); }
    -};//QhullLinkedListIterator
    -
    -#//== Definitions =========================================
    -
    -#//Conversion
    -
    -#ifndef QHULL_NO_STL
    -template 
    -std::vector QhullLinkedList::
    -toStdVector() const
    -{
    -    std::vector tmp;
    -    std::copy(constBegin(), constEnd(), std::back_inserter(tmp));
    -    return tmp;
    -}//toStdVector
    -#endif
    -
    -#ifdef QHULL_USES_QT
    -template 
    -QList  QhullLinkedList::
    -toQList() const
    -{
    -    QhullLinkedListIterator i(*this);
    -    QList ls;
    -    while(i.hasNext()){
    -        ls.append(i.next());
    -    }
    -    return ls;
    -}//toQList
    -#endif
    -
    -#//Read-only
    -
    -template 
    -int QhullLinkedList::
    -count() const
    -{
    -    const_iterator i= begin_node;
    -    int c= 0;
    -    while(i != end_node){
    -        c++;
    -        i++;
    -    }
    -    return c;
    -}//count
    -
    -#//Search
    -
    -template 
    -bool QhullLinkedList::
    -contains(const T &t) const
    -{
    -    const_iterator i= begin_node;
    -    while(i != end_node){
    -        if(i==t){
    -            return true;
    -        }
    -        i++;
    -    }
    -    return false;
    -}//contains
    -
    -template 
    -int QhullLinkedList::
    -count(const T &t) const
    -{
    -    const_iterator i= begin_node;
    -    int c= 0;
    -    while(i != end_node){
    -        if(i==t){
    -            c++;
    -        }
    -        i++;
    -    }
    -    return c;
    -}//count
    -
    -template 
    -bool QhullLinkedList::
    -operator==(const QhullLinkedList &l) const
    -{
    -    if(begin_node==l.begin_node){
    -        return (end_node==l.end_node);
    -    }
    -    T i= begin_node;
    -    T il= l.begin_node;
    -    while(i != end_node){
    -        if(i != il){
    -            return false;
    -        }
    -        i= static_cast(i.next());
    -        il= static_cast(il.next());
    -    }
    -    if(il != l.end_node){
    -        return false;
    -    }
    -    return true;
    -}//operator==
    -
    -#//Iterator
    -
    -template 
    -typename QhullLinkedList::iterator  QhullLinkedList::iterator::
    -operator+(int j) const
    -{
    -    T n= i;
    -    if(j>0){
    -        while(j--){
    -            n= n.next();
    -        }
    -    }else{
    -        while(j++){
    -            n= n.previous();
    -        }
    -    }
    -    return iterator(n);
    -}//operator+
    -
    -template 
    -typename QhullLinkedList::const_iterator  QhullLinkedList::const_iterator::
    -operator+(int j) const
    -{
    -    T n= i;
    -    if(j>0){
    -        while(j--){
    -            n= n.next();
    -        }
    -    }else{
    -        while(j++){
    -            n= n.previous();
    -        }
    -    }
    -    return const_iterator(n);
    -}//operator+
    -
    -#//QhullLinkedListIterator
    -
    -template 
    -bool QhullLinkedListIterator::
    -findNext(const T &t)
    -{
    -    while(i != c->constEnd()){
    -        if (*i++ == t){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findNext
    -
    -template 
    -bool QhullLinkedListIterator::
    -findPrevious(const T &t)
    -{
    -    while(i!=c->constBegin()){
    -        if(*(--i)==t){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findNext
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -template 
    -std::ostream &
    -operator<<(std::ostream &os, const orgQhull::QhullLinkedList &qs)
    -{
    -    typename orgQhull::QhullLinkedList::const_iterator i;
    -    for(i= qs.begin(); i != qs.end(); ++i){
    -        os << *i;
    -    }
    -    return os;
    -}//operator<<
    -
    -#endif // QHULLLINKEDLIST_H
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.cpp
    deleted file mode 100644
    index 212f34d0a8..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.cpp
    +++ /dev/null
    @@ -1,177 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullPoint.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "UsingLibQhull.h"
    -#include "QhullPoint.h"
    -
    -#include 
    -#include 
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Class public variables and methods
    -
    -//! If qhRundID undefined uses QhullPoint::s_points_begin and dimension
    -int QhullPoint::
    -id(int qhRunId, int dimension, const coordT *c)
    -{
    -    QHULL_UNUSED(dimension);
    -
    -    if(UsingLibQhull::hasPoints()){
    -        if(qhRunId==UsingLibQhull::NOqhRunId){
    -            const coordT *pointsEnd;
    -            int dim;
    -            const coordT *points= UsingLibQhull::globalPoints(&dim, &pointsEnd);
    -            if(c>=points && c(c));
    -        }
    -    }
    -    long long i=(long long)c;
    -    return (int)i; // WARN64
    -}//id
    -
    -#//Conversion
    -
    -// See qt-qhull.cpp for QList conversion
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullPoint::
    -toStdVector() const
    -{
    -    QhullPointIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        vs.push_back(i.next());
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Operator
    -
    -bool QhullPoint::
    -operator==(const QhullPoint &other) const
    -{
    -    if(point_dimension!=other.point_dimension){
    -        return false;
    -    }
    -    const coordT *c= point_coordinates;
    -    const coordT *c2= other.point_coordinates;
    -    if(c==c2){
    -        return true;
    -    }
    -    double dist2= 0.0;
    -    for(int k= point_dimension; k--; ){
    -        double diff= *c++ - *c2++;
    -        dist2 += diff*diff;
    -    }
    -    double epsilon= UsingLibQhull::globalDistanceEpsilon();
    -    // std::cout << "DEBUG dist2 " << dist2 << " epsilon^2 " << epsilon*epsilon << std::endl;
    -    return (dist2<=(epsilon*epsilon));
    -}//operator==
    -
    -
    -#//Value
    -
    -//! Return distance betweeen two points.
    -double QhullPoint::
    -distance(const QhullPoint &p) const
    -{
    -    const coordT *c= coordinates();
    -    const coordT *c2= p.coordinates();
    -    int dim= dimension();
    -    QHULL_ASSERT(dim==p.dimension());
    -    double dist;
    -
    -    switch(dim){
    -  case 2:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]);
    -      break;
    -  case 3:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]);
    -      break;
    -  case 4:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]) + (c[3]-c2[3])*(c[3]-c2[3]);
    -      break;
    -  case 5:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]) + (c[3]-c2[3])*(c[3]-c2[3]) + (c[4]-c2[4])*(c[4]-c2[4]);
    -      break;
    -  case 6:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]) + (c[3]-c2[3])*(c[3]-c2[3]) + (c[4]-c2[4])*(c[4]-c2[4]) + (c[5]-c2[5])*(c[5]-c2[5]);
    -      break;
    -  case 7:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]) + (c[3]-c2[3])*(c[3]-c2[3]) + (c[4]-c2[4])*(c[4]-c2[4]) + (c[5]-c2[5])*(c[5]-c2[5]) + (c[6]-c2[6])*(c[6]-c2[6]);
    -      break;
    -  case 8:
    -      dist= (c[0]-c2[0])*(c[0]-c2[0]) + (c[1]-c2[1])*(c[1]-c2[1]) + (c[2]-c2[2])*(c[2]-c2[2]) + (c[3]-c2[3])*(c[3]-c2[3]) + (c[4]-c2[4])*(c[4]-c2[4]) + (c[5]-c2[5])*(c[5]-c2[5]) + (c[6]-c2[6])*(c[6]-c2[6]) + (c[7]-c2[7])*(c[7]-c2[7]);
    -      break;
    -  default:
    -      dist= 0.0;
    -      for(int k=dim; k--; ){
    -          dist += (*c - *c2) * (*c - *c2);
    -          ++c;
    -          ++c2;
    -      }
    -      break;
    -    }
    -    return sqrt(dist);
    -}//distance
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::ostream;
    -using orgQhull::QhullPoint;
    -using orgQhull::UsingLibQhull;
    -
    -#//operator<<
    -
    -ostream &
    -operator<<(ostream &os, const QhullPoint &p)
    -{
    -    os << p.printWithIdentifier(UsingLibQhull::NOqhRunId, "");
    -    return os;
    -}
    -
    -//! Same as qh_printpointid [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullPoint::PrintPoint &pr)
    -{
    -    QhullPoint p= *pr.point; 
    -    int i= p.id(pr.run_id);
    -    if(pr.point_message){
    -        if(*pr.point_message){
    -            os << pr.point_message << " ";
    -        }
    -        if(pr.with_identifier && (i!=-1)){
    -            os << "p" << i << ": ";
    -        }
    -    }
    -    const realT *c= p.coordinates();
    -    for(int k=p.dimension(); k--; ){
    -        realT r= *c++;
    -        if(pr.point_message){
    -            os << " " << r; // FIXUP QH11010 %8.4g
    -        }else{
    -            os << " " << r; // FIXUP QH11010 qh_REAL_1
    -        }
    -    }
    -    os << std::endl;
    -    return os;
    -}//printPoint
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.h
    deleted file mode 100644
    index d67b03da47..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoint.h
    +++ /dev/null
    @@ -1,130 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullPoint.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHPOINT_H
    -#define QHPOINT_H
    -
    -#include "QhullError.h"
    -#include "QhullIterator.h"
    -#include "UsingLibQhull.h"
    -#include "Coordinates.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! QhullPoint as a pointer and dimension to shared memory
    -    class QhullPoint;
    -    //! Java-style iterator for QhullPoint coordinates
    -    class QhullPointIterator;
    -
    -class QhullPoint {
    -
    -    //! A point is a pointer into an array of coordinates.
    -
    -private:
    -#//Fields
    -    coordT             *point_coordinates;  // Keep pointers aligned
    -    int                 point_dimension;
    -
    -public:
    -#//Subtypes
    -    typedef const coordT *              iterator;
    -    typedef const coordT *              const_iterator;
    -    typedef QhullPoint::iterator        Iterator;
    -    typedef QhullPoint::const_iterator  ConstIterator;
    -
    -#//Class methods -- Convert point to id w/o QhullQh data structure
    -    static int          id(const coordT *c) { return QhullPoint::id(UsingLibQhull::NOqhRunId, 0, c); }
    -    static int          id(int qhRunId, const coordT *c) { return QhullPoint::id(qhRunId, 0, c); }
    -    static int          id(int qhRunId, int dimension, const coordT *c);
    -
    -#//Construct
    -                        QhullPoint() : point_coordinates(0), point_dimension(0) {};
    -                        QhullPoint(int pointDimension, coordT *c) : point_coordinates(c), point_dimension(pointDimension) {}
    -    explicit            QhullPoint(Coordinates &c) : point_coordinates(c.data()), point_dimension(c.count()) {}
    -                        // Creates an alias.  Does not copy the point.  Needed for return by value and parameter passing.
    -                        QhullPoint(const QhullPoint &other)  : point_coordinates(other.point_coordinates), point_dimension(other.point_dimension) {}
    -                        // Creates an alias.  Does not copy the point.  Needed for vector
    -    QhullPoint         &operator=(const QhullPoint &other) { point_coordinates= other.point_coordinates; point_dimension= other.point_dimension; return *this; }
    -                       ~QhullPoint() {}
    -
    -#//Conversions
    -    // see coordinates()
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList       toQList() const;
    -#endif //QHULL_USES_QT
    -
    -#//Read-only
    -public:
    -    const coordT       *coordinates() const { return point_coordinates; }
    -    coordT             *coordinates() { return point_coordinates; }
    -    int                 dimension() const { return point_dimension; }
    -    int                 id(int qhRunId) const { return id(qhRunId, dimension(), coordinates()); }
    -    int                 id() const { return id(UsingLibQhull::NOqhRunId, dimension(), coordinates()); }
    -    bool                isDefined() const { return point_coordinates!=0 && point_dimension>0; }
    -
    -#//Define
    -    void                advancePoint(int idx) { point_coordinates += idx*point_dimension; }
    -    void                defineAs(int pointDimension, coordT *c) { QHULL_ASSERT(pointDimension>=0); point_coordinates= c; point_dimension= pointDimension; }
    -    //! Creates an alias to other
    -    void                defineAs(QhullPoint &other) { point_coordinates= other.coordinates(); point_dimension= other.dimension(); }
    -    void                setCoordinates(coordT *c) { point_coordinates= c; }
    -    void                setDimension(int pointDimension) { point_dimension= pointDimension; }
    -
    -#//value
    -    double              distance(const QhullPoint &p) const;
    -
    -#//iterator
    -    iterator            begin() { return point_coordinates; }
    -    const_iterator      begin() const { return point_coordinates; }
    -    const_iterator      constBegin() const { return point_coordinates; }
    -    const_iterator      constEnd() const { return point_coordinates+point_dimension; }
    -    int                 count() { return dimension(); }
    -    iterator            end() { return point_coordinates+point_dimension; }
    -    const_iterator      end() const { return point_coordinates+point_dimension; }
    -    size_t              size() { return (size_t)dimension(); }
    -
    -#//Operator
    -    bool                operator==(const QhullPoint &other) const;
    -    bool                operator!=(const QhullPoint &other) const { return !operator==(other); }
    -    const coordT       &operator[](int idx) const { QHULL_ASSERT(idx>=0 && idx=0 && idx
    -#include 
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#// Conversion
    -
    -// See qt-qhull.cpp for QList conversion
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullPointSet::
    -toStdVector() const
    -{
    -    QhullPointSetIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        vs.push_back(i.next());
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Element-access
    -//! Derived from QhullSet::value
    -QhullPoint QhullPointSet::
    -value(int idx) const
    -{
    -    // Avoid call to qh_setsize() and assert in elementPointer()
    -    //const T *n= reinterpret_cast(&SETelem_(getSetT(), idx));
    -    void **n= reinterpret_cast(&SETelem_(getSetT(), idx));
    -    coordT **n2= reinterpret_cast(n);
    -    if(idx>=0 && n(&SETelem_(getSetT(), idx));
    -    coordT **n2= reinterpret_cast(n);
    -    if(idx>=0 && nconstEnd()){
    -        if(*i++ == p){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findNext
    -
    -bool QhullPointSetIterator::
    -findPrevious(const QhullPoint &p)
    -{
    -    while(i!=c->constBegin()){
    -        if(*(--i) == p){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findPrevious
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using orgQhull::QhullPoint;
    -using orgQhull::QhullPointSet;
    -using orgQhull::UsingLibQhull;
    -
    -#//operator<<
    -
    -ostream &
    -operator<<(ostream &os, const QhullPointSet &ps)
    -{
    -    os << ps.print(UsingLibQhull::NOqhRunId);
    -    return os;
    -}//<
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! QhullPointSet -- a set of coordinate pointers with dimension
    -    // with const_iterator and iterator
    -    class               QhullPointSet;
    -    //! Java-style iterator
    -    class QhullPointsIterator;
    -
    -#//Classref
    -    class               QhullPoint;
    -
    -class QhullPointSet : public QhullSet {
    -
    -private:
    -#//Field
    -    int                 point_dimension;
    -
    -public:
    -#//Subtypes and types
    -    class               const_iterator;
    -    class               iterator;
    -    typedef QhullPointSet::const_iterator ConstIterator;
    -    typedef QhullPointSet::iterator Iterator;
    -
    -    typedef QhullPoint  value_type;
    -    typedef ptrdiff_t   difference_type;
    -    typedef int         size_type;
    -    //typedef const value_type *const_pointer;    // FIXUP QH11019: QhullPointSet does not define pointer or reference due to point_dimension
    -    //typedef const value_type &const_reference;
    -    //typedef value_type *pointer;
    -    //typedef value_type &reference;
    -
    -#//Construct
    -                        //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
    -                        QhullPointSet(int pointDimension, setT *s) : QhullSet(s), point_dimension(pointDimension) {}
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
    -                        QhullPointSet(const QhullPointSet &o) : QhullSet(o), point_dimension(o.point_dimension) {}
    -                       ~QhullPointSet() {}
    -
    -//Default constructor and copy assignment disabled since p= p2 is ambiguous (coord* vs coord)
    -private:
    -                        QhullPointSet();
    -    QhullPointSet      &operator=(const QhullPointSet &);
    -public:
    -
    -#//Conversions
    -    // inherited -- constData, data
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -#endif
    -#ifdef QHULL_USES_QT
    -    QList   toQList() const;
    -#endif
    -
    -#//Read-only
    -    //inherits count, empty, isEmpty, size
    -    using QhullSetBase::count;
    -    int                 dimension() const { return point_dimension; }
    -    bool                operator==(const QhullPointSet &o) const;
    -    bool                operator!=(const QhullPointSet &o) const { return !operator==(o); }
    -
    -#//Element access -- can not return references since QhullPoint must be generated
    -    QhullPoint          at(int idx) const { return operator[](idx); }
    -    QhullPoint          back() const { return last(); }
    -    //! end element is NULL
    -    QhullPoint          first() const { QHULL_ASSERT(!isEmpty()); return *begin(); }
    -    QhullPoint          front() const { return first(); }
    -    QhullPoint          last() const { QHULL_ASSERT(!isEmpty()); return *(end()-1); }
    -    // mid() not available.  No setT constructor
    -    QhullPoint          operator[](int idx) const { return QhullPoint(dimension(), QhullSet::operator[](idx)); }
    -    QhullPoint          second()  const { return operator[](1); }
    -    QhullPoint          value(int idx) const;
    -    // Non-const since copy is an alias
    -    QhullPoint          value(int idx, QhullPoint &defaultValue) const;
    -
    -#//iterator
    -    iterator            begin() { return iterator(dimension(), reinterpret_cast(beginPointer())); }
    -    const_iterator      begin() const { return const_iterator(dimension(), reinterpret_cast(beginPointer())); }
    -    const_iterator      constBegin() const { return const_iterator(dimension(), reinterpret_cast(beginPointer())); }
    -    const_iterator      constEnd() const { return const_iterator(dimension(), reinterpret_cast(endPointer())); }
    -    iterator            end() { return iterator(dimension(), reinterpret_cast(endPointer())); }
    -    const_iterator      end() const { return const_iterator(dimension(), reinterpret_cast(endPointer())); }
    -
    -//Read-write -- Not available, no setT constructor
    -
    -#//Search
    -    bool                contains(const QhullPoint &t) const;
    -    int                 count(const QhullPoint &t) const;
    -    int                 indexOf(const QhullPoint &t) const;
    -    int                 lastIndexOf(const QhullPoint &t) const;
    -
    -    // before const_iterator for conversion with comparison operators
    -    class iterator {
    -        friend class    const_iterator;
    -
    -    private:
    -        coordT        **i;
    -        int             point_dimension;
    -
    -    public:
    -        typedef ptrdiff_t   difference_type;
    -        typedef std::bidirectional_iterator_tag  iterator_category;
    -        typedef QhullPoint *pointer;
    -        typedef QhullPoint &reference;
    -        typedef QhullPoint  value_type;
    -
    -                        iterator() : i(0), point_dimension(0) {}
    -                        iterator(int dimension, coordT **c) : i(c), point_dimension(dimension) {}
    -                        iterator(const iterator &o) : i(o.i), point_dimension(o.point_dimension) {}
    -        iterator       &operator=(const iterator &o) { i= o.i; point_dimension= o.point_dimension; return *this; }
    -
    -        QhullPoint      operator*() const { return QhullPoint(point_dimension, *i); }
    -                      //operator->() n/a, value-type
    -        QhullPoint      operator[](int idx) { return QhullPoint(point_dimension, *(i+idx)); }
    -        bool            operator==(const iterator &o) const { return i == o.i && point_dimension == o.point_dimension; }
    -        bool            operator!=(const iterator &o) const { return !operator==(o); }
    -        bool            operator==(const const_iterator &o) const
    -        { return i == reinterpret_cast(o).i && point_dimension == reinterpret_cast(o).point_dimension; }
    -        bool            operator!=(const const_iterator &o) const { return !operator==(o); }
    -
    -        //! Assumes same point set
    -        int             operator-(const iterator &o) { return (int)(i-o.i); } //WARN64
    -        bool            operator>(const iterator &o) const { return i>o.i; }
    -        bool            operator<=(const iterator &o) const { return !operator>(o); }
    -        bool            operator<(const iterator &o) const { return i=(const iterator &o) const { return !operator<(o); }
    -        bool            operator>(const const_iterator &o) const
    -        { return i > reinterpret_cast(o).i; }
    -        bool            operator<=(const const_iterator &o) const { return !operator>(o); }
    -        bool            operator<(const const_iterator &o) const
    -        { return i < reinterpret_cast(o).i; }
    -        bool            operator>=(const const_iterator &o) const { return !operator<(o); }
    -
    -        iterator       &operator++() { ++i; return *this; }
    -        iterator        operator++(int) { iterator o= *this; ++i; return o; }
    -        iterator       &operator--() { --i; return *this; }
    -        iterator        operator--(int) { iterator o= *this; --i; return o; }
    -        iterator        operator+(int j) const { return iterator(point_dimension, i+j); }
    -        iterator        operator-(int j) const { return operator+(-j); }
    -        iterator       &operator+=(int j) { i += j; return *this; }
    -        iterator       &operator-=(int j) { i -= j; return *this; }
    -    };//QhullPointSet::iterator
    -
    -    class const_iterator {
    -    private:
    -        coordT        **i;
    -        int             point_dimension;
    -
    -    public:
    -        typedef std::random_access_iterator_tag  iterator_category;
    -        typedef QhullPoint value_type;
    -        typedef value_type *pointer;
    -        typedef value_type &reference;
    -        typedef ptrdiff_t  difference_type;
    -
    -                        const_iterator() : i(0), point_dimension(0) {}
    -                        const_iterator(int dimension, coordT **c) : i(c), point_dimension(dimension) {}
    -                        const_iterator(const const_iterator &o) : i(o.i), point_dimension(o.point_dimension) {}
    -                        const_iterator(iterator o) : i(o.i), point_dimension(o.point_dimension) {}
    -        const_iterator &operator=(const const_iterator &o) { i= o.i; point_dimension= o.point_dimension; return *this; }
    -
    -        QhullPoint      operator*() const { return QhullPoint(point_dimension, *i); }
    -        QhullPoint      operator[](int idx) { return QhullPoint(point_dimension, *(i+idx)); }
    -                      //operator->() n/a, value-type
    -        bool            operator==(const const_iterator &o) const { return i == o.i && point_dimension == o.point_dimension; }
    -        bool            operator!=(const const_iterator &o) const { return !operator==(o); }
    -
    -        //! Assumes same point set
    -        int             operator-(const const_iterator &o) { return (int)(i-o.i); } //WARN64
    -        bool            operator>(const const_iterator &o) const { return i>o.i; }
    -        bool            operator<=(const const_iterator &o) const { return !operator>(o); }
    -        bool            operator<(const const_iterator &o) const { return i=(const const_iterator &o) const { return !operator<(o); }
    -
    -        const_iterator &operator++() { ++i; return *this; }
    -        const_iterator  operator++(int) { const_iterator o= *this; ++i; return o; }
    -        const_iterator &operator--() { --i; return *this; }
    -        const_iterator  operator--(int) { const_iterator o= *this; --i; return o; }
    -        const_iterator  operator+(int j) const { return const_iterator(point_dimension, i+j); }
    -        const_iterator  operator-(int j) const { return operator+(-j); }
    -        const_iterator &operator+=(int j) { i += j; return *this; }
    -        const_iterator &operator-=(int j) { i -= j; return *this; }
    -    };//QhullPointSet::const_iterator
    -
    -#//IO
    -    struct PrintIdentifiers{
    -        const QhullPointSet *point_set;
    -        const char     *print_message;
    -        int             run_id;
    -        PrintIdentifiers(const char *message, const QhullPointSet *s) : point_set(s), print_message(message) {}
    -    };//PrintIdentifiers
    -    PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
    -
    -    struct PrintPointSet{
    -        const QhullPointSet *point_set;
    -        const char     *print_message;
    -        int             run_id;
    -        PrintPointSet(int qhRunId, const char *message, const QhullPointSet &s) : point_set(&s), print_message(message), run_id(qhRunId) {}
    -    };//PrintPointSet
    -    PrintPointSet       print(int qhRunId) const { return PrintPointSet(qhRunId, 0, *this); }
    -    PrintPointSet       print(int qhRunId, const char *message) const { return PrintPointSet(qhRunId, message, *this); }
    -
    -};//QhullPointSet
    -
    -//derived from qiterator.h
    -class QhullPointSetIterator { // FIXUP QH11020 define QhullMutablePointSetIterator
    -    typedef QhullPointSet::const_iterator const_iterator;
    -    const QhullPointSet *c;
    -    const_iterator      i;
    -
    -public:
    -                        QhullPointSetIterator(const QhullPointSet &container) : c(&container), i(c->constBegin()) {}
    -    QhullPointSetIterator &operator=(const QhullPointSet &container) { c= &container; i= c->constBegin(); return *this; }
    -    bool                findNext(const QhullPoint &p);
    -    bool                findPrevious(const QhullPoint &p);
    -    bool                hasNext() const { return i != c->constEnd(); }
    -    bool                hasPrevious() const { return i != c->constBegin(); }
    -    QhullPoint          next() { return *i++; }
    -    QhullPoint          peekNext() const { return *i; }
    -    QhullPoint          peekPrevious() const { const_iterator p= i; return *--p; }
    -    QhullPoint          previous() { return *--i; }
    -    void                toBack() { i= c->constEnd(); }
    -    void                toFront() { i= c->constBegin(); }
    -};//QhullPointSetIterator
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPointSet &fs); // Not inline to avoid using statement
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPointSet::PrintIdentifiers &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPointSet::PrintPointSet &pr);
    -
    -#endif // QHULLPOINTSET_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoints.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoints.cpp
    deleted file mode 100644
    index e94b4e0e21..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullPoints.cpp
    +++ /dev/null
    @@ -1,235 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullPoints.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "QhullPoints.h"
    -
    -#include 
    -#include 
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Conversion
    -// See qt-qhull.cpp for QList conversion
    -
    -#ifndef QHULL_NO_STL
    -std::vector QhullPoints::
    -toStdVector() const
    -{
    -    QhullPointsIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        vs.push_back(i.next());
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#//Read-only
    -
    -bool QhullPoints::
    -operator==(const QhullPoints &other) const
    -{
    -    if(point_dimension!=other.point_dimension || (point_end-point_first) != (other.point_end-other.point_first)){
    -        return false;
    -    }
    -    const coordT *c= point_first;
    -    const coordT *c2= other.point_first;
    -    while(c=n){
    -        n= 0;
    -    }else if(length<0 || idx+length>=n){
    -        n -= idx;
    -    }else{
    -        n -= idx+length;
    -    }
    -    return QhullPoints(point_dimension, n*point_dimension, point_first+idx*point_dimension);
    -}//mid
    -
    -QhullPoint QhullPoints::
    -value(int idx) const
    -{
    -    QhullPoint p;
    -    if(idx>=0 && idx=0 && idxconstEnd()){
    -        if(*i++ == p){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findNext
    -
    -bool QhullPointsIterator::
    -findPrevious(const QhullPoint &p)
    -{
    -    while(i!=ps->constBegin()){
    -        if(*--i == p){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findPrevious
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::ostream;
    -using orgQhull::QhullPoint;
    -using orgQhull::QhullPoints;
    -using orgQhull::QhullPointsIterator;
    -
    -ostream &
    -operator<<(ostream &os, const QhullPoints &p)
    -{
    -    QhullPointsIterator i(p);
    -    while(i.hasNext()){
    -        os << i.next();
    -    }
    -    return os;
    -}//operator<
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! coordinate pointer with dimension
    -    // with const_iterator and iterator
    -    class QhullPoints;
    -    //! Java-style iterator
    -    class QhullPointsIterator;
    -
    -class QhullPoints {
    -
    -    // QhullPoints consists of pointers into an array of coordinates.
    -
    -private:
    -#//Field
    -    coordT             *point_first;
    -    coordT             *point_end;  // end>=first.  Trailing coordinates ignored
    -    int                 point_dimension;  // >= 0
    -
    -public:
    -#//Subtypes
    -    class               const_iterator;
    -    class               iterator;
    -    typedef QhullPoints::const_iterator ConstIterator;
    -    typedef QhullPoints::iterator Iterator;
    -
    -#//Construct
    -                        QhullPoints() : point_first(0), point_end(0), point_dimension(0) {};
    -                        QhullPoints(int pointDimension) : point_first(0), point_end(0), point_dimension(pointDimension) { QHULL_ASSERT(pointDimension>=0); }
    -                        QhullPoints(int pointDimension, int coordinateCount2, coordT *c) : point_first(c), point_end(c+coordinateCount2), point_dimension(pointDimension) { QHULL_ASSERT(pointDimension>=0 && coordinateCount2>=0 ); }
    -                        //Copy constructor copies pointers but not contents.  Needed for return by value and parameter passing.
    -                        QhullPoints(const QhullPoints &other)  : point_first(other.point_first), point_end(other.point_end), point_dimension(other.point_dimension) {}
    -                       ~QhullPoints() {}
    -
    -//disabled since p= p2 is ambiguous (coord* vs coord)
    -private:
    -    QhullPoints        &operator=(const QhullPoints &other) { point_first= other.point_first; point_end= other.point_end; point_dimension= other.point_dimension; return *this; }
    -public:
    -
    -#//Conversion
    -    const coordT       *constData() const { return coordinates(); }
    -    // See coordinates()
    -    coordT             *data() { return coordinates(); }
    -    const coordT       *data() const { return coordinates(); }
    -#ifndef QHULL_NO_STL
    -    std::vector toStdVector() const;
    -#endif //QHULL_NO_STL
    -#ifdef QHULL_USES_QT
    -    QList   toQList() const;
    -#endif //QHULL_USES_QT
    -
    -#//GetSet
    -    coordT             *coordinates() const { return point_first; }
    -    int                 coordinateCount() const { return (int)(point_end-point_first); } // WARN64
    -    int                 count() const { return (int)size(); } // WARN64
    -    void                defineAs(int pointDimension, int coordinatesCount, coordT *c) { QHULL_ASSERT(pointDimension>=0 && coordinatesCount>=0 && c!=0); point_first= c; point_end= c+coordinatesCount; point_dimension= pointDimension; }
    -    void                defineAs(int coordinatesCount, coordT *c) { QHULL_ASSERT((coordinatesCount>=0 && c!=0) || (c==0 && coordinatesCount==0)); point_first= c; point_end= c+coordinatesCount; }
    -    void                defineAs(const QhullPoints &other) { point_first= other.point_first; point_end= other.point_end; point_dimension= other.point_dimension; }
    -    int                 dimension() const { return point_dimension; }
    -    bool                empty() const { return point_end==point_first; }
    -    coordT             *extraCoordinates() const { return extraCoordinatesCount() ? (point_end-extraCoordinatesCount()) : 0; }
    -    int                 extraCoordinatesCount() const { return point_dimension>0 ? (int)((point_end-point_first)%(size_t)point_dimension) : 0; }  // WARN64
    -    bool                includesCoordinates(const coordT *c) const { return c>=point_first && c=0); point_dimension= pointDimension; }
    -    size_t              size() const { return (point_dimension ? (point_end-point_first)/point_dimension : 0); }
    -
    -#//ElementAccess -- can not return references to QhullPoint
    -    QhullPoint          at(int idx) const { coordT *p= point_first+idx*point_dimension; QHULL_ASSERT(p(other)); return *this; }
    -        QhullPoint     *operator->() { return this; }
    -        // value instead of reference since advancePoint() modifies self
    -        QhullPoint      operator*() const { return *this; }
    -        QhullPoint      operator[](int idx) const { QhullPoint n= *this; n.advancePoint(idx); return n; }
    -        bool            operator==(const iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates()==other.coordinates(); }
    -        bool            operator!=(const iterator &other) const { return !operator==(other); }
    -        bool            operator<(const iterator &other) const  { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() < other.coordinates(); }
    -        bool            operator<=(const iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() <= other.coordinates(); }
    -        bool            operator>(const iterator &other) const  { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() > other.coordinates(); }
    -        bool            operator>=(const iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() >= other.coordinates(); }
    -        // reinterpret_cast to break circular dependency
    -        bool            operator==(const QhullPoints::const_iterator &other) const { QHULL_ASSERT(dimension()==reinterpret_cast(other).dimension()); return coordinates()==reinterpret_cast(other).coordinates(); }
    -        bool            operator!=(const QhullPoints::const_iterator &other) const { return !operator==(reinterpret_cast(other)); }
    -        bool            operator<(const QhullPoints::const_iterator &other) const  { QHULL_ASSERT(dimension()==reinterpret_cast(other).dimension()); return coordinates() < reinterpret_cast(other).coordinates(); }
    -        bool            operator<=(const QhullPoints::const_iterator &other) const { QHULL_ASSERT(dimension()==reinterpret_cast(other).dimension()); return coordinates() <= reinterpret_cast(other).coordinates(); }
    -        bool            operator>(const QhullPoints::const_iterator &other) const  { QHULL_ASSERT(dimension()==reinterpret_cast(other).dimension()); return coordinates() > reinterpret_cast(other).coordinates(); }
    -        bool            operator>=(const QhullPoints::const_iterator &other) const { QHULL_ASSERT(dimension()==reinterpret_cast(other).dimension()); return coordinates() >= reinterpret_cast(other).coordinates(); }
    -        iterator       &operator++() { advancePoint(1); return *this; }
    -        iterator        operator++(int) { iterator n= *this; operator++(); return iterator(n); }
    -        iterator       &operator--() { advancePoint(-1); return *this; }
    -        iterator        operator--(int) { iterator n= *this; operator--(); return iterator(n); }
    -        iterator       &operator+=(int idx) { advancePoint(idx); return *this; }
    -        iterator       &operator-=(int idx) { advancePoint(-idx); return *this; }
    -        iterator        operator+(int idx) const { iterator n= *this; n.advancePoint(idx); return n; }
    -        iterator        operator-(int idx) const { iterator n= *this; n.advancePoint(-idx); return n; }
    -        difference_type operator-(iterator other) const { QHULL_ASSERT(dimension()==other.dimension()); return (coordinates()-other.coordinates())/dimension(); }
    -    };//QhullPoints::iterator
    -
    -#//QhullPoints::const_iterator -- FIXUP QH11018 const_iterator same as iterator
    -    class const_iterator : public QhullPoint {
    -
    -    public:
    -        typedef std::random_access_iterator_tag  iterator_category;
    -        typedef QhullPoint          value_type;
    -        typedef const value_type   *pointer;
    -        typedef const value_type   &reference;
    -        typedef ptrdiff_t           difference_type;
    -
    -                        const_iterator() : QhullPoint() {}
    -                        const_iterator(const const_iterator &other) : QhullPoint(*other) {}
    -                        const_iterator(const QhullPoints::iterator &other) : QhullPoint(*other) {}
    -        explicit        const_iterator(const QhullPoints &ps) : QhullPoint(ps.dimension(), ps.coordinates()) {}
    -        explicit        const_iterator(int pointDimension, coordT *c): QhullPoint(pointDimension, c) {}
    -        const_iterator &operator=(const const_iterator &other) { defineAs(const_cast(other)); return *this; }
    -        // value/non-const since advancePoint(1), etc. modifies self
    -        QhullPoint      operator*() const { return *this; }
    -        QhullPoint     *operator->() { return this; }
    -        QhullPoint      operator[](int idx) const { QhullPoint n= *this; n.advancePoint(idx); return n; }
    -        bool            operator==(const const_iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates()==other.coordinates(); }
    -        bool            operator!=(const const_iterator &other) const { return !operator==(other); }
    -        bool            operator<(const const_iterator &other) const  { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() < other.coordinates(); }
    -        bool            operator<=(const const_iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() <= other.coordinates(); }
    -        bool            operator>(const const_iterator &other) const  { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() > other.coordinates(); }
    -        bool            operator>=(const const_iterator &other) const { QHULL_ASSERT(dimension()==other.dimension()); return coordinates() >= other.coordinates(); }
    -        const_iterator &operator++() { advancePoint(1); return *this; }
    -        const_iterator  operator++(int) { const_iterator n= *this; operator++(); return const_iterator(n); }
    -        const_iterator &operator--() { advancePoint(-1); return *this; }
    -        const_iterator  operator--(int) { const_iterator n= *this; operator--(); return const_iterator(n); }
    -        const_iterator &operator+=(int idx) { advancePoint(idx); return *this; }
    -        const_iterator &operator-=(int idx) { advancePoint(-idx); return *this; }
    -        const_iterator  operator+(int idx) const { const_iterator n= *this; n.advancePoint(idx); return n; }
    -        const_iterator  operator-(int idx) const { const_iterator n= *this; n.advancePoint(-idx); return n; }
    -        difference_type operator-(const_iterator other) const { QHULL_ASSERT(dimension()==other.dimension()); return (coordinates()-other.coordinates())/dimension(); }
    -    };//QhullPoints::const_iterator
    -
    -#//IO
    -    struct PrintPoints{
    -        const QhullPoints  *points;
    -        const char     *point_message;
    -        int             run_id;
    -        bool            with_identifier;
    -        PrintPoints(int qhRunId, const char *message, bool withIdentifier, const QhullPoints &ps) : points(&ps), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {}
    -    };//PrintPoints
    -    PrintPoints          print() const { return  PrintPoints(UsingLibQhull::NOqhRunId, "", false, *this); }
    -    PrintPoints          print(int qhRunId) const { return PrintPoints(qhRunId, "", true, *this); }
    -    PrintPoints          print(int qhRunId, const char *message) const { return PrintPoints(qhRunId, message, false, *this); }
    -    PrintPoints          printWithIdentifier(int qhRunId, const char *message) const { return PrintPoints(qhRunId, message, true, *this); }
    -    //FIXUP remove message for print()?
    -};//QhullPoints
    -
    -// can't use QHULL_DECLARE_SEQUENTIAL_ITERATOR because next(),etc would return a reference to a temporary
    -class QhullPointsIterator
    -{
    -    typedef QhullPoints::const_iterator const_iterator;
    -
    -private:
    -#//Fields
    -    const QhullPoints  *ps;
    -    const_iterator      i;
    -
    -public:
    -                        QhullPointsIterator(const QhullPoints &other) : ps(&other), i(ps->constBegin()) {}
    -    QhullPointsIterator &operator=(const QhullPoints &other) { ps = &other; i = ps->constBegin(); return *this; }
    -    bool                findNext(const QhullPoint &t);
    -    bool                findPrevious(const QhullPoint &t);
    -    bool                hasNext() const { return i != ps->constEnd(); }
    -    bool                hasPrevious() const { return i != ps->constBegin(); }
    -    QhullPoint          next() { return *i++; }
    -    QhullPoint          peekNext() const { return *i; }
    -    QhullPoint          peekPrevious() const { const_iterator p = i; return *--p; }
    -    QhullPoint          previous() { return *--i; }
    -    void                toBack() { i = ps->constEnd(); }
    -    void                toFront() { i = ps->constBegin(); }
    -};//QhullPointsIterator
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -std::ostream           &operator<<(std::ostream &os, const orgQhull::QhullPoints &p);
    -std::ostream           &operator<<(std::ostream &os, const orgQhull::QhullPoints::PrintPoints &pr);
    -
    -#endif // QHULLPOINTS_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.cpp
    deleted file mode 100644
    index ba03e74d46..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.cpp
    +++ /dev/null
    @@ -1,104 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullQh.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullQh -- Qhull's global data structure, qhT, as a C++ class
    -
    -
    -
    -#include "QhullError.h"
    -#include "QhullQh.h"
    -#include "QhullStat.h"
    -
    -#include 
    -#include 
    -
    -using std::cerr;
    -using std::string;
    -using std::vector;
    -using std::ostream;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Global variables
    -
    -#//Constructor, destructor, etc.
    -
    -//! If qh_QHpointer==0, invoke with placement new on qh_qh;
    -//! Sets qh_qh and qh_qhstat.  Need to reset before UsingLibQhull.
    -//! Derived from qh_new_qhull[user.c]
    -QhullQh::
    -QhullQh()
    -{
    -    static boolT firstcall = True;
    -
    -    if(firstcall){
    -        if(qhmem.BUFinit!=0){
    -            throw QhullError(10017, "Qhull error: qhmem already initialized by another class.");
    -        }
    -        qh_meminit(NULL);
    -        firstcall= False;
    -    }
    -    // QhullQh() and UsingLibQhull() are the same
    -#if qh_QHpointer
    -    if(qh_qh){
    -        if(qh old_qhstat){
    -            throw QhullError(10041, "Qhull internal error: qh_qh.old_qhstat defined (%x) but qh_qh is active.  qh_qh not restored correctly.", 0, 0, 0.0, qh old_qhstat);
    -        }
    -        qh old_qhstat= qh_qhstat;
    -        qh old_tempstack= qhmem.tempstack;
    -        qh_qhstat= 0;
    -        qhmem.tempstack= 0;
    -    }
    -    qh_qh= static_cast(this);
    -#else
    -    if(strncmp(qh qhull, "qhull", 5) == 0){
    -        throw QhullError(10022, "Qhull error: Qhull already initialized as run %d", qh run_id);
    -    }
    -#endif
    -    // NOerrors -- Does not call qh_errexit()
    -    qh_initstatistics();
    -    // NOerrors -- Does not call qh_errexit()
    -    qh_initqhull_start2(NULL, NULL, qh_FILEstderr);
    -}//QhullQh
    -
    -//! UsingLibQhull must be declared along with QhullQh
    -QhullQh::
    -~QhullQh()
    -{
    -#if qh_QHpointer
    -    if(!qh_qh){
    -        QhullError e(10042, "Qhull internal error: qh_qh undefined.  Was ~QhullQh() invoked independent of UsingLibQhull?", qh run_id, 0, 0, qh_qh);
    -        e.logError();
    -    }else if(!qh_qhstat){
    -        QhullError e(10043, "Qhull internal error: qh_qhstat null.  Is another thread running?");
    -        e.logError();
    -    }else if(qh_qh!=this){
    -        QhullError e(10044, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh);
    -        e.logError();
    -    }else{
    -        qh_freeqhull2(qh_ALL); // sets qh.NOerrexit.  Clears struct *qh_qh including run_id, but not qh_qh itself
    -    }
    -#else
    -    if(&qh_qh!=this){
    -        QhullError e(10045, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh);
    -        e.logError();
    -    }else{
    -        qh_freeqhull2(qh_ALL); // sets qh.NOerrexit.  Clears struct *qh_qh including run_id, but not qh_qh itself
    -    }
    -#endif
    -}//~QhullQh
    -
    -#//Parallel Access
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.h
    deleted file mode 100644
    index 1576e9ca03..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullQh.h
    +++ /dev/null
    @@ -1,51 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullQh.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLQH_H
    -#define QHULLQH_H
    -
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//defined here
    -    //! QhullQh -- Qhull's global data structure, qhT, as a C++ class
    -    //! See UsingLibQhull.h for C++/C interface to qhT
    -    class QhullQh;
    -
    -class QhullQh : public qhT {
    -
    -#//Constants
    -    // Set ignored.  PointSet needs explicit dimension
    -    // Facet from vertices or ridges.vertices.count
    -    // Ridge from vertices.count
    -    // Vertex stored in vertexT?  1->16?
    -    // QhullPoint needs explicit dimension
    -
    -#//members (empty) -- POD type equivalent to qhT.  No data or virtual members
    -
    -public:
    -#//constructor, assignment, destructor, invariant
    -    QhullQh();
    -    ~QhullQh();
    -
    -private:
    -    //!disable copy constructor and assignment
    -                        QhullQh(const QhullQh &);
    -    QhullQh            &operator=(const QhullQh &);
    -
    -};//class QhullQh
    -
    -}//namespace orgQhull
    -
    -#endif // QHULLQH_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.cpp
    deleted file mode 100644
    index a0a63bbe74..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.cpp
    +++ /dev/null
    @@ -1,102 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullRidge.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullRidge -- Qhull's ridge structure, ridgeT, as a C++ class
    -
    -#include "QhullSets.h"
    -#include "QhullVertex.h"
    -#include "QhullRidge.h"
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//class statics
    -ridgeT QhullRidge::
    -s_empty_ridge= {0,0,0,0,0,
    -                0,0};
    -
    -#//Constructor, destructor, etc.
    -
    -#//Accessors
    -
    -//! Return True if nextRidge3d
    -//! Simplicial facets may have incomplete ridgeSets
    -//! Does not use qh_qh or qh_errexit()
    -bool QhullRidge::
    -hasNextRidge3d(const QhullFacet f) const
    -{
    -    vertexT *v= 0;
    -    ridgeT *ridge= qh_nextridge3d(getRidgeT(), f.getFacetT(), &v);
    -    return (ridge!=0);
    -}//hasNextRidge3d
    -
    -
    -
    -//! Return next ridge and optional vertex for a 3d facet and ridge
    -//! Does not use qh_qh or qh_errexit()
    -QhullRidge QhullRidge::
    -nextRidge3d(const QhullFacet f, QhullVertex *nextVertex) const
    -{
    -    vertexT *v= 0;
    -    ridgeT *ridge= qh_nextridge3d(getRidgeT(), f.getFacetT(), &v);
    -    if(!ridge){
    -        throw QhullError(10030, "Qhull error nextRidge3d:  missing next ridge for facet %d ridge %d.  Does facet contain ridge?", f.id(), id());
    -    }
    -    if(nextVertex!=0){
    -        *nextVertex= QhullVertex(v);
    -    }
    -    return QhullRidge(ridge);
    -}//nextRidge3d
    -
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using orgQhull::QhullRidge;
    -using orgQhull::QhullVertex;
    -using orgQhull::UsingLibQhull;
    -
    -ostream &
    -operator<<(ostream &os, const QhullRidge &r)
    -{
    -    os << r.print(UsingLibQhull::NOqhRunId);
    -    return os;
    -}//<< QhullRidge
    -
    -//! Duplicate of qh_printridge [io.c]
    -//!  if pr.run_id==UsingLibQhull::NOqhRunId, no access to qh [needed for QhullVertex/QhullPoint]
    -ostream &
    -operator<<(ostream &os, const QhullRidge::PrintRidge &pr)
    -{
    -    QhullRidge r= *pr.ridge;
    -    os << "     - r" << r.id();
    -    if(r.getRidgeT()->tested){
    -        os << " tested";
    -    }
    -    if(r.getRidgeT()->nonconvex){
    -        os << " nonconvex";
    -    }
    -    os << endl;
    -    os << r.vertices().print(pr.run_id, "           vertices:");
    -    if(r.getRidgeT()->top && r.getRidgeT()->bottom){
    -        os << "           between f" << r.topFacet().id() << " and f" << r.bottomFacet().id() << endl;
    -    }else if(r.getRidgeT()->top){
    -        os << "           top f" << r.topFacet().id() << endl;
    -    }else if(r.getRidgeT()->bottom){
    -        os << "           bottom f" << r.bottomFacet().id() << endl;
    -    }
    -
    -    return os;
    -}//<< PrintRidge
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.h
    deleted file mode 100644
    index 1f78815e45..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullRidge.h
    +++ /dev/null
    @@ -1,110 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullRidge.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLRIDGE_H
    -#define QHULLRIDGE_H
    -
    -#include "QhullSet.h"
    -#include "QhullVertex.h"
    -#include "QhullVertexSet.h"
    -#include "QhullFacet.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class QhullVertex;
    -    class QhullVertexSet;
    -    class QhullFacet;
    -
    -#//Types
    -    //! QhullRidge -- Qhull's ridge structure, ridgeT [libqhull.h], as a C++ class
    -    class QhullRidge;
    -    typedef QhullSet  QhullRidgeSet;
    -    typedef QhullSetIterator  QhullRidgeSetIterator;
    -
    -    // see QhullSets.h for QhullRidgeSet and QhullRidgeSetIterator -- avoids circular references
    -
    -/************************
    -a ridge is hull_dim-1 simplex between two neighboring facets.  If the
    -facets are non-simplicial, there may be more than one ridge between
    -two facets.  E.G. a 4-d hypercube has two triangles between each pair
    -of neighboring facets.
    -
    -topological information:
    -    vertices            a set of vertices
    -    top,bottom          neighboring facets with orientation
    -
    -geometric information:
    -    tested              True if ridge is clearly convex
    -    nonconvex           True if ridge is non-convex
    -*/
    -
    -class QhullRidge {
    -
    -#//Fields
    -    ridgeT             *qh_ridge;
    -
    -#//Class objects
    -    static ridgeT       s_empty_ridge;
    -
    -public:
    -#//Constants
    -
    -#//Constructors
    -                        QhullRidge() : qh_ridge(&s_empty_ridge) {}
    -                        // Creates an alias.  Does not copy QhullRidge.  Needed for return by value and parameter passing
    -                        QhullRidge(const QhullRidge &o) : qh_ridge(o.qh_ridge) {}
    -                        // Creates an alias.  Does not copy QhullRidge.  Needed for vector
    -    QhullRidge         &operator=(const QhullRidge &o) { qh_ridge= o.qh_ridge; return *this; }
    -                       ~QhullRidge() {}
    -
    -#//Conversion
    -                        //Implicit conversion from ridgeT
    -                        QhullRidge(ridgeT *r) : qh_ridge(r ? r : &s_empty_ridge) {}
    -    ridgeT             *getRidgeT() const { return qh_ridge; }
    -
    -#//QhullSet
    -    ridgeT             *getBaseT() const { return getRidgeT(); }
    -
    -#//getSet
    -    QhullFacet          bottomFacet() const { return QhullFacet(qh_ridge->bottom); }
    -    int                 dimension() const { return QhullSetBase::count(qh_ridge->vertices); }
    -    int                 id() const { return qh_ridge->id; }
    -    bool                isDefined() const { return qh_ridge != &s_empty_ridge; }
    -    bool                operator==(const QhullRidge &o) const { return qh_ridge==o.qh_ridge; }
    -    bool                operator!=(const QhullRidge &o) const { return !operator==(o); }
    -    QhullFacet          otherFacet(QhullFacet f) const { return QhullFacet(qh_ridge->top==f.getFacetT() ? qh_ridge->bottom : qh_ridge->top); }
    -    QhullFacet          topFacet() const { return QhullFacet(qh_ridge->top); }
    -
    -#//forEach
    -    bool                hasNextRidge3d(const QhullFacet f) const;
    -    QhullRidge          nextRidge3d(const QhullFacet f) const { return nextRidge3d(f, 0); }
    -    QhullRidge          nextRidge3d(const QhullFacet f, QhullVertex *nextVertex) const;
    -    QhullVertexSet      vertices() const { return QhullVertexSet(qh_ridge->vertices); }
    -
    -#//IO
    -
    -    struct PrintRidge{
    -        const QhullRidge *ridge;
    -        int             run_id;
    -                        PrintRidge(int qhRunId, const QhullRidge &r) : ridge(&r), run_id(qhRunId) {}
    -    };//PrintRidge
    -    PrintRidge          print(int qhRunId) const { return PrintRidge(qhRunId, *this); }
    -};//class QhullRidge
    -
    -}//namespace orgQhull
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge &r); 
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge::PrintRidge &pr);
    -
    -#endif // QHULLRIDGE_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.cpp
    deleted file mode 100644
    index 5c222f986c..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.cpp
    +++ /dev/null
    @@ -1,47 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullSet.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullSet -- Qhull's facet structure, facetT, as a C++ class
    -
    -#include "QhullError.h"
    -#include "QhullSet.h"
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//static members
    -
    -setT QhullSetBase::
    -s_empty_set;
    -
    -// Same code for qh_setsize [qset.c] and QhullSetBase::count
    -int QhullSetBase::count(const setT *set)
    -{
    -    int size;
    -    const setelemT *sizep;
    -
    -    if (!set)
    -        return(0);
    -    sizep= SETsizeaddr_(set);
    -    if ((size= sizep->i)) {
    -        size--;
    -        if (size > set->maxsize) {
    -            // FIXUP QH11022 How to add additional output to a error? -- qh_setprint(qhmem.ferr, "set: ", set);
    -            throw QhullError(10032, "QhullSet internal error: current set size %d is greater than maximum size %d\n",
    -                size, set->maxsize);
    -        }
    -    }else
    -        size= set->maxsize;
    -    return size;
    -}
    -
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.h
    deleted file mode 100644
    index 7d76a2f16d..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSet.h
    +++ /dev/null
    @@ -1,360 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullSet.h#7 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QhullSet_H
    -#define QhullSet_H
    -
    -#include "QhullError.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -
    -#ifndef QHULL_NO_STL
    -#include 
    -#endif
    -
    -#ifdef QHULL_USES_QT
    - #include 
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Type
    -    class QhullSetBase;  //! Base class for QhullSet
    -    //! QhullSet -- A read-only wrapper to Qhull's collection class, setT.
    -    //!  QhullSet is similar to STL's  and Qt's QVector.
    -    //!  QhullSet is unrelated to STL and Qt's set and map types (e.g., QSet and QMap)
    -    //!  For STL efficiency, QhullSet caches endPointer()
    -    //!  T must be a pointer type
    -    //!  A QhullSet does not own its contents -- erase(), clear(), removeFirst(), removeLast(), pop_back(), pop_front(), fromStdList() not defined
    -    //!  Qhull's FOREACHelement_() [qset.h] is more efficient than QhullSet.  It uses a NULL terminator instead of an end pointer.  STL requires an end pointer.
    -    //!  Derived from QhullLinkedList.h and Qt/core/tools/qvector.h
    -
    -    //! QhullSetIterator defined below
    -    //See: QhullPointSet, QhullLinkedList
    -
    -class QhullSetBase {
    -
    -private:
    -#//Fields --
    -    setT               *qh_set;
    -
    -#//Class objects
    -    static setT         s_empty_set;  //! Workaround for no setT allocator.  Used if setT* is NULL
    -
    -public:
    -#//Class methods
    -    static int          count(const setT *set);
    -    //s may be null
    -    static bool         isEmpty(const setT *s) { return SETempty_(s); }
    -
    -
    -#//Constructors
    -                        //! Copy constructor copies the pointer but not the set.  Needed for return by value and parameter passing.
    -                        QhullSetBase(const QhullSetBase &o) : qh_set(o.qh_set) {}
    -    explicit            QhullSetBase(setT *s) : qh_set(s ? s : &s_empty_set) {}
    -                       ~QhullSetBase() {}
    -
    -private:
    -                        //!disabled since memory allocation for QhullSet not defined
    -                        QhullSetBase() {}
    -                        //!disabled since qs= qs2 is ambiguous (pointer vs. contents)
    -    QhullSetBase       &operator=(const QhullSetBase &);
    -public:
    -
    -#//Conversions
    -                        //! Not type-safe since setT may contain any type
    -    void                defineAs(setT *s) { qh_set= s ? s : &s_empty_set; }
    -    setT               *getSetT() const { return qh_set; }
    -    setT              **referenceSetT() { return &qh_set; }
    -
    -#//Read-only
    -    int                 count() const { return QhullSetBase::count(qh_set); }
    -    bool                empty() const { return SETfirst_(qh_set)==0; }
    -    bool                isEmpty() const { return empty(); }
    -    size_t              size() const { return count(); }
    -
    -#//Element
    -protected:
    -    void              **beginPointer() const { return &qh_set->e[0].p; }
    -    void              **elementPointer(int idx) const { QHULL_ASSERT(idx>=0 && idxmaxsize); return &SETelem_(qh_set, idx); }
    -                        //! Always points to 0
    -    void              **endPointer() const { return qh_setendpointer(qh_set); }
    -};//QhullSetBase
    -
    -
    -//! set of pointers to baseT, T.getBaseT()
    -template 
    -class QhullSet : public QhullSetBase {
    -
    -private:
    -#//Fields -- see QhullSetBase
    -
    -#//Class objects
    -    static setT         s_empty_set;  //! Workaround for no setT allocator.  Used if setT* is NULL
    -
    -public:
    -#//Subtypes
    -    typedef T         *iterator;
    -    typedef const T   *const_iterator;
    -    typedef typename QhullSet::iterator Iterator;
    -    typedef typename QhullSet::const_iterator ConstIterator;
    -
    -#//Class methods
    -    static int          count(const setT *set);
    -                        //s may be null
    -    static bool         isEmpty(const setT *s) { return SETempty_(s); }
    -
    -#//Constructors
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value.
    -                        QhullSet(const QhullSet &o) : QhullSetBase(o) {}
    -                        //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
    -    explicit            QhullSet(setT *s) : QhullSetBase(s) { QHULL_ASSERT(sizeof(T)==sizeof(void *)); }
    -                       ~QhullSet() {}
    -
    -private:
    -                        //!Disable default constructor and copy assignment.  See QhullSetBase
    -                        QhullSet();
    -    QhullSet        &operator=(const QhullSet &);
    -public:
    -
    -#//Conversion
    -
    -#ifndef QHULL_NO_STL
    -    std::vector      toStdVector() const;
    -#endif
    -#ifdef QHULL_USES_QT
    -    QList            toQList() const;
    -#endif
    -
    -#//Read-only -- see QhullSetBase for count(), empty(), isEmpty(), size()
    -    using QhullSetBase::count;
    -    using QhullSetBase::isEmpty;
    -    // operator== defined for QhullSets of the same type
    -    bool                operator==(const QhullSet &other) const { return qh_setequal(getSetT(), other.getSetT()); }
    -    bool                operator!=(const QhullSet &other) const { return !operator==(other); }
    -
    -#//Element access
    -    const T            &at(int idx) const { return operator[](idx); }
    -    T                  &back() { return last(); }
    -    T                  &back() const { return last(); }
    -    //! end element is NULL
    -    const T            *constData() const { return constBegin(); }
    -    T                  *data() { return begin(); }
    -    const T            *data() const { return begin(); }
    -    T                  &first() { QHULL_ASSERT(!isEmpty()); return *begin(); }
    -    const T            &first() const { QHULL_ASSERT(!isEmpty()); return *begin(); }
    -    T                  &front() { return first(); }
    -    const T            &front() const { return first(); }
    -    T                  &last() { QHULL_ASSERT(!isEmpty()); return *(end()-1); }
    -    const T            &last() const {  QHULL_ASSERT(!isEmpty()); return *(end()-1); }
    -    // mid() not available.  No setT constructor
    -    T                  &operator[](int idx) { T *n= reinterpret_cast(elementPointer(idx)); QHULL_ASSERT(idx>=0 && n < reinterpret_cast(endPointer())); return *n; }
    -    const T            &operator[](int idx) const { const T *n= reinterpret_cast(elementPointer(idx)); QHULL_ASSERT(idx>=0 && n < reinterpret_cast(endPointer())); return *n; }
    -    T                  &second() { return operator[](1); }
    -    const T            &second() const { return operator[](1); }
    -    T                   value(int idx) const;
    -    T                   value(int idx, const T &defaultValue) const;
    -
    -#//Read-write -- Not available, no setT constructor
    -
    -#//iterator
    -    iterator            begin() { return iterator(beginPointer()); }
    -    const_iterator      begin() const { return const_iterator(beginPointer()); }
    -    const_iterator      constBegin() const { return const_iterator(beginPointer()); }
    -    const_iterator      constEnd() const { return const_iterator(endPointer()); }
    -    iterator            end() { return iterator(endPointer()); }
    -    const_iterator      end() const { return const_iterator(endPointer()); }
    -
    -#//Search
    -    bool                contains(const T &t) const;
    -    int                 count(const T &t) const;
    -    int                 indexOf(const T &t) const { /* no qh_qh */ return qh_setindex(getSetT(), t.getBaseT()); }
    -    int                 lastIndexOf(const T &t) const;
    -
    -};//class QhullSet
    -
    -// FIXUP? can't use QHULL_DECLARE_SEQUENTIAL_ITERATOR because it is not a template
    -
    -template 
    -class QhullSetIterator {
    -
    -#//Subtypes
    -    typedef typename QhullSet::const_iterator const_iterator;
    -
    -private:
    -#//Fields
    -    const_iterator      i;
    -    const_iterator      begin_i;
    -    const_iterator      end_i;
    -
    -public:
    -#//Constructors
    -                        QhullSetIterator(const QhullSet &s) : i(s.begin()), begin_i(i), end_i(s.end()) {}
    -                        QhullSetIterator(const QhullSetIterator &o) : i(o.i), begin_i(o.begin_i), end_i(o.end_i) {}
    -    QhullSetIterator &operator=(const QhullSetIterator &o) { i= o.i; begin_i= o.begin_i; end_i= o.end_i; return *this; }
    -
    -#//ReadOnly
    -    int                 countRemaining() { return (int)(end_i-begin_i); } // WARN64
    -
    -#//Search
    -    bool                findNext(const T &t);
    -    bool                findPrevious(const T &t);
    -
    -#//Foreach
    -    bool                hasNext() const { return i != end_i; }
    -    bool                hasPrevious() const { return i != begin_i; }
    -    T                   next() { return *i++; }
    -    T                   peekNext() const { return *i; }
    -    T                   peekPrevious() const { const_iterator p = i; return *--p; }
    -    T                   previous() { return *--i; }
    -    void                toBack() { i = end_i; }
    -    void                toFront() { i = begin_i; }
    -};//class QhullSetIterator
    -
    -#//== Definitions =========================================
    -
    -#//Conversion
    -
    -#ifndef QHULL_NO_STL
    -template 
    -std::vector QhullSet::
    -toStdVector() const
    -{
    -    QhullSetIterator i(*this);
    -    std::vector vs;
    -    vs.reserve(i.countRemaining());
    -    while(i.hasNext()){
    -        vs.push_back(i.next());
    -    }
    -    return vs;
    -}//toStdVector
    -#endif
    -
    -#ifdef QHULL_USES_QT
    -template 
    -QList QhullSet::
    -toQList() const
    -{
    -    QhullSetIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        vs.append(i.next());
    -    }
    -    return vs;
    -}//toQList
    -#endif
    -
    -#//Element
    -
    -template 
    -T QhullSet::
    -value(int idx) const
    -{
    -    // Avoid call to qh_setsize() and assert in elementPointer()
    -    const T *n= reinterpret_cast(&SETelem_(getSetT(), idx));
    -    return (idx>=0 && n
    -T QhullSet::
    -value(int idx, const T &defaultValue) const
    -{
    -    // Avoid call to qh_setsize() and assert in elementPointer()
    -    const T *n= reinterpret_cast(&SETelem_(getSetT(), idx));
    -    return (idx>=0 && n
    -bool QhullSet::
    -contains(const T &t) const
    -{
    -    setT *s= getSetT();
    -    void *e= t.getBaseT();  // contains() is not inline for better error reporting
    -    int result= qh_setin(s, e);
    -    return result!=0;
    -}//contains
    -
    -template 
    -int QhullSet::
    -count(const T &t) const
    -{
    -    int c= 0;
    -    const T *i= data();
    -    const T *e= end();
    -    while(i
    -int QhullSet::
    -lastIndexOf(const T &t) const
    -{
    -    const T *b= begin();
    -    const T *i= end();
    -    while(--i>=b){
    -        if(*i==t){
    -            break;
    -        }
    -    }
    -    return (int)(i-b); // WARN64
    -}//lastIndexOf
    -
    -#//QhullSetIterator
    -
    -template 
    -bool QhullSetIterator::
    -findNext(const T &t)
    -{
    -    while(i!=end_i){
    -        if(*(++i)==t){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findNext
    -
    -template 
    -bool QhullSetIterator::
    -findPrevious(const T &t)
    -{
    -    while(i!=begin_i){
    -        if(*(--i)==t){
    -            return true;
    -        }
    -    }
    -    return false;
    -}//findPrevious
    -
    -}//namespace orgQhull
    -
    -
    -#//== Global namespace =========================================
    -
    -template 
    -std::ostream &
    -operator<<(std::ostream &os, const orgQhull::QhullSet &qs)
    -{
    -    const T *i= qs.begin();
    -    const T *e= qs.end();
    -    while(i!=e){
    -        os << *i;
    -        ++i;
    -    }
    -    return os;
    -}//operator<<
    -
    -#endif // QhullSet_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSets.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSets.h
    deleted file mode 100644
    index 0eb9f99830..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullSets.h
    +++ /dev/null
    @@ -1,27 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullSets.h#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLSETS_H
    -#define QHULLSETS_H
    -
    -#include "QhullSet.h"
    -
    -namespace orgQhull {
    -
    -    //See: QhullFacetSet.h
    -    //See: QhullPointSet.h
    -    //See: QhullVertexSet.h
    -
    -    // Avoid circular references between QhullFacet, QhullRidge, and QhullVertex
    -    class QhullRidge;
    -    typedef QhullSet  QhullRidgeSet;
    -    typedef QhullSetIterator  QhullRidgeSetIterator;
    -
    -}//namespace orgQhull
    -
    -#endif // QHULLSETS_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.cpp
    deleted file mode 100644
    index 7ee2a658f8..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.cpp
    +++ /dev/null
    @@ -1,42 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullStat.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullStat -- Qhull's global data structure, statT, as a C++ class
    -
    -
    -#include "QhullError.h"
    -#include "QhullStat.h"
    -
    -#include 
    -#include 
    -
    -using std::cerr;
    -using std::string;
    -using std::vector;
    -using std::ostream;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Constructor, destructor, etc.
    -
    -//! If qh_QHpointer==0, invoke with placement new on qh_stat;
    -QhullStat::
    -QhullStat()
    -{
    -}//QhullStat
    -
    -QhullStat::
    -~QhullStat()
    -{
    -}//~QhullStat
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.h
    deleted file mode 100644
    index 90d522bdf2..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullStat.h
    +++ /dev/null
    @@ -1,52 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullStat.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLSTAT_H
    -#define QHULLSTAT_H
    -
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//defined here
    -    //! QhullStat -- Qhull's statistics, qhstatT, as a C++ class
    -    //! Statistics defined with zzdef_() control Qhull's behavior, summarize its result, and report precision problems.
    -    class QhullStat;
    -
    -class QhullStat : public qhstatT {
    -
    -private:
    -#//Fields (empty) -- POD type equivalent to qhstatT.  No data or virtual members
    -
    -public:
    -#//Constants
    -
    -#//class methods
    -    static void         clearStatistics();
    -
    -#//constructor, assignment, destructor, invariant
    -                        QhullStat();
    -                       ~QhullStat();
    -
    -private:
    -    //!disable copy constructor and assignment
    -                        QhullStat(const QhullStat &);
    -    QhullStat          &operator=(const QhullStat &);
    -public:
    -
    -#//Access
    -};//class QhullStat
    -
    -}//namespace orgQhull
    -
    -#endif // QHULLSTAT_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.cpp
    deleted file mode 100644
    index eea8c8e1d8..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.cpp
    +++ /dev/null
    @@ -1,94 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullVertex.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullVertex -- Qhull's vertex structure, vertexT, as a C++ class
    -
    -#include "UsingLibQhull.h"
    -#include "QhullPoint.h"
    -#include "QhullFacetSet.h"
    -#include "QhullVertex.h"
    -#include "QhullVertexSet.h"
    -#include "QhullFacet.h"
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//class statics
    -vertexT QhullVertex::
    -s_empty_vertex= {0,0,0,0,0,
    -                 0,0,0,0,0,
    -                 0,0};
    -
    -#//ForEach
    -
    -//! Return neighboring facets for a vertex
    -//! If neither merging nor Voronoi diagram, requires Qhull::defineVertexNeighborFacets() beforehand.
    -QhullFacetSet QhullVertex::
    -neighborFacets() const
    -{
    -    if(!neighborFacetsDefined()){
    -        throw QhullError(10034, "Qhull error: neighboring facets of vertex %d not defined.  Please call Qhull::defineVertexNeighborFacets() beforehand.", id());
    -    }
    -    return QhullFacetSet(qh_vertex->neighbors);
    -}//neighborFacets
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using std::string;
    -using std::vector;
    -using orgQhull::QhullPoint;
    -using orgQhull::QhullFacet;
    -using orgQhull::QhullFacetSet;
    -using orgQhull::QhullFacetSetIterator;
    -using orgQhull::QhullVertex;
    -using orgQhull::UsingLibQhull;
    -
    -//! Duplicate of qh_printvertex [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullVertex::PrintVertex &pr)
    -{
    -    QhullVertex v= *pr.vertex;
    -    QhullPoint p= v.point();
    -    os << "- p" << p.id(pr.run_id) << " (v" << v.id() << "): ";
    -    const realT *c= p.coordinates();
    -    for(int k= p.dimension(); k--; ){
    -        os << " " << *c++; // FIXUP QH11010 %5.2g
    -    }
    -    if(v.getVertexT()->deleted){
    -        os << " deleted";
    -    }
    -    if(v.getVertexT()->delridge){
    -        os << " ridgedeleted";
    -    }
    -    os << endl;
    -    if(v.neighborFacetsDefined()){
    -        QhullFacetSetIterator i= v.neighborFacets();
    -        if(i.hasNext()){
    -            os << " neighborFacets:";
    -            int count= 0;
    -            while(i.hasNext()){
    -                if(++count % 100 == 0){
    -                    os << endl << "     ";
    -                }
    -                QhullFacet f= i.next();
    -                os << " f" << f.id();
    -            }
    -            os << endl;
    -        }
    -    }
    -    return os;
    -}//<< PrintVertex
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.h
    deleted file mode 100644
    index 31561966d9..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertex.h
    +++ /dev/null
    @@ -1,103 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullVertex.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHULLVERTEX_H
    -#define QHULLVERTEX_H
    -
    -#include "UsingLibQhull.h"
    -#include "QhullPoint.h"
    -#include "QhullLinkedList.h"
    -#include "QhullSet.h"
    -extern "C" {
    -    #include "libqhull/qhull_a.h"
    -}
    -
    -#include 
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class QhullFacetSet;
    -
    -#//Types
    -    //! QhullVertex -- Qhull's vertex structure, vertexT [libqhull.h], as a C++ class
    -    class QhullVertex;
    -    typedef QhullLinkedList QhullVertexList;
    -    typedef QhullLinkedListIterator QhullVertexListIterator;
    -
    -
    -/*********************
    -  topological information:
    -    next,previous       doubly-linked list of all vertices
    -    neighborFacets           set of adjacent facets (only if qh.VERTEXneighbors)
    -
    -  geometric information:
    -    point               array of DIM coordinates
    -*/
    -
    -class QhullVertex {
    -
    -private:
    -#//Fields
    -    vertexT            *qh_vertex;
    -
    -#//Class objects
    -    static vertexT      s_empty_vertex;  // needed for shallow copy
    -
    -public:
    -#//Constants
    -
    -#//Constructors
    -                        QhullVertex() : qh_vertex(&s_empty_vertex) {}
    -                        // Creates an alias.  Does not copy QhullVertex.  Needed for return by value and parameter passing
    -                        QhullVertex(const QhullVertex &o) : qh_vertex(o.qh_vertex) {}
    -                        // Creates an alias.  Does not copy QhullVertex.  Needed for vector
    -    QhullVertex        &operator=(const QhullVertex &o) { qh_vertex= o.qh_vertex; return *this; }
    -                       ~QhullVertex() {}
    -
    -#//Conversion
    -                        //Implicit conversion from vertexT
    -                        QhullVertex(vertexT *v) : qh_vertex(v ? v : &s_empty_vertex) {}
    -    vertexT            *getVertexT() const { return qh_vertex; }
    -
    -#//QhullSet
    -    vertexT            *getBaseT() const { return getVertexT(); }
    -
    -#//getSet
    -    int                 dimension() const { return (qh_vertex->dim || !isDefined()) ? qh_vertex->dim : UsingLibQhull::globalVertexDimension(); }
    -    int                 id() const { return qh_vertex->id; }
    -    bool                isDefined() const { return qh_vertex != &s_empty_vertex; }
    -                        //! True if defineVertexNeighborFacets() already called.  Auotomatically set for facet merging, Voronoi diagrams
    -    bool                neighborFacetsDefined() const { return qh_vertex->neighbors != 0; }
    -    QhullVertex         next() const { return qh_vertex->next; }
    -    bool                operator==(const QhullVertex &o) const { return qh_vertex==o.qh_vertex; }
    -    bool                operator!=(const QhullVertex &o) const { return !operator==(o); }
    -    QhullPoint          point() const { return QhullPoint(dimension(), qh_vertex->point); }
    -    QhullVertex         previous() const { return qh_vertex->previous; }
    -
    -#//ForEach
    -    //See also QhullVertexList
    -    QhullFacetSet       neighborFacets() const;
    -
    -#//IO
    -    struct PrintVertex{
    -        const QhullVertex *vertex;
    -        int             run_id;
    -                        PrintVertex(int qhRunId, const QhullVertex &v) : vertex(&v), run_id(qhRunId) {}
    -    };//PrintVertex
    -    PrintVertex         print(int qhRunId) const { return PrintVertex(qhRunId, *this); }
    -};//class QhullVertex
    -
    -}//namespace orgQhull
    -
    -#//GLobal
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex::PrintVertex &pr);
    -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex &v) { os << v.print(orgQhull::UsingLibQhull::NOqhRunId); return os; }
    -
    -#endif // QHULLVERTEX_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertexSet.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertexSet.cpp
    deleted file mode 100644
    index bc46d4af68..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/QhullVertexSet.cpp
    +++ /dev/null
    @@ -1,110 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/QhullVertexSet.cpp#5 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! QhullVertexSet -- Qhull's linked Vertexs, as a C++ class
    -
    -#include "QhullVertex.h"
    -#include "QhullVertexSet.h"
    -#include "QhullPoint.h"
    -#include "QhullRidge.h"
    -#include "QhullVertex.h"
    -
    -using std::string;
    -using std::vector;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4611)  /* interaction between '_setjmp' and C++ object destruction is non-portable */
    -                                    /* setjmp should not be implemented with 'catch' */
    -#endif
    -
    -namespace orgQhull {
    -
    -QhullVertexSet::
    -QhullVertexSet(int qhRunId, facetT *facetlist, setT *facetset, bool allfacets)
    -: QhullSet(0)
    -, qhsettemp_qhull(0)
    -, qhsettemp_defined(false)
    -{
    -    UsingLibQhull q(qhRunId);
    -    int exitCode = setjmp(qh errexit);
    -    if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -        setT *vertices= qh_facetvertices(facetlist, facetset, allfacets);
    -        defineAs(vertices);
    -        qhsettemp_qhull= s_qhull_output;
    -        qhsettemp_defined= true;
    -    }
    -    q.maybeThrowQhullMessage(exitCode);
    -}//QhullVertexSet facetlist facetset
    -
    -void QhullVertexSet::
    -freeQhSetTemp()
    -{
    -    if(qhsettemp_defined){
    -        UsingLibQhull q(qhsettemp_qhull, QhullError::NOthrow);
    -        if(q.defined()){
    -            int exitCode = setjmp(qh errexit);
    -            if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -                qh_settempfree(referenceSetT()); // errors if not top of tempstack or if qhmem corrupted
    -            }
    -            q.maybeThrowQhullMessage(exitCode, QhullError::NOthrow);
    -        }
    -    }
    -}//freeQhSetTemp
    -
    -QhullVertexSet::
    -~QhullVertexSet()
    -{
    -    freeQhSetTemp();
    -}//~QhullVertexSet
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -using std::endl;
    -using std::ostream;
    -using orgQhull::QhullPoint;
    -using orgQhull::QhullVertex;
    -using orgQhull::QhullVertexSet;
    -using orgQhull::QhullVertexSetIterator;
    -using orgQhull::UsingLibQhull;
    -
    -//! Print Vertex identifiers to stream.  Space prefix.  From qh_printVertexheader [io.c]
    -ostream &
    -operator<<(ostream &os, const QhullVertexSet::PrintIdentifiers &pr)
    -{
    -    if(pr.print_message && *pr.print_message){
    -        os << pr.print_message;
    -    }
    -    for(QhullVertexSet::const_iterator i=pr.Vertex_set->begin(); i!=pr.Vertex_set->end(); ++i){
    -        const QhullVertex v= *i;
    -        os << " v" << v.id();
    -    }
    -    os << endl;
    -    return os;
    -}//<
    -
    -namespace orgQhull {
    -
    -#//ClassRef
    -    class               QhullVertex;
    -
    -#//Types
    -    //! QhullVertexSet -- a set of Qhull Vertices, as a C++ class.
    -    //! See Qhull
    -    class               QhullVertexSet;
    -    typedef QhullSetIterator
    -                        QhullVertexSetIterator;
    -
    -class QhullVertexSet : public QhullSet {
    -
    -private:
    -#//Fields
    -    Qhull              *qhsettemp_qhull; //! For sets allocated with qh_settemp()
    -    bool                qhsettemp_defined;  //! Set was allocated with q_memalloc()
    -
    -public:
    -#//Constructor
    -                        //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
    -   explicit             QhullVertexSet(setT *s) : QhullSet(s), qhsettemp_qhull(0), qhsettemp_defined(false) {}
    -                        QhullVertexSet(int qhRunId, facetT *facetlist, setT *facetset, bool allfacets);
    -                        //Copy constructor copies pointer but not contents.  Needed for return by value.
    -                        QhullVertexSet(const QhullVertexSet &o) : QhullSet(o), qhsettemp_qhull(o.qhsettemp_qhull), qhsettemp_defined(o.qhsettemp_defined) {}
    -                       ~QhullVertexSet();
    -
    -private:
    -                        //!Disable default constructor and copy assignment.  See QhullSetBase
    -                        QhullVertexSet();
    -    QhullVertexSet      &operator=(const QhullVertexSet &);
    -public:
    -
    -#//Constructor, destructor
    -    void                freeQhSetTemp();
    -
    -#//IO
    -    struct PrintVertexSet{
    -        const QhullVertexSet *Vertex_set;
    -        const char     *print_message;
    -        int             run_id;
    -                        PrintVertexSet(int qhRunId, const char *message, const QhullVertexSet *s) : Vertex_set(s), print_message(message), run_id(qhRunId) {}
    -    };//PrintVertexSet
    -    const PrintVertexSet       print(int qhRunId, const char *message) const { return PrintVertexSet(qhRunId, message, this); }
    -
    -    struct PrintIdentifiers{
    -        const QhullVertexSet *Vertex_set;
    -        const char     *print_message;
    -                        PrintIdentifiers(const char *message, const QhullVertexSet *s) : Vertex_set(s), print_message(message) {}
    -    };//PrintIdentifiers
    -    PrintIdentifiers    printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
    -
    -};//class QhullVertexSet
    -
    -}//namespace orgQhull
    -
    -#//== Global namespace =========================================
    -
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet::PrintVertexSet &pr);
    -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet::PrintIdentifiers &p);
    -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet &vs) { os << vs.print(orgQhull::UsingLibQhull::NOqhRunId, ""); return os; }
    -
    -#endif // QHULLVERTEXSET_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.cpp
    deleted file mode 100644
    index 8d55a5bcb9..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.cpp
    +++ /dev/null
    @@ -1,219 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RboxPoints.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -
    -#include 
    -
    -using std::cerr;
    -using std::endl;
    -using std::istream;
    -using std::ostream;
    -using std::ostringstream;
    -using std::string;
    -using std::vector;
    -using std::ws;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
    -#endif
    -
    -namespace orgQhull {
    -
    -#//! RboxPoints -- generate random PointCoordinates for qhull (rbox)
    -
    -#//Global
    -
    -//! pointer to RboxPoints for qh_fprintf callback
    -RboxPoints *rbox_output= 0;
    -
    -#//Construct
    -RboxPoints::
    -RboxPoints()
    -: PointCoordinates("rbox")
    -, rbox_new_count(0)
    -, rbox_status(qh_ERRnone)
    -, rbox_message()
    -{}
    -
    -RboxPoints::
    -RboxPoints(const char *rboxCommand)
    -: PointCoordinates("rbox")
    -, rbox_new_count(0)
    -, rbox_status(qh_ERRnone)
    -, rbox_message()
    -{
    -    appendPoints(rboxCommand);
    -}
    -
    -RboxPoints::
    -RboxPoints(const RboxPoints &other)
    -: PointCoordinates(other)
    -, rbox_new_count(0)
    -, rbox_status(other.rbox_status)
    -, rbox_message(other.rbox_message)
    -{}
    -
    -RboxPoints & RboxPoints::
    -operator=(const RboxPoints &other)
    -{
    -    PointCoordinates::operator=(other);
    -    rbox_new_count= other.rbox_new_count;
    -    rbox_status= other.rbox_status;
    -    rbox_message= other.rbox_message;
    -    return *this;
    -}//operator=
    -
    -
    -RboxPoints::
    -~RboxPoints()
    -{}
    -
    -#//Error
    -
    -void RboxPoints::
    -clearRboxMessage()
    -{
    -    rbox_status= qh_ERRnone;
    -    rbox_message.clear();
    -}//clearRboxMessage
    -
    -std::string RboxPoints::
    -rboxMessage() const
    -{
    -    if(rbox_status!=qh_ERRnone){
    -        return rbox_message;
    -    }
    -    if(isEmpty()){
    -        return "rbox warning: no points generated\n";
    -    }
    -    return "rbox: OK\n";
    -}//rboxMessage
    -
    -int RboxPoints::
    -rboxStatus() const
    -{
    -    return rbox_status;
    -}
    -
    -bool RboxPoints::
    -hasRboxMessage() const
    -{
    -    return (rbox_status!=qh_ERRnone);
    -}
    -
    -#//Modify
    -
    -void RboxPoints::
    -appendPoints(const char *rboxCommand)
    -{
    -    string s("rbox ");
    -    s += rboxCommand;
    -    char *command= const_cast(s.c_str());
    -    if(rbox_output){
    -        throw QhullError(10001, "Qhull error: Two simultaneous calls to RboxPoints::appendPoints().  Prevent two processes calling appendPoints() at the same time.  Other RboxPoints '%s'", 0, 0, 0, rbox_output->comment().c_str());
    -    }
    -    if(extraCoordinatesCount()!=0){
    -        throw QhullError(10067, "Qhull error: Extra coordinates (%d) prior to calling RboxPoints::appendPoints.  Was %s", extraCoordinatesCount(), 0, 0.0, comment().c_str());
    -    }
    -    int previousCount= count();
    -    rbox_output= this;              // set rbox_output for qh_fprintf()
    -    int status= ::qh_rboxpoints(0, 0, command);
    -    rbox_output= 0;
    -    if(rbox_status==qh_ERRnone){
    -        rbox_status= status;
    -    }
    -    if(rbox_status!=qh_ERRnone){
    -        throw QhullError(rbox_status, rbox_message);
    -    }
    -    if(extraCoordinatesCount()!=0){
    -        throw QhullError(10002, "Qhull error: extra coordinates (%d) for PointCoordinates (%x)", extraCoordinatesCount(), 0, 0.0, coordinates());
    -    }
    -    if(previousCount+newCount()!=count()){
    -        throw QhullError(10068, "Qhull error: rbox specified %d points but got %d points for command '%s'", newCount(), count()-previousCount, 0.0, comment().c_str());
    -    }
    -}//appendPoints
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -/*---------------------------------
    -
    -  qh_fprintf_rbox(fp, msgcode, format, list of args )
    -    fp is ignored (replaces qh_fprintf_rbox() in userprintf_rbox.c)
    -    rbox_output == RboxPoints
    -
    -notes:
    -    only called from qh_rboxpoints()
    -    same as fprintf() and Qhull::qh_fprintf()
    -    fgets() is not trapped like fprintf()
    -    Do not throw errors from here.  Use qh_errexit_rbox;
    -*/
    -extern "C"
    -void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) {
    -    va_list args;
    -
    -    using namespace orgQhull;
    -
    -    RboxPoints *out= rbox_output;
    -    va_start(args, fmt);
    -    if(msgcoderbox_message += newMessage;
    -        if(out->rbox_statusrbox_status>=MSG_STDERR){
    -            out->rbox_status= msgcode;
    -        }
    -        va_end(args);
    -        return;
    -    }
    -    switch(msgcode){
    -    case 9391:
    -    case 9392:
    -        out->rbox_message += "RboxPoints error: options 'h', 'n' not supported.\n";
    -        qh_errexit_rbox(10010);
    -        /* never returns */
    -    case 9393:
    -        {
    -            int dimension= va_arg(args, int);
    -            string command(va_arg(args, char*));
    -            int count= va_arg(args, int);
    -            out->setDimension(dimension);
    -            out->appendComment(" \"");
    -            out->appendComment(command.substr(command.find(' ')+1));
    -            out->appendComment("\"");
    -            out->setNewCount(count);
    -            out->reservePoints();
    -        }
    -        break;
    -    case 9407:
    -        *out << va_arg(args, int);
    -        // fall through
    -    case 9405:
    -        *out << va_arg(args, int);
    -        // fall through
    -    case 9403:
    -        *out << va_arg(args, int);
    -        break;
    -    case 9408:
    -        *out << va_arg(args, double);
    -        // fall through
    -    case 9406:
    -        *out << va_arg(args, double);
    -        // fall through
    -    case 9404:
    -        *out << va_arg(args, double);
    -        break;
    -    }
    -    va_end(args);
    -} /* qh_fprintf_rbox */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.h
    deleted file mode 100644
    index c909e2c180..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RboxPoints.h
    +++ /dev/null
    @@ -1,66 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RboxPoints.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef RBOXPOINTS_H
    -#define RBOXPOINTS_H
    -
    -#include "QhullPoint.h"
    -#include "PointCoordinates.h"
    -extern "C" {
    -#include "libqhull/libqhull.h"
    -}
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! RboxPoints -- generate random PointCoordinates for Qhull
    -    class RboxPoints;
    -
    -    class RboxPoints : public PointCoordinates {
    -
    -private:
    -#//Fields and friends
    -    int                 rbox_new_count;     //! Number of points for PointCoordinates
    -    int                 rbox_status;    //! error status from rboxpoints.  qh_ERRnone if none.
    -    std::string         rbox_message;   //! stderr from rboxpoints
    -
    -    friend void ::qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );
    -
    -public:
    -#//Construct
    -                        RboxPoints();
    -    explicit            RboxPoints(const char *rboxCommand);
    -                        RboxPoints(const RboxPoints &other);
    -                        RboxPoints &operator=(const RboxPoints &other);
    -                       ~RboxPoints();
    -
    -public:
    -#//GetSet
    -    void                clearRboxMessage();
    -    int                 newCount() const { return rbox_new_count; }
    -    std::string         rboxMessage() const;
    -    int                 rboxStatus() const;
    -    bool                hasRboxMessage() const;
    -    void                setNewCount(int pointCount) { QHULL_ASSERT(pointCount>=0); rbox_new_count= pointCount; }
    -
    -#//Modify
    -    void                appendPoints(const char* rboxCommand);
    -    using               PointCoordinates::appendPoints;
    -    void                reservePoints() { reserveCoordinates((count()+newCount())*dimension()); }
    -};//class RboxPoints
    -
    -}//namespace orgQhull
    -
    -#endif // RBOXPOINTS_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.cpp
    deleted file mode 100644
    index c946044cec..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.cpp
    +++ /dev/null
    @@ -1,156 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RoadError.cpp#1 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! RoadError -- All exceptions thrown by Qhull are RoadErrors
    -#//! Do not throw RoadError's from destructors.  Use e.logError() instead.
    -
    -#include "RoadError.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -using std::cerr;
    -using std::cout;
    -using std::string;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Class fields
    -
    -//! Identifies error messages from Qhull and Road for web searches.
    -//! See QhullError.h#QHULLlastError and user.h#MSG_ERROR
    -const char * RoadError::
    -ROADtag= "QH";
    -
    -std::ostringstream RoadError::
    -global_log;
    -
    -#//Constructor
    -
    -RoadError::
    -RoadError()
    -: error_code(0)
    -, log_event()
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(const RoadError &other)
    -: error_code(other.error_code)
    -, log_event(other.log_event)
    -, error_message(other.error_message)
    -{
    -}//copy construct
    -
    -RoadError::
    -RoadError(int code, const std::string &message)
    -: error_code(code)
    -, log_event(message.c_str())
    -, error_message(log_event.toString(ROADtag, error_code))
    -{
    -    log_event.cstr_1= error_message.c_str(); // overwrites initial value
    -}
    -
    -RoadError::
    -RoadError(int code, const char *fmt)
    -: error_code(code)
    -, log_event(fmt)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d)
    -: error_code(code)
    -, log_event(fmt, d)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2)
    -: error_code(code)
    -, log_event(fmt, d, d2)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f)
    -: error_code(code)
    -, log_event(fmt, d, d2, f)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f, const char *s)
    -: error_code(code)
    -, log_event(fmt, d, d2, f, s)
    -, error_message(log_event.toString(ROADtag, code)) // char * may go out of scope
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f, const void *x)
    -: error_code(code)
    -, log_event(fmt, d, d2, f, x)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f, int i)
    -: error_code(code)
    -, log_event(fmt, d, d2, f, i)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f, long long i)
    -: error_code(code)
    -, log_event(fmt, d, d2, f, i)
    -, error_message()
    -{ }
    -
    -RoadError::
    -RoadError(int code, const char *fmt, int d, int d2, float f, double e)
    -: error_code(code)
    -, log_event(fmt, d, d2, f, e)
    -, error_message()
    -{ }
    -
    -RoadError & RoadError::
    -operator=(const RoadError &other)
    -{
    -    error_code= other.error_code;
    -    error_message= other.error_message;
    -    log_event= other.log_event;
    -    return *this;
    -}//operator=
    -
    -#//Virtual
    -const char * RoadError::
    -what() const throw()
    -{
    -    if(error_message.empty()){
    -        error_message= log_event.toString(ROADtag, error_code);
    -    }
    -    return error_message.c_str();
    -}//what
    -
    -#//Updates
    -
    -//! Log error instead of throwing it.
    -void RoadError::
    -logError() const
    -{
    -    global_log << what() << endl;
    -}//logError
    -
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.h
    deleted file mode 100644
    index 41062bb2cc..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadError.h
    +++ /dev/null
    @@ -1,86 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RoadError.h#1 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef ROADERROR_H
    -#define ROADERROR_H
    -
    -#include "RoadLogEvent.h"
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -using std::endl;
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! RoadError -- Report and log errors
    -    //!  See discussion in Saylan, G., "Practical C++ error handling in hybrid environments," Dr. Dobb's Journal, p. 50-55, March 2007.
    -    //!   He uses an auto_ptr to track a stringstream.  It constructs a string on the fly.  RoadError uses the copy constructor to transform RoadLogEvent into a string
    -    class RoadError;
    -
    -class RoadError : public std::exception {
    -
    -private:
    -#//Fields
    -    int                 error_code;  //! Non-zero code (not logged), maybe returned as program status
    -    RoadLogEvent        log_event;   //! Format string w/ arguments
    -    mutable std::string error_message;  //! Formated error message.  Must be after log_event.
    -
    -#//Class fields
    -    static const char  *  ROADtag;
    -    static std::ostringstream  global_log; //! May be replaced with any ostream object
    -
    -public:
    -#//Constants
    -
    -#//Constructors
    -    RoadError();
    -    RoadError(const RoadError &other);  //! Called on throw, generates error_message
    -    RoadError(int code, const std::string &message);
    -    RoadError(int code, const char *fmt);
    -    RoadError(int code, const char *fmt, int d);
    -    RoadError(int code, const char *fmt, int d, int d2);
    -    RoadError(int code, const char *fmt, int d, int d2, float f);
    -    RoadError(int code, const char *fmt, int d, int d2, float f, const char *s);
    -    RoadError(int code, const char *fmt, int d, int d2, float f, const void *x);
    -    RoadError(int code, const char *fmt, int d, int d2, float f, int i);
    -    RoadError(int code, const char *fmt, int d, int d2, float f, long long i);
    -    RoadError(int code, const char *fmt, int d, int d2, float f, double e);
    -
    -    RoadError          &operator=(const RoadError &other);
    -                       ~RoadError() throw() {};
    -
    -#//Class methods
    -
    -    static void         clearGlobalLog() { global_log.seekp(0); }
    -    static bool         emptyGlobalLog() { return global_log.tellp()<=0; }
    -    static const char  *stringGlobalLog() { return global_log.str().c_str(); }
    -
    -#//Virtual
    -    virtual const char *what() const throw();
    -
    -#//GetSet
    -    bool                isDefined() const { return log_event.isDefined(); }
    -    int                 errorCode() const { return error_code; };
    -   // FIXUP QH11021 should RoadError provide errorMessage().  Currently what()
    -    RoadLogEvent        roadLogEvent() const { return log_event; };
    -
    -#//Update
    -    void                logError() const;
    -};//class RoadError
    -
    -}//namespace orgQhull
    -
    -#//Global functions
    -
    -inline std::ostream    &operator<<(std::ostream &os, const orgQhull::RoadError &e) { return os << e.what(); }
    -
    -#endif // ROADERROR_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.cpp
    deleted file mode 100644
    index 0cce045458..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.cpp
    +++ /dev/null
    @@ -1,122 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RoadLogEvent.cpp#1 $$Change: 1490 $
    -** $Date: 2012/02/19 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! RoadError -- All exceptions thrown by Qhull are RoadErrors
    -
    -#include "RoadError.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::string;
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//!\name Conversion
    -string RoadLogEvent::
    -toString(const char *tag, int code) const
    -{
    -    ostringstream os;
    -    if(tag && code){
    -        os << tag << code;
    -        if(format_string){
    -            os << " ";
    -        }
    -    }
    -    if(!format_string){
    -        return os.str();
    -    }
    -    const char *s= format_string;
    -    int dCount= 0;  // Count of %d
    -    int fCount= 0;  // Count of %f
    -    char extraCode= '\0';
    -    while(*s){
    -        if(*s!='%'){
    -            os << *s++;
    -        }else{
    -            char c= *++s;
    -            s++;
    -            switch(c){
    -            case 'd':
    -                if(++dCount>2){
    -                    os << " ERROR_three_%d_in_format ";
    -                }else if(dCount==2){
    -                    os << int_2;
    -                }else{
    -                    os << int_1;
    -                }
    -                break;
    -            case 'e':
    -                if(firstExtraCode(os, c, &extraCode)){
    -                    os << double_1;
    -                }
    -                break;
    -            case 'f':
    -                if(++fCount>1){
    -                    os << " ERROR_two_%f_in_format ";
    -                }else{
    -                    os << float_1;
    -                }
    -                break;
    -            case 'i':
    -                if(firstExtraCode(os, c, &extraCode)){
    -                    os << int64_1;
    -                }
    -                break;
    -            case 's':
    -                if(firstExtraCode(os, c, &extraCode)){
    -                    os << cstr_1;
    -                }
    -                break;
    -            case 'u':
    -                if(firstExtraCode(os, c, &extraCode)){
    -                    os << "0x" << std::hex << int64_1 << std::dec;
    -                }
    -                break;
    -            case 'x':
    -                if(firstExtraCode(os, c, &extraCode)){
    -                    os << void_1;
    -                }
    -                break;
    -            case '%':
    -                os << c;
    -                break;
    -            default:
    -                os << " ERROR_%" << c << "_not_defined_in_format";
    -                break;
    -            }
    -        }
    -    }
    -    if(s[-1]!='\n'){
    -        os << endl;
    -    }
    -    return os.str();
    -}//toString
    -
    -#//Class helpers (static)
    -
    -//! True if this char is the first extra code
    -bool RoadLogEvent::
    -firstExtraCode(std::ostream &os, char c, char *extraCode){
    -    if(*extraCode){
    -        os << " ERROR_%" << *extraCode << "_and_%" << c << "_in_format ";
    -        return false;
    -    }
    -    *extraCode= c;
    -    return true;
    -}//firstExtraCode
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.h
    deleted file mode 100644
    index bdab15ead5..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/RoadLogEvent.h
    +++ /dev/null
    @@ -1,77 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/RoadLogEvent.h#1 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef ROADLOGEVENT_H
    -#define ROADLOGEVENT_H
    -
    -#include 
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! RoadLogEvent -- Record an event for the RoadLog
    -    struct RoadLogEvent;
    -
    -struct RoadLogEvent {
    -
    -public:
    -#//Fields
    -    const char     *format_string; //! Format string (a literal with format codes, for logging)
    -    int             int_1;       //! Integer argument (%d, for logging)
    -    int             int_2;       //! Integer argument (%d, for logging)
    -    float           float_1;     //! Float argument (%f, for logging)
    -    union {                      //! One additional argument (for logging)
    -        const char *cstr_1;      //!   Cstr argument (%s) -- type checked at construct-time
    -        const void *void_1;      //!   Void* argument (%x) -- Use upper-case codes for object types
    -        long long   int64_1;     //!   signed int64 (%i).  Ambiguous if unsigned is also defined.
    -        double      double_1;    //!   Double argument (%e)
    -    };
    -
    -#//Constants
    -
    -#//Constructors
    -    RoadLogEvent() : format_string(0), int_1(0), int_2(0), float_1(0), int64_1(0) {};
    -    explicit RoadLogEvent(const char *fmt) : format_string(fmt), int_1(0), int_2(0), float_1(0), int64_1(0) {};
    -    RoadLogEvent(const char *fmt, int d) : format_string(fmt), int_1(d), int_2(0), float_1(0), int64_1(0) {};
    -    RoadLogEvent(const char *fmt, int d, int d2) : format_string(fmt), int_1(d), int_2(d2), float_1(0), int64_1(0) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f) : format_string(fmt), int_1(d), int_2(d2), float_1(f), int64_1(0) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f, const char *s) : format_string(fmt), int_1(d), int_2(d2), float_1(f), cstr_1(s) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f, const void *x) : format_string(fmt), int_1(d), int_2(d2), float_1(f), void_1(x) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f, int i) : format_string(fmt), int_1(d), int_2(d2), float_1(f), int64_1(i) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f, long long i) : format_string(fmt), int_1(d), int_2(d2), float_1(f), int64_1(i) {};
    -    RoadLogEvent(const char *fmt, int d, int d2, float f, double g) : format_string(fmt), int_1(d), int_2(d2), float_1(f), double_1(g) {};
    -    ~RoadLogEvent() {};
    -    //! Default copy constructor and assignment
    -
    -#//GetSet
    -    bool                isDefined() const { return format_string!=0; }
    -    int                 int1() const { return int_1; };
    -    int                 int2() const { return int_2; };
    -    float               float1() const { return float_1; };
    -    const char         *format() const { return format_string; };
    -    const char         *cstr1() const { return cstr_1; };
    -    const void         *void1() const { return void_1; };
    -    long long           int64() const { return int64_1; };
    -    double              double1() const { return double_1; };
    -
    -#//Conversion
    -
    -    std::string        toString(const char* tag, int code) const;
    -
    -private:
    -#//Class helpers
    -    static bool         firstExtraCode(std::ostream &os, char c, char *extraCode);
    -
    -
    -};//class RoadLogEvent
    -
    -}//namespace orgQhull
    -
    -#endif // ROADLOGEVENT_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.cpp
    deleted file mode 100644
    index 791f842fdf..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.cpp
    +++ /dev/null
    @@ -1,373 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/UsingLibQhull.cpp#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#//! UsingLibQhull -- Set up qhull C code from C++
    -
    -#include "Qhull.h"
    -#include "UsingLibQhull.h"
    -#include "QhullError.h"
    -#include "QhullQh.h"
    -
    -#ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
    -#endif
    -
    -namespace orgQhull {
    -
    -#//Class objects
    -
    -const double UsingLibQhull::
    -DEFAULTdistanceEpsilon= 1e-15*FACTORepsilon; //! ~DISTround*FACTORepsilon for unit cube
    -
    -const double UsingLibQhull::
    -DEFAULTangleEpsilon= 1e-15*FACTORepsilon; //! ~ANGLEround*FACTORepsilon for unit cube
    -
    -    //! Global pointer to Qhull for qh_fprintf callback and QhullError
    -Qhull *
    -s_qhull_output= 0;
    -
    -double UsingLibQhull::
    -s_angle_epsilon= 0;
    -
    -double UsingLibQhull::
    -s_distance_epsilon= 0;
    -
    -//! For QhullPoint.id() w/o qhRunId.  Initialized by Qhull
    -const coordT *UsingLibQhull::
    -s_points_begin= 0;
    -const coordT *UsingLibQhull::
    -s_points_end= 0;
    -int UsingLibQhull::
    -s_points_dimension= 0;
    -
    -int UsingLibQhull::
    -s_vertex_dimension= 0;  // FIXUP QH11023: s_vertex_dimension is required if dimension>15.  Cannot store in QhullVertex
    -
    -bool UsingLibQhull::
    -s_has_points= false;
    -
    -bool UsingLibQhull::
    -s_has_angle_epsilon= false;
    -
    -bool UsingLibQhull::
    -s_has_vertex_dimension= false;
    -
    -bool UsingLibQhull::
    -s_has_distance_epsilon= false;
    -
    -bool UsingLibQhull::
    -s_using_libqhull= false;
    -
    -#//Constructors
    -
    -//! Grabs global state (qh_qh, qh_qhstat, qhmem.tempstack)
    -//! Follow immediately with setjmp(qh errexit), otherwise errors in libqhull are not caught properly
    -//! See qh_restore_qhull [global.c]
    -UsingLibQhull::
    -UsingLibQhull(Qhull *q)
    -: my_qhull(q)
    -, qh_exitcode(0)
    -{
    -    checkUsingLibQhull();
    -    QhullQh *qhullqh= q->qhullQh();
    -    if(!qhullqh){
    -        throw QhullError(10014, "Qhull internal error: Qhull.qhullQh() not defined. initializeQhull() not called.");
    -    }
    -    if(qhullqh->run_id != q->qhull_run_id){
    -        throw QhullError(10015, "Qhull error: QhullQh.runId %d != Qhull.runId %d.  Overwritten?", qhullqh->run_id, q->qhull_run_id);
    -    }
    -    // qh.old_qhstat is zero at initialization
    -    // qh.old_tempstack is zero when empty
    -    // QhullQh() and UsingLibQhull() are the same
    -#if qh_QHpointer
    -    if(qh_qh){
    -        qh old_qhstat= qh_qhstat;
    -        qh old_tempstack= qhmem.tempstack;
    -    }
    -    qh_qh= qhullqh;
    -    qh_qhstat= qhullqh->old_qhstat;
    -    qhmem.tempstack= qhullqh->old_tempstack;
    -    qhullqh->old_qhstat= 0;
    -    qhullqh->old_tempstack= 0;
    -#else
    -    #error FIXUP QH11024 static qh_qh not tested.  Delete the line to try.
    -    if(qhullqh!=&qh_qh){
    -        throw QhullError(10040, "Qhull internal error: Qhull.qhullQh() is not qh_qh (%x, static).  Overwrite?", 0,0,0.0, &qh_qh);
    -    }
    -#endif
    -    s_qhull_output= q;      // set s_qhull_output for qh_fprintf()
    -    qh NOerrexit= False;   // assumes setjmp called next
    -}//UsingLibQhull qhull
    -
    -//! Same as UsingLibQhull but does not throw exceptions
    -//! !defined() on failure.  For use in destructors
    -UsingLibQhull::
    -UsingLibQhull(Qhull *q, int noThrow)
    -: my_qhull(0)  // Fail by default
    -, qh_exitcode(0)
    -{
    -    QHULL_UNUSED(noThrow);
    -
    -    QhullQh *qhullqh= q->qhullQh();
    -    if(s_using_libqhull){
    -        QhullError e(10050, "Qhull error: UsingLibQhull already in use");
    -        e.logError();
    -    }else if(!qhullqh || qhullqh->run_id != q->qhull_run_id){
    -        QhullError e(10051, "Qhull error: Qhull.qhullQh (%x) undefined or QhullQh.runId %d != Qhull.runId %d.  Overwritten?", (qhullqh ? qhullqh->run_id : -1), q->qhull_run_id, 0.0, qhullqh);
    -        e.logError();
    -    }else{
    -        // qh.old_qhstat is zero at initialization
    -        // qh.old_tempstack is zero when empty
    -        // QhullQh() and UsingLibQhull() are the same
    -#if qh_QHpointer
    -        if(qh_qh){
    -            qh old_qhstat= qh_qhstat;
    -            qh old_tempstack= qhmem.tempstack;
    -        }
    -        qh_qh= qhullqh;
    -        qh_qhstat= qhullqh->old_qhstat;
    -        qhmem.tempstack= qhullqh->old_tempstack;
    -        qhullqh->old_qhstat= 0;
    -        qhullqh->old_tempstack= 0;
    -#endif
    -        my_qhull= q;
    -        s_qhull_output= q;          // set s_qhull_output for qh_fprintf()
    -        qh NOerrexit= False;   // assumes setjmp called next
    -    }
    -}//UsingLibQhull qhull noThrow
    -
    -//! Reuses current global state (qh_qh) from prior UsingQhull
    -//! Errors if runId is not the same
    -UsingLibQhull::
    -UsingLibQhull(int qhRunId)
    -: my_qhull(0)
    -, qh_exitcode(0)
    -{
    -    checkUsingLibQhull();
    -#if qh_QHpointer
    -    if(!qh_qh || !qh_qhstat){
    -        throw QhullError(10024, "Qhull error: UsingLibQhull is not active (qh_qh %x or qh_qhstat is not defined)", 0,0,0.0, qh_qh);
    -    }
    -#endif
    -    if(qh run_id!=qhRunId){
    -        throw QhullError(10036, "Qhull error: qhRunId %d != qh_qh.runId %d.  Is another Qhull active?", qhRunId, qh run_id);
    -    }
    -    if(!s_qhull_output){
    -        throw QhullError(10037, "Qhull error: UsingLibQhull not active(s_qhull_output undefined).  Invoke UsingLibQhull before this call");
    -    }
    -    if(s_qhull_output->qhull_run_id!=qhRunId){
    -        throw QhullError(10046, "Qhull error: qhRunId %d != s_qhull_output.runId %d.  Is another Qhull active", qhRunId, s_qhull_output->qhull_run_id);
    -    }
    -    my_qhull= s_qhull_output;
    -    qh NOerrexit= False;   // assumes setjmp called next
    -}//UsingLibQhull runId
    -
    -//Leaves libqhull active for runId access
    -UsingLibQhull::
    -~UsingLibQhull()
    -{
    -    QhullError e= checkRunId();
    -    if(e.isDefined()){
    -        e.logError();
    -    }else{
    -#if qh_QHpointer
    -        if(qh_qh){
    -            qh NOerrexit= true;
    -        }
    -#else
    -        qh NOerrexit= true;
    -#endif
    -    }
    -    s_using_libqhull= false;
    -}//~UsingLibQhull
    -
    -#//Class methods
    -
    -void UsingLibQhull::
    -checkQhullMemoryEmpty()
    -{
    -    int curlong, totlong, curshort, totshort, maxlong, totbuffer;
    -    // qh_memtotal does not error
    -    qh_memtotal(&curlong, &totlong, &curshort, &totshort, &maxlong, &totbuffer);
    -    if (curlong || totlong){
    -        throw QhullError(10026, "Qhull error: qhull did not free %d bytes of long memory (%d pieces).", totlong, curlong);
    -    }
    -    if (curshort || totshort){
    -        throw QhullError(10035, "Qhull error: qhull did not free %d bytes of short memory (%d pieces).", totshort, curshort);
    -    }
    -}//checkQhullMemoryEmpty
    -
    -double UsingLibQhull::
    -currentAngleEpsilon()
    -{
    -    if(s_qhull_output && s_qhull_output->initialized()){
    -        return s_qhull_output->qhullQh()->ANGLEround*FACTORepsilon;
    -    }else if(s_has_angle_epsilon){
    -        return s_angle_epsilon;
    -    }
    -    return UsingLibQhull::DEFAULTangleEpsilon;
    -}//currentAngleEpsilon
    -
    -double UsingLibQhull::
    -currentDistanceEpsilon()
    -{
    -    if(s_qhull_output && s_qhull_output->initialized()){
    -        return s_qhull_output->qhullQh()->DISTround*FACTORepsilon;
    -    }else if(s_has_distance_epsilon){
    -        return s_distance_epsilon;
    -    }
    -    return UsingLibQhull::DEFAULTdistanceEpsilon;
    -}//currentDistanceEpsilon
    -
    -const coordT *UsingLibQhull::
    -currentPoints(int *dimension, const coordT **pointsEnd)
    -{
    -    if(s_qhull_output && s_qhull_output->initialized()){
    -        *dimension= qh hull_dim;
    -        *pointsEnd= qh first_point+qh num_points*qh hull_dim;
    -        return qh first_point;
    -    }else if(s_has_points){
    -        *dimension= s_points_dimension;
    -        *pointsEnd= s_points_end;
    -        return s_points_begin;
    -    }
    -    throw QhullError(10059, "Qhull error: missing definition for currentPoints().  Need currentQhull() or setGlobalDistanceEpsilon()");
    -}//currentPoints
    -
    -Qhull &UsingLibQhull::
    -currentQhull()
    -{
    -    if(!s_qhull_output){
    -        throw QhullError(10055, "Qhull error: currentQhull not defined.  Run qhull first.");
    -    }
    -    return *s_qhull_output;
    -}//currentQhull
    -
    -// for QhullVertex::dimension() when >= 16
    -int UsingLibQhull::
    -currentVertexDimension()
    -{
    -    if(s_qhull_output && s_qhull_output->initialized()){
    -        return s_qhull_output->dimension();
    -    }else if(s_has_vertex_dimension){
    -        return s_vertex_dimension;
    -    }
    -    throw QhullError(10057, "Qhull error: missing definition for currentVertexDimension().  Need currentQhull() or setGlobalVertexDimension()");
    -}//currentVertexDimension
    -
    -const coordT *UsingLibQhull::
    -globalPoints(int *dimension, const coordT **pointsEnd)
    -{
    -    if(s_has_points){
    -        *dimension= s_points_dimension;
    -        *pointsEnd= s_points_end;
    -        return s_points_begin;
    -    }else{
    -        return currentPoints(dimension, pointsEnd);
    -    }
    -}//globalPoints
    -
    -bool UsingLibQhull::
    -hasPoints()
    -{
    -    return s_has_points || (s_qhull_output && s_qhull_output->initialized());
    -}
    -
    -bool UsingLibQhull::
    -hasVertexDimension()
    -{
    -    return s_has_vertex_dimension || (s_qhull_output && s_qhull_output->initialized());
    -}
    -
    -void UsingLibQhull::
    -setGlobals()
    -{
    -    if(s_qhull_output && s_qhull_output->initialized()){
    -        QhullQh *qqh= s_qhull_output->qhullQh();
    -        s_angle_epsilon= qqh->ANGLEround*FACTORepsilon;
    -        s_distance_epsilon= qqh->DISTround*FACTORepsilon;
    -        s_points_begin= qqh->first_point;
    -        s_points_dimension= qqh->hull_dim;
    -        s_points_end= s_points_begin+qqh->num_points*s_points_dimension;
    -        s_vertex_dimension= qqh->hull_dim;
    -        s_has_angle_epsilon= true;
    -        s_has_distance_epsilon= true;
    -        s_has_points= true;
    -        s_has_vertex_dimension= true;
    -    }else{
    -        throw QhullError(10058, "Qhull error: setGlobals can only be called for currentQhull().  Run qhull first.");
    -    }
    - }//setGlobals
    -
    -void UsingLibQhull::
    -unsetGlobals()
    -{
    -    s_has_angle_epsilon= false;
    -    s_has_distance_epsilon= false;
    -    s_has_points= false;
    -    s_has_vertex_dimension= false;
    -}//unsetGlobals
    -
    -#// Methods
    -
    -void UsingLibQhull::
    -maybeThrowQhullMessage(int exitCode) const
    -{
    -    my_qhull->maybeThrowQhullMessage(exitCode);
    -    QhullError e= checkRunId(); // Check for qhRunId after libqhull returns. For convenience, ought to be at end of libqhull try block
    -    if(e.isDefined()){
    -        throw e;
    -    }
    -}//maybeThrowQhullMessage
    -
    -void UsingLibQhull::
    -maybeThrowQhullMessage(int exitCode, int noThrow) const
    -{
    -    my_qhull->maybeThrowQhullMessage(exitCode, noThrow);
    -    QhullError e= checkRunId(); // Check for qhRunId after libqhull returns. For convenience, ought to be at end of libqhull try block
    -    if(e.isDefined()){
    -        e.logError();
    -    }
    -}//maybeThrowQhullMessage
    -
    -#//Helpers
    -
    -//! Return QhullError for maybeThrowFromDestructor()
    -QhullError UsingLibQhull::
    -checkRunId() const
    -{
    -    // Predeclaring QhullError results in four copy constructors, none used here
    -#if qh_QHpointer
    -    if(qh_qh){ // 0 if ~Qhull
    -        if(my_qhull->qhull_run_id!=qh run_id){
    -            return QhullError(10047, "Qhull internal error: Global state (qh_qh, run_id %d) changed.  Should be runId %d.  Another thread?", qh run_id, my_qhull->qhull_run_id);
    -        }
    -    }
    -#else
    -    if(qh run_id!=0 && my_qhull->qhull_run_id!=qh run_id){
    -        return QhullError(10048, "Qhull internal error: Global state (qh_qh, run_id %d) changed.  Should be runId %d.  Another thread?", qh run_id, my_qhull->qhull_run_id);
    -    }
    -#endif
    -    return QhullError();
    -}//checkRunId
    -
    -//! Can not embed UsingLibQhull.  Otherwise allocated a C++ object missed by qh_errexit
    -void UsingLibQhull::
    -checkUsingLibQhull() const
    -{
    -    if(s_using_libqhull){
    -        if(s_qhull_output){
    -            throw QhullError(10049, "Qhull error: UsingLibQhull already in use by QhullQh.runId %d", s_qhull_output->qhull_run_id);
    -        }else{
    -            throw QhullError(10050, "Qhull error: UsingLibQhull already in use.  No s_qhull_output");
    -        }
    -    }
    -    s_using_libqhull= true;
    -}//checkUsingLibQhull
    -
    -}//namespace orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.h
    deleted file mode 100644
    index 92273a2206..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/UsingLibQhull.h
    +++ /dev/null
    @@ -1,144 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/UsingLibQhull.h#6 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef USINGlibqhull_H
    -#define USINGlibqhull_H
    -
    -#include "QhullError.h"
    -extern "C" {
    -#include "libqhull/libqhull.h"
    -}
    -
    -namespace orgQhull {
    -
    -#//Types
    -    //! UsingLibQhull -- Interface into libqhull and its 'qh' and 'qhstat' macros
    -    //! Always use with setjmp() for libqhull error handling.
    -
    -/*******************************
    -
    -UsingLibQhull is stack based, but as a call
    -Qhull declarations are stack-based.  But can't define a
    -setjmp environment, since the target goes away.  So must be UsingLibQhull, but can only have one
    -setjmp at a time? Can embedded another Using as long as save/restore
    -longjmp on exit.
    -*/
    -    class UsingLibQhull;
    -
    -    // Defined elsewhere
    -    class Qhull;
    -
    -#// Global variables
    -extern Qhull           *s_qhull_output; //! Provide qh_fprintf (Qhull.cpp) access to Qhull
    -
    -class UsingLibQhull {
    -
    -private:
    -#//Fields
    -    Qhull              *my_qhull;
    -    int                 qh_exitcode;
    -
    -#//Class globals
    -    //! Global flags
    -    static bool         s_using_libqhull; //! True if UsingLibQhull is in scope
    -
    -    //! Use global values if s_has_... is set
    -    static bool         s_has_angle_epsilon; //! True if s_angle_epsilon defined
    -    static bool         s_has_distance_epsilon; //! True if s_distance_epsilon defined
    -    static bool         s_has_points;        //! If False (default), Qhull() runs setPointBase()
    -    static bool         s_has_vertex_dimension; //! True if s_vertex_dimension defined
    -
    -    //! Global values
    -    static double       s_angle_epsilon;   //! Epsilon for angle equality
    -    static double       s_distance_epsilon;   //! Epsilon for distance equality
    -    static const coordT *s_points_begin;            //! For QhullPoint::id() w/o qhRunId.
    -    static const coordT *s_points_end;            //! For QhullPoint::id() w/o qhRunId.
    -    static int          s_points_dimension;
    -    static int          s_vertex_dimension; //! Default dimension (e.g., if Vertex::dimension() >= 16)
    -
    -public:
    -#//Class constants
    -    static const int    NOqhRunId= 0;   //! qh_qh is not available
    -    static const int    NOthrow= 1;     //! Do not throw from maybeThrowQhullMessage
    -    static const int    FACTORepsilon= 10;  //!
    -    static const double DEFAULTdistanceEpsilon; //! ~DISTround*FACTORepsilon for unit cube
    -    static const double DEFAULTangleEpsilon;    //! ~ANGLEround*FACTORepsilon for unit cube
    -
    -#//Class members
    -    static void         checkQhullMemoryEmpty();
    -    static double       currentAngleEpsilon();
    -    static double       currentDistanceEpsilon();
    -    static const coordT *currentPoints(int *dimension, const coordT **pointsEnd);
    -    static Qhull       ¤tQhull();
    -    static int          currentVertexDimension();
    -    static double       globalAngleEpsilon() { return s_has_angle_epsilon ? s_angle_epsilon : currentAngleEpsilon(); }
    -    static double       globalDistanceEpsilon() { return s_has_distance_epsilon ? s_distance_epsilon : currentDistanceEpsilon(); }
    -    static double       globalMachineEpsilon() { return REALepsilon; }
    -    static const coordT *globalPoints(int *dimension, const coordT **pointsEnd);
    -    static int          globalVertexDimension() { return s_has_vertex_dimension ? s_vertex_dimension : currentVertexDimension(); }
    -    static bool         hasPoints();        // inline would require Qhull.h
    -    static bool         hasVertexDimension();
    -    static void         setGlobalAngleEpsilon(double d) { s_angle_epsilon=d; s_has_angle_epsilon= true; }
    -    static void         setGlobalDistanceEpsilon(double d) { s_distance_epsilon= d; s_has_distance_epsilon= true; }
    -    static void         setGlobalPoints(int dimension, const coordT *pointsBegin, const coordT *pointsEnd) { s_points_dimension= dimension; s_points_begin= pointsBegin; s_points_end= pointsEnd; s_has_points= true; }
    -    static void         setGlobalVertexDimension(int i) { s_vertex_dimension= i; s_has_vertex_dimension= true; }
    -    static void         setGlobals();
    -    static void         unsetGlobalAngleEpsilon() { s_has_angle_epsilon= false; }
    -    static void         unsetGlobalDistanceEpsilon() { s_has_distance_epsilon= false; }
    -    static void         unsetGlobalPoints() { s_has_points= false; }
    -    static void         unsetGlobalVertexDimension() { s_has_vertex_dimension= false; }
    -    static void         unsetGlobals();
    -
    -#//Constructors
    -                        UsingLibQhull(Qhull *p);
    -                        UsingLibQhull(Qhull *p, int noThrow);
    -                        UsingLibQhull(int qhRunId);
    -                       ~UsingLibQhull();
    -
    -private:                //! disable default constructor, copy constructor, and copy assignment
    -                        UsingLibQhull();
    -                        UsingLibQhull(const UsingLibQhull &);
    -   UsingLibQhull       &operator=(const UsingLibQhull &);
    -public:
    -
    -#//Methods
    -#//Access
    -    bool                defined() const { return my_qhull!=0; }
    -    void                maybeThrowQhullMessage(int exitCode) const;
    -    void                maybeThrowQhullMessage(int exitCode, int noThrow) const;
    -
    -#//Helpers
    -private:
    -   QhullError           checkRunId() const;
    -   void                 checkUsingLibQhull() const;
    -
    -/***********************************
    -You may use global variables in 'qh' after declaring UsingLibQhull.  For example
    -
    -  UsingLibQhull q(qhRunId);
    -  // NOerrors -- no calls that throw libqhull errors
    -  cout << "Delaunay Mode: " << qh DELAUNAY;
    -
    -To trap errors from libqhull, UsingLibQhull must be followed by
    -
    -UsingLibQhull q(qhRunId);
    -int exitCode = setjmp(qh errexit);
    -if(!exitCode){ // no object creation -- destructors skipped on longjmp()
    -    calls to libqhull
    -}
    -q.maybeThrowQhullMessage(exitCode);
    -
    -The call to setjmp() can not be moved to a method.  The stack must be preserved for error exits from libqhull.
    -
    -*/
    -
    -};//UsingLibQhull
    -
    -}//namespace orgQhull
    -
    -#endif // USINGlibqhull_H
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/functionObjects.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/functionObjects.h
    deleted file mode 100644
    index 250b0e96c5..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/functionObjects.h
    +++ /dev/null
    @@ -1,66 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/functionObjects.h#4 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef QHFUNCTIONOBJECTS_H
    -#define QHFUNCTIONOBJECTS_H
    -
    -#include 
    -#include 
    -
    -namespace orgQhull {
    -#//Type
    -
    -    //! Sum of absolute values of the elements in a container
    -    class AbsoluteSumOf;
    -    //! Sum of the elements in a container
    -    class SumOf;
    -    //! Sum of squares of the elements in a container
    -    class SumSquaresOf;
    -
    -#//Class
    -
    -//! Absolute sum of the elements in a container
    -class AbsoluteSumOf
    -{
    -private:
    -    double sum;
    -public:
    -    inline AbsoluteSumOf() : sum(0.0) {}
    -    inline void operator()(double v) { sum += fabs(v); }
    -    inline operator double() { return sum; }
    -};//AbsoluteSumOf
    -
    -//! Sum of the elements in a container
    -class SumOf
    -{
    -private:
    -    double sum;
    -public:
    -    inline SumOf() : sum(0.0) {}
    -    inline void operator()(double v) { sum += v; }
    -    inline operator double() { return sum; }
    -};//SumOf
    -
    -
    -//! Sum of squares of the elements in a container
    -class SumSquaresOf
    -{
    -private:
    -    double sum;
    -public:
    -    inline SumSquaresOf() : sum(0.0) {}
    -    inline void operator()(double v) { sum += v*v; }
    -    inline operator double() { return sum; }
    -};//SumSquaresOf
    -
    -
    -}//orgQhull
    -
    -
    -#endif //QHFUNCTIONOBJECTS_H
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/libqhullcpp.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/libqhullcpp.pro
    deleted file mode 100644
    index f91d1cc7c7..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/libqhullcpp.pro
    +++ /dev/null
    @@ -1,71 +0,0 @@
    -# -------------------------------------------------
    -# libqhullcpp.pro -- Qt project for Qhull cpp shared library
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -
    -DESTDIR = ../../lib
    -TEMPLATE = lib
    -CONFIG += staticlib warn_on
    -CONFIG -= qt rtti
    -build_pass:CONFIG(debug, debug|release):{
    -   TARGET = qhullcpp_d
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release):{
    -   TARGET = qhullcpp
    -   OBJECTS_DIR = Release
    -}
    -MOC_DIR = moc
    -
    -DEFINES += qh_QHpointer # libqhull/user.h
    -
    -INCLUDEPATH += ../../src
    -INCLUDEPATH += $$PWD # for MOC_DIR
    -
    -CONFIG += qhull_warn_shadow qhull_warn_conversion
    -
    -SOURCES += Coordinates.cpp
    -SOURCES += PointCoordinates.cpp
    -SOURCES += Qhull.cpp
    -SOURCES += QhullFacet.cpp
    -SOURCES += QhullFacetList.cpp
    -SOURCES += QhullFacetSet.cpp
    -SOURCES += QhullHyperplane.cpp
    -SOURCES += QhullPoint.cpp
    -SOURCES += QhullPoints.cpp
    -SOURCES += QhullPointSet.cpp
    -SOURCES += QhullQh.cpp
    -SOURCES += QhullRidge.cpp
    -SOURCES += QhullSet.cpp
    -SOURCES += QhullStat.cpp
    -SOURCES += QhullVertex.cpp
    -SOURCES += QhullVertexSet.cpp
    -SOURCES += RboxPoints.cpp
    -SOURCES += RoadError.cpp
    -SOURCES += RoadLogEvent.cpp
    -SOURCES += UsingLibQhull.cpp
    -
    -HEADERS += Coordinates.h
    -HEADERS += functionObjects.h
    -HEADERS += PointCoordinates.h
    -HEADERS += Qhull.h
    -HEADERS += QhullError.h
    -HEADERS += QhullFacet.h
    -HEADERS += QhullFacetList.h
    -HEADERS += QhullFacetSet.h
    -HEADERS += QhullHyperplane.h
    -HEADERS += QhullIterator.h
    -HEADERS += QhullLinkedList.h
    -HEADERS += QhullPoint.h
    -HEADERS += QhullPoints.h
    -HEADERS += QhullPointSet.h
    -HEADERS += QhullQh.h
    -HEADERS += QhullRidge.h
    -HEADERS += QhullSet.h
    -HEADERS += QhullSets.h
    -HEADERS += QhullStat.h
    -HEADERS += QhullVertex.h
    -HEADERS += RboxPoints.h
    -HEADERS += RoadError.h
    -HEADERS += RoadLogEvent.h
    -HEADERS += UsingLibQhull.h
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qhull_interface.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qhull_interface.cpp
    deleted file mode 100644
    index 7c8151188f..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qhull_interface.cpp
    +++ /dev/null
    @@ -1,96 +0,0 @@
    -/*
      ---------------------------------
    -*/
    -
    -#include 
    -#include 
    -
    -//--- Include qhull, so it works from with in a C++ source file
    -//---
    -//--- In MVC one cannot just do:
    -//---
    -//---    extern "C"
    -//---    {
    -//---      #include "qhull_a.h"
    -//---    }
    -//---
    -//--- Because qhull_a.h includes math.h, which can not appear
    -//--- inside a extern "C" declaration.
    -//---
    -//--- Maybe that why Numerical recipes in C avoid this problem, by removing
    -//--- standard include headers from its header files and add them in the
    -//--- respective source files instead.
    -//---
    -//--- [K. Erleben]
    -
    -#if defined(__cplusplus)
    -extern "C"
    -{
    -#endif
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#if defined(__cplusplus)
    -}
    -#endif
    -
    -/*********************************************************************/
    -/*                                                                   */
    -/*                                                                   */
    -/*                                                                   */
    -/*                                                                   */
    -/*********************************************************************/
    -
    -void compute_convex_hull(void)
    -{
    -        int dim;                      /* dimension of points */
    -        int numpoints;            /* number of points */
    -        coordT *points;           /* array of coordinates for each point */
    -        boolT ismalloc;           /* True if qhull should free points in qh_freeqhull() or reallocation */
    -        char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */
    -        FILE *outfile= stdout;    /* output from qh_produce_output()
    -                                     use NULL to skip qh_produce_output() */
    -        FILE *errfile= stderr;    /* error messages from qhull code */
    -        int exitcode;             /* 0 if no error from qhull */
    -        facetT *facet;            /* set by FORALLfacets */
    -        int curlong, totlong;     /* memory remaining after qh_memfreeshort */
    -
    -        /* initialize dim, numpoints, points[], ismalloc here */
    -        exitcode= qh_new_qhull(dim, numpoints, points, ismalloc,
    -                                                        flags, outfile, errfile);
    -        if (!exitcode) { /* if no error */
    -                /* 'qh facet_list' contains the convex hull */
    -                FORALLfacets {
    -                        /* ... your code ... */
    -                }
    -        }
    -        qh_freeqhull(!qh_ALL);
    -        qh_memfreeshort(&curlong, &totlong);
    -        if (curlong || totlong)
    -                fprintf(errfile, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -                             totlong, curlong);
    -};
    -
    -/*********************************************************************/
    -/*                                                                   */
    -/*                                                                   */
    -/*                                                                   */
    -/*                                                                   */
    -/*********************************************************************/
    -
    -void main()
    -{
    -        cout << "Hello world" << endl;
    -
    -        cout << "Press any key..." << endl;
    -
    -        while (!_kbhit());
    -
    -};
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qt-qhull.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qt-qhull.cpp
    deleted file mode 100644
    index 093a753373..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullcpp/qt-qhull.cpp
    +++ /dev/null
    @@ -1,129 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/libqhullcpp/qt-qhull.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include 
    -#include "RoadTest.h"
    -
    -#ifndef QHULL_USES_QT
    -#define QHULL_USES_QT 1
    -#endif
    -
    -#include "Coordinates.h"
    -#include "QhullFacetList.h"
    -#include "QhullFacetSet.h"
    -#include "QhullHyperplane.h"
    -#include "QhullPoint.h"
    -#include "QhullPoints.h"
    -#include "QhullPointSet.h"
    -#include "QhullVertex.h"
    -#include "QhullVertexSet.h"
    -
    -namespace orgQhull {
    -
    -#//Conversions
    -
    -QList Coordinates::
    -toQList() const
    -{
    -    CoordinatesIterator i(*this);
    -    QList cs;
    -    while(i.hasNext()){
    -        cs.append(i.next());
    -    }
    -    return cs;
    -}//toQList
    -
    -QList QhullFacetList::
    -toQList() const
    -{
    -    QhullLinkedListIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.append(f);
    -        }
    -    }
    -    return vs;
    -}//toQList
    -
    -//! Same as PrintVertices
    -QList QhullFacetList::
    -vertices_toQList(int qhRunId) const
    -{
    -    QList vs;
    -    QhullVertexSet qvs(qhRunId, first().getFacetT(), NULL, isSelectAll());
    -    for(QhullVertexSet::iterator i=qvs.begin(); i!=qvs.end(); ++i){
    -        vs.push_back(*i);
    -    }
    -    return vs;
    -}//vertices_toQList
    -
    -QList QhullFacetSet::
    -toQList() const
    -{
    -    QhullSetIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.append(f);
    -        }
    -    }
    -    return vs;
    -}//toQList
    -
    -#ifdef QHULL_USES_QT
    -QList QhullHyperplane::
    -toQList() const
    -{
    -    QhullHyperplaneIterator i(*this);
    -    QList fs;
    -    while(i.hasNext()){
    -        fs.append(i.next());
    -    }
    -    fs.append(hyperplane_offset);
    -    return fs;
    -}//toQList
    -#endif //QHULL_USES_QT
    -
    -QList QhullPoint::
    -toQList() const
    -{
    -    QhullPointIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        vs.append(i.next());
    -    }
    -    return vs;
    -}//toQList
    -
    -QList QhullPoints::
    -toQList() const
    -{
    -    QhullPointsIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        vs.append(i.next());
    -    }
    -    return vs;
    -}//toQList
    -
    -QList QhullPointSet::
    -toQList() const
    -{
    -    QhullPointSetIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        vs.append(i.next());
    -    }
    -    return vs;
    -}//toQList
    -
    -}//orgQhull
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/libqhullp.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/libqhullp.pro
    deleted file mode 100644
    index d8248b1e16..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/libqhullp.pro
    +++ /dev/null
    @@ -1,25 +0,0 @@
    -# -------------------------------------------------
    -# libqhull.pro -- Qt project for Qhull shared library with qh_QHpointer
    -#   Built with qh_QHpointer=1
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -include(../qhull-libqhull-src.pri)
    -
    -DESTDIR = ../../lib
    -DLLDESTDIR = ../../bin
    -TEMPLATE = lib
    -CONFIG += shared warn_on
    -CONFIG -= qt
    -
    -build_pass:CONFIG(debug, debug|release):{
    -    TARGET = qhull_pd
    -    OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release):{
    -    TARGET = qhull_p
    -    OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -win32-msvc* : DEF_FILE += ../../src/libqhullp/qhull_p-exports.def
    -
    -DEFINES += qh_QHpointer # libqhull/user.h
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/qhull_p-exports.def b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/qhull_p-exports.def
    deleted file mode 100644
    index 4a0ce2ac56..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullp/qhull_p-exports.def
    +++ /dev/null
    @@ -1,413 +0,0 @@
    -; qhull_p-exports.def -- msvc module-definition file
    -;
    -;   Generated from depends.exe by cut-and-paste of exported symbols by mingw gcc
    -;   [mar'11] 399 symbols 
    -;   Annotate as DATA qh_qh qh_qhstat qhmem qhull_inuse rbox_inuse
    -;
    -; $Id: //main/2011/qhull/src/libqhull/qhull-exports.def#2 $$Change: 1368 $
    -; $DateTime: 2011/04/16 08:12:32 $$Author: bbarber $
    -;
    -; Define qhull_VERSION in CMakeLists.txt, Makefile, qhull-exports.def, qhull_p-exports.def, and qhull-warn.pri
    -VERSION 6.3
    -EXPORTS
    -dfacet
    -dvertex
    -out1
    -out2n
    -out3n
    -qh_addhash
    -qh_addpoint
    -qh_all_merges
    -qh_allstatA
    -qh_allstatB
    -qh_allstatC
    -qh_allstatD
    -qh_allstatE
    -qh_allstatE2
    -qh_allstatF
    -qh_allstatG
    -qh_allstatH
    -qh_allstatI
    -qh_allstatistics
    -qh_appendfacet
    -qh_appendmergeset
    -qh_appendprint
    -qh_appendvertex
    -qh_argv_to_command
    -qh_argv_to_command_size
    -qh_attachnewfacets
    -qh_backnormal
    -qh_basevertices
    -qh_build_withrestart
    -qh_buildhull
    -qh_buildtracing
    -qh_check_bestdist
    -qh_check_maxout
    -qh_check_output
    -qh_check_point
    -qh_check_points
    -qh_checkconnect
    -qh_checkconvex
    -qh_checkfacet
    -qh_checkflags
    -qh_checkflipped
    -qh_checkflipped_all
    -qh_checkpolygon
    -qh_checkvertex
    -qh_checkzero
    -qh_clear_outputflags
    -qh_clearcenters
    -qh_clock
    -qh_collectstatistics
    -qh_compare_facetarea
    -qh_compare_facetmerge
    -qh_compare_facetvisit
    -qh_compare_vertexpoint
    -qh_compareangle
    -qh_comparemerge
    -qh_comparevisit
    -qh_copyfilename
    -qh_copynonconvex
    -qh_copypoints
    -qh_countfacets
    -qh_createsimplex
    -qh_crossproduct
    -qh_degen_redundant_facet
    -qh_degen_redundant_neighbors
    -qh_deletevisible
    -qh_delfacet
    -qh_delridge
    -qh_delvertex
    -qh_determinant
    -qh_detjoggle
    -qh_detroundoff
    -qh_detsimplex
    -qh_detvnorm
    -qh_detvridge
    -qh_detvridge3
    -qh_distnorm
    -qh_distplane
    -qh_distround
    -qh_divzero
    -qh_eachvoronoi
    -qh_eachvoronoi_all
    -qh_errexit
    -qh_errexit2
    -qh_errexit_rbox
    -qh_errprint
    -qh_exit
    -qh_facet2point
    -qh_facet3vertex
    -qh_facetarea
    -qh_facetarea_simplex
    -qh_facetcenter
    -qh_facetintersect
    -qh_facetvertices
    -qh_find_newvertex
    -qh_findbest
    -qh_findbest_test
    -qh_findbestfacet
    -qh_findbesthorizon
    -qh_findbestlower
    -qh_findbestneighbor
    -qh_findbestnew
    -qh_findfacet_all
    -qh_findgood
    -qh_findgood_all
    -qh_findgooddist
    -qh_findhorizon
    -qh_flippedmerges
    -qh_forcedmerges
    -qh_fprintf
    -qh_fprintf_rbox
    -qh_free
    -qh_freebuffers
    -qh_freebuild
    -qh_freeqhull
    -qh_freeqhull2
    -qh_freestatistics
    -qh_furthestnext
    -qh_furthestout
    -qh_gausselim
    -qh_geomplanes
    -qh_getangle
    -qh_getarea
    -qh_getcenter
    -qh_getcentrum
    -qh_getdistance
    -qh_gethash
    -qh_getmergeset
    -qh_getmergeset_initial
    -qh_gram_schmidt
    -qh_hashridge
    -qh_hashridge_find
    -qh_infiniteloop
    -qh_init_A
    -qh_init_B
    -qh_init_qhull_command
    -qh_initbuild
    -qh_initflags
    -qh_initialhull
    -qh_initialvertices
    -qh_initqhull_buffers
    -qh_initqhull_globals
    -qh_initqhull_mem
    -qh_initqhull_outputflags
    -qh_initqhull_start
    -qh_initqhull_start2
    -qh_initstatistics
    -qh_initthresholds
    -qh_inthresholds
    -qh_isvertex
    -qh_joggleinput
    -qh_makenew_nonsimplicial
    -qh_makenew_simplicial
    -qh_makenewfacet
    -qh_makenewfacets
    -qh_makenewplanes
    -qh_makeridges
    -qh_malloc
    -qh_mark_dupridges
    -qh_markkeep
    -qh_markvoronoi
    -qh_matchduplicates
    -qh_matchneighbor
    -qh_matchnewfacets
    -qh_matchvertices
    -qh_maxabsval
    -qh_maxmin
    -qh_maxouter
    -qh_maxsimplex
    -qh_maydropneighbor
    -qh_memalloc
    -qh_memfree
    -qh_memfreeshort
    -qh_meminit
    -qh_meminitbuffers
    -qh_memsetup
    -qh_memsize
    -qh_memstatistics
    -qh_memtotal
    -qh_merge_degenredundant
    -qh_merge_nonconvex
    -qh_mergecycle
    -qh_mergecycle_all
    -qh_mergecycle_facets
    -qh_mergecycle_neighbors
    -qh_mergecycle_ridges
    -qh_mergecycle_vneighbors
    -qh_mergefacet
    -qh_mergefacet2d
    -qh_mergeneighbors
    -qh_mergeridges
    -qh_mergesimplex
    -qh_mergevertex_del
    -qh_mergevertex_neighbors
    -qh_mergevertices
    -qh_minabsval
    -qh_mindiff
    -qh_nearcoplanar
    -qh_nearvertex
    -qh_neighbor_intersections
    -qh_new_qhull
    -qh_newfacet
    -qh_newhashtable
    -qh_newridge
    -qh_newstats
    -qh_newvertex
    -qh_newvertices
    -qh_nextfurthest
    -qh_nextridge3d
    -qh_normalize
    -qh_normalize2
    -qh_nostatistic
    -qh_option
    -qh_order_vertexneighbors
    -qh_orientoutside
    -qh_outcoplanar
    -qh_outerinner
    -qh_partitionall
    -qh_partitioncoplanar
    -qh_partitionpoint
    -qh_partitionvisible
    -qh_point
    -qh_point_add
    -qh_pointdist
    -qh_pointfacet
    -qh_pointid
    -qh_pointvertex
    -qh_postmerge
    -qh_precision
    -qh_premerge
    -qh_prepare_output
    -qh_prependfacet
    -qh_printafacet
    -qh_printallstatistics
    -qh_printbegin
    -qh_printcenter
    -qh_printcentrum
    -qh_printend
    -qh_printend4geom
    -qh_printextremes
    -qh_printextremes_2d
    -qh_printextremes_d
    -qh_printfacet
    -qh_printfacet2geom
    -qh_printfacet2geom_points
    -qh_printfacet2math
    -qh_printfacet3geom_nonsimplicial
    -qh_printfacet3geom_points
    -qh_printfacet3geom_simplicial
    -qh_printfacet3math
    -qh_printfacet3vertex
    -qh_printfacet4geom_nonsimplicial
    -qh_printfacet4geom_simplicial
    -qh_printfacetNvertex_nonsimplicial
    -qh_printfacetNvertex_simplicial
    -qh_printfacetheader
    -qh_printfacetlist
    -qh_printfacetridges
    -qh_printfacets
    -qh_printhashtable
    -qh_printhelp_degenerate
    -qh_printhelp_narrowhull
    -qh_printhelp_singular
    -qh_printhyperplaneintersection
    -qh_printline3geom
    -qh_printlists
    -qh_printmatrix
    -qh_printneighborhood
    -qh_printpoint
    -qh_printpoint3
    -qh_printpointid
    -qh_printpoints
    -qh_printpoints_out
    -qh_printpointvect
    -qh_printpointvect2
    -qh_printridge
    -qh_printspheres
    -qh_printstatistics
    -qh_printstatlevel
    -qh_printstats
    -qh_printsummary
    -qh_printvdiagram
    -qh_printvdiagram2
    -qh_printvertex
    -qh_printvertexlist
    -qh_printvertices
    -qh_printvneighbors
    -qh_printvnorm
    -qh_printvoronoi
    -qh_printvridge
    -qh_produce_output
    -qh_produce_output2
    -qh_projectdim3
    -qh_projectinput
    -qh_projectpoint
    -qh_projectpoints
    -; Mark as DATA, otherwise links a separate qh_qh.  Requires __dcelspec
    -qh_qh               DATA
    -qh_qhstat           DATA
    -qh_qhull
    -qh_rand
    -qh_rand_seed
    -qh_randomfactor
    -qh_randommatrix
    -qh_rboxpoints
    -qh_readfeasible
    -qh_readpoints
    -qh_reducevertices
    -qh_redundant_vertex
    -qh_remove_extravertices
    -qh_removefacet
    -qh_removevertex
    -qh_rename_sharedvertex
    -qh_renameridgevertex
    -qh_renamevertex
    -qh_resetlists
    -qh_restore_qhull
    -qh_rotateinput
    -qh_rotatepoints
    -qh_save_qhull
    -qh_scaleinput
    -qh_scalelast
    -qh_scalepoints
    -qh_setaddnth
    -qh_setaddsorted
    -qh_setappend
    -qh_setappend2ndlast
    -qh_setappend_set
    -qh_setcheck
    -qh_setcompact
    -qh_setcopy
    -qh_setdel
    -qh_setdelaunay
    -qh_setdellast
    -qh_setdelnth
    -qh_setdelnthsorted
    -qh_setdelsorted
    -qh_setduplicate
    -qh_setequal
    -qh_setequal_except
    -qh_setequal_skip
    -qh_setfacetplane
    -qh_setfeasible
    -qh_setfree
    -qh_setfree2
    -qh_setfreelong
    -qh_sethalfspace
    -qh_sethalfspace_all
    -qh_sethyperplane_det
    -qh_sethyperplane_gauss
    -qh_setin
    -qh_setindex
    -qh_setlarger
    -qh_setlast
    -qh_setnew
    -qh_setnew_delnthsorted
    -qh_setprint
    -qh_setreplace
    -qh_setsize
    -qh_settemp
    -qh_settempfree
    -qh_settempfree_all
    -qh_settemppop
    -qh_settemppush
    -qh_settruncate
    -qh_setunique
    -qh_setvoronoi_all
    -qh_setzero
    -qh_sharpnewfacets
    -qh_skipfacet
    -qh_skipfilename
    -qh_srand
    -qh_stddev
    -qh_strtod
    -qh_strtol
    -qh_test_appendmerge
    -qh_test_vneighbors
    -qh_tracemerge
    -qh_tracemerging
    -qh_triangulate
    -qh_triangulate_facet
    -qh_triangulate_link
    -qh_triangulate_mirror
    -qh_triangulate_null
    -qh_updatetested
    -qh_updatevertices
    -qh_user_memsizes
    -qh_version
    -qh_vertexintersect
    -qh_vertexintersect_new
    -qh_vertexneighbors
    -qh_vertexridges
    -qh_vertexridges_facet
    -qh_vertexsubset
    -qh_voronoi_center
    -qh_willdelete
    -; Mark as DATA, otherwise links a separate qhmem.  Requires __dcelspec
    -qhmem                   DATA
    -qhull_inuse             DATA
    -rbox
    -rbox_inuse              DATA
    -roundi
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstatic/libqhullstatic.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstatic/libqhullstatic.pro
    deleted file mode 100644
    index 1a516db73c..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstatic/libqhullstatic.pro
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -# -------------------------------------------------
    -# libqhullstatic.pro -- Qt project for Qhull static library
    -#   Built with qh_QHpointer=0.  See libqhullp.pro
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -include(../qhull-libqhull-src.pri)
    -
    -DESTDIR = ../../lib
    -TEMPLATE = lib
    -CONFIG += staticlib warn_on
    -CONFIG -= qt
    -build_pass:CONFIG(debug, debug|release):{
    -    TARGET = qhullstatic_d
    -    OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release):{
    -    TARGET = qhullstatic
    -    OBJECTS_DIR = Release
    -}
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstaticp/libqhullstaticp.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstaticp/libqhullstaticp.pro
    deleted file mode 100644
    index fd4e38d48d..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/libqhullstaticp/libqhullstaticp.pro
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -# -------------------------------------------------
    -# libqhullstaticp.pro -- Qhull static library with qh_qhPointer
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -include(../qhull-libqhull-src.pri)
    -
    -DESTDIR = ../../lib
    -TEMPLATE = lib
    -CONFIG += staticlib warn_on
    -CONFIG -= qt
    -build_pass:CONFIG(debug, debug|release) {
    -    TARGET = qhullstatic_pd
    -    OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release) {
    -    TARGET = qhullstatic_p
    -    OBJECTS_DIR = Release
    -}
    -
    -DEFINES += qh_QHpointer # libqhull/user.h
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.c
    deleted file mode 100644
    index 465799fca3..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.c
    +++ /dev/null
    @@ -1,336 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qconvex.c
    -      compute convex hulls using qhull
    -
    -   see unix.c for full interface
    -
    -   Copyright (c) 1993-2012, The Geometry Center
    -*/
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include "libqhull.h"
    -#include "mem.h"
    -#include "qset.h"
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#elif __cplusplus
    -extern "C" {
    -  int isatty(int);
    -}
    -
    -#elif _MSC_VER
    -#include 
    -#define isatty _isatty
    -int _isatty(int);
    -
    -#else
    -int isatty(int);  /* returns 1 if stdin is a tty
    -                   if "Undefined symbol" this can be deleted along with call in main() */
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_prompt
    -    long prompt for qconvex
    -
    -  notes:
    -    restricted version of libqhull.c
    -
    -  see:
    -    concise prompt below
    -*/
    -
    -/* duplicated in qconvex.htm */
    -char hidden_options[]=" d v H Qbb Qf Qg Qm Qr Qu Qv Qx Qz TR E V Fp Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
    -
    -char qh_prompta[]= "\n\
    -qconvex- compute the convex hull\n\
    -    http://www.qhull.org  %s\n\
    -\n\
    -input (stdin):\n\
    -    first lines: dimension and number of points (or vice-versa).\n\
    -    other lines: point coordinates, best if one point per line\n\
    -    comments:    start with a non-numeric character\n\
    -\n\
    -options:\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Qc   - keep coplanar points with nearest facet\n\
    -    Qi   - keep interior points with nearest facet\n\
    -\n\
    -Qhull control options:\n\
    -    Qbk:n   - scale coord k so that low bound is n\n\
    -      QBk:n - scale coord k so that upper bound is n (QBk is %2.2g)\n\
    -    QbB  - scale input to unit cube centered at the origin\n\
    -    Qbk:0Bk:0 - remove k-th coordinate from input\n\
    -    QJn  - randomly joggle input in range [-n,n]\n\
    -    QRn  - random rotation (n=seed, n=0 time, n=-1 time/no rotate)\n\
    -%s%s%s%s";  /* split up qh_prompt for Visual C++ */
    -char qh_promptb[]= "\
    -    Qs   - search all points for the initial simplex\n\
    -    QGn  - good facet if visible from point n, -n for not visible\n\
    -    QVn  - good facet if it includes point n, -n if not\n\
    -\n\
    -";
    -char qh_promptc[]= "\
    -Trace options:\n\
    -    T4   - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
    -    Tc   - check frequently during execution\n\
    -    Ts   - print statistics\n\
    -    Tv   - verify result: structure, convexity, and point inclusion\n\
    -    Tz   - send all output to stdout\n\
    -    TFn  - report summary when n or more facets created\n\
    -    TI file - input data from file, no spaces or single quotes\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -    TPn  - turn on tracing when point n added to hull\n\
    -     TMn - turn on tracing at merge n\n\
    -     TWn - trace merge facets when width > n\n\
    -    TVn  - stop qhull after adding point n, -n for before (see TCn)\n\
    -     TCn - stop qhull after building cone for point n (see TVn)\n\
    -\n\
    -Precision options:\n\
    -    Cn   - radius of centrum (roundoff added).  Merge facets if non-convex\n\
    -     An  - cosine of maximum angle.  Merge facets if cosine > n or non-convex\n\
    -           C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
    -    Rn   - randomly perturb computations by a factor of [1-n,1+n]\n\
    -    Un   - max distance below plane for a new, coplanar point\n\
    -    Wn   - min facet width for outside point (before roundoff)\n\
    -\n\
    -Output formats (may be combined; if none, produces a summary to stdout):\n\
    -    f    - facet dump\n\
    -    G    - Geomview output (see below)\n\
    -    i    - vertices incident to each facet\n\
    -    m    - Mathematica output (2-d and 3-d)\n\
    -    n    - normals with offsets\n\
    -    o    - OFF file format (dim, points and facets; Voronoi regions)\n\
    -    p    - point coordinates \n\
    -    s    - summary (stderr)\n\
    -\n\
    -";
    -char qh_promptd[]= "\
    -More formats:\n\
    -    Fa   - area for each facet\n\
    -    FA   - compute total area and volume for option 's'\n\
    -    Fc   - count plus coplanar points for each facet\n\
    -           use 'Qc' (default) for coplanar and 'Qi' for interior\n\
    -    FC   - centrum for each facet\n\
    -    Fd   - use cdd format for input (homogeneous with offset first)\n\
    -    FD   - use cdd format for numeric output (offset first)\n\
    -    FF   - facet dump without ridges\n\
    -    Fi   - inner plane for each facet\n\
    -    FI   - ID for each facet\n\
    -    Fm   - merge count for each facet (511 max)\n\
    -    Fn   - count plus neighboring facets for each facet\n\
    -    FN   - count plus neighboring facets for each point\n\
    -    Fo   - outer plane (or max_outside) for each facet\n\
    -    FO   - options and precision constants\n\
    -    FP   - nearest vertex for each coplanar point\n\
    -    FQ   - command used for qconvex\n\
    -    Fs   - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
    -                      for output: #vertices, #facets,\n\
    -                                  #coplanar points, #non-simplicial facets\n\
    -                    #real (2), max outer plane, min vertex\n\
    -    FS   - sizes:   #int (0) \n\
    -                    #real (2) tot area, tot volume\n\
    -    Ft   - triangulation with centrums for non-simplicial facets (OFF format)\n\
    -    Fv   - count plus vertices for each facet\n\
    -    FV   - average of vertices (a feasible point for 'H')\n\
    -    Fx   - extreme points (in order for 2-d)\n\
    -\n\
    -";
    -char qh_prompte[]= "\
    -Geomview output (2-d, 3-d, and 4-d)\n\
    -    Ga   - all points as dots\n\
    -     Gp  -  coplanar points and vertices as radii\n\
    -     Gv  -  vertices as spheres\n\
    -    Gi   - inner planes only\n\
    -     Gn  -  no planes\n\
    -     Go  -  outer planes only\n\
    -    Gc   - centrums\n\
    -    Gh   - hyperplane intersections\n\
    -    Gr   - ridges\n\
    -    GDn  - drop dimension n in 3-d and 4-d output\n\
    -\n\
    -Print options:\n\
    -    PAn  - keep n largest facets by area\n\
    -    Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
    -    PDk:n - drop facet if normal[k] >= n\n\
    -    Pg   - print good facets (needs 'QGn' or 'QVn')\n\
    -    PFn  - keep facets whose area is at least n\n\
    -    PG   - print neighbors of good facets\n\
    -    PMn  - keep n facets with most merges\n\
    -    Po   - force output.  If error, output neighborhood of facet\n\
    -    Pp   - do not report precision problems\n\
    -\n\
    -    .    - list of all options\n\
    -    -    - one line descriptions of all options\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt2
    -    synopsis for qhull
    -*/
    -char qh_prompt2[]= "\n\
    -qconvex- compute the convex hull.  Qhull %s\n\
    -    input (stdin): dimension, number of points, point coordinates\n\
    -    comments start with a non-numeric character\n\
    -\n\
    -options (qconvex.htm):\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Tv   - verify result: structure, convexity, and point inclusion\n\
    -    .    - concise list of all options\n\
    -    -    - one-line description of all options\n\
    -\n\
    -output options (subset):\n\
    -    s    - summary of results (default)\n\
    -    i    - vertices incident to each facet\n\
    -    n    - normals with offsets\n\
    -    p    - vertex coordinates (includes coplanar points if 'Qc')\n\
    -    Fx   - extreme points (convex hull vertices)\n\
    -    FA   - report total area and volume\n\
    -    FS   - compute total area and volume\n\
    -    o    - OFF format (dim, n, points, facets)\n\
    -    G    - Geomview output (2-d, 3-d, and 4-d)\n\
    -    m    - Mathematica output (2-d and 3-d)\n\
    -    QVn  - print facets that include point n, -n if not\n\
    -    TO file- output results to file, may be enclosed in single quotes\n\
    -\n\
    -examples:\n\
    -    rbox c D2 | qconvex s n                    rbox c D2 | qconvex i\n\
    -    rbox c D2 | qconvex o                      rbox 1000 s | qconvex s Tv FA\n\
    -    rbox c d D2 | qconvex s Qc Fx              rbox y 1000 W0 | qconvex s n\n\
    -    rbox y 1000 W0 | qconvex s QJ              rbox d G1 D12 | qconvex QR0 FA Pp\n\
    -    rbox c D7 | qconvex FA TF1000\n\
    -\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt3
    -    concise prompt for qhull
    -*/
    -char qh_prompt3[]= "\n\
    -Qhull %s.\n\
    -Except for 'F.' and 'PG', upper-case options take an argument.\n\
    -\n\
    - incidences     mathematica    normals        OFF_format     points\n\
    - summary        facet_dump\n\
    -\n\
    - Farea          FArea_total    Fcoplanars     FCentrums      Fd_cdd_in\n\
    - FD_cdd_out     FFacet_xridge  Finner         FIDs           Fmerges\n\
    - Fneighbors     FNeigh_vertex  Fouter         FOptions       FPoint_near\n\
    - FQhull         Fsummary       FSize          Fvertices      FVertex_ave\n\
    - Fxtremes       FMaple\n\
    -\n\
    - Gvertices      Gpoints        Gall_points    Gno_planes     Ginner\n\
    - Gcentrums      Ghyperplanes   Gridges        Gouter         GDrop_dim\n\
    -\n\
    - PArea_keep     Pdrop d0:0D0   PFacet_area_keep Pgood        PGood_neighbors\n\
    - PMerge_keep    Poutput_forced Pprecision_not\n\
    -\n\
    - QbBound 0:0.5  QbB_scale_box  Qcoplanar      QGood_point    Qinterior\n\
    - QJoggle        Qrandom        QRotate        Qsearch_1st    Qtriangulate\n\
    - QVertex_good\n\
    -\n\
    - T4_trace       Tcheck_often   Tstatistics    Tverify        Tz_stdout\n\
    - TFacet_log     TInput_file    TPoint_trace   TMerge_trace   TOutput_file\n\
    - TWide_trace    TVertex_stop   TCone_stop\n\
    -\n\
    - Angle_max      Centrum_size   Random_dist    Ucoplanar_max  Wide_outside\n\
    -";
    -
    -/*---------------------------------
    -
    -  main( argc, argv )
    -    processes the command line, calls qhull() to do the work, and exits
    -
    -  design:
    -    initializes data structures
    -    reads points
    -    finishes initialization
    -    computes convex hull and other structures
    -    checks the result
    -    writes the output
    -    frees memory
    -*/
    -int main(int argc, char *argv[]) {
    -  int curlong, totlong; /* used !qh_NOmem */
    -  int exitcode, numpoints, dim;
    -  coordT *points;
    -  boolT ismalloc;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= false;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if ((argc == 1) && isatty( 0 /*stdin*/)) {
    -    fprintf(stdout, qh_prompt2, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompta, qh_version, qh_DEFAULTbox,
    -                qh_promptb, qh_promptc, qh_promptd, qh_prompte);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompt3, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  qh_init_A(stdin, stdout, stderr, argc, argv);  /* sets qh qhull_command */
    -  exitcode= setjmp(qh errexit); /* simple statement for CRAY J916 */
    -  if (!exitcode) {
    -    qh_checkflags(qh qhull_command, hidden_options);
    -    qh_initflags(qh qhull_command);
    -    points= qh_readpoints(&numpoints, &dim, &ismalloc);
    -    if (dim >= 5) {
    -      qh_option("Qxact_merge", NULL, NULL);
    -      qh MERGEexact= True; /* 'Qx' always */
    -    }
    -    qh_init_B(points, numpoints, dim, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();
    -    if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -    exitcode= qh_ERRnone;
    -  }
    -  qh NOerrexit= True;  /* no more setjmp */
    -#ifdef qh_NOmem
    -  qh_freeqhull( True);
    -#else
    -  qh_freeqhull( False);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -       totlong, curlong);
    -#endif
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.pro
    deleted file mode 100644
    index 1bf631bff6..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qconvex/qconvex.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# qconvex.pro -- Qt project file for qconvex.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = qconvex
    -
    -SOURCES += qconvex.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaun.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaun.c
    deleted file mode 100644
    index 7f6b45e364..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaun.c
    +++ /dev/null
    @@ -1,325 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qdelaun.c
    -     compute Delaunay triangulations and furthest-point Delaunay
    -     triangulations using qhull
    -
    -   see unix.c for full interface
    -
    -   Copyright (c) 1993-2012, The Geometry Center
    -*/
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include "libqhull.h"
    -#include "mem.h"
    -#include "qset.h"
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#elif __cplusplus
    -extern "C" {
    -  int isatty(int);
    -}
    -
    -#elif _MSC_VER
    -#include 
    -#define isatty _isatty
    -int _isatty(int);
    -
    -#else
    -int isatty(int);  /* returns 1 if stdin is a tty
    -                   if "Undefined symbol" this can be deleted along with call in main() */
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_prompt
    -    long prompt for qhull
    -
    -  notes:
    -    restricted version of libqhull.c
    -
    -  see:
    -    concise prompt below
    -*/
    -
    -/* duplicated in qdelau_f.htm and qdelaun.htm */
    -char hidden_options[]=" d n v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V FC Fi Fo Ft Fp FV Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
    -
    -char qh_prompta[]= "\n\
    -qdelaunay- compute the Delaunay triangulation\n\
    -    http://www.qhull.org  %s\n\
    -\n\
    -input (stdin):\n\
    -    first lines: dimension and number of points (or vice-versa).\n\
    -    other lines: point coordinates, best if one point per line\n\
    -    comments:    start with a non-numeric character\n\
    -\n\
    -options:\n\
    -    Qu   - compute furthest-site Delaunay triangulation\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -\n\
    -Qhull control options:\n\
    -    QJn  - randomly joggle input in range [-n,n]\n\
    -%s%s%s%s";  /* split up qh_prompt for Visual C++ */
    -char qh_promptb[]= "\
    -    Qs   - search all points for the initial simplex\n\
    -    Qz   - add point-at-infinity to Delaunay triangulation\n\
    -    QGn  - print Delaunay region if visible from point n, -n if not\n\
    -    QVn  - print Delaunay regions that include point n, -n if not\n\
    -\n\
    -";
    -char qh_promptc[]= "\
    -Trace options:\n\
    -    T4   - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
    -    Tc   - check frequently during execution\n\
    -    Ts   - print statistics\n\
    -    Tv   - verify result: structure, convexity, and in-circle test\n\
    -    Tz   - send all output to stdout\n\
    -    TFn  - report summary when n or more facets created\n\
    -    TI file - input data from file, no spaces or single quotes\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -    TPn  - turn on tracing when point n added to hull\n\
    -     TMn - turn on tracing at merge n\n\
    -     TWn - trace merge facets when width > n\n\
    -    TVn  - stop qhull after adding point n, -n for before (see TCn)\n\
    -     TCn - stop qhull after building cone for point n (see TVn)\n\
    -\n\
    -Precision options:\n\
    -    Cn   - radius of centrum (roundoff added).  Merge facets if non-convex\n\
    -     An  - cosine of maximum angle.  Merge facets if cosine > n or non-convex\n\
    -           C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
    -    Rn   - randomly perturb computations by a factor of [1-n,1+n]\n\
    -    Wn   - min facet width for outside point (before roundoff)\n\
    -\n\
    -Output formats (may be combined; if none, produces a summary to stdout):\n\
    -    f    - facet dump\n\
    -    G    - Geomview output (see below)\n\
    -    i    - vertices incident to each Delaunay region\n\
    -    m    - Mathematica output (2-d only, lifted to a paraboloid)\n\
    -    o    - OFF format (dim, points, and facets as a paraboloid)\n\
    -    p    - point coordinates (lifted to a paraboloid)\n\
    -    s    - summary (stderr)\n\
    -\n\
    -";
    -char qh_promptd[]= "\
    -More formats:\n\
    -    Fa   - area for each Delaunay region\n\
    -    FA   - compute total area for option 's'\n\
    -    Fc   - count plus coincident points for each Delaunay region\n\
    -    Fd   - use cdd format for input (homogeneous with offset first)\n\
    -    FD   - use cdd format for numeric output (offset first)\n\
    -    FF   - facet dump without ridges\n\
    -    FI   - ID of each Delaunay region\n\
    -    Fm   - merge count for each Delaunay region (511 max)\n\
    -    FM   - Maple output (2-d only, lifted to a paraboloid)\n\
    -    Fn   - count plus neighboring region for each Delaunay region\n\
    -    FN   - count plus neighboring region for each point\n\
    -    FO   - options and precision constants\n\
    -    FP   - nearest point and distance for each coincident point\n\
    -    FQ   - command used for qdelaunay\n\
    -    Fs   - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
    -                    for output: #vertices, #Delaunay regions,\n\
    -                                #coincident points, #non-simplicial regions\n\
    -                    #real (2), max outer plane, min vertex\n\
    -    FS   - sizes:   #int (0)\n\
    -                    #real (2), tot area, 0\n\
    -    Fv   - count plus vertices for each Delaunay region\n\
    -    Fx   - extreme points of Delaunay triangulation (on convex hull)\n\
    -\n\
    -";
    -char qh_prompte[]= "\
    -Geomview options (2-d and 3-d)\n\
    -    Ga   - all points as dots\n\
    -     Gp  -  coplanar points and vertices as radii\n\
    -     Gv  -  vertices as spheres\n\
    -    Gi   - inner planes only\n\
    -     Gn  -  no planes\n\
    -     Go  -  outer planes only\n\
    -    Gc     - centrums\n\
    -    Gh   - hyperplane intersections\n\
    -    Gr   - ridges\n\
    -    GDn  - drop dimension n in 3-d and 4-d output\n\
    -    Gt   - transparent outer ridges to view 3-d Delaunay\n\
    -\n\
    -Print options:\n\
    -    PAn  - keep n largest Delaunay regions by area\n\
    -    Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
    -    PDk:n - drop facet if normal[k] >= n\n\
    -    Pg   - print good Delaunay regions (needs 'QGn' or 'QVn')\n\
    -    PFn  - keep Delaunay regions whose area is at least n\n\
    -    PG   - print neighbors of good regions (needs 'QGn' or 'QVn')\n\
    -    PMn  - keep n Delaunay regions with most merges\n\
    -    Po   - force output.  If error, output neighborhood of facet\n\
    -    Pp   - do not report precision problems\n\
    -\n\
    -    .    - list of all options\n\
    -    -    - one line descriptions of all options\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt2
    -    synopsis for qhull
    -*/
    -char qh_prompt2[]= "\n\
    -qdelaunay- compute the Delaunay triangulation.  Qhull %s\n\
    -    input (stdin): dimension, number of points, point coordinates\n\
    -    comments start with a non-numeric character\n\
    -\n\
    -options (qdelaun.htm):\n\
    -    Qu   - furthest-site Delaunay triangulation\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Tv   - verify result: structure, convexity, and in-circle test\n\
    -    .    - concise list of all options\n\
    -    -    - one-line description of all options\n\
    -\n\
    -output options (subset):\n\
    -    s    - summary of results (default)\n\
    -    i    - vertices incident to each Delaunay region\n\
    -    Fx   - extreme points (vertices of the convex hull)\n\
    -    o    - OFF format (shows the points lifted to a paraboloid)\n\
    -    G    - Geomview output (2-d and 3-d points lifted to a paraboloid)\n\
    -    m    - Mathematica output (2-d inputs lifted to a paraboloid)\n\
    -    QVn  - print Delaunay regions that include point n, -n if not\n\
    -    TO file- output results to file, may be enclosed in single quotes\n\
    -\n\
    -examples:\n\
    -    rbox c P0 D2 | qdelaunay s o          rbox c P0 D2 | qdelaunay i\n\
    -    rbox c P0 D2 | qdelaunay Fv           rbox c P0 D2 | qdelaunay s Qu Fv\n\
    -    rbox c G1 d D2 | qdelaunay s i        rbox c G1 d D2 | qdelaunay Qt\n\
    -    rbox M3,4 z 100 D2 | qdelaunay s      rbox M3,4 z 100 D2 | qdelaunay s Qt\n\
    -\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt3
    -    concise prompt for qhull
    -*/
    -char qh_prompt3[]= "\n\
    -Qhull %s.\n\
    -Except for 'F.' and 'PG', upper-case options take an argument.\n\
    -\n\
    - incidences     mathematica    OFF_format     points_lifted  summary\n\
    - facet_dump\n\
    -\n\
    - Farea          FArea_total    Fcoincident    Fd_cdd_in      FD_cdd_out\n\
    - FF_dump_xridge FIDs           Fmerges        Fneighbors     FNeigh_vertex\n\
    - FOptions       FPoint_near    FQdelaun       Fsummary       FSize\n\
    - Fvertices      Fxtremes       FMaple\n\
    -\n\
    - Gvertices      Gpoints        Gall_points    Gno_planes     Ginner\n\
    - Gcentrums      Ghyperplanes   Gridges        Gouter         GDrop_dim\n\
    - Gtransparent\n\
    -\n\
    - PArea_keep     Pdrop d0:0D0   Pgood          PFacet_area_keep\n\
    - PGood_neighbors PMerge_keep   Poutput_forced Pprecision_not\n\
    -\n\
    - QGood_point    QJoggle        Qsearch_1st    Qtriangulate   QupperDelaunay\n\
    - QVertex_good   Qzinfinite\n\
    -\n\
    - T4_trace       Tcheck_often   Tstatistics    Tverify        Tz_stdout\n\
    - TFacet_log     TInput_file    TPoint_trace   TMerge_trace   TOutput_file\n\
    - TWide_trace    TVertex_stop   TCone_stop\n\
    -\n\
    - Angle_max      Centrum_size   Random_dist    Wide_outside\n\
    -";
    -
    -/*---------------------------------
    -
    -  main( argc, argv )
    -    processes the command line, calls qhull() to do the work, and exits
    -
    -  design:
    -    initializes data structures
    -    reads points
    -    finishes initialization
    -    computes convex hull and other structures
    -    checks the result
    -    writes the output
    -    frees memory
    -*/
    -int main(int argc, char *argv[]) {
    -  int curlong, totlong; /* used !qh_NOmem */
    -  int exitcode, numpoints, dim;
    -  coordT *points;
    -  boolT ismalloc;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= false;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if ((argc == 1) && isatty( 0 /*stdin*/)) {
    -    fprintf(stdout, qh_prompt2, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompta, qh_version,
    -                qh_promptb, qh_promptc, qh_promptd, qh_prompte);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompt3, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  qh_init_A(stdin, stdout, stderr, argc, argv);  /* sets qh qhull_command */
    -  exitcode= setjmp(qh errexit); /* simple statement for CRAY J916 */
    -  if (!exitcode) {
    -    qh_option("delaunay  Qbbound-last", NULL, NULL);
    -    qh DELAUNAY= True;     /* 'd'   */
    -    qh SCALElast= True;    /* 'Qbb' */
    -    qh KEEPcoplanar= True; /* 'Qc', to keep coplanars in 'p' */
    -    qh_checkflags(qh qhull_command, hidden_options);
    -    qh_initflags(qh qhull_command);
    -    points= qh_readpoints(&numpoints, &dim, &ismalloc);
    -    if (dim >= 5) {
    -      qh_option("Qxact_merge", NULL, NULL);
    -      qh MERGEexact= True; /* 'Qx' always */
    -    }
    -    qh_init_B(points, numpoints, dim, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();
    -    if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -    exitcode= qh_ERRnone;
    -  }
    -  qh NOerrexit= True;  /* no more setjmp */
    -#ifdef qh_NOmem
    -  qh_freeqhull( True);
    -#else
    -  qh_freeqhull( False);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -       totlong, curlong);
    -#endif
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaunay.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaunay.pro
    deleted file mode 100644
    index 138ac0589d..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qdelaunay/qdelaunay.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# qdelaunay.pro -- Qt project file for qvoronoi.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = qdelaunay
    -
    -SOURCES += qdelaun.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.c
    deleted file mode 100644
    index bf36e8feb0..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.c
    +++ /dev/null
    @@ -1,326 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qhalf.c
    -     compute the intersection of halfspaces about a point
    -
    -   see unix.c for full interface
    -
    -   Copyright (c) 1993-2012, The Geometry Center
    -*/
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include "libqhull.h"
    -#include "mem.h"
    -#include "qset.h"
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#elif __cplusplus
    -extern "C" {
    -  int isatty(int);
    -}
    -
    -#elif _MSC_VER
    -#include 
    -#define isatty _isatty
    -int _isatty(int);
    -
    -#else
    -int isatty(int);  /* returns 1 if stdin is a tty
    -                   if "Undefined symbol" this can be deleted along with call in main() */
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_prompt
    -    long prompt for qhull
    -
    -  notes:
    -    restricted version of libqhull.c
    -
    -  see:
    -    concise prompt below
    -*/
    -
    -/* duplicated in qhalf.htm */
    -char hidden_options[]=" d n v Qbb QbB Qf Qg Qm Qr QR Qv Qx Qz TR E V Fa FA FC FD FS Ft FV Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
    -
    -char qh_prompta[]= "\n\
    -qhalf- compute the intersection of halfspaces about a point\n\
    -    http://www.qhull.org  %s\n\
    -\n\
    -input (stdin):\n\
    -    optional interior point: dimension, 1, coordinates\n\
    -    first lines: dimension+1 and number of halfspaces\n\
    -    other lines: halfspace coefficients followed by offset\n\
    -    comments:    start with a non-numeric character\n\
    -\n\
    -options:\n\
    -    Hn,n - specify coordinates of interior point\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Qc   - keep coplanar halfspaces\n\
    -    Qi   - keep other redundant halfspaces\n\
    -\n\
    -Qhull control options:\n\
    -    QJn  - randomly joggle input in range [-n,n]\n\
    -%s%s%s%s";  /* split up qh_prompt for Visual C++ */
    -char qh_promptb[]= "\
    -    Qbk:0Bk:0 - remove k-th coordinate from input\n\
    -    Qs   - search all halfspaces for the initial simplex\n\
    -    QGn  - print intersection if visible to halfspace n, -n for not\n\
    -    QVn  - print intersections for halfspace n, -n if not\n\
    -\n\
    -";
    -char qh_promptc[]= "\
    -Trace options:\n\
    -    T4   - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
    -    Tc   - check frequently during execution\n\
    -    Ts   - print statistics\n\
    -    Tv   - verify result: structure, convexity, and redundancy\n\
    -    Tz   - send all output to stdout\n\
    -    TFn  - report summary when n or more facets created\n\
    -    TI file - input data from file, no spaces or single quotes\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -    TPn  - turn on tracing when halfspace n added to intersection\n\
    -    TMn  - turn on tracing at merge n\n\
    -    TWn  - trace merge facets when width > n\n\
    -    TVn  - stop qhull after adding halfspace n, -n for before (see TCn)\n\
    -    TCn  - stop qhull after building cone for halfspace n (see TVn)\n\
    -\n\
    -Precision options:\n\
    -    Cn   - radius of centrum (roundoff added).  Merge facets if non-convex\n\
    -     An  - cosine of maximum angle.  Merge facets if cosine > n or non-convex\n\
    -           C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
    -    Rn   - randomly perturb computations by a factor of [1-n,1+n]\n\
    -    Un   - max distance below plane for a new, coplanar halfspace\n\
    -    Wn   - min facet width for outside halfspace (before roundoff)\n\
    -\n\
    -Output formats (may be combined; if none, produces a summary to stdout):\n\
    -    f    - facet dump\n\
    -    G    - Geomview output (dual convex hull)\n\
    -    i    - non-redundant halfspaces incident to each intersection\n\
    -    m    - Mathematica output (dual convex hull)\n\
    -    o    - OFF format (dual convex hull: dimension, points, and facets)\n\
    -    p    - vertex coordinates of dual convex hull (coplanars if 'Qc' or 'Qi')\n\
    -    s    - summary (stderr)\n\
    -\n\
    -";
    -char qh_promptd[]= "\
    -More formats:\n\
    -    Fc   - count plus redundant halfspaces for each intersection\n\
    -         -   Qc (default) for coplanar and Qi for other redundant\n\
    -    Fd   - use cdd format for input (homogeneous with offset first)\n\
    -    FF   - facet dump without ridges\n\
    -    FI   - ID of each intersection\n\
    -    Fm   - merge count for each intersection (511 max)\n\
    -    FM   - Maple output (dual convex hull)\n\
    -    Fn   - count plus neighboring intersections for each intersection\n\
    -    FN   - count plus intersections for each non-redundant halfspace\n\
    -    FO   - options and precision constants\n\
    -    Fp   - dim, count, and intersection coordinates\n\
    -    FP   - nearest halfspace and distance for each redundant halfspace\n\
    -    FQ   - command used for qhalf\n\
    -    Fs   - summary: #int (8), dim, #halfspaces, #non-redundant, #intersections\n\
    -                      for output: #non-redundant, #intersections, #coplanar\n\
    -                                  halfspaces, #non-simplicial intersections\n\
    -                    #real (2), max outer plane, min vertex\n\
    -    Fv   - count plus non-redundant halfspaces for each intersection\n\
    -    Fx   - non-redundant halfspaces\n\
    -\n\
    -";
    -char qh_prompte[]= "\
    -Geomview output (2-d, 3-d and 4-d; dual convex hull)\n\
    -    Ga   - all points (i.e., transformed halfspaces) as dots\n\
    -     Gp  -  coplanar points and vertices as radii\n\
    -     Gv  -  vertices (i.e., non-redundant halfspaces) as spheres\n\
    -    Gi   - inner planes (i.e., halfspace intersections) only\n\
    -     Gn  -  no planes\n\
    -     Go  -  outer planes only\n\
    -    Gc   - centrums\n\
    -    Gh   - hyperplane intersections\n\
    -    Gr   - ridges\n\
    -    GDn  - drop dimension n in 3-d and 4-d output\n\
    -\n\
    -Print options:\n\
    -    PAn  - keep n largest facets (i.e., intersections) by area\n\
    -    Pdk:n- drop facet if normal[k] <= n (default 0.0)\n\
    -    PDk:n- drop facet if normal[k] >= n\n\
    -    Pg   - print good facets (needs 'QGn' or 'QVn')\n\
    -    PFn  - keep facets whose area is at least n\n\
    -    PG   - print neighbors of good facets\n\
    -    PMn  - keep n facets with most merges\n\
    -    Po   - force output.  If error, output neighborhood of facet\n\
    -    Pp   - do not report precision problems\n\
    -\n\
    -    .    - list of all options\n\
    -    -    - one line descriptions of all options\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt2
    -    synopsis for qhull
    -*/
    -char qh_prompt2[]= "\n\
    -qhalf- halfspace intersection about a point.  Qhull %s\n\
    -    input (stdin): [dim, 1, interior point], dim+1, n, coefficients+offset\n\
    -    comments start with a non-numeric character\n\
    -\n\
    -options (qhalf.htm):\n\
    -    Hn,n - specify coordinates of interior point\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Tv   - verify result: structure, convexity, and redundancy\n\
    -    .    - concise list of all options\n\
    -    -    - one-line description of all options\n\
    -\n\
    -output options (subset):\n\
    -    s    - summary of results (default)\n\
    -    Fp   - intersection coordinates\n\
    -    Fv   - non-redundant halfspaces incident to each intersection\n\
    -    Fx   - non-redundant halfspaces\n\
    -    o    - OFF file format (dual convex hull)\n\
    -    G    - Geomview output (dual convex hull)\n\
    -    m    - Mathematica output (dual convex hull)\n\
    -    QVn  - print intersections for halfspace n, -n if not\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -\n\
    -examples:\n\
    -    rbox d | qconvex FQ n | qhalf s H0,0,0 Fp\n\
    -    rbox c | qconvex FQ FV n | qhalf s i\n\
    -    rbox c | qconvex FQ FV n | qhalf s o\n\
    -\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt3
    -    concise prompt for qhull
    -*/
    -char qh_prompt3[]= "\n\
    -Qhull %s.\n\
    -Except for 'F.' and 'PG', upper_case options take an argument.\n\
    -\n\
    - incidences     Geomview       mathematica    OFF_format     point_dual\n\
    - summary        facet_dump\n\
    -\n\
    - Fc_redundant   Fd_cdd_in      FF_dump_xridge FIDs           Fmerges\n\
    - Fneighbors     FN_intersect   FOptions       Fp_coordinates FP_nearest\n\
    - FQhalf         Fsummary       Fv_halfspace   FMaple         Fx_non_redundant\n\
    -\n\
    - Gvertices      Gpoints        Gall_points    Gno_planes     Ginner\n\
    - Gcentrums      Ghyperplanes   Gridges        Gouter         GDrop_dim\n\
    -\n\
    - PArea_keep     Pdrop d0:0D0   Pgood          PFacet_area_keep\n\
    - PGood_neighbors PMerge_keep   Poutput_forced Pprecision_not\n\
    -\n\
    - Qbk:0Bk:0_drop Qcoplanar      QG_half_good   Qi_redundant   QJoggle\n\
    - Qsearch_1st    Qtriangulate   QVertex_good\n\
    -\n\
    - T4_trace       Tcheck_often   Tstatistics    Tverify        Tz_stdout\n\
    - TFacet_log     TInput_file    TPoint_trace   TMerge_trace   TOutput_file\n\
    - TWide_trace    TVertex_stop   TCone_stop\n\
    -\n\
    - Angle_max      Centrum_size   Random_dist    Ucoplanar_max  Wide_outside\n\
    -";
    -
    -/*---------------------------------
    -
    -  main( argc, argv )
    -    processes the command line, calls qhull() to do the work, and exits
    -
    -  design:
    -    initializes data structures
    -    reads points
    -    finishes initialization
    -    computes convex hull and other structures
    -    checks the result
    -    writes the output
    -    frees memory
    -*/
    -int main(int argc, char *argv[]) {
    -  int curlong, totlong; /* used !qh_NOmem */
    -  int exitcode, numpoints, dim;
    -  coordT *points;
    -  boolT ismalloc;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= false;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if ((argc == 1) && isatty( 0 /*stdin*/)) {
    -    fprintf(stdout, qh_prompt2, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompta, qh_version,
    -        qh_promptb, qh_promptc, qh_promptd, qh_prompte);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompt3, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  qh_init_A(stdin, stdout, stderr, argc, argv);  /* sets qh qhull_command */
    -  exitcode= setjmp(qh errexit); /* simple statement for CRAY J916 */
    -  if (!exitcode) {
    -    qh_option("Halfspace", NULL, NULL);
    -    qh HALFspace= True;    /* 'H'   */
    -    qh_checkflags(qh qhull_command, hidden_options);
    -    qh_initflags(qh qhull_command);
    -    if (qh SCALEinput) {
    -      fprintf(qh ferr, "\
    -qhull error: options 'Qbk:n' and 'QBk:n' are not used with qhalf.\n\
    -             Use 'Qbk:0Bk:0 to drop dimension k.\n");
    -      qh_errexit(qh_ERRinput, NULL, NULL);
    -    }
    -    points= qh_readpoints(&numpoints, &dim, &ismalloc);
    -    if (dim >= 5) {
    -      qh_option("Qxact_merge", NULL, NULL);
    -      qh MERGEexact= True; /* 'Qx' always */
    -    }
    -    qh_init_B(points, numpoints, dim, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();
    -    if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -    exitcode= qh_ERRnone;
    -  }
    -  qh NOerrexit= True;  /* no more setjmp */
    -#ifdef qh_NOmem
    -  qh_freeqhull( True);
    -#else
    -  qh_freeqhull( False);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -       totlong, curlong);
    -#endif
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.pro
    deleted file mode 100644
    index ebad387893..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhalf/qhalf.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# qhalf.pro -- Qt project file for qconvex.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = qhalf
    -
    -SOURCES += qhalf.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-all.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-all.pro
    deleted file mode 100644
    index 5d9b08a625..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-all.pro
    +++ /dev/null
    @@ -1,76 +0,0 @@
    -# -------------------------------------------------
    -# qhull-all.pro -- Qt project to build executables and static libraries
    -#
    -# To build with Qt on mingw
    -#   Download Qt SDK, install Perl
    -#   /c/qt/2010.05/qt> ./configure -static -platform win32-g++ -fast -no-qt3support
    -#
    -# To build DevStudio sln and proj files (Qhull ships with cmake derived files)
    -# qmake is in Qt's bin directory
    -# ../build> qmake -tp vc -r ../src/qhull-all.pro
    -# Need to add Build Dependencies, disable rtti, rename targets to qhull.dll, qhull6_p.dll and qhull6_pd.dll
    -# -------------------------------------------------
    -
    -TEMPLATE = subdirs
    -CONFIG += ordered
    -
    -SUBDIRS += libqhull        #shared library
    -SUBDIRS += libqhullp       #shared library with qh_QHpointer (libqhull/user.h)
    -SUBDIRS += user_eg         #user program linked to libqhull6_p (libqhullp)
    -
    -SUBDIRS += libqhullstatic  #static library
    -SUBDIRS += libqhullstaticp #static library with qh_QHpointer
    -SUBDIRS += qhull           #qhull programs linked to libqhullstatic
    -SUBDIRS += qconvex
    -SUBDIRS += qdelaunay
    -SUBDIRS += qhalf
    -SUBDIRS += qvoronoi
    -SUBDIRS += rbox
    -SUBDIRS += user_eg2        #user program linked to libqhull
    -SUBDIRS += testqset        #test program for qset.c with mem.c
    -
    -SUBDIRS += libqhullcpp     #static library for C++ interface with libqhullstaticp
    -SUBDIRS += user_eg3        #user program with libqhullcpp and libqhullstaticp
    -SUBDIRS += qhulltest       #test program with Qt, libqhullcpp, and libqhullstaticp
    -
    -OTHER_FILES += Changes.txt
    -OTHER_FILES += CMakeLists.txt
    -OTHER_FILES += Make-config.sh
    -OTHER_FILES += ../Announce.txt
    -OTHER_FILES += ../CMakeLists.txt
    -OTHER_FILES += ../COPYING.txt
    -OTHER_FILES += ../File_id.diz
    -OTHER_FILES += ../index.htm
    -OTHER_FILES += ../Makefile
    -OTHER_FILES += ../README.txt
    -OTHER_FILES += ../REGISTER.txt
    -OTHER_FILES += ../eg/q_eg
    -OTHER_FILES += ../eg/q_egtest
    -OTHER_FILES += ../eg/q_test
    -OTHER_FILES += ../html/index.htm
    -OTHER_FILES += ../html/qconvex.htm
    -OTHER_FILES += ../html/qdelau_f.htm
    -OTHER_FILES += ../html/qdelaun.htm
    -OTHER_FILES += ../html/qhalf.htm
    -OTHER_FILES += ../html/qh-code.htm
    -OTHER_FILES += ../html/qh-eg.htm
    -OTHER_FILES += ../html/qh-faq.htm
    -OTHER_FILES += ../html/qh-get.htm
    -OTHER_FILES += ../html/qh-impre.htm
    -OTHER_FILES += ../html/qh-optc.htm
    -OTHER_FILES += ../html/qh-optf.htm
    -OTHER_FILES += ../html/qh-optg.htm
    -OTHER_FILES += ../html/qh-opto.htm
    -OTHER_FILES += ../html/qh-optp.htm
    -OTHER_FILES += ../html/qh-optq.htm
    -OTHER_FILES += ../html/qh-optt.htm
    -OTHER_FILES += ../html/qh-quick.htm
    -OTHER_FILES += ../html/qhull.htm
    -OTHER_FILES += ../html/qhull.man
    -OTHER_FILES += ../html/qhull.txt
    -OTHER_FILES += ../html/qhull-cpp.xml
    -OTHER_FILES += ../html/qvoron_f.htm
    -OTHER_FILES += ../html/qvoronoi.htm
    -OTHER_FILES += ../html/rbox.htm
    -OTHER_FILES += ../html/rbox.man
    -OTHER_FILES += ../html/rbox.txt
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-c.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-c.pri
    deleted file mode 100644
    index 20b064f7de..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-c.pri
    +++ /dev/null
    @@ -1,24 +0,0 @@
    -# -------------------------------------------------
    -# qhull-app-c.pri -- Qt include project for C qhull applications linked to libqhull
    -# -------------------------------------------------
    -
    -include(qhull-warn.pri)
    -
    -DESTDIR = ../../bin
    -TEMPLATE = app
    -CONFIG += console warn_on
    -CONFIG -= qt
    -
    -LIBS += -L../../lib
    -build_pass:CONFIG(debug, debug|release){
    -   LIBS += -lqhullstatic_d
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release){
    -   LIBS += -lqhullstatic
    -   OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -
    -INCLUDEPATH += ../libqhull
    -CONFIG += qhull_warn_conversion
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-cpp.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-cpp.pri
    deleted file mode 100644
    index 953cba4000..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-cpp.pri
    +++ /dev/null
    @@ -1,26 +0,0 @@
    -# -------------------------------------------------
    -# qhull-app-cpp.pri -- Qt include project for static CPP qhull applications using Qt
    -# -------------------------------------------------
    -
    -include(qhull-warn.pri)
    -
    -DESTDIR = ../../bin
    -TEMPLATE = app
    -CONFIG += console warn_on
    -CONFIG -= rtti
    -LIBS += -L../../lib
    -build_pass:CONFIG(debug, debug|release){
    -   LIBS += -lqhullcpp_d
    -   LIBS += -lqhullstatic_pd  # Must be last, otherwise qh_fprintf,etc. are loaded from here instead of qhullcpp-d.lib
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release){
    -   LIBS += -lqhullcpp
    -   LIBS += -lqhullstatic_p  # Must be last, otherwise qh_fprintf,etc. are loaded from here instead of qhullcpp.lib
    -   OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -
    -DEFINES += qh_QHpointer # libqhull/user.h
    -
    -INCLUDEPATH += ../libqhullcpp
    -INCLUDEPATH += ../../src # "libqhull/qhull_a.h"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-shared.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-shared.pri
    deleted file mode 100644
    index 0c8a191b12..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-shared.pri
    +++ /dev/null
    @@ -1,27 +0,0 @@
    -# -------------------------------------------------
    -# qhull-app-shared.pri -- Qt include project for C qhull applications linked with libqhull (shared library)
    -# -------------------------------------------------
    -
    -include(qhull-warn.pri)
    -
    -DESTDIR = ../../bin
    -TEMPLATE = app
    -CONFIG += console warn_on
    -CONFIG -= qt
    -
    -LIBS += -L../../lib
    -build_pass:CONFIG(debug, debug|release){
    -   LIBS += -lqhull_d
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release){
    -   LIBS += -lqhull
    -   OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -
    -win32-msvc* : DEFINES += qh_dllimport # libqhull/user.h
    -
    -INCLUDEPATH += ../libqhull
    -CONFIG += qhull_warn_conversion
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-sharedp.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-sharedp.pri
    deleted file mode 100644
    index 3d0bbacaa3..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-app-sharedp.pri
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -# -------------------------------------------------
    -# qhull-app-sharedp.pri -- Qt include project for C qhull applications linked with libqhull6_p 
    -#   Compile code with -Dqh_QHpointer 
    -# -------------------------------------------------
    -
    -include(qhull-warn.pri)
    -
    -DESTDIR = ../../bin
    -TEMPLATE = app
    -CONFIG += console warn_on
    -CONFIG -= qt
    -
    -LIBS += -L../../lib
    -build_pass:CONFIG(debug, debug|release){
    -   LIBS += -lqhull_pd
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release){
    -   LIBS += -lqhull_p
    -   OBJECTS_DIR = Release
    -}
    -win32-msvc* : QMAKE_LFLAGS += /INCREMENTAL:NO
    -
    -DEFINES += qh_QHpointer # libqhull/user.h
    -win32-msvc* : DEFINES += qh_QHpointer_dllimport # libqhull/user.h
    -
    -INCLUDEPATH += ../libqhull
    -CONFIG += qhull_warn_conversion
    -
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-libqhull-src.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-libqhull-src.pri
    deleted file mode 100644
    index cfa19cfba5..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-libqhull-src.pri
    +++ /dev/null
    @@ -1,36 +0,0 @@
    -# -------------------------------------------------
    -# qhull-libqhull-src.pri -- Qt include project for libqhull sources and headers
    -#   libqhull.pro, libqhullp.pro, and libqhulldll.pro are the same for SOURCES and HEADERS
    -# -------------------------------------------------
    -
    -# Order object files by frequency of execution.  Small files at end.
    -# Current directory is caller
    -SOURCES += ../libqhull/global.c
    -SOURCES += ../libqhull/stat.c
    -SOURCES += ../libqhull/geom2.c
    -SOURCES += ../libqhull/poly2.c
    -SOURCES += ../libqhull/merge.c
    -SOURCES += ../libqhull/libqhull.c
    -SOURCES += ../libqhull/geom.c
    -SOURCES += ../libqhull/poly.c
    -SOURCES += ../libqhull/qset.c
    -SOURCES += ../libqhull/mem.c
    -SOURCES += ../libqhull/random.c
    -SOURCES += ../libqhull/usermem.c
    -SOURCES += ../libqhull/userprintf.c
    -SOURCES += ../libqhull/io.c
    -SOURCES += ../libqhull/user.c
    -SOURCES += ../libqhull/rboxlib.c
    -SOURCES += ../libqhull/userprintf_rbox.c
    -
    -HEADERS += ../libqhull/geom.h
    -HEADERS += ../libqhull/io.h
    -HEADERS += ../libqhull/libqhull.h
    -HEADERS += ../libqhull/mem.h
    -HEADERS += ../libqhull/merge.h
    -HEADERS += ../libqhull/poly.h
    -HEADERS += ../libqhull/random.h
    -HEADERS += ../libqhull/qhull_a.h
    -HEADERS += ../libqhull/qset.h
    -HEADERS += ../libqhull/stat.h
    -HEADERS += ../libqhull/user.h
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-warn.pri b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-warn.pri
    deleted file mode 100644
    index 42d6d56d5d..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull-warn.pri
    +++ /dev/null
    @@ -1,57 +0,0 @@
    -# -------------------------------------------------
    -# qhull-warn.pri -- Qt project warnings for warn_on
    -#   CONFIG += qhull_warn_all        # Qhull compiles with all warnings except for qhull_warn_shadow and qhull_warn_conversion
    -#   CONFIG += qhull_warn_conversion # Warn in Qt and Qhull about conversion errors
    -#   CONFIG += qhull_warn_error      # Turn warnings into errors
    -#   CONFIG += qhull_warn_shadow     # Warn in Qt about shadowing of functions and fields
    -# -------------------------------------------------
    -
    -# [apr'11] VERSION works erratically for msvc builds
    -# VERSION = 6.3.1
    -qhull_SOVERSION = 6
    -
    -# Uncomment to report warnings as errors
    -#CONFIG += qhull_warn_error
    -
    -*g++{
    -    qhull_warn_error{
    -        QMAKE_CFLAGS_WARN_ON += -Werror
    -        QMAKE_CXXFLAGS_WARN_ON += -Werror
    -    }
    -
    -    QMAKE_CFLAGS_WARN_ON += -Wcast-qual -Wextra -Wshadow -Wwrite-strings
    -
    -    QMAKE_CXXFLAGS_WARN_ON += -Wcast-qual -Wextra -Wwrite-strings
    -    QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-conversion
    -
    -    qhull_warn_shadow{
    -        QMAKE_CXXFLAGS_WARN_ON += -Wshadow     # Shadowing occurs in Qt, e.g., nested foreach
    -    }
    -
    -    qhull_warn_conversion{
    -        QMAKE_CFLAGS_WARN_ON += -Wno-sign-conversion   # libqhullstatic has many size_t vs. int warnings
    -        QMAKE_CFLAGS_WARN_ON += -Wconversion           # libqhullstatic has no workaround for bit-field conversions
    -        QMAKE_CXXFLAGS_WARN_ON += -Wconversion         # Qt has conversion errors for qbitarray and qpalette
    -    }
    -
    -    qhull_warn_all{
    -        QMAKE_CFLAGS_WARN_ON += -Waddress -Warray-bounds -Wchar-subscripts -Wclobbered -Wcomment -Wempty-body
    -        QMAKE_CFLAGS_WARN_ON += -Wformat -Wignored-qualifiers -Wimplicit-function-declaration -Wimplicit-int
    -        QMAKE_CFLAGS_WARN_ON += -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-parameter-type
    -        QMAKE_CFLAGS_WARN_ON += -Wnonnull -Wold-style-declaration -Woverride-init -Wparentheses
    -        QMAKE_CFLAGS_WARN_ON += -Wpointer-sign -Wreturn-type -Wsequence-point -Wsign-compare
    -        QMAKE_CFLAGS_WARN_ON += -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch
    -        QMAKE_CFLAGS_WARN_ON += -Wtrigraphs -Wtype-limits -Wuninitialized -Wuninitialized
    -        QMAKE_CFLAGS_WARN_ON += -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-parameter
    -        QMAKE_CFLAGS_WARN_ON += -Wunused-value -Wunused-variable -Wvolatile-register-var
    -
    -        QMAKE_CXXFLAGS_WARN_ON += -Waddress -Warray-bounds -Wc++0x-compat -Wchar-subscripts
    -        QMAKE_CXXFLAGS_WARN_ON += -Wclobbered -Wcomment -Wempty-body -Wenum-compare
    -        QMAKE_CXXFLAGS_WARN_ON += -Wformat -Wignored-qualifiers -Wmain -Wmissing-braces
    -        QMAKE_CXXFLAGS_WARN_ON += -Wmissing-field-initializers -Wparentheses -Wreorder -Wreturn-type
    -        QMAKE_CXXFLAGS_WARN_ON += -Wsequence-point -Wsign-compare -Wsign-compare -Wstrict-aliasing
    -        QMAKE_CXXFLAGS_WARN_ON += -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wtype-limits
    -        QMAKE_CXXFLAGS_WARN_ON += -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label
    -        QMAKE_CXXFLAGS_WARN_ON += -Wunused-parameter -Wunused-value -Wunused-variable -Wvolatile-register-var
    -    }
    -}
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/qhull.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/qhull.pro
    deleted file mode 100644
    index e70d1463f8..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/qhull.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# qhull.pro -- Qt project file for qhull.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = qhull
    -
    -SOURCES += unix.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/unix.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/unix.c
    deleted file mode 100644
    index 551c59a0d1..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhull/unix.c
    +++ /dev/null
    @@ -1,382 +0,0 @@
    -/*
      ---------------------------------
    -
    -   unix.c
    -     command line interface to qhull
    -         includes SIOUX interface for Macintoshes
    -
    -   see qh-qhull.htm
    -
    -   Copyright (c) 1993-2012 The Geometry Center.
    -   $Id: //main/2011/qhull/src/qhull/unix.c#5 $$Change: 1464 $
    -   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -*/
    -
    -#include "mem.h"
    -#include "qset.h"
    -#include "libqhull.h"
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#elif __cplusplus
    -extern "C" {
    -  int isatty(int);
    -}
    -
    -#elif _MSC_VER
    -#include 
    -#define isatty _isatty
    -int _isatty(int);
    -
    -#else
    -int isatty(int);  /* returns 1 if stdin is a tty
    -                   if "Undefined symbol" this can be deleted along with call in main() */
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_prompt
    -    long prompt for qhull
    -
    -  see:
    -    concise prompt below
    -*/
    -char qh_prompta[]= "\n\
    -qhull- compute convex hulls and related structures.\n\
    -    http://www.qhull.org  %s\n\
    -\n\
    -input (stdin):\n\
    -    first lines: dimension and number of points (or vice-versa).\n\
    -    other lines: point coordinates, best if one point per line\n\
    -    comments:    start with a non-numeric character\n\
    -    halfspaces:  use dim plus one and put offset after coefficients.\n\
    -                 May be preceeded by a single interior point ('H').\n\
    -\n\
    -options:\n\
    -    d    - Delaunay triangulation by lifting points to a paraboloid\n\
    -    d Qu - furthest-site Delaunay triangulation (upper convex hull)\n\
    -    v    - Voronoi diagram (dual of the Delaunay triangulation)\n\
    -    v Qu - furthest-site Voronoi diagram\n\
    -    Hn,n,... - halfspace intersection about point [n,n,0,...]\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Qc   - keep coplanar points with nearest facet\n\
    -    Qi   - keep interior points with nearest facet\n\
    -\n\
    -Qhull control options:\n\
    -    Qbk:n   - scale coord k so that low bound is n\n\
    -      QBk:n - scale coord k so that upper bound is n (QBk is %2.2g)\n\
    -    QbB  - scale input to unit cube centered at the origin\n\
    -    Qbb  - scale last coordinate to [0,m] for Delaunay triangulations\n\
    -    Qbk:0Bk:0 - remove k-th coordinate from input\n\
    -    QJn  - randomly joggle input in range [-n,n]\n\
    -    QRn  - random rotation (n=seed, n=0 time, n=-1 time/no rotate)\n\
    -%s%s%s%s";  /* split up qh_prompt for Visual C++ */
    -char qh_promptb[]= "\
    -    Qf   - partition point to furthest outside facet\n\
    -    Qg   - only build good facets (needs 'QGn', 'QVn', or 'PdD')\n\
    -    Qm   - only process points that would increase max_outside\n\
    -    Qr   - process random outside points instead of furthest ones\n\
    -    Qs   - search all points for the initial simplex\n\
    -    Qu   - for 'd' or 'v', compute upper hull without point at-infinity\n\
    -              returns furthest-site Delaunay triangulation\n\
    -    Qv   - test vertex neighbors for convexity\n\
    -    Qx   - exact pre-merges (skips coplanar and angle-coplanar facets)\n\
    -    Qz   - add point-at-infinity to Delaunay triangulation\n\
    -    QGn  - good facet if visible from point n, -n for not visible\n\
    -    QVn  - good facet if it includes point n, -n if not\n\
    -    Q0   - turn off default premerge with 'C-0'/'Qx'\n\
    -    Q1     - sort merges by type instead of angle\n\
    -    Q2   - merge all non-convex at once instead of independent sets\n\
    -    Q3   - do not merge redundant vertices\n\
    -    Q4   - avoid old->new merges\n\
    -    Q5   - do not correct outer planes at end of qhull\n\
    -    Q6   - do not pre-merge concave or coplanar facets\n\
    -    Q7   - depth-first processing instead of breadth-first\n\
    -    Q8   - do not process near-inside points\n\
    -    Q9   - process furthest of furthest points\n\
    -    Q10  - no special processing for narrow distributions\n\
    -    Q11  - copy normals and recompute centrums for tricoplanar facets\n\
    -\n\
    -";
    -char qh_promptc[]= "\
    -Topts- Trace options:\n\
    -    T4   - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
    -    Ta   - annotate output with message codes\n\
    -    Tc   - check frequently during execution\n\
    -    Ts   - print statistics\n\
    -    Tv   - verify result: structure, convexity, and point inclusion\n\
    -    Tz   - send all output to stdout\n\
    -    TFn  - report summary when n or more facets created\n\
    -    TI file - input data from file, no spaces or single quotes\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -    TPn  - turn on tracing when point n added to hull\n\
    -     TMn - turn on tracing at merge n\n\
    -     TWn - trace merge facets when width > n\n\
    -    TRn  - rerun qhull n times.  Use with 'QJn'\n\
    -    TVn  - stop qhull after adding point n, -n for before (see TCn)\n\
    -     TCn - stop qhull after building cone for point n (see TVn)\n\
    -\n\
    -Precision options:\n\
    -    Cn   - radius of centrum (roundoff added).  Merge facets if non-convex\n\
    -     An  - cosine of maximum angle.  Merge facets if cosine > n or non-convex\n\
    -           C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
    -    En   - max roundoff error for distance computation\n\
    -    Rn   - randomly perturb computations by a factor of [1-n,1+n]\n\
    -    Vn   - min distance above plane for a visible facet (default 3C-n or En)\n\
    -    Un   - max distance below plane for a new, coplanar point (default Vn)\n\
    -    Wn   - min facet width for outside point (before roundoff, default 2Vn)\n\
    -\n\
    -Output formats (may be combined; if none, produces a summary to stdout):\n\
    -    f    - facet dump\n\
    -    G    - Geomview output (see below)\n\
    -    i    - vertices incident to each facet\n\
    -    m    - Mathematica output (2-d and 3-d)\n\
    -    o    - OFF format (dim, points and facets; Voronoi regions)\n\
    -    n    - normals with offsets\n\
    -    p    - vertex coordinates or Voronoi vertices (coplanar points if 'Qc')\n\
    -    s    - summary (stderr)\n\
    -\n\
    -";
    -char qh_promptd[]= "\
    -More formats:\n\
    -    Fa   - area for each facet\n\
    -    FA   - compute total area and volume for option 's'\n\
    -    Fc   - count plus coplanar points for each facet\n\
    -           use 'Qc' (default) for coplanar and 'Qi' for interior\n\
    -    FC   - centrum or Voronoi center for each facet\n\
    -    Fd   - use cdd format for input (homogeneous with offset first)\n\
    -    FD   - use cdd format for numeric output (offset first)\n\
    -    FF   - facet dump without ridges\n\
    -    Fi   - inner plane for each facet\n\
    -           for 'v', separating hyperplanes for bounded Voronoi regions\n\
    -    FI   - ID of each facet\n\
    -    Fm   - merge count for each facet (511 max)\n\
    -    FM   - Maple output (2-d and 3-d)\n\
    -    Fn   - count plus neighboring facets for each facet\n\
    -    FN   - count plus neighboring facets for each point\n\
    -    Fo   - outer plane (or max_outside) for each facet\n\
    -           for 'v', separating hyperplanes for unbounded Voronoi regions\n\
    -    FO   - options and precision constants\n\
    -    Fp   - dim, count, and intersection coordinates (halfspace only)\n\
    -    FP   - nearest vertex and distance for each coplanar point\n\
    -    FQ   - command used for qhull\n\
    -    Fs   - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
    -                      output: #vertices, #facets, #coplanars, #nonsimplicial\n\
    -                    #real (2), max outer plane, min vertex\n\
    -    FS   - sizes:   #int (0)\n\
    -                    #real (2) tot area, tot volume\n\
    -    Ft   - triangulation with centrums for non-simplicial facets (OFF format)\n\
    -    Fv   - count plus vertices for each facet\n\
    -           for 'v', Voronoi diagram as Voronoi vertices for pairs of sites\n\
    -    FV   - average of vertices (a feasible point for 'H')\n\
    -    Fx   - extreme points (in order for 2-d)\n\
    -\n\
    -";
    -char qh_prompte[]= "\
    -Geomview options (2-d, 3-d, and 4-d; 2-d Voronoi)\n\
    -    Ga   - all points as dots\n\
    -     Gp  -  coplanar points and vertices as radii\n\
    -     Gv  -  vertices as spheres\n\
    -    Gi   - inner planes only\n\
    -     Gn  -  no planes\n\
    -     Go  -  outer planes only\n\
    -    Gc   - centrums\n\
    -    Gh   - hyperplane intersections\n\
    -    Gr   - ridges\n\
    -    GDn  - drop dimension n in 3-d and 4-d output\n\
    -    Gt   - for 3-d 'd', transparent outer ridges\n\
    -\n\
    -Print options:\n\
    -    PAn  - keep n largest facets by area\n\
    -    Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
    -    PDk:n - drop facet if normal[k] >= n\n\
    -    Pg   - print good facets (needs 'QGn' or 'QVn')\n\
    -    PFn  - keep facets whose area is at least n\n\
    -    PG   - print neighbors of good facets\n\
    -    PMn  - keep n facets with most merges\n\
    -    Po   - force output.  If error, output neighborhood of facet\n\
    -    Pp   - do not report precision problems\n\
    -\n\
    -    .    - list of all options\n\
    -    -    - one line descriptions of all options\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt2
    -    synopsis for qhull
    -*/
    -char qh_prompt2[]= "\n\
    -qhull- compute convex hulls and related structures.  Qhull %s\n\
    -    input (stdin): dimension, n, point coordinates\n\
    -    comments start with a non-numeric character\n\
    -    halfspace: use dim+1 and put offsets after coefficients\n\
    -\n\
    -options (qh-quick.htm):\n\
    -    d    - Delaunay triangulation by lifting points to a paraboloid\n\
    -    d Qu - furthest-site Delaunay triangulation (upper convex hull)\n\
    -    v    - Voronoi diagram as the dual of the Delaunay triangulation\n\
    -    v Qu - furthest-site Voronoi diagram\n\
    -    H1,1 - Halfspace intersection about [1,1,0,...] via polar duality\n\
    -    Qt   - triangulated output\n\
    -    QJ   - joggled input instead of merged facets\n\
    -    Tv   - verify result: structure, convexity, and point inclusion\n\
    -    .    - concise list of all options\n\
    -    -    - one-line description of each option\n\
    -\n\
    -Output options (subset):\n\
    -    s    - summary of results (default)\n\
    -    i    - vertices incident to each facet\n\
    -    n    - normals with offsets\n\
    -    p    - vertex coordinates (if 'Qc', includes coplanar points)\n\
    -           if 'v', Voronoi vertices\n\
    -    Fp   - halfspace intersections\n\
    -    Fx   - extreme points (convex hull vertices)\n\
    -    FA   - compute total area and volume\n\
    -    o    - OFF format (if 'v', outputs Voronoi regions)\n\
    -    G    - Geomview output (2-d, 3-d and 4-d)\n\
    -    m    - Mathematica output (2-d and 3-d)\n\
    -    QVn  - print facets that include point n, -n if not\n\
    -    TO file- output results to file, may be enclosed in single quotes\n\
    -\n\
    -examples:\n\
    -    rbox c d D2 | qhull Qc s f Fx | more      rbox 1000 s | qhull Tv s FA\n\
    -    rbox 10 D2 | qhull d QJ s i TO result     rbox 10 D2 | qhull v Qbb Qt p\n\
    -    rbox 10 D2 | qhull d Qu QJ m              rbox 10 D2 | qhull v Qu QJ o\n\
    -    rbox c | qhull n                          rbox c | qhull FV n | qhull H Fp\n\
    -    rbox d D12 | qhull QR0 FA                 rbox c D7 | qhull FA TF1000\n\
    -    rbox y 1000 W0 | qhull                    rbox 10 | qhull v QJ o Fv\n\
    -\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt3
    -    concise prompt for qhull
    -*/
    -char qh_prompt3[]= "\n\
    -Qhull %s.\n\
    -Except for 'F.' and 'PG', upper-case options take an argument.\n\
    -\n\
    - delaunay       voronoi        Geomview       Halfspace      facet_dump\n\
    - incidences     mathematica    normals        OFF_format     points\n\
    - summary\n\
    -\n\
    - Farea          FArea-total    Fcoplanars     FCentrums      Fd-cdd-in\n\
    - FD-cdd-out     FF-dump-xridge Finner         FIDs           Fmerges\n\
    - Fneighbors     FNeigh-vertex  Fouter         FOptions       Fpoint-intersect\n\
    - FPoint_near    FQhull         Fsummary       FSize          Ftriangles\n\
    - Fvertices      Fvoronoi       FVertex-ave    Fxtremes       FMaple\n\
    -\n\
    - Gvertices      Gpoints        Gall_points    Gno_planes     Ginner\n\
    - Gcentrums      Ghyperplanes   Gridges        Gouter         GDrop_dim\n\
    - Gtransparent\n\
    -\n\
    - PArea-keep     Pdrop d0:0D0   Pgood          PFacet_area_keep\n\
    - PGood_neighbors PMerge-keep   Poutput_forced Pprecision_not\n\
    -\n\
    - QbBound 0:0.5  Qbk:0Bk:0_drop QbB-scale-box  Qbb-scale-last Qcoplanar\n\
    - Qfurthest      Qgood_only     QGood_point    Qinterior      Qmax_out\n\
    - QJoggle        Qrandom        QRotate        Qsearch_1st    Qtriangulate\n\
    - QupperDelaunay QVertex_good   Qvneighbors    Qxact_merge    Qzinfinite\n\
    -\n\
    - Q0_no_premerge Q1_no_angle    Q2_no_independ Q3_no_redundant Q4_no_old\n\
    - Q5_no_check_out Q6_no_concave Q7_depth_first Q8_no_near_in  Q9_pick_furthest\n\
    - Q10_no_narrow  Q11_trinormals\n\
    -\n\
    - T4_trace       Tannotate      Tcheck_often   Tstatistics    Tverify\n\
    - Tz_stdout      TFacet_log     TInput_file    TPoint_trace   TMerge_trace\n\
    - TOutput_file   TRerun         TWide_trace    TVertex_stop   TCone_stop\n\
    -\n\
    - Angle_max      Centrum_size   Error_round    Random_dist    Visible_min\n\
    - Ucoplanar_max  Wide_outside\n\
    -";
    -
    -/*---------------------------------
    -
    -  main( argc, argv )
    -    processes the command line, calls qhull() to do the work, and exits
    -
    -  design:
    -    initializes data structures
    -    reads points
    -    finishes initialization
    -    computes convex hull and other structures
    -    checks the result
    -    writes the output
    -    frees memory
    -*/
    -int main(int argc, char *argv[]) {
    -  int curlong, totlong; /* used !qh_NOmem */
    -  int exitcode, numpoints, dim;
    -  coordT *points;
    -  boolT ismalloc;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= false;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if ((argc == 1) && isatty( 0 /*stdin*/)) {
    -    fprintf(stdout, qh_prompt2, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompta, qh_version, qh_DEFAULTbox,
    -                qh_promptb, qh_promptc, qh_promptd, qh_prompte);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompt3, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  qh_init_A(stdin, stdout, stderr, argc, argv);  /* sets qh qhull_command */
    -  exitcode= setjmp(qh errexit); /* simple statement for CRAY J916 */
    -  if (!exitcode) {
    -    qh_initflags(qh qhull_command);
    -    points= qh_readpoints(&numpoints, &dim, &ismalloc);
    -    qh_init_B(points, numpoints, dim, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();
    -    if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -    exitcode= qh_ERRnone;
    -  }
    -  qh NOerrexit= True;  /* no more setjmp */
    -#ifdef qh_NOmem
    -  qh_freeqhull( True);
    -#else
    -  qh_freeqhull( False);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -       totlong, curlong);
    -#endif
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Coordinates_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Coordinates_test.cpp
    deleted file mode 100644
    index e483ecd91a..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Coordinates_test.cpp
    +++ /dev/null
    @@ -1,534 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/Coordinates_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "Coordinates.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class Coordinates_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void t_construct();
    -    void t_convert();
    -    void t_element();
    -    void t_readonly();
    -    void t_operator();
    -    void t_const_iterator();
    -    void t_iterator();
    -    void t_coord_iterator();
    -    void t_mutable_coord_iterator();
    -    void t_readwrite();
    -    void t_search();
    -    void t_io();
    -};//Coordinates_test
    -
    -void
    -add_Coordinates_test()
    -{
    -    new Coordinates_test();
    -}
    -
    -void Coordinates_test::
    -t_construct()
    -{
    -    Coordinates c;
    -    QCOMPARE(c.size(), 0U);
    -    QVERIFY(c.isEmpty());
    -    c << 1.0;
    -    QCOMPARE(c.count(), 1);
    -    Coordinates c2(c);
    -    c2 << 2.0;
    -    QCOMPARE(c2.count(), 2);
    -    Coordinates c3;
    -    c3 = c2;
    -    QCOMPARE(c3.count(), 2);
    -    QCOMPARE(c3[0]+c3[1], 3.0);
    -    QVERIFY(c2==c3);
    -    std::vector vc;
    -    vc.push_back(3.0);
    -    vc.push_back(4.0);
    -    Coordinates c4(vc);
    -    QCOMPARE(c4[0]+c4[1], 7.0);
    -    Coordinates c5(c3);
    -    QVERIFY(c5==c3);
    -    c5= vc;
    -    QVERIFY(c5!=c3);
    -    QVERIFY(c5==c4);
    -}//t_construct
    -
    -void Coordinates_test::
    -t_convert()
    -{
    -    Coordinates c;
    -    c << 1.0 << 3.0;
    -    QCOMPARE(c.data()[1], 3.0);
    -    coordT *c2= c.data();
    -    const coordT *c3= c.data();
    -    QCOMPARE(c2, c3);
    -    std::vector vc= c.toStdVector();
    -    QCOMPARE(vc.size(), c.size());
    -    for(size_t k= vc.size(); k--; ){
    -        QCOMPARE(vc[k], c[k]);
    -    }
    -    QList qc= c.toQList();
    -    QCOMPARE(qc.count(), c.count());
    -    for(int k= qc.count(); k--; ){
    -        QCOMPARE(qc[k], c[k]);
    -    }
    -    Coordinates c4;
    -    c4= std::vector(2, 0.0);
    -    QCOMPARE(c4.back(), 0.0);
    -    Coordinates c5(std::vector(2, 0.0));
    -    QCOMPARE(c4.size(), c5.size());
    -    QVERIFY(c4==c5);
    -}//t_convert
    -
    -void Coordinates_test::
    -t_element()
    -{
    -    Coordinates c;
    -    c << 1.0 << -2.0;
    -    c.at(1)= -3;
    -    QCOMPARE(c.at(1), -3.0);
    -    QCOMPARE(c.back(), -3.0);
    -    QCOMPARE(c.front(), 1.0);
    -    c[1]= -2.0;
    -    QCOMPARE(c[1],-2.0);
    -    QCOMPARE(c.first(), 1.0);
    -    c.first()= 2.0;
    -    QCOMPARE(c.first(), 2.0);
    -    QCOMPARE(c.last(), -2.0);
    -    c.last()= 0.0;
    -    QCOMPARE(c.first()+c.last(), 2.0);
    -    coordT *c4= &c.first();
    -    const coordT *c5= &c.first();
    -    QCOMPARE(c4, c5);
    -    coordT *c6= &c.last();
    -    const coordT *c7= &c.last();
    -    QCOMPARE(c6, c7);
    -    Coordinates c2= c.mid(1);
    -    QCOMPARE(c2.count(), 1);
    -    c << 3.0;
    -    Coordinates c3= c.mid(1,1);
    -    QCOMPARE(c2, c3);
    -    QCOMPARE(c3.value(-1, -1.0), -1.0);
    -    QCOMPARE(c3.value(3, 4.0), 4.0);
    -    QCOMPARE(c.value(2, 4.0), 3.0);
    -}//t_element
    -
    -void Coordinates_test::
    -t_readonly()
    -{
    -    Coordinates c;
    -    QCOMPARE(c.size(), 0u);
    -    QCOMPARE(c.count(), 0);
    -    QVERIFY(c.empty());
    -    QVERIFY(c.isEmpty());
    -    c << 1.0 << -2.0;
    -    QCOMPARE(c.size(), 2u);
    -    QCOMPARE(c.count(), 2);
    -    QVERIFY(!c.empty());
    -    QVERIFY(!c.isEmpty());
    -}//t_readonly
    -
    -void Coordinates_test::
    -t_operator()
    -{
    -    Coordinates c;
    -    Coordinates c2(c);
    -    QVERIFY(c==c2);
    -    QVERIFY(!(c!=c2));
    -    c << 1.0;
    -    QVERIFY(!(c==c2));
    -    QVERIFY(c!=c2);
    -    c2 << 1.0;
    -    QVERIFY(c==c2);
    -    QVERIFY(!(c!=c2));
    -    c[0]= 0.0;
    -    QVERIFY(c!=c2);
    -    Coordinates c3= c+c2;
    -    QCOMPARE(c3.count(), 2);
    -    QCOMPARE(c3[0], 0.0);
    -    QCOMPARE(c3[1], 1.0);
    -    c3 += c3;
    -    QCOMPARE(c3.count(), 4);
    -    QCOMPARE(c3[2], 0.0);
    -    QCOMPARE(c3[3], 1.0);
    -    c3 += c2;
    -    QCOMPARE(c3[4], 1.0);
    -    c3 += 5.0;
    -    QCOMPARE(c3.count(), 6);
    -    QCOMPARE(c3[5], 5.0);
    -    // << checked above
    -}//t_operator
    -
    -void Coordinates_test::
    -t_const_iterator()
    -{
    -    Coordinates c;
    -    QCOMPARE(c.begin(), c.end());
    -    // begin and end checked elsewhere
    -    c << 1.0 << 3.0;
    -    Coordinates::const_iterator i= c.begin();
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(i[1], 3.0);
    -    // i[1]= -3.0; // compiler error
    -    // operator-> is not applicable to double
    -    QCOMPARE(*i++, 1.0);
    -    QCOMPARE(*i, 3.0);
    -    QCOMPARE(*i--, 3.0);
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(*(i+1), 3.0);
    -    QCOMPARE(*++i, 3.0);
    -    QCOMPARE(*(i-1), 1.0);
    -    QCOMPARE(*--i, 1.0);
    -    QVERIFY(i==c.begin());
    -    QVERIFY(i==c.constBegin());
    -    QVERIFY(i!=c.end());
    -    QVERIFY(i!=c.constEnd());
    -    QVERIFY(i=c.begin());
    -    QVERIFY(i+1<=c.end());
    -    QVERIFY(i+1>c.begin());
    -    Coordinates::iterator i2= c.begin();
    -    Coordinates::const_iterator i3(i2);
    -    QCOMPARE(*i3, 1.0);
    -    QCOMPARE(i3[1], 3.0);
    -}//t_const_iterator
    -
    -void Coordinates_test::
    -t_iterator()
    -{
    -    Coordinates c;
    -    QCOMPARE(c.begin(), c.end());
    -    // begin and end checked elsewhere
    -    c << 1.0 << 3.0;
    -    Coordinates::iterator i= c.begin();
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(i[1], 3.0);
    -    *i= -1.0;
    -    QCOMPARE(*i, -1.0);
    -    i[1]= -3.0;
    -    QCOMPARE(i[1], -3.0);
    -    *i= 1.0;
    -    // operator-> is not applicable to double
    -    QCOMPARE(*i++, 1.0);
    -    QCOMPARE(*i, -3.0);
    -    *i= 3.0;
    -    QCOMPARE(*i--, 3.0);
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(*(i+1), 3.0);
    -    QCOMPARE(*++i, 3.0);
    -    QCOMPARE(*(i-1), 1.0);
    -    QCOMPARE(*--i, 1.0);
    -    QVERIFY(i==c.begin());
    -    QVERIFY(i==c.constBegin());
    -    QVERIFY(i!=c.end());
    -    QVERIFY(i!=c.constEnd());
    -    QVERIFY(i=c.begin());
    -    QVERIFY(i+1<=c.end());
    -    QVERIFY(i+1>c.begin());
    -}//t_iterator
    -
    -void Coordinates_test::
    -t_coord_iterator()
    -{
    -    Coordinates c;
    -    c << 1.0 << 3.0;
    -    CoordinatesIterator i(c);
    -    CoordinatesIterator i2= c;
    -    QVERIFY(i.findNext(1.0));
    -    QVERIFY(!i.findNext(2.0));
    -    QVERIFY(!i.findNext(3.0));
    -    QVERIFY(i.findPrevious(3.0));
    -    QVERIFY(!i.findPrevious(2.0));
    -    QVERIFY(!i.findPrevious(1.0));
    -    QVERIFY(i2.findNext(3.0));
    -    QVERIFY(i2.findPrevious(3.0));
    -    QVERIFY(i2.findNext(3.0));
    -    QVERIFY(i2.findPrevious(1.0));
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    i2.toFront();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(i.hasPrevious());
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    Coordinates c2;
    -    i2= c2;
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    i2.toBack();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekPrevious(), 3.0);
    -    QCOMPARE(i.previous(), 3.0);
    -    QCOMPARE(i.previous(), 1.0);
    -    QVERIFY(!i.hasPrevious());
    -    QCOMPARE(i.peekNext(), 1.0);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), 1.0);
    -    QCOMPARE(i.peekNext(), 3.0);
    -    QCOMPARE(i.next(), 3.0);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), 1.0);
    -}//t_coord_iterator
    -
    -void Coordinates_test::
    -t_mutable_coord_iterator()
    -{
    -    // Same tests as CoordinatesIterator
    -    Coordinates c;
    -    c << 1.0 << 3.0;
    -    MutableCoordinatesIterator i(c);
    -    MutableCoordinatesIterator i2= c;
    -    QVERIFY(i.findNext(1.0));
    -    QVERIFY(!i.findNext(2.0));
    -    QVERIFY(!i.findNext(3.0));
    -    QVERIFY(i.findPrevious(3.0));
    -    QVERIFY(!i.findPrevious(2.0));
    -    QVERIFY(!i.findPrevious(1.0));
    -    QVERIFY(i2.findNext(3.0));
    -    QVERIFY(i2.findPrevious(3.0));
    -    QVERIFY(i2.findNext(3.0));
    -    QVERIFY(i2.findPrevious(1.0));
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    i2.toFront();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(i.hasPrevious());
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    Coordinates c2;
    -    i2= c2;
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    i2.toBack();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekPrevious(), 3.0);
    -    QCOMPARE(i.peekPrevious(), 3.0);
    -    QCOMPARE(i.previous(), 3.0);
    -    QCOMPARE(i.previous(), 1.0);
    -    QVERIFY(!i.hasPrevious());
    -    QCOMPARE(i.peekNext(), 1.0);
    -    QCOMPARE(i.next(), 1.0);
    -    QCOMPARE(i.peekNext(), 3.0);
    -    QCOMPARE(i.next(), 3.0);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), 1.0);
    -
    -    // Mutable tests
    -    i.toFront();
    -    i.peekNext()= -1.0;
    -    QCOMPARE(i.peekNext(), -1.0);
    -    QCOMPARE((i.next()= 1.0), 1.0);
    -    QCOMPARE(i.peekPrevious(), 1.0);
    -    i.remove();
    -    QCOMPARE(c.count(), 1);
    -    i.remove();
    -    QCOMPARE(c.count(), 1);
    -    QCOMPARE(i.peekNext(), 3.0);
    -    i.insert(1.0);
    -    i.insert(2.0);
    -    QCOMPARE(c.count(), 3);
    -    QCOMPARE(i.peekNext(), 3.0);
    -    QCOMPARE(i.peekPrevious(), 2.0);
    -    i.peekPrevious()= -2.0;
    -    QCOMPARE(i.peekPrevious(), -2.0);
    -    QCOMPARE((i.previous()= 2.0), 2.0);
    -    QCOMPARE(i.peekNext(), 2.0);
    -    i.toBack();
    -    i.remove();
    -    QCOMPARE(c.count(), 3); // unchanged
    -    i.toFront();
    -    i.remove();
    -    QCOMPARE(c.count(), 3); // unchanged
    -    QCOMPARE(i.peekNext(), 1.0);
    -    i.remove();
    -    QCOMPARE(c.count(), 3); // unchanged
    -    i.insert(0.0);
    -    QCOMPARE(c.count(), 4);
    -    QCOMPARE(i.value(), 0.0);
    -    QCOMPARE(i.peekPrevious(), 0.0);
    -    i.setValue(-10.0);
    -    QCOMPARE(c.count(), 4); // unchanged
    -    QCOMPARE(i.peekNext(), 1.0);
    -    QCOMPARE(i.peekPrevious(), -10.0);
    -    i.findNext(1.0);
    -    i.setValue(-1.0);
    -    QCOMPARE(i.peekPrevious(), -1.0);
    -    i.setValue(1.0);
    -    QCOMPARE(i.peekPrevious(), 1.0);
    -    QCOMPARE(i.value(), 1.0);
    -    i.findPrevious(1.0);
    -    i.setValue(-1.0);
    -    QCOMPARE(i.peekNext(), -1.0);
    -    i.toBack();
    -    QCOMPARE(i.previous(), 3.0);
    -    i.setValue(-3.0);
    -    QCOMPARE(i.peekNext(), -3.0);
    -    double d= i.value();
    -    QCOMPARE(d, -3.0);
    -    QCOMPARE(i.previous(), 2.0);
    -}//t_mutable_coord_iterator
    -
    -void Coordinates_test::
    -t_readwrite()
    -{
    -    Coordinates c;
    -    c.clear();
    -    QCOMPARE(c.count(), 0);
    -    c << 1.0 << 3.0;
    -    c.clear();
    -    QCOMPARE(c.count(), 0);
    -    c << 1.0 << 3.0;
    -    c.erase(c.begin(), c.end());
    -    QCOMPARE(c.count(), 0);
    -    c << 1.0 << 0.0;
    -    Coordinates::iterator i= c.erase(c.begin());
    -    QCOMPARE(*i, 0.0);
    -    i= c.insert(c.end(), 1.0);
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(c.count(), 2);
    -    c.pop_back();
    -    QCOMPARE(c.count(), 1);   // 0
    -    QCOMPARE(c[0], 0.0);
    -    c.push_back(2.0);
    -    QCOMPARE(c.count(), 2);
    -    c.append(3.0);
    -    QCOMPARE(c.count(), 3);   // 0, 2, 3
    -    QCOMPARE(c[2], 3.0);
    -    c.insert(0, 4.0);
    -    QCOMPARE(c[0], 4.0);
    -    QCOMPARE(c[3], 3.0);
    -    c.insert(c.count(), 5.0);
    -    QCOMPARE(c.count(), 5);   // 4, 0, 2, 3, 5
    -    QCOMPARE(c[4], 5.0);
    -    c.move(4, 0);
    -    QCOMPARE(c.count(), 5);   // 5, 4, 0, 2, 3
    -    QCOMPARE(c[0], 5.0);
    -    c.pop_front();
    -    QCOMPARE(c.count(), 4);
    -    QCOMPARE(c[0], 4.0);
    -    c.prepend(6.0);
    -    QCOMPARE(c.count(), 5);   // 6, 4, 0, 2, 3
    -    QCOMPARE(c[0], 6.0);
    -    c.push_front(7.0);
    -    QCOMPARE(c.count(), 6);
    -    QCOMPARE(c[0], 7.0);
    -    c.removeAt(1);
    -    QCOMPARE(c.count(), 5);   // 7, 4, 0, 2, 3
    -    QCOMPARE(c[1], 4.0);
    -    c.removeFirst();
    -    QCOMPARE(c.count(), 4);   // 4, 0, 2, 3
    -    QCOMPARE(c[0], 4.0);
    -    c.removeLast();
    -    QCOMPARE(c.count(), 3);
    -    QCOMPARE(c.last(), 2.0);
    -    c.replace(2, 8.0);
    -    QCOMPARE(c.count(), 3);   // 4, 0, 8
    -    QCOMPARE(c[2], 8.0);
    -    c.swap(0, 2);
    -    QCOMPARE(c[2], 4.0);
    -    double d= c.takeAt(2);
    -    QCOMPARE(c.count(), 2);   // 8, 0
    -    QCOMPARE(d, 4.0);
    -    double d2= c.takeFirst();
    -    QCOMPARE(c.count(), 1);   // 0
    -    QCOMPARE(d2, 8.0);
    -    double d3= c.takeLast();
    -    QVERIFY(c.isEmpty()); \
    -    QCOMPARE(d3, 0.0);
    -}//t_readwrite
    -
    -void Coordinates_test::
    -t_search()
    -{
    -    Coordinates c;
    -    c << 1.0 << 3.0 << 1.0;
    -    QVERIFY(c.contains(1.0));
    -    QVERIFY(c.contains(3.0));
    -    QVERIFY(!c.contains(0.0));
    -    QCOMPARE(c.count(1.0), 2);
    -    QCOMPARE(c.count(3.0), 1);
    -    QCOMPARE(c.count(0.0), 0);
    -    QCOMPARE(c.indexOf(1.0), 0);
    -    QCOMPARE(c.indexOf(3.0), 1);
    -    QCOMPARE(c.indexOf(1.0, -1), 2);
    -    QCOMPARE(c.indexOf(3.0, -1), -1);
    -    QCOMPARE(c.indexOf(3.0, -2), 1);
    -    QCOMPARE(c.indexOf(1.0, -3), 0);
    -    QCOMPARE(c.indexOf(1.0, -4), 0);
    -    QCOMPARE(c.indexOf(1.0, 1), 2);
    -    QCOMPARE(c.indexOf(3.0, 2), -1);
    -    QCOMPARE(c.indexOf(1.0, 2), 2);
    -    QCOMPARE(c.indexOf(1.0, 3), -1);
    -    QCOMPARE(c.indexOf(1.0, 4), -1);
    -    QCOMPARE(c.lastIndexOf(1.0), 2);
    -    QCOMPARE(c.lastIndexOf(3.0), 1);
    -    QCOMPARE(c.lastIndexOf(1.0, -1), 2);
    -    QCOMPARE(c.lastIndexOf(3.0, -1), 1);
    -    QCOMPARE(c.lastIndexOf(3.0, -2), 1);
    -    QCOMPARE(c.lastIndexOf(1.0, -3), 0);
    -    QCOMPARE(c.lastIndexOf(1.0, -4), -1);
    -    QCOMPARE(c.lastIndexOf(1.0, 1), 0);
    -    QCOMPARE(c.lastIndexOf(3.0, 2), 1);
    -    QCOMPARE(c.lastIndexOf(1.0, 2), 2);
    -    QCOMPARE(c.lastIndexOf(1.0, 3), 2);
    -    QCOMPARE(c.lastIndexOf(1.0, 4), 2);
    -    c.removeAll(3.0);
    -    QCOMPARE(c.count(), 2);
    -    c.removeAll(4.0);
    -    QCOMPARE(c.count(), 2);
    -    c.removeAll(1.0);
    -    QCOMPARE(c.count(), 0);
    -    c.removeAll(4.0);
    -    QCOMPARE(c.count(), 0);
    -}//t_search
    -
    -void Coordinates_test::
    -t_io()
    -{
    -    Coordinates c;
    -    c << 1.0 << 2.0 << 3.0;
    -    ostringstream os;
    -    os << "Coordinates 1-2-3\n" << c;
    -    cout << os.str();
    -    QString s= QString::fromStdString(os.str());
    -    QCOMPARE(s.count("2"), 2);
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/Coordinates_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/PointCoordinates_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/PointCoordinates_test.cpp
    deleted file mode 100644
    index 1d843d4acd..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/PointCoordinates_test.cpp
    +++ /dev/null
    @@ -1,397 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/PointCoordinates_test.cpp#6 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "PointCoordinates.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -using std::stringstream;
    -
    -namespace orgQhull {
    -
    -class PointCoordinates_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void t_construct();
    -    void t_convert();
    -    void t_getset();
    -    void t_element();
    -    void t_foreach();
    -    void t_search();
    -    void t_modify();
    -    void t_append_points();
    -    void t_coord_iterator();
    -    void t_io();
    -};//PointCoordinates_test
    -
    -void
    -add_PointCoordinates_test()
    -{
    -    new PointCoordinates_test();
    -}
    -
    -void PointCoordinates_test::
    -t_construct()
    -{
    -    PointCoordinates pc;
    -    QCOMPARE(pc.size(), 0U);
    -    QCOMPARE(pc.coordinateCount(), 0);
    -    QCOMPARE(pc.dimension(), 0);
    -    QCOMPARE(pc.coordinates(), (coordT *)0);
    -    QVERIFY(pc.isEmpty());
    -    pc.checkValid();
    -    PointCoordinates pc7(2);
    -    QCOMPARE(pc7.dimension(), 2);
    -    QCOMPARE(pc7.count(), 0);
    -    QVERIFY(pc7.isEmpty());
    -    QVERIFY(pc7.comment().empty());
    -    pc7.checkValid();
    -    PointCoordinates pc2("Test pc2");
    -    QCOMPARE(pc2.count(), 0);
    -    QVERIFY(pc2.isEmpty());
    -    QCOMPARE(pc2.comment(), std::string("Test pc2"));
    -    pc2.checkValid();
    -    PointCoordinates pc3(3, "Test 3-d pc3");
    -    QCOMPARE(pc3.dimension(), 3);
    -    QVERIFY(pc3.isEmpty());
    -    pc3.checkValid();
    -    coordT c[]= { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
    -    PointCoordinates pc4(2, "Test 2-d pc4", 6, c);
    -    QCOMPARE(pc4.dimension(), 2);
    -    QCOMPARE(pc4.count(), 3);
    -    QCOMPARE(pc4.size(), 3u);
    -    QVERIFY(!pc4.isEmpty());
    -    QVERIFY(!pc4.empty());
    -    pc4.checkValid();
    -    QhullPoint p= pc4[2];
    -    QCOMPARE(p[1], 5.0);
    -    // QhullPoint refers to PointCoordinates
    -    p[1] += 1.0;
    -    QCOMPARE(pc4[2][1], 6.0);
    -    PointCoordinates pc5(4, "Test 4-d pc5 with insufficient coordinates", 6, c);
    -    QCOMPARE(pc5.dimension(), 4);
    -    QCOMPARE(pc5.count(), 1);
    -    QCOMPARE(pc5.extraCoordinatesCount(), 2);
    -    QCOMPARE(pc5.extraCoordinates()[1], 5.0);
    -    QVERIFY(!pc5.isEmpty());;
    -    std::vector vc;
    -    vc.push_back(3.0);
    -    vc.push_back(4.0);
    -    vc.push_back(5.0);
    -    vc.push_back(6.0);
    -    vc.push_back(7.0);
    -    vc.push_back(9.0);
    -    pc5.append(2, &vc[3]); // Copy of vc[]
    -    pc5.checkValid();
    -    QhullPoint p5(4, &vc[1]);
    -    QCOMPARE(pc5[1], p5);
    -    PointCoordinates pc6(pc5); // Makes copy of point_coordinates
    -    QCOMPARE(pc6[1], p5);
    -    QVERIFY(pc6==pc5);
    -    QhullPoint p6= pc5[1];  // Refers to pc5.coordinates
    -    pc5[1][0] += 1.0;
    -    QCOMPARE(pc5[1], p6);
    -    QVERIFY(pc5[1]!=p5);
    -    QVERIFY(pc6!=pc5);
    -    pc6= pc5;
    -    QVERIFY(pc6==pc5);
    -    PointCoordinates pc8;
    -    pc6= pc8;
    -    QVERIFY(pc6!=pc5);
    -    QVERIFY(pc6.isEmpty());
    -}//t_construct
    -
    -void PointCoordinates_test::
    -t_convert()
    -{
    -    //defineAs tested above
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates ps(3, "two 3-d points", 6, c);
    -    QCOMPARE(ps.dimension(), 3);
    -    QCOMPARE(ps.size(), 2u);
    -    const coordT *c2= ps.constData();
    -    QVERIFY(c!=c2);
    -    QCOMPARE(c[0], c2[0]);
    -    const coordT *c3= ps.data();
    -    QCOMPARE(c3, c2);
    -    coordT *c4= ps.data();
    -    QCOMPARE(c4, c2);
    -    std::vector vs= ps.toStdVector();
    -    QCOMPARE(vs.size(), 6u);
    -    QCOMPARE(vs[5], 5.0);
    -    QList qs= ps.toQList();
    -    QCOMPARE(qs.size(), 6);
    -    QCOMPARE(qs[5], 5.0);
    -}//t_convert
    -
    -void PointCoordinates_test::
    -t_getset()
    -{
    -    // See t_construct() for test of coordinates, coordinateCount, dimension, empty, isEmpty, ==, !=
    -    // See t_construct() for test of checkValid, comment, setDimension
    -    PointCoordinates pc("Coordinates c");
    -    pc.setComment("New comment");
    -    QCOMPARE(pc.comment(), std::string("New comment"));
    -    pc.checkValid();
    -    pc.makeValid();  // A no-op
    -    pc.checkValid();
    -    Coordinates cs= pc.getCoordinates();
    -    QVERIFY(cs.isEmpty());
    -    PointCoordinates pc2(pc);
    -    pc.setDimension(3);
    -    QVERIFY(pc2!=pc);
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    pc.append(6, c);
    -    pc.checkValid();
    -    pc.makeValid();  // A no-op
    -    QhullPoint p= pc[0];
    -    QCOMPARE(p[2], 2.0);
    -    try{
    -        pc.setDimension(2);
    -        QFAIL("setDimension(2) did not fail for 3-d.");
    -    }catch (const std::exception &e) {
    -        const char *s= e.what();
    -        cout << "INFO   : Caught " << s;
    -    }
    -}//t_getset
    -
    -void PointCoordinates_test::
    -t_element()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates pc(2, "2-d points", 6, c);
    -    QhullPoint p= pc.at(0);
    -    QCOMPARE(p, pc[0]);
    -    QCOMPARE(p, pc.first());
    -    QCOMPARE(p, pc.value(0));
    -    p= pc.back();
    -    QCOMPARE(p, pc[2]);
    -    QCOMPARE(p, pc.last());
    -    QCOMPARE(p, pc.value(2));
    -    QhullPoints ps= pc.mid(1, 2);
    -    QCOMPARE(ps[1], p);
    -}//t_element
    -
    -void PointCoordinates_test::
    -t_foreach()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates pc(2, "2-d points", 6, c);
    -    QhullPoints::Iterator i= pc.begin();
    -    QhullPoint p= pc[0];
    -    QCOMPARE(*i, p);
    -    QCOMPARE((*i)[0], 0.0);
    -    QhullPoint p3= pc[2];
    -    i= pc.end();
    -    QCOMPARE(i[-1], p3);
    -    const PointCoordinates pc2(2, "2-d points", 6, c);
    -    QhullPoints::ConstIterator i2= pc.begin();
    -    const QhullPoint p0= pc2[0];
    -    QCOMPARE(*i2, p0);
    -    QCOMPARE((*i2)[0], 0.0);
    -    QhullPoints::ConstIterator i3= i2;
    -    QCOMPARE(i3, i2);
    -    QCOMPARE((*i3)[0], 0.0);
    -    i3= pc.constEnd();
    -    --i3;
    -    QhullPoint p2= pc2[2];
    -    QCOMPARE(*i3, p2);
    -    i= pc.end();
    -    QVERIFY(i-1==i3);
    -    i2= pc2.end();
    -    QVERIFY(i2-1!=i3);
    -    QCOMPARE(*(i2-1), *i3);
    -    foreach(QhullPoint p3, pc){ //Qt only
    -        QVERIFY(p3[0]>=0.0);
    -        QVERIFY(p3[0]<=5.0);
    -    }
    -    Coordinates::ConstIterator i4= pc.beginCoordinates();
    -    QCOMPARE(*i4, 0.0);
    -    Coordinates::Iterator i5= pc.beginCoordinates();
    -    QCOMPARE(*i5, 0.0);
    -    i4= pc.beginCoordinates(1);
    -    QCOMPARE(*i4, 2.0);
    -    i5= pc.beginCoordinates(1);
    -    QCOMPARE(*i5, 2.0);
    -    i4= pc.endCoordinates();
    -    QCOMPARE(*--i4, 5.0);
    -    i5= pc.endCoordinates();
    -    QCOMPARE(*--i5, 5.0);
    -}//t_foreach
    -
    -void PointCoordinates_test::
    -t_search()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates pc(2, "2-d points", 6, c);
    -    QhullPoint p0= pc[0];
    -    QhullPoint p2= pc[2];
    -    QVERIFY(pc.contains(p0));
    -    QVERIFY(pc.contains(p2));
    -    QCOMPARE(pc.count(p0), 1);
    -    QCOMPARE(pc.indexOf(p2), 2);
    -    QCOMPARE(pc.lastIndexOf(p0), 0);
    -}//t_search
    -
    -void PointCoordinates_test::
    -t_modify()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates pc(2, "2-d points", 6, c);
    -    coordT c3[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    PointCoordinates pc5(2);
    -    pc5.append(6, c3); // 0-5
    -    QVERIFY(pc5==pc);
    -    PointCoordinates pc2(2, "2-d");
    -    coordT c2[]= {6.0, 7.0, 8.0, 9.0, 10.0, 11.0};
    -    pc2.append(6, c2);
    -    QCOMPARE(pc2.count(), 3);
    -    pc2.append(14.0);
    -    QCOMPARE(pc2.count(), 3);
    -    QCOMPARE(pc2.extraCoordinatesCount(), 1);
    -    pc2.append(15.0); // 6-11, 14,15
    -    QCOMPARE(pc2.count(), 4);
    -    QCOMPARE(pc2.extraCoordinatesCount(), 0);
    -    QhullPoint p(pc[0]);
    -    pc2.append(p); // 6-11, 14,15, 0,1
    -    QCOMPARE(pc2.count(), 5);
    -    QCOMPARE(pc2.extraCoordinatesCount(), 0);
    -    QCOMPARE(pc2.lastIndexOf(p), 4);
    -    pc.append(pc2); // Invalidates p
    -    QCOMPARE(pc.count(), 8); // 0-11, 14,15, 0,1
    -    QCOMPARE(pc.extraCoordinatesCount(), 0);
    -    QCOMPARE(pc.lastIndexOf(pc[0]), 7);
    -    pc.appendComment(" operators");
    -    QCOMPARE(pc.comment(), std::string("2-d points operators"));
    -    pc.checkValid();
    -    // see t_append_points for appendPoints
    -    PointCoordinates pc3= pc+pc2;
    -    pc3.checkValid();
    -    QCOMPARE(pc3.count(), 13);
    -    QCOMPARE(pc3[6][0], 14.0);
    -    QCOMPARE(pc3[8][0], 6.0);
    -    pc3 += pc;
    -    QCOMPARE(pc3.count(), 21);
    -    QCOMPARE(pc3[14][0], 2.0);
    -    pc3 += 12.0;
    -    pc3 += 14.0;
    -    QCOMPARE(pc3.count(), 22);
    -    QCOMPARE(pc3.last()[0], 12.0);
    -    // QhullPoint p3= pc3.first(); // += throws error because append may move the data
    -    QhullPoint p3= pc2.first();
    -    pc3 += p3;
    -    QCOMPARE(pc3.count(), 23);
    -    QCOMPARE(pc3.last()[0], 6.0);
    -    pc3 << pc;
    -    QCOMPARE(pc3.count(), 31);
    -    QCOMPARE(pc3.last()[0], 0.0);
    -    pc3 << 12.0 << 14.0;
    -    QCOMPARE(pc3.count(), 32);
    -    QCOMPARE(pc3.last()[0], 12.0);
    -    PointCoordinates pc4(pc3);
    -    pc4.reserveCoordinates(100);
    -    QVERIFY(pc3==pc4);
    -}//t_modify
    -
    -void PointCoordinates_test::
    -t_append_points()
    -{
    -    PointCoordinates pc(2, "stringstream");
    -    stringstream s("2 3 1 2 3 4 5 6");
    -    pc.appendPoints(s);
    -    QCOMPARE(pc.count(), 3);
    -}//t_append_points
    -
    -void PointCoordinates_test::
    -t_coord_iterator()
    -{
    -    PointCoordinates c(2);
    -    c << 0.0 << 1.0 << 2.0 << 3.0 << 4.0 << 5.0;
    -    PointCoordinatesIterator i(c);
    -    QhullPoint p0(c[0]);
    -    QhullPoint p1(c[1]);
    -    QhullPoint p2(c[2]);
    -    coordT c2[] = {-1.0, -2.0};
    -    QhullPoint p3(2, c2);
    -    PointCoordinatesIterator i2= c;
    -    QVERIFY(i.findNext(p1));
    -    QVERIFY(!i.findNext(p1));
    -    QVERIFY(!i.findNext(p2));
    -    QVERIFY(!i.findNext(p3));
    -    QVERIFY(i.findPrevious(p2));
    -    QVERIFY(!i.findPrevious(p2));
    -    QVERIFY(!i.findPrevious(p0));
    -    QVERIFY(!i.findPrevious(p3));
    -    QVERIFY(i2.findNext(p2));
    -    QVERIFY(i2.findPrevious(p0));
    -    QVERIFY(i2.findNext(p1));
    -    QVERIFY(i2.findPrevious(p0));
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    i2.toFront();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(i.hasPrevious());
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    PointCoordinates c3;
    -    PointCoordinatesIterator i3= c3;
    -    QVERIFY(!i3.hasNext());
    -    QVERIFY(!i3.hasPrevious());
    -    i3.toBack();
    -    QVERIFY(!i3.hasNext());
    -    QVERIFY(!i3.hasPrevious());
    -    QCOMPARE(i.peekPrevious(), p2);
    -    QCOMPARE(i.previous(), p2);
    -    QCOMPARE(i.previous(), p1);
    -    QCOMPARE(i.previous(), p0);
    -    QVERIFY(!i.hasPrevious());
    -    QCOMPARE(i.peekNext(), p0);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), p0);
    -    QCOMPARE(i.peekNext(), p1);
    -    QCOMPARE(i.next(), p1);
    -    QCOMPARE(i.next(), p2);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), p0);
    -}//t_coord_iterator
    -
    -void PointCoordinates_test::
    -t_io()
    -{
    -    PointCoordinates c;
    -    c << 1.0 << 2.0 << 3.0 << 1.0 << 2.0 << 3.0;
    -    ostringstream os;
    -    os << "PointCoordinates 0-d\n" << c;
    -    c.setDimension(2);
    -    os << "PointCoordinates 1-3-2\n" << c;
    -    cout << os.str();
    -    QString s= QString::fromStdString(os.str());
    -    QCOMPARE(s.count("0"), 3);
    -    QCOMPARE(s.count("2"), 4);
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/PointCoordinates_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Point_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Point_test.cpp
    deleted file mode 100644
    index 2c533b3e2e..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Point_test.cpp
    +++ /dev/null
    @@ -1,238 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (C) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/Point_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include 
    -using std::cout;
    -using std::endl;
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "QhullPoint.h"
    -
    -#include "Qhull.h"
    -
    -namespace orgQhull {
    -
    -class Point_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void initTestCase();
    -    void t_construct();
    -    void t_getset();
    -    void t_operator();
    -    void t_const_iterator();
    -    void t_iterator();
    -    void t_point_iterator();
    -    // void t_mutable_point_iterator();
    -    // void t_io();
    -};//Point_test
    -
    -void
    -add_Point_test()
    -{
    -    new Point_test();
    -}
    -
    -void Point_test::
    -initTestCase(){
    -    RboxPoints rcube("c");
    -    Qhull q(rcube, "");
    -    UsingQhullLib::setGlobals();
    -}//initTestCase
    -
    -void Point_test::
    -t_construct()
    -{
    -    QhullPoint p;
    -    QCOMPARE(p.dimension(), 0);
    -    coordT c[]= {0.0, 1.0, 2.0};
    -    QhullPoint p2;
    -    p2.defineAs(3, c);
    -    QCOMPARE(p2.dimension(), 3);
    -    QCOMPARE(p2.coordinates(), c);
    -    coordT c2[]= {0.0, 1.0, 2.0};
    -    QhullPoint p3(3, c2);
    -    QVERIFY(p3==p2);
    -    QhullPoint p5(p3);
    -    QVERIFY(p5==p3);
    -}//t_construct
    -
    -void Point_test::
    -t_getset()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0};
    -    QhullPoint p(3, c);
    -    QCOMPARE(p.coordinates(), c);
    -    QCOMPARE(p.dimension(), 3);
    -    QCOMPARE(p[2], 2.0);
    -    QhullPoint p2(p);
    -    p2.defineAs(p);
    -    QVERIFY(p2==p);
    -    QVERIFY(p2.coordinates()==p.coordinates());
    -    QVERIFY(p2.dimension()==p.dimension());
    -    p2.setDimension(2);
    -    QCOMPARE(p2.dimension(), 2);
    -    QVERIFY(p2!=p);
    -    coordT c2[]= {0.0, 1.0};
    -    p2.setCoordinates(c2);
    -    QCOMPARE(p2.coordinates(), c2);
    -    p.defineAs(2, c);
    -    QVERIFY(p2==p);
    -    QCOMPARE(p[1], 1.0);
    -}//t_getset
    -
    -void Point_test::
    -t_operator()
    -{
    -    QhullPoint p;
    -    QhullPoint p2(p);
    -    QVERIFY(p==p2);
    -    QVERIFY(!(p!=p2));
    -    coordT c[]= {0.0, 1.0, 2.0};
    -    QhullPoint p3(3, c);
    -    QVERIFY(p3!=p2);
    -    QhullPoint p4(p3);
    -    QVERIFY(p4==p3);
    -    coordT c5[]= {5.0, 6.0, 7.0};
    -    QhullPoint p5(3, c5);
    -    QVERIFY(p5!=p3);
    -    QCOMPARE(p5[1], 6.0);
    -    QCOMPARE(p5[0], 5.0);
    -    const coordT *c0= &p5[0];
    -    QCOMPARE(*c0, 5.0);
    -}//t_operator
    -
    -void Point_test::
    -t_const_iterator()
    -{
    -    coordT c[]= {1.0, 2.0, 3.0};
    -    QhullPoint p(3, c);
    -    QhullPoint::const_iterator i(p.coordinates());
    -    QhullPoint::const_iterator i2= p.coordinates();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(*(i+1), 2.0);
    -    QCOMPARE(*(i+1), i[1]);
    -    i= p.end();
    -    QVERIFY(i!=i2);
    -    i= i2;
    -    QVERIFY(i==i2);
    -    i= p.end();
    -    i= p.begin();
    -    QCOMPARE(*i, 1.0);
    -    QhullPoint::ConstIterator i3= p.end();
    -    QCOMPARE(*(i3-1), 3.0);
    -    QCOMPARE(*(i3-1), i3[-1]);
    -    QVERIFY(i!=i3);
    -    QVERIFY(ii);
    -    QVERIFY(i3>=i);
    -}//t_const_iterator
    -
    -
    -void Point_test::
    -t_iterator()
    -{
    -    coordT c[]= {1.0, 2.0, 3.0};
    -    QhullPoint p(3, c);
    -    QhullPoint::Iterator i(p.coordinates());
    -    QhullPoint::iterator i2= p.coordinates();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -    QCOMPARE(*i, 1.0);
    -    QCOMPARE(*(i+1), 2.0);
    -    QCOMPARE(*(i+1), i[1]);
    -    i= p.end();
    -    QVERIFY(i!=i2);
    -    i= i2;
    -    QVERIFY(i==i2);
    -    i= p.end();
    -    i= p.begin();
    -    QCOMPARE(*i, 1.0);
    -    QhullPoint::Iterator i3= p.end();
    -    QCOMPARE(*(i3-1), 3.0);
    -    QCOMPARE(*(i3-1), i3[-1]);
    -    QVERIFY(i!=i3);
    -    QVERIFY(ii);
    -    QVERIFY(i3>=i);
    -    // compiler errors -- QhullPoint is const-only
    -    // QCOMPARE((i[0]= -10.0), -10.0);
    -    // coordT *c3= &i3[1];
    -}//t_iterator
    -
    -void Point_test::
    -t_point_iterator()
    -{
    -    coordT c[]= {1.0, 3.0, 4.0};
    -    QhullPoint p(3, c);
    -    QhullPointIterator i(p);
    -    QhullPointIterator i2= p;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    i2.toFront();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(i.hasPrevious());
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -
    -    coordT c2[]= {1.0, 3.0, 4.0};
    -    QhullPoint p2(0, c2); // 0-dimensional
    -    i2= p2;
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    i2.toBack();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekPrevious(), 4.0);
    -    QCOMPARE(i.previous(), 4.0);
    -    QCOMPARE(i.previous(), 3.0);
    -    QCOMPARE(i.previous(), 1.0);
    -    QVERIFY(!i.hasPrevious());
    -    QCOMPARE(i.peekNext(), 1.0);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), 1.0);
    -    QCOMPARE(i.peekNext(), 3.0);
    -    QCOMPARE(i.next(), 3.0);
    -    QCOMPARE(i.next(), 4.0);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), 1.0);
    -}//t_point_iterator
    -
    -// No MutableQhullPointIterator since QhullPoint is const-only
    -
    -#if 0
    -
    -void Point_test::
    -t_io()
    -{
    -    QhullPoint p;
    -    cout<< "INFO:     empty point" << p << endl;
    -    const coordT c[]= {1.0, 3.0, 4.0};
    -    QhullPoint p2(2, c); // 2-dimensional
    -    cout<< "INFO:   " << p2 << endl;
    -}//t_io
    -
    -error LNK2019: unresolved external symbol "class std::basic_ostream > & __cdecl operator<<(class std::basic_ostream > &,class orgQhull::QhullPoint &)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@AAVPoint@orgQhull@@@Z) referenced in function "private: void __thiscall orgQhull::Point_test::t_io(void)" (?t_io@Point_test@orgQhull@@AAEXXZ)
    -
    -#endif
    -
    -}//orgQhull
    -
    -#include "moc/Point_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetList_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetList_test.cpp
    deleted file mode 100644
    index aac6ec5be0..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetList_test.cpp
    +++ /dev/null
    @@ -1,172 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullFacetList_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "QhullFacetList.h"
    -#include "QhullError.h"
    -#include "QhullFacet.h"
    -#include "QhullVertexSet.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullFacetList_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_readonly();
    -    void t_foreach();
    -    void t_io();
    -};//QhullFacetList_test
    -
    -void
    -add_QhullFacetList_test()
    -{
    -    new QhullFacetList_test();
    -}
    -
    -//Executed after each testcase
    -void QhullFacetList_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullFacetList_test::
    -t_construct()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacetList fs2= q.facetList();
    -    QVERIFY(!fs2.isEmpty());
    -    QCOMPARE(fs2.count(),6);
    -    QhullFacetList fs3(q.endFacet(), q.endFacet());
    -    QVERIFY(fs3.isEmpty());
    -    QhullFacetList fs4(q.endFacet().previous(), q.endFacet());
    -    QCOMPARE(fs4.count(), 1);
    -    QhullFacetList fs5(q.beginFacet(), q.endFacet());
    -    QCOMPARE(fs2.count(), fs5.count());
    -    QVERIFY(fs2==fs5);
    -    QhullFacetList fs6= fs2; // copy constructor
    -    QVERIFY(fs6==fs2);
    -    std::vector fv= fs2.toStdVector();
    -    QCOMPARE(fv.size(), 6u);
    -}//t_construct
    -
    -void QhullFacetList_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0 QV2");  // rotated unit cube
    -    QhullFacetList fs2= q.facetList();
    -    QVERIFY(!fs2.isSelectAll());
    -    QVERIFY(!fs2.isEmpty());
    -    QCOMPARE(fs2.count(),3);
    -    std::vector fv= fs2.toStdVector();
    -    QCOMPARE(fv.size(), 3u);
    -    QList fv2= fs2.toQList();
    -    QCOMPARE(fv2.size(), 3);
    -    std::vector fv5= fs2.vertices_toStdVector(q.runId());
    -    QCOMPARE(fv5.size(), 7u);
    -    QList fv6= fs2.vertices_toQList(q.runId());
    -    QCOMPARE(fv6.size(), 7);
    -    fs2.selectAll();
    -    QVERIFY(fs2.isSelectAll());
    -    std::vector fv3= fs2.toStdVector();
    -    QCOMPARE(fv3.size(), 6u);
    -    QList fv4= fs2.toQList();
    -    QCOMPARE(fv4.size(), 6);
    -    std::vector fv7= fs2.vertices_toStdVector(q.runId());
    -    QCOMPARE(fv7.size(), 8u);
    -    QList fv8= fs2.vertices_toQList(q.runId());
    -    QCOMPARE(fv8.size(), 8);
    -}//t_convert
    -
    -//! Spot check properties and read-only.  See QhullLinkedList_test
    -void QhullFacetList_test::
    -t_readonly()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QV0");  // good facets are adjacent to point 0
    -    QhullFacetList fs= q.facetList();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 3);
    -    QCOMPARE(fs.first(), q.firstFacet());
    -    fs.selectAll();
    -    QVERIFY(fs.isSelectAll());
    -    QCOMPARE(fs.count(), 6);
    -    fs.selectGood();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 3);
    -    fs.selectAll();
    -    QVERIFY(fs.isSelectAll());
    -    QCOMPARE(fs.count(), 6);
    -    QhullFacet f= fs.first();
    -    QhullFacet f2= fs.last();
    -    fs.selectAll();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(fs.contains(f2));
    -    QVERIFY(f.isGood());
    -    QVERIFY(!f2.isGood());
    -    fs.selectGood();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(!fs.contains(f2));
    -}//t_readonly
    -
    -void QhullFacetList_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c");
    -    // Spot check predicates and accessors.  See QhullLinkedList_test
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullFacetList fs= q.facetList();
    -    QVERIFY(fs.contains(q.firstFacet()));
    -    QhullFacet f= q.firstFacet().next();
    -    QVERIFY(fs.contains(f));
    -    QCOMPARE(fs.first(), *fs.begin());
    -    QCOMPARE(*(fs.end()-1), fs.last());
    -    QCOMPARE(fs.first(), q.firstFacet());
    -    QCOMPARE(*fs.begin(), q.beginFacet());
    -    QCOMPARE(*fs.end(), q.endFacet());
    -}//t_foreach
    -
    -void QhullFacetList_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0 QV0");   // good facets are adjacent to point 0
    -        QhullFacetList fs= q.facetList();
    -        ostringstream os;
    -        os << fs.print(q.runId()); // Runs all print options
    -        os << "\nFacets only\n" << fs; // printVertices() requires a runId
    -        cout << os.str();
    -        QString facets= QString::fromStdString(os.str());
    -        QCOMPARE(facets.count("(v"), 7+12*3*2);
    -        QCOMPARE(facets.count(QRegExp("f\\d")), 3*7 + 13*3*2);
    -    }
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullFacetList_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetSet_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetSet_test.cpp
    deleted file mode 100644
    index 40f495a4b9..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacetSet_test.cpp
    +++ /dev/null
    @@ -1,153 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullFacetSet_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullFacetSet.h"
    -#include "QhullError.h"
    -#include "QhullFacet.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullFacetSet_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_readonly();
    -    void t_foreach();
    -    void t_io();
    -};//QhullFacetSet_test
    -
    -void
    -add_QhullFacetSet_test()
    -{
    -    new QhullFacetSet_test();
    -}
    -
    -//Executed after each testcase
    -void QhullFacetSet_test::
    -cleanup()
    -{
    -    RoadTest::cleanup();
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -}
    -
    -void QhullFacetSet_test::
    -t_construct()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacet f= q.firstFacet();
    -    QhullFacetSet fs2= f.neighborFacets();
    -    QVERIFY(!fs2.isEmpty());
    -    QCOMPARE(fs2.count(),4);
    -    QhullFacetSet fs4= fs2; // copy constructor
    -    QVERIFY(fs4==fs2);
    -    QhullFacetSet fs3(q.qhullQh()->facet_mergeset);
    -    QVERIFY(fs3.isEmpty());
    -}//t_construct
    -
    -void QhullFacetSet_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q2(rcube,"QR0 QV2");  // rotated unit cube
    -    QhullFacet f2= q2.firstFacet();
    -    QhullFacetSet fs2= f2.neighborFacets();
    -    QVERIFY(!fs2.isSelectAll());
    -    QCOMPARE(fs2.count(),2);
    -    std::vector fv= fs2.toStdVector();
    -    QCOMPARE(fv.size(), 2u);
    -    QList fv2= fs2.toQList();
    -    QCOMPARE(fv2.size(), 2);
    -    fs2.selectAll();
    -    QVERIFY(fs2.isSelectAll());
    -    std::vector fv3= fs2.toStdVector();
    -    QCOMPARE(fv3.size(), 4u);
    -    QList fv4= fs2.toQList();
    -    QCOMPARE(fv4.size(), 4);
    -}//t_convert
    -
    -//! Spot check properties and read-only.  See QhullSet_test
    -void QhullFacetSet_test::
    -t_readonly()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QV0");  // good facets are adjacent to point 0
    -    QhullFacetSet fs= q.firstFacet().neighborFacets();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 2);
    -    fs.selectAll();
    -    QVERIFY(fs.isSelectAll());
    -    QCOMPARE(fs.count(), 4);
    -    fs.selectGood();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 2);
    -    QhullFacet f= fs.first();
    -    QhullFacet f2= fs.last();
    -    fs.selectAll();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(fs.contains(f2));
    -    QVERIFY(f.isGood());
    -    QVERIFY(!f2.isGood());
    -    fs.selectGood();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(!fs.contains(f2));
    -}//t_readonly
    -
    -void QhullFacetSet_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c");
    -    // Spot check predicates and accessors.  See QhullLinkedList_test
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacetSet fs= q.firstFacet().neighborFacets();
    -    QVERIFY(!fs.contains(q.firstFacet()));
    -    QVERIFY(fs.contains(fs.first()));
    -    QhullFacet f= q.firstFacet().next();
    -    if(!fs.contains(f)){
    -        f= f.next();
    -    }
    -    QVERIFY(fs.contains(f));
    -    QCOMPARE(fs.first(), *fs.begin());
    -    QCOMPARE(*(fs.end()-1), fs.last());
    -}//t_foreach
    -
    -void QhullFacetSet_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0 QV0");   // good facets are adjacent to point 0
    -        QhullFacetSet fs= q.firstFacet().neighborFacets();
    -        ostringstream os;
    -        os << fs.print(q.runId(), "Neighbors of first facet with point 0");
    -        os << fs.printIdentifiers("\nFacet identifiers: ");
    -        cout << os.str();
    -        QString facets= QString::fromStdString(os.str());
    -        QCOMPARE(facets.count(QRegExp(" f[0-9]")), 2+13*2);
    -    }
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullFacetSet_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacet_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacet_test.cpp
    deleted file mode 100644
    index 3044d70690..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullFacet_test.cpp
    +++ /dev/null
    @@ -1,264 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullFacet_test.cpp#6 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullFacet.h"
    -#include "QhullError.h"
    -#include "Coordinates.h"
    -#include "RboxPoints.h"
    -#include "QhullFacetList.h"
    -#include "QhullFacetSet.h"
    -#include "QhullPointSet.h"
    -#include "QhullRidge.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullFacet_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_constructConvert();
    -    void t_getSet();
    -    void t_value();
    -    void t_foreach();
    -    void t_io();
    -};//QhullFacet_test
    -
    -void
    -add_QhullFacet_test()
    -{
    -    new QhullFacet_test();
    -}
    -
    -//Executed after each testcase
    -void QhullFacet_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullFacet_test::
    -t_constructConvert()
    -{
    -    // Qhull.runQhull() constructs QhullFacets as facetT
    -    QhullFacet f;
    -    QVERIFY(!f.isDefined());
    -    QCOMPARE(f.dimension(),0);
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullFacet f2(q.beginFacet());
    -    QCOMPARE(f2.dimension(),3);
    -    f= f2; // copy assignment
    -    QVERIFY(f.isDefined());
    -    QCOMPARE(f.dimension(),3);
    -    QhullFacet f5= f2;
    -    QVERIFY(f5==f2);
    -    QVERIFY(f5==f);
    -    QhullFacet f3= f2.getFacetT();
    -    QCOMPARE(f,f3);
    -    QhullFacet f4= f2.getBaseT();
    -    QCOMPARE(f,f4);
    -}//t_constructConvert
    -
    -void QhullFacet_test::
    -t_getSet()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q.facetCount(), 12);
    -        QCOMPARE(q.vertexCount(), 8);
    -        QhullFacetListIterator i(q.facetList());
    -        while(i.hasNext()){
    -            const QhullFacet f= i.next();
    -            cout << f.id() << endl;
    -            QCOMPARE(f.dimension(),3);
    -            QVERIFY(f.id()>0 && f.id()<=39);
    -            QVERIFY(f.isDefined());
    -            if(i.hasNext()){
    -                QCOMPARE(f.next(), i.peekNext());
    -                QVERIFY(f.next()!=f);
    -            }
    -            QVERIFY(i.hasPrevious());
    -            QCOMPARE(f, i.peekPrevious());
    -        }
    -        QhullFacetListIterator i2(i);
    -        QEXPECT_FAIL("", "ListIterator copy constructor not reset to BOT", Continue);
    -        QVERIFY(!i2.hasPrevious());
    -
    -        // test tricoplanarOwner
    -        QhullFacet facet = q.beginFacet();
    -        QhullFacet tricoplanarOwner = facet.tricoplanarOwner();
    -        int tricoplanarCount= 0;
    -        i.toFront();
    -        while(i.hasNext()){
    -            const QhullFacet f= i.next();
    -            if(f.tricoplanarOwner()==tricoplanarOwner){
    -                tricoplanarCount++;
    -            }
    -        }
    -        QCOMPARE(tricoplanarCount, 2);
    -        int tricoplanarCount2= 0;
    -        foreach (QhullFacet f, q.facetList()){  // Qt only
    -            QhullHyperplane h= f.hyperplane();
    -            cout << "Hyperplane: " << h << endl;
    -            QCOMPARE(h.count(), 3);
    -            QCOMPARE(h.offset(), -0.5);
    -            double n= h.norm();
    -            QCOMPARE(n, 1.0);
    -            QhullHyperplane hi= f.innerplane(q.runId());
    -            QCOMPARE(hi.count(), 3);
    -            double innerOffset= hi.offset()+0.5;
    -            cout << "InnerPlane: " << hi << "innerOffset+0.5 " << innerOffset << endl;
    -            QVERIFY(innerOffset >= 0.0);
    -            QhullHyperplane ho= f.outerplane(q.runId());
    -            QCOMPARE(ho.count(), 3);
    -            double outerOffset= ho.offset()+0.5;
    -            cout << "OuterPlane: " << ho << "outerOffset+0.5 " << outerOffset << endl;
    -            QVERIFY(outerOffset <= 0.0);
    -            QVERIFY(outerOffset-innerOffset < 1e-7);
    -            for(int k= 0; k<3; k++){
    -                QVERIFY(ho[k]==hi[k]);
    -                QVERIFY(ho[k]==h[k]);
    -            }
    -            QhullPoint center= f.getCenter(q.runId());
    -            cout << "Center: " << center << endl;
    -            double d= f.distance(center);
    -            QVERIFY(d < innerOffset-outerOffset);
    -            QhullPoint center2= f.getCenter(q.runId(), qh_PRINTcentrums);
    -            QCOMPARE(center, center2);
    -            if(f.tricoplanarOwner()==tricoplanarOwner){
    -                tricoplanarCount2++;
    -            }
    -        }
    -        QCOMPARE(tricoplanarCount2, 2);
    -        Qhull q2(rcube,"d Qz Qt QR0");  // 3-d triangulation of Delaunay triangulation (the cube)
    -        QhullFacet f2= q2.firstFacet();
    -        QhullPoint center3= f2.getCenter(q.runId(), qh_PRINTtriangles);
    -        QCOMPARE(center3.dimension(), 3);
    -        QhullPoint center4= f2.getCenter(q.runId());
    -        QCOMPARE(center4.dimension(), 3);
    -        for(int k= 0; k<3; k++){
    -            QVERIFY(center4[k]==center3[k]);
    -        }
    -        Qhull q3(rcube,"v Qz QR0");  // Voronoi diagram of a cube (one vertex)
    -
    -        UsingLibQhull::setGlobalDistanceEpsilon(1e-12); // Voronoi vertices are not necessarily within distance episilon
    -        foreach(QhullFacet f, q3.facetList()){ //Qt only
    -            if(f.isGood()){
    -                QhullPoint p= f.voronoiVertex(q3.runId());
    -                cout << p.print(q3.runId(), "Voronoi vertex: ")
    -                    << " DistanceEpsilon " << UsingLibQhull::globalDistanceEpsilon() << endl;
    -                QCOMPARE(p, q3.origin());
    -            }
    -        }
    -    }
    -}//t_getSet
    -
    -void QhullFacet_test::
    -t_value()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        coordT c[]= {0.0, 0.0, 0.0};
    -        foreach (QhullFacet f, q.facetList()){  // Qt only
    -            double d= f.distance(q.origin());
    -            QCOMPARE(d, -0.5);
    -            double d0= f.distance(c);
    -            QCOMPARE(d0, -0.5);
    -            double facetArea= f.facetArea(q.runId());
    -            QCOMPARE(facetArea, 1.0);
    -            #if qh_MAXoutside
    -                double maxoutside= f.getFacetT()->maxoutside;
    -                QVERIFY(maxoutside<1e-7);
    -            #endif
    -        }
    -    }
    -}//t_value
    -
    -void QhullFacet_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c W0 300");  // cube plus 300 points on its surface
    -    {
    -        Qhull q(rcube, "QR0 Qc"); // keep coplanars, thick facet, and rotate the cube
    -        int coplanarCount= 0;
    -        foreach(const QhullFacet f, q.facetList()){
    -            QhullPointSet coplanars= f.coplanarPoints();
    -            coplanarCount += coplanars.count();
    -            QhullFacetSet neighbors= f.neighborFacets();
    -            QCOMPARE(neighbors.count(), 4);
    -            QhullPointSet outsides= f.outsidePoints();
    -            QCOMPARE(outsides.count(), 0);
    -            QhullRidgeSet ridges= f.ridges();
    -            QCOMPARE(ridges.count(), 4);
    -            QhullVertexSet vertices= f.vertices();
    -            QCOMPARE(vertices.count(), 4);
    -            int ridgeCount= 0;
    -            QhullRidge r= ridges.first();
    -            for(int r0= r.id(); ridgeCount==0 || r.id()!=r0; r= r.nextRidge3d(f)){
    -                ++ridgeCount;
    -                if(!r.hasNextRidge3d(f)){
    -                    QFAIL("Unexpected simplicial facet.  They only have ridges to non-simplicial neighbors.");
    -                }
    -            }
    -            QCOMPARE(ridgeCount, 4);
    -        }
    -        QCOMPARE(coplanarCount, 300);
    -    }
    -}//t_foreach
    -
    -void QhullFacet_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        QhullFacet f= q.beginFacet();
    -        cout << f;
    -        ostringstream os;
    -        os << f.printHeader(q.runId());
    -        os << f.printFlags("    - flags:");
    -        os << f.printCenter(q.runId(), qh_PRINTfacets, "    - center:");
    -        os << f.printRidges(q.runId());
    -        cout << os.str();
    -        ostringstream os2;
    -        os2 << f.print(q.runId());  // invokes print*()
    -        QString facetString2= QString::fromStdString(os2.str());
    -        facetString2.replace(QRegExp("\\s\\s+"), " ");
    -        ostringstream os3;
    -        q.setOutputStream(&os3);
    -        q.outputQhull("f");
    -        QString facetsString= QString::fromStdString(os3.str());
    -        QString facetString3= facetsString.mid(facetsString.indexOf("- f1\n"));
    -        facetString3= facetString3.left(facetString3.indexOf("\n- f")+1);
    -        facetString3.replace(QRegExp("\\s\\s+"), " ");
    -        QCOMPARE(facetString2, facetString3);
    -    }
    -}//t_io
    -
    -// toQhullFacet is static_cast only
    -
    -}//orgQhull
    -
    -#include "moc/QhullFacet_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullHyperplane_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullHyperplane_test.cpp
    deleted file mode 100644
    index ef232ac6d9..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullHyperplane_test.cpp
    +++ /dev/null
    @@ -1,412 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullHyperplane_test.cpp#6 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullHyperplane.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetList.h"
    -#include "Qhull.h"
    -#include 
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullHyperplane_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_readonly();
    -    void t_define();
    -    void t_value();
    -    void t_operator();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_qhullHyperplane_iterator();
    -    void t_io();
    -};//QhullHyperplane_test
    -
    -void
    -add_QhullHyperplane_test()
    -{
    -    new QhullHyperplane_test();
    -}
    -
    -//Executed after each testcase
    -void QhullHyperplane_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullHyperplane_test::
    -t_construct()
    -{
    -    // Qhull.runQhull() constructs QhullFacets as facetT
    -    QhullHyperplane h;
    -    QVERIFY(!h.isDefined());
    -    QCOMPARE(h.dimension(),0);
    -    QCOMPARE(h.coordinates(),static_cast(0));
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullFacet f= q.firstFacet();
    -    QhullHyperplane h2(f.hyperplane());
    -    QVERIFY(h2.isDefined());
    -    QCOMPARE(h2.dimension(),3);
    -    // h= h2;  // copy assignment disabled, ambiguous
    -    QhullHyperplane h3(h2.dimension(), h2.coordinates(), h2.offset());
    -    QCOMPARE(h2, h3);
    -    QhullHyperplane h5= h2; // copy constructor
    -    QVERIFY(h5==h2);
    -}//t_construct
    -
    -void QhullHyperplane_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullHyperplane h= q.firstFacet().hyperplane();
    -    std::vector fs= h.toStdVector();
    -    QCOMPARE(fs.size(), 4u);
    -    double offset= fs.back();
    -    fs.pop_back();
    -    QCOMPARE(offset, -0.5);
    -
    -    double squareNorm= inner_product(fs.begin(), fs.end(), fs.begin(), 0.0);
    -    QCOMPARE(squareNorm, 1.0);
    -    QList qs= h.toQList();
    -    QCOMPARE(qs.size(), 4);
    -    double offset2= qs.takeLast();
    -    QCOMPARE(offset2, -0.5);
    -    double squareNorm2= std::inner_product(qs.begin(), qs.end(), qs.begin(), 0.0);
    -    QCOMPARE(squareNorm2, 1.0);
    -}//t_convert
    -
    -void QhullHyperplane_test::
    -t_readonly()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QhullFacetList fs= q.facetList();
    -        QhullFacetListIterator i(fs);
    -        while(i.hasNext()){
    -            QhullFacet f= i.next();
    -            QhullHyperplane h= f.hyperplane();
    -            int id= f.id();
    -            cout << "h" << id << endl;
    -            QVERIFY(h.isDefined());
    -            QCOMPARE(h.dimension(),3);
    -            const coordT *c= h.coordinates();
    -            coordT *c2= h.coordinates();
    -            QCOMPARE(c, c2);
    -            const coordT *c3= h.begin();
    -            QCOMPARE(c, c3);
    -            QCOMPARE(h.offset(), -0.5);
    -            int j= h.end()-h.begin();
    -            QCOMPARE(j, 3);
    -            double squareNorm= std::inner_product(h.begin(), h.end(), h.begin(), 0.0);
    -            QCOMPARE(squareNorm, 1.0);
    -        }
    -        QhullHyperplane h2= fs.first().hyperplane();
    -        QhullHyperplane h3= fs.last().hyperplane();
    -        QVERIFY(h2!=h3);
    -        QVERIFY(h3.coordinates()!=h2.coordinates());
    -    }
    -}//t_readonly
    -
    -void QhullHyperplane_test::
    -t_define()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QhullFacetList fs= q.facetList();
    -        QhullHyperplane h= fs.first().hyperplane();
    -        QhullHyperplane h2= h;
    -        QVERIFY(h==h2);
    -        QhullHyperplane h3= fs.last().hyperplane();
    -        QVERIFY(h2!=h3);
    -
    -        QhullHyperplane h4= h3;
    -        h4.defineAs(h2);
    -        QVERIFY(h2==h4);
    -        QhullHyperplane p5= h3;
    -        p5.defineAs(h2.dimension(), h2.coordinates(), h2.offset());
    -        QVERIFY(h2==p5);
    -        QhullHyperplane h6= h3;
    -        h6.setCoordinates(h2.coordinates());
    -        QCOMPARE(h2.coordinates(), h6.coordinates());
    -        h6.setOffset(h2.offset());
    -        QCOMPARE(h2.offset(), h6.offset());
    -        QVERIFY(h2==h6);
    -        h6.setDimension(2);
    -        QCOMPARE(h6.dimension(), 2);
    -        QVERIFY(h2!=h6);
    -    }
    -}//t_define
    -
    -void QhullHyperplane_test::
    -t_value()
    -{
    -    RboxPoints rcube("c G1");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    const QhullHyperplane h= q.firstFacet().hyperplane();
    -    double dist= h.distance(q.origin());
    -    QCOMPARE(dist, -1.0);
    -    double norm= h.norm();
    -    QCOMPARE(norm, 1.0);
    -}//t_value
    -
    -void QhullHyperplane_test::
    -t_operator()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    const QhullHyperplane h= q.firstFacet().hyperplane();
    -    //operator== and operator!= tested elsewhere
    -    const coordT *c= h.coordinates();
    -    for(int k=h.dimension(); k--; ){
    -        QCOMPARE(c[k], h[k]);
    -    }
    -    //h[0]= 10.0; // compiler error, const
    -    QhullHyperplane h2= q.firstFacet().hyperplane();
    -    h2[0]= 10.0;  // Overwrites Hyperplane coordinate!
    -    QCOMPARE(h2[0], 10.0);
    -}//t_operator
    -
    -void QhullHyperplane_test::
    -t_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        QhullHyperplane h2;
    -        QCOMPARE(h2.begin(), h2.end());
    -        QCOMPARE(h2.count(), 0);
    -        QCOMPARE(h2.size(), 0u);
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullHyperplane h= q.firstFacet().hyperplane();
    -        QCOMPARE(h.count(), 3);
    -        QCOMPARE(h.size(), 3u);
    -        QhullHyperplane::Iterator i= h.begin();
    -        QhullHyperplane::iterator i2= h.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= h.begin();
    -        QVERIFY(i==i2);
    -        i2= h.end();
    -        QVERIFY(i!=i2);
    -        double d3= *i;
    -        i2--;
    -        double d2= *i2;
    -        QCOMPARE(d3, h[0]);
    -        QCOMPARE(d2, h[2]);
    -        QhullHyperplane::Iterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3), h[1]);
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        QhullHyperplane::ConstIterator i4= h.begin();
    -        QVERIFY(i==i4); // iterator COMP const_iterator
    -        QVERIFY(i<=i4);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4==i); // const_iterator COMP iterator
    -        QVERIFY(i4<=i);
    -        QVERIFY(i4>=i);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4<=i);
    -        QVERIFY(i2!=i4);
    -        QVERIFY(i2>i4);
    -        QVERIFY(i2>=i4);
    -        QVERIFY(i4!=i2);
    -        QVERIFY(i4i);
    -        QVERIFY(i4>=i);
    -
    -        i= h.begin();
    -        i2= h.begin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, h[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, h.begin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2 += 3, h.end());
    -        QCOMPARE(i2 -= 3, h.begin());
    -        QCOMPARE(i2+0, h.begin());
    -        QCOMPARE(i2+3, h.end());
    -        i2 += 3;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-3;
    -        QCOMPARE(i, h.begin());
    -        QCOMPARE(i2-i, 3);
    -
    -        //h.begin end tested above
    -
    -        // QhullHyperplane is const-only
    -    }
    -}//t_iterator
    -
    -void QhullHyperplane_test::
    -t_const_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullHyperplane h= q.firstFacet().hyperplane();
    -        QhullHyperplane::ConstIterator i= h.begin();
    -        QhullHyperplane::const_iterator i2= h.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= h.begin();
    -        QVERIFY(i==i2);
    -        i2= h.end();
    -        QVERIFY(i!=i2);
    -        double d3= *i;
    -        i2--;
    -        double d2= *i2;
    -        QCOMPARE(d3, h[0]);
    -        QCOMPARE(d2, h[2]);
    -        QhullHyperplane::ConstIterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3), h[1]);
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        // See t_iterator for const_iterator COMP iterator
    -
    -        i= h.begin();
    -        i2= h.constBegin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, h[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, h.constBegin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2+=3, h.constEnd());
    -        QCOMPARE(i2-=3, h.constBegin());
    -        QCOMPARE(i2+0, h.constBegin());
    -        QCOMPARE(i2+3, h.constEnd());
    -        i2 += 3;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-3;
    -        QCOMPARE(i, h.constBegin());
    -        QCOMPARE(i2-i, 3);
    -
    -        // QhullHyperplane is const-only
    -    }
    -}//t_const_iterator
    -
    -void QhullHyperplane_test::
    -t_qhullHyperplane_iterator()
    -{
    -    QhullHyperplane h2;
    -    QhullHyperplaneIterator i= h2;
    -    QCOMPARE(h2.dimension(), 0);
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullHyperplane h = q.firstFacet().hyperplane();
    -    QhullHyperplaneIterator i2(h);
    -    QCOMPARE(h.dimension(), 3);
    -    i= h;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i2.toBack();
    -    i.toFront();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    // i at front, i2 at end/back, 3 coordinates
    -    QCOMPARE(i.peekNext(), h[0]);
    -    QCOMPARE(i2.peekPrevious(), h[2]);
    -    QCOMPARE(i2.previous(), h[2]);
    -    QCOMPARE(i2.previous(), h[1]);
    -    QCOMPARE(i2.previous(), h[0]);
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekNext(), h[0]);
    -    // i.peekNext()= 1.0; // compiler error, i is const
    -    QCOMPARE(i.next(), h[0]);
    -    QCOMPARE(i.peekNext(), h[1]);
    -    QCOMPARE(i.next(), h[1]);
    -    QCOMPARE(i.next(), h[2]);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), h[0]);
    -}//t_qhullHyperplane_iterator
    -
    -void QhullHyperplane_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        QhullHyperplane h= q.firstFacet().hyperplane();
    -        ostringstream os;
    -        os << "Hyperplane:\n";
    -        os << h;
    -        os << "Hyperplane w/ runId:\n";
    -        os << h.print();
    -        os << h.print(" and a message ", " offset ");
    -        cout << os.str();
    -        QString s= QString::fromStdString(os.str());
    -        QCOMPARE(s.count("1"), 3);
    -        // QCOMPARE(s.count(QRegExp("f\\d")), 3*7 + 13*3*2);
    -    }
    -}//t_io
    -
    -
    -}//orgQhull
    -
    -#include "moc/QhullHyperplane_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullLinkedList_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullLinkedList_test.cpp
    deleted file mode 100644
    index ab603ea832..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullLinkedList_test.cpp
    +++ /dev/null
    @@ -1,330 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullLinkedList_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullLinkedList.h"
    -#include "Qhull.h"
    -
    -namespace orgQhull {
    -
    -class QhullLinkedList_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_element();
    -    void t_search();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_QhullLinkedList_iterator();
    -    void t_io();
    -};//QhullLinkedList_test
    -
    -void
    -add_QhullLinkedList_test()
    -{
    -    new QhullLinkedList_test();
    -}
    -
    -//Executed after each testcase
    -void QhullLinkedList_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullLinkedList_test::
    -t_construct()
    -{
    -    // QhullLinkedList vs; //private (compiler error).  No memory allocation
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q.facetCount(), 12);
    -        QhullVertexList vs = QhullVertexList(q.beginVertex(), q.endVertex());
    -        QCOMPARE(vs.count(), 8);
    -        QCOMPARE(vs.size(), 8u);
    -        QVERIFY(!vs.isEmpty());
    -        QhullVertexList vs2 = q.vertexList();
    -        QCOMPARE(vs2.count(), 8);
    -        QCOMPARE(vs2.size(),8u);
    -        QVERIFY(!vs2.isEmpty());
    -        QVERIFY(!vs2.empty());
    -        QVERIFY(vs==vs2);
    -        // vs= vs2; // disabled.  Would not copy the vertices
    -        QhullVertexList vs3= vs2; // copy constructor
    -        QVERIFY(vs3==vs2);
    -    }
    -}//t_construct
    -
    -void QhullLinkedList_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q.facetCount(), 12);
    -        QhullVertexList vs = q.vertexList();
    -        QCOMPARE(vs.size(), 8u);
    -        QVERIFY(!vs.isEmpty());
    -        QVERIFY(!vs.empty());
    -        std::vector vs2= vs.toStdVector();
    -        QCOMPARE(vs2.size(), vs.size());
    -        QhullVertexList::Iterator i= vs.begin();
    -        for(int k= 0; k<(int)vs2.size(); k++){
    -            QCOMPARE(vs2[k], *i++);
    -        }
    -        QList vs3= vs.toQList();
    -        QCOMPARE(vs3.count(), vs.count());
    -        i= vs.begin();
    -        for(int k= 0; k
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "QhullPointSet.h"
    -#include "RboxPoints.h"
    -#include "QhullPoint.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetList.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -
    -namespace orgQhull {
    -
    -class QhullPointSet_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_element();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_search();
    -    void t_pointset_iterator();
    -    void t_io();
    -};//QhullPointSet_test
    -
    -void
    -add_QhullPointSet_test()
    -{
    -    new QhullPointSet_test();
    -}
    -
    -//Executed after each testcase
    -void QhullPointSet_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullPointSet_test::
    -t_construct()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    int coplanarCount= 0;
    -    foreach(QhullFacet f, q.facetList()){
    -        QhullPointSet ps(q.dimension(), f.getFacetT()->outsideset);
    -        QCOMPARE(ps.dimension(), 3);
    -        QVERIFY(ps.isEmpty());
    -        QVERIFY(ps.empty());
    -        QCOMPARE(ps.count(), 0);
    -        QCOMPARE(ps.size(), 0u);
    -        QhullPointSet ps2(q.dimension(), f.getFacetT()->coplanarset);
    -        QCOMPARE(ps2.dimension(), 3);
    -        QVERIFY(!ps2.isEmpty());
    -        QVERIFY(!ps2.empty());
    -        coplanarCount += ps2.count();
    -        QCOMPARE(ps2.count(), (int)ps2.size());
    -        QhullPointSet ps3(ps2);
    -        QCOMPARE(ps3.dimension(), 3);
    -        QVERIFY(!ps3.isEmpty());
    -        QCOMPARE(ps3.count(), ps2.count());
    -        QVERIFY(ps3==ps2);
    -        QVERIFY(ps3!=ps);
    -        // ps4= ps3; //compiler error
    -    }
    -    QCOMPARE(coplanarCount, 1000);
    -}//t_construct
    -
    -void QhullPointSet_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QCOMPARE(ps.dimension(), 3);
    -    QVERIFY(ps.count()>=1);   // Sometimes no coplanar points
    -    std::vector vs= ps.toStdVector();
    -    QCOMPARE(vs.size(), ps.size());
    -    QhullPoint p= ps[0];
    -    QhullPoint p2= vs[0];
    -    QCOMPARE(p, p2);
    -    QList qs= ps.toQList();
    -    QCOMPARE(qs.size(), static_cast(ps.size()));
    -    QhullPoint p3= qs[0];
    -    QCOMPARE(p3, p);
    -}//t_convert
    -
    -// readonly tested in t_construct
    -//   dimension, empty, isEmpty, ==, !=, size
    -
    -void QhullPointSet_test::
    -t_element()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    QhullPoint p= ps[0];
    -    QCOMPARE(p, ps[0]);
    -    QhullPoint p2= ps[ps.count()-1];
    -    QCOMPARE(ps.at(1), ps[1]);
    -    QCOMPARE(ps.first(), p);
    -    QCOMPARE(ps.front(), ps.first());
    -    QCOMPARE(ps.last(), p2);
    -    QCOMPARE(ps.back(), ps.last());
    -    QhullPoint p8;
    -    QCOMPARE(ps.value(2), ps[2]);
    -    QCOMPARE(ps.value(-1), p8);
    -    QCOMPARE(ps.value(ps.count()), p8);
    -    QCOMPARE(ps.value(ps.count(), p), p);
    -    QVERIFY(ps.value(1, p)!=p);
    -    QhullPointSet ps8= f.coplanarPoints();
    -    QhullPointSet::Iterator i= ps8.begin();
    -    foreach(QhullPoint p9, ps){  // Qt only
    -        QCOMPARE(p9.dimension(), 3);
    -        QCOMPARE(p9, *i++);
    -    }
    -}//t_element
    -
    -void QhullPointSet_test::
    -t_iterator()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    QhullPointSet::Iterator i= ps.begin();
    -    QhullPointSet::iterator i2= ps.begin();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -    i= ps.begin();
    -    QVERIFY(i==i2);
    -    i2= ps.end();
    -    QVERIFY(i!=i2);
    -    QhullPoint p= *i;
    -    QCOMPARE(p.dimension(), ps.dimension());
    -    QCOMPARE(p, ps[0]);
    -    i2--;
    -    QhullPoint p2= *i2;
    -    QCOMPARE(p2.dimension(), ps.dimension());
    -    QCOMPARE(p2, ps.last());
    -    QhullPointSet::Iterator i5(i2);
    -    QCOMPARE(*i2, *i5);
    -    QhullPointSet::Iterator i3= i+1;
    -    QVERIFY(i!=i3);
    -    QCOMPARE(i[1], *i3);
    -    (i3= i)++;
    -    QCOMPARE((*i3)[0], ps[1][0]);
    -    QCOMPARE((*i3).dimension(), 3);
    -
    -    QVERIFY(i==i);
    -    QVERIFY(i!=i3);
    -    QVERIFY(ii);
    -    QVERIFY(i3>=i);
    -
    -    QhullPointSet::ConstIterator i4= ps.begin();
    -    QVERIFY(i==i4); // iterator COMP const_iterator
    -    QVERIFY(i<=i4);
    -    QVERIFY(i>=i4);
    -    QVERIFY(i4==i); // const_iterator COMP iterator
    -    QVERIFY(i4<=i);
    -    QVERIFY(i4>=i);
    -    QVERIFY(i>=i4);
    -    QVERIFY(i4<=i);
    -    QVERIFY(i2!=i4);
    -    QVERIFY(i2>i4);
    -    QVERIFY(i2>=i4);
    -    QVERIFY(i4!=i2);
    -    QVERIFY(i4i);
    -    QVERIFY(i4>=i);
    -
    -    i= ps.begin();
    -    i2= ps.begin();
    -    QCOMPARE(i, i2++);
    -    QCOMPARE(*i2, ps[1]);
    -    QCOMPARE(++i, i2);
    -    QCOMPARE(i, i2--);
    -    QCOMPARE(i2, ps.begin());
    -    QCOMPARE(--i, i2);
    -    QCOMPARE(i2+=ps.count(), ps.end());
    -    QCOMPARE(i2-=ps.count(), ps.begin());
    -    QCOMPARE(i2+0, ps.begin());
    -    QCOMPARE(i2+ps.count(), ps.end());
    -    i2 += ps.count();
    -    i= i2-0;
    -    QCOMPARE(i, i2);
    -    i= i2-ps.count();
    -    QCOMPARE(i, ps.begin());
    -    QCOMPARE(i2-i, ps.count());
    -
    -    //ps.begin end tested above
    -
    -    // QhullPointSet is const-only
    -}//t_iterator
    -
    -void QhullPointSet_test::
    -t_const_iterator()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    QhullPointSet::ConstIterator i= ps.begin();
    -    QhullPointSet::const_iterator i2= ps.begin();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -
    -    // See t_iterator for const_iterator COMP iterator
    -
    -    i= ps.begin();
    -    QVERIFY(i==i2);
    -    i2= ps.end();
    -    QVERIFY(i!=i2);
    -    QhullPoint p= *i; // QhullPoint is the base class for QhullPointSet::iterator
    -    QCOMPARE(p.dimension(), ps.dimension());
    -    QCOMPARE(p, ps[0]);
    -    i2--;
    -    QhullPoint p2= *i2;
    -    QCOMPARE(p2.dimension(), ps.dimension());
    -    QCOMPARE(p2, ps.last());
    -    QhullPointSet::ConstIterator i5(i2);
    -    QCOMPARE(*i2, *i5);
    -
    -
    -    QhullPointSet::ConstIterator i3= i+1;
    -    QVERIFY(i!=i3);
    -    QCOMPARE(i[1], *i3);
    -
    -    QVERIFY(i==i);
    -    QVERIFY(i!=i3);
    -    QVERIFY(ii);
    -    QVERIFY(i3>=i);
    -
    -    // QhullPointSet is const-only
    -}//t_const_iterator
    -
    -
    -void QhullPointSet_test::
    -t_search()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    QhullPoint p= ps.first();
    -    QhullPoint p2= ps.last();
    -    QVERIFY(ps.contains(p));
    -    QVERIFY(ps.contains(p2));
    -    QVERIFY(p!=p2);
    -    QhullPoint p3= ps[2];
    -    QVERIFY(ps.contains(p3));
    -    QVERIFY(p!=p3);
    -    QhullPoint p4;
    -    QCOMPARE(ps.indexOf(p), 0);
    -    QCOMPARE(ps.indexOf(p2), ps.count()-1);
    -    QCOMPARE(ps.indexOf(p3), 2);
    -    QCOMPARE(ps.indexOf(p4), -1);
    -    QCOMPARE(ps.lastIndexOf(p), 0);
    -    QCOMPARE(ps.lastIndexOf(p2), ps.count()-1);
    -    QCOMPARE(ps.lastIndexOf(p3), 2);
    -    QCOMPARE(ps.lastIndexOf(p4), -1);
    -}//t_search
    -
    -void QhullPointSet_test::
    -t_pointset_iterator()
    -{
    -    RboxPoints rcube("c W0 1000");
    -    Qhull q(rcube,"Qc");  // cube with 1000 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps2= f.outsidePoints();
    -    QVERIFY(ps2.count()==0); // No outside points after constructing the convex hull
    -    QhullPointSetIterator i2= ps2;
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    i2.toBack();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    QhullPointSetIterator i(ps);
    -    i2= ps;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i2.toBack();
    -    i.toFront();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    QhullPoint p= ps[0];
    -    QhullPoint p2(ps[0]);
    -    QCOMPARE(p, p2);
    -    QVERIFY(p==p2);
    -    QhullPoint p3(ps.last());
    - // p2[0]= 0.0;
    -    QVERIFY(p==p2);
    -    QCOMPARE(i2.peekPrevious(), p3);
    -    QCOMPARE(i2.previous(), p3);
    -    QCOMPARE(i2.previous(), ps[ps.count()-2]);
    -    QVERIFY(i2.hasPrevious());
    -    QCOMPARE(i.peekNext(), p);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), p);
    -    QhullPoint p4= i.peekNext();
    -    QVERIFY(p4!=p3);
    -    QCOMPARE(i.next(), p4);
    -    QVERIFY(i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), p);
    -}//t_pointset_iterator
    -
    -void QhullPointSet_test::
    -t_io()
    -{
    -    ostringstream os;
    -    RboxPoints rcube("c W0 120");
    -    Qhull q(rcube,"Qc");  // cube with 100 coplanar points
    -    QhullFacet f= q.firstFacet();
    -    QhullPointSet ps= f.coplanarPoints();
    -    QVERIFY(ps.count()>=3);  // Sometimes no coplanar points
    -    os << "QhullPointSet from coplanarPoints\n" << ps << endl;
    -    os << "\nRunId\n" << ps.print(q.runId());
    -    os << ps.print(q.runId(), "\nRunId w/ message\n");
    -    cout << os.str();
    -    QString s= QString::fromStdString(os.str());
    -    QCOMPARE(s.count("p"), 3*ps.count()+1);
    -    // QCOMPARE(s.count(QRegExp("f\\d")), 3*7 + 13*3*2);
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullPointSet_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoint_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoint_test.cpp
    deleted file mode 100644
    index 6fc1bb7618..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoint_test.cpp
    +++ /dev/null
    @@ -1,397 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullPoint_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullPoint.h"
    -#include "Coordinates.h"
    -#include "RboxPoints.h"
    -#include "QhullError.h"
    -#include "QhullFacet.h"
    -#include "QhullPoint.h"
    -#include "Qhull.h"
    -
    -#include 
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullPoint_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_readonly();
    -    void t_define();
    -    void t_operator();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_qhullpoint_iterator();
    -    void t_io();
    -};//QhullPoint_test
    -
    -void
    -add_QhullPoint_test()
    -{
    -    new QhullPoint_test();
    -}
    -
    -//Executed after each test
    -void QhullPoint_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullPoint_test::
    -t_construct()
    -{
    -    // Qhull.runQhull() constructs QhullFacets as facetT
    -    QhullPoint p;
    -    QVERIFY(!p.isDefined());
    -    QCOMPARE(p.dimension(),0);
    -    QCOMPARE(p.coordinates(),static_cast(0));
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullVertex v2(q.beginVertex());
    -    QhullPoint p2(v2.point());
    -    QVERIFY(p2.isDefined());
    -    QCOMPARE(p2.dimension(),3);
    -    // p= p2;  // copy assignment disabled, ambiguous
    -    QhullPoint p3(p2.dimension(), p2.coordinates());
    -    QCOMPARE(p2, p3);
    -    Coordinates c;
    -    c << 0.0 << 0.0 << 0.0;
    -    QhullPoint p6(c);
    -    QCOMPARE(p6, q.origin());
    -    QhullPoint p5= p2; // copy constructor
    -    QVERIFY(p5==p2);
    -}//t_construct
    -
    -void QhullPoint_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullVertex v= q.firstVertex();
    -    QhullPoint p= v.point();
    -    std::vector vs= p.toStdVector();
    -    QCOMPARE(vs.size(), 3u);
    -    for(int k=3; k--; ){
    -        QCOMPARE(vs[k], p[k]);
    -    }
    -    QList qs= p.toQList();
    -    QCOMPARE(qs.size(), 3);
    -    for(int k=3; k--; ){
    -        QCOMPARE(qs[k], p[k]);
    -    }
    -}//t_convert
    -
    -void QhullPoint_test::
    -t_readonly()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QhullVertexList vs= q.vertexList();
    -        QhullVertexListIterator i(vs);
    -        while(i.hasNext()){
    -            QhullPoint p= i.next().point();
    -            int id= p.id(q.runId());
    -            cout << "p" << id << endl;
    -            QVERIFY(p.isDefined());
    -            QCOMPARE(p.dimension(),3);
    -            QCOMPARE(id, p.id());
    -            QVERIFY(p.id()>=0 && p.id()<9);
    -            const coordT *c= p.coordinates();
    -            coordT *c2= p.coordinates();
    -            QCOMPARE(c, c2);
    -            QCOMPARE(p.dimension(), 3);
    -        }
    -        QhullPoint p2= vs.first().point();
    -        QhullPoint p3= vs.last().point();
    -        QVERIFY(p2!=p3);
    -        QVERIFY(p3.coordinates()!=p2.coordinates());
    -    }
    -}//t_readonly
    -
    -void QhullPoint_test::
    -t_define()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QhullVertexList vs= q.vertexList();
    -        QhullPoint p= vs.first().point();
    -        QhullPoint p2= p;
    -        QVERIFY(p==p2);
    -        QhullPoint p3= vs.last().point();
    -        QVERIFY(p2!=p3);
    -        int idx= (p3.coordinates()-p2.coordinates())/p2.dimension();
    -        QVERIFY(idx>-8 && idx<8);
    -        p2.advancePoint(idx);
    -        QVERIFY(p2==p3);
    -        p2.advancePoint(-idx);
    -        QVERIFY(p2==p);
    -        p2.advancePoint(0);
    -        QVERIFY(p2==p);
    -
    -        QhullPoint p4= p3;
    -        p4.defineAs(p2);
    -        QVERIFY(p2==p4);
    -        QhullPoint p5= p3;
    -        p5.defineAs(p2.dimension(), p2.coordinates());
    -        QVERIFY(p2==p5);
    -        QhullPoint p6= p3;
    -        p6.setCoordinates(p2.coordinates());
    -        QCOMPARE(p2.coordinates(), p6.coordinates());
    -        QVERIFY(p2==p6);
    -        p6.setDimension(2);
    -        QCOMPARE(p6.dimension(), 2);
    -        QVERIFY(p2!=p6);
    -    }
    -}//t_define
    -
    -void QhullPoint_test::
    -t_operator()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    const QhullPoint p= q.firstVertex().point();
    -    //operator== and operator!= tested elsewhere
    -    const coordT *c= p.coordinates();
    -    for(int k=p.dimension(); k--; ){
    -        QCOMPARE(c[k], p[k]);
    -    }
    -    //p[0]= 10.0; // compiler error, const
    -    QhullPoint p2= q.firstVertex().point();
    -    p2[0]= 10.0;  // Overwrites point coordinate
    -    QCOMPARE(p2[0], 10.0);
    -}//t_operator
    -
    -void QhullPoint_test::
    -t_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        QhullPoint p2;
    -        QCOMPARE(p2.begin(), p2.end());
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullPoint p= q.firstVertex().point();
    -        QhullPoint::Iterator i= p.begin();
    -        QhullPoint::iterator i2= p.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= p.begin();
    -        QVERIFY(i==i2);
    -        i2= p.end();
    -        QVERIFY(i!=i2);
    -        double d3= *i;
    -        i2--;
    -        double d2= *i2;
    -        QCOMPARE(d3, p[0]);
    -        QCOMPARE(d2, p[2]);
    -        QhullPoint::Iterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3), p[1]);
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        QhullPoint::ConstIterator i4= p.begin();
    -        QVERIFY(i==i4); // iterator COMP const_iterator
    -        QVERIFY(i<=i4);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4==i); // const_iterator COMP iterator
    -        QVERIFY(i4<=i);
    -        QVERIFY(i4>=i);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4<=i);
    -        QVERIFY(i2!=i4);
    -        QVERIFY(i2>i4);
    -        QVERIFY(i2>=i4);
    -        QVERIFY(i4!=i2);
    -        QVERIFY(i4i);
    -        QVERIFY(i4>=i);
    -
    -        i= p.begin();
    -        i2= p.begin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, p[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, p.begin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2 += 3, p.end());
    -        QCOMPARE(i2 -= 3, p.begin());
    -        QCOMPARE(i2+0, p.begin());
    -        QCOMPARE(i2+3, p.end());
    -        i2 += 3;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-3;
    -        QCOMPARE(i, p.begin());
    -        QCOMPARE(i2-i, 3);
    -
    -        //p.begin end tested above
    -
    -        // QhullPoint is const-only
    -    }
    -}//t_iterator
    -
    -void QhullPoint_test::
    -t_const_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullPoint p= q.firstVertex().point();
    -        QhullPoint::ConstIterator i= p.begin();
    -        QhullPoint::const_iterator i2= p.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= p.begin();
    -        QVERIFY(i==i2);
    -        i2= p.end();
    -        QVERIFY(i!=i2);
    -        double d3= *i;
    -        i2--;
    -        double d2= *i2;
    -        QCOMPARE(d3, p[0]);
    -        QCOMPARE(d2, p[2]);
    -        QhullPoint::ConstIterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3), p[1]);
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        // See t_iterator for const_iterator COMP iterator
    -
    -        i= p.begin();
    -        i2= p.constBegin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, p[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, p.constBegin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2+=3, p.constEnd());
    -        QCOMPARE(i2-=3, p.constBegin());
    -        QCOMPARE(i2+0, p.constBegin());
    -        QCOMPARE(i2+3, p.constEnd());
    -        i2 += 3;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-3;
    -        QCOMPARE(i, p.constBegin());
    -        QCOMPARE(i2-i, 3);
    -
    -        // QhullPoint is const-only
    -    }
    -}//t_const_iterator
    -
    -void QhullPoint_test::
    -t_qhullpoint_iterator()
    -{
    -    QhullPoint p2;
    -    QhullPointIterator i= p2;
    -    QCOMPARE(p2.dimension(), 0);
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullPoint p = q.firstVertex().point();
    -    QhullPointIterator i2(p);
    -    QCOMPARE(p.dimension(), 3);
    -    i= p;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i2.toBack();
    -    i.toFront();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    // i at front, i2 at end/back, 3 coordinates
    -    QCOMPARE(i.peekNext(), p[0]);
    -    QCOMPARE(i2.peekPrevious(), p[2]);
    -    QCOMPARE(i2.previous(), p[2]);
    -    QCOMPARE(i2.previous(), p[1]);
    -    QCOMPARE(i2.previous(), p[0]);
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekNext(), p[0]);
    -    // i.peekNext()= 1.0; // compiler error, i is const
    -    QCOMPARE(i.next(), p[0]);
    -    QCOMPARE(i.peekNext(), p[1]);
    -    QCOMPARE(i.next(), p[1]);
    -    QCOMPARE(i.next(), p[2]);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), p[0]);
    -}//t_qhullpoint_iterator
    -
    -void QhullPoint_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        QhullPoint p= q.beginVertex().point();
    -        ostringstream os;
    -        os << "Point w/o runId:\n";
    -        os << p;
    -        os << "Point w/ runId:\n";
    -        os << p.print(q.runId()) << p.print(q.runId(), " and a message ");
    -        os << p.printWithIdentifier(q.runId(), " Point with id and a message ");
    -        cout << os.str();
    -        QString s= QString::fromStdString(os.str());
    -        QCOMPARE(s.count("p"), 3);
    -        // QCOMPARE(s.count(QRegExp("f\\d")), 3*7 + 13*3*2);
    -    }
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullPoint_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoints_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoints_test.cpp
    deleted file mode 100644
    index 06d7976cdc..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullPoints_test.cpp
    +++ /dev/null
    @@ -1,481 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (p) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullPoints_test.cpp#6 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled header
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "QhullPoints.h"
    -#include "RboxPoints.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -
    -namespace orgQhull {
    -
    -class QhullPoints_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_getset();
    -    void t_element();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_search();
    -    void t_points_iterator();
    -    void t_io();
    -};//QhullPoints_test
    -
    -void
    -add_QhullPoints_test()
    -{
    -    new QhullPoints_test();
    -}
    -
    -//Executed after each testcase
    -void QhullPoints_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullPoints_test::
    -t_construct()
    -{
    -    QhullPoints ps;
    -    QCOMPARE(ps.dimension(), 0);
    -    QVERIFY(ps.isEmpty());
    -    QVERIFY(ps.empty());
    -    QCOMPARE(ps.count(), 0);
    -    QCOMPARE(ps.size(), 0u);
    -    QCOMPARE(ps.coordinateCount(), 0);
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps2;
    -    ps2.defineAs(2, 6, c);
    -    QCOMPARE(ps2.dimension(), 2);
    -    QVERIFY(!ps2.isEmpty());
    -    QVERIFY(!ps2.empty());
    -    QCOMPARE(ps2.count(), 3);
    -    QCOMPARE(ps2.size(), 3u);
    -    QCOMPARE(ps2.coordinates(), c);
    -    QhullPoints ps7(3);
    -    QCOMPARE(ps7.dimension(), 3);
    -    QVERIFY(ps7.isEmpty());
    -    QhullPoints ps3(2, 6, c);
    -    QCOMPARE(ps3.dimension(), 2);
    -    QVERIFY(!ps3.isEmpty());
    -    QCOMPARE(ps3.coordinates(), ps2.coordinates());
    -    QVERIFY(ps3==ps2);
    -    QVERIFY(ps3!=ps);
    -    QhullPoints ps4= ps3;
    -    QVERIFY(ps4==ps3);
    -    // ps4= ps3; //compiler error
    -    QhullPoints ps5(ps4);
    -    QVERIFY(ps5==ps4);
    -    QVERIFY(!(ps5!=ps4));
    -    coordT c2[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps6(2, 6, c2);
    -    QVERIFY(ps6==ps2);
    -}//t_construct
    -
    -void QhullPoints_test::
    -t_convert()
    -{
    -    //defineAs tested above
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps(3, 6, c);
    -    QCOMPARE(ps.dimension(), 3);
    -    QCOMPARE(ps.size(), 2u);
    -    const coordT *c2= ps.constData();
    -    QCOMPARE(c, c2);
    -    const coordT *c3= ps.data();
    -    QCOMPARE(c, c3);
    -    coordT *c4= ps.data();
    -    QCOMPARE(c, c4);
    -    std::vector vs= ps.toStdVector();
    -    QCOMPARE(vs.size(), 2u);
    -    QhullPoint p= vs[1];
    -    QCOMPARE(p[2], 5.0);
    -    QList qs= ps.toQList();
    -    QCOMPARE(qs.size(), 2);
    -    QhullPoint p2= qs[1];
    -    QCOMPARE(p2[2], 5.0);
    -}//t_convert
    -
    -void QhullPoints_test::
    -t_getset()
    -{
    -    //See t_construct for coordinates, count, defineAs, dimension, empty, isempty, ==, !=, size
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps(3, 6, c);
    -    QhullPoints ps2(3, 6, c);
    -    QCOMPARE(ps2.dimension(), 3);
    -    QCOMPARE(ps2.coordinates(), c);
    -    QCOMPARE(ps2.count(), 2);
    -    QCOMPARE(ps2.coordinateCount(), 6);
    -    coordT c2[]= {-1.0, -2.0, -3.0, -4.0, -5.0, -6.0};
    -    ps2.defineAs(6, c2);
    -    QCOMPARE(ps2.coordinates(), c2);
    -    QCOMPARE(ps2.count(), 2);
    -    QCOMPARE(ps2.size(), 2u);
    -    QCOMPARE(ps2.dimension(), 3);
    -    QVERIFY(!ps2.isEmpty());
    -    QVERIFY(ps!=ps2);
    -    // ps2= ps; // assignment not available, compiler error
    -    ps2.defineAs(ps);
    -    QVERIFY(ps==ps2);
    -    ps2.setDimension(2);
    -    QCOMPARE(ps2.dimension(), 2);
    -    QCOMPARE(ps2.coordinates(), c);
    -    QVERIFY(!ps2.isEmpty());
    -    QCOMPARE(ps2.count(), 3);
    -    QCOMPARE(ps2.size(), 3u);
    -    QVERIFY(ps!=ps2);
    -    QhullPoints ps3(3);
    -    ps3.defineAs(5, c2);
    -    QCOMPARE(ps3.count(), 1);
    -    QCOMPARE(ps3.extraCoordinatesCount(), 2);
    -    QCOMPARE(ps3.extraCoordinates()[0], -4.0);
    -    QVERIFY(ps3.includesCoordinates(ps3.data()));
    -    QVERIFY(ps3.includesCoordinates(ps3.data()+ps3.count()-1));
    -    QVERIFY(!ps3.includesCoordinates(ps3.data()-1));
    -    QVERIFY(!ps3.includesCoordinates(ps3.data()+ps3.coordinateCount()));
    -}//t_getset
    -
    -
    -void QhullPoints_test::
    -t_element()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps(2, 6, c);
    -    QhullPoint p(2, c);
    -    QCOMPARE(ps[0], p);
    -    QCOMPARE(ps.at(1), ps[1]);
    -    QCOMPARE(ps.first(), p);
    -    QCOMPARE(ps.front(), ps.first());
    -    QCOMPARE(ps.last(), ps.at(2));
    -    QCOMPARE(ps.back(), ps.last());
    -    QhullPoints ps2= ps.mid(2);
    -    QCOMPARE(ps2.count(), 1);
    -    QhullPoints ps3= ps.mid(3);
    -    QVERIFY(ps3.isEmpty());
    -    QVERIFY(ps3.empty());
    -    QhullPoints ps4= ps.mid(10);
    -    QVERIFY(ps4.isEmpty());
    -    QhullPoints ps5= ps.mid(-1);
    -    QVERIFY(ps5.isEmpty());
    -    QhullPoints ps6= ps.mid(1, 1);
    -    QCOMPARE(ps6.count(), 1);
    -    QCOMPARE(ps6[0], ps[1]);
    -    QhullPoints ps7= ps.mid(1, 10);
    -    QCOMPARE(ps7.count(), 2);
    -    QCOMPARE(ps7[1], ps[2]);
    -    QhullPoint p8;
    -    QCOMPARE(ps.value(2), ps[2]);
    -    QCOMPARE(ps.value(-1), p8);
    -    QCOMPARE(ps.value(3), p8);
    -    QCOMPARE(ps.value(3, p), p);
    -    QVERIFY(ps.value(1, p)!=p);
    -    foreach(QhullPoint p9, ps){  // Qt only
    -        QCOMPARE(p9.dimension(), 2);
    -        QVERIFY(p9[0]==0.0 || p9[0]==2.0 || p9[0]==4.0);
    -    }
    -}//t_element
    -
    -void QhullPoints_test::
    -t_iterator()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0};
    -    QhullPoints ps(1, 3, c);
    -    QhullPoints::Iterator i(ps);
    -    QhullPoints::iterator i2= ps.begin();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -    i= ps.begin();
    -    QVERIFY(i==i2);
    -    i2= ps.end();
    -    QVERIFY(i!=i2);
    -    QhullPoint p(i); // QhullPoint is the base class for QhullPoints::iterator
    -    QCOMPARE(p.dimension(), ps.dimension());
    -    QCOMPARE(p.coordinates(), ps.coordinates());
    -    i2--;
    -    QhullPoint p2= *i2;
    -    QCOMPARE(p[0], 0.0);
    -    QCOMPARE(p2[0], 2.0);
    -    QhullPoints::Iterator i5(i2);
    -    QCOMPARE(*i2, *i5);
    -    coordT c3[]= {0.0, -1.0, -2.0};
    -    QhullPoints::Iterator i3(1, c3);
    -    QVERIFY(i!=i3);
    -    QCOMPARE(*i, *i3);
    -
    -    (i3= i)++;
    -    QCOMPARE((*i3)[0], 1.0);
    -    QCOMPARE(i3->dimension(), 1);
    -    QCOMPARE(i3[0][0], 1.0);
    -    QCOMPARE(i3[0], ps[1]);
    -
    -    QVERIFY(i==i);
    -    QVERIFY(i!=i2);
    -    QVERIFY(ii);
    -    QVERIFY(i2>=i);
    -
    -    QhullPoints::ConstIterator i4(1, c);
    -    QVERIFY(i==i4); // iterator COMP const_iterator
    -    QVERIFY(i<=i4);
    -    QVERIFY(i>=i4);
    -    QVERIFY(i4==i); // const_iterator COMP iterator
    -    QVERIFY(i4<=i);
    -    QVERIFY(i4>=i);
    -    QVERIFY(i>=i4);
    -    QVERIFY(i4<=i);
    -    QVERIFY(i2!=i4);
    -    QVERIFY(i2>i4);
    -    QVERIFY(i2>=i4);
    -    QVERIFY(i4!=i2);
    -    QVERIFY(i4i);
    -    QVERIFY(i4>=i);
    -
    -    i= ps.begin();
    -    i2= ps.begin();
    -    QCOMPARE(i, i2++);
    -    QCOMPARE(*i2, ps[1]);
    -    QCOMPARE(++i, i2);
    -    QCOMPARE(i, i2--);
    -    QCOMPARE(i2, ps.begin());
    -    QCOMPARE(--i, i2);
    -    QCOMPARE(i2+=3, ps.end());
    -    QCOMPARE(i2-=3, ps.begin());
    -    QCOMPARE(i2+0, ps.begin());
    -    QCOMPARE(i2+3, ps.end());
    -    i2 += 3;
    -    i= i2-0;
    -    QCOMPARE(i, i2);
    -    i= i2-3;
    -    QCOMPARE(i, ps.begin());
    -    QCOMPARE(i2-i, 3);
    -
    -    //ps.begin end tested above
    -
    -    // QhullPoints is const-only
    -}//t_iterator
    -
    -void QhullPoints_test::
    -t_const_iterator()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0};
    -    const QhullPoints ps(1, 3, c);
    -    QhullPoints::ConstIterator i(ps);
    -    QhullPoints::const_iterator i2= ps.begin();
    -    QVERIFY(i==i2);
    -    QVERIFY(i>=i2);
    -    QVERIFY(i<=i2);
    -    i= ps.begin();
    -    QVERIFY(i==i2);
    -    i2= ps.end();
    -    QVERIFY(i!=i2);
    -    QhullPoint p(i);
    -    QCOMPARE(p.dimension(), ps.dimension());
    -    QCOMPARE(p.coordinates(), ps.coordinates());
    -    i2--;
    -    QhullPoint p2= *i2;
    -    QCOMPARE(p[0], 0.0);
    -    QCOMPARE(p2[0], 2.0);
    -    QhullPoints::ConstIterator i5(i2);
    -    QCOMPARE(*i2, *i5);
    -    coordT c3[]= {0.0, -1.0, -2.0};
    -    QhullPoints::ConstIterator i3(1, c3);
    -    QVERIFY(i!=i3);
    -    QCOMPARE(*i, *i3);
    -
    -    (i3= i)++;
    -    QCOMPARE((*i3)[0], 1.0);
    -    QCOMPARE(i3->dimension(), 1);
    -    QCOMPARE(i3[0][0], 1.0);
    -    QCOMPARE(i3[0][0], 1.0);
    -    QCOMPARE(i3[0], ps[1]);
    -
    -    QVERIFY(i==i);
    -    QVERIFY(i!=i2);
    -    QVERIFY(ii);
    -    QVERIFY(i2>=i);
    -
    -    // See t_iterator for const_iterator COMP iterator
    -
    -    i= ps.begin();
    -    i2= ps.constBegin();
    -    QCOMPARE(i, i2++);
    -    QCOMPARE(*i2, ps[1]);
    -    QCOMPARE(++i, i2);
    -    QCOMPARE(i, i2--);
    -    QCOMPARE(i2, ps.constBegin());
    -    QCOMPARE(--i, i2);
    -    QCOMPARE(i2+=3, ps.constEnd());
    -    QCOMPARE(i2-=3, ps.constBegin());
    -    QCOMPARE(i2+0, ps.constBegin());
    -    QCOMPARE(i2+3, ps.constEnd());
    -    i2 += 3;
    -    i= i2-0;
    -    QCOMPARE(i, i2);
    -    i= i2-3;
    -    QCOMPARE(i, ps.constBegin());
    -    QCOMPARE(i2-i, 3);
    -
    -    // QhullPoints is const-only
    -}//t_const_iterator
    -
    -
    -void QhullPoints_test::
    -t_search()
    -{
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 0, 1};
    -    QhullPoints ps(2, 8, c); //2-d array of 4 points
    -    QhullPoint p= ps.first();
    -    QhullPoint p2= ps.last();
    -    QVERIFY(ps.contains(p));
    -    QVERIFY(ps.contains(p2));
    -    QVERIFY(p==p2);
    -    QhullPoint p5= ps[2];
    -    QVERIFY(p!=p5);
    -    QVERIFY(ps.contains(p5));
    -    coordT c2[]= {0.0, 1.0, 2.0, 3.0};
    -    QhullPoint p3(2, c2); //2-d point
    -    QVERIFY(ps.contains(p3));
    -    QhullPoint p4(3, c2); //3-d point
    -    QVERIFY(!ps.contains(p4));
    -    p4.defineAs(2, c); //2-d point
    -    QVERIFY(ps.contains(p4));
    -    p4.defineAs(2, c+1); //2-d point
    -    QVERIFY(!ps.contains(p4));
    -    QhullPoint p6(2, c2+2); //2-d point
    -    QCOMPARE(ps.count(p), 2);
    -    QCOMPARE(ps.count(p2), 2);
    -    QCOMPARE(ps.count(p3), 2);
    -    QCOMPARE(ps.count(p4), 0);
    -    QCOMPARE(ps.count(p6), 1);
    -    QCOMPARE(ps.indexOf(&ps[0][0]), 0);
    -    //QCOMPARE(ps.indexOf(ps.end()), -1); //ps.end() is a QhullPoint which may match
    -    QCOMPARE(ps.indexOf(0), -1);
    -    QCOMPARE(ps.indexOf(&ps[3][0]), 3);
    -    QCOMPARE(ps.indexOf(&ps[3][1], QhullError::NOthrow), 3);
    -    QCOMPARE(ps.indexOf(ps.data()+ps.coordinateCount(), QhullError::NOthrow), -1);
    -    QCOMPARE(ps.indexOf(p), 0);
    -    QCOMPARE(ps.indexOf(p2), 0);
    -    QCOMPARE(ps.indexOf(p3), 0);
    -    QCOMPARE(ps.indexOf(p4), -1);
    -    QCOMPARE(ps.indexOf(p5), 2);
    -    QCOMPARE(ps.indexOf(p6), 1);
    -    QCOMPARE(ps.lastIndexOf(p), 3);
    -    QCOMPARE(ps.lastIndexOf(p4), -1);
    -    QCOMPARE(ps.lastIndexOf(p6), 1);
    -    QhullPoints ps2(3);
    -    QCOMPARE(ps2.indexOf(ps2.data()), -1);
    -    QCOMPARE(ps2.indexOf(ps2.data()+1, QhullError::NOthrow), -1);
    -    QCOMPARE(ps2.indexOf(p), -1);
    -    QCOMPARE(ps2.lastIndexOf(p), -1);
    -    QhullPoints ps3;
    -    QCOMPARE(ps3.indexOf(ps3.data()), -1);
    -    QCOMPARE(ps3.indexOf(ps3.data()+1, QhullError::NOthrow), -1);
    -    QCOMPARE(ps3.indexOf(p), -1);
    -    QCOMPARE(ps3.lastIndexOf(p), -1);
    -    QhullPoints ps4(2, 0, c);
    -    QCOMPARE(ps4.indexOf(p), -1);
    -    QCOMPARE(ps4.lastIndexOf(p), -1);
    -}//t_search
    -
    -void QhullPoints_test::
    -t_points_iterator()
    -{
    -    coordT c2[]= {0.0};
    -    QhullPoints ps2(0, 0, c2); // 0-dimensional
    -    QhullPointsIterator i2= ps2;
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    i2.toBack();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps(3, 6, c); // 3-dimensional
    -    QhullPointsIterator i(ps);
    -    i2= ps;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i2.toBack();
    -    i.toFront();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    QhullPoint p= ps[0];
    -    QhullPoint p2(ps[0]);
    -    QCOMPARE(p, p2);
    -    QVERIFY(p==p2);
    -    QhullPoint p3(ps[1]);
    - // p2[0]= 0.0;
    -    QVERIFY(p==p2);
    -    QCOMPARE(i2.peekPrevious(), p3);
    -    QCOMPARE(i2.previous(), p3);
    -    QCOMPARE(i2.previous(), p);
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekNext(), p);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), p);
    -    QCOMPARE(i.peekNext(), p3);
    -    QCOMPARE(i.next(), p3);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), p);
    -}//t_points_iterator
    -
    -void QhullPoints_test::
    -t_io()
    -{
    -    QhullPoints ps;
    -    ostringstream os;
    -    os << "Empty QhullPoints\n" << ps << endl;
    -    coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
    -    QhullPoints ps2(3, 6, c); // 3-dimensional explicit
    -    os << "QhullPoints from c[]\n" << ps2 << endl;
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullPoints ps3= q.points();
    -    os << "QhullPoints\n" << ps3;
    -    os << "RunId\n" << ps3.print(q.runId());
    -    os << ps3.print(q.runId(), "RunId w/ message\n");
    -    os << ps3.printWithIdentifier(q.runId(), "RunId w/ identifiers\n");
    -    cout << os.str();
    -    QString s= QString::fromStdString(os.str());
    -    QCOMPARE(s.count("p"), 3*8+3);
    -    // QCOMPARE(s.count(QRegExp("f\\d")), 3*7 + 13*3*2);
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullPoints_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullRidge_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullRidge_test.cpp
    deleted file mode 100644
    index 7ac5c8c804..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullRidge_test.cpp
    +++ /dev/null
    @@ -1,163 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullRidge_test.cpp#5 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullRidge.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "QhullFacet.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullRidge_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_getSet();
    -    void t_foreach();
    -    void t_io();
    -};//QhullRidge_test
    -
    -void
    -add_QhullRidge_test()
    -{
    -    new QhullRidge_test();
    -}
    -
    -//Executed after each testcase
    -void QhullRidge_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullRidge_test::
    -t_construct()
    -{
    -    // Qhull.runQhull() constructs QhullFacets as facetT
    -    QhullRidge r;
    -    QVERIFY(!r.isDefined());
    -    QCOMPARE(r.dimension(),0);
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // triangulation of rotated unit cube
    -    QhullFacet f(q.firstFacet());
    -    QhullRidgeSet rs(f.ridges());
    -    QVERIFY(!rs.isEmpty()); // Simplicial facets do not have ridges()
    -    QhullRidge r2(rs.first());
    -    QCOMPARE(r2.dimension(), 2); // One dimension lower than the facet
    -    r= r2;
    -    QVERIFY(r.isDefined());
    -    QCOMPARE(r.dimension(), 2);
    -    QhullRidge r3= r2.getRidgeT();
    -    QCOMPARE(r,r3);
    -    QhullRidge r4= r2.getBaseT();
    -    QCOMPARE(r,r4);
    -    QhullRidge r5= r2; // copy constructor
    -    QVERIFY(r5==r2);
    -    QVERIFY(r5==r);
    -}//t_construct
    -
    -void QhullRidge_test::
    -t_getSet()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q.facetCount(), 6);
    -        QCOMPARE(q.vertexCount(), 8);
    -        QhullFacet f(q.firstFacet());
    -        QhullRidgeSet rs= f.ridges();
    -        QhullRidgeSetIterator i(rs);
    -        while(i.hasNext()){
    -            const QhullRidge r= i.next();
    -            cout << r.id() << endl;
    -            QVERIFY(r.bottomFacet()!=r.topFacet());
    -            QCOMPARE(r.dimension(), 2); // Ridge one-dimension less than facet
    -            QVERIFY(r.id()>=0 && r.id()<9*27);
    -            QVERIFY(r.isDefined());
    -            QVERIFY(r==r);
    -            QVERIFY(r==i.peekPrevious());
    -            QCOMPARE(r.otherFacet(r.bottomFacet()),r.topFacet());
    -            QCOMPARE(r.otherFacet(r.topFacet()),r.bottomFacet());
    -        }
    -        QhullRidgeSetIterator i2(i);
    -        QEXPECT_FAIL("", "SetIterator copy constructor not reset to BOT", Continue);
    -        QVERIFY(!i2.hasPrevious());
    -    }
    -}//t_getSet
    -
    -void QhullRidge_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c");  // cube
    -    {
    -        Qhull q(rcube, "QR0"); // rotated cube
    -        QhullFacet f(q.firstFacet());
    -        foreach (QhullRidge r, f.ridges()){  // Qt only
    -            QhullVertexSet vs= r.vertices();
    -            QCOMPARE(vs.count(), 2);
    -            foreach (QhullVertex v, vs){  // Qt only
    -                QVERIFY(f.vertices().contains(v));
    -            }
    -        }
    -        QhullRidgeSet rs= f.ridges();
    -        QhullRidge r= rs.first();
    -        QhullRidge r2= r;
    -        QList vs;
    -        int count= 0;
    -        while(!count || r2!=r){
    -            ++count;
    -            QhullVertex v;
    -            QVERIFY2(r2.hasNextRidge3d(f),"A cube should only have non-simplicial facets.");
    -            QhullRidge r3= r2.nextRidge3d(f, &v);
    -            QVERIFY(!vs.contains(v));
    -            vs << v;
    -            r2= r2.nextRidge3d(f);
    -            QCOMPARE(r3, r2);
    -        }
    -        QCOMPARE(vs.count(), rs.count());
    -        QCOMPARE(count, rs.count());
    -    }
    -}//t_foreach
    -
    -void QhullRidge_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        QhullFacet f(q.firstFacet());
    -        QhullRidgeSet rs= f.ridges();
    -        QhullRidge r= rs.first();
    -        ostringstream os;
    -        os << "Ridges Without runId\n" << rs << "Ridge\n" << r;
    -        os << "Ridge with runId\n" << r.print(q.runId());
    -        cout << os.str();
    -        QString s= QString::fromStdString(os.str());
    -        QCOMPARE(s.count(" r"), 6+2);
    -    }
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullRidge_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullSet_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullSet_test.cpp
    deleted file mode 100644
    index 7147388631..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullSet_test.cpp
    +++ /dev/null
    @@ -1,435 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2009-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullSet_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "QhullRidge.h"
    -#include "QhullFacetSet.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -
    -namespace orgQhull {
    -
    -class QhullSet_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_qhullsetbase();
    -    void t_convert();
    -    void t_element();
    -    void t_search();
    -    void t_iterator();
    -    void t_const_iterator();
    -    void t_qhullset_iterator();
    -    void t_io();
    -};//QhullSet_test
    -
    -void
    -add_QhullSet_test()
    -{
    -    new QhullSet_test();
    -}
    -
    -//Executed after each testcase
    -void QhullSet_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -// Test QhullFacetSet and QhullSet.
    -// Use QhullRidgeSet to test methods overloaded by QhullFacetSet
    -
    -void QhullSet_test::
    -t_qhullsetbase()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // triangulation of rotated unit cube
    -        // Fake an empty set.  Default constructor not defined.  No memory allocation.
    -        QhullFacet f4 = q.beginFacet();
    -        QhullFacetSet fs = f4.neighborFacets();
    -        fs.defineAs(q.qhullQh()->other_points); // Force an empty set
    -        QVERIFY(fs.isEmpty());
    -        QVERIFY(fs.empty());
    -        QCOMPARE(fs.count(), 0);
    -        QCOMPARE(fs.size(), 0u);
    -        QCOMPARE(fs.begin(), fs.end()); // beginPointer(), endPointer()
    -        QVERIFY(QhullSetBase::isEmpty(fs.getSetT()));
    -
    -        QhullRidgeSet rs = f4.ridges();
    -        QVERIFY(!rs.isEmpty());
    -        QVERIFY(!rs.empty());
    -        QCOMPARE(rs.count(), 4);
    -        QCOMPARE(rs.size(), 4u);
    -        QVERIFY(rs.begin()!=rs.end());
    -        QVERIFY(!QhullSetBase::isEmpty(rs.getSetT()));
    -        QhullRidgeSet rs2= rs; // copy constructor
    -        // rs= rs2; // disabled.  Would not copy ridges
    -        QCOMPARE(rs2, rs);
    -
    -        QCOMPARE(q.facetCount(), 6);
    -        QhullFacet f = q.beginFacet();
    -        QhullFacetSet fs2 = f.neighborFacets();
    -        QCOMPARE(fs2.count(), 4);
    -        QCOMPARE(fs2.size(), 4u);
    -        QVERIFY(!fs2.isEmpty());
    -        QVERIFY(!QhullSetBase::isEmpty(fs2.getSetT()));
    -        QVERIFY(!fs2.empty());
    -        QVERIFY(fs!=fs2);
    -        setT *s= fs2.getSetT();
    -        fs.defineAs(s);
    -        QVERIFY(fs==fs2);
    -        QCOMPARE(fs[1], fs2[1]); // elementPointer
    -        QhullFacetSet fs3(fs2);
    -        QVERIFY(fs3==fs);
    -        // fs= fs2; // disabled.  Would not copy facets
    -        QhullFacetSet fs4= fs2; // copy constructor
    -        QVERIFY(fs4==fs2);
    -    }
    -}//t_qhullsetbase
    -
    -// constructors tested by t_qhullsetbase
    -
    -void QhullSet_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullFacet f= q.firstFacet();
    -        f= f.next();
    -        QhullRidgeSet rs= f.ridges();
    -        QCOMPARE(rs.count(),4);
    -        std::vector rv= rs.toStdVector();
    -        QCOMPARE(rv.size(), 4u);
    -        QList rv2= rs.toQList();
    -        QCOMPARE(rv2.size(), 4);
    -        std::vector::iterator i= rv.begin();
    -        foreach(QhullRidge r, rv2){  // Qt only
    -            QhullRidge r2= *i++;
    -            QCOMPARE(r, r2);
    -        }
    -
    -        Qhull q2(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q2.facetCount(), 12);
    -        QhullFacet f2 = q2.beginFacet();
    -        QhullFacetSet fs = f2.neighborFacets();
    -        QCOMPARE(fs.size(), 3U);
    -        std::vector vs= fs.toStdVector();
    -        QCOMPARE(vs.size(), fs.size());
    -        for(int k= fs.count(); k--; ){
    -            QCOMPARE(vs[k], fs[k]);
    -        }
    -        QList qv= fs.toQList();
    -        QCOMPARE(qv.count(), fs.count());
    -        for(int k= fs.count(); k--; ){
    -            QCOMPARE(qv[k], fs[k]);
    -        }
    -    }
    -}//t_convert
    -
    -//ReadOnly (count, isEmpty) tested by t_convert
    -//  operator== tested by t_search
    -
    -void QhullSet_test::
    -t_element()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacet f = q.beginFacet();
    -    QhullFacetSet fs = f.neighborFacets();
    -
    -    QCOMPARE(fs.at(1), fs[1]);
    -    QCOMPARE(fs.first(), fs[0]);
    -    QCOMPARE(fs.front(), fs.first());
    -    QCOMPARE(fs.last(), fs.at(3));
    -    QCOMPARE(fs.back(), fs.last());
    -    QhullFacet *d= fs.data();
    -    const QhullFacet *d2= fs.data();
    -    const QhullFacet *d3= fs.constData();
    -    QVERIFY(d==d2);
    -    QVERIFY(d2==d3);
    -    QCOMPARE(*d, fs.first());
    -    QCOMPARE(d+4, fs.end());
    -    QCOMPARE((d+4)->getFacetT(), static_cast(0));
    -    QhullFacet f4= *(d+4);
    -    QVERIFY(!f4.isDefined());
    -    QCOMPARE(fs.second(), fs[1]);
    -    const QhullFacet f2= fs.second();
    -    QVERIFY(f2==fs[1]);
    -    const QhullFacet f3= fs[1];
    -    QCOMPARE(f2, f3);
    -
    -    QCOMPARE(fs.value(2), fs[2]);
    -    QCOMPARE(fs.value(-1), QhullFacet());
    -    QCOMPARE(fs.value(10), QhullFacet());
    -    QCOMPARE(fs.value(2, f), fs[2]);
    -    QCOMPARE(fs.value(4, f), f);
    -    // mid() not available (read-only)
    -}//t_element
    -
    -void QhullSet_test::
    -t_search()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacet f = q.beginFacet();
    -    QhullFacetSet fs = f.neighborFacets();
    -    QhullFacet f2= *fs.begin();
    -    QhullFacet f3= fs.last();
    -    QVERIFY(fs.contains(f2));
    -    QVERIFY(fs.contains(f3));
    -    QVERIFY(!fs.contains(f));
    -
    -    QhullFacetSet fs2= f2.neighborFacets();
    -    QVERIFY(fs==fs);
    -    QVERIFY(fs!=fs2);
    -    QCOMPARE(fs.count(f2), 1);
    -    QCOMPARE(fs.count(f3), 1);
    -    QCOMPARE(fs.count(f), 0);
    -    QCOMPARE(fs.indexOf(f2), 0);
    -    QCOMPARE(fs.indexOf(f3), 3);
    -    QCOMPARE(fs.indexOf(f), -1);
    -    QCOMPARE(fs.lastIndexOf(f2), 0);
    -    QCOMPARE(fs.lastIndexOf(f3), 3);
    -    QCOMPARE(fs.lastIndexOf(f), -1);
    -}//t_search
    -
    -void QhullSet_test::
    -t_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullFacet f = q.beginFacet();
    -        QhullFacetSet fs = f.neighborFacets();
    -        QhullFacetSet::Iterator i= fs.begin();
    -        QhullFacetSet::iterator i2= fs.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= fs.begin();
    -        QVERIFY(i==i2);
    -        i2= fs.end();
    -        QVERIFY(i!=i2);
    -        QhullFacet f3(*i);
    -        i2--;
    -        QhullFacet f2= *i2;
    -        QCOMPARE(f3.id(), fs[0].id());
    -        QCOMPARE(f2.id(), fs[3].id());
    -        QhullFacetSet::Iterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3).id(), fs[1].id());
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        QhullFacetSet::ConstIterator i4= fs.begin();
    -        QVERIFY(i==i4); // iterator COMP const_iterator
    -        QVERIFY(i<=i4);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4==i); // const_iterator COMP iterator
    -        QVERIFY(i4<=i);
    -        QVERIFY(i4>=i);
    -        QVERIFY(i>=i4);
    -        QVERIFY(i4<=i);
    -        QVERIFY(i2!=i4);
    -        QVERIFY(i2>i4);
    -        QVERIFY(i2>=i4);
    -        QVERIFY(i4!=i2);
    -        QVERIFY(i4i);
    -        QVERIFY(i4>=i);
    -
    -        i= fs.begin();
    -        i2= fs.begin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, fs[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, fs.begin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2 += 4, fs.end());
    -        QCOMPARE(i2 -= 4, fs.begin());
    -        QCOMPARE(i2+0, fs.begin());
    -        QCOMPARE(i2+4, fs.end());
    -        i2 += 4;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-4;
    -        QCOMPARE(i, fs.begin());
    -        QCOMPARE(i2-i, 4);
    -
    -        //fs.begin end tested above
    -
    -        // QhullFacetSet is const-only
    -    }
    -}//t_iterator
    -
    -void QhullSet_test::
    -t_const_iterator()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0");  // rotated unit cube
    -        QhullFacet f = q.beginFacet();
    -        QhullFacetSet fs = f.neighborFacets();
    -        QhullFacetSet::ConstIterator i= fs.begin();
    -        QhullFacetSet::const_iterator i2= fs.begin();
    -        QVERIFY(i==i2);
    -        QVERIFY(i>=i2);
    -        QVERIFY(i<=i2);
    -        i= fs.begin();
    -        QVERIFY(i==i2);
    -        i2= fs.end();
    -        QVERIFY(i!=i2);
    -        QhullFacet f3(*i);
    -        i2--;
    -        QhullFacet f2= *i2;
    -        QCOMPARE(f3.id(), fs[0].id());
    -        QCOMPARE(f2.id(), fs[3].id());
    -        QhullFacetSet::ConstIterator i3(i2);
    -        QCOMPARE(*i2, *i3);
    -
    -        (i3= i)++;
    -        QCOMPARE((*i3).id(), fs[1].id());
    -        QVERIFY(i==i);
    -        QVERIFY(i!=i2);
    -        QVERIFY(ii);
    -        QVERIFY(i2>=i);
    -
    -        // See t_iterator for const_iterator COMP iterator
    -
    -        i= fs.begin();
    -        i2= fs.constBegin();
    -        QCOMPARE(i, i2++);
    -        QCOMPARE(*i2, fs[1]);
    -        QCOMPARE(++i, i2);
    -        QCOMPARE(i, i2--);
    -        QCOMPARE(i2, fs.constBegin());
    -        QCOMPARE(--i, i2);
    -        QCOMPARE(i2+=4, fs.constEnd());
    -        QCOMPARE(i2-=4, fs.constBegin());
    -        QCOMPARE(i2+0, fs.constBegin());
    -        QCOMPARE(i2+4, fs.constEnd());
    -        i2 += 4;
    -        i= i2-0;
    -        QCOMPARE(i, i2);
    -        i= i2-4;
    -        QCOMPARE(i, fs.constBegin());
    -        QCOMPARE(i2-i, 4);
    -
    -        // QhullFacetSet is const-only
    -    }
    -}//t_const_iterator
    -
    -void QhullSet_test::
    -t_qhullset_iterator()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    // Fake an empty set.  Default constructor not defined.  No memory allocation.
    -    QhullFacet f = q.beginFacet();
    -    QhullFacetSet fs = f.neighborFacets();
    -    fs.defineAs(q.qhullQh()->other_points);
    -    QhullFacetSetIterator i= fs;
    -    QCOMPARE(fs.count(), 0);
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i.toBack();
    -    QVERIFY(!i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    QhullFacet f2 = q.beginFacet();
    -    QhullFacetSet fs2 = f2.neighborFacets();
    -    QhullFacetSetIterator i2(fs2);
    -    QCOMPARE(fs2.count(), 4);
    -    i= fs2;
    -    QVERIFY(i2.hasNext());
    -    QVERIFY(!i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -    i2.toBack();
    -    i.toFront();
    -    QVERIFY(!i2.hasNext());
    -    QVERIFY(i2.hasPrevious());
    -    QVERIFY(i.hasNext());
    -    QVERIFY(!i.hasPrevious());
    -
    -    // i at front, i2 at end/back, 4 neighbors
    -    QhullFacetSet fs3 = f2.neighborFacets(); // same as fs2
    -    QhullFacet f3(fs2[0]);
    -    QhullFacet f4= fs3[0];
    -    QCOMPARE(f3, f4);
    -    QVERIFY(f3==f4);
    -    QhullFacet f5(fs3[1]);
    -    QVERIFY(f4!=f5);
    -    QhullFacet f6(fs3[2]);
    -    QhullFacet f7(fs3[3]);
    -    QCOMPARE(i2.peekPrevious(), f7);
    -    QCOMPARE(i2.previous(), f7);
    -    QCOMPARE(i2.previous(), f6);
    -    QCOMPARE(i2.previous(), f5);
    -    QCOMPARE(i2.previous(), f4);
    -    QVERIFY(!i2.hasPrevious());
    -    QCOMPARE(i.peekNext(), f4);
    -    // i.peekNext()= 1.0; // compiler error
    -    QCOMPARE(i.next(), f4);
    -    QCOMPARE(i.peekNext(), f5);
    -    QCOMPARE(i.next(), f5);
    -    QCOMPARE(i.next(), f6);
    -    QCOMPARE(i.next(), f7);
    -    QVERIFY(!i.hasNext());
    -    i.toFront();
    -    QCOMPARE(i.next(), f4);
    -}//t_qhullset_iterator
    -
    -void QhullSet_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    // Fake an empty set.  Default constructor not defined.  No memory allocation.
    -    QhullFacet f= q.beginFacet();
    -    QhullFacetSet fs= f.neighborFacets();
    -    fs.defineAs(q.qhullQh()->other_points);
    -    cout << "INFO:     empty set" << fs << std::endl;
    -    QhullFacet f2= q.beginFacet();
    -    QhullFacetSet fs2= f2.neighborFacets();
    -    cout << "INFO:   Neighboring facets\n";
    -    cout << fs2 << std::endl;
    -
    -    QhullRidgeSet rs= f.ridges();
    -    cout << "INFO:   Ridges for a facet\n";
    -    cout << rs << std::endl;
    -}//t_io
    -
    -}//namespace orgQhull
    -
    -#include "moc/QhullSet_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertexSet_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertexSet_test.cpp
    deleted file mode 100644
    index d417e6206b..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertexSet_test.cpp
    +++ /dev/null
    @@ -1,185 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullVertexSet_test.cpp#3 $$Change: 1464 $
    -** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#include 
    -#include "../road/RoadTest.h" // FIXUP First for QHULL_USES_QT
    -
    -#include "Qhull.h"
    -#include "QhullError.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetSet.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullFacetSet_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_convert();
    -    void t_readonly();
    -    void t_foreach();
    -    void t_io();
    -};//QhullFacetSet_test
    -
    -void
    -add_QhullFacetSet_test()
    -{
    -    new QhullFacetSet_test();
    -}
    -
    -//Executed after each testcase
    -void QhullFacetSet_test::
    -cleanup()
    -{
    -    RoadTest::cleanup();
    -    UsingQhullLib::checkQhullMemoryEmpty();
    -}
    -
    -void QhullFacetSet_test::
    -t_construct()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacet f= q.firstFacet();
    -    QhullFacetSet fs2= f.neighborFacets();
    -    QVERIFY(!fs2.isEmpty());
    -    QCOMPARE(fs2.count(),4);
    -    QhullFacetSet fs4= fs2; // copy constructor
    -    QVERIFY(fs4==fs2);
    -    QhullFacetSet fs3(q.qhullQh()->facet_mergeset);
    -    QVERIFY(fs3.isEmpty());
    -}//t_construct
    -
    -void QhullFacetSet_test::
    -t_convert()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QR0 QV2");  // rotated unit cube
    -    QhullFacet f= q.firstFacet();
    -    QhullFacetSet fs2= f.neighborFacets();
    -    QVERIFY(!fs2.isSelectAll());
    -    QCOMPARE(fs2.count(),2);
    -    std::vector fv= fs2.toStdVector();
    -    QCOMPARE(fv.size(), 2u);
    -    QList fv2= fs2.toQList();
    -    QCOMPARE(fv2.size(), 2);
    -    fs2.selectAll();
    -    QVERIFY(fs2.isSelectAll());
    -    std::vector fv3= fs2.toStdVector();
    -    QCOMPARE(fv3.size(), 4u);
    -    QList fv4= fs2.toQList();
    -    QCOMPARE(fv4.size(), 4);
    -}//t_convert
    -
    -//! Spot check properties and read-only.  See QhullSet_test
    -void QhullFacetSet_test::
    -t_readonly()
    -{
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"QV0");  // good facets are adjacent to point 0
    -    QhullFacetSet fs= q.firstFacet().neighborFacets();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 2);
    -    fs.selectAll();
    -    QVERIFY(fs.isSelectAll());
    -    QCOMPARE(fs.count(), 4);
    -    fs.selectGood();
    -    QVERIFY(!fs.isSelectAll());
    -    QCOMPARE(fs.count(), 2);
    -    QhullFacet f= fs.first();
    -    QhullFacet f2= fs.last();
    -    fs.selectAll();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(fs.contains(f2));
    -    QVERIFY(f.isGood());
    -    QVERIFY(!f2.isGood());
    -    fs.selectGood();
    -    QVERIFY(fs.contains(f));
    -    QVERIFY(!fs.contains(f2));
    -}//t_readonly
    -
    -void QhullFacetSet_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c");
    -    // Spot check predicates and accessors.  See QhullLinkedList_test
    -    Qhull q(rcube,"QR0");  // rotated unit cube
    -    QhullFacetSet fs= q.firstFacet().neighborFacets();
    -    QVERIFY(!fs.contains(q.firstFacet()));
    -    QVERIFY(fs.contains(fs.first()));
    -    QhullFacet f= q.firstFacet().next();
    -    if(!fs.contains(f)){
    -        f= f.next();
    -    }
    -    QVERIFY(fs.contains(f));
    -    QCOMPARE(fs.first(), *fs.begin());
    -    QCOMPARE(*(fs.end()-1), fs.last());
    -}//t_foreach
    -
    -void QhullFacetSet_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"QR0 QV0");   // good facets are adjacent to point 0
    -        QhullFacetSet fs= q.firstFacet().neighborFacets();
    -        ostringstream os;
    -        os << fs.print(q.runId(), "Neighbors of first facet with point 0");
    -        os << fs.printIdentifiers("\nFacet identifiers: ");
    -        cout<< os.str();
    -        QString facets= QString::fromStdString(os.str());
    -        QCOMPARE(facets.count(QRegExp(" f[0-9]")), 2+13*2);
    -    }
    -}//t_io
    -
    -//FIXUP -- Move conditional, QhullFacetSet code to QhullFacetSet.cpp
    -#ifndef QHULL_NO_STL
    -std::vector QhullFacetSet::
    -toStdVector() const
    -{
    -    QhullSetIterator i(*this);
    -    std::vector vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.push_back(f);
    -        }
    -    }
    -    return vs;
    -}//toStdVector
    -#endif //QHULL_NO_STL
    -
    -#ifdef QHULL_USES_QT
    -QList QhullFacetSet::
    -toQList() const
    -{
    -    QhullSetIterator i(*this);
    -    QList vs;
    -    while(i.hasNext()){
    -        QhullFacet f= i.next();
    -        if(isSelectAll() || f.isGood()){
    -            vs.append(f);
    -        }
    -    }
    -    return vs;
    -}//toQList
    -#endif //QHULL_USES_QT
    -
    -}//orgQhull
    -
    -#include "moc/QhullFacetSet_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertex_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertex_test.cpp
    deleted file mode 100644
    index 1ef87186fe..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/QhullVertex_test.cpp
    +++ /dev/null
    @@ -1,184 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/QhullVertex_test.cpp#6 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h"
    -
    -#include "QhullVertex.h"
    -#include "Coordinates.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetSet.h"
    -#include "QhullVertexSet.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::ostream;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -class QhullVertex_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_constructConvert();
    -    void t_getSet();
    -    void t_foreach();
    -    void t_io();
    -};//QhullVertex_test
    -
    -void
    -add_QhullVertex_test()
    -{
    -    new QhullVertex_test();
    -}
    -
    -//Executed after each testcase
    -void QhullVertex_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void QhullVertex_test::
    -t_constructConvert()
    -{
    -    // Qhull.runQhull() constructs QhullFacets as facetT
    -    QhullVertex v;
    -    QVERIFY(!v.isDefined());
    -    QCOMPARE(v.dimension(),0);
    -    RboxPoints rcube("c");
    -    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -    QhullVertex v2(q.beginVertex());
    -    QCOMPARE(v2.dimension(),3);
    -    v= v2;  // copy assignment
    -    QVERIFY(v.isDefined());
    -    QCOMPARE(v.dimension(),3);
    -    QhullVertex v5= v2; // copy constructor
    -    QVERIFY(v5==v2);
    -    QVERIFY(v5==v);
    -    QhullVertex v3= v2.getVertexT();
    -    QCOMPARE(v,v3);
    -    QhullVertex v4= v2.getBaseT();
    -    QCOMPARE(v,v4);
    -}//t_constructConvert
    -
    -void QhullVertex_test::
    -t_getSet()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    -        QCOMPARE(q.facetCount(), 12);
    -        QCOMPARE(q.vertexCount(), 8);
    -
    -        // Also spot-test QhullVertexList.  See QhullLinkedList_test.cpp
    -        QhullVertexList vs= q.vertexList();
    -        QhullVertexListIterator i(vs);
    -        while(i.hasNext()){
    -            const QhullVertex v= i.next();
    -            cout << v.id() << endl;
    -            QCOMPARE(v.dimension(),3);
    -            QVERIFY(v.id()>=0 && v.id()<9);
    -            QVERIFY(v.isDefined());
    -            if(i.hasNext()){
    -                QCOMPARE(v.next(), i.peekNext());
    -                QVERIFY(v.next()!=v);
    -                QVERIFY(v.next().previous()==v);
    -            }
    -            QVERIFY(i.hasPrevious());
    -            QCOMPARE(v, i.peekPrevious());
    -        }
    -        QhullVertexListIterator i2(i);
    -        QEXPECT_FAIL("", "ListIterator copy constructor not reset to BOT", Continue);
    -        QVERIFY(!i2.hasPrevious());
    -
    -        // test point()
    -        foreach (QhullVertex v, q.vertexList()){  // Qt only
    -            QhullPoint p= v.point();
    -            int j= p.id(q.runId());
    -            cout << "Point " << j << ":\n" << p.print(q.runId()) << endl;
    -            QVERIFY(j>=0 && j<8);
    -        }
    -    }
    -}//t_getSet
    -
    -void QhullVertex_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c W0 300");  // 300 points on surface of cube
    -    {
    -        Qhull q(rcube, "QR0 Qc"); // keep coplanars, thick facet, and rotate the cube
    -        foreach (QhullVertex v, q.vertexList()){  // Qt only
    -            QhullFacetSet fs= v.neighborFacets();
    -            QCOMPARE(fs.count(), 3);
    -            foreach (QhullFacet f, fs){  // Qt only
    -                QVERIFY(f.vertices().contains(v));
    -            }
    -        }
    -    }
    -}//t_foreach
    -
    -void QhullVertex_test::
    -t_io()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q(rcube, "");
    -        QhullVertex v= q.beginVertex();
    -        ostringstream os;
    -        os << "Vertex and vertices w/o runId:\n";
    -        os << v;
    -        QhullVertexSet vs= q.firstFacet().vertices();
    -        os << vs;
    -        os << "Vertex and vertices w/ runId:\n";
    -        os << v.print(q.runId());
    -        os << vs.print(q.runId(), "vertices:");
    -        cout << os.str();
    -        QString s= QString::fromStdString(os.str());
    -        QCOMPARE(s.count("(v"), 10);
    -        QCOMPARE(s.count(": f"), 2);
    -    }
    -    RboxPoints r10("10 D3");  // Without QhullVertex::facetNeighbors
    -    {
    -        Qhull q(r10, "");
    -        QhullVertex v= q.beginVertex();
    -        ostringstream os;
    -        os << "\nTry again with simplicial facets.  No neighboring facets listed for vertices.\n";
    -        os << "Vertex and vertices w/o runId:\n";
    -        os << v;
    -        q.defineVertexNeighborFacets();
    -        os << "This time with neighborFacets() defined for all vertices:\n";
    -        os << v;
    -        cout << os.str();
    -        QString s= QString::fromStdString(os.str());
    -        QCOMPARE(s.count(": f"), 1);
    -
    -        Qhull q2(r10, "v"); // Voronoi diagram
    -        QhullVertex v2= q2.beginVertex();
    -        ostringstream os2;
    -        os2 << "\nTry again with Voronoi diagram of simplicial facets.  Neighboring facets automatically defined for vertices.\n";
    -        os2 << "Vertex and vertices w/o runId:\n";
    -        os2 << v2;
    -        cout << os2.str();
    -        QString s2= QString::fromStdString(os2.str());
    -        QCOMPARE(s2.count(": f"), 1);
    -    }
    -}//t_io
    -
    -}//orgQhull
    -
    -#include "moc/QhullVertex_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Qhull_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Qhull_test.cpp
    deleted file mode 100644
    index f1f2ab5b2f..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/Qhull_test.cpp
    +++ /dev/null
    @@ -1,380 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/Qhull_test.cpp#5 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "Qhull.h"
    -#include "QhullError.h"
    -#include "RboxPoints.h"
    -#include "QhullFacetList.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -//! Test C++ interface to Qhull
    -//! See eg/q_test for tests of Qhull commands
    -class Qhull_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_construct();
    -    void t_attribute();
    -    void t_message();
    -    void t_getSet();
    -    void t_getQh();
    -    void t_getValue();
    -    void t_foreach();
    -    void t_modify();
    -};//Qhull_test
    -
    -void
    -add_Qhull_test()
    -{
    -    new Qhull_test();
    -}
    -
    -//Executed after each testcase
    -void Qhull_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void Qhull_test::
    -t_construct()
    -{
    -    {
    -        Qhull q;
    -        QCOMPARE(q.dimension(),0);
    -        QVERIFY(q.qhullQh()!=0);
    -        QVERIFY(q.runId()!=0);
    -        QCOMPARE(QString(q.qhullCommand()),QString(""));
    -        QCOMPARE(QString(q.rboxCommand()),QString(""));
    -        try{
    -            QCOMPARE(q.area(),0.0);
    -            QFAIL("area() did not fail.");
    -        }catch (const std::exception &e) {
    -            cout << "INFO   : Caught " << e.what();
    -        }
    -        Qhull q2(q);  // Copy constructor and copy assignment OK if not q.initialized()
    -        QCOMPARE(q2.dimension(),0);
    -        q= q2;
    -        QCOMPARE(q.dimension(),0);
    -    }
    -    {
    -        RboxPoints rbox("10000");
    -        Qhull q(rbox, "QR0"); // Random points in a randomly rotated cube.
    -        QCOMPARE(q.dimension(),3);
    -        QVERIFY(q.volume() < 1.0);
    -        QVERIFY(q.volume() > 0.99);
    -        try{
    -            Qhull q2(q);
    -            QFAIL("Copy constructor did not fail for initialized Qhull.");
    -        }catch (const std::exception &e) {
    -            cout << "INFO   : Caught " << e.what();
    -        }
    -        try{
    -            Qhull q3;
    -            q3= q;
    -            QFAIL("Copy assignment did not fail for initialized Qhull source.");
    -        }catch (const std::exception &e) {
    -            cout << "INFO   : Caught " << e.what();
    -        }
    -        QCOMPARE(q.dimension(),3);
    -        try{
    -            Qhull q4;
    -            q= q4;
    -            QFAIL("Copy assignment did not fail for initialized Qhull destination.");
    -        }catch (const std::exception &e) {
    -            cout << "INFO   : Caught " << e.what();
    -        }
    -        QCOMPARE(q.dimension(),3);
    -    }
    -    {
    -        double points[] = {
    -            0, 0,
    -            1, 0,
    -            1, 1
    -        };
    -        Qhull q("triangle", 2, 3, points, "");
    -        QCOMPARE(q.dimension(),2);
    -        QCOMPARE(q.facetCount(),3);
    -        QCOMPARE(q.vertexCount(),3);
    -        QCOMPARE(q.dimension(),2);
    -        QCOMPARE(q.area(), 2.0+sqrt(2.0)); // length of boundary
    -        QCOMPARE(q.volume(), 0.5);        // the 2-d area
    -    }
    -}//t_construct
    -
    -void Qhull_test::
    -t_attribute()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        double normals[] = {
    -            0,  -1, -0.5,
    -           -1,   0, -0.5,
    -            1,   0, -0.5,
    -            0,   1, -0.5
    -        };
    -        Qhull q;
    -        q.feasiblePoint << 0.0 << 0.0;
    -        Coordinates c(std::vector(2, 0.0));
    -        QVERIFY(q.feasiblePoint==c);
    -        q.setOutputStream(&cout);
    -        q.runQhull("normals of square", 3, 4, normals, "H"); // halfspace intersect
    -        QCOMPARE(q.facetList().count(), 4); // Vertices of square
    -        cout << "Expecting summary of halfspace intersect\n";
    -        q.outputQhull();
    -        q.useOutputStream= false;
    -        cout << "Expecting no output from qh_fprintf() in Qhull.cpp\n";
    -        q.outputQhull();
    -    }
    -}//t_attribute
    -
    -//! No QhullMessage for errors outside of qhull
    -void Qhull_test::
    -t_message()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q;
    -        QCOMPARE(q.qhullMessage(), string(""));
    -        QCOMPARE(q.qhullStatus(), qh_ERRnone);
    -        QVERIFY(!q.hasQhullMessage());
    -        try{
    -            q.runQhull(rcube, "Fd");
    -            QFAIL("runQhull Fd did not fail.");
    -        }catch (const std::exception &e) {
    -            const char *s= e.what();
    -            cout << "INFO   : Caught " << s;
    -            QCOMPARE(QString::fromStdString(s).left(6), QString("QH6029"));
    -            // FIXUP QH11025 -- review decision to clearQhullMessage at QhullError()            // Cleared when copied to QhullError
    -            QVERIFY(!q.hasQhullMessage());
    -            // QCOMPARE(q.qhullMessage(), QString::fromStdString(s).remove(0, 7));
    -            // QCOMPARE(q.qhullStatus(), 6029);
    -            q.clearQhullMessage();
    -            QVERIFY(!q.hasQhullMessage());
    -        }
    -        q.appendQhullMessage("Append 1");
    -        QVERIFY(q.hasQhullMessage());
    -        QCOMPARE(QString::fromStdString(q.qhullMessage()), QString("Append 1"));
    -        q.appendQhullMessage("\nAppend 2\n");
    -        QCOMPARE(QString::fromStdString(q.qhullMessage()), QString("Append 1\nAppend 2\n"));
    -        q.clearQhullMessage();
    -        QVERIFY(!q.hasQhullMessage());
    -        QCOMPARE(QString::fromStdString(q.qhullMessage()), QString(""));
    -    }
    -    {
    -        cout << "INFO   : Error stream without output stream\n";
    -        Qhull q;
    -        q.setErrorStream(&cout);
    -        q.setOutputStream(0);
    -        try{
    -            q.runQhull(rcube, "Fd");
    -            QFAIL("runQhull Fd did not fail.");
    -        }catch (const QhullError &e) {
    -            cout << "INFO   : Caught " << e;
    -            QCOMPARE(e.errorCode(), 6029);
    -        }
    -        //FIXUP QH11026 Qhullmessage cleared when QhullError thrown.  Switched to e
    -        //QVERIFY(q.hasQhullMessage());
    -        //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(6), QString("QH6029"));
    -        q.clearQhullMessage();
    -        QVERIFY(!q.hasQhullMessage());
    -    }
    -    {
    -        cout << "INFO   : Error output sent to output stream without error stream\n";
    -        Qhull q;
    -        q.setErrorStream(0);
    -        q.setOutputStream(&cout);
    -        try{
    -            q.runQhull(rcube, "Tz H0");
    -            QFAIL("runQhull TZ did not fail.");
    -        }catch (const std::exception &e) {
    -            const char *s= e.what();
    -            cout << "INFO   : Caught " << s;
    -            QCOMPARE(QString::fromAscii(s).left(6), QString("QH6023"));
    -        }
    -        //FIXUP QH11026 Qhullmessage cleared when QhullError thrown.  Switched to e
    -        //QVERIFY(q.hasQhullMessage());
    -        //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(17), QString("qhull: no message"));
    -        //QCOMPARE(q.qhullStatus(), 6023);
    -        q.clearQhullMessage();
    -        QVERIFY(!q.hasQhullMessage());
    -    }
    -    {
    -        cout << "INFO   : No error stream or output stream\n";
    -        Qhull q;
    -        q.setErrorStream(0);
    -        q.setOutputStream(0);
    -        try{
    -            q.runQhull(rcube, "Fd");
    -            QFAIL("outputQhull did not fail.");
    -        }catch (const std::exception &e) {
    -            const char *s= e.what();
    -            cout << "INFO   : Caught " << s;
    -            QCOMPARE(QString::fromAscii(s).left(6), QString("QH6029"));
    -        }
    -        //FIXUP QH11026 Qhullmessage cleared when QhullError thrown.  Switched to e
    -        //QVERIFY(q.hasQhullMessage());
    -        //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(9), QString("qhull err"));
    -        //QCOMPARE(q.qhullStatus(), 6029);
    -        q.clearQhullMessage();
    -        QVERIFY(!q.hasQhullMessage());
    -    }
    -}//t_message
    -
    -void Qhull_test::
    -t_getSet()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q;
    -        QVERIFY(!q.initialized());
    -        q.runQhull(rcube, "s");
    -        QVERIFY(q.initialized());
    -        QCOMPARE(q.dimension(), 3);
    -        QhullPoint p= q.origin();
    -        QCOMPARE(p.dimension(), 3);
    -        QCOMPARE(p[0]+p[1]+p[2], 0.0);
    -        QVERIFY(q.runId()!=0);
    -        q.setErrorStream(&cout);
    -        q.outputQhull();
    -    }
    -    {
    -        Qhull q;
    -        q.runQhull(rcube, "");
    -        q.setOutputStream(&cout);
    -        q.outputQhull();
    -    }
    -    // qhullQh -- UsingLibQhull [Qhull.cpp]
    -    // runId -- UsingLibQhull [Qhull.cpp]
    -}//t_getSet
    -
    -void Qhull_test::
    -t_getQh()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q;
    -        q.runQhull(rcube, "s");
    -        QCOMPARE(QString(q.qhullCommand()), QString("qhull s"));
    -        QCOMPARE(QString(q.rboxCommand()), QString("rbox \"c\""));
    -        QCOMPARE(q.facetCount(), 6);
    -        QCOMPARE(q.vertexCount(), 8);
    -        // Sample fields from Qhull's qhT [libqhull.h]
    -        QCOMPARE(q.qhullQh()->ALLpoints, 0u);
    -        QCOMPARE(q.qhullQh()->GOODpoint, 0);
    -        QCOMPARE(q.qhullQh()->IStracing, 0);
    -        QCOMPARE(q.qhullQh()->MAXcoplanar+1.0, 1.0); // fuzzy compare
    -        QCOMPARE(q.qhullQh()->MERGING, 1u);
    -        QCOMPARE(q.qhullQh()->input_dim, 3);
    -        QCOMPARE(QString(q.qhullQh()->qhull_options).left(8), QString("  run-id"));
    -        QCOMPARE(q.qhullQh()->run_id, q.runId());
    -        QCOMPARE(q.qhullQh()->num_facets, 6);
    -        QCOMPARE(q.qhullQh()->hasTriangulation, 0u);
    -        QCOMPARE(q.qhullQh()->max_outside - q.qhullQh()->min_vertex + 1.0, 1.0); // fuzzy compare
    -        QCOMPARE(*q.qhullQh()->gm_matrix+1.0, 1.0); // fuzzy compare
    -    }
    -}//t_getQh
    -
    -void Qhull_test::
    -t_getValue()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q;
    -        q.runQhull(rcube, "");
    -        QCOMPARE(q.area(), 6.0);
    -        QCOMPARE(q.volume(), 1.0);
    -    }
    -}//t_getValue
    -
    -void Qhull_test::
    -t_foreach()
    -{
    -    RboxPoints rcube("c");
    -    {
    -        Qhull q;
    -        QCOMPARE(q.beginFacet(),q.endFacet());
    -        QCOMPARE(q.beginVertex(),q.endVertex());
    -        q.runQhull(rcube, "");
    -        QCOMPARE(q.facetList().count(), 6);
    -
    -        // defineVertexNeighborFacets() tested in QhullVertex_test::t_io()
    -
    -        QhullFacetList facets(q.beginFacet(), q.endFacet());
    -        QCOMPARE(facets.count(), 6);
    -        QCOMPARE(q.firstFacet(), q.beginFacet());
    -        QhullVertexList vertices(q.beginVertex(), q.endVertex());
    -        QCOMPARE(vertices.count(), 8);
    -        QCOMPARE(q.firstVertex(), q.beginVertex());
    -        QhullPoints ps= q.points();
    -        QCOMPARE(ps.count(), 8);
    -        QhullPointSet ps2= q.otherPoints();
    -        QCOMPARE(ps2.count(), 0);
    -        // ps2= q.otherPoints(); //disabled, would not copy the points
    -        QCOMPARE(q.facetCount(), 6);
    -        QCOMPARE(q.vertexCount(), 8);
    -        coordT *c= q.pointCoordinateBegin(); // of q.points()
    -        QVERIFY(*c==0.5 || *c==-0.5);
    -        coordT *c3= q.pointCoordinateEnd();
    -        QVERIFY(c3[-1]==0.5 || c3[-1]==-0.5);
    -        QCOMPARE(c3-c, 8*3);
    -        QCOMPARE(q.vertexList().count(), 8);
    -    }
    -}//t_foreach
    -
    -void Qhull_test::
    -t_modify()
    -{
    -    //addPoint() tested in t_foreach
    -    RboxPoints diamond("d");
    -    Qhull q(diamond, "o");
    -    q.setOutputStream(&cout);
    -    cout << "Expecting vertexList and facetList of a 3-d diamond.\n";
    -    q.outputQhull();
    -    cout << "Expecting normals of a 3-d diamond.\n";
    -    q.outputQhull("n");
    -    // runQhull tested in t_attribute(), t_message(), etc.
    -}//t_modify
    -
    -}//orgQhull
    -
    -// Redefine Qhull's usermem.c
    -void qh_exit(int exitcode) {
    -    cout << "FAIL!  : Qhull called qh_exit().  Qhull's error handling not available.\n.. See the corresponding Qhull:qhull_message or setErrorStream().\n";
    -    exit(exitcode);
    -}
    -void qh_free(void *mem) {
    -    free(mem);
    -}
    -void *qh_malloc(size_t size) {
    -    return malloc(size);
    -}
    -
    -#if 0
    -template<> char * QTest::
    -toString(const std::string &s)
    -{
    -    QByteArray ba = s.c_str();
    -    return qstrdup(ba.data());
    -}
    -#endif
    -
    -#include "moc/Qhull_test.moc"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RboxPoints_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RboxPoints_test.cpp
    deleted file mode 100644
    index 2c1080778c..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RboxPoints_test.cpp
    +++ /dev/null
    @@ -1,216 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2006-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/RboxPoints_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "RboxPoints.h"
    -#include "QhullError.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::ostringstream;
    -using std::string;
    -using std::stringstream;
    -
    -namespace orgQhull {
    -
    -//! Test C++ interface to Rbox
    -//! See eg/q_test for tests of rbox commands
    -class RboxPoints_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void t_construct();
    -    void t_error();
    -    void t_test();
    -    void t_getSet();
    -    void t_foreach();
    -    void t_change();
    -    void t_ostream();
    -};
    -
    -void
    -add_RboxPoints_test()
    -{
    -    new RboxPoints_test();
    -}
    -
    -void RboxPoints_test::
    -t_construct()
    -{
    -    RboxPoints rp;
    -    QCOMPARE(rp.dimension(), 0);
    -    QCOMPARE(rp.count(), 0);
    -    QVERIFY(QString::fromStdString(rp.comment()) != QString(""));
    -    QVERIFY(rp.isEmpty());
    -    QVERIFY(!rp.hasRboxMessage());
    -    QCOMPARE(rp.rboxStatus(), qh_ERRnone);
    -    QCOMPARE(QString::fromStdString(rp.rboxMessage()), QString("rbox warning: no points generated\n"));
    -
    -    RboxPoints rp2("c"); // 3-d cube
    -    QCOMPARE(rp2.dimension(), 3);
    -    QCOMPARE(rp2.count(), 8);
    -    QCOMPARE(QString::fromStdString(rp2.comment()), QString("rbox \"c\""));
    -    QVERIFY(!rp2.isEmpty());
    -    QVERIFY(!rp2.hasRboxMessage());
    -    QCOMPARE(rp2.rboxStatus(), qh_ERRnone);
    -    QCOMPARE(QString::fromStdString(rp2.rboxMessage()), QString("rbox: OK\n"));
    -}//t_construct
    -
    -void RboxPoints_test::
    -t_error()
    -{
    -    RboxPoints rp;
    -    try{
    -        rp.appendPoints("D0 c");
    -        QFAIL("'D0 c' did not fail.");
    -    }catch (const std::exception &e) {
    -        const char *s= e.what();
    -        cout << "INFO   : Caught " << s;
    -        QCOMPARE(QString(s).left(6), QString("QH6189"));
    -        QVERIFY(rp.hasRboxMessage());
    -        QCOMPARE(QString::fromStdString(rp.rboxMessage()).left(8), QString("rbox err"));
    -        QCOMPARE(rp.rboxStatus(), 6189);
    -        rp.clearRboxMessage();
    -        QVERIFY(!rp.hasRboxMessage());
    -    }
    -    try{
    -        RboxPoints rp2;
    -        rp2.setDimension(-1);
    -        QFAIL("setDimension(-1) did not fail.");
    -    }catch (const RoadError &e) {
    -        const char *s= e.what();
    -        cout << "INFO   : Caught " << s;
    -        QCOMPARE(QString(s).left(7), QString("QH10062"));
    -        QCOMPARE(e.errorCode(), 10062);
    -        QCOMPARE(QString::fromStdString(e.what()), QString(s));
    -        RoadLogEvent logEvent= e.roadLogEvent();
    -        QCOMPARE(logEvent.int1(), -1);
    -    }
    -}//t_error
    -
    -void RboxPoints_test::
    -t_test()
    -{
    -    // isEmpty -- t_construct
    -}//t_test
    -
    -void RboxPoints_test::
    -t_getSet()
    -{
    -    // comment -- t_construct
    -    // count -- t_construct
    -    // dimension -- t_construct
    -
    -    RboxPoints rp;
    -    QCOMPARE(rp.dimension(), 0);
    -    rp.setDimension(2);
    -    QCOMPARE(rp.dimension(), 2);
    -    rp.setDimension(2);
    -    QCOMPARE(rp.dimension(), 2);
    -    try{
    -        rp.setDimension(102);
    -        QFAIL("setDimension(102) did not fail.");
    -    }catch (const std::exception &e) {
    -        cout << "INFO   : Caught " << e.what();
    -    }
    -    QCOMPARE(rp.newCount(), 0);
    -    rp.appendPoints("D2 P1 P2");
    -    QCOMPARE(rp.count(), 2);
    -    QCOMPARE(rp.newCount(), 2); // From previous appendPoints();
    -    PointCoordinates pc(2);
    -    pc << 1.0 << 0.0 << 2.0 << 0.0;
    -    QCOMPARE(pc.dimension(), 2);
    -    QCOMPARE(pc.count(), 2);
    -    QVERIFY(rp==pc);
    -    rp.setNewCount(10);  // Normally only used by appendPoints for rbox processing
    -    QCOMPARE(rp.newCount(), 10);
    -    rp.reservePoints();
    -    QVERIFY(rp==pc);
    -}//t_getSet
    -
    -void RboxPoints_test::
    -t_foreach()
    -{
    -    RboxPoints rp("c");
    -    Coordinates::ConstIterator cci= rp.beginCoordinates();
    -    orgQhull::Coordinates::Iterator ci= rp.beginCoordinates();
    -    QCOMPARE(*cci, -0.5);
    -    QCOMPARE(*ci, *cci);
    -    int i=1;
    -    while(++cci
    -#include 
    -#include "RoadTest.h"
    -
    -using std::cout;
    -using std::endl;
    -
    -namespace orgQhull {
    -
    -#//class variable
    -
    -QList RoadTest::
    -s_testcases;
    -
    -int RoadTest::
    -s_test_count= 0;
    -
    -int RoadTest::
    -s_test_fail= 0;
    -
    -QStringList RoadTest::
    -s_failed_tests;
    -
    -#//Slot
    -
    -//! Executed after each test
    -void RoadTest::
    -cleanup()
    -{
    -    s_test_count++;
    -    if(QTest::currentTestFailed()){
    -        recordFailedTest();
    -    }
    -}//cleanup
    -
    -#//Helper
    -
    -void RoadTest::
    -recordFailedTest()
    -{
    -    s_test_fail++;
    -    QString className= metaObject()->className();
    -    s_failed_tests << className + "::" + QTest::currentTestFunction();
    -}
    -
    -#//class function
    -
    -int RoadTest::
    -runTests(QStringList arguments)
    -{
    -    int result= 0; // assume success
    -
    -    foreach(RoadTest *testcase, s_testcases){
    -        try{
    -            result += QTest::qExec(testcase, arguments);
    -        }catch(const std::exception &e){
    -            cout << "FAIL!  : Threw error ";
    -            cout << e.what() << endl;
    -    s_test_count++;
    -            testcase->recordFailedTest();
    -            // Qt 4.5.2 OK.  In Qt 4.3.3, qtestcase did not clear currentTestObject
    -        }
    -    }
    -    if(s_test_fail){
    -        cout << "Failed " << s_test_fail << " of " << s_test_count << " tests.\n";
    -        cout << s_failed_tests.join("\n").toLocal8Bit().constData() << std::endl;
    -    }else{
    -        cout << "Passed " << s_test_count << " tests.\n";
    -    }
    -    return result;
    -}//runTests
    -
    -}//orgQhull
    -
    -#include "moc/moc_RoadTest.cpp"
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RoadTest.h b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RoadTest.h
    deleted file mode 100644
    index c42f81969a..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/RoadTest.h
    +++ /dev/null
    @@ -1,101 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/RoadTest.h#1 $$Change: 1490 $
    -** $Date: 2012/02/19 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -#ifndef ROADTEST_H
    -#define ROADTEST_H
    -
    -//pre-compiled with RoadTest.h
    -#include     // Qt C++ Framework
    -#include 
    -
    -#define QHULL_USES_QT 1
    -
    -namespace orgQhull {
    -
    -#//!\name Defined here
    -
    -    //! RoadTest -- Generic test for Qt's QTest
    -    class RoadTest;
    -    //! TESTadd_(t) -- Add a RoadTest
    -
    -/** Test Name objects using Qt's QTestLib
    -
    -Template:
    -
    -class Name_test : public RoadTest
    -{
    -    Q_OBJECT
    -#//Test slot
    -private slots:
    -    void t_name();
    -    //Executed before any test
    -    void initTestCase();
    -    void init();          // Each test
    -    //Executed after each test
    -    void cleanup(); //RoadTest::cleanup();
    -    // Executed after last test
    -    void cleanupTestCase();
    -};
    -
    -void
    -add_Name_test()
    -{
    -    new Name_test();
    -}
    -
    -Send additional output to cout
    -*/
    -
    -class RoadTest : public QObject
    -{
    -    Q_OBJECT
    -
    -#//!\name Class globals
    -protected:
    -    static QList
    -                        s_testcases; ///! List of testcases to execute.  Initialized via add_...()
    -    static int          s_test_count; ///! Total number of tests executed
    -    static int          s_test_fail; ///! Number of failed tests
    -    static QStringList  s_failed_tests; ///! List of failed tests
    -
    -#//!\name Test slots
    -public slots:
    -    void cleanup();
    -
    -public:
    -#//!\name Constructors, etc.
    -    RoadTest()  { s_testcases.append(this); }
    -    ~RoadTest() { s_testcases.removeAll(this); }
    -
    -#//Helper
    -    void                recordFailedTest();
    -
    -
    -#//!\name Class functions
    -    static int          runTests(QStringList arguments);
    -
    -};//RoadTest
    -
    -#define TESTadd_(t) extern void t(); t();
    -
    -
    -}//orgQhull
    -
    -namespace QTest{
    -
    -template<>
    -inline char *
    -toString(const std::string &s)
    -{
    -    return qstrdup(s.c_str());
    -}
    -
    -}//namespace QTest
    -
    -#endif //ROADTEST_H
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/UsingLibQhull_test.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/UsingLibQhull_test.cpp
    deleted file mode 100644
    index 8857282576..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/UsingLibQhull_test.cpp
    +++ /dev/null
    @@ -1,210 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/UsingLibQhull_test.cpp#4 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include "RoadTest.h" // QT_VERSION
    -
    -#include "UsingLibQhull.h"
    -#include "QhullError.h"
    -#include "Qhull.h"
    -
    -using std::cout;
    -using std::endl;
    -using std::string;
    -
    -namespace orgQhull {
    -
    -//! Test C++ interface to Qhull
    -//! See eg/q_test for tests of Qhull commands
    -class UsingLibQhull_test : public RoadTest
    -{
    -    Q_OBJECT
    -
    -#//Test slots
    -private slots:
    -    void cleanup();
    -    void t_classMembers();
    -    void t_globalPoints();
    -    void t_UsingLibQhull();
    -    void t_methods();
    -    void t_cleanuptestcase();
    -};//UsingLibQhull_test
    -
    -void
    -add_UsingLibQhull_test()
    -{
    -    new UsingLibQhull_test();
    -}
    -
    -//Executed after each testcase
    -void UsingLibQhull_test::
    -cleanup()
    -{
    -    UsingLibQhull::checkQhullMemoryEmpty();
    -    RoadTest::cleanup();
    -}
    -
    -void UsingLibQhull_test::
    -t_classMembers()
    -{
    -    {
    -        //checkQhullMemoryEmpty tested by cleanup()
    -        QCOMPARE(UsingLibQhull::globalMachineEpsilon()+1.0, 1.0);
    -        RboxPoints r10("10");
    -        Qhull q(r10,"v");  // voronoi diagram of 10 points
    -        UsingLibQhull::unsetGlobalAngleEpsilon();
    -        UsingLibQhull::unsetGlobalDistanceEpsilon();
    -        cout << "MachineEpsilon " << UsingLibQhull::globalMachineEpsilon()
    -            << " angleEpsilon " << UsingLibQhull::globalAngleEpsilon()
    -            << " distanceEpsilon " << UsingLibQhull::globalDistanceEpsilon()
    -            << endl;
    -        QCOMPARE(UsingLibQhull::currentAngleEpsilon()+1.0, 1.0);
    -        QVERIFY(UsingLibQhull::currentAngleEpsilon() > UsingLibQhull::globalMachineEpsilon());
    -        QCOMPARE(UsingLibQhull::currentDistanceEpsilon()+1.0, 1.0);
    -        QVERIFY(UsingLibQhull::currentDistanceEpsilon() >= UsingLibQhull::currentAngleEpsilon());
    -        QCOMPARE(UsingLibQhull::currentQhull().runId(), q.runId());
    -        QCOMPARE(UsingLibQhull::globalAngleEpsilon()+1.0, UsingLibQhull::currentAngleEpsilon()+1.0);
    -        QCOMPARE(UsingLibQhull::currentVertexDimension(), q.dimension());
    -        QCOMPARE(UsingLibQhull::globalDistanceEpsilon()+1.0, UsingLibQhull::currentDistanceEpsilon()+1.0);
    -        UsingLibQhull::setGlobalAngleEpsilon(1.0);
    -        UsingLibQhull::setGlobalDistanceEpsilon(1.0);
    -        cout << " Global angleEpsilon " << UsingLibQhull::globalAngleEpsilon()
    -            << " distanceEpsilon " << UsingLibQhull::globalDistanceEpsilon()
    -            << endl;
    -        QCOMPARE(UsingLibQhull::globalAngleEpsilon(), UsingLibQhull::globalDistanceEpsilon());
    -        QVERIFY(UsingLibQhull::currentAngleEpsilon() != UsingLibQhull::globalAngleEpsilon());
    -        UsingLibQhull::setGlobalVertexDimension(3);
    -        QCOMPARE(UsingLibQhull::globalVertexDimension(), UsingLibQhull::currentVertexDimension());
    -        UsingLibQhull::setGlobalVertexDimension(2);
    -        QCOMPARE(UsingLibQhull::globalVertexDimension(), 2);
    -        QCOMPARE(UsingLibQhull::currentVertexDimension(), q.dimension());
    -        QVERIFY(UsingLibQhull::currentDistanceEpsilon() != UsingLibQhull::globalDistanceEpsilon());
    -        UsingLibQhull::unsetGlobalAngleEpsilon();
    -        UsingLibQhull::unsetGlobalVertexDimension();
    -        UsingLibQhull::unsetGlobalDistanceEpsilon();
    -        QCOMPARE(UsingLibQhull::currentAngleEpsilon()+1.0, UsingLibQhull::globalAngleEpsilon()+1.0);
    -        QCOMPARE(UsingLibQhull::globalVertexDimension(), UsingLibQhull::currentVertexDimension());
    -        QCOMPARE(UsingLibQhull::currentDistanceEpsilon()+1.0, UsingLibQhull::globalDistanceEpsilon()+1.0);
    -        UsingLibQhull::setGlobals();
    -    }
    -    QCOMPARE(UsingLibQhull::globalAngleEpsilon()+1.0, 1.0);
    -    QCOMPARE(UsingLibQhull::globalVertexDimension(), 4); // 'v'.  VertexDimension is only used for QhullVertex where dim>15
    -    QCOMPARE(UsingLibQhull::globalDistanceEpsilon()+1.0, 1.0);
    -    UsingLibQhull::unsetGlobals();
    -    try{
    -        cout << UsingLibQhull::globalVertexDimension();
    -        QFAIL("Did not throw error for undefined dimension.");
    -    }catch(const std::exception &e){
    -        cout << "INFO     Caught error -- " << e.what() << endl;
    -    }
    -}//t_classMembers
    -
    -void UsingLibQhull_test::
    -t_globalPoints()
    -{
    -    const coordT *r10PointsBegin;
    -    {
    -        RboxPoints r10("10");
    -        Qhull q(r10,"v");  // voronoi diagram of 10 points
    -        UsingLibQhull::unsetGlobalPoints();
    -        int dimension;
    -        const coordT *pointsEnd;
    -        const coordT *pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd);
    -        cout << "pointsBegin " << pointsBegin
    -            << " pointsEnd " << pointsEnd
    -            << " dimension " << dimension
    -            << endl;
    -        int dimension2;
    -        const coordT *pointsEnd2;
    -        const coordT *pointsBegin2= UsingLibQhull::currentPoints(&dimension2, &pointsEnd2);
    -        QCOMPARE(pointsBegin2, pointsBegin);
    -        QCOMPARE(pointsEnd2, pointsEnd);
    -        QCOMPARE(dimension2, dimension);
    -        coordT c[]= { 1.0,2.0, 3.0,4.0, 5.0,6.0 };
    -        UsingLibQhull::setGlobalPoints(2, c, c+3*2);
    -        pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd);
    -        QCOMPARE(pointsBegin, c);
    -        QCOMPARE(pointsEnd[-1], 6.0);
    -        QCOMPARE(dimension, 2);
    -        UsingLibQhull::unsetGlobalPoints();
    -        pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd);
    -        QCOMPARE(pointsBegin, pointsBegin2);
    -        QCOMPARE(pointsEnd, pointsEnd2);
    -        QCOMPARE(dimension, dimension2);
    -        UsingLibQhull::setGlobals();
    -        r10PointsBegin= pointsBegin;
    -    }
    -    int dimension3;
    -    const coordT *pointsEnd3;
    -    const coordT *pointsBegin3= UsingLibQhull::currentPoints(&dimension3, &pointsEnd3);
    -    QCOMPARE(pointsBegin3, r10PointsBegin); // Memory was freed
    -    QCOMPARE(pointsEnd3, r10PointsBegin+10*4);
    -    QCOMPARE(dimension3, 4);
    -    UsingLibQhull::unsetGlobals();
    -    try{
    -        pointsBegin3= UsingLibQhull::globalPoints(&dimension3, &pointsEnd3);
    -        QFAIL("Did not throw error for undefined global points.");
    -    }catch(const std::exception &e){
    -        cout << "INFO     Caught error -- " << e.what() << endl;
    -    }
    -}//t_globalPoints
    -
    -void UsingLibQhull_test::
    -t_UsingLibQhull()
    -{
    -    {
    -        Qhull q;
    -        UsingLibQhull uq(&q); // Normally created in a method using 'this'
    -
    -        try{
    -            Qhull q2; // If qh_QHpointer, QhullQh() calls usinlibqhull()
    -            UsingLibQhull uq2(&q2);
    -            QFAIL("UsingLibQhull did not fail.");
    -        }catch (const std::exception &e) {
    -            cout << "INFO   : Caught " << e.what();
    -        }
    -    }
    -    Qhull q3;
    -    UsingLibQhull uq3(&q3);
    -    // UsingLibQhull uq4; // Default constructors disabled.
    -}//t_UsingLibQhull
    -
    -void UsingLibQhull_test::
    -t_methods()
    -{
    -    Qhull q;
    -    UsingLibQhull u(&q); // Normally created in a method using 'this'
    -    QVERIFY(u.defined());
    -    u.maybeThrowQhullMessage(0);  // Nothing thrown
    -    try{
    -        u.maybeThrowQhullMessage(1);
    -        QFAIL("maybeThrowQhullMessage(1) did not fail.");
    -    }catch (const std::exception &e) {
    -        cout << "INFO   : Caught " << e.what();
    -    }
    -    // Can not check checkRunId() in maybeThrowQhullMessage().  Requires another thread.
    -    u.maybeThrowQhullMessage(2, UsingLibQhull::NOthrow);
    -    try{
    -        throw QhullError(10054, "Report previous NOthrow error");
    -    }catch (const std::exception &e) {
    -        cout << "INFO   : " << e.what();
    -    }
    -}//t_methods
    -
    -// Executed after last test
    -void UsingLibQhull_test::
    -t_cleanuptestcase()
    -{
    -    UsingLibQhull::unsetGlobals();
    -}//t_cleanuptestcase
    -
    -}//orgQhull
    -
    -#include "moc/UsingLibQhull_test.moc"
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.cpp
    deleted file mode 100644
    index 1a4c41a0cd..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.cpp
    +++ /dev/null
    @@ -1,86 +0,0 @@
    -/****************************************************************************
    -**
    -** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
    -** $Id: //main/2011/qhull/src/qhulltest/qhulltest.cpp#5 $$Change: 1490 $
    -** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
    -**
    -****************************************************************************/
    -
    -//pre-compiled headers
    -#include 
    -#include 
    -#include 
    -#include 
    -#include "RoadTest.h"
    -
    -#include "../libqhullcpp/RoadError.h"
    -
    -using std::cout;
    -using std::endl;
    -
    -namespace orgQhull {
    -
    -void addQhullTests(QStringList &args)
    -{
    -    TESTadd_(add_QhullVertex_test); //copy
    -
    -    if(args.contains("--all")){
    -        args.removeAll("--all");
    -        // up-to-date
    -        TESTadd_(add_Coordinates_test);
    -        TESTadd_(add_PointCoordinates_test);
    -        TESTadd_(add_QhullFacet_test);
    -        TESTadd_(add_QhullFacetList_test);
    -        TESTadd_(add_QhullFacetSet_test);
    -        TESTadd_(add_QhullHyperplane_test);
    -        TESTadd_(add_QhullLinkedList_test);
    -        TESTadd_(add_QhullPoint_test);
    -        TESTadd_(add_QhullPoints_test);
    -        TESTadd_(add_QhullPointSet_test);
    -        TESTadd_(add_QhullRidge_test);
    -        TESTadd_(add_QhullSet_test);
    -        TESTadd_(add_QhullVertex_test);
    -        TESTadd_(add_RboxPoints_test);
    -        TESTadd_(add_UsingLibQhull_test);
    -        // needs review
    -        // qhullStat
    -        TESTadd_(add_Qhull_test);
    -    }//--all
    -}//addQhullTests
    -
    -int main(int argc, char *argv[])
    -{
    -    QCoreApplication app(argc, argv);
    -    QStringList args= app.arguments();
    -    bool isAll= args.contains("--all");
    -    addQhullTests(args);
    -    int status=1010;
    -    try{
    -        status= RoadTest::runTests(args);
    -    }catch(const std::exception &e){
    -        cout << "FAIL!  : runTests() did not catch error\n";
    -        cout << e.what() << endl;
    -        if(!RoadError::emptyGlobalLog()){
    -            cout << RoadError::stringGlobalLog() << endl;
    -            RoadError::clearGlobalLog();
    -        }
    -    }
    -    if(!RoadError::emptyGlobalLog()){
    -        cout << RoadError::stringGlobalLog() << endl;
    -        RoadError::clearGlobalLog();
    -    }
    -    if(isAll){
    -        cout << "Finished test of libqhullcpp.  Test libqhull with eg/q_test" << endl;
    -    }else{
    -        cout << "Finished test of one class.  Test all classes with 'qhulltest --all'" << endl;
    -    }
    -    return status;
    -}
    -
    -}//orgQhull
    -
    -int main(int argc, char *argv[])
    -{
    -    return orgQhull::main(argc, argv); // Needs RoadTest:: for TESTadd_() linkage
    -}
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.pro
    deleted file mode 100644
    index dce14046c6..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qhulltest/qhulltest.pro
    +++ /dev/null
    @@ -1,34 +0,0 @@
    -# -------------------------------------------------
    -# qhulltest.pro -- Qt project for qhulltest.exe (QTestLib)
    -# -------------------------------------------------
    -
    -include(../qhull-app-cpp.pri)
    -
    -TARGET = qhulltest
    -CONFIG += qtestlib
    -MOC_DIR = moc
    -INCLUDEPATH += ..  # for MOC_DIR
    -
    -PRECOMPILED_HEADER = RoadTest.h
    -
    -SOURCES += ../libqhullcpp/qt-qhull.cpp
    -SOURCES += Coordinates_test.cpp
    -SOURCES += PointCoordinates_test.cpp
    -SOURCES += Qhull_test.cpp
    -SOURCES += QhullFacet_test.cpp
    -SOURCES += QhullFacetList_test.cpp
    -SOURCES += QhullFacetSet_test.cpp
    -SOURCES += QhullHyperplane_test.cpp
    -SOURCES += QhullLinkedList_test.cpp
    -SOURCES += QhullPoint_test.cpp
    -SOURCES += QhullPoints_test.cpp
    -SOURCES += QhullPointSet_test.cpp
    -SOURCES += QhullRidge_test.cpp
    -SOURCES += QhullSet_test.cpp
    -SOURCES += qhulltest.cpp
    -SOURCES += QhullVertex_test.cpp
    -SOURCES += RboxPoints_test.cpp
    -SOURCES += RoadTest.cpp
    -SOURCES += UsingLibQhull_test.cpp
    -
    -HEADERS += RoadTest.h
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.c
    deleted file mode 100644
    index 28bdc2c5a6..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.c
    +++ /dev/null
    @@ -1,313 +0,0 @@
    -/*
      ---------------------------------
    -
    -   qvoronoi.c
    -     compute Voronoi diagrams and furthest-point Voronoi
    -     diagrams using qhull
    -
    -   see unix.c for full interface
    -
    -   Copyright (c) 1993-2012, The Geometry Center
    -*/
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include "libqhull.h"
    -#include "mem.h"
    -#include "qset.h"
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#elif __cplusplus
    -extern "C" {
    -  int isatty(int);
    -}
    -
    -#elif _MSC_VER
    -#include 
    -#define isatty _isatty
    -int _isatty(int);
    -
    -#else
    -int isatty(int);  /* returns 1 if stdin is a tty
    -                   if "Undefined symbol" this can be deleted along with call in main() */
    -#endif
    -
    -/*---------------------------------
    -
    -  qh_prompt
    -    long prompt for qhull
    -
    -  notes:
    -    restricted version of libqhull.c
    -
    -  see:
    -    concise prompt below
    -*/
    -
    -/* duplicated in qvoron_f.htm and qvoronoi.htm
    -   QJ and Qt are deprecated, but allowed for backwards compatibility
    -*/
    -char hidden_options[]=" d n m v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V Fa FA FC Fp FS Ft FV Pv Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
    -
    -char qh_prompta[]= "\n\
    -qvoronoi- compute the Voronoi diagram\n\
    -    http://www.qhull.org  %s\n\
    -\n\
    -input (stdin):\n\
    -    first lines: dimension and number of points (or vice-versa).\n\
    -    other lines: point coordinates, best if one point per line\n\
    -    comments:    start with a non-numeric character\n\
    -\n\
    -options:\n\
    -    Qu   - compute furthest-site Voronoi diagram\n\
    -\n\
    -Qhull control options:\n\
    -    Qz   - add point-at-infinity to Voronoi diagram\n\
    -%s%s%s%s";  /* split up qh_prompt for Visual C++ */
    -char qh_promptb[]= "\
    -    Qs   - search all points for the initial simplex\n\
    -    QGn  - Voronoi vertices if visible from point n, -n if not\n\
    -    QVn  - Voronoi vertices for input point n, -n if not\n\
    -\n\
    -";
    -char qh_promptc[]= "\
    -Trace options:\n\
    -    T4   - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
    -    Tc   - check frequently during execution\n\
    -    Ts   - statistics\n\
    -    Tv   - verify result: structure, convexity, and in-circle test\n\
    -    Tz   - send all output to stdout\n\
    -    TFn  - report summary when n or more facets created\n\
    -    TI file - input data from file, no spaces or single quotes\n\
    -    TO file - output results to file, may be enclosed in single quotes\n\
    -    TPn  - turn on tracing when point n added to hull\n\
    -     TMn - turn on tracing at merge n\n\
    -     TWn - trace merge facets when width > n\n\
    -    TVn  - stop qhull after adding point n, -n for before (see TCn)\n\
    -     TCn - stop qhull after building cone for point n (see TVn)\n\
    -\n\
    -Precision options:\n\
    -    Cn   - radius of centrum (roundoff added).  Merge facets if non-convex\n\
    -     An  - cosine of maximum angle.  Merge facets if cosine > n or non-convex\n\
    -           C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
    -    Rn   - randomly perturb computations by a factor of [1-n,1+n]\n\
    -    Wn   - min facet width for non-coincident point (before roundoff)\n\
    -\n\
    -Output formats (may be combined; if none, produces a summary to stdout):\n\
    -    s    - summary to stderr\n\
    -    p    - Voronoi vertices\n\
    -    o    - OFF format (dim, Voronoi vertices, and Voronoi regions)\n\
    -    i    - Delaunay regions (use 'Pp' to avoid warning)\n\
    -    f    - facet dump\n\
    -\n\
    -";
    -char qh_promptd[]= "\
    -More formats:\n\
    -    Fc   - count plus coincident points (by Voronoi vertex)\n\
    -    Fd   - use cdd format for input (homogeneous with offset first)\n\
    -    FD   - use cdd format for output (offset first)\n\
    -    FF   - facet dump without ridges\n\
    -    Fi   - separating hyperplanes for bounded Voronoi regions\n\
    -    FI   - ID for each Voronoi vertex\n\
    -    Fm   - merge count for each Voronoi vertex (511 max)\n\
    -    Fn   - count plus neighboring Voronoi vertices for each Voronoi vertex\n\
    -    FN   - count and Voronoi vertices for each Voronoi region\n\
    -    Fo   - separating hyperplanes for unbounded Voronoi regions\n\
    -    FO   - options and precision constants\n\
    -    FP   - nearest point and distance for each coincident point\n\
    -    FQ   - command used for qvoronoi\n\
    -    Fs   - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
    -                    for output: #Voronoi regions, #Voronoi vertices,\n\
    -                                #coincident points, #non-simplicial regions\n\
    -                    #real (2), max outer plane and min vertex\n\
    -    Fv   - Voronoi diagram as Voronoi vertices between adjacent input sites\n\
    -    Fx   - extreme points of Delaunay triangulation (on convex hull)\n\
    -\n\
    -";
    -char qh_prompte[]= "\
    -Geomview options (2-d only)\n\
    -    Ga   - all points as dots\n\
    -     Gp  -  coplanar points and vertices as radii\n\
    -     Gv  -  vertices as spheres\n\
    -    Gi   - inner planes only\n\
    -     Gn  -  no planes\n\
    -     Go  -  outer planes only\n\
    -    Gc   - centrums\n\
    -    Gh   - hyperplane intersections\n\
    -    Gr   - ridges\n\
    -    GDn  - drop dimension n in 3-d and 4-d output\n\
    -\n\
    -Print options:\n\
    -    PAn  - keep n largest Voronoi vertices by 'area'\n\
    -    Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
    -    PDk:n - drop facet if normal[k] >= n\n\
    -    Pg   - print good Voronoi vertices (needs 'QGn' or 'QVn')\n\
    -    PFn  - keep Voronoi vertices whose 'area' is at least n\n\
    -    PG   - print neighbors of good Voronoi vertices\n\
    -    PMn  - keep n Voronoi vertices with most merges\n\
    -    Po   - force output.  If error, output neighborhood of facet\n\
    -    Pp   - do not report precision problems\n\
    -\n\
    -    .    - list of all options\n\
    -    -    - one line descriptions of all options\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt2
    -    synopsis for qhull
    -*/
    -char qh_prompt2[]= "\n\
    -qvoronoi- compute the Voronoi diagram.  Qhull %s\n\
    -    input (stdin): dimension, number of points, point coordinates\n\
    -    comments start with a non-numeric character\n\
    -\n\
    -options (qvoronoi.htm):\n\
    -    Qu   - compute furthest-site Voronoi diagram\n\
    -    Tv   - verify result: structure, convexity, and in-circle test\n\
    -    .    - concise list of all options\n\
    -    -    - one-line description of all options\n\
    -\n\
    -output options (subset):\n\
    -    s    - summary of results (default)\n\
    -    p    - Voronoi vertices\n\
    -    o    - OFF file format (dim, Voronoi vertices, and Voronoi regions)\n\
    -    FN   - count and Voronoi vertices for each Voronoi region\n\
    -    Fv   - Voronoi diagram as Voronoi vertices between adjacent input sites\n\
    -    Fi   - separating hyperplanes for bounded regions, 'Fo' for unbounded\n\
    -    G    - Geomview output (2-d only)\n\
    -    QVn  - Voronoi vertices for input point n, -n if not\n\
    -    TO file- output results to file, may be enclosed in single quotes\n\
    -\n\
    -examples:\n\
    -rbox c P0 D2 | qvoronoi s o         rbox c P0 D2 | qvoronoi Fi\n\
    -rbox c P0 D2 | qvoronoi Fo          rbox c P0 D2 | qvoronoi Fv\n\
    -rbox c P0 D2 | qvoronoi s Qu Fv     rbox c P0 D2 | qvoronoi Qu Fo\n\
    -rbox c G1 d D2 | qvoronoi s p       rbox c P0 D2 | qvoronoi s Fv QV0\n\
    -\n\
    -";
    -/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
    -
    -/*---------------------------------
    -
    -  qh_prompt3
    -    concise prompt for qhull
    -*/
    -char qh_prompt3[]= "\n\
    -Qhull %s.\n\
    -Except for 'F.' and 'PG', upper-case options take an argument.\n\
    -\n\
    - OFF_format     p_vertices     i_delaunay     summary        facet_dump\n\
    -\n\
    - Fcoincident    Fd_cdd_in      FD_cdd_out     FF-dump-xridge Fi_bounded\n\
    - Fxtremes       Fmerges        Fneighbors     FNeigh_region  FOptions\n\
    - Fo_unbounded   FPoint_near    FQvoronoi      Fsummary       Fvoronoi\n\
    - FIDs\n\
    -\n\
    - Gvertices      Gpoints        Gall_points    Gno_planes     Ginner\n\
    - Gcentrums      Ghyperplanes   Gridges        Gouter         GDrop_dim\n\
    -\n\
    - PArea_keep     Pdrop d0:0D0   Pgood          PFacet_area_keep\n\
    - PGood_neighbors PMerge_keep   Poutput_forced Pprecision_not\n\
    -\n\
    - QG_vertex_good Qsearch_1st    Qupper_voronoi QV_point_good  Qzinfinite\n\
    - T4_trace       Tcheck_often   Tstatistics    Tverify        Tz_stdout\n\
    - TFacet_log     TInput_file    TPoint_trace   TMerge_trace   TOutput_file\n\
    - TWide_trace    TVertex_stop   TCone_stop\n\
    -\n\
    - Angle_max      Centrum_size   Random_dist    Wide_outside\n\
    -";
    -
    -/*---------------------------------
    -
    -  main( argc, argv )
    -    processes the command line, calls qhull() to do the work, and exits
    -
    -  design:
    -    initializes data structures
    -    reads points
    -    finishes initialization
    -    computes convex hull and other structures
    -    checks the result
    -    writes the output
    -    frees memory
    -*/
    -int main(int argc, char *argv[]) {
    -  int curlong, totlong; /* used !qh_NOmem */
    -  int exitcode, numpoints, dim;
    -  coordT *points;
    -  boolT ismalloc;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= false;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if ((argc == 1) && isatty( 0 /*stdin*/)) {
    -    fprintf(stdout, qh_prompt2, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompta, qh_version,
    -                qh_promptb, qh_promptc, qh_promptd, qh_prompte);
    -    exit(qh_ERRnone);
    -  }
    -  if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
    -    fprintf(stdout, qh_prompt3, qh_version);
    -    exit(qh_ERRnone);
    -  }
    -  qh_init_A(stdin, stdout, stderr, argc, argv);  /* sets qh qhull_command */
    -  exitcode= setjmp(qh errexit); /* simple statement for CRAY J916 */
    -  if (!exitcode) {
    -    qh_option("voronoi  _bbound-last  _coplanar-keep", NULL, NULL);
    -    qh DELAUNAY= True;     /* 'v'   */
    -    qh VORONOI= True;
    -    qh SCALElast= True;    /* 'Qbb' */
    -    qh_checkflags(qh qhull_command, hidden_options);
    -    qh_initflags(qh qhull_command);
    -    points= qh_readpoints(&numpoints, &dim, &ismalloc);
    -    if (dim >= 5) {
    -      qh_option("_merge-exact", NULL, NULL);
    -      qh MERGEexact= True; /* 'Qx' always */
    -    }
    -    qh_init_B(points, numpoints, dim, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();
    -    if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points();
    -    exitcode= qh_ERRnone;
    -  }
    -  qh NOerrexit= True;  /* no more setjmp */
    -#ifdef qh_NOmem
    -  qh_freeqhull( True);
    -#else
    -  qh_freeqhull( False);
    -  qh_memfreeshort(&curlong, &totlong);
    -  if (curlong || totlong)
    -    fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n",
    -       totlong, curlong);
    -#endif
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.pro
    deleted file mode 100644
    index 4646c84472..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/qvoronoi/qvoronoi.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# qvoronoi.pro -- Qt project file for qvoronoi.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = qvoronoi
    -
    -SOURCES += qvoronoi.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.c
    deleted file mode 100644
    index 4a3d9943f7..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.c
    +++ /dev/null
    @@ -1,101 +0,0 @@
    -/*
      ---------------------------------
    -
    -   rbox.c
    -     rbox program for generating input points for qhull.
    -
    -   notes:
    -     50 points generated for 'rbox D4'
    -
    -*/
    -
    -#include "random.h"
    -#include "libqhull.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -#if __MWERKS__ && __POWERPC__
    -#include 
    -#include 
    -#include 
    -#include 
    -#endif
    -
    -#ifdef _MSC_VER  /* Microsoft Visual C++ -- warning level 4 */
    -#pragma warning( disable : 4706)  /* assignment within conditional function */
    -#endif
    -
    -char prompt[]= "\n\
    --rbox- generate various point distributions.  Default is random in cube.\n\
    -\n\
    -args (any order, space separated):                    Version: 2001/06/24\n\
    -  3000    number of random points in cube, lens, spiral, sphere or grid\n\
    -  D3      dimension 3-d\n\
    -  c       add a unit cube to the output ('c G2.0' sets size)\n\
    -  d       add a unit diamond to the output ('d G2.0' sets size)\n\
    -  l       generate a regular 3-d spiral\n\
    -  r       generate a regular polygon, ('r s Z1 G0.1' makes a cone)\n\
    -  s       generate cospherical points\n\
    -  x       generate random points in simplex, may use 'r' or 'Wn'\n\
    -  y       same as 'x', plus simplex\n\
    -  Pn,m,r  add point [n,m,r] first, pads with 0\n\
    -\n\
    -  Ln      lens distribution of radius n.  Also 's', 'r', 'G', 'W'.\n\
    -  Mn,m,r  lattice(Mesh) rotated by [n,-m,0], [m,n,0], [0,0,r], ...\n\
    -          '27 M1,0,1' is {0,1,2} x {0,1,2} x {0,1,2}.  Try 'M3,4 z'.\n\
    -  W0.1    random distribution within 0.1 of the cube's or sphere's surface\n\
    -  Z0.5 s  random points in a 0.5 disk projected to a sphere\n\
    -  Z0.5 s G0.6 same as Z0.5 within a 0.6 gap\n\
    -\n\
    -  Bn      bounding box coordinates, default %2.2g\n\
    -  h       output as homogeneous coordinates for cdd\n\
    -  n       remove command line from the first line of output\n\
    -  On      offset coordinates by n\n\
    -  t       use time as the random number seed(default is command line)\n\
    -  tn      use n as the random number seed\n\
    -  z       print integer coordinates, default 'Bn' is %2.2g\n\
    -";
    -
    -/*--------------------------------------------
    --rbox-  main procedure of rbox application
    -*/
    -int main(int argc, char **argv) {
    -  char *command;
    -  int command_size;
    -  int return_status;
    -
    -#if __MWERKS__ && __POWERPC__
    -  char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
    -  SIOUXSettings.showstatusline= False;
    -  SIOUXSettings.tabspaces= 1;
    -  SIOUXSettings.rows= 40;
    -  if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0   /* w/o, SIOUX I/O is slow*/
    -  || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
    -  || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
    -    fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
    -  argc= ccommand(&argv);
    -#endif
    -
    -  if (argc == 1) {
    -    printf(prompt, qh_DEFAULTbox, qh_DEFAULTzbox);
    -    return 1;
    -  }
    -
    -  command_size= qh_argv_to_command_size(argc, argv);
    -  if ((command= (char *)qh_malloc((size_t)command_size))) {
    -    if (!qh_argv_to_command(argc, argv, command, command_size)) {
    -      fprintf(stderr, "rbox internal error: allocated insufficient memory (%d) for arguments\n", command_size);
    -      return_status= qh_ERRinput;
    -    }else{
    -      return_status= qh_rboxpoints(stdout, stderr, command);
    -    }
    -    qh_free(command);
    -  }else {
    -    fprintf(stderr, "rbox error: insufficient memory for %d bytes\n", command_size);
    -    return_status= qh_ERRmem;
    -  }
    -  return return_status;
    -}/*main*/
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.pro
    deleted file mode 100644
    index 173e5aed05..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/rbox/rbox.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# rbox.pro -- Qt project for rbox.exe
    -# -------------------------------------------------
    -
    -include(../qhull-app-c.pri)
    -
    -TARGET = rbox
    -
    -SOURCES += rbox.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.c
    deleted file mode 100644
    index 2bdcf17bb2..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.c
    +++ /dev/null
    @@ -1,856 +0,0 @@
    -/*
      ---------------------------------
    -
    -   testset.c -- test qset.c and its use of mem.c
    -
    -   The test sets are pointers to int.  Normally a set is a pointer to a type (e.g., facetT, ridgeT, etc.).
    -   For consistency in notation, an "int" is typedef'd to i2T
    -
    -Functions and macros from qset.h.  Counts occurrences in this test.  Does not correspond to thoroughness.
    -    qh_setaddsorted -- 4 tests
    -    qh_setaddnth -- 1 test
    -    qh_setappend -- 7 tests
    -    qh_setappend_set -- 1 test
    -    qh_setappend2ndlast -- 1 test
    -    qh_setcheck -- lots of tests
    -    qh_setcompact -- 7 tests
    -    qh_setcopy -- 3 tests
    -    qh_setdel -- 1 tests
    -    qh_setdellast -- 1 tests
    -    qh_setdelnth -- 2 tests
    -    qh_setdelnthsorted -- 2 tests
    -    qh_setdelsorted -- 1 test
    -    qh_setduplicate -- not testable here
    -    qh_setequal -- 4 tests
    -    qh_setequal_except -- 2 tests
    -    qh_setequal_skip -- 2 tests
    -    qh_setfree -- 11+ tests
    -    qh_setfree2 -- not testable here
    -    qh_setfreelong -- 2 tests
    -    qh_setin -- 3 tests
    -    qh_setindex -- 4 tests
    -    qh_setlarger -- 1 test
    -    qh_setlast -- 2 tests
    -    qh_setnew -- 6 tests
    -    qh_setnew_delnthsorted
    -    qh_setprint -- tested elsewhere
    -    qh_setreplace -- 1 test
    -    qh_setsize -- 9+ tests
    -    qh_settemp -- 2 tests
    -    qh_settempfree -- 1 test
    -    qh_settempfree_all -- 1 test
    -    qh_settemppop -- 1 test
    -    qh_settemppush -- 1 test
    -    qh_settruncate -- 3 tests
    -    qh_setunique -- 3 tests
    -    qh_setzero -- 1 test
    -    FOREACHint_ -- 2 test
    -    FOREACHint4_
    -    FOREACHint_i_ -- 1 test
    -    FOREACHintreverse_
    -    FOREACHintreverse12_
    -    FOREACHsetelement_ -- 1 test
    -    FOREACHsetelement_i_ -- 1 test
    -    FOREACHsetelementreverse_ -- 1 test
    -    FOREACHsetelementreverse12_ -- 1 test
    -    SETelem_ -- 3 tests
    -    SETelemaddr_ -- 2 tests
    -    SETelemt_ -- not tested (generic)
    -    SETempty_ -- 1 test
    -    SETfirst_ -- 4 tests
    -    SETfirstt_ -- 2 tests
    -    SETindex_ -- 2 tests
    -    SETref_ -- 2 tests
    -    SETreturnsize_ -- 2 tests
    -    SETsecond_ -- 1 test
    -    SETsecondt_ -- 2 tests
    -    SETtruncate_ -- 2 tests
    -*/
    -
    -#include 
    -#include 
    -#include 
    -#include 
    -
    -#include "qset.h"
    -#include "mem.h"
    -
    -typedef int i2T;
    -#define MAXerrorCount 100 /* quit after n errors */
    -
    -#define FOREACHint_( ints ) FOREACHsetelement_( i2T, ints, i2)
    -#define FOREACHint4_( ints ) FOREACHsetelement_( i2T, ints, i4)
    -#define FOREACHint_i_( ints ) FOREACHsetelement_i_( i2T, ints, i2)
    -#define FOREACHintreverse_( ints ) FOREACHsetelementreverse_( i2T, ints, i2)
    -#define FOREACHintreverse12_( ints ) FOREACHsetelementreverse12_( i2T, ints, i2)
    -
    -enum {
    -    MAXint= 0x7fffffff,
    -};
    -
    -char prompt[]= "testqset N [M] -- Test qset.c and mem.c\n\
    -  Test qsets of 0..N integers with a check every M iterations (default ~log10)\n\
    -  Additional checking and logging if M is 1\n\
    -  For example:\n\
    -    testqset 10000\n\
    -";
    -
    -int error_count= 0;  /* Global error_count.  checkSetContents() keeps its own error count.  It exits on too many errors */
    -
    -/* Macros normally defined in user.h */
    -
    -#define qh_MEMalign ((int)(sizeof(void *)))
    -#define qh_MEMbufsize 0x10000       /* allocate 64K memory buffers */
    -#define qh_MEMinitbuf 0x20000      /* initially allocate 128K buffer */
    -
    -/* Macros normally defined in QhullSet.h */
    -
    -
    -/* Functions normally defined in usermem.h */
    -
    -void qh_exit(int exitcode) {
    -    exit(exitcode);
    -} /* exit */
    -
    -void qh_free(void *mem) {
    -    free(mem);
    -} /* free */
    -
    -void *qh_malloc(size_t size) {
    -    return malloc(size);
    -} /* malloc */
    -
    -void    qh_errexit(int exitcode, void *f, void *r)
    -{
    -    f= r; /* unused */
    -    qh_exit(exitcode);
    -}
    -
    -void    qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... )
    -{
    -    static int needs_cr= 0;  /* True if qh_fprintf needs a CR */
    -
    -    size_t fmtlen= strlen(fmt);
    -    va_list args;
    -
    -    if (!fp) {
    -        fprintf(stderr, "qh_fprintf: fp not defined for '%s'", fmt);
    -        qh_errexit(6232, NULL, NULL);
    -    }
    -    if(fmtlen>0){
    -        if(fmt[fmtlen-1]=='\n'){
    -            if(needs_cr && fmtlen>1){
    -                fprintf(fp, "\n");
    -            }
    -            needs_cr= 0;
    -        }else{
    -            needs_cr= 1;
    -        }
    -    }
    -    if(msgcode>=6000 && msgcode<7000){
    -        fprintf(fp, "Error TQ%d ", msgcode);
    -    }
    -    va_start(args, fmt);
    -    vfprintf(fp, fmt, args);
    -    va_end(args);
    -}
    -
    -/* Defined below in order of use */
    -int main(int argc, char **argv);
    -void readOptions(int argc, char **argv, const char *promptstr, int *numInts, int *checkEvery);
    -void setupMemory(int tracelevel, int numInts, int **intarray);
    -
    -void testSetappendSettruncate(int numInts, int *intarray, int checkEvery);
    -void testSetdelSetadd(int numInts, int *intarray, int checkEvery);
    -void testSetappendSet(int numInts, int *intarray, int checkEvery);
    -void testSetcompactCopy(int numInts, int *intarray, int checkEvery);
    -void testSetequalInEtc(int numInts, int *intarray, int checkEvery);
    -void testSettemp(int numInts, int *intarray, int checkEvery);
    -void testSetlastEtc(int numInts, int *intarray, int checkEvery);
    -void testSetdelsortedEtc(int numInts, int *intarray, int checkEvery);
    -
    -int log_i(setT *set, const char *s, int i, int numInts, int checkEvery);
    -void checkSetContents(const char *name, setT *set, int count, int rangeA, int rangeB, int rangeC);
    -
    -int main(int argc, char **argv) {
    -    int *intarray= NULL;
    -    int numInts;
    -    int checkEvery= MAXint;
    -    int curlong, totlong;
    -    int tracelevel= 4; /* 4 normally.  5 for memory tracing */
    -
    -    readOptions(argc, argv, prompt, &numInts, &checkEvery);
    -    setupMemory(tracelevel, numInts, &intarray);
    -
    -    testSetappendSettruncate(numInts, intarray, checkEvery);
    -    testSetdelSetadd(numInts, intarray, checkEvery);
    -    testSetappendSet(numInts, intarray, checkEvery);
    -    testSetcompactCopy(numInts, intarray, checkEvery);
    -    testSetequalInEtc(numInts, intarray, checkEvery);
    -    testSettemp(numInts, intarray, checkEvery);
    -    testSetlastEtc(numInts, intarray, checkEvery);
    -    testSetdelsortedEtc(numInts, intarray, checkEvery);
    -    printf("\n\nNot testing qh_setduplicate and qh_setfree2.\n  These routines use heap-allocated set contents.  See qhull tests.\n");
    -
    -    qh_memstatistics(stdout);
    -    qh_memfreeshort(&curlong, &totlong);
    -    if (curlong || totlong){
    -        qh_fprintf(stderr, 8043, "qh_memfreeshort: did not free %d bytes of long memory(%d pieces)\n", totlong, curlong);
    -        error_count++;
    -    }
    -    if(error_count){
    -        qh_fprintf(stderr, 8012, "testqset: %d errors\n\n", error_count);
    -        exit(1);
    -    }else{
    -        printf("testqset: OK\n\n");
    -    }
    -    return 0;
    -}/*main*/
    -
    -void readOptions(int argc, char **argv, const char *promptstr, int *numInts, int *checkEvery)
    -{
    -    long numIntsArg;
    -    long checkEveryArg;
    -    char *endp;
    -
    -    if (argc != 2 && argc != 3) {
    -        printf(promptstr);
    -        exit(0);
    -    }
    -    numIntsArg= strtol(argv[1], &endp, 10);
    -    if(numIntsArg<1){
    -        qh_fprintf(stderr, 6301, "First argument should be 1 or greater.  Got '%s'\n", argv[1]);
    -        exit(1);
    -    }
    -    if(numIntsArg>MAXint){
    -        qh_fprintf(stderr, 6302, "qset does not currently support 64-bit ints.  Maximum count is %d\n", MAXint);
    -        exit(1);
    -    }
    -    *numInts= (int)numIntsArg;
    -
    -    if(argc>2){
    -        checkEveryArg= strtol(argv[2], &endp, 10);
    -        if(checkEveryArg<1){
    -            qh_fprintf(stderr, 6321, "checkEvery argument should be 1 or greater.  Got '%s'\n", argv[2]);
    -            exit(1);
    -        }
    -        if(checkEveryArg>MAXint){
    -            qh_fprintf(stderr, 6322, "qset does not currently support 64-bit ints.  Maximum checkEvery is %d\n", MAXint);
    -            exit(1);
    -        }
    -        *checkEvery= (int)checkEveryArg;
    -    }
    -}/*readOptions*/
    -
    -void setupMemory(int tracelevel, int numInts, int **intarray)
    -{
    -    int i;
    -    if(numInts<0 || numInts*(int)sizeof(int)<0){
    -        qh_fprintf(stderr, 6303, "qset does not currently support 64-bit ints.  Integer overflow\n");
    -        exit(1);
    -    }
    -    *intarray= qh_malloc(numInts * sizeof(int));
    -    if(!*intarray){
    -        qh_fprintf(stderr, 6304, "Failed to allocate %d bytes of memory\n", numInts * sizeof(int));
    -        exit(1);
    -    }
    -    for(i= 0; i=2){
    -        isCheck= log_i(ints, "n", numInts/2, numInts, checkEvery);
    -        qh_settruncate(ints, numInts/2);
    -        checkSetContents("qh_settruncate by half", ints, numInts/2, 0, -1, -1);
    -    }
    -    isCheck= log_i(ints, "n", 0, numInts, checkEvery);
    -    qh_settruncate(ints, 0);
    -    checkSetContents("qh_settruncate", ints, 0, -1, -1, -1);
    -
    -    qh_fprintf(stderr, 8003, "\n\nTesting qh_setappend2ndlast 0,0..%d.  Test 0", numInts-1);
    -    qh_setfree(&ints);
    -    ints= qh_setnew(4);
    -    qh_setappend(&ints, intarray+0);
    -    for(i= 0; i=2){
    -        isCheck= log_i(ints, "n", numInts/2, numInts, checkEvery);
    -        SETtruncate_(ints, numInts/2);
    -        checkSetContents("SETtruncate_ by half", ints, numInts/2, 0, -1, -1);
    -    }
    -    isCheck= log_i(ints, "n", 0, numInts, checkEvery);
    -    SETtruncate_(ints, 0);
    -    checkSetContents("SETtruncate_", ints, 0, -1, -1, -1);
    -
    -    qh_setfree(&ints);
    -}/*testSetappendSettruncate*/
    -
    -void testSetdelSetadd(int numInts, int *intarray, int checkEvery)
    -{
    -    setT *ints=qh_setnew(1);
    -    int i,j, isCheck;
    -
    -    qh_fprintf(stderr, 8003, "\n\nTesting qh_setdelnthsorted and qh_setaddnth 1..%d. Test", numInts-1);
    -    for(j=1; j3){
    -                qh_setdelsorted(ints, intarray+i/2);
    -                checkSetContents("qh_setdelsorted", ints, j-1, 0, i/2+1, -1);
    -                qh_setaddsorted(&ints, intarray+i/2);
    -                checkSetContents("qh_setaddsorted i/2", ints, j, 0, 0, -1);
    -            }
    -            qh_setdellast(ints);
    -            checkSetContents("qh_setdellast", ints, (j ? j-1 : 0), 0, -1, -1);
    -            if(j>0){
    -                qh_setaddsorted(&ints, intarray+j-1);
    -                checkSetContents("qh_setaddsorted j-1", ints, j, 0, -1, -1);
    -            }
    -            if(j>4){
    -                qh_setdelnthsorted(ints, i/2);
    -                if (checkEvery==1)
    -                  checkSetContents("qh_setdelnthsorted", ints, j-1, 0, i/2+1, -1);
    -                /* FIXUP qh_setdelnth  move-to-front */
    -                qh_setdelsorted(ints, intarray+i/2+1);
    -                checkSetContents("qh_setdelsorted 2", ints, j-2, 0, i/2+2, -1);
    -                qh_setaddsorted(&ints, intarray+i/2+1);
    -                if (checkEvery==1)
    -                  checkSetContents("qh_setaddsorted i/2+1", ints, j-1, 0, i/2+1, -1);
    -                qh_setaddsorted(&ints, intarray+i/2);
    -                checkSetContents("qh_setaddsorted i/2 again", ints, j, 0, -1, -1);
    -            }
    -            qh_setfree(&ints2);
    -            ints2= qh_setcopy(ints, 0);
    -            qh_setcompact(ints);
    -            qh_setcompact(ints2);
    -            checkSetContents("qh_setcompact", ints, j, 0, 0, -1);
    -            checkSetContents("qh_setcompact 2", ints2, j, 0, 0, -1);
    -            qh_setcompact(ints);
    -            checkSetContents("qh_setcompact 3", ints, j, 0, 0, -1);
    -            qh_setfree(&ints2);
    -        }
    -    }
    -    qh_setfreelong(&ints);
    -    if(ints){
    -        qh_setfree(&ints); /* Was quick memory */
    -    }
    -}/*testSetdelsortedEtc*/
    -
    -void testSetequalInEtc(int numInts, int *intarray, int checkEvery)
    -{
    -    setT *ints= NULL;
    -    setT *ints2= NULL;
    -    setT *ints3= NULL;
    -    int i,j,n;
    -
    -    qh_fprintf(stderr, 8019, "\n\nTesting qh_setequal*, qh_setin*, qh_setdel, qh_setdelnth, and qh_setlarger 0..%d. Test", numInts-1);
    -    for(j=0; j0){
    -                if(qh_setequal(ints, ints2)){
    -                    qh_fprintf(stderr, 6324, "testSetequalInEtc: non-empty set equal to empty set\n", j);
    -                    error_count++;
    -                }
    -                qh_setfree(&ints3);
    -                ints3= qh_setcopy(ints, 0);
    -                checkSetContents("qh_setreplace", ints3, j, 0, -1, -1);
    -                qh_setreplace(ints3, intarray+j/2, intarray+j/2+1);
    -                if(j==1){
    -                    checkSetContents("qh_setreplace 2", ints3, j, j/2+1, -1, -1);
    -                }else if(j==2){
    -                    checkSetContents("qh_setreplace 3", ints3, j, 0, j/2+1, -1);
    -                }else{
    -                    checkSetContents("qh_setreplace 3", ints3, j, 0, j/2+1, j/2+1);
    -                }
    -                if(qh_setequal(ints, ints3)){
    -                    qh_fprintf(stderr, 6325, "testSetequalInEtc: modified set equal to original set at %d/2\n", j);
    -                    error_count++;
    -                }
    -                if(!qh_setequal_except(ints, intarray+j/2, ints3, intarray+j/2+1)){
    -                    qh_fprintf(stderr, 6326, "qh_setequal_except: modified set not equal to original set except modified\n", j);
    -                    error_count++;
    -                }
    -                if(qh_setequal_except(ints, intarray+j/2, ints3, intarray)){
    -                    qh_fprintf(stderr, 6327, "qh_setequal_except: modified set equal to original set with wrong excepts\n", j);
    -                    error_count++;
    -                }
    -                if(!qh_setequal_skip(ints, j/2, ints3, j/2)){
    -                    qh_fprintf(stderr, 6328, "qh_setequal_skip: modified set not equal to original set except modified\n", j);
    -                    error_count++;
    -                }
    -                if(j>2 && qh_setequal_skip(ints, j/2, ints3, 0)){
    -                    qh_fprintf(stderr, 6329, "qh_setequal_skip: modified set equal to original set with wrong excepts\n", j);
    -                    error_count++;
    -                }
    -                if(intarray+j/2+1!=qh_setdel(ints3, intarray+j/2+1)){
    -                    qh_fprintf(stderr, 6330, "qh_setdel: failed to find added element\n", j);
    -                    error_count++;
    -                }
    -                checkSetContents("qh_setdel", ints3, j-1, 0, j-1, (j==1 ? -1 : j/2+1));  /* swaps last element with deleted element */
    -                if(j>3){
    -                    qh_setdelnth(ints3, j/2); /* Delete at the same location as the original replace, for only one out-of-order element */
    -                    checkSetContents("qh_setdelnth", ints3, j-2, 0, j-2, (j==2 ? -1 : j/2+1));
    -                }
    -                if(qh_setin(ints3, intarray+j/2)){
    -                    qh_fprintf(stderr, 6331, "qh_setin: found deleted element\n");
    -                    error_count++;
    -                }
    -                if(j>4 && !qh_setin(ints3, intarray+1)){
    -                    qh_fprintf(stderr, 6332, "qh_setin: did not find second element\n");
    -                    error_count++;
    -                }
    -                if(j>4 && !qh_setin(ints3, intarray+j-2)){
    -                    qh_fprintf(stderr, 6333, "qh_setin: did not find last element\n");
    -                    error_count++;
    -                }
    -                if(-1!=qh_setindex(ints2, intarray)){
    -                    qh_fprintf(stderr, 6334, "qh_setindex: found element in empty set\n");
    -                    error_count++;
    -                }
    -                if(-1!=qh_setindex(ints3, intarray+j/2)){
    -                    qh_fprintf(stderr, 6335, "qh_setindex: found deleted element in set\n");
    -                    error_count++;
    -                }
    -                if(0!=qh_setindex(ints, intarray)){
    -                    qh_fprintf(stderr, 6336, "qh_setindex: did not find first in set\n");
    -                    error_count++;
    -                }
    -                if(j-1!=qh_setindex(ints, intarray+j-1)){
    -                    qh_fprintf(stderr, 6337, "qh_setindex: did not find last in set\n");
    -                    error_count++;
    -                }
    -            }
    -            qh_setfree(&ints2);
    -        }
    -    }
    -    qh_setfree(&ints3);
    -    qh_setfreelong(&ints);
    -    if(ints){
    -        qh_setfree(&ints); /* Was quick memory */
    -    }
    -}/*testSetequalInEtc*/
    -
    -
    -void testSetlastEtc(int numInts, int *intarray, int checkEvery)
    -{
    -    setT *ints= NULL;
    -    setT *ints2= NULL;
    -    int i,j,prepend;
    -
    -    qh_fprintf(stderr, 8020, "\n\nTesting qh_setlast, qh_setnew_delnthsorted, qh_setunique, and qh_setzero 0..%d. Test", numInts-1);
    -    for(j=0; j0){
    -                if(intarray+j-1!=qh_setlast(ints)){
    -                    qh_fprintf(stderr, 6338, "qh_setlast: wrong last element\n");
    -                    error_count++;
    -                }
    -                prepend= (j<100 ? j/4 : 0);
    -                ints2= qh_setnew_delnthsorted(ints, qh_setsize(ints), j/2, prepend);
    -                if(qh_setsize(ints2)!=j+prepend-1){
    -                    qh_fprintf(stderr, 6345, "qh_setnew_delnthsorted: Expecting %d elements, got %d\n", j+prepend-1, qh_setsize(ints2));
    -                    error_count++;
    -                }
    -                /* Define prepended elements.  Otherwise qh_setdelnthsorted may fail */
    -                for(i= 0; i2){
    -                    qh_setzero(ints2, j/2, j-1);  /* max size may be j-1 */
    -                    if(qh_setsize(ints2)!=j-1){
    -                        qh_fprintf(stderr, 6342, "qh_setzero: Expecting %d elements, got %d\n", j, qh_setsize(ints2));
    -                        error_count++;
    -                    }
    -                    qh_setcompact(ints2);
    -                    checkSetContents("qh_setzero", ints2, j/2, 0, -1, -1);
    -                }
    -            }
    -            qh_setfree(&ints2);
    -        }
    -    }
    -    qh_setfreelong(&ints);
    -    if(ints){
    -        qh_setfree(&ints); /* Was quick memory */
    -    }
    -}/*testSetlastEtc*/
    -
    -void testSettemp(int numInts, int *intarray, int checkEvery)
    -{
    -    setT *ints= NULL;
    -    setT *ints2= NULL;
    -    setT *ints3= NULL;
    -    int i,j;
    -
    -    qh_fprintf(stderr, 8021, "\n\nTesting qh_settemp* 0..%d. Test", numInts-1);
    -    for(j=0; j0){
    -                qh_settemppush(ints);
    -                ints3= qh_settemppop();
    -                if(ints!=ints3){
    -                    qh_fprintf(stderr, 6343, "qh_settemppop: didn't pop the push\n");
    -                    error_count++;
    -                }
    -            }
    -            qh_settempfree(&ints2);
    -        }
    -    }
    -    qh_setfreelong(&ints);
    -    if(ints){
    -        qh_setfree(&ints); /* Was quick memory */
    -    }
    -}/*testSettemp*/
    -
    -/* Check that a set contains count elements
    -   Ranges are consecutive (e.g., 1,2,3,...) starting with first, mid, and last
    -   Use -1 for missing ranges
    -   Returns -1 if should check results
    -*/
    -int log_i(setT *set, const char *s, int i, int numInts, int checkEvery)
    -{
    -    int j= i;
    -    int scale= 1;
    -    int e= 0;
    -    int *i2, **i2p;
    -
    -    if(*s || checkEvery==1){
    -        if(i<10){
    -            qh_fprintf(stderr, 8004, " %s%d", s, i);
    -        }else{
    -            if(i==11 && checkEvery==1){
    -                qh_fprintf(stderr, 8005, "\nResults after 10: ");
    -                FOREACHint_(set){
    -                    qh_fprintf(stderr, 8006, " %d", *i2);
    -                }
    -                qh_fprintf(stderr, 8007, " Continue");
    -            }
    -            while((j= j/10)>=1){
    -                scale *= 10;
    -                e++;
    -            }
    -            if(i==numInts-1){
    -                qh_fprintf(stderr, 8008, " %s%d", s, i);
    -            }else if(i==scale){
    -                if(i<=1000){
    -                    qh_fprintf(stderr, 8010, " %s%d", s, i);
    -                }else{
    -                    qh_fprintf(stderr, 8009, " %s1e%d", s, e);
    -                }
    -            }
    -        }
    -    }
    -    if(i<1000 || i%checkEvery==0 || i== scale || i==numInts-1){
    -        return 1;
    -    }
    -    return 0;
    -}/*log_i*/
    -
    -/* Check that a set contains count elements
    -   Ranges are consecutive (e.g., 1,2,3,...) starting with first, mid, and last
    -   Use -1 for missing ranges
    -*/
    -void checkSetContents(const char *name, setT *set, int count, int rangeA, int rangeB, int rangeC)
    -{
    -
    -    i2T *i2, **i2p;
    -    int i2_i, i2_n;
    -    int prev= -1; /* avoid warning */
    -    int i;
    -    int first= -3;
    -    int second= -3;
    -    int rangeCount=1;
    -    int actualSize= 0;
    -
    -    qh_setcheck(set, name, 0);
    -    if(set){
    -        SETreturnsize_(set, actualSize);  /* normally used only when speed is critical */
    -        if(*qh_setendpointer(set)!=NULL){
    -            qh_fprintf(stderr, 6344, "%s: qh_setendpointer(), 0x%x, is not NULL terminator of set 0x%x", name, qh_setendpointer(set), set);
    -            error_count++;
    -        }
    -    }
    -    if(actualSize!=qh_setsize(set)){
    -        qh_fprintf(stderr, 6305, "%s: SETreturnsize_() returned %d while qh_setsize() returns %d\n", name, actualSize, qh_setsize(set));
    -        error_count++;
    -    }else if(actualSize!=count){
    -        qh_fprintf(stderr, 6306, "%s: Expecting %d elements for set.  Got %d elements\n", name, count, actualSize);
    -        error_count++;
    -    }
    -    if(SETempty_(set)){
    -        if(count!=0){
    -            qh_fprintf(stderr, 6307, "%s: Got empty set instead of count %d, rangeA %d, rangeB %d, rangeC %d\n", name, count, rangeA, rangeB, rangeC);
    -            error_count++;
    -        }
    -    }else{
    -        /* Must be first, otherwise trips msvc 8 */
    -        i2T **p= SETaddr_(set, i2T);
    -        if(*p!=SETfirstt_(set, i2T)){
    -            qh_fprintf(stderr, 6309, "%s: SETaddr_(set, i2t) [%p] is not the same as SETfirst_(set) [%p]\n", name, SETaddr_(set, i2T), SETfirst_(set));
    -            error_count++;
    -        }
    -        first= *(int *)SETfirst_(set);
    -        if(SETfirst_(set)!=SETfirstt_(set, i2T)){
    -            qh_fprintf(stderr, 6308, "%s: SETfirst_(set) [%p] is not the same as SETfirstt_(set, i2T [%p]\n", name, SETfirst_(set), SETfirstt_(set, i2T));
    -            error_count++;
    -        }
    -        if(qh_setsize(set)>1){
    -            second= *(int *)SETsecond_(set);
    -            if(SETsecond_(set)!=SETsecondt_(set, i2T)){
    -                qh_fprintf(stderr, 6310, "%s: SETsecond_(set) [%p] is not the same as SETsecondt_(set, i2T) [%p]\n", name, SETsecond_(set), SETsecondt_(set, i2T));
    -                error_count++;
    -            }
    -        }
    -    }
    -    /* Test first run of ints in set*/
    -    i= 0;
    -    FOREACHint_(set){
    -        if(i2!=SETfirst_(set) && *i2!=prev+1){
    -            break;
    -        }
    -        prev= *i2;
    -        if(SETindex_(set, i2)!=i){
    -            qh_fprintf(stderr, 6311, "%s: Expecting SETIndex_(set, pointer-to-%d) to be %d.  Got %d\n", name, *i2, i, SETindex_(set, i2));
    -            error_count++;;
    -        }
    -        if(i2!=SETref_(i2)){
    -            qh_fprintf(stderr, 6312, "%s: SETref_(i2) [%p] does not point to i2 (the %d'th element)\n", name, SETref_(i2), i);
    -            error_count++;;
    -        }
    -        i++;
    -    }
    -    FOREACHint_i_(set){
    -        /* Must be first conditional, otherwise it trips up msvc 8 */
    -        i2T **p= SETelemaddr_(set, i2_i, i2T);
    -        if(i2!=*p){
    -            qh_fprintf(stderr, 6320, "%s: SETelemaddr_(set, %d, i2T) [%p] does not point to i2\n", name, i2_i, SETelemaddr_(set, i2_i, int));
    -            error_count++;;
    -        }
    -        if(i2_i==0){
    -            if(first!=*i2){
    -                qh_fprintf(stderr, 6314, "%s: First element is %d instead of SETfirst %d\n", name, *i2, first);
    -                error_count++;;
    -            }
    -            if(rangeA!=*i2){
    -                qh_fprintf(stderr, 6315, "%s: starts with %d instead of rangeA %d\n", name, *i2, rangeA);
    -                error_count++;;
    -            }
    -            prev= rangeA;
    -        }else{
    -            if(i2_i==1 && second!=*i2){
    -                qh_fprintf(stderr, 6316, "%s: Second element is %d instead of SETsecond %d\n", name, *i2, second);
    -                error_count++;;
    -            }
    -            if(prev+1==*i2){
    -                prev++;
    -            }else{
    -                if(*i2==rangeB){
    -                    prev= rangeB;
    -                    rangeB= -1;
    -                    rangeCount++;
    -                }else if(rangeB==-1 && *i2==rangeC){
    -                    prev= rangeC;
    -                    rangeC= -1;
    -                    rangeCount++;
    -                }else{
    -                    prev++;
    -                    qh_fprintf(stderr, 6317, "%s: Expecting %d'th element to be %d.  Got %d\n", name, i2_i, prev, *i2);
    -                    error_count++;
    -                }
    -            }
    -        }
    -        if(i2!=SETelem_(set, i2_i)){
    -            qh_fprintf(stderr, 6318, "%s: SETelem_(set, %d) [%p] is not i2 [%p] (the %d'th element)\n", name, i2_i, SETelem_(set, i2_i), i2, i2_i);
    -            error_count++;;
    -        }
    -        if(SETelemt_(set, i2_i, i2T)!=SETelem_(set, i2_i)){   /* Normally SETelemt_ is used for generic sets */
    -            qh_fprintf(stderr, 6319, "%s: SETelemt_(set, %d, i2T) [%p] is not SETelem_(set, %d) [%p] (the %d'th element)\n", name, i2_i, SETelemt_(set, i2_i, int), i2_i, SETelem_(set, i2_i), i2_i);
    -            error_count++;;
    -        }
    -    }
    -    if(error_count>=MAXerrorCount){
    -        qh_fprintf(stderr, 8011, "testqset: Stop testing after %d errors\n", error_count);
    -        exit(1);
    -    }
    -}/*checkSetContents*/
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.pro
    deleted file mode 100644
    index b49c3371db..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/testqset/testqset.pro
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -# -------------------------------------------------
    -# testqset.pro -- Qt project file for testqset.exe
    -# -------------------------------------------------
    -
    -include(../qhull-warn.pri)
    -
    -TARGET = testqset
    -
    -DESTDIR = ../../bin
    -TEMPLATE = app
    -CONFIG += console warn_on
    -CONFIG -= qt
    -CONFIG += qhull_warn_conversion
    -
    -build_pass:CONFIG(debug, debug|release){
    -   OBJECTS_DIR = Debug
    -}else:build_pass:CONFIG(release, debug|release){
    -   OBJECTS_DIR = Release
    -}
    -
    -INCLUDEPATH += ../libqhull
    -
    -SOURCES += testqset.c
    -SOURCES += ../libqhull/qset.c
    -SOURCES += ../libqhull/mem.c
    -
    -HEADERS += ../libqhull/mem.h
    -HEADERS += ../libqhull/qset.h
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.c
    deleted file mode 100644
    index 934e816cb1..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.c
    +++ /dev/null
    @@ -1,327 +0,0 @@
    -/*
      ---------------------------------
    -
    -  user_eg.c
    -  sample code for calling qhull() from an application
    -
    -  call with:
    -
    -     user_eg "cube/diamond options" "delaunay options" "halfspace options"
    -
    -  for example:
    -
    -     user_eg                             # return summaries
    -
    -     user_eg "n" "o" "Fp"                # return normals, OFF, points
    -
    -     user_eg "n Qt" "o" "Fp"             # triangulated cube
    -
    -     user_eg "QR0 p" "QR0 v p" "QR0 Fp"  # rotate input and return points
    -                                         # 'v' returns Voronoi
    -                                         # transform is rotated for halfspaces
    -
    -   main() makes three runs of qhull.
    -
    -     1) compute the convex hull of a cube
    -
    -     2a) compute the Delaunay triangulation of random points
    -
    -     2b) find the Delaunay triangle closest to a point.
    -
    -     3) compute the halfspace intersection of a diamond
    -
    - notes:
    -
    -   For another example, see main() in unix.c and user_eg2.c.
    -   These examples, call qh_qhull() directly.  They allow
    -   tighter control on the code loaded with Qhull.
    -
    -   For a C++ example, see user_eg3.cpp
    -
    -   Summaries are sent to stderr if other output formats are used
    -
    -   compiled by 'make user_eg'
    -
    -   see libqhull.h for data structures, macros, and user-callable functions.
    -*/
    -
    -#define qh_QHimport
    -#include "qhull_a.h"
    -
    -/*-------------------------------------------------
    --internal function prototypes
    -*/
    -void print_summary (void);
    -void makecube (coordT *points, int numpoints, int dim);
    -void makeDelaunay (coordT *points, int numpoints, int dim, int seed);
    -void findDelaunay (int dim);
    -void makehalf (coordT *points, int numpoints, int dim);
    -
    -/*-------------------------------------------------
    --print_summary()
    -*/
    -void print_summary (void) {
    -  facetT *facet;
    -  int k;
    -
    -  printf ("\n%d vertices and %d facets with normals:\n",
    -                 qh num_vertices, qh num_facets);
    -  FORALLfacets {
    -    for (k=0; k < qh hull_dim; k++)
    -      printf ("%6.2g ", facet->normal[k]);
    -    printf ("\n");
    -  }
    -}
    -
    -/*--------------------------------------------------
    --makecube- set points to vertices of cube
    -  points is numpoints X dim
    -*/
    -void makecube (coordT *points, int numpoints, int dim) {
    -  int j,k;
    -  coordT *point;
    -
    -  for (j=0; jlocate a facet with qh_findbestfacet()
    -*/
    -void findDelaunay (int dim) {
    -  int k;
    -  coordT point[ 100];
    -  boolT isoutside;
    -  realT bestdist;
    -  facetT *facet;
    -  vertexT *vertex, **vertexp;
    -
    -  for (k= 0; k < dim; k++)
    -    point[k]= 0.5;
    -  qh_setdelaunay (dim+1, 1, point);
    -  facet= qh_findbestfacet (point, qh_ALL, &bestdist, &isoutside);
    -  if (facet->tricoplanar) {
    -    fprintf(stderr, "findDelaunay: not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n",
    -       facet->id);
    -    qh_errexit (qh_ERRqhull, facet, NULL);
    -  }
    -  FOREACHvertex_(facet->vertices) {
    -    for (k=0; k < dim; k++)
    -      printf ("%5.2f ", vertex->point[k]);
    -    printf ("\n");
    -  }
    -} /*.findDelaunay.*/
    -
    -/*--------------------------------------------------
    --makehalf- set points to halfspaces for a (dim)-dimensional diamond
    -  points is numpoints X dim+1
    -
    -  each halfspace consists of dim coefficients followed by an offset
    -*/
    -void makehalf (coordT *points, int numpoints, int dim) {
    -  int j,k;
    -  coordT *point;
    -
    -  for (j=0; j= 2 ? argv[1] : "");
    -  numpoints= SIZEcube;
    -  makecube (points, numpoints, DIM);
    -  for (i=numpoints; i--; )
    -    rows[i]= points+dim*i;
    -  qh_printmatrix (outfile, "input", rows, numpoints, dim);
    -  exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
    -                      flags, outfile, errfile);
    -  if (!exitcode) {                  /* if no error */
    -    /* 'qh facet_list' contains the convex hull */
    -    print_summary();
    -    FORALLfacets {
    -       /* ... your code ... */
    -    }
    -  }
    -  qh_freeqhull(!qh_ALL);                   /* free long memory  */
    -  qh_memfreeshort (&curlong, &totlong);    /* free short memory and memory allocator */
    -  if (curlong || totlong)
    -    fprintf (errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
    -
    -  /*
    -    Run 2: Delaunay triangulation
    -  */
    -
    -  printf( "\ncompute %d-d Delaunay triangulation\n", dim);
    -  sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
    -  numpoints= SIZEcube;
    -  makeDelaunay (points, numpoints, dim, (int)time(NULL));
    -  for (i=numpoints; i--; )
    -    rows[i]= points+dim*i;
    -  qh_printmatrix (outfile, "input", rows, numpoints, dim);
    -  exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
    -                      flags, outfile, errfile);
    -  if (!exitcode) {                  /* if no error */
    -    /* 'qh facet_list' contains the convex hull */
    -    /* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL),
    -       call qh_setvoronoi_all() after qh_new_qhull(). */
    -    print_summary();
    -    FORALLfacets {
    -       /* ... your code ... */
    -    }
    -    printf( "\nfind %d-d Delaunay triangle closest to [0.5, 0.5, ...]\n", dim);
    -    exitcode= setjmp (qh errexit);
    -    if (!exitcode) {
    -      /* Trap Qhull errors in findDelaunay().  Without the setjmp(), Qhull
    -         will exit() after reporting an error */
    -      qh NOerrexit= False;
    -      findDelaunay (DIM);
    -    }
    -    qh NOerrexit= True;
    -  }
    -#if qh_QHpointer  /* see user.h */
    -  {
    -    qhT *oldqhA, *oldqhB;
    -    coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */
    -
    -
    -    printf( "\nsave first triangulation and compute a new triangulation\n");
    -    oldqhA= qh_save_qhull();
    -    sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
    -    numpoints= SIZEcube;
    -    makeDelaunay (pointsB, numpoints, dim, (int)time(NULL)+1);
    -    for (i=numpoints; i--; )
    -      rows[i]= pointsB+dim*i;
    -    qh_printmatrix (outfile, "input", rows, numpoints, dim);
    -    exitcode= qh_new_qhull (dim, numpoints, pointsB, ismalloc,
    -                      flags, outfile, errfile);
    -    if (!exitcode)
    -      print_summary();
    -    printf( "\nsave second triangulation and restore first one\n");
    -    oldqhB= qh_save_qhull();
    -    qh_restore_qhull (&oldqhA);
    -    print_summary();
    -    printf( "\nfree first triangulation and restore second one.\n");
    -    qh_freeqhull (qh_ALL);               /* free short and long memory used by first call */
    -                                         /* do not use qh_memfreeshort */
    -    qh_restore_qhull (&oldqhB);
    -    print_summary();
    -  }
    -#endif
    -  qh_freeqhull(!qh_ALL);                 /* free long memory */
    -  qh_memfreeshort (&curlong, &totlong);  /* free short memory and memory allocator */
    -  if (curlong || totlong)
    -    fprintf (errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
    -
    -  /*
    -    Run 3: halfspace intersection about the origin
    -  */
    -  printf( "\ncompute halfspace intersection about the origin for a diamond\n");
    -  sprintf (flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp");
    -  numpoints= SIZEcube;
    -  makehalf (points, numpoints, dim);
    -  for (i=numpoints; i--; )
    -    rows[i]= points+(dim+1)*i;
    -  qh_printmatrix (outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1);
    -  /* use qh_sethalfspace_all to transform the halfspaces yourself.
    -     If so, set 'qh feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces]
    -  */
    -  exitcode= qh_new_qhull (dim+1, numpoints, points, ismalloc,
    -                      flags, outfile, errfile);
    -  if (!exitcode)
    -    print_summary();
    -  qh_freeqhull (!qh_ALL);
    -  qh_memfreeshort (&curlong, &totlong);
    -  if (curlong || totlong)  /* could also check previous runs */
    -    fprintf (stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n",
    -       totlong, curlong);
    -  return exitcode;
    -} /* main */
    -
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.pro
    deleted file mode 100644
    index 090370b34a..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg/user_eg.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# user_eg.pro -- Qt project for Qhull demonstration
    -# -------------------------------------------------
    -
    -include(../qhull-app-sharedp.pri)
    -
    -TARGET = user_eg
    -
    -SOURCES += user_eg.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.c b/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.c
    deleted file mode 100644
    index 8f21b175d6..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.c
    +++ /dev/null
    @@ -1,736 +0,0 @@
    -/*
      ---------------------------------
    -
    -  user_eg2.c
    -
    -  sample code for calling qhull() from an application.
    -
    -  See user_eg.c for a simpler method using qh_new_qhull().
    -  The method used here and in unix.c gives you additional
    -  control over Qhull.
    -
    -  See user_eg3.cpp for a C++ example
    -
    -  call with:
    -
    -     user_eg2 "triangulated cube/diamond options" "delaunay options" "halfspace options"
    -
    -  for example:
    -
    -     user_eg2                             # return summaries
    -
    -     user_eg2 "n" "o" "Fp"                # return normals, OFF, points
    -
    -     user_eg2 "QR0 p" "QR0 v p" "QR0 Fp"  # rotate input and return points
    -                                         # 'v' returns Voronoi
    -                                         # transform is rotated for halfspaces
    -
    -   main() makes three runs of qhull.
    -
    -     1) compute the convex hull of a cube, and incrementally add a diamond
    -
    -     2a) compute the Delaunay triangulation of random points, and add points.
    -
    -     2b) find the Delaunay triangle closest to a point.
    -
    -     3) compute the halfspace intersection of a diamond, and add a cube
    -
    - notes:
    -
    -   summaries are sent to stderr if other output formats are used
    -
    -   derived from unix.c and compiled by 'make user_eg2'
    -
    -   see libqhull.h for data structures, macros, and user-callable functions.
    -
    -   If you want to control all output to stdio and input to stdin,
    -   set the #if below to "1" and delete all lines that contain "io.c".
    -   This prevents the loading of io.o.  Qhull will
    -   still write to 'qh ferr' (stderr) for error reporting and tracing.
    -
    -   Defining #if 1, also prevents user.o from being loaded.
    -*/
    -
    -#include "qhull_a.h"
    -
    -/*-------------------------------------------------
    --internal function prototypes
    -*/
    -void print_summary (void);
    -void makecube (coordT *points, int numpoints, int dim);
    -void adddiamond (coordT *points, int numpoints, int numnew, int dim);
    -void makeDelaunay (coordT *points, int numpoints, int dim);
    -void addDelaunay (coordT *points, int numpoints, int numnew, int dim);
    -void findDelaunay (int dim);
    -void makehalf (coordT *points, int numpoints, int dim);
    -void addhalf (coordT *points, int numpoints, int numnew, int dim, coordT *feasible);
    -
    -/*-------------------------------------------------
    --print_summary()
    -*/
    -void print_summary (void) {
    -  facetT *facet;
    -  int k;
    -
    -  printf ("\n%d vertices and %d facets with normals:\n",
    -                 qh num_vertices, qh num_facets);
    -  FORALLfacets {
    -    for (k=0; k < qh hull_dim; k++)
    -      printf ("%6.2g ", facet->normal[k]);
    -    printf ("\n");
    -  }
    -}
    -
    -/*--------------------------------------------------
    --makecube- set points to vertices of cube
    -  points is numpoints X dim
    -*/
    -void makecube (coordT *points, int numpoints, int dim) {
    -  int j,k;
    -  coordT *point;
    -
    -  for (j=0; jlocate a facet with qh_findbestfacet()
    -*/
    -void findDelaunay (int dim) {
    -  int k;
    -  coordT point[ 100];
    -  boolT isoutside;
    -  realT bestdist;
    -  facetT *facet;
    -  vertexT *vertex, **vertexp;
    -
    -  for (k= 0; k < dim-1; k++)
    -    point[k]= 0.5;
    -  qh_setdelaunay (dim, 1, point);
    -  facet= qh_findbestfacet (point, qh_ALL, &bestdist, &isoutside);
    -  if (facet->tricoplanar) {
    -    fprintf(stderr, "findDelaunay: not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n",
    -       facet->id);
    -    qh_errexit (qh_ERRqhull, facet, NULL);
    -  }
    -  FOREACHvertex_(facet->vertices) {
    -    for (k=0; k < dim-1; k++)
    -      printf ("%5.2f ", vertex->point[k]);
    -    printf ("\n");
    -  }
    -} /*.findDelaunay.*/
    -
    -/*--------------------------------------------------
    --makehalf- set points to halfspaces for a (dim)-d diamond
    -  points is numpoints X dim+1
    -
    -  each halfspace consists of dim coefficients followed by an offset
    -*/
    -void makehalf (coordT *points, int numpoints, int dim) {
    -  int j,k;
    -  coordT *point;
    -
    -  for (j=0; j= 2 ? argv[1] : "");
    -    qh_initflags (options);
    -    printf( "\ncompute triangulated convex hull of cube after rotating input\n");
    -    makecube (array[0], SIZEcube, DIM);
    -    qh_init_B (array[0], SIZEcube, DIM, ismalloc);
    -    qh_qhull();
    -    qh_check_output();
    -    qh_triangulate();  /* requires option 'Q11' if want to add points */
    -    print_summary ();
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -    printf( "\nadd points in a diamond\n");
    -    adddiamond (array[0], SIZEcube, SIZEdiamond, DIM);
    -    qh_check_output();
    -    print_summary ();
    -    qh_produce_output();  /* delete this line to help avoid io.c */
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -  }
    -  qh NOerrexit= True;
    -  qh_freeqhull (!qh_ALL);
    -  qh_memfreeshort (&curlong, &totlong);
    -  /*
    -    Run 2: Delaunay triangulation
    -  */
    -  qh_init_A (stdin, stdout, stderr, 0, NULL);
    -  exitcode= setjmp (qh errexit);
    -  if (!exitcode) {
    -    coordT array[TOTpoints][DIM];
    -
    -    strcat (qh rbox_command, "user_eg Delaunay");
    -    sprintf (options, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
    -    qh_initflags (options);
    -    printf( "\ncompute %d-d Delaunay triangulation\n", DIM-1);
    -    makeDelaunay (array[0], SIZEcube, DIM);
    -    /* Instead of makeDelaunay with qh_setdelaunay, you may
    -       produce a 2-d array of points, set DIM to 2, and set
    -       qh PROJECTdelaunay to True.  qh_init_B will call
    -       qh_projectinput to project the points to the paraboloid
    -       and add a point "at-infinity".
    -    */
    -    qh_init_B (array[0], SIZEcube, DIM, ismalloc);
    -    qh_qhull();
    -    /* If you want Voronoi ('v') without qh_produce_output(), call
    -       qh_setvoronoi_all() after qh_qhull() */
    -    qh_check_output();
    -    print_summary ();
    -    qh_produce_output();  /* delete this line to help avoid io.c */
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -    printf( "\nadd points to triangulation\n");
    -    addDelaunay (array[0], SIZEcube, SIZEdiamond, DIM);
    -    qh_check_output();
    -    qh_produce_output();  /* delete this line to help avoid io.c */
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -    printf( "\nfind Delaunay triangle closest to [0.5, 0.5, ...]\n");
    -    findDelaunay (DIM);
    -  }
    -  qh NOerrexit= True;
    -  qh_freeqhull (!qh_ALL);
    -  qh_memfreeshort (&curlong, &totlong);
    -  /*
    -    Run 3: halfspace intersection
    -  */
    -  qh_init_A (stdin, stdout, stderr, 0, NULL);
    -  exitcode= setjmp (qh errexit);
    -  if (!exitcode) {
    -    coordT array[TOTpoints][DIM+1];  /* +1 for halfspace offset */
    -    pointT *points;
    -
    -    strcat (qh rbox_command, "user_eg halfspaces");
    -    sprintf (options, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "");
    -    qh_initflags (options);
    -    printf( "\ncompute halfspace intersection about the origin for a diamond\n");
    -    makehalf (array[0], SIZEcube, DIM);
    -    qh_setfeasible (DIM); /* from io.c, sets qh feasible_point from 'Hn,n' */
    -    /* you may malloc and set qh feasible_point directly.  It is only used for
    -       option 'Fp' */
    -    points= qh_sethalfspace_all ( DIM+1, SIZEcube, array[0], qh feasible_point);
    -    qh_init_B (points, SIZEcube, DIM, True); /* qh_freeqhull frees points */
    -    qh_qhull();
    -    qh_check_output();
    -    qh_produce_output();  /* delete this line to help avoid io.c */
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -    printf( "\nadd halfspaces for cube to intersection\n");
    -    addhalf (array[0], SIZEcube, SIZEdiamond, DIM, qh feasible_point);
    -    qh_check_output();
    -    qh_produce_output();  /* delete this line to help avoid io.c */
    -    if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
    -      qh_check_points ();
    -  }
    -  qh NOerrexit= True;
    -  qh NOerrexit= True;
    -  qh_freeqhull (!qh_ALL);
    -  qh_memfreeshort (&curlong, &totlong);
    -  if (curlong || totlong)  /* could also check previous runs */
    -    fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
    -       totlong, curlong);
    -  return exitcode;
    -} /* main */
    -
    -#if 1    /* use 1 to prevent loading of io.o and user.o */
    -/*-------------------------------------------
    --errexit- return exitcode to system after an error
    -  assumes exitcode non-zero
    -  prints useful information
    -  see qh_errexit2() in libqhull.c for 2 facets
    -*/
    -void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) {
    -  QHULL_UNUSED(facet);
    -  QHULL_UNUSED(ridge);
    -
    -  if (qh ERREXITcalled) {
    -    fprintf (qh ferr, "qhull error while processing previous error.  Exit program\n");
    -    exit(1);
    -  }
    -  qh ERREXITcalled= True;
    -  if (!qh QHULLfinished)
    -    qh hulltime= (unsigned)clock() - qh hulltime;
    -  fprintf (qh ferr, "\nWhile executing: %s | %s\n", qh rbox_command, qh qhull_command);
    -  fprintf(qh ferr, "Options selected:\n%s\n", qh qhull_options);
    -  if (qh furthest_id >= 0) {
    -    fprintf(qh ferr, "\nLast point added to hull was p%d", qh furthest_id);
    -    if (zzval_(Ztotmerge))
    -      fprintf(qh ferr, "  Last merge was #%d.", zzval_(Ztotmerge));
    -    if (qh QHULLfinished)
    -      fprintf(qh ferr, "\nQhull has finished constructing the hull.");
    -    else if (qh POSTmerging)
    -      fprintf(qh ferr, "\nQhull has started post-merging");
    -    fprintf(qh ferr, "\n\n");
    -  }
    -  if (qh NOerrexit) {
    -    fprintf (qh ferr, "qhull error while ending program.  Exit program\n");
    -    exit(1);
    -  }
    -  if (!exitcode)
    -    exitcode= qh_ERRqhull;
    -  qh NOerrexit= True;
    -  longjmp(qh errexit, exitcode);
    -} /* errexit */
    -
    -
    -/*-------------------------------------------
    --errprint- prints out the information of the erroneous object
    -    any parameter may be NULL, also prints neighbors and geomview output
    -*/
    -void qh_errprint(const char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex) {
    -
    -  fprintf (qh ferr, "%s facets f%d f%d ridge r%d vertex v%d\n",
    -           string, getid_(atfacet), getid_(otherfacet), getid_(atridge),
    -           getid_(atvertex));
    -} /* errprint */
    -
    -
    -void qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall) {
    -  facetT *facet, **facetp;
    -
    -  /* remove these calls to help avoid io.c */
    -  qh_printbegin (qh ferr, qh_PRINTfacets, facetlist, facets, printall);/*io.c*/
    -  FORALLfacet_(facetlist)                                              /*io.c*/
    -    qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);          /*io.c*/
    -  FOREACHfacet_(facets)                                                /*io.c*/
    -    qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);          /*io.c*/
    -  qh_printend (qh ferr, qh_PRINTfacets, facetlist, facets, printall);  /*io.c*/
    -
    -  FORALLfacet_(facetlist)
    -    fprintf( qh ferr, "facet f%d\n", facet->id);
    -} /* printfacetlist */
    -
    -/* qh_printhelp_degenerate( fp )
    -    prints descriptive message for precision error
    -
    -  notes:
    -    no message if qh_QUICKhelp
    -*/
    -void qh_printhelp_degenerate(FILE *fp) {
    -
    -  if (qh MERGEexact || qh PREmerge || qh JOGGLEmax < REALmax/2)
    -    qh_fprintf(fp, 9368, "\n\
    -A Qhull error has occurred.  Qhull should have corrected the above\n\
    -precision error.  Please send the input and all of the output to\n\
    -qhull_bug@qhull.org\n");
    -  else if (!qh_QUICKhelp) {
    -    qh_fprintf(fp, 9369, "\n\
    -Precision problems were detected during construction of the convex hull.\n\
    -This occurs because convex hull algorithms assume that calculations are\n\
    -exact, but floating-point arithmetic has roundoff errors.\n\
    -\n\
    -To correct for precision problems, do not use 'Q0'.  By default, Qhull\n\
    -selects 'C-0' or 'Qx' and merges non-convex facets.  With option 'QJ',\n\
    -Qhull joggles the input to prevent precision problems.  See \"Imprecision\n\
    -in Qhull\" (qh-impre.htm).\n\
    -\n\
    -If you use 'Q0', the output may include\n\
    -coplanar ridges, concave ridges, and flipped facets.  In 4-d and higher,\n\
    -Qhull may produce a ridge with four neighbors or two facets with the same \n\
    -vertices.  Qhull reports these events when they occur.  It stops when a\n\
    -concave ridge, flipped facet, or duplicate facet occurs.\n");
    -#if REALfloat
    -    qh_fprintf(fp, 9370, "\
    -\n\
    -Qhull is currently using single precision arithmetic.  The following\n\
    -will probably remove the precision problems:\n\
    -  - recompile qhull for realT precision(#define REALfloat 0 in user.h).\n");
    -#endif
    -    if (qh DELAUNAY && !qh SCALElast && qh MAXabs_coord > 1e4)
    -      qh_fprintf(fp, 9371, "\
    -\n\
    -When computing the Delaunay triangulation of coordinates > 1.0,\n\
    -  - use 'Qbb' to scale the last coordinate to [0,m] (max previous coordinate)\n");
    -    if (qh DELAUNAY && !qh ATinfinity)
    -      qh_fprintf(fp, 9372, "\
    -When computing the Delaunay triangulation:\n\
    -  - use 'Qz' to add a point at-infinity.  This reduces precision problems.\n");
    -
    -    qh_fprintf(fp, 9373, "\
    -\n\
    -If you need triangular output:\n\
    -  - use option 'Qt' to triangulate the output\n\
    -  - use option 'QJ' to joggle the input points and remove precision errors\n\
    -  - use option 'Ft'.  It triangulates non-simplicial facets with added points.\n\
    -\n\
    -If you must use 'Q0',\n\
    -try one or more of the following options.  They can not guarantee an output.\n\
    -  - use 'QbB' to scale the input to a cube.\n\
    -  - use 'Po' to produce output and prevent partitioning for flipped facets\n\
    -  - use 'V0' to set min. distance to visible facet as 0 instead of roundoff\n\
    -  - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
    -  - options 'Qf', 'Qbb', and 'QR0' may also help\n",
    -               qh DISTround);
    -    qh_fprintf(fp, 9374, "\
    -\n\
    -To guarantee simplicial output:\n\
    -  - use option 'Qt' to triangulate the output\n\
    -  - use option 'QJ' to joggle the input points and remove precision errors\n\
    -  - use option 'Ft' to triangulate the output by adding points\n\
    -  - use exact arithmetic (see \"Imprecision in Qhull\", qh-impre.htm)\n\
    -");
    -  }
    -} /* printhelp_degenerate */
    -
    -
    -/* qh_printhelp_narrowhull( minangle )
    -     Warn about a narrow hull
    -
    -  notes:
    -    Alternatively, reduce qh_WARNnarrow in user.h
    -
    -*/
    -void qh_printhelp_narrowhull(FILE *fp, realT minangle) {
    -
    -    qh_fprintf(fp, 9375, "qhull precision warning: \n\
    -The initial hull is narrow (cosine of min. angle is %.16f).\n\
    -A coplanar point may lead to a wide facet.  Options 'QbB' (scale to unit box)\n\
    -or 'Qbb' (scale last coordinate) may remove this warning.  Use 'Pp' to skip\n\
    -this warning.  See 'Limitations' in qh-impre.htm.\n",
    -          -minangle);   /* convert from angle between normals to angle between facets */
    -} /* printhelp_narrowhull */
    -
    -/* qh_printhelp_singular
    -      prints descriptive message for singular input
    -*/
    -void qh_printhelp_singular(FILE *fp) {
    -  facetT *facet;
    -  vertexT *vertex, **vertexp;
    -  realT min, max, *coord, dist;
    -  int i,k;
    -
    -  qh_fprintf(fp, 9376, "\n\
    -The input to qhull appears to be less than %d dimensional, or a\n\
    -computation has overflowed.\n\n\
    -Qhull could not construct a clearly convex simplex from points:\n",
    -           qh hull_dim);
    -  qh_printvertexlist(fp, "", qh facet_list, NULL, qh_ALL);
    -  if (!qh_QUICKhelp)
    -    qh_fprintf(fp, 9377, "\n\
    -The center point is coplanar with a facet, or a vertex is coplanar\n\
    -with a neighboring facet.  The maximum round off error for\n\
    -computing distances is %2.2g.  The center point, facets and distances\n\
    -to the center point are as follows:\n\n", qh DISTround);
    -  qh_printpointid(fp, "center point", qh hull_dim, qh interior_point, -1);
    -  qh_fprintf(fp, 9378, "\n");
    -  FORALLfacets {
    -    qh_fprintf(fp, 9379, "facet");
    -    FOREACHvertex_(facet->vertices)
    -      qh_fprintf(fp, 9380, " p%d", qh_pointid(vertex->point));
    -    zinc_(Zdistio);
    -    qh_distplane(qh interior_point, facet, &dist);
    -    qh_fprintf(fp, 9381, " distance= %4.2g\n", dist);
    -  }
    -  if (!qh_QUICKhelp) {
    -    if (qh HALFspace)
    -      qh_fprintf(fp, 9382, "\n\
    -These points are the dual of the given halfspaces.  They indicate that\n\
    -the intersection is degenerate.\n");
    -    qh_fprintf(fp, 9383,"\n\
    -These points either have a maximum or minimum x-coordinate, or\n\
    -they maximize the determinant for k coordinates.  Trial points\n\
    -are first selected from points that maximize a coordinate.\n");
    -    if (qh hull_dim >= qh_INITIALmax)
    -      qh_fprintf(fp, 9384, "\n\
    -Because of the high dimension, the min x-coordinate and max-coordinate\n\
    -points are used if the determinant is non-zero.  Option 'Qs' will\n\
    -do a better, though much slower, job.  Instead of 'Qs', you can change\n\
    -the points by randomly rotating the input with 'QR0'.\n");
    -  }
    -  qh_fprintf(fp, 9385, "\nThe min and max coordinates for each dimension are:\n");
    -  for (k=0; k < qh hull_dim; k++) {
    -    min= REALmax;
    -    max= -REALmin;
    -    for (i=qh num_points, coord= qh first_point+k; i--; coord += qh hull_dim) {
    -      maximize_(max, *coord);
    -      minimize_(min, *coord);
    -    }
    -    qh_fprintf(fp, 9386, "  %d:  %8.4g  %8.4g  difference= %4.4g\n", k, min, max, max-min);
    -  }
    -  if (!qh_QUICKhelp) {
    -    qh_fprintf(fp, 9387, "\n\
    -If the input should be full dimensional, you have several options that\n\
    -may determine an initial simplex:\n\
    -  - use 'QJ'  to joggle the input and make it full dimensional\n\
    -  - use 'QbB' to scale the points to the unit cube\n\
    -  - use 'QR0' to randomly rotate the input for different maximum points\n\
    -  - use 'Qs'  to search all points for the initial simplex\n\
    -  - use 'En'  to specify a maximum roundoff error less than %2.2g.\n\
    -  - trace execution with 'T3' to see the determinant for each point.\n",
    -                     qh DISTround);
    -#if REALfloat
    -    qh_fprintf(fp, 9388, "\
    -  - recompile qhull for realT precision(#define REALfloat 0 in libqhull.h).\n");
    -#endif
    -    qh_fprintf(fp, 9389, "\n\
    -If the input is lower dimensional:\n\
    -  - use 'QJ' to joggle the input and make it full dimensional\n\
    -  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should\n\
    -    pick the coordinate with the least range.  The hull will have the\n\
    -    correct topology.\n\
    -  - determine the flat containing the points, rotate the points\n\
    -    into a coordinate plane, and delete the other coordinates.\n\
    -  - add one or more points to make the input full dimensional.\n\
    -");
    -    if (qh DELAUNAY && !qh ATinfinity)
    -      qh_fprintf(fp, 9390, "\n\n\
    -This is a Delaunay triangulation and the input is co-circular or co-spherical:\n\
    -  - use 'Qz' to add a point \"at infinity\" (i.e., above the paraboloid)\n\
    -  - or use 'QJ' to joggle the input and avoid co-circular data\n");
    -  }
    -} /* printhelp_singular */
    -
    -
    -/*-----------------------------------------
    --user_memsizes- allocate up to 10 additional, quick allocation sizes
    -*/
    -void qh_user_memsizes (void) {
    -
    -  /* qh_memsize (size); */
    -} /* user_memsizes */
    -
    -#endif
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.pro b/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.pro
    deleted file mode 100644
    index b42336c5f7..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg2/user_eg2.pro
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -# -------------------------------------------------
    -# user_eg2.pro -- Qt project for Qhull demonstration using shared Qhull dll
    -# -------------------------------------------------
    -
    -include(../qhull-app-shared.pri)
    -
    -TARGET = user_eg2
    -
    -SOURCES += user_eg2.c
    diff --git a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg3/user_eg3.cpp b/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg3/user_eg3.cpp
    deleted file mode 100644
    index a94b552175..0000000000
    --- a/src/amuse_simplex/src/plugins/qhull-2012.1/src/user_eg3/user_eg3.cpp
    +++ /dev/null
    @@ -1,156 +0,0 @@
    -#//! user_eg3.cpp -- Invoke rbox and qhull from C++
    -
    -#include "RboxPoints.h"
    -#include "QhullError.h"
    -#include "QhullQh.h"
    -#include "QhullFacet.h"
    -#include "QhullFacetList.h"
    -#include "QhullLinkedList.h"
    -#include "QhullVertex.h"
    -#include "Qhull.h"
    -
    -#include    /* for printf() of help message */
    -#include 
    -
    -using std::cerr;
    -using std::cin;
    -using std::cout;
    -using std::endl;
    -
    -using orgQhull::Qhull;
    -using orgQhull::QhullError;
    -using orgQhull::QhullFacet;
    -using orgQhull::QhullFacetList;
    -using orgQhull::QhullQh;
    -using orgQhull::RboxPoints;
    -using orgQhull::QhullVertex;
    -using orgQhull::QhullVertexSet;
    -
    -int main(int argc, char **argv);
    -int user_eg3(int argc, char **argv);
    -
    -char prompt[]= "\n\
    -user_eg3 -- demonstrate calling rbox and qhull from C++.\n\
    -\n\
    -  eg-100                       Run the example in qh-code.htm\n\
    -  rbox \"200 D4\" ...            Generate points from rbox\n\
    -  qhull \"d p\" ...              Run qhull and produce output\n\
    -  qhull-cout \"o\" ...           Run qhull and produce output to cout\n\
    -  facets                       Print facets when done\n\
    -\n\
    -For example\n\
    -  user_eg3 rbox qhull\n\
    -  user_eg3 rbox qhull d\n\
    -  user_eg3 rbox \"10 D2\"  \"2 D2\" qhull  \"s p\" facets\n\
    -\n\
    -";
    -
    -
    -/*--------------------------------------------
    --user_eg3-  main procedure of user_eg3 application
    -*/
    -int main(int argc, char **argv) {
    -
    -    if(argc==1){
    -        cout << prompt;
    -        return 1;
    -    }
    -    try{
    -        return user_eg3(argc, argv);
    -    }catch(QhullError &e){
    -        cerr << e.what() << std::endl;
    -        return e.errorCode();
    -    }
    -}//main
    -
    -int user_eg3(int argc, char **argv)
    -{
    -    bool printFacets= false;
    -    if(strcmp(argv[1], "eg-100")==0){
    -        RboxPoints rbox;
    -        rbox.appendPoints("100");
    -        Qhull qhull;
    -        qhull.runQhull(rbox, "");
    -        QhullFacetList facets= qhull.facetList();
    -        cout << facets;
    -        return 0;
    -    }
    -    RboxPoints rbox;
    -    Qhull qhull;
    -    int readingRbox= 0;
    -    int readingQhull= 0;
    -    for(int i=1; ivertices) {
     	      //store the indices of each simplex
    -	      ids[r++]=idList[qh_pointid(vertex->point)];
    +	      ids[r++]=idList[qh_pointid(qh, vertex->point)];
     	    }//for each facet
     
     	    tempSimpl.set_id1( in_box[ ids[0] ] );
    @@ -1447,10 +1450,10 @@ void SimpleX::compute_triangulation(){
           }
     
           //free long memory
    -      qh_freeqhull(!qh_ALL);
    +      qh_freeqhull(qh, !qh_ALL);
     
           //free short memory and memory allocator
    -      qh_memfreeshort (&curlong, &totlong);
    +      qh_memfreeshort (qh, &curlong, &totlong);
           if (curlong || totlong) {
     	fprintf(errfile, "QHull: did not free %d bytes of long memory (%d pieces)", totlong, curlong);
           }
    diff --git a/src/amuse_simplex/src/src/SimpleX.h b/src/amuse_simplex/src/src/SimpleX.h
    index 9f3a7af1be..4c084be6d2 100644
    --- a/src/amuse_simplex/src/src/SimpleX.h
    +++ b/src/amuse_simplex/src/src/SimpleX.h
    @@ -1,7 +1,7 @@
     /*************************************************************************
     
     description:
    -This file contains the class that can do the actual radiative transport, 
    +This file contains the class that can do the actual radiative transport,
     including routines for grid calculation, physics and the actual transport
     
     Copyright Jan-Pieter Paardekooper and Chael Kruip October 2011
    @@ -33,7 +33,7 @@ along with SimpleX.  If not, see .
     #include "configfile.h"   //keyvalue input file
     
     #ifdef HEAL_PIX
    -  #include "healpix_base.h" //healpix header
    +  #include "healpix_cxx/healpix_base.h" //healpix header
     #endif
     
     
    @@ -54,14 +54,8 @@ extern "C"
     #endif
     #include 
     #include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    -#include 
    +#include 
    +#include 
     #if defined(__cplusplus)
     }
     #endif
    @@ -103,20 +97,20 @@ class SimpleX{
         //! Create orientations and mappings from correct header file
         void set_direction_bins();
     
    -    //! Create a simple homogeneous point distribution 
    -    
    +    //! Create a simple homogeneous point distribution
    +
         //! Points are placed using the gsl randoom number generator
         void poisson_square();
     
         //! Read in hdf5 file with site information
         void read_vertex_list();
    -  
    +
         //! Compute the largest index of all the vertices
         unsigned long long int computeMaxId();
    -    
    +
         //! Create boundary around computational domain
     
    -    //! Width of the boundary is variable borderBox. 
    +    //! Width of the boundary is variable borderBox.
         //! Number of points in the boundary is variable borderSites.
         void create_boundary();
     
    @@ -129,10 +123,10 @@ class SimpleX{
     
         //! Decompose the domain
     
    -    //! Count the number of sites contained in one subbox and add those until 
    +    //! Count the number of sites contained in one subbox and add those until
         //! number of points is approximately equal per processor
         void decompose_domain();
    -    
    +
         //! Assign the correct process to vertices
         void assign_process();
     
    @@ -158,9 +152,9 @@ class SimpleX{
         //! Give each site an id corresponding to place in local sites vector
         void assign_site_ids();
     
    -    //! Determine which sites use ballistic transport and which sites 
    +    //! Determine which sites use ballistic transport and which sites
         //! should use direction conserving transport at the start of the
    -    //! simulation. 
    +    //! simulation.
         void initiate_ballistic_sites();
     
         //! Shuffle list of sites
    @@ -174,14 +168,14 @@ class SimpleX{
     
         //! Compute properties of the sites from the triangulation
     
    -    //! Important properties like the neighbours, the volumes and 
    +    //! Important properties like the neighbours, the volumes and
         //! the most straight paths are computed
         void compute_site_properties();
     
         //! Compute the neighbours of vertex
     
         //! Generate the neighbour vectors for each vertex from the simplex vector
    -    //! Care should be taken so that no vertex is put twice in the neighbour list. 
    +    //! Care should be taken so that no vertex is put twice in the neighbour list.
         //! Also get rid of vertices in the sub box boundary that are not connected to a site
         //! in the computational domain
         void compute_neighbours();
    @@ -202,7 +196,7 @@ class SimpleX{
         //! Identify the place of every ballistic site in neighbour array
         //! of neighbouring site
         void match_neighbours();
    - 
    +
         //! Compute the solid angles into which the intensity is distributed
         void compute_solid_angles( const bool& rotate );
     
    @@ -221,7 +215,7 @@ class SimpleX{
     
         //================ Grid Update Routines ============================//
     
    -    //! Rotate the solid angles of the unit sphere 
    +    //! Rotate the solid angles of the unit sphere
         //! to avoid preferential directions
         void rotate_solid_angles();
     
    @@ -257,7 +251,7 @@ class SimpleX{
     
     
         //================ Send Routines ===================================//
    -   
    +
     
         //! Send vertices to processors
         void send_vertices();
    @@ -265,15 +259,15 @@ class SimpleX{
         //! Send the domain decomposition to all procs
         void send_dom_dec();
     
    -    //! Fill the list of indices of sites that contain information to be send 
    +    //! Fill the list of indices of sites that contain information to be send
         //! to other procs
         void fill_send_list();
     
         //! Give every vertex its correct process (needed for vertices in boundary between procs)
         void send_site_properties();
     
    -    //! Give every ballistic site its correct neighbour information 
    -    
    +    //! Give every ballistic site its correct neighbour information
    +
         //! This is only needed for ballistic sites in boundary between procs, and is necessary because
         //! the order of the neighbours in the neighbour vector is not the same among procs.
         void send_neighbour_properties();
    @@ -311,7 +305,7 @@ class SimpleX{
         //! Read metal line cooling data and initialize vectors
         void read_metals();
     
    -    //! set homogeneous number density. 
    +    //! set homogeneous number density.
     
         //! Use only in combination with Poisson_Square()
         void set_homogeneous_number_density( const float& nH );
    @@ -337,9 +331,9 @@ class SimpleX{
         //! Return mean optical depth of total grid
         double output_optical_depth();
     
    -    //! output relevant physical parameters to screen 
    +    //! output relevant physical parameters to screen
         void parameter_output( const unsigned int& run );
    -    
    +
         //! Add more neighbours to vertices that have a flux, by adding the neighbours
         //! of neighbours.
         void make_source_isotropic();
    @@ -366,7 +360,7 @@ class SimpleX{
         double update_temperature( Site& site, const vector& N_ion, const double& t_end );
     
      //================= Radiative Transfer Functions ======================//
    -    
    +
         //! Solve the rate equation to determine ionisations and recombinations
         vector solve_rate_equation( Site& site );
     
    @@ -386,11 +380,11 @@ class SimpleX{
     
     
         //! Call the output routines
    -    void generate_output( const unsigned int& run );    
    +    void generate_output( const unsigned int& run );
     
         //! Write hdf5 output file
         void write_hdf5_output(char* name, const unsigned int& run);
    -    
    +
         //! calculate position of the I-Front for source in centre
         double calc_IFront( const unsigned int& run );
     
    @@ -399,16 +393,16 @@ class SimpleX{
     
     
         //================ Generic Functions ==============================//
    -   
    +
         //! clear all temporary structures for the next run
         void clear_temporary();
    -    
    +
         //! Function to give diagnostic output about total number of photons in simulation
         double count_photons();
     
         //! return number of runs
         const unsigned int& get_numRuns() const{ return numRuns; }
    -  
    +
         //! Return number of outputs
         const unsigned int& get_numOutputs() const{ return numOutputs; }
     
    @@ -456,11 +450,11 @@ class SimpleX{
         vector< float > temp_clumping_list;
         //! Temporary list of metallicity
         vector temp_metallicity_list;
    -    
    +
         //! Cross section of hydrogen
         vector cross_H;
         //! The photon excess energy used to heat the gas
    -    vector photon_excess_energy;  
    +    vector photon_excess_energy;
         //! The elemental abundances of metals (and Helium)
         vector abundances;
         //! Vector of cooling curves
    @@ -469,8 +463,8 @@ class SimpleX{
         //! Variable used by random number generator
         gsl_rng * ran;
         //! Output to logfile
    -    ofstream simpleXlog; 
    -    
    +    ofstream simpleXlog;
    +
       protected:
     
         unsigned long int numSites;            //!< Total number of sites in the simulation
    @@ -542,6 +536,8 @@ class SimpleX{
         unsigned int*** maps;          //!< Array to hold the mappings between direction bins
         unsigned int number_of_directions; //!< Number of discretizations of the unit sphere for DCT
         unsigned int number_of_orientations;//!< Number of random rotations of the DCT discretization
    +    qhT Qhull;                     //!< QHull main object
    +    qhT *qh;                       //!< Points to Qhull, needed for Qhull macros to work
     };
     
     #endif
    diff --git a/src/amuse_simplex/src/src/amuse_interface.cpp b/src/amuse_simplex/src/src/amuse_interface.cpp
    index d8248c9a41..9e5d95c657 100644
    --- a/src/amuse_simplex/src/src/amuse_interface.cpp
    +++ b/src/amuse_simplex/src/src/amuse_interface.cpp
    @@ -2,7 +2,7 @@
     #include "configfile.h"
     
     #include "amuse_interface.h"
    -#include "../../worker_code.h"
    +#include "../../simplex_worker.h"
     
     #ifndef M_PI
     #define M_PI           3.14159265358979323846
    @@ -18,7 +18,7 @@ void AMUSE_SimpleX::read_parameters(){
       //random seed
       randomSeed = 25061977;
     
    -  //hilbert order, determines number of subboxes. 
    +  //hilbert order, determines number of subboxes.
       //should be > 0 for parallel runs!
       hilbert_order = 1;
     
    @@ -31,13 +31,13 @@ void AMUSE_SimpleX::read_parameters(){
       blackBody = 0;
       //effective temperature of source
       sourceTeff = 1.e5;
    -  
    +
       //units of source
       UNIT_I = 1.e48;
    -  
    +
       //number of frequencies
       numFreq = 1;
    -  
    +
       //include collisional ionisations?
       coll_ion = 0;
     
    @@ -46,25 +46,25 @@ void AMUSE_SimpleX::read_parameters(){
     
       //include metal line cooling?
       metal_cooling = 0;
    -  
    +
       //include recombination radiation?
       rec_rad = 0;
    -  
    +
     //----------- Don't change these unless you know what you're doing -------------------------//
     
      //dimension should always be 3
       dimension = 3;
    -  
    +
       //number of points in border, set this as you like
       borderSites = 25000;
       //region in which border points are placed
       borderBox = 0.1;
       //size of border around subbox
       padding_subbox = 0.25;
    -  
    +
       //temperature of the ionised gas
       gasIonTemp = 1.e4;
    -  
    +
       //temperature of neutral gas
       gasNeutralTemp = 100.0;
     
    @@ -76,7 +76,7 @@ void AMUSE_SimpleX::read_parameters(){
       //type of transport
       ballisticTransport = 0;
       dirConsTransport = 0;
    -  combinedTransport = 1;  
    +  combinedTransport = 1;
     
       //Chunk size for hdf5 writing
       chunk_size = 100000;
    @@ -93,7 +93,7 @@ void AMUSE_SimpleX::read_parameters(){
     
       //Switch between dct and ballistic transport
       switchTau = 0.5;
    -  
    +
       //Use temporal photon conservation?
       photon_conservation = 1;
     
    @@ -101,7 +101,7 @@ void AMUSE_SimpleX::read_parameters(){
       number_of_directions = 42;
       //Number of orientations, fixed in header files
       number_of_orientations = 100;
    -  
    +
       //calculate straight from tesselation instead of direction bins
       //is faster in postprocessing, but less precise
       straight_from_tess = 1;
    @@ -129,7 +129,7 @@ int AMUSE_SimpleX::add_vertex(long *id, double x,double y,double z,double rho,
         vertices.push_back( tempVert );
         numSites=vertices.size();
       }
    -  
    +
       double n_HI = rho*(1.0-xion);
       double n_HII = rho*xion;
       temp_n_HI_list.push_back( (float) n_HI);
    @@ -172,13 +172,13 @@ int AMUSE_SimpleX::add_site(long *id, double x,double y,double z,double rho,
         tempSite.set_internalEnergy(uInt);
         tempSite.set_dinternalEnergydt(0.0);
         tempSite.set_metallicity(metallicity);
    -    
    +
         sites.push_back( tempSite );
         numSites++;
    -    
    -    // cerr << " Add site " << tempSite.get_vertex_id() << " x: " << tempSite.get_x() << " y: " << tempSite.get_y() << " z: " << tempSite.get_z() 
    +
    +    // cerr << " Add site " << tempSite.get_vertex_id() << " x: " << tempSite.get_x() << " y: " << tempSite.get_y() << " z: " << tempSite.get_z()
         //      << " n_HI: " << tempSite.get_n_HI() << " n_HII: " << tempSite.get_n_HII() << endl;
    -        
    +
         return 1;
       } else
       {
    @@ -192,7 +192,7 @@ int AMUSE_SimpleX::add_site(long *id, double x,double y,double z,double rho,
     int AMUSE_SimpleX::remove_site(long id) {
        SITE_ITERATOR p;
        Site tmp;
    -   
    +
        tmp.set_vertex_id((unsigned long long) id);
     
        p=lower_bound(sites.begin(),sites.end(), tmp, compare_vertex_id_site);
    @@ -201,7 +201,7 @@ int AMUSE_SimpleX::remove_site(long id) {
            p->set_neigh_dist(-1.);
            return 1;
          }
    -   }  
    +   }
        return 0;
     }
     
    @@ -209,17 +209,17 @@ int AMUSE_SimpleX::remove_site(long id) {
     void AMUSE_SimpleX::convert_units(){
     
       //convert parsec to cm
    -  UNIT_L = sizeBox * 3.08568025e18; 
    +  UNIT_L = sizeBox * 3.08568025e18;
       UNIT_V = pow(UNIT_L, 3);
    -  
    -  
    +
    +
       //calculate mean number density
       //double n_H = 0.0;
       //for(unsigned int i=0; iget_process() == COMM_RANK && !it->get_border() ){
    -  //     cerr << " Site: " << it->get_vertex_id() << " nHI: " << it->get_n_HI() << " nHII: " << it->get_n_HII() << endl; 
    +  //     cerr << " Site: " << it->get_vertex_id() << " nHI: " << it->get_n_HI() << " nHII: " << it->get_n_HII() << endl;
       //   }
    -  // }  
    -  // 
    -   //make sure that the vectors that will be filled are empty 
    +  // }
    +  //
    +   //make sure that the vectors that will be filled are empty
         site_intensities.clear();
         intens_ids.clear();
    -    
    -    //make sure that photons have left all ghost vertices 
    +
    +    //make sure that photons have left all ghost vertices
         //before calculating local intensities
         send_intensities();
     
    @@ -415,14 +415,14 @@ int AMUSE_SimpleX::reinitialize(){
         //remember the orientation index with which the intensities were stored
         orientation_index_old = orientation_index;
     
    -    //store the relevant properties of the sites to be used 
    +    //store the relevant properties of the sites to be used
         //in the coming run
         store_site_properties();
     
         //create a list of vertices to be triangulated
         create_new_vertex_list();
     
    -    //clear temporary structures in the sites 
    +    //clear temporary structures in the sites
         //and completely clear the sites vector
         clear_temporary();
         sites.clear();
    @@ -433,16 +433,16 @@ int AMUSE_SimpleX::reinitialize(){
     
         //send the list to master proc
         send_new_vertex_list();
    - 
    +
         // if( COMM_RANK == 0 ){
         //   cerr << " (" << COMM_RANK << ") Computing triangulation" << endl;
         // }
    -     
    +
         if(COMM_RANK == 0){
     
           //set boundary around unity domain
           create_boundary();
    -      
    +
           // Sort the vertices
           sort( vertices.begin(), vertices.end(), compare_vertex_id_vertex );
     
    @@ -474,10 +474,10 @@ int AMUSE_SimpleX::reinitialize(){
         //check if vertices have moved to different process and send the
         //info accordingly
         if(COMM_SIZE > 1){
    -      send_site_physics();  
    +      send_site_physics();
           send_site_intensities();
         }
    -            
    +
         //compute the triangulation
         compute_triangulation();
     
    @@ -485,27 +485,27 @@ int AMUSE_SimpleX::reinitialize(){
         create_sites();
     
         //assign the correct site ids to the sites
    -    assign_site_ids();  
    +    assign_site_ids();
     
         //return the physical properties to the sites
         return_physics();
    -            
    +
         compute_site_properties();
    -    
    +
         compute_physics( 1 );
    -    
    +
         remove_border_simplices();
    -      
    +
         // if(COMM_RANK == 0){
         //   cerr << " Done" << endl;
         // }
    -    
    +
         // for( SITE_ITERATOR it=sites.begin(); it!=sites.end(); it++ ){
         //   if(it->get_process() == COMM_RANK && !it->get_border() ){
    -    //     cerr << " Site: " << it->get_vertex_id() << " nHI: " << it->get_n_HI() << " nHII: " << it->get_n_HII() << endl; 
    +    //     cerr << " Site: " << it->get_vertex_id() << " nHI: " << it->get_n_HI() << " nHII: " << it->get_n_HII() << endl;
         //   }
         // }
    -    
    +
       syncflag=0;
       return 0;
     }
    @@ -515,7 +515,7 @@ int AMUSE_SimpleX::get_site(int id, double *x,double *y,double *z,double *rho,
                                                   double *flux,double *xion, double *uInt, double *metallicity){
        SITE_ITERATOR p;
        Site tmp;
    -   
    +
        tmp.set_vertex_id((unsigned long long) id);
        p=lower_bound(sites.begin(),sites.end(), tmp, compare_vertex_id_site);
        if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -535,7 +535,7 @@ int AMUSE_SimpleX::get_site(int id, double *x,double *y,double *z,double *rho,
            *xion = (double) p->get_n_HII()/nH;
            *uInt = p->get_internalEnergy();
            *metallicity = p->get_metallicity();
    -       
    +
            return 1;
          }
        }
    @@ -545,7 +545,7 @@ int AMUSE_SimpleX::get_site(int id, double *x,double *y,double *z,double *rho,
     int AMUSE_SimpleX::get_position(int id, double *x,double *y,double *z){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p = lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -562,7 +562,7 @@ int AMUSE_SimpleX::get_position(int id, double *x,double *y,double *z){
     int AMUSE_SimpleX::get_density(int id, double *rho){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -577,7 +577,7 @@ int AMUSE_SimpleX::get_density(int id, double *rho){
     int AMUSE_SimpleX::get_flux(int id, double *flux){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -596,21 +596,21 @@ int AMUSE_SimpleX::get_flux(int id, double *flux){
     }
     
     int AMUSE_SimpleX::get_mean_intensity(int id, double *mean_intensity){
    -  
    +
       SITE_ITERATOR p;
       Site tmp;
    -    
    +
       tmp.set_vertex_id((unsigned long long) id);
       p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
       if(p->get_vertex_id() == (unsigned long long int)id){
           if (p->get_process() == COMM_RANK){
    -        
    +
             double meanIntensity = 0.0;
             //in case of ballistic transport, intensity has size of number of neighbours;
    -        //in case of direction conserving transport, intensity has 
    +        //in case of direction conserving transport, intensity has
             //the size of the tesselation of the unit sphere
             numPixels = ( p->get_ballistic() ) ? p->get_numNeigh() : number_of_directions;
    -        
    +
             for(unsigned int i=0; iget_vertex_id() == (unsigned long long int)id){
           if (p->get_process() == COMM_RANK){
    -        
    +
             double diffuseIntensity = 0.0;
             numPixels = ( p->get_ballistic() ) ? p->get_numNeigh() : number_of_directions;
    -        
    +
             for(unsigned int i=0; iget_intensityOut(f,i) + p->get_intensityIn(f,i);
    @@ -647,13 +647,13 @@ int AMUSE_SimpleX::get_diffuse_intensity(int id, double *diffuse_intensity){
           }
       }
       return 0;
    -   
    +
     }
     
     int AMUSE_SimpleX::get_ionisation(int id, double *xion){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -668,7 +668,7 @@ int AMUSE_SimpleX::get_ionisation(int id, double *xion){
     int AMUSE_SimpleX::get_metallicity(int id, double *metallicity){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -696,7 +696,7 @@ int AMUSE_SimpleX::get_internalEnergy(int id, double *uInt){
       }
       return 0;
     
    -  
    +
     }
     
     int AMUSE_SimpleX::get_dinternalEnergydt(int id, double *uInt){
    @@ -715,7 +715,7 @@ int AMUSE_SimpleX::get_dinternalEnergydt(int id, double *uInt){
       }
       return 0;
     
    -  
    +
     }
     
     //set properties of specified site
    @@ -723,7 +723,7 @@ int AMUSE_SimpleX::set_site(int id, double x, double y, double z, double rho,
                                                   double flux, double xion, double uInt, double metallicity){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p = lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -744,7 +744,7 @@ int AMUSE_SimpleX::set_site(int id, double x, double y, double z, double rho,
             p->set_n_HII(xion*rho);
     	      p->set_internalEnergy( uInt );
             p->set_metallicity( metallicity );
    -        
    +
             return 1;
         }
         return 0;
    @@ -753,7 +753,7 @@ int AMUSE_SimpleX::set_site(int id, double x, double y, double z, double rho,
     int AMUSE_SimpleX::set_position(int id, double x, double y, double z){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p = lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -768,7 +768,7 @@ int AMUSE_SimpleX::set_position(int id, double x, double y, double z){
     int AMUSE_SimpleX::set_density(int id, double rho){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -783,7 +783,7 @@ int AMUSE_SimpleX::set_density(int id, double rho){
     int AMUSE_SimpleX::set_flux(int id, double flux){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -804,7 +804,7 @@ int AMUSE_SimpleX::set_flux(int id, double flux){
     int AMUSE_SimpleX::set_ionisation(int id, double xion){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -819,7 +819,7 @@ int AMUSE_SimpleX::set_ionisation(int id, double xion){
     int AMUSE_SimpleX::set_metallicity(int id, double metallicity){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -832,7 +832,7 @@ int AMUSE_SimpleX::set_metallicity(int id, double metallicity){
     int AMUSE_SimpleX::set_internalEnergy(int id, double uInt){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -845,7 +845,7 @@ int AMUSE_SimpleX::set_internalEnergy(int id, double uInt){
     int AMUSE_SimpleX::set_dinternalEnergydt(int id, double uInt){
         SITE_ITERATOR p;
         Site tmp;
    -    
    +
         tmp.set_vertex_id((unsigned long long) id);
         p=lower_bound(sites.begin(), sites.end(), tmp, compare_vertex_id_site);
         if(p->get_vertex_id() == (unsigned long long int)id){
    @@ -866,7 +866,7 @@ string global_data_path = ".";
     int initialize_code() {
       MPI_Comm_rank(MPI_COMM_WORLD, &COMM_RANK);
       SimpleXGrid=new AMUSE_SimpleX(global_output_path, global_data_path);
    -  return (*SimpleXGrid).setup_simplex();  
    +  return (*SimpleXGrid).setup_simplex();
     }
     
     int set_simplex_output_directory(char *output_path){
    @@ -896,18 +896,18 @@ int recommit_particles() {
     
     int new_particle(int *id, double x,double y,double z,double rho,
                                             double flux,double xion, double uInt, double metallicity ){
    -                                          
    -                                                                                  
    +
    +
         long tmp_id;
         double bs;
         int ret, totalret;
    -    
    +
         (*SimpleXGrid).get_sizeBox(&bs);
         if(bs==0) return -2;
         x=(x/bs)+0.5;y=y/bs+0.5;z=z/bs+0.5;
    -    if (x<0 || x>1 || 
    +    if (x<0 || x>1 ||
             y<0 || y>1 ||
    -        z<0 || z>1 ) 
    +        z<0 || z>1 )
             {
                 return -3;
             }
    @@ -934,7 +934,7 @@ int delete_particle(int id) {
      MPI_Barrier(MPI_COMM_WORLD);
      return returnvalues-1;
     }
    -  
    +
     //int evolve(double t_target,int sync) {
      //return (*SimpleXGrid).evolve(t_target, sync);
     //}
    @@ -956,14 +956,14 @@ int get_state(int id, double *x, double *y, double *z, double *rho,
         double send[8], recv[8];
         int ret, totalret=0;
         double bs;
    -    
    +
         (*SimpleXGrid).get_sizeBox(&bs);
    -    if(bs==0) return -2;  
    -    
    +    if(bs==0) return -2;
    +
         ret=(*SimpleXGrid).get_site(id, &fx, &fy, &fz, &frho, &fflux, &fxion, &fuInt, &fmetallicity);
    -    MPI_Reduce(&ret,&totalret,1,MPI_INT,MPI_SUM,0, MPI_COMM_WORLD ); 
    +    MPI_Reduce(&ret,&totalret,1,MPI_INT,MPI_SUM,0, MPI_COMM_WORLD );
         send[0]=fx;send[1]=fy;send[2]=fz;send[3]=frho;send[4]=fflux;send[5]=fxion;send[6]=fuInt;send[7]=fmetallicity;
    -    MPI_Reduce(&send[0],&recv[0],8,MPI_DOUBLE,MPI_SUM,0, MPI_COMM_WORLD ); 
    +    MPI_Reduce(&send[0],&recv[0],8,MPI_DOUBLE,MPI_SUM,0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
         fx=recv[0];fy=recv[1];fz=recv[2];
         frho=recv[3];
    @@ -985,10 +985,10 @@ int get_position(int id, double *x, double *y, double *z){
         double send[3], recv[3];
         int ret, totalret;
         double bs;
    -    
    +
         (*SimpleXGrid).get_sizeBox(&bs);
    -    if(bs==0) return -2;     
    -    
    +    if(bs==0) return -2;
    +
         ret = (*SimpleXGrid).get_position(id, &fx, &fy, &fz);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send[0] = fx;
    @@ -1006,7 +1006,7 @@ int get_density(int id, double *rho){
         double frho=0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_density(id, &frho);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = frho;
    @@ -1020,7 +1020,7 @@ int get_flux(int id, double *flux){
         double fflux=0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_flux(id, &fflux);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = fflux;
    @@ -1034,7 +1034,7 @@ int get_mean_intensity(int id, double *mean_intensity){
         double fmean_intensity = 0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_mean_intensity(id, &fmean_intensity);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = fmean_intensity;
    @@ -1048,7 +1048,7 @@ int get_diffuse_intensity(int id, double *diffuse_intensity){
         double fdiffuse_intensity = 0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_diffuse_intensity(id, &fdiffuse_intensity);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = fdiffuse_intensity;
    @@ -1062,7 +1062,7 @@ int get_ionisation(int id, double *xion){
         double fxion=0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_ionisation(id, &fxion);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = fxion;
    @@ -1076,7 +1076,7 @@ int get_metallicity(int id, double *metallicity){
         double fmetallicity=0.0;
         double send, recv;
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).get_metallicity(id, &fmetallicity);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         send = fmetallicity;
    @@ -1090,7 +1090,7 @@ int get_internal_energy(int id, double *uInt){
       double fuInt=0.0;
       double send, recv;
       int ret, totalret;
    -  
    +
       ret = (*SimpleXGrid).get_internalEnergy(id, &fuInt);
       MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
       send = fuInt;
    @@ -1104,7 +1104,7 @@ int get_dinternal_energy_dt(int id, double *dudt){
       double fdudt=0.0;
       double send, recv;
       int ret, totalret;
    -  
    +
       ret = (*SimpleXGrid).get_dinternalEnergydt(id, &fdudt);
       MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
       send = fdudt;
    @@ -1119,14 +1119,14 @@ int set_state(int id, double x, double y, double z, double rho,
                                                double flux, double xion, double uInt, double metallicity){
         int ret,totalret;
         double bs;
    -    
    +
         (*SimpleXGrid).get_sizeBox(&bs);
         if(bs==0) return -2;
         x=(x/bs)+0.5;y=y/bs+0.5;z=z/bs+0.5;
    -    if (x<0 || x>1 || 
    +    if (x<0 || x>1 ||
             y<0 || y>1 ||
             z<0 || z>1 ) return -3;
    -          
    +
         ret = (*SimpleXGrid).set_site(id, x, y, z, rho, flux, xion, uInt, metallicity);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1136,14 +1136,14 @@ int set_state(int id, double x, double y, double z, double rho,
     int set_position(int id, double x, double y, double z){
         int ret, totalret;
         double bs;
    -    
    -    (*SimpleXGrid).get_sizeBox(&bs);    
    +
    +    (*SimpleXGrid).get_sizeBox(&bs);
         if(bs==0) return -2;
         x=(x/bs)+0.5;y=y/bs+0.5;z=z/bs+0.5;
    -    if (x<0 || x>1 || 
    +    if (x<0 || x>1 ||
             y<0 || y>1 ||
             z<0 || z>1 ) return -3;
    -        
    +
         ret = (*SimpleXGrid).set_position(id, x, y, z);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1152,7 +1152,7 @@ int set_position(int id, double x, double y, double z){
     
     int set_density(int id, double rho){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_density(id, rho);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1161,7 +1161,7 @@ int set_density(int id, double rho){
     
     int set_flux(int id, double flux){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_flux(id, flux);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1170,7 +1170,7 @@ int set_flux(int id, double flux){
     
     int set_ionisation(int id, double xion){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_ionisation(id, xion);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1179,7 +1179,7 @@ int set_ionisation(int id, double xion){
     
     int set_metallicity(int id, double metallicity){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_metallicity(id, metallicity);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1188,7 +1188,7 @@ int set_metallicity(int id, double metallicity){
     
     int set_internal_energy(int id, double uInt){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_internalEnergy(id, uInt);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    @@ -1197,7 +1197,7 @@ int set_internal_energy(int id, double uInt){
     
     int set_dinternal_energy_dt(int id, double dut){
         int ret, totalret;
    -    
    +
         ret = (*SimpleXGrid).set_dinternalEnergydt(id, dut);
         MPI_Reduce(&ret, &totalret, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
         MPI_Barrier(MPI_COMM_WORLD);
    diff --git a/src/amuse_simplex/support/aclocal.m4 b/src/amuse_simplex/support/aclocal.m4
    new file mode 100644
    index 0000000000..382c743096
    --- /dev/null
    +++ b/src/amuse_simplex/support/aclocal.m4
    @@ -0,0 +1,22 @@
    +# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
    +
    +# Copyright (C) 1996-2021 Free Software Foundation, Inc.
    +
    +# This file is free software; the Free Software Foundation
    +# gives unlimited permission to copy and/or distribute it,
    +# with or without modifications, as long as this notice is preserved.
    +
    +# This program is distributed in the hope that it will be useful,
    +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    +# PARTICULAR PURPOSE.
    +
    +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
    +m4_include([shared/m4/amuse_lib_healpix.m4])
    +m4_include([shared/m4/amuse_lib_qhull.m4])
    +m4_include([shared/m4/amuse_venv.m4])
    +m4_include([shared/m4/ax_count_cpus.m4])
    +m4_include([shared/m4/ax_lib_hdf5.m4])
    +m4_include([shared/m4/ax_mpi.m4])
    +m4_include([shared/m4/gsl.m4])
    +m4_include([shared/m4/pkg.m4])
    diff --git a/src/amuse_simplex/support/config.mk.in b/src/amuse_simplex/support/config.mk.in
    new file mode 100644
    index 0000000000..dab6318c62
    --- /dev/null
    +++ b/src/amuse_simplex/support/config.mk.in
    @@ -0,0 +1,38 @@
    +# Compilers
    +CXX = @CXX@
    +MPICXX = @MPICXX@
    +
    +CPU_COUNT = @CPU_COUNT@
    +
    +# Tools
    +AR = @AR@
    +RANLIB = @RANLIB@
    +
    +
    +# General flags and libraries
    +CFLAGS = @CFLAGS@
    +FFLAGS = @FFLAGS@
    +FCFLAGS = @FCFLAGS@
    +LDFLAGS = @LDFLAGS@
    +
    +LIBS = @LIBS@
    +
    +
    +# External dependencies
    +GSL_FLAGS = @GSL_FLAGS@
    +GSL_LIBS = @GSL_LIBS@
    +
    +HDF5_VERSION = @HDF5_VERSION@
    +HDF5_CFLAGS = @HDF5_CFLAGS@
    +HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
    +HDF5_FFLAGS = @HDF5_FFLAGS@
    +HDF5_LDFLAGS = @HDF5_LDFLAGS@
    +HDF5_LIBS = @HDF5_LIBS@
    +HDF5_FLIBS = @HDF5_FLIBS@
    +
    +QHULL_FLAGS = @QHULL_FLAGS@
    +QHULL_LIBS = @QHULL_LIBS@
    +
    +HEALPIX_CXX_CFLAGS = @HEALPIX_CXX_CFLAGS@
    +HEALPIX_CXX_LIBS = @HEALPIX_CXX_LIBS@
    +
    diff --git a/src/amuse_simplex/support/configure b/src/amuse_simplex/support/configure
    new file mode 100755
    index 0000000000..022b4e4c04
    --- /dev/null
    +++ b/src/amuse_simplex/support/configure
    @@ -0,0 +1,7364 @@
    +#! /bin/sh
    +# Guess values for system-dependent variables and create Makefiles.
    +# Generated by GNU Autoconf 2.71 for amuse-simplex 1.0.
    +#
    +#
    +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
    +# Inc.
    +#
    +#
    +# This configure script is free software; the Free Software Foundation
    +# gives unlimited permission to copy, distribute and modify it.
    +## -------------------- ##
    +## M4sh Initialization. ##
    +## -------------------- ##
    +
    +# Be more Bourne compatible
    +DUALCASE=1; export DUALCASE # for MKS sh
    +as_nop=:
    +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
    +then :
    +  emulate sh
    +  NULLCMD=:
    +  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
    +  # is contrary to our usage.  Disable this feature.
    +  alias -g '${1+"$@"}'='"$@"'
    +  setopt NO_GLOB_SUBST
    +else $as_nop
    +  case `(set -o) 2>/dev/null` in #(
    +  *posix*) :
    +    set -o posix ;; #(
    +  *) :
    +     ;;
    +esac
    +fi
    +
    +
    +
    +# Reset variables that may have inherited troublesome values from
    +# the environment.
    +
    +# IFS needs to be set, to space, tab, and newline, in precisely that order.
    +# (If _AS_PATH_WALK were called with IFS unset, it would have the
    +# side effect of setting IFS to empty, thus disabling word splitting.)
    +# Quoting is to prevent editors from complaining about space-tab.
    +as_nl='
    +'
    +export as_nl
    +IFS=" ""	$as_nl"
    +
    +PS1='$ '
    +PS2='> '
    +PS4='+ '
    +
    +# Ensure predictable behavior from utilities with locale-dependent output.
    +LC_ALL=C
    +export LC_ALL
    +LANGUAGE=C
    +export LANGUAGE
    +
    +# We cannot yet rely on "unset" to work, but we need these variables
    +# to be unset--not just set to an empty or harmless value--now, to
    +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
    +# also avoids known problems related to "unset" and subshell syntax
    +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
    +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
    +do eval test \${$as_var+y} \
    +  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
    +done
    +
    +# Ensure that fds 0, 1, and 2 are open.
    +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
    +if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
    +
    +# The user is always right.
    +if ${PATH_SEPARATOR+false} :; then
    +  PATH_SEPARATOR=:
    +  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    +    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
    +      PATH_SEPARATOR=';'
    +  }
    +fi
    +
    +
    +# Find who we are.  Look in the path if we contain no directory separator.
    +as_myself=
    +case $0 in #((
    +  *[\\/]* ) as_myself=$0 ;;
    +  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
    +  done
    +IFS=$as_save_IFS
    +
    +     ;;
    +esac
    +# We did not find ourselves, most probably we were run as `sh COMMAND'
    +# in which case we are not to be found in the path.
    +if test "x$as_myself" = x; then
    +  as_myself=$0
    +fi
    +if test ! -f "$as_myself"; then
    +  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
    +  exit 1
    +fi
    +
    +
    +# Use a proper internal environment variable to ensure we don't fall
    +  # into an infinite loop, continuously re-executing ourselves.
    +  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
    +    _as_can_reexec=no; export _as_can_reexec;
    +    # We cannot yet assume a decent shell, so we have to provide a
    +# neutralization value for shells without unset; and this also
    +# works around shells that cannot unset nonexistent variables.
    +# Preserve -v and -x to the replacement shell.
    +BASH_ENV=/dev/null
    +ENV=/dev/null
    +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
    +case $- in # ((((
    +  *v*x* | *x*v* ) as_opts=-vx ;;
    +  *v* ) as_opts=-v ;;
    +  *x* ) as_opts=-x ;;
    +  * ) as_opts= ;;
    +esac
    +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
    +# Admittedly, this is quite paranoid, since all the known shells bail
    +# out after a failed `exec'.
    +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
    +exit 255
    +  fi
    +  # We don't want this to propagate to other subprocesses.
    +          { _as_can_reexec=; unset _as_can_reexec;}
    +if test "x$CONFIG_SHELL" = x; then
    +  as_bourne_compatible="as_nop=:
    +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
    +then :
    +  emulate sh
    +  NULLCMD=:
    +  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
    +  # is contrary to our usage.  Disable this feature.
    +  alias -g '\${1+\"\$@\"}'='\"\$@\"'
    +  setopt NO_GLOB_SUBST
    +else \$as_nop
    +  case \`(set -o) 2>/dev/null\` in #(
    +  *posix*) :
    +    set -o posix ;; #(
    +  *) :
    +     ;;
    +esac
    +fi
    +"
    +  as_required="as_fn_return () { (exit \$1); }
    +as_fn_success () { as_fn_return 0; }
    +as_fn_failure () { as_fn_return 1; }
    +as_fn_ret_success () { return 0; }
    +as_fn_ret_failure () { return 1; }
    +
    +exitcode=0
    +as_fn_success || { exitcode=1; echo as_fn_success failed.; }
    +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
    +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
    +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
    +if ( set x; as_fn_ret_success y && test x = \"\$1\" )
    +then :
    +
    +else \$as_nop
    +  exitcode=1; echo positional parameters were not saved.
    +fi
    +test x\$exitcode = x0 || exit 1
    +blah=\$(echo \$(echo blah))
    +test x\"\$blah\" = xblah || exit 1
    +test -x / || exit 1"
    +  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
    +  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
    +  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
    +  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
    +test \$(( 1 + 1 )) = 2 || exit 1"
    +  if (eval "$as_required") 2>/dev/null
    +then :
    +  as_have_required=yes
    +else $as_nop
    +  as_have_required=no
    +fi
    +  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
    +then :
    +
    +else $as_nop
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +as_found=false
    +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +  as_found=:
    +  case $as_dir in #(
    +	 /*)
    +	   for as_base in sh bash ksh sh5; do
    +	     # Try only shells that exist, to save several forks.
    +	     as_shell=$as_dir$as_base
    +	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
    +		    as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
    +then :
    +  CONFIG_SHELL=$as_shell as_have_required=yes
    +		   if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
    +then :
    +  break 2
    +fi
    +fi
    +	   done;;
    +       esac
    +  as_found=false
    +done
    +IFS=$as_save_IFS
    +if $as_found
    +then :
    +
    +else $as_nop
    +  if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
    +	      as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
    +then :
    +  CONFIG_SHELL=$SHELL as_have_required=yes
    +fi
    +fi
    +
    +
    +      if test "x$CONFIG_SHELL" != x
    +then :
    +  export CONFIG_SHELL
    +             # We cannot yet assume a decent shell, so we have to provide a
    +# neutralization value for shells without unset; and this also
    +# works around shells that cannot unset nonexistent variables.
    +# Preserve -v and -x to the replacement shell.
    +BASH_ENV=/dev/null
    +ENV=/dev/null
    +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
    +case $- in # ((((
    +  *v*x* | *x*v* ) as_opts=-vx ;;
    +  *v* ) as_opts=-v ;;
    +  *x* ) as_opts=-x ;;
    +  * ) as_opts= ;;
    +esac
    +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
    +# Admittedly, this is quite paranoid, since all the known shells bail
    +# out after a failed `exec'.
    +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
    +exit 255
    +fi
    +
    +    if test x$as_have_required = xno
    +then :
    +  printf "%s\n" "$0: This script requires a shell more modern than all"
    +  printf "%s\n" "$0: the shells that I found on your system."
    +  if test ${ZSH_VERSION+y} ; then
    +    printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    +    printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
    +  else
    +    printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
    +$0: including any error possibly output before this
    +$0: message. Then install a modern shell, or manually run
    +$0: the script under such a shell if you do have one."
    +  fi
    +  exit 1
    +fi
    +fi
    +fi
    +SHELL=${CONFIG_SHELL-/bin/sh}
    +export SHELL
    +# Unset more variables known to interfere with behavior of common tools.
    +CLICOLOR_FORCE= GREP_OPTIONS=
    +unset CLICOLOR_FORCE GREP_OPTIONS
    +
    +## --------------------- ##
    +## M4sh Shell Functions. ##
    +## --------------------- ##
    +# as_fn_unset VAR
    +# ---------------
    +# Portably unset VAR.
    +as_fn_unset ()
    +{
    +  { eval $1=; unset $1;}
    +}
    +as_unset=as_fn_unset
    +
    +
    +# as_fn_set_status STATUS
    +# -----------------------
    +# Set $? to STATUS, without forking.
    +as_fn_set_status ()
    +{
    +  return $1
    +} # as_fn_set_status
    +
    +# as_fn_exit STATUS
    +# -----------------
    +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
    +as_fn_exit ()
    +{
    +  set +e
    +  as_fn_set_status $1
    +  exit $1
    +} # as_fn_exit
    +# as_fn_nop
    +# ---------
    +# Do nothing but, unlike ":", preserve the value of $?.
    +as_fn_nop ()
    +{
    +  return $?
    +}
    +as_nop=as_fn_nop
    +
    +# as_fn_mkdir_p
    +# -------------
    +# Create "$as_dir" as a directory, including parents if necessary.
    +as_fn_mkdir_p ()
    +{
    +
    +  case $as_dir in #(
    +  -*) as_dir=./$as_dir;;
    +  esac
    +  test -d "$as_dir" || eval $as_mkdir_p || {
    +    as_dirs=
    +    while :; do
    +      case $as_dir in #(
    +      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
    +      *) as_qdir=$as_dir;;
    +      esac
    +      as_dirs="'$as_qdir' $as_dirs"
    +      as_dir=`$as_dirname -- "$as_dir" ||
    +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    +	 X"$as_dir" : 'X\(//\)[^/]' \| \
    +	 X"$as_dir" : 'X\(//\)$' \| \
    +	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X"$as_dir" |
    +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)[^/].*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +      test -d "$as_dir" && break
    +    done
    +    test -z "$as_dirs" || eval "mkdir $as_dirs"
    +  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
    +
    +
    +} # as_fn_mkdir_p
    +
    +# as_fn_executable_p FILE
    +# -----------------------
    +# Test if FILE is an executable regular file.
    +as_fn_executable_p ()
    +{
    +  test -f "$1" && test -x "$1"
    +} # as_fn_executable_p
    +# as_fn_append VAR VALUE
    +# ----------------------
    +# Append the text in VALUE to the end of the definition contained in VAR. Take
    +# advantage of any shell optimizations that allow amortized linear growth over
    +# repeated appends, instead of the typical quadratic growth present in naive
    +# implementations.
    +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
    +then :
    +  eval 'as_fn_append ()
    +  {
    +    eval $1+=\$2
    +  }'
    +else $as_nop
    +  as_fn_append ()
    +  {
    +    eval $1=\$$1\$2
    +  }
    +fi # as_fn_append
    +
    +# as_fn_arith ARG...
    +# ------------------
    +# Perform arithmetic evaluation on the ARGs, and store the result in the
    +# global $as_val. Take advantage of shells that can avoid forks. The arguments
    +# must be portable across $(()) and expr.
    +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
    +then :
    +  eval 'as_fn_arith ()
    +  {
    +    as_val=$(( $* ))
    +  }'
    +else $as_nop
    +  as_fn_arith ()
    +  {
    +    as_val=`expr "$@" || test $? -eq 1`
    +  }
    +fi # as_fn_arith
    +
    +# as_fn_nop
    +# ---------
    +# Do nothing but, unlike ":", preserve the value of $?.
    +as_fn_nop ()
    +{
    +  return $?
    +}
    +as_nop=as_fn_nop
    +
    +# as_fn_error STATUS ERROR [LINENO LOG_FD]
    +# ----------------------------------------
    +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
    +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
    +# script with STATUS, using 1 if that was 0.
    +as_fn_error ()
    +{
    +  as_status=$1; test $as_status -eq 0 && as_status=1
    +  if test "$4"; then
    +    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
    +  fi
    +  printf "%s\n" "$as_me: error: $2" >&2
    +  as_fn_exit $as_status
    +} # as_fn_error
    +
    +if expr a : '\(a\)' >/dev/null 2>&1 &&
    +   test "X`expr 00001 : '.*\(...\)'`" = X001; then
    +  as_expr=expr
    +else
    +  as_expr=false
    +fi
    +
    +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
    +  as_basename=basename
    +else
    +  as_basename=false
    +fi
    +
    +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
    +  as_dirname=dirname
    +else
    +  as_dirname=false
    +fi
    +
    +as_me=`$as_basename -- "$0" ||
    +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
    +	 X"$0" : 'X\(//\)$' \| \
    +	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X/"$0" |
    +    sed '/^.*\/\([^/][^/]*\)\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\/\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\/\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +
    +# Avoid depending upon Character Ranges.
    +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
    +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
    +as_cr_digits='0123456789'
    +as_cr_alnum=$as_cr_Letters$as_cr_digits
    +
    +
    +  as_lineno_1=$LINENO as_lineno_1a=$LINENO
    +  as_lineno_2=$LINENO as_lineno_2a=$LINENO
    +  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
    +  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
    +  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
    +  sed -n '
    +    p
    +    /[$]LINENO/=
    +  ' <$as_myself |
    +    sed '
    +      s/[$]LINENO.*/&-/
    +      t lineno
    +      b
    +      :lineno
    +      N
    +      :loop
    +      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
    +      t loop
    +      s/-\n.*//
    +    ' >$as_me.lineno &&
    +  chmod +x "$as_me.lineno" ||
    +    { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
    +
    +  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
    +  # already done that, so ensure we don't try to do so again and fall
    +  # in an infinite loop.  This has already happened in practice.
    +  _as_can_reexec=no; export _as_can_reexec
    +  # Don't try to exec as it changes $[0], causing all sort of problems
    +  # (the dirname of $[0] is not the place where we might find the
    +  # original and so on.  Autoconf is especially sensitive to this).
    +  . "./$as_me.lineno"
    +  # Exit status is that of the last command.
    +  exit
    +}
    +
    +
    +# Determine whether it's possible to make 'echo' print without a newline.
    +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
    +# for compatibility with existing Makefiles.
    +ECHO_C= ECHO_N= ECHO_T=
    +case `echo -n x` in #(((((
    +-n*)
    +  case `echo 'xy\c'` in
    +  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
    +  xy)  ECHO_C='\c';;
    +  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
    +       ECHO_T='	';;
    +  esac;;
    +*)
    +  ECHO_N='-n';;
    +esac
    +
    +# For backward compatibility with old third-party macros, we provide
    +# the shell variables $as_echo and $as_echo_n.  New code should use
    +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
    +as_echo='printf %s\n'
    +as_echo_n='printf %s'
    +
    +
    +rm -f conf$$ conf$$.exe conf$$.file
    +if test -d conf$$.dir; then
    +  rm -f conf$$.dir/conf$$.file
    +else
    +  rm -f conf$$.dir
    +  mkdir conf$$.dir 2>/dev/null
    +fi
    +if (echo >conf$$.file) 2>/dev/null; then
    +  if ln -s conf$$.file conf$$ 2>/dev/null; then
    +    as_ln_s='ln -s'
    +    # ... but there are two gotchas:
    +    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    +    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    +    # In both cases, we have to default to `cp -pR'.
    +    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    +      as_ln_s='cp -pR'
    +  elif ln conf$$.file conf$$ 2>/dev/null; then
    +    as_ln_s=ln
    +  else
    +    as_ln_s='cp -pR'
    +  fi
    +else
    +  as_ln_s='cp -pR'
    +fi
    +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
    +rmdir conf$$.dir 2>/dev/null
    +
    +if mkdir -p . 2>/dev/null; then
    +  as_mkdir_p='mkdir -p "$as_dir"'
    +else
    +  test -d ./-p && rmdir ./-p
    +  as_mkdir_p=false
    +fi
    +
    +as_test_x='test -x'
    +as_executable_p=as_fn_executable_p
    +
    +# Sed expression to map a string onto a valid CPP name.
    +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
    +
    +# Sed expression to map a string onto a valid variable name.
    +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
    +
    +as_awk_strverscmp='
    +  # Use only awk features that work with 7th edition Unix awk (1978).
    +  # My, what an old awk you have, Mr. Solaris!
    +  END {
    +    while (length(v1) && length(v2)) {
    +      # Set d1 to be the next thing to compare from v1, and likewise for d2.
    +      # Normally this is a single character, but if v1 and v2 contain digits,
    +      # compare them as integers and fractions as strverscmp does.
    +      if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) {
    +	# Split v1 and v2 into their leading digit string components d1 and d2,
    +	# and advance v1 and v2 past the leading digit strings.
    +	for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue
    +	for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue
    +	d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1)
    +	d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1)
    +	if (d1 ~ /^0/) {
    +	  if (d2 ~ /^0/) {
    +	    # Compare two fractions.
    +	    while (d1 ~ /^0/ && d2 ~ /^0/) {
    +	      d1 = substr(d1, 2); len1--
    +	      d2 = substr(d2, 2); len2--
    +	    }
    +	    if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) {
    +	      # The two components differ in length, and the common prefix
    +	      # contains only leading zeros.  Consider the longer to be less.
    +	      d1 = -len1
    +	      d2 = -len2
    +	    } else {
    +	      # Otherwise, compare as strings.
    +	      d1 = "x" d1
    +	      d2 = "x" d2
    +	    }
    +	  } else {
    +	    # A fraction is less than an integer.
    +	    exit 1
    +	  }
    +	} else {
    +	  if (d2 ~ /^0/) {
    +	    # An integer is greater than a fraction.
    +	    exit 2
    +	  } else {
    +	    # Compare two integers.
    +	    d1 += 0
    +	    d2 += 0
    +	  }
    +	}
    +      } else {
    +	# The normal case, without worrying about digits.
    +	d1 = substr(v1, 1, 1); v1 = substr(v1, 2)
    +	d2 = substr(v2, 1, 1); v2 = substr(v2, 2)
    +      }
    +      if (d1 < d2) exit 1
    +      if (d1 > d2) exit 2
    +    }
    +    # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10),
    +    # which mishandles some comparisons of empty strings to integers.
    +    if (length(v2)) exit 1
    +    if (length(v1)) exit 2
    +  }
    +'
    +
    +test -n "$DJDIR" || exec 7<&0 &1
    +
    +# Name of the host.
    +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
    +# so uname gets run too.
    +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
    +
    +#
    +# Initializations.
    +#
    +ac_default_prefix=/usr/local
    +ac_clean_files=
    +ac_config_libobj_dir=.
    +LIBOBJS=
    +cross_compiling=no
    +subdirs=
    +MFLAGS=
    +MAKEFLAGS=
    +
    +# Identity of this package.
    +PACKAGE_NAME='amuse-simplex'
    +PACKAGE_TARNAME='amuse-simplex'
    +PACKAGE_VERSION='1.0'
    +PACKAGE_STRING='amuse-simplex 1.0'
    +PACKAGE_BUGREPORT=''
    +PACKAGE_URL=''
    +
    +# Factoring default headers for most tests.
    +ac_includes_default="\
    +#include 
    +#ifdef HAVE_STDIO_H
    +# include 
    +#endif
    +#ifdef HAVE_STDLIB_H
    +# include 
    +#endif
    +#ifdef HAVE_STRING_H
    +# include 
    +#endif
    +#ifdef HAVE_INTTYPES_H
    +# include 
    +#endif
    +#ifdef HAVE_STDINT_H
    +# include 
    +#endif
    +#ifdef HAVE_STRINGS_H
    +# include 
    +#endif
    +#ifdef HAVE_SYS_TYPES_H
    +# include 
    +#endif
    +#ifdef HAVE_SYS_STAT_H
    +# include 
    +#endif
    +#ifdef HAVE_UNISTD_H
    +# include 
    +#endif"
    +
    +ac_header_c_list=
    +ac_subst_vars='LTLIBOBJS
    +LIBOBJS
    +HEALPIX_CXX_LIBS
    +HEALPIX_CXX_CFLAGS
    +QHULL_FLAGS
    +QHULL_LIBS
    +HDF5_TYPE
    +HDF5_FLIBS
    +HDF5_FFLAGS
    +HDF5_FC
    +HDF5_LIBS
    +HDF5_LDFLAGS
    +HDF5_CPPFLAGS
    +HDF5_CFLAGS
    +HDF5_CC
    +HDF5_VERSION
    +H5FC
    +ac_ct_CC
    +CFLAGS
    +CC
    +H5CC
    +AWK
    +SED
    +GSL_CONFIG
    +GSL_LIBS
    +GSL_CFLAGS
    +PKG_CONFIG_LIBDIR
    +PKG_CONFIG_PATH
    +PKG_CONFIG
    +GSL_FLAGS
    +MPILIBS
    +MPI_CXXLIBS
    +MPI_CXXFLAGS
    +MPICXX
    +RANLIB
    +AR
    +target_os
    +target_vendor
    +target_cpu
    +target
    +OBJEXT
    +EXEEXT
    +ac_ct_CXX
    +CPPFLAGS
    +LDFLAGS
    +CXXFLAGS
    +CXX
    +CPU_COUNT
    +EGREP
    +GREP
    +host_os
    +host_vendor
    +host_cpu
    +host
    +build_os
    +build_vendor
    +build_cpu
    +build
    +FFLAGS
    +target_alias
    +host_alias
    +build_alias
    +LIBS
    +ECHO_T
    +ECHO_N
    +ECHO_C
    +DEFS
    +mandir
    +localedir
    +libdir
    +psdir
    +pdfdir
    +dvidir
    +htmldir
    +infodir
    +docdir
    +oldincludedir
    +includedir
    +runstatedir
    +localstatedir
    +sharedstatedir
    +sysconfdir
    +datadir
    +datarootdir
    +libexecdir
    +sbindir
    +bindir
    +program_transform_name
    +prefix
    +exec_prefix
    +PACKAGE_URL
    +PACKAGE_BUGREPORT
    +PACKAGE_STRING
    +PACKAGE_VERSION
    +PACKAGE_TARNAME
    +PACKAGE_NAME
    +PATH_SEPARATOR
    +SHELL'
    +ac_subst_files=''
    +ac_user_opts='
    +enable_option_checking
    +with_gsl_prefix
    +with_gsl_exec_prefix
    +enable_gsltest
    +with_hdf5
    +'
    +      ac_precious_vars='build_alias
    +host_alias
    +target_alias
    +CXX
    +CXXFLAGS
    +LDFLAGS
    +LIBS
    +CPPFLAGS
    +CCC
    +MPICXX
    +PKG_CONFIG
    +PKG_CONFIG_PATH
    +PKG_CONFIG_LIBDIR
    +GSL_CFLAGS
    +GSL_LIBS
    +CC
    +CFLAGS
    +HEALPIX_CXX_CFLAGS
    +HEALPIX_CXX_LIBS'
    +
    +
    +# Initialize some variables set by options.
    +ac_init_help=
    +ac_init_version=false
    +ac_unrecognized_opts=
    +ac_unrecognized_sep=
    +# The variables have the same names as the options, with
    +# dashes changed to underlines.
    +cache_file=/dev/null
    +exec_prefix=NONE
    +no_create=
    +no_recursion=
    +prefix=NONE
    +program_prefix=NONE
    +program_suffix=NONE
    +program_transform_name=s,x,x,
    +silent=
    +site=
    +srcdir=
    +verbose=
    +x_includes=NONE
    +x_libraries=NONE
    +
    +# Installation directory options.
    +# These are left unexpanded so users can "make install exec_prefix=/foo"
    +# and all the variables that are supposed to be based on exec_prefix
    +# by default will actually change.
    +# Use braces instead of parens because sh, perl, etc. also accept them.
    +# (The list follows the same order as the GNU Coding Standards.)
    +bindir='${exec_prefix}/bin'
    +sbindir='${exec_prefix}/sbin'
    +libexecdir='${exec_prefix}/libexec'
    +datarootdir='${prefix}/share'
    +datadir='${datarootdir}'
    +sysconfdir='${prefix}/etc'
    +sharedstatedir='${prefix}/com'
    +localstatedir='${prefix}/var'
    +runstatedir='${localstatedir}/run'
    +includedir='${prefix}/include'
    +oldincludedir='/usr/include'
    +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
    +infodir='${datarootdir}/info'
    +htmldir='${docdir}'
    +dvidir='${docdir}'
    +pdfdir='${docdir}'
    +psdir='${docdir}'
    +libdir='${exec_prefix}/lib'
    +localedir='${datarootdir}/locale'
    +mandir='${datarootdir}/man'
    +
    +ac_prev=
    +ac_dashdash=
    +for ac_option
    +do
    +  # If the previous option needs an argument, assign it.
    +  if test -n "$ac_prev"; then
    +    eval $ac_prev=\$ac_option
    +    ac_prev=
    +    continue
    +  fi
    +
    +  case $ac_option in
    +  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
    +  *=)   ac_optarg= ;;
    +  *)    ac_optarg=yes ;;
    +  esac
    +
    +  case $ac_dashdash$ac_option in
    +  --)
    +    ac_dashdash=yes ;;
    +
    +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    +    ac_prev=bindir ;;
    +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    +    bindir=$ac_optarg ;;
    +
    +  -build | --build | --buil | --bui | --bu)
    +    ac_prev=build_alias ;;
    +  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    +    build_alias=$ac_optarg ;;
    +
    +  -cache-file | --cache-file | --cache-fil | --cache-fi \
    +  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    +    ac_prev=cache_file ;;
    +  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    +  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    +    cache_file=$ac_optarg ;;
    +
    +  --config-cache | -C)
    +    cache_file=config.cache ;;
    +
    +  -datadir | --datadir | --datadi | --datad)
    +    ac_prev=datadir ;;
    +  -datadir=* | --datadir=* | --datadi=* | --datad=*)
    +    datadir=$ac_optarg ;;
    +
    +  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
    +  | --dataroo | --dataro | --datar)
    +    ac_prev=datarootdir ;;
    +  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
    +  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
    +    datarootdir=$ac_optarg ;;
    +
    +  -disable-* | --disable-*)
    +    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
    +    # Reject names that are not valid shell variable names.
    +    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    +      as_fn_error $? "invalid feature name: \`$ac_useropt'"
    +    ac_useropt_orig=$ac_useropt
    +    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
    +    case $ac_user_opts in
    +      *"
    +"enable_$ac_useropt"
    +"*) ;;
    +      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
    +	 ac_unrecognized_sep=', ';;
    +    esac
    +    eval enable_$ac_useropt=no ;;
    +
    +  -docdir | --docdir | --docdi | --doc | --do)
    +    ac_prev=docdir ;;
    +  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
    +    docdir=$ac_optarg ;;
    +
    +  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
    +    ac_prev=dvidir ;;
    +  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
    +    dvidir=$ac_optarg ;;
    +
    +  -enable-* | --enable-*)
    +    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
    +    # Reject names that are not valid shell variable names.
    +    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    +      as_fn_error $? "invalid feature name: \`$ac_useropt'"
    +    ac_useropt_orig=$ac_useropt
    +    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
    +    case $ac_user_opts in
    +      *"
    +"enable_$ac_useropt"
    +"*) ;;
    +      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
    +	 ac_unrecognized_sep=', ';;
    +    esac
    +    eval enable_$ac_useropt=\$ac_optarg ;;
    +
    +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
    +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
    +  | --exec | --exe | --ex)
    +    ac_prev=exec_prefix ;;
    +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
    +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
    +  | --exec=* | --exe=* | --ex=*)
    +    exec_prefix=$ac_optarg ;;
    +
    +  -gas | --gas | --ga | --g)
    +    # Obsolete; use --with-gas.
    +    with_gas=yes ;;
    +
    +  -help | --help | --hel | --he | -h)
    +    ac_init_help=long ;;
    +  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
    +    ac_init_help=recursive ;;
    +  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
    +    ac_init_help=short ;;
    +
    +  -host | --host | --hos | --ho)
    +    ac_prev=host_alias ;;
    +  -host=* | --host=* | --hos=* | --ho=*)
    +    host_alias=$ac_optarg ;;
    +
    +  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
    +    ac_prev=htmldir ;;
    +  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
    +  | --ht=*)
    +    htmldir=$ac_optarg ;;
    +
    +  -includedir | --includedir | --includedi | --included | --include \
    +  | --includ | --inclu | --incl | --inc)
    +    ac_prev=includedir ;;
    +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
    +  | --includ=* | --inclu=* | --incl=* | --inc=*)
    +    includedir=$ac_optarg ;;
    +
    +  -infodir | --infodir | --infodi | --infod | --info | --inf)
    +    ac_prev=infodir ;;
    +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    +    infodir=$ac_optarg ;;
    +
    +  -libdir | --libdir | --libdi | --libd)
    +    ac_prev=libdir ;;
    +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    +    libdir=$ac_optarg ;;
    +
    +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
    +  | --libexe | --libex | --libe)
    +    ac_prev=libexecdir ;;
    +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
    +  | --libexe=* | --libex=* | --libe=*)
    +    libexecdir=$ac_optarg ;;
    +
    +  -localedir | --localedir | --localedi | --localed | --locale)
    +    ac_prev=localedir ;;
    +  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
    +    localedir=$ac_optarg ;;
    +
    +  -localstatedir | --localstatedir | --localstatedi | --localstated \
    +  | --localstate | --localstat | --localsta | --localst | --locals)
    +    ac_prev=localstatedir ;;
    +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
    +  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
    +    localstatedir=$ac_optarg ;;
    +
    +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    +    ac_prev=mandir ;;
    +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    +    mandir=$ac_optarg ;;
    +
    +  -nfp | --nfp | --nf)
    +    # Obsolete; use --without-fp.
    +    with_fp=no ;;
    +
    +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
    +  | --no-cr | --no-c | -n)
    +    no_create=yes ;;
    +
    +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
    +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    +    no_recursion=yes ;;
    +
    +  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
    +  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
    +  | --oldin | --oldi | --old | --ol | --o)
    +    ac_prev=oldincludedir ;;
    +  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
    +  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
    +  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    +    oldincludedir=$ac_optarg ;;
    +
    +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    +    ac_prev=prefix ;;
    +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    +    prefix=$ac_optarg ;;
    +
    +  -program-prefix | --program-prefix | --program-prefi | --program-pref \
    +  | --program-pre | --program-pr | --program-p)
    +    ac_prev=program_prefix ;;
    +  -program-prefix=* | --program-prefix=* | --program-prefi=* \
    +  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    +    program_prefix=$ac_optarg ;;
    +
    +  -program-suffix | --program-suffix | --program-suffi | --program-suff \
    +  | --program-suf | --program-su | --program-s)
    +    ac_prev=program_suffix ;;
    +  -program-suffix=* | --program-suffix=* | --program-suffi=* \
    +  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    +    program_suffix=$ac_optarg ;;
    +
    +  -program-transform-name | --program-transform-name \
    +  | --program-transform-nam | --program-transform-na \
    +  | --program-transform-n | --program-transform- \
    +  | --program-transform | --program-transfor \
    +  | --program-transfo | --program-transf \
    +  | --program-trans | --program-tran \
    +  | --progr-tra | --program-tr | --program-t)
    +    ac_prev=program_transform_name ;;
    +  -program-transform-name=* | --program-transform-name=* \
    +  | --program-transform-nam=* | --program-transform-na=* \
    +  | --program-transform-n=* | --program-transform-=* \
    +  | --program-transform=* | --program-transfor=* \
    +  | --program-transfo=* | --program-transf=* \
    +  | --program-trans=* | --program-tran=* \
    +  | --progr-tra=* | --program-tr=* | --program-t=*)
    +    program_transform_name=$ac_optarg ;;
    +
    +  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
    +    ac_prev=pdfdir ;;
    +  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
    +    pdfdir=$ac_optarg ;;
    +
    +  -psdir | --psdir | --psdi | --psd | --ps)
    +    ac_prev=psdir ;;
    +  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
    +    psdir=$ac_optarg ;;
    +
    +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    +  | -silent | --silent | --silen | --sile | --sil)
    +    silent=yes ;;
    +
    +  -runstatedir | --runstatedir | --runstatedi | --runstated \
    +  | --runstate | --runstat | --runsta | --runst | --runs \
    +  | --run | --ru | --r)
    +    ac_prev=runstatedir ;;
    +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
    +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
    +  | --run=* | --ru=* | --r=*)
    +    runstatedir=$ac_optarg ;;
    +
    +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    +    ac_prev=sbindir ;;
    +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
    +  | --sbi=* | --sb=*)
    +    sbindir=$ac_optarg ;;
    +
    +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
    +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
    +  | --sharedst | --shareds | --shared | --share | --shar \
    +  | --sha | --sh)
    +    ac_prev=sharedstatedir ;;
    +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
    +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
    +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
    +  | --sha=* | --sh=*)
    +    sharedstatedir=$ac_optarg ;;
    +
    +  -site | --site | --sit)
    +    ac_prev=site ;;
    +  -site=* | --site=* | --sit=*)
    +    site=$ac_optarg ;;
    +
    +  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    +    ac_prev=srcdir ;;
    +  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    +    srcdir=$ac_optarg ;;
    +
    +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
    +  | --syscon | --sysco | --sysc | --sys | --sy)
    +    ac_prev=sysconfdir ;;
    +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
    +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    +    sysconfdir=$ac_optarg ;;
    +
    +  -target | --target | --targe | --targ | --tar | --ta | --t)
    +    ac_prev=target_alias ;;
    +  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    +    target_alias=$ac_optarg ;;
    +
    +  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    +    verbose=yes ;;
    +
    +  -version | --version | --versio | --versi | --vers | -V)
    +    ac_init_version=: ;;
    +
    +  -with-* | --with-*)
    +    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
    +    # Reject names that are not valid shell variable names.
    +    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    +      as_fn_error $? "invalid package name: \`$ac_useropt'"
    +    ac_useropt_orig=$ac_useropt
    +    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
    +    case $ac_user_opts in
    +      *"
    +"with_$ac_useropt"
    +"*) ;;
    +      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
    +	 ac_unrecognized_sep=', ';;
    +    esac
    +    eval with_$ac_useropt=\$ac_optarg ;;
    +
    +  -without-* | --without-*)
    +    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
    +    # Reject names that are not valid shell variable names.
    +    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    +      as_fn_error $? "invalid package name: \`$ac_useropt'"
    +    ac_useropt_orig=$ac_useropt
    +    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
    +    case $ac_user_opts in
    +      *"
    +"with_$ac_useropt"
    +"*) ;;
    +      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
    +	 ac_unrecognized_sep=', ';;
    +    esac
    +    eval with_$ac_useropt=no ;;
    +
    +  --x)
    +    # Obsolete; use --with-x.
    +    with_x=yes ;;
    +
    +  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
    +  | --x-incl | --x-inc | --x-in | --x-i)
    +    ac_prev=x_includes ;;
    +  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
    +  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    +    x_includes=$ac_optarg ;;
    +
    +  -x-libraries | --x-libraries | --x-librarie | --x-librari \
    +  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    +    ac_prev=x_libraries ;;
    +  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
    +  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    +    x_libraries=$ac_optarg ;;
    +
    +  -*) as_fn_error $? "unrecognized option: \`$ac_option'
    +Try \`$0 --help' for more information"
    +    ;;
    +
    +  *=*)
    +    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    +    # Reject names that are not valid shell variable names.
    +    case $ac_envvar in #(
    +      '' | [0-9]* | *[!_$as_cr_alnum]* )
    +      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
    +    esac
    +    eval $ac_envvar=\$ac_optarg
    +    export $ac_envvar ;;
    +
    +  *)
    +    # FIXME: should be removed in autoconf 3.0.
    +    printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
    +    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
    +      printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
    +    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
    +    ;;
    +
    +  esac
    +done
    +
    +if test -n "$ac_prev"; then
    +  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
    +  as_fn_error $? "missing argument to $ac_option"
    +fi
    +
    +if test -n "$ac_unrecognized_opts"; then
    +  case $enable_option_checking in
    +    no) ;;
    +    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
    +    *)     printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
    +  esac
    +fi
    +
    +# Check all directory arguments for consistency.
    +for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
    +		datadir sysconfdir sharedstatedir localstatedir includedir \
    +		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
    +		libdir localedir mandir runstatedir
    +do
    +  eval ac_val=\$$ac_var
    +  # Remove trailing slashes.
    +  case $ac_val in
    +    */ )
    +      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
    +      eval $ac_var=\$ac_val;;
    +  esac
    +  # Be sure to have absolute directory names.
    +  case $ac_val in
    +    [\\/$]* | ?:[\\/]* )  continue;;
    +    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
    +  esac
    +  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
    +done
    +
    +# There might be people who depend on the old broken behavior: `$host'
    +# used to hold the argument of --host etc.
    +# FIXME: To remove some day.
    +build=$build_alias
    +host=$host_alias
    +target=$target_alias
    +
    +# FIXME: To remove some day.
    +if test "x$host_alias" != x; then
    +  if test "x$build_alias" = x; then
    +    cross_compiling=maybe
    +  elif test "x$build_alias" != "x$host_alias"; then
    +    cross_compiling=yes
    +  fi
    +fi
    +
    +ac_tool_prefix=
    +test -n "$host_alias" && ac_tool_prefix=$host_alias-
    +
    +test "$silent" = yes && exec 6>/dev/null
    +
    +
    +ac_pwd=`pwd` && test -n "$ac_pwd" &&
    +ac_ls_di=`ls -di .` &&
    +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
    +  as_fn_error $? "working directory cannot be determined"
    +test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
    +  as_fn_error $? "pwd does not report name of working directory"
    +
    +
    +# Find the source files, if location was not specified.
    +if test -z "$srcdir"; then
    +  ac_srcdir_defaulted=yes
    +  # Try the directory containing this script, then the parent directory.
    +  ac_confdir=`$as_dirname -- "$as_myself" ||
    +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    +	 X"$as_myself" : 'X\(//\)[^/]' \| \
    +	 X"$as_myself" : 'X\(//\)$' \| \
    +	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X"$as_myself" |
    +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)[^/].*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +  srcdir=$ac_confdir
    +  if test ! -r "$srcdir/$ac_unique_file"; then
    +    srcdir=..
    +  fi
    +else
    +  ac_srcdir_defaulted=no
    +fi
    +if test ! -r "$srcdir/$ac_unique_file"; then
    +  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
    +  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
    +fi
    +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
    +ac_abs_confdir=`(
    +	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
    +	pwd)`
    +# When building in place, set srcdir=.
    +if test "$ac_abs_confdir" = "$ac_pwd"; then
    +  srcdir=.
    +fi
    +# Remove unnecessary trailing slashes from srcdir.
    +# Double slashes in file names in object file debugging info
    +# mess up M-x gdb in Emacs.
    +case $srcdir in
    +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
    +esac
    +for ac_var in $ac_precious_vars; do
    +  eval ac_env_${ac_var}_set=\${${ac_var}+set}
    +  eval ac_env_${ac_var}_value=\$${ac_var}
    +  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
    +  eval ac_cv_env_${ac_var}_value=\$${ac_var}
    +done
    +
    +#
    +# Report the --help message.
    +#
    +if test "$ac_init_help" = "long"; then
    +  # Omit some internal or obsolete options to make the list less imposing.
    +  # This message is too long to be a string in the A/UX 3.1 sh.
    +  cat <<_ACEOF
    +\`configure' configures amuse-simplex 1.0 to adapt to many kinds of systems.
    +
    +Usage: $0 [OPTION]... [VAR=VALUE]...
    +
    +To assign environment variables (e.g., CC, CFLAGS...), specify them as
    +VAR=VALUE.  See below for descriptions of some of the useful variables.
    +
    +Defaults for the options are specified in brackets.
    +
    +Configuration:
    +  -h, --help              display this help and exit
    +      --help=short        display options specific to this package
    +      --help=recursive    display the short help of all the included packages
    +  -V, --version           display version information and exit
    +  -q, --quiet, --silent   do not print \`checking ...' messages
    +      --cache-file=FILE   cache test results in FILE [disabled]
    +  -C, --config-cache      alias for \`--cache-file=config.cache'
    +  -n, --no-create         do not create output files
    +      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
    +
    +Installation directories:
    +  --prefix=PREFIX         install architecture-independent files in PREFIX
    +                          [$ac_default_prefix]
    +  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
    +                          [PREFIX]
    +
    +By default, \`make install' will install all the files in
    +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
    +an installation prefix other than \`$ac_default_prefix' using \`--prefix',
    +for instance \`--prefix=\$HOME'.
    +
    +For better control, use the options below.
    +
    +Fine tuning of the installation directories:
    +  --bindir=DIR            user executables [EPREFIX/bin]
    +  --sbindir=DIR           system admin executables [EPREFIX/sbin]
    +  --libexecdir=DIR        program executables [EPREFIX/libexec]
    +  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
    +  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
    +  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
    +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
    +  --libdir=DIR            object code libraries [EPREFIX/lib]
    +  --includedir=DIR        C header files [PREFIX/include]
    +  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
    +  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
    +  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
    +  --infodir=DIR           info documentation [DATAROOTDIR/info]
    +  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
    +  --mandir=DIR            man documentation [DATAROOTDIR/man]
    +  --docdir=DIR            documentation root [DATAROOTDIR/doc/amuse-simplex]
    +  --htmldir=DIR           html documentation [DOCDIR]
    +  --dvidir=DIR            dvi documentation [DOCDIR]
    +  --pdfdir=DIR            pdf documentation [DOCDIR]
    +  --psdir=DIR             ps documentation [DOCDIR]
    +_ACEOF
    +
    +  cat <<\_ACEOF
    +
    +System types:
    +  --build=BUILD     configure for building on BUILD [guessed]
    +  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
    +  --target=TARGET   configure for building compilers for TARGET [HOST]
    +_ACEOF
    +fi
    +
    +if test -n "$ac_init_help"; then
    +  case $ac_init_help in
    +     short | recursive ) echo "Configuration of amuse-simplex 1.0:";;
    +   esac
    +  cat <<\_ACEOF
    +
    +Optional Features:
    +  --disable-option-checking  ignore unrecognized --enable/--with options
    +  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
    +  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    +  --disable-gsltest       Do not try to compile and run a test GSL program
    +
    +Optional Packages:
    +  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    +  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    +  --with-gsl-prefix=PFX   Prefix where GSL is installed (optional)
    +  --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional)
    +  --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration
    +
    +Some influential environment variables:
    +  CXX         C++ compiler command
    +  CXXFLAGS    C++ compiler flags
    +  LDFLAGS     linker flags, e.g. -L if you have libraries in a
    +              nonstandard directory 
    +  LIBS        libraries to pass to the linker, e.g. -l
    +  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I if
    +              you have headers in a nonstandard directory 
    +  MPICXX      MPI C++ compiler command
    +  PKG_CONFIG  path to pkg-config utility
    +  PKG_CONFIG_PATH
    +              directories to add to pkg-config's search path
    +  PKG_CONFIG_LIBDIR
    +              path overriding pkg-config's built-in search path
    +  GSL_CFLAGS  C compiler flags for GSL, overriding pkg-config
    +  GSL_LIBS    linker flags for GSL, overriding pkg-config
    +  CC          C compiler command
    +  CFLAGS      C compiler flags
    +  HEALPIX_CXX_CFLAGS
    +              C compiler flags for HEALPIX_CXX, overriding pkg-config
    +  HEALPIX_CXX_LIBS
    +              linker flags for HEALPIX_CXX, overriding pkg-config
    +
    +Use these variables to override the choices made by `configure' or to help
    +it to find libraries and programs with nonstandard names/locations.
    +
    +Report bugs to the package provider.
    +_ACEOF
    +ac_status=$?
    +fi
    +
    +if test "$ac_init_help" = "recursive"; then
    +  # If there are subdirs, report their specific --help.
    +  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
    +    test -d "$ac_dir" ||
    +      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
    +      continue
    +    ac_builddir=.
    +
    +case "$ac_dir" in
    +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
    +*)
    +  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
    +  # A ".." for each directory in $ac_dir_suffix.
    +  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
    +  case $ac_top_builddir_sub in
    +  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
    +  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
    +  esac ;;
    +esac
    +ac_abs_top_builddir=$ac_pwd
    +ac_abs_builddir=$ac_pwd$ac_dir_suffix
    +# for backward compatibility:
    +ac_top_builddir=$ac_top_build_prefix
    +
    +case $srcdir in
    +  .)  # We are building in place.
    +    ac_srcdir=.
    +    ac_top_srcdir=$ac_top_builddir_sub
    +    ac_abs_top_srcdir=$ac_pwd ;;
    +  [\\/]* | ?:[\\/]* )  # Absolute name.
    +    ac_srcdir=$srcdir$ac_dir_suffix;
    +    ac_top_srcdir=$srcdir
    +    ac_abs_top_srcdir=$srcdir ;;
    +  *) # Relative name.
    +    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    +    ac_top_srcdir=$ac_top_build_prefix$srcdir
    +    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
    +esac
    +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
    +
    +    cd "$ac_dir" || { ac_status=$?; continue; }
    +    # Check for configure.gnu first; this name is used for a wrapper for
    +    # Metaconfig's "Configure" on case-insensitive file systems.
    +    if test -f "$ac_srcdir/configure.gnu"; then
    +      echo &&
    +      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
    +    elif test -f "$ac_srcdir/configure"; then
    +      echo &&
    +      $SHELL "$ac_srcdir/configure" --help=recursive
    +    else
    +      printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    +    fi || ac_status=$?
    +    cd "$ac_pwd" || { ac_status=$?; break; }
    +  done
    +fi
    +
    +test -n "$ac_init_help" && exit $ac_status
    +if $ac_init_version; then
    +  cat <<\_ACEOF
    +amuse-simplex configure 1.0
    +generated by GNU Autoconf 2.71
    +
    +Copyright (C) 2021 Free Software Foundation, Inc.
    +This configure script is free software; the Free Software Foundation
    +gives unlimited permission to copy, distribute and modify it.
    +_ACEOF
    +  exit
    +fi
    +
    +## ------------------------ ##
    +## Autoconf initialization. ##
    +## ------------------------ ##
    +
    +# ac_fn_cxx_try_compile LINENO
    +# ----------------------------
    +# Try to compile conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_cxx_try_compile ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam
    +  if { { ac_try="$ac_compile"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compile") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_cxx_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest.$ac_objext
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_cxx_try_compile
    +
    +# ac_fn_cxx_try_link LINENO
    +# -------------------------
    +# Try to link conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_cxx_try_link ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
    +  if { { ac_try="$ac_link"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_cxx_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest$ac_exeext && {
    +	 test "$cross_compiling" = yes ||
    +	 test -x conftest$ac_exeext
    +       }
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
    +  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
    +  # interfere with the next link command; also delete a directory that is
    +  # left behind by Apple's compiler.  We do this before executing the actions.
    +  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_cxx_try_link
    +
    +# ac_fn_cxx_check_func LINENO FUNC VAR
    +# ------------------------------------
    +# Tests whether FUNC exists, setting the cache variable VAR accordingly
    +ac_fn_cxx_check_func ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    +printf %s "checking for $2... " >&6; }
    +if eval test \${$3+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +/* Define $2 to an innocuous variant, in case  declares $2.
    +   For example, HP-UX 11i  declares gettimeofday.  */
    +#define $2 innocuous_$2
    +
    +/* System header to define __stub macros and hopefully few prototypes,
    +   which can conflict with char $2 (); below.  */
    +
    +#include 
    +#undef $2
    +
    +/* Override any GCC internal prototype to avoid an error.
    +   Use char because int might match the return type of a GCC
    +   builtin and then its argument prototype would still apply.  */
    +#ifdef __cplusplus
    +extern "C"
    +#endif
    +char $2 ();
    +/* The GNU C library defines this for functions which it implements
    +    to always fail with ENOSYS.  Some functions are actually named
    +    something starting with __ and the normal name is an alias.  */
    +#if defined __stub_$2 || defined __stub___$2
    +choke me
    +#endif
    +
    +int
    +main (void)
    +{
    +return $2 ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +  eval "$3=yes"
    +else $as_nop
    +  eval "$3=no"
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +fi
    +eval ac_res=\$$3
    +	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    +printf "%s\n" "$ac_res" >&6; }
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +
    +} # ac_fn_cxx_check_func
    +
    +# ac_fn_c_try_compile LINENO
    +# --------------------------
    +# Try to compile conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_c_try_compile ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam
    +  if { { ac_try="$ac_compile"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compile") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_c_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest.$ac_objext
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_c_try_compile
    +
    +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
    +# -------------------------------------------------------
    +# Tests whether HEADER exists and can be compiled using the include files in
    +# INCLUDES, setting the cache variable VAR accordingly.
    +ac_fn_c_check_header_compile ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    +printf %s "checking for $2... " >&6; }
    +if eval test \${$3+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$4
    +#include <$2>
    +_ACEOF
    +if ac_fn_c_try_compile "$LINENO"
    +then :
    +  eval "$3=yes"
    +else $as_nop
    +  eval "$3=no"
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +eval ac_res=\$$3
    +	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    +printf "%s\n" "$ac_res" >&6; }
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +
    +} # ac_fn_c_check_header_compile
    +
    +# ac_fn_c_try_link LINENO
    +# -----------------------
    +# Try to link conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_c_try_link ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
    +  if { { ac_try="$ac_link"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_c_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest$ac_exeext && {
    +	 test "$cross_compiling" = yes ||
    +	 test -x conftest$ac_exeext
    +       }
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
    +  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
    +  # interfere with the next link command; also delete a directory that is
    +  # left behind by Apple's compiler.  We do this before executing the actions.
    +  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_c_try_link
    +
    +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
    +# ---------------------------------------------------------
    +# Tests whether HEADER exists and can be compiled using the include files in
    +# INCLUDES, setting the cache variable VAR accordingly.
    +ac_fn_cxx_check_header_compile ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    +printf %s "checking for $2... " >&6; }
    +if eval test \${$3+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$4
    +#include <$2>
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  eval "$3=yes"
    +else $as_nop
    +  eval "$3=no"
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +eval ac_res=\$$3
    +	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    +printf "%s\n" "$ac_res" >&6; }
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +
    +} # ac_fn_cxx_check_header_compile
    +ac_configure_args_raw=
    +for ac_arg
    +do
    +  case $ac_arg in
    +  *\'*)
    +    ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
    +  esac
    +  as_fn_append ac_configure_args_raw " '$ac_arg'"
    +done
    +
    +case $ac_configure_args_raw in
    +  *$as_nl*)
    +    ac_safe_unquote= ;;
    +  *)
    +    ac_unsafe_z='|&;<>()$`\\"*?[ ''	' # This string ends in space, tab.
    +    ac_unsafe_a="$ac_unsafe_z#~"
    +    ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
    +    ac_configure_args_raw=`      printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
    +esac
    +
    +cat >config.log <<_ACEOF
    +This file contains any messages produced by compilers while
    +running configure, to aid debugging if configure makes a mistake.
    +
    +It was created by amuse-simplex $as_me 1.0, which was
    +generated by GNU Autoconf 2.71.  Invocation command line was
    +
    +  $ $0$ac_configure_args_raw
    +
    +_ACEOF
    +exec 5>>config.log
    +{
    +cat <<_ASUNAME
    +## --------- ##
    +## Platform. ##
    +## --------- ##
    +
    +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
    +uname -m = `(uname -m) 2>/dev/null || echo unknown`
    +uname -r = `(uname -r) 2>/dev/null || echo unknown`
    +uname -s = `(uname -s) 2>/dev/null || echo unknown`
    +uname -v = `(uname -v) 2>/dev/null || echo unknown`
    +
    +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
    +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
    +
    +/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
    +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
    +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
    +/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
    +/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
    +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
    +/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
    +
    +_ASUNAME
    +
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    printf "%s\n" "PATH: $as_dir"
    +  done
    +IFS=$as_save_IFS
    +
    +} >&5
    +
    +cat >&5 <<_ACEOF
    +
    +
    +## ----------- ##
    +## Core tests. ##
    +## ----------- ##
    +
    +_ACEOF
    +
    +
    +# Keep a trace of the command line.
    +# Strip out --no-create and --no-recursion so they do not pile up.
    +# Strip out --silent because we don't want to record it for future runs.
    +# Also quote any args containing shell meta-characters.
    +# Make two passes to allow for proper duplicate-argument suppression.
    +ac_configure_args=
    +ac_configure_args0=
    +ac_configure_args1=
    +ac_must_keep_next=false
    +for ac_pass in 1 2
    +do
    +  for ac_arg
    +  do
    +    case $ac_arg in
    +    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
    +    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    +    | -silent | --silent | --silen | --sile | --sil)
    +      continue ;;
    +    *\'*)
    +      ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
    +    esac
    +    case $ac_pass in
    +    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
    +    2)
    +      as_fn_append ac_configure_args1 " '$ac_arg'"
    +      if test $ac_must_keep_next = true; then
    +	ac_must_keep_next=false # Got value, back to normal.
    +      else
    +	case $ac_arg in
    +	  *=* | --config-cache | -C | -disable-* | --disable-* \
    +	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
    +	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
    +	  | -with-* | --with-* | -without-* | --without-* | --x)
    +	    case "$ac_configure_args0 " in
    +	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
    +	    esac
    +	    ;;
    +	  -* ) ac_must_keep_next=true ;;
    +	esac
    +      fi
    +      as_fn_append ac_configure_args " '$ac_arg'"
    +      ;;
    +    esac
    +  done
    +done
    +{ ac_configure_args0=; unset ac_configure_args0;}
    +{ ac_configure_args1=; unset ac_configure_args1;}
    +
    +# When interrupted or exit'd, cleanup temporary files, and complete
    +# config.log.  We remove comments because anyway the quotes in there
    +# would cause problems or look ugly.
    +# WARNING: Use '\'' to represent an apostrophe within the trap.
    +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
    +trap 'exit_status=$?
    +  # Sanitize IFS.
    +  IFS=" ""	$as_nl"
    +  # Save into config.log some information that might help in debugging.
    +  {
    +    echo
    +
    +    printf "%s\n" "## ---------------- ##
    +## Cache variables. ##
    +## ---------------- ##"
    +    echo
    +    # The following way of writing the cache mishandles newlines in values,
    +(
    +  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
    +    eval ac_val=\$$ac_var
    +    case $ac_val in #(
    +    *${as_nl}*)
    +      case $ac_var in #(
    +      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
    +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
    +      esac
    +      case $ac_var in #(
    +      _ | IFS | as_nl) ;; #(
    +      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
    +      *) { eval $ac_var=; unset $ac_var;} ;;
    +      esac ;;
    +    esac
    +  done
    +  (set) 2>&1 |
    +    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
    +    *${as_nl}ac_space=\ *)
    +      sed -n \
    +	"s/'\''/'\''\\\\'\'''\''/g;
    +	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
    +      ;; #(
    +    *)
    +      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
    +      ;;
    +    esac |
    +    sort
    +)
    +    echo
    +
    +    printf "%s\n" "## ----------------- ##
    +## Output variables. ##
    +## ----------------- ##"
    +    echo
    +    for ac_var in $ac_subst_vars
    +    do
    +      eval ac_val=\$$ac_var
    +      case $ac_val in
    +      *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
    +      esac
    +      printf "%s\n" "$ac_var='\''$ac_val'\''"
    +    done | sort
    +    echo
    +
    +    if test -n "$ac_subst_files"; then
    +      printf "%s\n" "## ------------------- ##
    +## File substitutions. ##
    +## ------------------- ##"
    +      echo
    +      for ac_var in $ac_subst_files
    +      do
    +	eval ac_val=\$$ac_var
    +	case $ac_val in
    +	*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
    +	esac
    +	printf "%s\n" "$ac_var='\''$ac_val'\''"
    +      done | sort
    +      echo
    +    fi
    +
    +    if test -s confdefs.h; then
    +      printf "%s\n" "## ----------- ##
    +## confdefs.h. ##
    +## ----------- ##"
    +      echo
    +      cat confdefs.h
    +      echo
    +    fi
    +    test "$ac_signal" != 0 &&
    +      printf "%s\n" "$as_me: caught signal $ac_signal"
    +    printf "%s\n" "$as_me: exit $exit_status"
    +  } >&5
    +  rm -f core *.core core.conftest.* &&
    +    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
    +    exit $exit_status
    +' 0
    +for ac_signal in 1 2 13 15; do
    +  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
    +done
    +ac_signal=0
    +
    +# confdefs.h avoids OS command line length limits that DEFS can exceed.
    +rm -f -r conftest* confdefs.h
    +
    +printf "%s\n" "/* confdefs.h */" > confdefs.h
    +
    +# Predefined preprocessor variables.
    +
    +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
    +
    +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
    +
    +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
    +
    +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
    +
    +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
    +
    +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
    +
    +
    +# Let the site file select an alternate cache file if it wants to.
    +# Prefer an explicitly selected file to automatically selected ones.
    +if test -n "$CONFIG_SITE"; then
    +  ac_site_files="$CONFIG_SITE"
    +elif test "x$prefix" != xNONE; then
    +  ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
    +else
    +  ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
    +fi
    +
    +for ac_site_file in $ac_site_files
    +do
    +  case $ac_site_file in #(
    +  */*) :
    +     ;; #(
    +  *) :
    +    ac_site_file=./$ac_site_file ;;
    +esac
    +  if test -f "$ac_site_file" && test -r "$ac_site_file"; then
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
    +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
    +    sed 's/^/| /' "$ac_site_file" >&5
    +    . "$ac_site_file" \
    +      || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error $? "failed to load site script $ac_site_file
    +See \`config.log' for more details" "$LINENO" 5; }
    +  fi
    +done
    +
    +if test -r "$cache_file"; then
    +  # Some versions of bash will fail to source /dev/null (special files
    +  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
    +  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
    +printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
    +    case $cache_file in
    +      [\\/]* | ?:[\\/]* ) . "$cache_file";;
    +      *)                      . "./$cache_file";;
    +    esac
    +  fi
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
    +printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
    +  >$cache_file
    +fi
    +
    +# Test code for whether the C++ compiler supports C++98 (global declarations)
    +ac_cxx_conftest_cxx98_globals='
    +// Does the compiler advertise C++98 conformance?
    +#if !defined __cplusplus || __cplusplus < 199711L
    +# error "Compiler does not advertise C++98 conformance"
    +#endif
    +
    +// These inclusions are to reject old compilers that
    +// lack the unsuffixed header files.
    +#include 
    +#include 
    +
    +//  and  are *not* freestanding headers in C++98.
    +extern void assert (int);
    +namespace std {
    +  extern int strcmp (const char *, const char *);
    +}
    +
    +// Namespaces, exceptions, and templates were all added after "C++ 2.0".
    +using std::exception;
    +using std::strcmp;
    +
    +namespace {
    +
    +void test_exception_syntax()
    +{
    +  try {
    +    throw "test";
    +  } catch (const char *s) {
    +    // Extra parentheses suppress a warning when building autoconf itself,
    +    // due to lint rules shared with more typical C programs.
    +    assert (!(strcmp) (s, "test"));
    +  }
    +}
    +
    +template  struct test_template
    +{
    +  T const val;
    +  explicit test_template(T t) : val(t) {}
    +  template  T add(U u) { return static_cast(u) + val; }
    +};
    +
    +} // anonymous namespace
    +'
    +
    +# Test code for whether the C++ compiler supports C++98 (body of main)
    +ac_cxx_conftest_cxx98_main='
    +  assert (argc);
    +  assert (! argv[0]);
    +{
    +  test_exception_syntax ();
    +  test_template tt (2.0);
    +  assert (tt.add (4) == 6.0);
    +  assert (true && !false);
    +}
    +'
    +
    +# Test code for whether the C++ compiler supports C++11 (global declarations)
    +ac_cxx_conftest_cxx11_globals='
    +// Does the compiler advertise C++ 2011 conformance?
    +#if !defined __cplusplus || __cplusplus < 201103L
    +# error "Compiler does not advertise C++11 conformance"
    +#endif
    +
    +namespace cxx11test
    +{
    +  constexpr int get_val() { return 20; }
    +
    +  struct testinit
    +  {
    +    int i;
    +    double d;
    +  };
    +
    +  class delegate
    +  {
    +  public:
    +    delegate(int n) : n(n) {}
    +    delegate(): delegate(2354) {}
    +
    +    virtual int getval() { return this->n; };
    +  protected:
    +    int n;
    +  };
    +
    +  class overridden : public delegate
    +  {
    +  public:
    +    overridden(int n): delegate(n) {}
    +    virtual int getval() override final { return this->n * 2; }
    +  };
    +
    +  class nocopy
    +  {
    +  public:
    +    nocopy(int i): i(i) {}
    +    nocopy() = default;
    +    nocopy(const nocopy&) = delete;
    +    nocopy & operator=(const nocopy&) = delete;
    +  private:
    +    int i;
    +  };
    +
    +  // for testing lambda expressions
    +  template  Ret eval(Fn f, Ret v)
    +  {
    +    return f(v);
    +  }
    +
    +  // for testing variadic templates and trailing return types
    +  template  auto sum(V first) -> V
    +  {
    +    return first;
    +  }
    +  template  auto sum(V first, Args... rest) -> V
    +  {
    +    return first + sum(rest...);
    +  }
    +}
    +'
    +
    +# Test code for whether the C++ compiler supports C++11 (body of main)
    +ac_cxx_conftest_cxx11_main='
    +{
    +  // Test auto and decltype
    +  auto a1 = 6538;
    +  auto a2 = 48573953.4;
    +  auto a3 = "String literal";
    +
    +  int total = 0;
    +  for (auto i = a3; *i; ++i) { total += *i; }
    +
    +  decltype(a2) a4 = 34895.034;
    +}
    +{
    +  // Test constexpr
    +  short sa[cxx11test::get_val()] = { 0 };
    +}
    +{
    +  // Test initializer lists
    +  cxx11test::testinit il = { 4323, 435234.23544 };
    +}
    +{
    +  // Test range-based for
    +  int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
    +                 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
    +  for (auto &x : array) { x += 23; }
    +}
    +{
    +  // Test lambda expressions
    +  using cxx11test::eval;
    +  assert (eval ([](int x) { return x*2; }, 21) == 42);
    +  double d = 2.0;
    +  assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
    +  assert (d == 5.0);
    +  assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
    +  assert (d == 5.0);
    +}
    +{
    +  // Test use of variadic templates
    +  using cxx11test::sum;
    +  auto a = sum(1);
    +  auto b = sum(1, 2);
    +  auto c = sum(1.0, 2.0, 3.0);
    +}
    +{
    +  // Test constructor delegation
    +  cxx11test::delegate d1;
    +  cxx11test::delegate d2();
    +  cxx11test::delegate d3(45);
    +}
    +{
    +  // Test override and final
    +  cxx11test::overridden o1(55464);
    +}
    +{
    +  // Test nullptr
    +  char *c = nullptr;
    +}
    +{
    +  // Test template brackets
    +  test_template<::test_template> v(test_template(12));
    +}
    +{
    +  // Unicode literals
    +  char const *utf8 = u8"UTF-8 string \u2500";
    +  char16_t const *utf16 = u"UTF-8 string \u2500";
    +  char32_t const *utf32 = U"UTF-32 string \u2500";
    +}
    +'
    +
    +# Test code for whether the C compiler supports C++11 (complete).
    +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
    +${ac_cxx_conftest_cxx11_globals}
    +
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_cxx_conftest_cxx98_main}
    +  ${ac_cxx_conftest_cxx11_main}
    +  return ok;
    +}
    +"
    +
    +# Test code for whether the C compiler supports C++98 (complete).
    +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_cxx_conftest_cxx98_main}
    +  return ok;
    +}
    +"
    +
    +# Test code for whether the C compiler supports C89 (global declarations)
    +ac_c_conftest_c89_globals='
    +/* Does the compiler advertise C89 conformance?
    +   Do not test the value of __STDC__, because some compilers set it to 0
    +   while being otherwise adequately conformant. */
    +#if !defined __STDC__
    +# error "Compiler does not advertise C89 conformance"
    +#endif
    +
    +#include 
    +#include 
    +struct stat;
    +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */
    +struct buf { int x; };
    +struct buf * (*rcsopen) (struct buf *, struct stat *, int);
    +static char *e (p, i)
    +     char **p;
    +     int i;
    +{
    +  return p[i];
    +}
    +static char *f (char * (*g) (char **, int), char **p, ...)
    +{
    +  char *s;
    +  va_list v;
    +  va_start (v,p);
    +  s = g (p, va_arg (v,int));
    +  va_end (v);
    +  return s;
    +}
    +
    +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    +   function prototypes and stuff, but not \xHH hex character constants.
    +   These do not provoke an error unfortunately, instead are silently treated
    +   as an "x".  The following induces an error, until -std is added to get
    +   proper ANSI mode.  Curiously \x00 != x always comes out true, for an
    +   array size at least.  It is necessary to write \x00 == 0 to get something
    +   that is true only with -std.  */
    +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
    +
    +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
    +   inside strings and character constants.  */
    +#define FOO(x) '\''x'\''
    +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
    +
    +int test (int i, double x);
    +struct s1 {int (*f) (int a);};
    +struct s2 {int (*f) (double a);};
    +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
    +               int, int);'
    +
    +# Test code for whether the C compiler supports C89 (body of main).
    +ac_c_conftest_c89_main='
    +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
    +'
    +
    +# Test code for whether the C compiler supports C99 (global declarations)
    +ac_c_conftest_c99_globals='
    +// Does the compiler advertise C99 conformance?
    +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
    +# error "Compiler does not advertise C99 conformance"
    +#endif
    +
    +#include 
    +extern int puts (const char *);
    +extern int printf (const char *, ...);
    +extern int dprintf (int, const char *, ...);
    +extern void *malloc (size_t);
    +
    +// Check varargs macros.  These examples are taken from C99 6.10.3.5.
    +// dprintf is used instead of fprintf to avoid needing to declare
    +// FILE and stderr.
    +#define debug(...) dprintf (2, __VA_ARGS__)
    +#define showlist(...) puts (#__VA_ARGS__)
    +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
    +static void
    +test_varargs_macros (void)
    +{
    +  int x = 1234;
    +  int y = 5678;
    +  debug ("Flag");
    +  debug ("X = %d\n", x);
    +  showlist (The first, second, and third items.);
    +  report (x>y, "x is %d but y is %d", x, y);
    +}
    +
    +// Check long long types.
    +#define BIG64 18446744073709551615ull
    +#define BIG32 4294967295ul
    +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
    +#if !BIG_OK
    +  #error "your preprocessor is broken"
    +#endif
    +#if BIG_OK
    +#else
    +  #error "your preprocessor is broken"
    +#endif
    +static long long int bignum = -9223372036854775807LL;
    +static unsigned long long int ubignum = BIG64;
    +
    +struct incomplete_array
    +{
    +  int datasize;
    +  double data[];
    +};
    +
    +struct named_init {
    +  int number;
    +  const wchar_t *name;
    +  double average;
    +};
    +
    +typedef const char *ccp;
    +
    +static inline int
    +test_restrict (ccp restrict text)
    +{
    +  // See if C++-style comments work.
    +  // Iterate through items via the restricted pointer.
    +  // Also check for declarations in for loops.
    +  for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
    +    continue;
    +  return 0;
    +}
    +
    +// Check varargs and va_copy.
    +static bool
    +test_varargs (const char *format, ...)
    +{
    +  va_list args;
    +  va_start (args, format);
    +  va_list args_copy;
    +  va_copy (args_copy, args);
    +
    +  const char *str = "";
    +  int number = 0;
    +  float fnumber = 0;
    +
    +  while (*format)
    +    {
    +      switch (*format++)
    +	{
    +	case '\''s'\'': // string
    +	  str = va_arg (args_copy, const char *);
    +	  break;
    +	case '\''d'\'': // int
    +	  number = va_arg (args_copy, int);
    +	  break;
    +	case '\''f'\'': // float
    +	  fnumber = va_arg (args_copy, double);
    +	  break;
    +	default:
    +	  break;
    +	}
    +    }
    +  va_end (args_copy);
    +  va_end (args);
    +
    +  return *str && number && fnumber;
    +}
    +'
    +
    +# Test code for whether the C compiler supports C99 (body of main).
    +ac_c_conftest_c99_main='
    +  // Check bool.
    +  _Bool success = false;
    +  success |= (argc != 0);
    +
    +  // Check restrict.
    +  if (test_restrict ("String literal") == 0)
    +    success = true;
    +  char *restrict newvar = "Another string";
    +
    +  // Check varargs.
    +  success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
    +  test_varargs_macros ();
    +
    +  // Check flexible array members.
    +  struct incomplete_array *ia =
    +    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
    +  ia->datasize = 10;
    +  for (int i = 0; i < ia->datasize; ++i)
    +    ia->data[i] = i * 1.234;
    +
    +  // Check named initializers.
    +  struct named_init ni = {
    +    .number = 34,
    +    .name = L"Test wide string",
    +    .average = 543.34343,
    +  };
    +
    +  ni.number = 58;
    +
    +  int dynamic_array[ni.number];
    +  dynamic_array[0] = argv[0][0];
    +  dynamic_array[ni.number - 1] = 543;
    +
    +  // work around unused variable warnings
    +  ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
    +	 || dynamic_array[ni.number - 1] != 543);
    +'
    +
    +# Test code for whether the C compiler supports C11 (global declarations)
    +ac_c_conftest_c11_globals='
    +// Does the compiler advertise C11 conformance?
    +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
    +# error "Compiler does not advertise C11 conformance"
    +#endif
    +
    +// Check _Alignas.
    +char _Alignas (double) aligned_as_double;
    +char _Alignas (0) no_special_alignment;
    +extern char aligned_as_int;
    +char _Alignas (0) _Alignas (int) aligned_as_int;
    +
    +// Check _Alignof.
    +enum
    +{
    +  int_alignment = _Alignof (int),
    +  int_array_alignment = _Alignof (int[100]),
    +  char_alignment = _Alignof (char)
    +};
    +_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
    +
    +// Check _Noreturn.
    +int _Noreturn does_not_return (void) { for (;;) continue; }
    +
    +// Check _Static_assert.
    +struct test_static_assert
    +{
    +  int x;
    +  _Static_assert (sizeof (int) <= sizeof (long int),
    +                  "_Static_assert does not work in struct");
    +  long int y;
    +};
    +
    +// Check UTF-8 literals.
    +#define u8 syntax error!
    +char const utf8_literal[] = u8"happens to be ASCII" "another string";
    +
    +// Check duplicate typedefs.
    +typedef long *long_ptr;
    +typedef long int *long_ptr;
    +typedef long_ptr long_ptr;
    +
    +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
    +struct anonymous
    +{
    +  union {
    +    struct { int i; int j; };
    +    struct { int k; long int l; } w;
    +  };
    +  int m;
    +} v1;
    +'
    +
    +# Test code for whether the C compiler supports C11 (body of main).
    +ac_c_conftest_c11_main='
    +  _Static_assert ((offsetof (struct anonymous, i)
    +		   == offsetof (struct anonymous, w.k)),
    +		  "Anonymous union alignment botch");
    +  v1.i = 2;
    +  v1.w.k = 5;
    +  ok |= v1.i != 5;
    +'
    +
    +# Test code for whether the C compiler supports C11 (complete).
    +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
    +${ac_c_conftest_c99_globals}
    +${ac_c_conftest_c11_globals}
    +
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_c_conftest_c89_main}
    +  ${ac_c_conftest_c99_main}
    +  ${ac_c_conftest_c11_main}
    +  return ok;
    +}
    +"
    +
    +# Test code for whether the C compiler supports C99 (complete).
    +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
    +${ac_c_conftest_c99_globals}
    +
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_c_conftest_c89_main}
    +  ${ac_c_conftest_c99_main}
    +  return ok;
    +}
    +"
    +
    +# Test code for whether the C compiler supports C89 (complete).
    +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
    +
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_c_conftest_c89_main}
    +  return ok;
    +}
    +"
    +
    +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
    +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
    +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
    +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
    +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
    +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
    +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
    +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
    +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
    +
    +# Auxiliary files required by this configure script.
    +ac_aux_files="config.guess config.sub"
    +
    +# Locations in which to look for auxiliary files.
    +ac_aux_dir_candidates="${srcdir}/shared"
    +
    +# Search for a directory containing all of the required auxiliary files,
    +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
    +# If we don't find one directory that contains all the files we need,
    +# we report the set of missing files from the *first* directory in
    +# $ac_aux_dir_candidates and give up.
    +ac_missing_aux_files=""
    +ac_first_candidate=:
    +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +as_found=false
    +for as_dir in $ac_aux_dir_candidates
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +  as_found=:
    +
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}:  trying $as_dir" >&5
    +  ac_aux_dir_found=yes
    +  ac_install_sh=
    +  for ac_aux in $ac_aux_files
    +  do
    +    # As a special case, if "install-sh" is required, that requirement
    +    # can be satisfied by any of "install-sh", "install.sh", or "shtool",
    +    # and $ac_install_sh is set appropriately for whichever one is found.
    +    if test x"$ac_aux" = x"install-sh"
    +    then
    +      if test -f "${as_dir}install-sh"; then
    +        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}install-sh found" >&5
    +        ac_install_sh="${as_dir}install-sh -c"
    +      elif test -f "${as_dir}install.sh"; then
    +        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}install.sh found" >&5
    +        ac_install_sh="${as_dir}install.sh -c"
    +      elif test -f "${as_dir}shtool"; then
    +        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}shtool found" >&5
    +        ac_install_sh="${as_dir}shtool install -c"
    +      else
    +        ac_aux_dir_found=no
    +        if $ac_first_candidate; then
    +          ac_missing_aux_files="${ac_missing_aux_files} install-sh"
    +        else
    +          break
    +        fi
    +      fi
    +    else
    +      if test -f "${as_dir}${ac_aux}"; then
    +        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}${ac_aux} found" >&5
    +      else
    +        ac_aux_dir_found=no
    +        if $ac_first_candidate; then
    +          ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
    +        else
    +          break
    +        fi
    +      fi
    +    fi
    +  done
    +  if test "$ac_aux_dir_found" = yes; then
    +    ac_aux_dir="$as_dir"
    +    break
    +  fi
    +  ac_first_candidate=false
    +
    +  as_found=false
    +done
    +IFS=$as_save_IFS
    +if $as_found
    +then :
    +
    +else $as_nop
    +  as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
    +fi
    +
    +
    +# These three variables are undocumented and unsupported,
    +# and are intended to be withdrawn in a future Autoconf release.
    +# They can cause serious problems if a builder's source tree is in a directory
    +# whose full name contains unusual characters.
    +if test -f "${ac_aux_dir}config.guess"; then
    +  ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
    +fi
    +if test -f "${ac_aux_dir}config.sub"; then
    +  ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
    +fi
    +if test -f "$ac_aux_dir/configure"; then
    +  ac_configure="$SHELL ${ac_aux_dir}configure"
    +fi
    +
    +# Check that the precious variables saved in the cache have kept the same
    +# value.
    +ac_cache_corrupted=false
    +for ac_var in $ac_precious_vars; do
    +  eval ac_old_set=\$ac_cv_env_${ac_var}_set
    +  eval ac_new_set=\$ac_env_${ac_var}_set
    +  eval ac_old_val=\$ac_cv_env_${ac_var}_value
    +  eval ac_new_val=\$ac_env_${ac_var}_value
    +  case $ac_old_set,$ac_new_set in
    +    set,)
    +      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
    +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
    +      ac_cache_corrupted=: ;;
    +    ,set)
    +      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
    +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
    +      ac_cache_corrupted=: ;;
    +    ,);;
    +    *)
    +      if test "x$ac_old_val" != "x$ac_new_val"; then
    +	# differences in whitespace do not lead to failure.
    +	ac_old_val_w=`echo x $ac_old_val`
    +	ac_new_val_w=`echo x $ac_new_val`
    +	if test "$ac_old_val_w" != "$ac_new_val_w"; then
    +	  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
    +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
    +	  ac_cache_corrupted=:
    +	else
    +	  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
    +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
    +	  eval $ac_var=\$ac_old_val
    +	fi
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
    +printf "%s\n" "$as_me:   former value:  \`$ac_old_val'" >&2;}
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
    +printf "%s\n" "$as_me:   current value: \`$ac_new_val'" >&2;}
    +      fi;;
    +  esac
    +  # Pass precious variables to config.status.
    +  if test "$ac_new_set" = set; then
    +    case $ac_new_val in
    +    *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
    +    *) ac_arg=$ac_var=$ac_new_val ;;
    +    esac
    +    case " $ac_configure_args " in
    +      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
    +      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
    +    esac
    +  fi
    +done
    +if $ac_cache_corrupted; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
    +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
    +  as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
    +	    and start over" "$LINENO" 5
    +fi
    +## -------------------- ##
    +## Main body of script. ##
    +## -------------------- ##
    +
    +ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +
    +# Pick up Conda env or virtualenv
    +
    +    if test "x$VIRTUAL_ENV" != x
    +then :
    +
    +        CFLAGS="$CFLAGS -I${VIRTUAL_ENV}/include"
    +        CXXFLAGS="$CXXFLAGS -I${VIRTUAL_ENV}/include"
    +        FFLAGS="$FFLAGS -I${VIRTUAL_ENV}/include"
    +        FCFLAGS="$FCFLAGS -I${VIRTUAL_ENV}/include"
    +        LDFLAGS="$LDFLAGS -L${VIRTUAL_ENV}/lib -Wl,-rpath,${VIRTUAL_ENV}/lib"
    +        PKG_CONFIG_PATH="$VIRTUAL_ENV/lib/pkgconfig:$PKG_CONFIG_PATH"
    +
    +fi
    +
    +    if test "x$CONDA_PREFIX" != x
    +then :
    +
    +        # Conda does not set FCFLAGS, so we copy from FFLAGS here
    +        FCFLAGS="$FFLAGS"
    +        LDFLAGS="$LDFLAGS -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib"
    +        # Conda pkg-config includes this already, but in case we have one from
    +        # the system...
    +        PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${CONDA_PREFIX}/lib/pkgconfig"
    +
    +fi
    +    # Needs to be exported or the PKG_CHECK_MODULES macro won't see it
    +    export PKG_CONFIG_PATH
    +
    +
    +
    +# Set CPU_COUNT
    +
    +
    +
    +  # Make sure we can run config.sub.
    +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
    +  as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
    +printf %s "checking build system type... " >&6; }
    +if test ${ac_cv_build+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_build_alias=$build_alias
    +test "x$ac_build_alias" = x &&
    +  ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
    +test "x$ac_build_alias" = x &&
    +  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
    +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
    +  as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
    +printf "%s\n" "$ac_cv_build" >&6; }
    +case $ac_cv_build in
    +*-*-*) ;;
    +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
    +esac
    +build=$ac_cv_build
    +ac_save_IFS=$IFS; IFS='-'
    +set x $ac_cv_build
    +shift
    +build_cpu=$1
    +build_vendor=$2
    +shift; shift
    +# Remember, the first character of IFS is used to create $*,
    +# except with old shells:
    +build_os=$*
    +IFS=$ac_save_IFS
    +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
    +
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
    +printf %s "checking host system type... " >&6; }
    +if test ${ac_cv_host+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test "x$host_alias" = x; then
    +  ac_cv_host=$ac_cv_build
    +else
    +  ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
    +    as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
    +fi
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
    +printf "%s\n" "$ac_cv_host" >&6; }
    +case $ac_cv_host in
    +*-*-*) ;;
    +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
    +esac
    +host=$ac_cv_host
    +ac_save_IFS=$IFS; IFS='-'
    +set x $ac_cv_host
    +shift
    +host_cpu=$1
    +host_vendor=$2
    +shift; shift
    +# Remember, the first character of IFS is used to create $*,
    +# except with old shells:
    +host_os=$*
    +IFS=$ac_save_IFS
    +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
    +
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
    +printf %s "checking for grep that handles long lines and -e... " >&6; }
    +if test ${ac_cv_path_GREP+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -z "$GREP"; then
    +  ac_path_GREP_found=false
    +  # Loop through the user's path and test for each of PROGNAME-LIST
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_prog in grep ggrep
    +   do
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +      ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
    +      as_fn_executable_p "$ac_path_GREP" || continue
    +# Check for GNU ac_path_GREP and select it if it is found.
    +  # Check for GNU $ac_path_GREP
    +case `"$ac_path_GREP" --version 2>&1` in
    +*GNU*)
    +  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
    +*)
    +  ac_count=0
    +  printf %s 0123456789 >"conftest.in"
    +  while :
    +  do
    +    cat "conftest.in" "conftest.in" >"conftest.tmp"
    +    mv "conftest.tmp" "conftest.in"
    +    cp "conftest.in" "conftest.nl"
    +    printf "%s\n" 'GREP' >> "conftest.nl"
    +    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    +    as_fn_arith $ac_count + 1 && ac_count=$as_val
    +    if test $ac_count -gt ${ac_path_GREP_max-0}; then
    +      # Best one so far, save it but keep looking for a better one
    +      ac_cv_path_GREP="$ac_path_GREP"
    +      ac_path_GREP_max=$ac_count
    +    fi
    +    # 10*(2^10) chars as input seems more than enough
    +    test $ac_count -gt 10 && break
    +  done
    +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
    +esac
    +
    +      $ac_path_GREP_found && break 3
    +    done
    +  done
    +  done
    +IFS=$as_save_IFS
    +  if test -z "$ac_cv_path_GREP"; then
    +    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
    +  fi
    +else
    +  ac_cv_path_GREP=$GREP
    +fi
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
    +printf "%s\n" "$ac_cv_path_GREP" >&6; }
    + GREP="$ac_cv_path_GREP"
    +
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
    +printf %s "checking for egrep... " >&6; }
    +if test ${ac_cv_path_EGREP+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    +   then ac_cv_path_EGREP="$GREP -E"
    +   else
    +     if test -z "$EGREP"; then
    +  ac_path_EGREP_found=false
    +  # Loop through the user's path and test for each of PROGNAME-LIST
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_prog in egrep
    +   do
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +      ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
    +      as_fn_executable_p "$ac_path_EGREP" || continue
    +# Check for GNU ac_path_EGREP and select it if it is found.
    +  # Check for GNU $ac_path_EGREP
    +case `"$ac_path_EGREP" --version 2>&1` in
    +*GNU*)
    +  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
    +*)
    +  ac_count=0
    +  printf %s 0123456789 >"conftest.in"
    +  while :
    +  do
    +    cat "conftest.in" "conftest.in" >"conftest.tmp"
    +    mv "conftest.tmp" "conftest.in"
    +    cp "conftest.in" "conftest.nl"
    +    printf "%s\n" 'EGREP' >> "conftest.nl"
    +    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    +    as_fn_arith $ac_count + 1 && ac_count=$as_val
    +    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
    +      # Best one so far, save it but keep looking for a better one
    +      ac_cv_path_EGREP="$ac_path_EGREP"
    +      ac_path_EGREP_max=$ac_count
    +    fi
    +    # 10*(2^10) chars as input seems more than enough
    +    test $ac_count -gt 10 && break
    +  done
    +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
    +esac
    +
    +      $ac_path_EGREP_found && break 3
    +    done
    +  done
    +  done
    +IFS=$as_save_IFS
    +  if test -z "$ac_cv_path_EGREP"; then
    +    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
    +  fi
    +else
    +  ac_cv_path_EGREP=$EGREP
    +fi
    +
    +   fi
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
    +printf "%s\n" "$ac_cv_path_EGREP" >&6; }
    + EGREP="$ac_cv_path_EGREP"
    +
    +
    +                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the number of available CPUs" >&5
    +printf %s "checking the number of available CPUs... " >&6; }
    +      CPU_COUNT="0"
    +
    +      # Try generic methods
    +
    +      # 'getconf' is POSIX utility, but '_NPROCESSORS_ONLN' and
    +      # 'NPROCESSORS_ONLN' are platform-specific
    +      command -v getconf >/dev/null 2>&1 && \
    +        CPU_COUNT=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null` || CPU_COUNT="0"
    +      if test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v nproc >/dev/null 2>&1
    +then :
    +  : # empty
    +else $as_nop
    +          # 'nproc' is part of GNU Coreutils and is widely available
    +        CPU_COUNT=`OMP_NUM_THREADS='' nproc 2>/dev/null` || CPU_COUNT=`nproc 2>/dev/null` || CPU_COUNT="0"
    +
    +fi
    +      if test "$CPU_COUNT" -gt "0" 2>/dev/null
    +then :
    +  : # empty
    +else $as_nop
    +          # Try platform-specific preferred methods
    +        case $host_os in #(
    +            *linux*) :
    +    CPU_COUNT=`lscpu -p 2>/dev/null | $EGREP -e '^[0-9]+,' -c` || CPU_COUNT="0" ;; #(
    +            *darwin*) :
    +    CPU_COUNT=`sysctl -n hw.logicalcpu 2>/dev/null` || CPU_COUNT="0" ;; #(
    +            freebsd*) :
    +    command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n kern.smp.cpus 2>/dev/null` || CPU_COUNT="0" ;; #(
    +            netbsd*) :
    +    command -v sysctl >/dev/null 2>&1 && CPU_COUNT=`sysctl -n hw.ncpuonline 2>/dev/null` || CPU_COUNT="0" ;; #(
    +            solaris*) :
    +    command -v psrinfo >/dev/null 2>&1 && CPU_COUNT=`psrinfo 2>/dev/null | $EGREP -e '^[0-9].*on-line' -c 2>/dev/null` || CPU_COUNT="0" ;; #(
    +            mingw*) :
    +    CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^[0-9]+/' -c` || CPU_COUNT="0" ;; #(
    +            msys*) :
    +    CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^[0-9]+/' -c` || CPU_COUNT="0" ;; #(
    +            cygwin*) :
    +    CPU_COUNT=`ls -qpU1 /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor/ 2>/dev/null | $EGREP -e '^[0-9]+/' -c` || CPU_COUNT="0"         ;; #(
    +  *) :
    +     ;;
    +esac
    +fi
    +      if test "$CPU_COUNT" -gt "0" 2>/dev/null || ! command -v sysctl >/dev/null 2>&1
    +then :
    +  : # empty
    +else $as_nop
    +          # Try less preferred generic method
    +        # 'hw.ncpu' exist on many platforms, but not on GNU/Linux
    +        CPU_COUNT=`sysctl -n hw.ncpu 2>/dev/null` || CPU_COUNT="0"
    +
    +fi
    +      if test "$CPU_COUNT" -gt "0" 2>/dev/null
    +then :
    +  : # empty
    +else $as_nop
    +        # Try platform-specific fallback methods
    +      # They can be less accurate and slower then preferred methods
    +        case $host_os in #(
    +            *linux*) :
    +    CPU_COUNT=`$EGREP -e '^processor' -c /proc/cpuinfo 2>/dev/null` || CPU_COUNT="0" ;; #(
    +            *darwin*) :
    +    CPU_COUNT=`system_profiler SPHardwareDataType 2>/dev/null | $EGREP -i -e 'number of cores:'|cut -d : -f 2 -s|tr -d ' '` || CPU_COUNT="0" ;; #(
    +            freebsd*) :
    +    CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu[0-9]+: '|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0" ;; #(
    +            netbsd*) :
    +    CPU_COUNT=`command -v cpuctl >/dev/null 2>&1 && cpuctl list 2>/dev/null| $EGREP -e '^[0-9]+ .* online ' -c` || \
    +                           CPU_COUNT=`dmesg 2>/dev/null| $EGREP -e '^cpu[0-9]+ at'|sort -u|$EGREP -e '^' -c` || CPU_COUNT="0" ;; #(
    +            solaris*) :
    +    command -v kstat >/dev/null 2>&1 && CPU_COUNT=`kstat -m cpu_info -s state -p 2>/dev/null | $EGREP -c -e 'on-line'` || \
    +                           CPU_COUNT=`kstat -m cpu_info 2>/dev/null | $EGREP -c -e 'module: cpu_info'` || CPU_COUNT="0" ;; #(
    +            mingw*) :
    +    if CPU_COUNT=`reg query 'HKLM\\Hardware\\Description\\System\\CentralProcessor' 2>/dev/null | $EGREP -e '\\\\[0-9]+$' -c`
    +then :
    +                          : # empty
    +else $as_nop
    +  test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"
    +fi ;; #(
    +            msys*) :
    +    test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS" ;; #(
    +            cygwin*) :
    +    test "$NUMBER_OF_PROCESSORS" -gt "0" 2>/dev/null && CPU_COUNT="$NUMBER_OF_PROCESSORS"         ;; #(
    +  *) :
    +     ;;
    +esac
    +fi
    +      if test "x$CPU_COUNT" != "x0" && test "$CPU_COUNT" -gt 0 2>/dev/null
    +then :
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPU_COUNT" >&5
    +printf "%s\n" "$CPU_COUNT" >&6; }
    +
    +else $as_nop
    +                        CPU_COUNT="1"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unable to detect (assuming 1)" >&5
    +printf "%s\n" "unable to detect (assuming 1)" >&6; }
    +
    +fi
    +
    +
    +# Find the compiler(s)
    +
    +
    +
    +
    +
    +
    +ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +if test -z "$CXX"; then
    +  if test -n "$CCC"; then
    +    CXX=$CCC
    +  else
    +    if test -n "$ac_tool_prefix"; then
    +  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
    +  do
    +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CXX+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CXX"; then
    +  ac_cv_prog_CXX="$CXX" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CXX=$ac_cv_prog_CXX
    +if test -n "$CXX"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
    +printf "%s\n" "$CXX" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +    test -n "$CXX" && break
    +  done
    +fi
    +if test -z "$CXX"; then
    +  ac_ct_CXX=$CXX
    +  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_CXX+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_CXX"; then
    +  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_CXX="$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
    +if test -n "$ac_ct_CXX"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
    +printf "%s\n" "$ac_ct_CXX" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$ac_ct_CXX" && break
    +done
    +
    +  if test "x$ac_ct_CXX" = x; then
    +    CXX="g++"
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    CXX=$ac_ct_CXX
    +  fi
    +fi
    +
    +  fi
    +fi
    +# Provide some information about the compiler.
    +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
    +set X $ac_compile
    +ac_compiler=$2
    +for ac_option in --version -v -V -qversion; do
    +  { { ac_try="$ac_compiler $ac_option >&5"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    sed '10a\
    +... rest of stderr output deleted ...
    +         10q' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +  fi
    +  rm -f conftest.er1 conftest.err
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +done
    +
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +ac_clean_files_save=$ac_clean_files
    +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
    +# Try to create an executable without -o first, disregard a.out.
    +# It will help us diagnose broken compilers, and finding out an intuition
    +# of exeext.
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
    +printf %s "checking whether the C++ compiler works... " >&6; }
    +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
    +
    +# The possible output files:
    +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
    +
    +ac_rmfiles=
    +for ac_file in $ac_files
    +do
    +  case $ac_file in
    +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    +    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
    +  esac
    +done
    +rm -f $ac_rmfiles
    +
    +if { { ac_try="$ac_link_default"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link_default") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +then :
    +  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
    +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
    +# in a Makefile.  We should not override ac_cv_exeext if it was cached,
    +# so that the user can short-circuit this test for compilers unknown to
    +# Autoconf.
    +for ac_file in $ac_files ''
    +do
    +  test -f "$ac_file" || continue
    +  case $ac_file in
    +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
    +	;;
    +    [ab].out )
    +	# We found the default executable, but exeext='' is most
    +	# certainly right.
    +	break;;
    +    *.* )
    +	if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
    +	then :; else
    +	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
    +	fi
    +	# We set ac_cv_exeext here because the later test for it is not
    +	# safe: cross compilers may not add the suffix if given an `-o'
    +	# argument, so we may need to know it at that point already.
    +	# Even if this section looks crufty: it has the advantage of
    +	# actually working.
    +	break;;
    +    * )
    +	break;;
    +  esac
    +done
    +test "$ac_cv_exeext" = no && ac_cv_exeext=
    +
    +else $as_nop
    +  ac_file=''
    +fi
    +if test -z "$ac_file"
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error 77 "C++ compiler cannot create executables
    +See \`config.log' for more details" "$LINENO" 5; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
    +printf %s "checking for C++ compiler default output file name... " >&6; }
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
    +printf "%s\n" "$ac_file" >&6; }
    +ac_exeext=$ac_cv_exeext
    +
    +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
    +ac_clean_files=$ac_clean_files_save
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
    +printf %s "checking for suffix of executables... " >&6; }
    +if { { ac_try="$ac_link"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +then :
    +  # If both `conftest.exe' and `conftest' are `present' (well, observable)
    +# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
    +# work properly (i.e., refer to `conftest.exe'), while it won't with
    +# `rm'.
    +for ac_file in conftest.exe conftest conftest.*; do
    +  test -f "$ac_file" || continue
    +  case $ac_file in
    +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    +    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
    +	  break;;
    +    * ) break;;
    +  esac
    +done
    +else $as_nop
    +  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error $? "cannot compute suffix of executables: cannot compile and link
    +See \`config.log' for more details" "$LINENO" 5; }
    +fi
    +rm -f conftest conftest$ac_cv_exeext
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
    +printf "%s\n" "$ac_cv_exeext" >&6; }
    +
    +rm -f conftest.$ac_ext
    +EXEEXT=$ac_cv_exeext
    +ac_exeext=$EXEEXT
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +#include 
    +int
    +main (void)
    +{
    +FILE *f = fopen ("conftest.out", "w");
    + return ferror (f) || fclose (f) != 0;
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +ac_clean_files="$ac_clean_files conftest.out"
    +# Check that the compiler produces executables we can run.  If not, either
    +# the compiler is broken, or we cross compile.
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
    +printf %s "checking whether we are cross compiling... " >&6; }
    +if test "$cross_compiling" != yes; then
    +  { { ac_try="$ac_link"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +  if { ac_try='./conftest$ac_cv_exeext'
    +  { { case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_try") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; }; then
    +    cross_compiling=no
    +  else
    +    if test "$cross_compiling" = maybe; then
    +	cross_compiling=yes
    +    else
    +	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error 77 "cannot run C++ compiled programs.
    +If you meant to cross compile, use \`--host'.
    +See \`config.log' for more details" "$LINENO" 5; }
    +    fi
    +  fi
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
    +printf "%s\n" "$cross_compiling" >&6; }
    +
    +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
    +ac_clean_files=$ac_clean_files_save
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
    +printf %s "checking for suffix of object files... " >&6; }
    +if test ${ac_cv_objext+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +rm -f conftest.o conftest.obj
    +if { { ac_try="$ac_compile"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compile") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +then :
    +  for ac_file in conftest.o conftest.obj conftest.*; do
    +  test -f "$ac_file" || continue;
    +  case $ac_file in
    +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
    +    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
    +       break;;
    +  esac
    +done
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error $? "cannot compute suffix of object files: cannot compile
    +See \`config.log' for more details" "$LINENO" 5; }
    +fi
    +rm -f conftest.$ac_cv_objext conftest.$ac_ext
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
    +printf "%s\n" "$ac_cv_objext" >&6; }
    +OBJEXT=$ac_cv_objext
    +ac_objext=$OBJEXT
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
    +printf %s "checking whether the compiler supports GNU C++... " >&6; }
    +if test ${ac_cv_cxx_compiler_gnu+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +#ifndef __GNUC__
    +       choke me
    +#endif
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_compiler_gnu=yes
    +else $as_nop
    +  ac_compiler_gnu=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
    +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +if test $ac_compiler_gnu = yes; then
    +  GXX=yes
    +else
    +  GXX=
    +fi
    +ac_test_CXXFLAGS=${CXXFLAGS+y}
    +ac_save_CXXFLAGS=$CXXFLAGS
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
    +printf %s "checking whether $CXX accepts -g... " >&6; }
    +if test ${ac_cv_prog_cxx_g+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    +   ac_cxx_werror_flag=yes
    +   ac_cv_prog_cxx_g=no
    +   CXXFLAGS="-g"
    +   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_g=yes
    +else $as_nop
    +  CXXFLAGS=""
    +      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +
    +else $as_nop
    +  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
    +	 CXXFLAGS="-g"
    +	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_g=yes
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
    +if test $ac_test_CXXFLAGS; then
    +  CXXFLAGS=$ac_save_CXXFLAGS
    +elif test $ac_cv_prog_cxx_g = yes; then
    +  if test "$GXX" = yes; then
    +    CXXFLAGS="-g -O2"
    +  else
    +    CXXFLAGS="-g"
    +  fi
    +else
    +  if test "$GXX" = yes; then
    +    CXXFLAGS="-O2"
    +  else
    +    CXXFLAGS=
    +  fi
    +fi
    +ac_prog_cxx_stdcxx=no
    +if test x$ac_prog_cxx_stdcxx = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
    +printf %s "checking for $CXX option to enable C++11 features... " >&6; }
    +if test ${ac_cv_prog_cxx_11+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cxx_11=no
    +ac_save_CXX=$CXX
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_cxx_conftest_cxx11_program
    +_ACEOF
    +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
    +do
    +  CXX="$ac_save_CXX $ac_arg"
    +  if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_cxx11=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CXX=$ac_save_CXX
    +fi
    +
    +if test "x$ac_cv_prog_cxx_cxx11" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cxx_cxx11" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
    +     CXX="$CXX $ac_cv_prog_cxx_cxx11"
    +fi
    +  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
    +  ac_prog_cxx_stdcxx=cxx11
    +fi
    +fi
    +if test x$ac_prog_cxx_stdcxx = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
    +printf %s "checking for $CXX option to enable C++98 features... " >&6; }
    +if test ${ac_cv_prog_cxx_98+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cxx_98=no
    +ac_save_CXX=$CXX
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_cxx_conftest_cxx98_program
    +_ACEOF
    +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
    +do
    +  CXX="$ac_save_CXX $ac_arg"
    +  if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_cxx98=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CXX=$ac_save_CXX
    +fi
    +
    +if test "x$ac_cv_prog_cxx_cxx98" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cxx_cxx98" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
    +     CXX="$CXX $ac_cv_prog_cxx_cxx98"
    +fi
    +  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
    +  ac_prog_cxx_stdcxx=cxx98
    +fi
    +fi
    +
    +ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +# Find tools for creating static libraries
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
    +printf %s "checking target system type... " >&6; }
    +if test ${ac_cv_target+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test "x$target_alias" = x; then
    +  ac_cv_target=$ac_cv_host
    +else
    +  ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` ||
    +    as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5
    +fi
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
    +printf "%s\n" "$ac_cv_target" >&6; }
    +case $ac_cv_target in
    +*-*-*) ;;
    +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
    +esac
    +target=$ac_cv_target
    +ac_save_IFS=$IFS; IFS='-'
    +set x $ac_cv_target
    +shift
    +target_cpu=$1
    +target_vendor=$2
    +shift; shift
    +# Remember, the first character of IFS is used to create $*,
    +# except with old shells:
    +target_os=$*
    +IFS=$ac_save_IFS
    +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
    +
    +
    +# The aliases save the names the user supplied, while $host etc.
    +# will get canonicalized.
    +test -n "$target_alias" &&
    +  test "$program_prefix$program_suffix$program_transform_name" = \
    +    NONENONEs,x,x, &&
    +  program_prefix=${target_alias}-
    +# Extract the first word of "$target_alias-ar", so it can be a program name with args.
    +set dummy $target_alias-ar; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_AR+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$AR"; then
    +  ac_cv_prog_AR="$AR" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_AR="$target_alias-ar"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +AR=$ac_cv_prog_AR
    +if test -n "$AR"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
    +printf "%s\n" "$AR" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +if test -z "$ac_cv_prog_AR"; then
    +  if test "$build" = "$target"; then
    +    ac_ct_AR=$AR
    +    # Extract the first word of "ar", so it can be a program name with args.
    +set dummy ar; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_AR+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_AR"; then
    +  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_AR="ar"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR=":"
    +fi
    +fi
    +ac_ct_AR=$ac_cv_prog_ac_ct_AR
    +if test -n "$ac_ct_AR"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
    +printf "%s\n" "$ac_ct_AR" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +    AR=$ac_ct_AR
    +  else
    +    AR=":"
    +  fi
    +else
    +  AR="$ac_cv_prog_AR"
    +fi
    +
    +if test $AR = ":"
    +then :
    +  as_fn_error $? "ar command not found." "$LINENO" 5
    +fi
    +
    +if test -n "$ac_tool_prefix"; then
    +  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
    +set dummy ${ac_tool_prefix}ranlib; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_RANLIB+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$RANLIB"; then
    +  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +RANLIB=$ac_cv_prog_RANLIB
    +if test -n "$RANLIB"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
    +printf "%s\n" "$RANLIB" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +fi
    +if test -z "$ac_cv_prog_RANLIB"; then
    +  ac_ct_RANLIB=$RANLIB
    +  # Extract the first word of "ranlib", so it can be a program name with args.
    +set dummy ranlib; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_RANLIB+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_RANLIB"; then
    +  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_RANLIB="ranlib"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
    +if test -n "$ac_ct_RANLIB"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
    +printf "%s\n" "$ac_ct_RANLIB" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +  if test "x$ac_ct_RANLIB" = x; then
    +    RANLIB=":"
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    RANLIB=$ac_ct_RANLIB
    +  fi
    +else
    +  RANLIB="$ac_cv_prog_RANLIB"
    +fi
    +
    +if test $RANLIB = ":"
    +then :
    +  as_fn_error $? "ranlib command not found." "$LINENO" 5
    +fi
    +
    +# Find external dependencies
    +ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +
    +
    +
    +
    +
    +
    +	for ac_prog in mpicxx mpiCC mpic++ hcp mpxlC_r mpxlC mpCC cmpic++
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_MPICXX+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$MPICXX"; then
    +  ac_cv_prog_MPICXX="$MPICXX" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_MPICXX="$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +MPICXX=$ac_cv_prog_MPICXX
    +if test -n "$MPICXX"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MPICXX" >&5
    +printf "%s\n" "$MPICXX" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$MPICXX" && break
    +done
    +test -n "$MPICXX" || MPICXX="$CXX"
    +
    +	ax_mpi_save_CXX="$CXX"
    +	CXX="$MPICXX"
    +
    +
    + 	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking checking MPI C++ flags" >&5
    +printf %s "checking checking MPI C++ flags... " >&6; }
    + 	ax_mpi_cc_flags="`$MPICXX -showme:compile 2>/dev/null| cut -d\  -f2-`"
    + 	ax_mpi_cc_libs="`$MPICXX -showme:link 2>/dev/null| cut -d\  -f2-`"
    +        if test "x$ax_mpi_cc_flags" = "x"
    +then :
    +
    +          ax_mpi_cc_flags="`$MPICXX -show -c 2>/dev/null| cut -d\  -f2-|sed s/-c\ //`"
    +          ax_mpi_cc_libs="`$MPICXX -show 2>/dev/null| cut -d\  -f2-`"
    +	   if test "x$ax_mpi_cc_flags" = "x"
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: could not determine C++ flags from show functions" >&5
    +printf "%s\n" "could not determine C++ flags from show functions" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: flags found" >&5
    +printf "%s\n" "flags found" >&6; }
    +fi
    +
    +
    +else $as_nop
    +
    +          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: flags found" >&5
    +printf "%s\n" "flags found" >&6; }
    +fi
    +	MPI_CXXFLAGS="$ax_mpi_cc_flags"
    +	MPI_CXXLIBS="$ax_mpi_cc_libs"
    +
    +
    +
    +
    +
    +if test x = x"$MPILIBS"; then
    +	ac_fn_cxx_check_func "$LINENO" "MPI_Init" "ac_cv_func_MPI_Init"
    +if test "x$ac_cv_func_MPI_Init" = xyes
    +then :
    +  MPILIBS=" "
    +fi
    +
    +fi
    +
    +if test x = x"$MPILIBS"; then
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5
    +printf %s "checking for MPI_Init in -lmpi... " >&6; }
    +if test ${ac_cv_lib_mpi_MPI_Init+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_check_lib_save_LIBS=$LIBS
    +LIBS="-lmpi  $LIBS"
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +namespace conftest {
    +  extern "C" int MPI_Init ();
    +}
    +int
    +main (void)
    +{
    +return conftest::MPI_Init ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +  ac_cv_lib_mpi_MPI_Init=yes
    +else $as_nop
    +  ac_cv_lib_mpi_MPI_Init=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +LIBS=$ac_check_lib_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5
    +printf "%s\n" "$ac_cv_lib_mpi_MPI_Init" >&6; }
    +if test "x$ac_cv_lib_mpi_MPI_Init" = xyes
    +then :
    +  MPILIBS="-lmpi"
    +fi
    +
    +fi
    +if test x = x"$MPILIBS"; then
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5
    +printf %s "checking for MPI_Init in -lmpich... " >&6; }
    +if test ${ac_cv_lib_mpich_MPI_Init+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_check_lib_save_LIBS=$LIBS
    +LIBS="-lmpich  $LIBS"
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +namespace conftest {
    +  extern "C" int MPI_Init ();
    +}
    +int
    +main (void)
    +{
    +return conftest::MPI_Init ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +  ac_cv_lib_mpich_MPI_Init=yes
    +else $as_nop
    +  ac_cv_lib_mpich_MPI_Init=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +LIBS=$ac_check_lib_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5
    +printf "%s\n" "$ac_cv_lib_mpich_MPI_Init" >&6; }
    +if test "x$ac_cv_lib_mpich_MPI_Init" = xyes
    +then :
    +  MPILIBS="-lmpich"
    +fi
    +
    +fi
    +
    +if test x != x"$MPILIBS"; then
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mpi.h" >&5
    +printf %s "checking for mpi.h... " >&6; }
    +	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +#include 
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +else $as_nop
    +  MPILIBS=""
    +		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +
    +CXX="$ax_mpi_save_CXX"
    +
    +
    +
    +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
    +if test x = x"$MPILIBS"; then
    +
    +        :
    +else
    +
    +printf "%s\n" "#define HAVE_MPI 1" >>confdefs.h
    +
    +        :
    +fi
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
    +	if test -n "$ac_tool_prefix"; then
    +  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
    +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_path_PKG_CONFIG+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  case $PKG_CONFIG in
    +  [\\/]* | ?:[\\/]*)
    +  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
    +  ;;
    +  *)
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +  ;;
    +esac
    +fi
    +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
    +if test -n "$PKG_CONFIG"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
    +printf "%s\n" "$PKG_CONFIG" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +fi
    +if test -z "$ac_cv_path_PKG_CONFIG"; then
    +  ac_pt_PKG_CONFIG=$PKG_CONFIG
    +  # Extract the first word of "pkg-config", so it can be a program name with args.
    +set dummy pkg-config; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  case $ac_pt_PKG_CONFIG in
    +  [\\/]* | ?:[\\/]*)
    +  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
    +  ;;
    +  *)
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +  ;;
    +esac
    +fi
    +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
    +if test -n "$ac_pt_PKG_CONFIG"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
    +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +  if test "x$ac_pt_PKG_CONFIG" = x; then
    +    PKG_CONFIG=""
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    PKG_CONFIG=$ac_pt_PKG_CONFIG
    +  fi
    +else
    +  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
    +fi
    +
    +fi
    +if test -n "$PKG_CONFIG"; then
    +	_pkg_min_version=0.9.0
    +	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
    +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; }
    +	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
    +		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +	else
    +		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +		PKG_CONFIG=""
    +	fi
    +fi
    +
    +
    +# Check whether --with-gsl-prefix was given.
    +if test ${with_gsl_prefix+y}
    +then :
    +  withval=$with_gsl_prefix; gsl_prefix="$withval"
    +else $as_nop
    +  gsl_prefix=""
    +fi
    +
    +
    +# Check whether --with-gsl-exec-prefix was given.
    +if test ${with_gsl_exec_prefix+y}
    +then :
    +  withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval"
    +else $as_nop
    +  gsl_exec_prefix=""
    +fi
    +
    +# Check whether --enable-gsltest was given.
    +if test ${enable_gsltest+y}
    +then :
    +  enableval=$enable_gsltest;
    +else $as_nop
    +  enable_gsltest=yes
    +fi
    +
    +
    +  if test "x${GSL_CONFIG+set}" != xset ; then
    +     if test "x$gsl_prefix" != x ; then
    +         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
    +     fi
    +     if test "x$gsl_exec_prefix" != x ; then
    +        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
    +     fi
    +  fi
    +
    +
    +  if test "x${GSL_CONFIG+set}" == xset ; then
    +    if test -x "${GSL_CONFIG}" ; then
    +        gsl_config_exists=yes
    +    else
    +        gsl_config_exists=no
    +    fi
    +  fi
    +  FOUND_GSL=no
    +  if test "x$GSL_CFLAGS" != x ; then
    +    if test "x$GSL_LIBS" != x ; then
    +        GSL_FLAGS="$GSL_CFLAGS"
    +        GSL_LIBS="$GSL_LIBS"
    +        FOUND_GSL=yes
    +
    +    fi
    +  fi
    +  if test "$FOUND_GSL" = "no"; then
    +      if test "x$gsl_config_exists" != xyes ; then
    +
    +pkg_failed=no
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GSL" >&5
    +printf %s "checking for GSL... " >&6; }
    +
    +if test -n "$GSL_CFLAGS"; then
    +    pkg_cv_GSL_CFLAGS="$GSL_CFLAGS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gsl >= 1.0\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "gsl >= 1.0") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_GSL_CFLAGS=`$PKG_CONFIG --cflags "gsl >= 1.0" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +if test -n "$GSL_LIBS"; then
    +    pkg_cv_GSL_LIBS="$GSL_LIBS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gsl >= 1.0\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "gsl >= 1.0") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_GSL_LIBS=`$PKG_CONFIG --libs "gsl >= 1.0" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +
    +
    +
    +if test $pkg_failed = yes; then
    +   	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
    +        _pkg_short_errors_supported=yes
    +else
    +        _pkg_short_errors_supported=no
    +fi
    +        if test $_pkg_short_errors_supported = yes; then
    +	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl >= 1.0" 2>&1`
    +        else
    +	        GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gsl >= 1.0" 2>&1`
    +        fi
    +	# Put the nasty error message in config.log where it belongs
    +	echo "$GSL_PKG_ERRORS" >&5
    +
    +
    +
    +
    +elif test $pkg_failed = untried; then
    +     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +
    +
    +else
    +	GSL_CFLAGS=$pkg_cv_GSL_CFLAGS
    +	GSL_LIBS=$pkg_cv_GSL_LIBS
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +            GSL_FLAGS="$GSL_CFLAGS"
    +            GSL_LIBS="$GSL_LIBS"
    +            FOUND_GSL=yes
    +
    +
    +            FOUND_GSL=yes
    +
    +fi
    +      fi
    +  fi
    +  if test "$FOUND_GSL" = "no"; then
    +      # Extract the first word of "gsl-config", so it can be a program name with args.
    +set dummy gsl-config; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_path_GSL_CONFIG+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  case $GSL_CONFIG in
    +  [\\/]* | ?:[\\/]*)
    +  ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path.
    +  ;;
    +  *)
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_path_GSL_CONFIG="$as_dir$ac_word$ac_exec_ext"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +  test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no"
    +  ;;
    +esac
    +fi
    +GSL_CONFIG=$ac_cv_path_GSL_CONFIG
    +if test -n "$GSL_CONFIG"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5
    +printf "%s\n" "$GSL_CONFIG" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +      min_gsl_version=1.0
    +      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5
    +printf %s "checking for GSL - version >= $min_gsl_version... " >&6; }
    +      no_gsl=""
    +      if test "$GSL_CONFIG" = "no" ; then
    +        no_gsl=yes
    +      else
    +        GSL_FLAGS=`$GSL_CONFIG --cflags`
    +        GSL_LIBS=`$GSL_CONFIG --libs`
    +
    +        gsl_version=`$GSL_CONFIG --version`
    +        as_arg_v1=$gsl_version
    +as_arg_v2=$min_gsl_version
    +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null
    +case $? in #(
    +  1) :
    +    no_gsl=yes ;; #(
    +  0) :
    +     ;; #(
    +  2) :
    +     ;; #(
    +  *) :
    +     ;;
    +esac
    +      fi
    +      if test "x$no_gsl" = x ; then
    +         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +         FOUND_GSL=yes
    +      else
    +         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +         if test "$GSL_CONFIG" = "no" ; then
    +           echo "*** The gsl-config script installed by GSL could not be found"
    +           echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
    +           echo "*** your path, or set the GSL_CONFIG environment variable to the"
    +           echo "*** full path to gsl-config."
    +         else
    +           if test -f conf.gsltest ; then
    +            :
    +           else
    +              echo "*** Could not run GSL test program, checking why..."
    +              CFLAGS="$CFLAGS $GSL_FLAGS"
    +              LIBS="$LIBS $GSL_LIBS"
    +              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +    #include 
    +
    +int
    +main (void)
    +{
    + return 0;
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +   echo "*** The test program compiled, but did not run. This usually means"
    +              echo "*** that the run-time linker is not finding GSL or finding the wrong"
    +              echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
    +              echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
    +              echo "*** to the installed location  Also, make sure you have run ldconfig if that"
    +              echo "*** is required on your system"
    +          echo "***"
    +              echo "*** If you have an old version installed, it is best to remove it, although"
    +              echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
    +else $as_nop
    +   echo "*** The test program failed to compile or link. See the file config.log for the"
    +              echo "*** exact error that occured. This usually means GSL was incorrectly installed"
    +              echo "*** or that you have moved GSL since it was installed. In the latter case, you"
    +              echo "*** may want to edit the gsl-config script: $GSL_CONFIG"
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +              CFLAGS="$ac_save_CFLAGS"
    +              LIBS="$ac_save_LIBS"
    +           fi
    +         fi
    +    #     GSL_FLAGS=""
    +    #     GSL_LIBS=""
    +         :
    +      fi
    +
    +  fi
    +
    +
    +  rm -f conf.gsltest
    +
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
    +printf %s "checking for a sed that does not truncate output... " >&6; }
    +if test ${ac_cv_path_SED+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
    +     for ac_i in 1 2 3 4 5 6 7; do
    +       ac_script="$ac_script$as_nl$ac_script"
    +     done
    +     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
    +     { ac_script=; unset ac_script;}
    +     if test -z "$SED"; then
    +  ac_path_SED_found=false
    +  # Loop through the user's path and test for each of PROGNAME-LIST
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_prog in sed gsed
    +   do
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +      ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
    +      as_fn_executable_p "$ac_path_SED" || continue
    +# Check for GNU ac_path_SED and select it if it is found.
    +  # Check for GNU $ac_path_SED
    +case `"$ac_path_SED" --version 2>&1` in
    +*GNU*)
    +  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
    +*)
    +  ac_count=0
    +  printf %s 0123456789 >"conftest.in"
    +  while :
    +  do
    +    cat "conftest.in" "conftest.in" >"conftest.tmp"
    +    mv "conftest.tmp" "conftest.in"
    +    cp "conftest.in" "conftest.nl"
    +    printf "%s\n" '' >> "conftest.nl"
    +    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
    +    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    +    as_fn_arith $ac_count + 1 && ac_count=$as_val
    +    if test $ac_count -gt ${ac_path_SED_max-0}; then
    +      # Best one so far, save it but keep looking for a better one
    +      ac_cv_path_SED="$ac_path_SED"
    +      ac_path_SED_max=$ac_count
    +    fi
    +    # 10*(2^10) chars as input seems more than enough
    +    test $ac_count -gt 10 && break
    +  done
    +  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
    +esac
    +
    +      $ac_path_SED_found && break 3
    +    done
    +  done
    +  done
    +IFS=$as_save_IFS
    +  if test -z "$ac_cv_path_SED"; then
    +    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
    +  fi
    +else
    +  ac_cv_path_SED=$SED
    +fi
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
    +printf "%s\n" "$ac_cv_path_SED" >&6; }
    + SED="$ac_cv_path_SED"
    +  rm -f conftest.sed
    +
    +for ac_prog in gawk mawk nawk awk
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_AWK+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$AWK"; then
    +  ac_cv_prog_AWK="$AWK" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_AWK="$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +AWK=$ac_cv_prog_AWK
    +if test -n "$AWK"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
    +printf "%s\n" "$AWK" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$AWK" && break
    +done
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +if test -n "$ac_tool_prefix"; then
    +  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
    +set dummy ${ac_tool_prefix}gcc; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CC"; then
    +  ac_cv_prog_CC="$CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CC="${ac_tool_prefix}gcc"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CC=$ac_cv_prog_CC
    +if test -n "$CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
    +printf "%s\n" "$CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +fi
    +if test -z "$ac_cv_prog_CC"; then
    +  ac_ct_CC=$CC
    +  # Extract the first word of "gcc", so it can be a program name with args.
    +set dummy gcc; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_CC"; then
    +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_CC="gcc"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_CC=$ac_cv_prog_ac_ct_CC
    +if test -n "$ac_ct_CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
    +printf "%s\n" "$ac_ct_CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +  if test "x$ac_ct_CC" = x; then
    +    CC=""
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    CC=$ac_ct_CC
    +  fi
    +else
    +  CC="$ac_cv_prog_CC"
    +fi
    +
    +if test -z "$CC"; then
    +          if test -n "$ac_tool_prefix"; then
    +    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
    +set dummy ${ac_tool_prefix}cc; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CC"; then
    +  ac_cv_prog_CC="$CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CC="${ac_tool_prefix}cc"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CC=$ac_cv_prog_CC
    +if test -n "$CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
    +printf "%s\n" "$CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  fi
    +fi
    +if test -z "$CC"; then
    +  # Extract the first word of "cc", so it can be a program name with args.
    +set dummy cc; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CC"; then
    +  ac_cv_prog_CC="$CC" # Let the user override the test.
    +else
    +  ac_prog_rejected=no
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
    +       ac_prog_rejected=yes
    +       continue
    +     fi
    +    ac_cv_prog_CC="cc"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +if test $ac_prog_rejected = yes; then
    +  # We found a bogon in the path, so make sure we never use it.
    +  set dummy $ac_cv_prog_CC
    +  shift
    +  if test $# != 0; then
    +    # We chose a different compiler from the bogus one.
    +    # However, it has the same basename, so the bogon will be chosen
    +    # first if we set CC to just the basename; use the full file name.
    +    shift
    +    ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
    +  fi
    +fi
    +fi
    +fi
    +CC=$ac_cv_prog_CC
    +if test -n "$CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
    +printf "%s\n" "$CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +fi
    +if test -z "$CC"; then
    +  if test -n "$ac_tool_prefix"; then
    +  for ac_prog in cl.exe
    +  do
    +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CC"; then
    +  ac_cv_prog_CC="$CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CC=$ac_cv_prog_CC
    +if test -n "$CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
    +printf "%s\n" "$CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +    test -n "$CC" && break
    +  done
    +fi
    +if test -z "$CC"; then
    +  ac_ct_CC=$CC
    +  for ac_prog in cl.exe
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_CC"; then
    +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_CC="$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_CC=$ac_cv_prog_ac_ct_CC
    +if test -n "$ac_ct_CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
    +printf "%s\n" "$ac_ct_CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$ac_ct_CC" && break
    +done
    +
    +  if test "x$ac_ct_CC" = x; then
    +    CC=""
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    CC=$ac_ct_CC
    +  fi
    +fi
    +
    +fi
    +if test -z "$CC"; then
    +  if test -n "$ac_tool_prefix"; then
    +  # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
    +set dummy ${ac_tool_prefix}clang; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CC"; then
    +  ac_cv_prog_CC="$CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CC="${ac_tool_prefix}clang"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CC=$ac_cv_prog_CC
    +if test -n "$CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
    +printf "%s\n" "$CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +fi
    +if test -z "$ac_cv_prog_CC"; then
    +  ac_ct_CC=$CC
    +  # Extract the first word of "clang", so it can be a program name with args.
    +set dummy clang; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_CC"; then
    +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_CC="clang"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_CC=$ac_cv_prog_ac_ct_CC
    +if test -n "$ac_ct_CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
    +printf "%s\n" "$ac_ct_CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +  if test "x$ac_ct_CC" = x; then
    +    CC=""
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    CC=$ac_ct_CC
    +  fi
    +else
    +  CC="$ac_cv_prog_CC"
    +fi
    +
    +fi
    +
    +
    +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
    +as_fn_error $? "no acceptable C compiler found in \$PATH
    +See \`config.log' for more details" "$LINENO" 5; }
    +
    +# Provide some information about the compiler.
    +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
    +set X $ac_compile
    +ac_compiler=$2
    +for ac_option in --version -v -V -qversion -version; do
    +  { { ac_try="$ac_compiler $ac_option >&5"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    sed '10a\
    +... rest of stderr output deleted ...
    +         10q' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +  fi
    +  rm -f conftest.er1 conftest.err
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +done
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
    +printf %s "checking whether the compiler supports GNU C... " >&6; }
    +if test ${ac_cv_c_compiler_gnu+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +#ifndef __GNUC__
    +       choke me
    +#endif
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_compiler_gnu=yes
    +else $as_nop
    +  ac_compiler_gnu=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +ac_cv_c_compiler_gnu=$ac_compiler_gnu
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
    +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +if test $ac_compiler_gnu = yes; then
    +  GCC=yes
    +else
    +  GCC=
    +fi
    +ac_test_CFLAGS=${CFLAGS+y}
    +ac_save_CFLAGS=$CFLAGS
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
    +printf %s "checking whether $CC accepts -g... " >&6; }
    +if test ${ac_cv_prog_cc_g+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_save_c_werror_flag=$ac_c_werror_flag
    +   ac_c_werror_flag=yes
    +   ac_cv_prog_cc_g=no
    +   CFLAGS="-g"
    +   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cc_g=yes
    +else $as_nop
    +  CFLAGS=""
    +      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_compile "$LINENO"
    +then :
    +
    +else $as_nop
    +  ac_c_werror_flag=$ac_save_c_werror_flag
    +	 CFLAGS="-g"
    +	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cc_g=yes
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +   ac_c_werror_flag=$ac_save_c_werror_flag
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
    +printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
    +if test $ac_test_CFLAGS; then
    +  CFLAGS=$ac_save_CFLAGS
    +elif test $ac_cv_prog_cc_g = yes; then
    +  if test "$GCC" = yes; then
    +    CFLAGS="-g -O2"
    +  else
    +    CFLAGS="-g"
    +  fi
    +else
    +  if test "$GCC" = yes; then
    +    CFLAGS="-O2"
    +  else
    +    CFLAGS=
    +  fi
    +fi
    +ac_prog_cc_stdc=no
    +if test x$ac_prog_cc_stdc = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
    +printf %s "checking for $CC option to enable C11 features... " >&6; }
    +if test ${ac_cv_prog_cc_c11+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cc_c11=no
    +ac_save_CC=$CC
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_c_conftest_c11_program
    +_ACEOF
    +for ac_arg in '' -std=gnu11
    +do
    +  CC="$ac_save_CC $ac_arg"
    +  if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cc_c11=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cc_c11" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CC=$ac_save_CC
    +fi
    +
    +if test "x$ac_cv_prog_cc_c11" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cc_c11" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
    +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
    +     CC="$CC $ac_cv_prog_cc_c11"
    +fi
    +  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
    +  ac_prog_cc_stdc=c11
    +fi
    +fi
    +if test x$ac_prog_cc_stdc = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
    +printf %s "checking for $CC option to enable C99 features... " >&6; }
    +if test ${ac_cv_prog_cc_c99+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cc_c99=no
    +ac_save_CC=$CC
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_c_conftest_c99_program
    +_ACEOF
    +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
    +do
    +  CC="$ac_save_CC $ac_arg"
    +  if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cc_c99=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cc_c99" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CC=$ac_save_CC
    +fi
    +
    +if test "x$ac_cv_prog_cc_c99" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cc_c99" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
    +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
    +     CC="$CC $ac_cv_prog_cc_c99"
    +fi
    +  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
    +  ac_prog_cc_stdc=c99
    +fi
    +fi
    +if test x$ac_prog_cc_stdc = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
    +printf %s "checking for $CC option to enable C89 features... " >&6; }
    +if test ${ac_cv_prog_cc_c89+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cc_c89=no
    +ac_save_CC=$CC
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_c_conftest_c89_program
    +_ACEOF
    +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
    +do
    +  CC="$ac_save_CC $ac_arg"
    +  if ac_fn_c_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cc_c89=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cc_c89" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CC=$ac_save_CC
    +fi
    +
    +if test "x$ac_cv_prog_cc_c89" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cc_c89" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
    +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
    +     CC="$CC $ac_cv_prog_cc_c89"
    +fi
    +  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
    +  ac_prog_cc_stdc=c89
    +fi
    +fi
    +
    +ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +ac_header= ac_cache=
    +for ac_item in $ac_header_c_list
    +do
    +  if test $ac_cache; then
    +    ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
    +    if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
    +      printf "%s\n" "#define $ac_item 1" >> confdefs.h
    +    fi
    +    ac_header= ac_cache=
    +  elif test $ac_header; then
    +    ac_cache=$ac_item
    +  else
    +    ac_header=$ac_item
    +  fi
    +done
    +
    +
    +
    +
    +
    +
    +
    +
    +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
    +then :
    +
    +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
    +
    +fi
    +
    +
    +
    +
    +
    +
    +if   test "" = ""        ; then
    +    : # Recognized value
    +elif test "" = "serial"  ; then
    +    : # Recognized value
    +elif test "" = "parallel"; then
    +    : # Recognized value
    +else
    +    as_fn_error $? "
    +Unrecognized value for AX_LIB_HDF5 within configure.ac.
    +If supplied, argument 1 must be either 'serial' or 'parallel'.
    +" "$LINENO" 5
    +fi
    +
    +
    +# Check whether --with-hdf5 was given.
    +if test ${with_hdf5+y}
    +then :
    +  withval=$with_hdf5; if test "$withval" = "no"; then
    +     with_hdf5="no"
    +   elif test "$withval" = "yes"; then
    +     with_hdf5="yes"
    +   else
    +     with_hdf5="yes"
    +     H5CC="$withval"
    +   fi
    +else $as_nop
    +  with_hdf5="yes"
    +
    +fi
    +
    +
    +HDF5_CC=""
    +HDF5_VERSION=""
    +HDF5_CFLAGS=""
    +HDF5_CPPFLAGS=""
    +HDF5_LDFLAGS=""
    +HDF5_LIBS=""
    +HDF5_FC=""
    +HDF5_FFLAGS=""
    +HDF5_FLIBS=""
    +HDF5_TYPE=""
    +
    +if test "$with_hdf5" = "yes"; then
    +    if test -z "$H5CC"; then
    +                for ac_prog in h5cc h5pcc
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_path_H5CC+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  case $H5CC in
    +  [\\/]* | ?:[\\/]*)
    +  ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path.
    +  ;;
    +  *)
    +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +  ;;
    +esac
    +fi
    +H5CC=$ac_cv_path_H5CC
    +if test -n "$H5CC"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5
    +printf "%s\n" "$H5CC" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$H5CC" && break
    +done
    +
    +    else
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided HDF5 C wrapper" >&5
    +printf %s "checking Using provided HDF5 C wrapper... " >&6; }
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5
    +printf "%s\n" "$H5CC" >&6; }
    +    fi
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 type" >&5
    +printf %s "checking for HDF5 type... " >&6; }
    +    case $H5CC in #(
    +  *h5pcc) :
    +    HDF5_TYPE=parallel ;; #(
    +  *h5cc) :
    +    HDF5_TYPE=serial ;; #(
    +  *) :
    +    HDF5_TYPE=neither ;;
    +esac
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HDF5_TYPE" >&5
    +printf "%s\n" "$HDF5_TYPE" >&6; }
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 libraries" >&5
    +printf %s "checking for HDF5 libraries... " >&6; }
    +    if test ! -f "$H5CC" || test ! -x "$H5CC"; then
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING:
    +Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'.
    +Please specify --with-hdf5= as the full path to h5cc or h5pcc.
    +HDF5 support is being disabled (equivalent to --with-hdf5=no).
    +" >&5
    +printf "%s\n" "$as_me: WARNING:
    +Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'.
    +Please specify --with-hdf5= as the full path to h5cc or h5pcc.
    +HDF5 support is being disabled (equivalent to --with-hdf5=no).
    +" >&2;}
    +        with_hdf5="no"
    +        with_hdf5_fortran="no"
    +    else
    +                HDF5_SHOW=$(eval $H5CC -show)
    +
    +                HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $1}')
    +        if test "$HDF5_CC" = "ccache"; then
    +            HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $2}')
    +        fi
    +
    +
    +                HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \
    +            | $AWK '{print $3}')
    +
    +                                                                                HDF5_tmp_flags=$(eval $H5CC -showconfig \
    +            | $GREP 'FLAGS\|Extra libraries:' \
    +            | $AWK -F: '{printf("%s "), $2}' )
    +
    +                HDF5_tmp_inst=$(eval $H5CC -showconfig \
    +            | $GREP 'Installation point:' \
    +            | $AWK '{print $NF}' )
    +
    +                HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include"
    +
    +                for arg in $HDF5_SHOW $HDF5_tmp_flags ; do
    +          case "$arg" in
    +            -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
    +                  || HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg"
    +              ;;
    +            -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
    +                  || HDF5_LDFLAGS="$HDF5_LDFLAGS $arg"
    +              ;;
    +            -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \
    +                  || HDF5_LIBS="$HDF5_LIBS $arg"
    +              ;;
    +          esac
    +        done
    +
    +        HDF5_LIBS="-lhdf5 $HDF5_LIBS"
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $HDF5_VERSION)" >&5
    +printf "%s\n" "yes (version $HDF5_VERSION)" >&6; }
    +
    +                ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +        ax_lib_hdf5_save_CC=$CC
    +        ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS
    +        ax_lib_hdf5_save_LIBS=$LIBS
    +        ax_lib_hdf5_save_LDFLAGS=$LDFLAGS
    +        CC=$HDF5_CC
    +        CPPFLAGS=$HDF5_CPPFLAGS
    +        LIBS=$HDF5_LIBS
    +        LDFLAGS=$HDF5_LDFLAGS
    +        ac_fn_c_check_header_compile "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
    +if test "x$ac_cv_header_hdf5_h" = xyes
    +then :
    +  ac_cv_hadf5_h=yes
    +else $as_nop
    +  ac_cv_hadf5_h=no
    +fi
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for H5Fcreate in -lhdf5" >&5
    +printf %s "checking for H5Fcreate in -lhdf5... " >&6; }
    +if test ${ac_cv_lib_hdf5_H5Fcreate+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_check_lib_save_LIBS=$LIBS
    +LIBS="-lhdf5  $LIBS"
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +/* Override any GCC internal prototype to avoid an error.
    +   Use char because int might match the return type of a GCC
    +   builtin and then its argument prototype would still apply.  */
    +char H5Fcreate ();
    +int
    +main (void)
    +{
    +return H5Fcreate ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_link "$LINENO"
    +then :
    +  ac_cv_lib_hdf5_H5Fcreate=yes
    +else $as_nop
    +  ac_cv_lib_hdf5_H5Fcreate=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +LIBS=$ac_check_lib_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fcreate" >&5
    +printf "%s\n" "$ac_cv_lib_hdf5_H5Fcreate" >&6; }
    +if test "x$ac_cv_lib_hdf5_H5Fcreate" = xyes
    +then :
    +  ac_cv_libhdf5=yes
    +else $as_nop
    +  ac_cv_libhdf5=no
    +fi
    +
    +        if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then
    +          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile HDF5 test program" >&5
    +printf "%s\n" "$as_me: WARNING: Unable to compile HDF5 test program" >&2;}
    +        fi
    +                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5_hl" >&5
    +printf %s "checking for main in -lhdf5_hl... " >&6; }
    +if test ${ac_cv_lib_hdf5_hl_main+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_check_lib_save_LIBS=$LIBS
    +LIBS="-lhdf5_hl  $LIBS"
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +
    +int
    +main (void)
    +{
    +return main ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_c_try_link "$LINENO"
    +then :
    +  ac_cv_lib_hdf5_hl_main=yes
    +else $as_nop
    +  ac_cv_lib_hdf5_hl_main=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +LIBS=$ac_check_lib_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_hl_main" >&5
    +printf "%s\n" "$ac_cv_lib_hdf5_hl_main" >&6; }
    +if test "x$ac_cv_lib_hdf5_hl_main" = xyes
    +then :
    +  HDF5_LIBS="-lhdf5_hl $HDF5_LIBS"
    +fi
    +ac_cv_lib_hdf5_hl=ac_cv_lib_hdf5_hl_main
    +
    +
    +        CC=$ax_lib_hdf5_save_CC
    +        CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS
    +        LIBS=$ax_lib_hdf5_save_LIBS
    +        LDFLAGS=$ax_lib_hdf5_save_LDFLAGS
    +        ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching HDF5 Fortran wrapper" >&5
    +printf %s "checking for matching HDF5 Fortran wrapper... " >&6; }
    +                H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p')
    +        if test -x "$H5FC"; then
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5
    +printf "%s\n" "$H5FC" >&6; }
    +            with_hdf5_fortran="yes"
    +
    +
    +                        for arg in `$H5FC -show`
    +            do
    +              case "$arg" in #(
    +                -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
    +                      || HDF5_FFLAGS="$HDF5_FFLAGS $arg"
    +                  ;;#(
    +                -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
    +                      || HDF5_FFLAGS="$HDF5_FFLAGS $arg"
    +                                                               echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \
    +                      || HDF5_FFLAGS="$HDF5_FFLAGS -I${arg#-L}"
    +                  ;;
    +              esac
    +            done
    +
    +                        for arg in $HDF5_LIBS
    +            do
    +              case "$arg" in #(
    +                -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg"
    +                  ;; #(
    +                -lhdf5)    HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg"
    +                  ;; #(
    +                *) HDF5_FLIBS="$HDF5_FLIBS $arg"
    +                  ;;
    +              esac
    +            done
    +        else
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +            with_hdf5_fortran="no"
    +        fi
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +printf "%s\n" "#define HAVE_HDF5 1" >>confdefs.h
    +
    +    fi
    +fi
    +
    +
    +    amuse_lib_qhull_save_libs="$LIBS"
    +
    +    LIBS=""
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing qh_freeqhull" >&5
    +printf %s "checking for library containing qh_freeqhull... " >&6; }
    +if test ${ac_cv_search_qh_freeqhull+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_func_search_save_LIBS=$LIBS
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +namespace conftest {
    +  extern "C" int qh_freeqhull ();
    +}
    +int
    +main (void)
    +{
    +return conftest::qh_freeqhull ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +for ac_lib in '' qhull_r
    +do
    +  if test -z "$ac_lib"; then
    +    ac_res="none required"
    +  else
    +    ac_res=-l$ac_lib
    +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    +  fi
    +  if ac_fn_cxx_try_link "$LINENO"
    +then :
    +  ac_cv_search_qh_freeqhull=$ac_res
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext
    +  if test ${ac_cv_search_qh_freeqhull+y}
    +then :
    +  break
    +fi
    +done
    +if test ${ac_cv_search_qh_freeqhull+y}
    +then :
    +
    +else $as_nop
    +  ac_cv_search_qh_freeqhull=no
    +fi
    +rm conftest.$ac_ext
    +LIBS=$ac_func_search_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_qh_freeqhull" >&5
    +printf "%s\n" "$ac_cv_search_qh_freeqhull" >&6; }
    +ac_res=$ac_cv_search_qh_freeqhull
    +if test "$ac_res" != no
    +then :
    +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
    +
    +        FOUND_QHULL="yes"
    +
    +fi
    +
    +    QHULL_LIBS="$LIBS"
    +    QHULL_FLAGS=""
    +
    +    LIBS="$amuse_lib_qhull_save_libs"
    +
    +           for ac_header in libqhull_r/libqhull_r.h
    +do :
    +  ac_fn_cxx_check_header_compile "$LINENO" "libqhull_r/libqhull_r.h" "ac_cv_header_libqhull_r_libqhull_r_h" "$ac_includes_default"
    +if test "x$ac_cv_header_libqhull_r_libqhull_r_h" = xyes
    +then :
    +  printf "%s\n" "#define HAVE_LIBQHULL_R_LIBQHULL_R_H 1" >>confdefs.h
    +
    +else $as_nop
    +  FOUND_QHULL="no"
    +fi
    +
    +done
    +
    +
    +
    +
    +
    +    amuse_lib_healpix_cxx_save_libs="$LIBS"
    +
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HEALPix" >&5
    +printf %s "checking for HEALPix... " >&6; }
    +
    +    ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +    LIBS="-lhealpix_cxx"
    +
    +    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +
    +            #include 
    +
    +int
    +main (void)
    +{
    +
    +            Healpix_Base hb;
    +
    +  ;
    +  return 0;
    +}
    +
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +
    +        FOUND_HEALPIX_CXX="yes"
    +        HEALPIX_CXX_CFLAGS=""
    +        HEALPIX_CXX_LIBS="$LIBS"
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +else $as_nop
    +
    +        # Not found, try pkg-config instead
    +
    +pkg_failed=no
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HEALPIX_CXX" >&5
    +printf %s "checking for HEALPIX_CXX... " >&6; }
    +
    +if test -n "$HEALPIX_CXX_CFLAGS"; then
    +    pkg_cv_HEALPIX_CXX_CFLAGS="$HEALPIX_CXX_CFLAGS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"healpix_cxx\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "healpix_cxx") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_HEALPIX_CXX_CFLAGS=`$PKG_CONFIG --cflags "healpix_cxx" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +if test -n "$HEALPIX_CXX_LIBS"; then
    +    pkg_cv_HEALPIX_CXX_LIBS="$HEALPIX_CXX_LIBS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"healpix_cxx\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "healpix_cxx") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_HEALPIX_CXX_LIBS=`$PKG_CONFIG --libs "healpix_cxx" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +
    +
    +
    +if test $pkg_failed = yes; then
    +   	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
    +        _pkg_short_errors_supported=yes
    +else
    +        _pkg_short_errors_supported=no
    +fi
    +        if test $_pkg_short_errors_supported = yes; then
    +	        HEALPIX_CXX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "healpix_cxx" 2>&1`
    +        else
    +	        HEALPIX_CXX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "healpix_cxx" 2>&1`
    +        fi
    +	# Put the nasty error message in config.log where it belongs
    +	echo "$HEALPIX_CXX_PKG_ERRORS" >&5
    +
    +
    +            FOUND_HEALPIX_CXX="no"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +elif test $pkg_failed = untried; then
    +     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +            FOUND_HEALPIX_CXX="no"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +else
    +	HEALPIX_CXX_CFLAGS=$pkg_cv_HEALPIX_CXX_CFLAGS
    +	HEALPIX_CXX_LIBS=$pkg_cv_HEALPIX_CXX_LIBS
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +            FOUND_HEALPIX_CXX="yes"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +fi
    +
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +
    +    ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +
    +
    +
    +
    +ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +# Generate output
    +ac_config_files="$ac_config_files config.mk"
    +
    +cat >confcache <<\_ACEOF
    +# This file is a shell script that caches the results of configure
    +# tests run on this system so they can be shared between configure
    +# scripts and configure runs, see configure's option --config-cache.
    +# It is not useful on other systems.  If it contains results you don't
    +# want to keep, you may remove or edit it.
    +#
    +# config.status only pays attention to the cache file if you give it
    +# the --recheck option to rerun configure.
    +#
    +# `ac_cv_env_foo' variables (set or unset) will be overridden when
    +# loading this file, other *unset* `ac_cv_foo' will be assigned the
    +# following values.
    +
    +_ACEOF
    +
    +# The following way of writing the cache mishandles newlines in values,
    +# but we know of no workaround that is simple, portable, and efficient.
    +# So, we kill variables containing newlines.
    +# Ultrix sh set writes to stderr and can't be redirected directly,
    +# and sets the high bit in the cache file unless we assign to the vars.
    +(
    +  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    +    eval ac_val=\$$ac_var
    +    case $ac_val in #(
    +    *${as_nl}*)
    +      case $ac_var in #(
    +      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
    +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
    +      esac
    +      case $ac_var in #(
    +      _ | IFS | as_nl) ;; #(
    +      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
    +      *) { eval $ac_var=; unset $ac_var;} ;;
    +      esac ;;
    +    esac
    +  done
    +
    +  (set) 2>&1 |
    +    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    +    *${as_nl}ac_space=\ *)
    +      # `set' does not quote correctly, so add quotes: double-quote
    +      # substitution turns \\\\ into \\, and sed turns \\ into \.
    +      sed -n \
    +	"s/'/'\\\\''/g;
    +	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
    +      ;; #(
    +    *)
    +      # `set' quotes correctly as required by POSIX, so do not add quotes.
    +      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
    +      ;;
    +    esac |
    +    sort
    +) |
    +  sed '
    +     /^ac_cv_env_/b end
    +     t clear
    +     :clear
    +     s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
    +     t end
    +     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
    +     :end' >>confcache
    +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
    +  if test -w "$cache_file"; then
    +    if test "x$cache_file" != "x/dev/null"; then
    +      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
    +printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
    +      if test ! -f "$cache_file" || test -h "$cache_file"; then
    +	cat confcache >"$cache_file"
    +      else
    +        case $cache_file in #(
    +        */* | ?:*)
    +	  mv -f confcache "$cache_file"$$ &&
    +	  mv -f "$cache_file"$$ "$cache_file" ;; #(
    +        *)
    +	  mv -f confcache "$cache_file" ;;
    +	esac
    +      fi
    +    fi
    +  else
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
    +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
    +  fi
    +fi
    +rm -f confcache
    +
    +test "x$prefix" = xNONE && prefix=$ac_default_prefix
    +# Let make expand exec_prefix.
    +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
    +
    +# Transform confdefs.h into DEFS.
    +# Protect against shell expansion while executing Makefile rules.
    +# Protect against Makefile macro expansion.
    +#
    +# If the first sed substitution is executed (which looks for macros that
    +# take arguments), then branch to the quote section.  Otherwise,
    +# look for a macro that doesn't take arguments.
    +ac_script='
    +:mline
    +/\\$/{
    + N
    + s,\\\n,,
    + b mline
    +}
    +t clear
    +:clear
    +s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
    +t quote
    +s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
    +t quote
    +b any
    +:quote
    +s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
    +s/\[/\\&/g
    +s/\]/\\&/g
    +s/\$/$$/g
    +H
    +:any
    +${
    +	g
    +	s/^\n//
    +	s/\n/ /g
    +	p
    +}
    +'
    +DEFS=`sed -n "$ac_script" confdefs.h`
    +
    +
    +ac_libobjs=
    +ac_ltlibobjs=
    +U=
    +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
    +  # 1. Remove the extension, and $U if already installed.
    +  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
    +  ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
    +  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
    +  #    will be set to the directory where LIBOBJS objects are built.
    +  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
    +  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
    +done
    +LIBOBJS=$ac_libobjs
    +
    +LTLIBOBJS=$ac_ltlibobjs
    +
    +
    +
    +: "${CONFIG_STATUS=./config.status}"
    +ac_write_fail=0
    +ac_clean_files_save=$ac_clean_files
    +ac_clean_files="$ac_clean_files $CONFIG_STATUS"
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
    +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
    +as_write_fail=0
    +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
    +#! $SHELL
    +# Generated by $as_me.
    +# Run this file to recreate the current configuration.
    +# Compiler output produced by configure, useful for debugging
    +# configure, is in config.log if it exists.
    +
    +debug=false
    +ac_cs_recheck=false
    +ac_cs_silent=false
    +
    +SHELL=\${CONFIG_SHELL-$SHELL}
    +export SHELL
    +_ASEOF
    +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
    +## -------------------- ##
    +## M4sh Initialization. ##
    +## -------------------- ##
    +
    +# Be more Bourne compatible
    +DUALCASE=1; export DUALCASE # for MKS sh
    +as_nop=:
    +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
    +then :
    +  emulate sh
    +  NULLCMD=:
    +  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
    +  # is contrary to our usage.  Disable this feature.
    +  alias -g '${1+"$@"}'='"$@"'
    +  setopt NO_GLOB_SUBST
    +else $as_nop
    +  case `(set -o) 2>/dev/null` in #(
    +  *posix*) :
    +    set -o posix ;; #(
    +  *) :
    +     ;;
    +esac
    +fi
    +
    +
    +
    +# Reset variables that may have inherited troublesome values from
    +# the environment.
    +
    +# IFS needs to be set, to space, tab, and newline, in precisely that order.
    +# (If _AS_PATH_WALK were called with IFS unset, it would have the
    +# side effect of setting IFS to empty, thus disabling word splitting.)
    +# Quoting is to prevent editors from complaining about space-tab.
    +as_nl='
    +'
    +export as_nl
    +IFS=" ""	$as_nl"
    +
    +PS1='$ '
    +PS2='> '
    +PS4='+ '
    +
    +# Ensure predictable behavior from utilities with locale-dependent output.
    +LC_ALL=C
    +export LC_ALL
    +LANGUAGE=C
    +export LANGUAGE
    +
    +# We cannot yet rely on "unset" to work, but we need these variables
    +# to be unset--not just set to an empty or harmless value--now, to
    +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
    +# also avoids known problems related to "unset" and subshell syntax
    +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
    +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
    +do eval test \${$as_var+y} \
    +  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
    +done
    +
    +# Ensure that fds 0, 1, and 2 are open.
    +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
    +if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
    +
    +# The user is always right.
    +if ${PATH_SEPARATOR+false} :; then
    +  PATH_SEPARATOR=:
    +  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    +    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
    +      PATH_SEPARATOR=';'
    +  }
    +fi
    +
    +
    +# Find who we are.  Look in the path if we contain no directory separator.
    +as_myself=
    +case $0 in #((
    +  *[\\/]* ) as_myself=$0 ;;
    +  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
    +  done
    +IFS=$as_save_IFS
    +
    +     ;;
    +esac
    +# We did not find ourselves, most probably we were run as `sh COMMAND'
    +# in which case we are not to be found in the path.
    +if test "x$as_myself" = x; then
    +  as_myself=$0
    +fi
    +if test ! -f "$as_myself"; then
    +  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
    +  exit 1
    +fi
    +
    +
    +
    +# as_fn_error STATUS ERROR [LINENO LOG_FD]
    +# ----------------------------------------
    +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
    +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
    +# script with STATUS, using 1 if that was 0.
    +as_fn_error ()
    +{
    +  as_status=$1; test $as_status -eq 0 && as_status=1
    +  if test "$4"; then
    +    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
    +  fi
    +  printf "%s\n" "$as_me: error: $2" >&2
    +  as_fn_exit $as_status
    +} # as_fn_error
    +
    +
    +
    +# as_fn_set_status STATUS
    +# -----------------------
    +# Set $? to STATUS, without forking.
    +as_fn_set_status ()
    +{
    +  return $1
    +} # as_fn_set_status
    +
    +# as_fn_exit STATUS
    +# -----------------
    +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
    +as_fn_exit ()
    +{
    +  set +e
    +  as_fn_set_status $1
    +  exit $1
    +} # as_fn_exit
    +
    +# as_fn_unset VAR
    +# ---------------
    +# Portably unset VAR.
    +as_fn_unset ()
    +{
    +  { eval $1=; unset $1;}
    +}
    +as_unset=as_fn_unset
    +
    +# as_fn_append VAR VALUE
    +# ----------------------
    +# Append the text in VALUE to the end of the definition contained in VAR. Take
    +# advantage of any shell optimizations that allow amortized linear growth over
    +# repeated appends, instead of the typical quadratic growth present in naive
    +# implementations.
    +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
    +then :
    +  eval 'as_fn_append ()
    +  {
    +    eval $1+=\$2
    +  }'
    +else $as_nop
    +  as_fn_append ()
    +  {
    +    eval $1=\$$1\$2
    +  }
    +fi # as_fn_append
    +
    +# as_fn_arith ARG...
    +# ------------------
    +# Perform arithmetic evaluation on the ARGs, and store the result in the
    +# global $as_val. Take advantage of shells that can avoid forks. The arguments
    +# must be portable across $(()) and expr.
    +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
    +then :
    +  eval 'as_fn_arith ()
    +  {
    +    as_val=$(( $* ))
    +  }'
    +else $as_nop
    +  as_fn_arith ()
    +  {
    +    as_val=`expr "$@" || test $? -eq 1`
    +  }
    +fi # as_fn_arith
    +
    +
    +if expr a : '\(a\)' >/dev/null 2>&1 &&
    +   test "X`expr 00001 : '.*\(...\)'`" = X001; then
    +  as_expr=expr
    +else
    +  as_expr=false
    +fi
    +
    +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
    +  as_basename=basename
    +else
    +  as_basename=false
    +fi
    +
    +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
    +  as_dirname=dirname
    +else
    +  as_dirname=false
    +fi
    +
    +as_me=`$as_basename -- "$0" ||
    +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
    +	 X"$0" : 'X\(//\)$' \| \
    +	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X/"$0" |
    +    sed '/^.*\/\([^/][^/]*\)\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\/\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\/\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +
    +# Avoid depending upon Character Ranges.
    +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
    +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
    +as_cr_digits='0123456789'
    +as_cr_alnum=$as_cr_Letters$as_cr_digits
    +
    +
    +# Determine whether it's possible to make 'echo' print without a newline.
    +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
    +# for compatibility with existing Makefiles.
    +ECHO_C= ECHO_N= ECHO_T=
    +case `echo -n x` in #(((((
    +-n*)
    +  case `echo 'xy\c'` in
    +  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
    +  xy)  ECHO_C='\c';;
    +  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
    +       ECHO_T='	';;
    +  esac;;
    +*)
    +  ECHO_N='-n';;
    +esac
    +
    +# For backward compatibility with old third-party macros, we provide
    +# the shell variables $as_echo and $as_echo_n.  New code should use
    +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
    +as_echo='printf %s\n'
    +as_echo_n='printf %s'
    +
    +rm -f conf$$ conf$$.exe conf$$.file
    +if test -d conf$$.dir; then
    +  rm -f conf$$.dir/conf$$.file
    +else
    +  rm -f conf$$.dir
    +  mkdir conf$$.dir 2>/dev/null
    +fi
    +if (echo >conf$$.file) 2>/dev/null; then
    +  if ln -s conf$$.file conf$$ 2>/dev/null; then
    +    as_ln_s='ln -s'
    +    # ... but there are two gotchas:
    +    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    +    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    +    # In both cases, we have to default to `cp -pR'.
    +    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    +      as_ln_s='cp -pR'
    +  elif ln conf$$.file conf$$ 2>/dev/null; then
    +    as_ln_s=ln
    +  else
    +    as_ln_s='cp -pR'
    +  fi
    +else
    +  as_ln_s='cp -pR'
    +fi
    +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
    +rmdir conf$$.dir 2>/dev/null
    +
    +
    +# as_fn_mkdir_p
    +# -------------
    +# Create "$as_dir" as a directory, including parents if necessary.
    +as_fn_mkdir_p ()
    +{
    +
    +  case $as_dir in #(
    +  -*) as_dir=./$as_dir;;
    +  esac
    +  test -d "$as_dir" || eval $as_mkdir_p || {
    +    as_dirs=
    +    while :; do
    +      case $as_dir in #(
    +      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
    +      *) as_qdir=$as_dir;;
    +      esac
    +      as_dirs="'$as_qdir' $as_dirs"
    +      as_dir=`$as_dirname -- "$as_dir" ||
    +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    +	 X"$as_dir" : 'X\(//\)[^/]' \| \
    +	 X"$as_dir" : 'X\(//\)$' \| \
    +	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X"$as_dir" |
    +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)[^/].*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +      test -d "$as_dir" && break
    +    done
    +    test -z "$as_dirs" || eval "mkdir $as_dirs"
    +  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
    +
    +
    +} # as_fn_mkdir_p
    +if mkdir -p . 2>/dev/null; then
    +  as_mkdir_p='mkdir -p "$as_dir"'
    +else
    +  test -d ./-p && rmdir ./-p
    +  as_mkdir_p=false
    +fi
    +
    +
    +# as_fn_executable_p FILE
    +# -----------------------
    +# Test if FILE is an executable regular file.
    +as_fn_executable_p ()
    +{
    +  test -f "$1" && test -x "$1"
    +} # as_fn_executable_p
    +as_test_x='test -x'
    +as_executable_p=as_fn_executable_p
    +
    +# Sed expression to map a string onto a valid CPP name.
    +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
    +
    +# Sed expression to map a string onto a valid variable name.
    +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
    +
    +
    +exec 6>&1
    +## ----------------------------------- ##
    +## Main body of $CONFIG_STATUS script. ##
    +## ----------------------------------- ##
    +_ASEOF
    +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +# Save the log message, to keep $0 and so on meaningful, and to
    +# report actual input values of CONFIG_FILES etc. instead of their
    +# values after options handling.
    +ac_log="
    +This file was extended by amuse-simplex $as_me 1.0, which was
    +generated by GNU Autoconf 2.71.  Invocation command line was
    +
    +  CONFIG_FILES    = $CONFIG_FILES
    +  CONFIG_HEADERS  = $CONFIG_HEADERS
    +  CONFIG_LINKS    = $CONFIG_LINKS
    +  CONFIG_COMMANDS = $CONFIG_COMMANDS
    +  $ $0 $@
    +
    +on `(hostname || uname -n) 2>/dev/null | sed 1q`
    +"
    +
    +_ACEOF
    +
    +case $ac_config_files in *"
    +"*) set x $ac_config_files; shift; ac_config_files=$*;;
    +esac
    +
    +
    +
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +# Files that config.status was made for.
    +config_files="$ac_config_files"
    +
    +_ACEOF
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +ac_cs_usage="\
    +\`$as_me' instantiates files and other configuration actions
    +from templates according to the current configuration.  Unless the files
    +and actions are specified as TAGs, all are instantiated by default.
    +
    +Usage: $0 [OPTION]... [TAG]...
    +
    +  -h, --help       print this help, then exit
    +  -V, --version    print version number and configuration settings, then exit
    +      --config     print configuration, then exit
    +  -q, --quiet, --silent
    +                   do not print progress messages
    +  -d, --debug      don't remove temporary files
    +      --recheck    update $as_me by reconfiguring in the same conditions
    +      --file=FILE[:TEMPLATE]
    +                   instantiate the configuration file FILE
    +
    +Configuration files:
    +$config_files
    +
    +Report bugs to the package provider."
    +
    +_ACEOF
    +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
    +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +ac_cs_config='$ac_cs_config_escaped'
    +ac_cs_version="\\
    +amuse-simplex config.status 1.0
    +configured by $0, generated by GNU Autoconf 2.71,
    +  with options \\"\$ac_cs_config\\"
    +
    +Copyright (C) 2021 Free Software Foundation, Inc.
    +This config.status script is free software; the Free Software Foundation
    +gives unlimited permission to copy, distribute and modify it."
    +
    +ac_pwd='$ac_pwd'
    +srcdir='$srcdir'
    +AWK='$AWK'
    +test -n "\$AWK" || AWK=awk
    +_ACEOF
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +# The default lists apply if the user does not specify any file.
    +ac_need_defaults=:
    +while test $# != 0
    +do
    +  case $1 in
    +  --*=?*)
    +    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    +    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    +    ac_shift=:
    +    ;;
    +  --*=)
    +    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    +    ac_optarg=
    +    ac_shift=:
    +    ;;
    +  *)
    +    ac_option=$1
    +    ac_optarg=$2
    +    ac_shift=shift
    +    ;;
    +  esac
    +
    +  case $ac_option in
    +  # Handling of the options.
    +  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    +    ac_cs_recheck=: ;;
    +  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    +    printf "%s\n" "$ac_cs_version"; exit ;;
    +  --config | --confi | --conf | --con | --co | --c )
    +    printf "%s\n" "$ac_cs_config"; exit ;;
    +  --debug | --debu | --deb | --de | --d | -d )
    +    debug=: ;;
    +  --file | --fil | --fi | --f )
    +    $ac_shift
    +    case $ac_optarg in
    +    *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    +    '') as_fn_error $? "missing file argument" ;;
    +    esac
    +    as_fn_append CONFIG_FILES " '$ac_optarg'"
    +    ac_need_defaults=false;;
    +  --he | --h |  --help | --hel | -h )
    +    printf "%s\n" "$ac_cs_usage"; exit ;;
    +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    +  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    +    ac_cs_silent=: ;;
    +
    +  # This is an error.
    +  -*) as_fn_error $? "unrecognized option: \`$1'
    +Try \`$0 --help' for more information." ;;
    +
    +  *) as_fn_append ac_config_targets " $1"
    +     ac_need_defaults=false ;;
    +
    +  esac
    +  shift
    +done
    +
    +ac_configure_extra_args=
    +
    +if $ac_cs_silent; then
    +  exec 6>/dev/null
    +  ac_configure_extra_args="$ac_configure_extra_args --silent"
    +fi
    +
    +_ACEOF
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +if \$ac_cs_recheck; then
    +  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
    +  shift
    +  \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
    +  CONFIG_SHELL='$SHELL'
    +  export CONFIG_SHELL
    +  exec "\$@"
    +fi
    +
    +_ACEOF
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +exec 5>>config.log
    +{
    +  echo
    +  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
    +## Running $as_me. ##
    +_ASBOX
    +  printf "%s\n" "$ac_log"
    +} >&5
    +
    +_ACEOF
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +_ACEOF
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +
    +# Handling of arguments.
    +for ac_config_target in $ac_config_targets
    +do
    +  case $ac_config_target in
    +    "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;;
    +
    +  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
    +  esac
    +done
    +
    +
    +# If the user did not use the arguments to specify the items to instantiate,
    +# then the envvar interface is used.  Set only those that are not.
    +# We use the long form for the default assignment because of an extremely
    +# bizarre bug on SunOS 4.1.3.
    +if $ac_need_defaults; then
    +  test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
    +fi
    +
    +# Have a temporary directory for convenience.  Make it in the build tree
    +# simply because there is no reason against having it here, and in addition,
    +# creating and moving files from /tmp can sometimes cause problems.
    +# Hook for its removal unless debugging.
    +# Note that there is a small window in which the directory will not be cleaned:
    +# after its creation but before its name has been assigned to `$tmp'.
    +$debug ||
    +{
    +  tmp= ac_tmp=
    +  trap 'exit_status=$?
    +  : "${ac_tmp:=$tmp}"
    +  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
    +' 0
    +  trap 'as_fn_exit 1' 1 2 13 15
    +}
    +# Create a (secure) tmp directory for tmp files.
    +
    +{
    +  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
    +  test -d "$tmp"
    +}  ||
    +{
    +  tmp=./conf$$-$RANDOM
    +  (umask 077 && mkdir "$tmp")
    +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
    +ac_tmp=$tmp
    +
    +# Set up the scripts for CONFIG_FILES section.
    +# No need to generate them if there are no CONFIG_FILES.
    +# This happens for instance with `./config.status config.h'.
    +if test -n "$CONFIG_FILES"; then
    +
    +
    +ac_cr=`echo X | tr X '\015'`
    +# On cygwin, bash can eat \r inside `` if the user requested igncr.
    +# But we know of no other shell where ac_cr would be empty at this
    +# point, so we can use a bashism as a fallback.
    +if test "x$ac_cr" = x; then
    +  eval ac_cr=\$\'\\r\'
    +fi
    +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
    +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
    +  ac_cs_awk_cr='\\r'
    +else
    +  ac_cs_awk_cr=$ac_cr
    +fi
    +
    +echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
    +_ACEOF
    +
    +
    +{
    +  echo "cat >conf$$subs.awk <<_ACEOF" &&
    +  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
    +  echo "_ACEOF"
    +} >conf$$subs.sh ||
    +  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
    +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
    +ac_delim='%!_!# '
    +for ac_last_try in false false false false false :; do
    +  . ./conf$$subs.sh ||
    +    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
    +
    +  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
    +  if test $ac_delim_n = $ac_delim_num; then
    +    break
    +  elif $ac_last_try; then
    +    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
    +  else
    +    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
    +  fi
    +done
    +rm -f conf$$subs.sh
    +
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
    +_ACEOF
    +sed -n '
    +h
    +s/^/S["/; s/!.*/"]=/
    +p
    +g
    +s/^[^!]*!//
    +:repl
    +t repl
    +s/'"$ac_delim"'$//
    +t delim
    +:nl
    +h
    +s/\(.\{148\}\)..*/\1/
    +t more1
    +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
    +p
    +n
    +b repl
    +:more1
    +s/["\\]/\\&/g; s/^/"/; s/$/"\\/
    +p
    +g
    +s/.\{148\}//
    +t nl
    +:delim
    +h
    +s/\(.\{148\}\)..*/\1/
    +t more2
    +s/["\\]/\\&/g; s/^/"/; s/$/"/
    +p
    +b
    +:more2
    +s/["\\]/\\&/g; s/^/"/; s/$/"\\/
    +p
    +g
    +s/.\{148\}//
    +t delim
    +' >$CONFIG_STATUS || ac_write_fail=1
    +rm -f conf$$subs.awk
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +_ACAWK
    +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
    +  for (key in S) S_is_set[key] = 1
    +  FS = ""
    +
    +}
    +{
    +  line = $ 0
    +  nfields = split(line, field, "@")
    +  substed = 0
    +  len = length(field[1])
    +  for (i = 2; i < nfields; i++) {
    +    key = field[i]
    +    keylen = length(key)
    +    if (S_is_set[key]) {
    +      value = S[key]
    +      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
    +      len += length(value) + length(field[++i])
    +      substed = 1
    +    } else
    +      len += 1 + keylen
    +  }
    +
    +  print line
    +}
    +
    +_ACAWK
    +_ACEOF
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
    +  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
    +else
    +  cat
    +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
    +  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
    +_ACEOF
    +
    +# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
    +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
    +# trailing colons and then remove the whole line if VPATH becomes empty
    +# (actually we leave an empty line to preserve line numbers).
    +if test "x$srcdir" = x.; then
    +  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
    +h
    +s///
    +s/^/:/
    +s/[	 ]*$/:/
    +s/:\$(srcdir):/:/g
    +s/:\${srcdir}:/:/g
    +s/:@srcdir@:/:/g
    +s/^:*//
    +s/:*$//
    +x
    +s/\(=[	 ]*\).*/\1/
    +G
    +s/\n//
    +s/^[^=]*=[	 ]*$//
    +}'
    +fi
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +fi # test -n "$CONFIG_FILES"
    +
    +
    +eval set X "  :F $CONFIG_FILES      "
    +shift
    +for ac_tag
    +do
    +  case $ac_tag in
    +  :[FHLC]) ac_mode=$ac_tag; continue;;
    +  esac
    +  case $ac_mode$ac_tag in
    +  :[FHL]*:*);;
    +  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
    +  :[FH]-) ac_tag=-:-;;
    +  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
    +  esac
    +  ac_save_IFS=$IFS
    +  IFS=:
    +  set x $ac_tag
    +  IFS=$ac_save_IFS
    +  shift
    +  ac_file=$1
    +  shift
    +
    +  case $ac_mode in
    +  :L) ac_source=$1;;
    +  :[FH])
    +    ac_file_inputs=
    +    for ac_f
    +    do
    +      case $ac_f in
    +      -) ac_f="$ac_tmp/stdin";;
    +      *) # Look for the file first in the build tree, then in the source tree
    +	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
    +	 # because $ac_f cannot contain `:'.
    +	 test -f "$ac_f" ||
    +	   case $ac_f in
    +	   [\\/$]*) false;;
    +	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
    +	   esac ||
    +	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
    +      esac
    +      case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
    +      as_fn_append ac_file_inputs " '$ac_f'"
    +    done
    +
    +    # Let's still pretend it is `configure' which instantiates (i.e., don't
    +    # use $as_me), people would be surprised to read:
    +    #    /* config.h.  Generated by config.status.  */
    +    configure_input='Generated from '`
    +	  printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
    +	`' by configure.'
    +    if test x"$ac_file" != x-; then
    +      configure_input="$ac_file.  $configure_input"
    +      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
    +printf "%s\n" "$as_me: creating $ac_file" >&6;}
    +    fi
    +    # Neutralize special characters interpreted by sed in replacement strings.
    +    case $configure_input in #(
    +    *\&* | *\|* | *\\* )
    +       ac_sed_conf_input=`printf "%s\n" "$configure_input" |
    +       sed 's/[\\\\&|]/\\\\&/g'`;; #(
    +    *) ac_sed_conf_input=$configure_input;;
    +    esac
    +
    +    case $ac_tag in
    +    *:-:* | *:-) cat >"$ac_tmp/stdin" \
    +      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
    +    esac
    +    ;;
    +  esac
    +
    +  ac_dir=`$as_dirname -- "$ac_file" ||
    +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    +	 X"$ac_file" : 'X\(//\)[^/]' \| \
    +	 X"$ac_file" : 'X\(//\)$' \| \
    +	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
    +printf "%s\n" X"$ac_file" |
    +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)[^/].*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\/\)$/{
    +	    s//\1/
    +	    q
    +	  }
    +	  /^X\(\/\).*/{
    +	    s//\1/
    +	    q
    +	  }
    +	  s/.*/./; q'`
    +  as_dir="$ac_dir"; as_fn_mkdir_p
    +  ac_builddir=.
    +
    +case "$ac_dir" in
    +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
    +*)
    +  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
    +  # A ".." for each directory in $ac_dir_suffix.
    +  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
    +  case $ac_top_builddir_sub in
    +  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
    +  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
    +  esac ;;
    +esac
    +ac_abs_top_builddir=$ac_pwd
    +ac_abs_builddir=$ac_pwd$ac_dir_suffix
    +# for backward compatibility:
    +ac_top_builddir=$ac_top_build_prefix
    +
    +case $srcdir in
    +  .)  # We are building in place.
    +    ac_srcdir=.
    +    ac_top_srcdir=$ac_top_builddir_sub
    +    ac_abs_top_srcdir=$ac_pwd ;;
    +  [\\/]* | ?:[\\/]* )  # Absolute name.
    +    ac_srcdir=$srcdir$ac_dir_suffix;
    +    ac_top_srcdir=$srcdir
    +    ac_abs_top_srcdir=$srcdir ;;
    +  *) # Relative name.
    +    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    +    ac_top_srcdir=$ac_top_build_prefix$srcdir
    +    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
    +esac
    +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
    +
    +
    +  case $ac_mode in
    +  :F)
    +  #
    +  # CONFIG_FILE
    +  #
    +
    +_ACEOF
    +
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +# If the template does not know about datarootdir, expand it.
    +# FIXME: This hack should be removed a few years after 2.60.
    +ac_datarootdir_hack=; ac_datarootdir_seen=
    +ac_sed_dataroot='
    +/datarootdir/ {
    +  p
    +  q
    +}
    +/@datadir@/p
    +/@docdir@/p
    +/@infodir@/p
    +/@localedir@/p
    +/@mandir@/p'
    +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
    +*datarootdir*) ac_datarootdir_seen=yes;;
    +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
    +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
    +_ACEOF
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +  ac_datarootdir_hack='
    +  s&@datadir@&$datadir&g
    +  s&@docdir@&$docdir&g
    +  s&@infodir@&$infodir&g
    +  s&@localedir@&$localedir&g
    +  s&@mandir@&$mandir&g
    +  s&\\\${datarootdir}&$datarootdir&g' ;;
    +esac
    +_ACEOF
    +
    +# Neutralize VPATH when `$srcdir' = `.'.
    +# Shell code in configure.ac might set extrasub.
    +# FIXME: do we really want to maintain this feature?
    +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    +ac_sed_extra="$ac_vpsub
    +$extrasub
    +_ACEOF
    +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    +:t
    +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
    +s|@configure_input@|$ac_sed_conf_input|;t t
    +s&@top_builddir@&$ac_top_builddir_sub&;t t
    +s&@top_build_prefix@&$ac_top_build_prefix&;t t
    +s&@srcdir@&$ac_srcdir&;t t
    +s&@abs_srcdir@&$ac_abs_srcdir&;t t
    +s&@top_srcdir@&$ac_top_srcdir&;t t
    +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
    +s&@builddir@&$ac_builddir&;t t
    +s&@abs_builddir@&$ac_abs_builddir&;t t
    +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
    +$ac_datarootdir_hack
    +"
    +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
    +  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    +
    +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
    +  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
    +  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
    +      "$ac_tmp/out"`; test -z "$ac_out"; } &&
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
    +which seems to be undefined.  Please make sure it is defined" >&5
    +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
    +which seems to be undefined.  Please make sure it is defined" >&2;}
    +
    +  rm -f "$ac_tmp/stdin"
    +  case $ac_file in
    +  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
    +  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
    +  esac \
    +  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    + ;;
    +
    +
    +
    +  esac
    +
    +done # for ac_tag
    +
    +
    +as_fn_exit 0
    +_ACEOF
    +ac_clean_files=$ac_clean_files_save
    +
    +test $ac_write_fail = 0 ||
    +  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
    +
    +
    +# configure is writing to config.log, and then calls config.status.
    +# config.status does its own redirection, appending to config.log.
    +# Unfortunately, on DOS this fails, as config.log is still kept open
    +# by configure, so config.status won't be able to write to it; its
    +# output is simply discarded.  So we exec the FD to /dev/null,
    +# effectively closing config.log, so it can be properly (re)opened and
    +# appended to by config.status.  When coming back to configure, we
    +# need to make the FD available again.
    +if test "$no_create" != yes; then
    +  ac_cs_success=:
    +  ac_config_status_args=
    +  test "$silent" = yes &&
    +    ac_config_status_args="$ac_config_status_args --quiet"
    +  exec 5>/dev/null
    +  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
    +  exec 5>>config.log
    +  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
    +  # would make configure fail if this is the last instruction.
    +  $ac_cs_success || as_fn_exit 1
    +fi
    +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
    +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
    +fi
    +
    +
    +
    diff --git a/src/amuse_simplex/support/configure.ac b/src/amuse_simplex/support/configure.ac
    new file mode 100644
    index 0000000000..1360887d62
    --- /dev/null
    +++ b/src/amuse_simplex/support/configure.ac
    @@ -0,0 +1,38 @@
    +AC_CONFIG_AUX_DIR([shared])
    +AC_CONFIG_MACRO_DIRS([shared/m4])
    +
    +AC_INIT([amuse-simplex], [1.0])
    +
    +# Pick up Conda env or virtualenv
    +AMUSE_VENV()
    +
    +# Set CPU_COUNT
    +AX_COUNT_CPUS()
    +AC_SUBST(CPU_COUNT)
    +
    +# Find the compiler(s)
    +AC_PROG_CXX()
    +
    +# Find tools for creating static libraries
    +AC_CHECK_TARGET_TOOL([AR], [ar], [:])
    +AS_IF([test $AR = ":"], [AC_MSG_ERROR([ar command not found.])])
    +
    +AC_PROG_RANLIB()
    +AS_IF([test $RANLIB = ":"], [AC_MSG_ERROR([ranlib command not found.])])
    +
    +# Find external dependencies
    +AC_LANG_PUSH([C++])
    +
    +AX_MPI()
    +
    +AX_PATH_GSL(1.0, [FOUND_GSL=yes])
    +AX_LIB_HDF5()
    +AMUSE_LIB_QHULL()
    +AMUSE_LIB_HEALPIX_CXX()
    +
    +AC_LANG_POP([C++])
    +
    +# Generate output
    +AC_CONFIG_FILES([config.mk])
    +AC_OUTPUT
    +
    diff --git a/src/amuse_simplex/support/shared b/src/amuse_simplex/support/shared
    new file mode 120000
    index 0000000000..00817b0193
    --- /dev/null
    +++ b/src/amuse_simplex/support/shared
    @@ -0,0 +1 @@
    +../../../support/shared
    \ No newline at end of file
    diff --git a/src/tests/codes_tests/test_simplex.py b/src/amuse_simplex/tests/test_simplex.py
    similarity index 97%
    rename from src/tests/codes_tests/test_simplex.py
    rename to src/amuse_simplex/tests/test_simplex.py
    index 7212534609..ae73685338 100644
    --- a/src/tests/codes_tests/test_simplex.py
    +++ b/src/amuse_simplex/tests/test_simplex.py
    @@ -1,8 +1,8 @@
     import os.path
     import numpy
    -from amuse.test.amusetest import TestWithMPI
    +from amuse.support.testing.amusetest import TestWithMPI
     
    -from amuse.community.simplex.interface import SimpleXInterface, SimpleX, SimpleXSplitSet
    +from amuse_simplex.interface import SimpleXInterface, SimpleX, SimpleXSplitSet
     from amuse.units import units
     from amuse.datamodel import Particles
     from amuse.datamodel import Particle
    @@ -394,6 +394,20 @@ def test12(self):
             self.assertAlmostRelativeEquals(0.0750819123073, radiative.particles.xion.mean(), 1)
             radiative.stop()
     
    +    def test_cooling(self):
    +        # tests whether the input data files are found correctly
    +        instance = SimpleX(number_of_workers=1)
    +
    +        instance.parameters.metal_cooling_flag = 1
    +
    +        input_file = os.path.join(os.path.dirname(__file__), "test_simplex_data.txt")
    +        particles = particles_from_input_file(input_file)
    +        N = len(particles)
    +        instance.particles.add_particles(particles)
    +        instance.commit_particles()
    +        instance.evolve_model(0.25 | units.Myr)
    +        self.assertEqual(len(instance.particles), N)
    +
     
     class TestSimpleXSplitSet(TestWithMPI):
     
    diff --git a/src/tests/codes_tests/test_simplex_data.txt b/src/amuse_simplex/tests/test_simplex_data.txt
    similarity index 100%
    rename from src/tests/codes_tests/test_simplex_data.txt
    rename to src/amuse_simplex/tests/test_simplex_data.txt
    diff --git a/support/aclocal.m4 b/support/aclocal.m4
    index d357fb2f62..9ac4fdd4ae 100644
    --- a/support/aclocal.m4
    +++ b/support/aclocal.m4
    @@ -16,6 +16,8 @@ m4_include([shared/m4/amuse_conda.m4])
     m4_include([shared/m4/amuse_cuda.m4])
     m4_include([shared/m4/amuse_download.m4])
     m4_include([shared/m4/amuse_lib.m4])
    +m4_include([shared/m4/amuse_lib_healpix.m4])
    +m4_include([shared/m4/amuse_lib_qhull.m4])
     m4_include([shared/m4/amuse_opencl.m4])
     m4_include([shared/m4/ax_blas.m4])
     m4_include([shared/m4/ax_check_gnu_make.m4])
    diff --git a/support/configure b/support/configure
    index 7e1e200f4d..e7e0114cd1 100755
    --- a/support/configure
    +++ b/support/configure
    @@ -712,6 +712,12 @@ GMAKE
     FOUND_SAPPORO_LIGHT
     SAPPORO_LIGHT_LIBS
     SAPPORO_LIGHT_CFLAGS
    +HEALPIX_CXX_LIBS
    +HEALPIX_CXX_CFLAGS
    +ac_ct_CXX
    +CXXFLAGS
    +QHULL_FLAGS
    +QHULL_LIBS
     NETCDF4_FLIBS
     NETCDF4_FFLAGS
     NETCDF4_FC
    @@ -896,6 +902,11 @@ MPFR_CFLAGS
     MPFR_LIBS
     FFTW_CFLAGS
     FFTW_LIBS
    +CXX
    +CXXFLAGS
    +CCC
    +HEALPIX_CXX_CFLAGS
    +HEALPIX_CXX_LIBS
     SAPPORO_LIGHT_CFLAGS
     SAPPORO_LIGHT_LIBS'
     
    @@ -1567,6 +1578,12 @@ Some influential environment variables:
       MPFR_LIBS   linker flags for MPFR, overriding pkg-config
       FFTW_CFLAGS C compiler flags for FFTW, overriding pkg-config
       FFTW_LIBS   linker flags for FFTW, overriding pkg-config
    +  CXX         C++ compiler command
    +  CXXFLAGS    C++ compiler flags
    +  HEALPIX_CXX_CFLAGS
    +              C compiler flags for HEALPIX_CXX, overriding pkg-config
    +  HEALPIX_CXX_LIBS
    +              linker flags for HEALPIX_CXX, overriding pkg-config
       SAPPORO_LIGHT_CFLAGS
                   C compiler flags for SAPPORO_LIGHT, overriding pkg-config
       SAPPORO_LIGHT_LIBS
    @@ -1872,6 +1889,92 @@ printf "%s\n" "$ac_res" >&6; }
       eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
     
     } # ac_fn_c_check_header_compile
    +
    +# ac_fn_cxx_try_compile LINENO
    +# ----------------------------
    +# Try to compile conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_cxx_try_compile ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam
    +  if { { ac_try="$ac_compile"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compile") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_cxx_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest.$ac_objext
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_cxx_try_compile
    +
    +# ac_fn_cxx_try_link LINENO
    +# -------------------------
    +# Try to link conftest.$ac_ext, and return whether this succeeded.
    +ac_fn_cxx_try_link ()
    +{
    +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    +  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
    +  if { { ac_try="$ac_link"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_link") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    grep -v '^ *+' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +    mv -f conftest.er1 conftest.err
    +  fi
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; } && {
    +	 test -z "$ac_cxx_werror_flag" ||
    +	 test ! -s conftest.err
    +       } && test -s conftest$ac_exeext && {
    +	 test "$cross_compiling" = yes ||
    +	 test -x conftest$ac_exeext
    +       }
    +then :
    +  ac_retval=0
    +else $as_nop
    +  printf "%s\n" "$as_me: failed program was:" >&5
    +sed 's/^/| /' conftest.$ac_ext >&5
    +
    +	ac_retval=1
    +fi
    +  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
    +  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
    +  # interfere with the next link command; also delete a directory that is
    +  # left behind by Apple's compiler.  We do this before executing the actions.
    +  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
    +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
    +  as_fn_set_status $ac_retval
    +
    +} # ac_fn_cxx_try_link
     ac_configure_args_raw=
     for ac_arg
     do
    @@ -2484,6 +2587,222 @@ as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
     as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
     as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
     as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
    +# Test code for whether the C++ compiler supports C++98 (global declarations)
    +ac_cxx_conftest_cxx98_globals='
    +// Does the compiler advertise C++98 conformance?
    +#if !defined __cplusplus || __cplusplus < 199711L
    +# error "Compiler does not advertise C++98 conformance"
    +#endif
    +
    +// These inclusions are to reject old compilers that
    +// lack the unsuffixed header files.
    +#include 
    +#include 
    +
    +//  and  are *not* freestanding headers in C++98.
    +extern void assert (int);
    +namespace std {
    +  extern int strcmp (const char *, const char *);
    +}
    +
    +// Namespaces, exceptions, and templates were all added after "C++ 2.0".
    +using std::exception;
    +using std::strcmp;
    +
    +namespace {
    +
    +void test_exception_syntax()
    +{
    +  try {
    +    throw "test";
    +  } catch (const char *s) {
    +    // Extra parentheses suppress a warning when building autoconf itself,
    +    // due to lint rules shared with more typical C programs.
    +    assert (!(strcmp) (s, "test"));
    +  }
    +}
    +
    +template  struct test_template
    +{
    +  T const val;
    +  explicit test_template(T t) : val(t) {}
    +  template  T add(U u) { return static_cast(u) + val; }
    +};
    +
    +} // anonymous namespace
    +'
    +
    +# Test code for whether the C++ compiler supports C++98 (body of main)
    +ac_cxx_conftest_cxx98_main='
    +  assert (argc);
    +  assert (! argv[0]);
    +{
    +  test_exception_syntax ();
    +  test_template tt (2.0);
    +  assert (tt.add (4) == 6.0);
    +  assert (true && !false);
    +}
    +'
    +
    +# Test code for whether the C++ compiler supports C++11 (global declarations)
    +ac_cxx_conftest_cxx11_globals='
    +// Does the compiler advertise C++ 2011 conformance?
    +#if !defined __cplusplus || __cplusplus < 201103L
    +# error "Compiler does not advertise C++11 conformance"
    +#endif
    +
    +namespace cxx11test
    +{
    +  constexpr int get_val() { return 20; }
    +
    +  struct testinit
    +  {
    +    int i;
    +    double d;
    +  };
    +
    +  class delegate
    +  {
    +  public:
    +    delegate(int n) : n(n) {}
    +    delegate(): delegate(2354) {}
    +
    +    virtual int getval() { return this->n; };
    +  protected:
    +    int n;
    +  };
    +
    +  class overridden : public delegate
    +  {
    +  public:
    +    overridden(int n): delegate(n) {}
    +    virtual int getval() override final { return this->n * 2; }
    +  };
    +
    +  class nocopy
    +  {
    +  public:
    +    nocopy(int i): i(i) {}
    +    nocopy() = default;
    +    nocopy(const nocopy&) = delete;
    +    nocopy & operator=(const nocopy&) = delete;
    +  private:
    +    int i;
    +  };
    +
    +  // for testing lambda expressions
    +  template  Ret eval(Fn f, Ret v)
    +  {
    +    return f(v);
    +  }
    +
    +  // for testing variadic templates and trailing return types
    +  template  auto sum(V first) -> V
    +  {
    +    return first;
    +  }
    +  template  auto sum(V first, Args... rest) -> V
    +  {
    +    return first + sum(rest...);
    +  }
    +}
    +'
    +
    +# Test code for whether the C++ compiler supports C++11 (body of main)
    +ac_cxx_conftest_cxx11_main='
    +{
    +  // Test auto and decltype
    +  auto a1 = 6538;
    +  auto a2 = 48573953.4;
    +  auto a3 = "String literal";
    +
    +  int total = 0;
    +  for (auto i = a3; *i; ++i) { total += *i; }
    +
    +  decltype(a2) a4 = 34895.034;
    +}
    +{
    +  // Test constexpr
    +  short sa[cxx11test::get_val()] = { 0 };
    +}
    +{
    +  // Test initializer lists
    +  cxx11test::testinit il = { 4323, 435234.23544 };
    +}
    +{
    +  // Test range-based for
    +  int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
    +                 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
    +  for (auto &x : array) { x += 23; }
    +}
    +{
    +  // Test lambda expressions
    +  using cxx11test::eval;
    +  assert (eval ([](int x) { return x*2; }, 21) == 42);
    +  double d = 2.0;
    +  assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
    +  assert (d == 5.0);
    +  assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
    +  assert (d == 5.0);
    +}
    +{
    +  // Test use of variadic templates
    +  using cxx11test::sum;
    +  auto a = sum(1);
    +  auto b = sum(1, 2);
    +  auto c = sum(1.0, 2.0, 3.0);
    +}
    +{
    +  // Test constructor delegation
    +  cxx11test::delegate d1;
    +  cxx11test::delegate d2();
    +  cxx11test::delegate d3(45);
    +}
    +{
    +  // Test override and final
    +  cxx11test::overridden o1(55464);
    +}
    +{
    +  // Test nullptr
    +  char *c = nullptr;
    +}
    +{
    +  // Test template brackets
    +  test_template<::test_template> v(test_template(12));
    +}
    +{
    +  // Unicode literals
    +  char const *utf8 = u8"UTF-8 string \u2500";
    +  char16_t const *utf16 = u"UTF-8 string \u2500";
    +  char32_t const *utf32 = U"UTF-32 string \u2500";
    +}
    +'
    +
    +# Test code for whether the C compiler supports C++11 (complete).
    +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
    +${ac_cxx_conftest_cxx11_globals}
    +
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_cxx_conftest_cxx98_main}
    +  ${ac_cxx_conftest_cxx11_main}
    +  return ok;
    +}
    +"
    +
    +# Test code for whether the C compiler supports C++98 (complete).
    +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
    +int
    +main (int argc, char **argv)
    +{
    +  int ok = 0;
    +  ${ac_cxx_conftest_cxx98_main}
    +  return ok;
    +}
    +"
    +
     
     # Auxiliary files required by this configure script.
     ac_aux_files="config.guess config.sub"
    @@ -4330,6 +4649,48 @@ else $as_nop
             { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
     printf "%s\n" "no" >&6; }
     
    +fi
    +
    +
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for conda package qhull" >&5
    +printf %s "checking for conda package qhull... " >&6; }
    +    ax_conda_package_line="$(echo $amuse_conda_list | tr '^' '\n' | grep '^qhull ')"
    +    if test "$?" = "0"
    +then :
    +
    +        # FOUND_QHULL="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')"
    +
    +            FOUND_QHULL="yes"
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +else $as_nop
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +fi
    +
    +
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for conda package healpix_cxx" >&5
    +printf %s "checking for conda package healpix_cxx... " >&6; }
    +    ax_conda_package_line="$(echo $amuse_conda_list | tr '^' '\n' | grep '^healpix_cxx ')"
    +    if test "$?" = "0"
    +then :
    +
    +        # FOUND_HEALPIX_CXX="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')"
    +
    +            FOUND_HEALPIX_CXX="yes"
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +else $as_nop
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
     fi
     
     
    @@ -14351,45 +14712,12 @@ printf "%s\n" "#define HAVE_NETCDF4 1" >>confdefs.h
     fi
     
     
    -            ac_ext=c
    -ac_cpp='$CPP $CPPFLAGS'
    -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    -ac_compiler_gnu=$ac_cv_c_compiler_gnu
    -
    -        else
    -            printf "%s\n" "Skipping library detection because we don't have C"
    -        fi
    -    fi
    -
    -    # This needs to be factored out, because autoconf won't instantiate the compiler
    -    # checks this calls twice, causing the compiler to appear broken even though it
    -    # works.
    -
    -
    -    amuse_save_LIBS="$LIBS"
    -    amuse_save_LIB_CFLAGS="$SAPPORO_LIGHT_CFLAGS"
    -    amuse_save_LIB_LIBS="$SAPPORO_LIGHT_LIBS"
    -    amuse_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    -
    -    # If we have an active virtualenv, make sure pkg-config searches it
    -    if test "a${VIRTUAL_ENV}" != "a"
    -    then
    -        PKG_CONFIG_PATH="${VIRTUAL_ENV}/lib/pkgconfig:${PKG_CONFIG_PATH}"
    -    fi
    -
    -    # All AMUSE libs export C symbols
    -    ac_ext=c
    -ac_cpp='$CPP $CPPFLAGS'
    -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    -ac_compiler_gnu=$ac_cv_c_compiler_gnu
    -
    +    amuse_lib_qhull_save_libs="$LIBS"
     
    -    # Search for the library, first directly then fall back to pkg-config
    -    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing get_device_count" >&5
    -printf %s "checking for library containing get_device_count... " >&6; }
    -if test ${ac_cv_search_get_device_count+y}
    +    LIBS=""
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing qh_freeqhull" >&5
    +printf %s "checking for library containing qh_freeqhull... " >&6; }
    +if test ${ac_cv_search_qh_freeqhull+y}
     then :
       printf %s "(cached) " >&6
     else $as_nop
    @@ -14400,7 +14728,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* Override any GCC internal prototype to avoid an error.
        Use char because int might match the return type of a GCC
        builtin and then its argument prototype would still apply.  */
    -char get_device_count ();
    +char qh_freeqhull ();
     #ifdef F77_DUMMY_MAIN
     
     #  ifdef __cplusplus
    @@ -14412,12 +14740,12 @@ char get_device_count ();
     int
     main (void)
     {
    -return get_device_count ();
    +return qh_freeqhull ();
       ;
       return 0;
     }
     _ACEOF
    -for ac_lib in '' sapporo
    +for ac_lib in '' qhull_r
     do
       if test -z "$ac_lib"; then
         ac_res="none required"
    @@ -14427,41 +14755,727 @@ do
       fi
       if ac_fn_c_try_link "$LINENO"
     then :
    -  ac_cv_search_get_device_count=$ac_res
    +  ac_cv_search_qh_freeqhull=$ac_res
     fi
     rm -f core conftest.err conftest.$ac_objext conftest.beam \
         conftest$ac_exeext
    -  if test ${ac_cv_search_get_device_count+y}
    +  if test ${ac_cv_search_qh_freeqhull+y}
     then :
       break
     fi
     done
    -if test ${ac_cv_search_get_device_count+y}
    +if test ${ac_cv_search_qh_freeqhull+y}
     then :
     
     else $as_nop
    -  ac_cv_search_get_device_count=no
    +  ac_cv_search_qh_freeqhull=no
     fi
     rm conftest.$ac_ext
     LIBS=$ac_func_search_save_LIBS
     fi
    -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_get_device_count" >&5
    -printf "%s\n" "$ac_cv_search_get_device_count" >&6; }
    -ac_res=$ac_cv_search_get_device_count
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_qh_freeqhull" >&5
    +printf "%s\n" "$ac_cv_search_qh_freeqhull" >&6; }
    +ac_res=$ac_cv_search_qh_freeqhull
     if test "$ac_res" != no
     then :
       test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
     
    -        FOUND_SAPPORO_LIGHT="yes"
    -        SAPPORO_LIGHT_LIBS="$LIBS"
    -        SAPPORO_LIGHT_CFLAGS=""
    +        FOUND_QHULL="yes"
     
    -else $as_nop
    +fi
     
    +    QHULL_LIBS="$LIBS"
    +    QHULL_FLAGS=""
     
    -pkg_failed=no
    -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SAPPORO_LIGHT" >&5
    -printf %s "checking for SAPPORO_LIGHT... " >&6; }
    +    LIBS="$amuse_lib_qhull_save_libs"
    +
    +           for ac_header in libqhull_r/libqhull_r.h
    +do :
    +  ac_fn_c_check_header_compile "$LINENO" "libqhull_r/libqhull_r.h" "ac_cv_header_libqhull_r_libqhull_r_h" "$ac_includes_default"
    +if test "x$ac_cv_header_libqhull_r_libqhull_r_h" = xyes
    +then :
    +  printf "%s\n" "#define HAVE_LIBQHULL_R_LIBQHULL_R_H 1" >>confdefs.h
    +
    +else $as_nop
    +  FOUND_QHULL="no"
    +fi
    +
    +done
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +if test -z "$CXX"; then
    +  if test -n "$CCC"; then
    +    CXX=$CCC
    +  else
    +    if test -n "$ac_tool_prefix"; then
    +  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
    +  do
    +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_CXX+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$CXX"; then
    +  ac_cv_prog_CXX="$CXX" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +CXX=$ac_cv_prog_CXX
    +if test -n "$CXX"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
    +printf "%s\n" "$CXX" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +    test -n "$CXX" && break
    +  done
    +fi
    +if test -z "$CXX"; then
    +  ac_ct_CXX=$CXX
    +  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
    +do
    +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    +set dummy $ac_prog; ac_word=$2
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    +printf %s "checking for $ac_word... " >&6; }
    +if test ${ac_cv_prog_ac_ct_CXX+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  if test -n "$ac_ct_CXX"; then
    +  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
    +else
    +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    +for as_dir in $PATH
    +do
    +  IFS=$as_save_IFS
    +  case $as_dir in #(((
    +    '') as_dir=./ ;;
    +    */) ;;
    +    *) as_dir=$as_dir/ ;;
    +  esac
    +    for ac_exec_ext in '' $ac_executable_extensions; do
    +  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
    +    ac_cv_prog_ac_ct_CXX="$ac_prog"
    +    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
    +    break 2
    +  fi
    +done
    +  done
    +IFS=$as_save_IFS
    +
    +fi
    +fi
    +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
    +if test -n "$ac_ct_CXX"; then
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
    +printf "%s\n" "$ac_ct_CXX" >&6; }
    +else
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +fi
    +
    +
    +  test -n "$ac_ct_CXX" && break
    +done
    +
    +  if test "x$ac_ct_CXX" = x; then
    +    CXX="g++"
    +  else
    +    case $cross_compiling:$ac_tool_warned in
    +yes:)
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    +ac_tool_warned=yes ;;
    +esac
    +    CXX=$ac_ct_CXX
    +  fi
    +fi
    +
    +  fi
    +fi
    +# Provide some information about the compiler.
    +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
    +set X $ac_compile
    +ac_compiler=$2
    +for ac_option in --version -v -V -qversion; do
    +  { { ac_try="$ac_compiler $ac_option >&5"
    +case "(($ac_try" in
    +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    +  *) ac_try_echo=$ac_try;;
    +esac
    +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
    +printf "%s\n" "$ac_try_echo"; } >&5
    +  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
    +  ac_status=$?
    +  if test -s conftest.err; then
    +    sed '10a\
    +... rest of stderr output deleted ...
    +         10q' conftest.err >conftest.er1
    +    cat conftest.er1 >&5
    +  fi
    +  rm -f conftest.er1 conftest.err
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }
    +done
    +
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
    +printf %s "checking whether the compiler supports GNU C++... " >&6; }
    +if test ${ac_cv_cxx_compiler_gnu+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +#ifndef __GNUC__
    +       choke me
    +#endif
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_compiler_gnu=yes
    +else $as_nop
    +  ac_compiler_gnu=no
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
    +
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
    +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +if test $ac_compiler_gnu = yes; then
    +  GXX=yes
    +else
    +  GXX=
    +fi
    +ac_test_CXXFLAGS=${CXXFLAGS+y}
    +ac_save_CXXFLAGS=$CXXFLAGS
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
    +printf %s "checking whether $CXX accepts -g... " >&6; }
    +if test ${ac_cv_prog_cxx_g+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    +   ac_cxx_werror_flag=yes
    +   ac_cv_prog_cxx_g=no
    +   CXXFLAGS="-g"
    +   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_g=yes
    +else $as_nop
    +  CXXFLAGS=""
    +      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +
    +else $as_nop
    +  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
    +	 CXXFLAGS="-g"
    +	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_g=yes
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    +   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
    +if test $ac_test_CXXFLAGS; then
    +  CXXFLAGS=$ac_save_CXXFLAGS
    +elif test $ac_cv_prog_cxx_g = yes; then
    +  if test "$GXX" = yes; then
    +    CXXFLAGS="-g -O2"
    +  else
    +    CXXFLAGS="-g"
    +  fi
    +else
    +  if test "$GXX" = yes; then
    +    CXXFLAGS="-O2"
    +  else
    +    CXXFLAGS=
    +  fi
    +fi
    +ac_prog_cxx_stdcxx=no
    +if test x$ac_prog_cxx_stdcxx = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
    +printf %s "checking for $CXX option to enable C++11 features... " >&6; }
    +if test ${ac_cv_prog_cxx_11+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cxx_11=no
    +ac_save_CXX=$CXX
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_cxx_conftest_cxx11_program
    +_ACEOF
    +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
    +do
    +  CXX="$ac_save_CXX $ac_arg"
    +  if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_cxx11=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CXX=$ac_save_CXX
    +fi
    +
    +if test "x$ac_cv_prog_cxx_cxx11" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cxx_cxx11" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
    +     CXX="$CXX $ac_cv_prog_cxx_cxx11"
    +fi
    +  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
    +  ac_prog_cxx_stdcxx=cxx11
    +fi
    +fi
    +if test x$ac_prog_cxx_stdcxx = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
    +printf %s "checking for $CXX option to enable C++98 features... " >&6; }
    +if test ${ac_cv_prog_cxx_98+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_cv_prog_cxx_98=no
    +ac_save_CXX=$CXX
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +$ac_cxx_conftest_cxx98_program
    +_ACEOF
    +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
    +do
    +  CXX="$ac_save_CXX $ac_arg"
    +  if ac_fn_cxx_try_compile "$LINENO"
    +then :
    +  ac_cv_prog_cxx_cxx98=$ac_arg
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam
    +  test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
    +done
    +rm -f conftest.$ac_ext
    +CXX=$ac_save_CXX
    +fi
    +
    +if test "x$ac_cv_prog_cxx_cxx98" = xno
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
    +printf "%s\n" "unsupported" >&6; }
    +else $as_nop
    +  if test "x$ac_cv_prog_cxx_cxx98" = x
    +then :
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
    +printf "%s\n" "none needed" >&6; }
    +else $as_nop
    +  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
    +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
    +     CXX="$CXX $ac_cv_prog_cxx_cxx98"
    +fi
    +  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
    +  ac_prog_cxx_stdcxx=cxx98
    +fi
    +fi
    +
    +ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +
    +    amuse_lib_healpix_cxx_save_libs="$LIBS"
    +
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HEALPix" >&5
    +printf %s "checking for HEALPix... " >&6; }
    +
    +    ac_ext=cpp
    +ac_cpp='$CXXCPP $CPPFLAGS'
    +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    +
    +
    +    LIBS="-lhealpix_cxx"
    +
    +    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +
    +            #include 
    +
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +
    +            Healpix_Base hb;
    +
    +  ;
    +  return 0;
    +}
    +
    +_ACEOF
    +if ac_fn_cxx_try_link "$LINENO"
    +then :
    +
    +        FOUND_HEALPIX_CXX="yes"
    +        HEALPIX_CXX_CFLAGS=""
    +        HEALPIX_CXX_LIBS="$LIBS"
    +
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +else $as_nop
    +
    +        # Not found, try pkg-config instead
    +
    +pkg_failed=no
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HEALPIX_CXX" >&5
    +printf %s "checking for HEALPIX_CXX... " >&6; }
    +
    +if test -n "$HEALPIX_CXX_CFLAGS"; then
    +    pkg_cv_HEALPIX_CXX_CFLAGS="$HEALPIX_CXX_CFLAGS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"healpix_cxx\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "healpix_cxx") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_HEALPIX_CXX_CFLAGS=`$PKG_CONFIG --cflags "healpix_cxx" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +if test -n "$HEALPIX_CXX_LIBS"; then
    +    pkg_cv_HEALPIX_CXX_LIBS="$HEALPIX_CXX_LIBS"
    + elif test -n "$PKG_CONFIG"; then
    +    if test -n "$PKG_CONFIG" && \
    +    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"healpix_cxx\""; } >&5
    +  ($PKG_CONFIG --exists --print-errors "healpix_cxx") 2>&5
    +  ac_status=$?
    +  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    +  test $ac_status = 0; }; then
    +  pkg_cv_HEALPIX_CXX_LIBS=`$PKG_CONFIG --libs "healpix_cxx" 2>/dev/null`
    +		      test "x$?" != "x0" && pkg_failed=yes
    +else
    +  pkg_failed=yes
    +fi
    + else
    +    pkg_failed=untried
    +fi
    +
    +
    +
    +if test $pkg_failed = yes; then
    +   	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
    +        _pkg_short_errors_supported=yes
    +else
    +        _pkg_short_errors_supported=no
    +fi
    +        if test $_pkg_short_errors_supported = yes; then
    +	        HEALPIX_CXX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "healpix_cxx" 2>&1`
    +        else
    +	        HEALPIX_CXX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "healpix_cxx" 2>&1`
    +        fi
    +	# Put the nasty error message in config.log where it belongs
    +	echo "$HEALPIX_CXX_PKG_ERRORS" >&5
    +
    +
    +            FOUND_HEALPIX_CXX="no"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +elif test $pkg_failed = untried; then
    +     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +            FOUND_HEALPIX_CXX="no"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +printf "%s\n" "no" >&6; }
    +
    +else
    +	HEALPIX_CXX_CFLAGS=$pkg_cv_HEALPIX_CXX_CFLAGS
    +	HEALPIX_CXX_LIBS=$pkg_cv_HEALPIX_CXX_LIBS
    +        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +            FOUND_HEALPIX_CXX="yes"
    +            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    +printf "%s\n" "yes" >&6; }
    +
    +fi
    +
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext conftest.$ac_ext
    +
    +    ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +
    +
    +
    +
    +            ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +        else
    +            printf "%s\n" "Skipping library detection because we don't have C"
    +        fi
    +    fi
    +
    +    # This needs to be factored out, because autoconf won't instantiate the compiler
    +    # checks this calls twice, causing the compiler to appear broken even though it
    +    # works.
    +
    +
    +    amuse_save_LIBS="$LIBS"
    +    amuse_save_LIB_CFLAGS="$SAPPORO_LIGHT_CFLAGS"
    +    amuse_save_LIB_LIBS="$SAPPORO_LIGHT_LIBS"
    +    amuse_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    +
    +    # If we have an active virtualenv, make sure pkg-config searches it
    +    if test "a${VIRTUAL_ENV}" != "a"
    +    then
    +        PKG_CONFIG_PATH="${VIRTUAL_ENV}/lib/pkgconfig:${PKG_CONFIG_PATH}"
    +    fi
    +
    +    # All AMUSE libs export C symbols
    +    ac_ext=c
    +ac_cpp='$CPP $CPPFLAGS'
    +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    +ac_compiler_gnu=$ac_cv_c_compiler_gnu
    +
    +
    +    # Search for the library, first directly then fall back to pkg-config
    +    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing get_device_count" >&5
    +printf %s "checking for library containing get_device_count... " >&6; }
    +if test ${ac_cv_search_get_device_count+y}
    +then :
    +  printf %s "(cached) " >&6
    +else $as_nop
    +  ac_func_search_save_LIBS=$LIBS
    +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    +/* end confdefs.h.  */
    +
    +/* Override any GCC internal prototype to avoid an error.
    +   Use char because int might match the return type of a GCC
    +   builtin and then its argument prototype would still apply.  */
    +char get_device_count ();
    +#ifdef F77_DUMMY_MAIN
    +
    +#  ifdef __cplusplus
    +     extern "C"
    +#  endif
    +   int F77_DUMMY_MAIN() { return 1; }
    +
    +#endif
    +int
    +main (void)
    +{
    +return get_device_count ();
    +  ;
    +  return 0;
    +}
    +_ACEOF
    +for ac_lib in '' sapporo
    +do
    +  if test -z "$ac_lib"; then
    +    ac_res="none required"
    +  else
    +    ac_res=-l$ac_lib
    +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    +  fi
    +  if ac_fn_c_try_link "$LINENO"
    +then :
    +  ac_cv_search_get_device_count=$ac_res
    +fi
    +rm -f core conftest.err conftest.$ac_objext conftest.beam \
    +    conftest$ac_exeext
    +  if test ${ac_cv_search_get_device_count+y}
    +then :
    +  break
    +fi
    +done
    +if test ${ac_cv_search_get_device_count+y}
    +then :
    +
    +else $as_nop
    +  ac_cv_search_get_device_count=no
    +fi
    +rm conftest.$ac_ext
    +LIBS=$ac_func_search_save_LIBS
    +fi
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_get_device_count" >&5
    +printf "%s\n" "$ac_cv_search_get_device_count" >&6; }
    +ac_res=$ac_cv_search_get_device_count
    +if test "$ac_res" != no
    +then :
    +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
    +
    +        FOUND_SAPPORO_LIGHT="yes"
    +        SAPPORO_LIGHT_LIBS="$LIBS"
    +        SAPPORO_LIGHT_CFLAGS=""
    +
    +else $as_nop
    +
    +
    +pkg_failed=no
    +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SAPPORO_LIGHT" >&5
    +printf %s "checking for SAPPORO_LIGHT... " >&6; }
     
     if test -n "$SAPPORO_LIGHT_CFLAGS"; then
         pkg_cv_SAPPORO_LIGHT_CFLAGS="$SAPPORO_LIGHT_CFLAGS"
    @@ -14712,6 +15726,14 @@ if test "x${FOUND_NETCDF}" = "xyes"
     then :
       FEATURES="${FEATURES} netcdf4"
     fi
    +if test "x${FOUND_QHULL}" = "xyes"
    +then :
    +  FEATURES="${FEATURES} qhull"
    +fi
    +if test "x${FOUND_HEALPIX_CXX}" = "xyes"
    +then :
    +  FEATURES="${FEATURES} healpix-cxx"
    +fi
     if test "x${FOUND_SAPPORO_LIGHT}" = "xyes"
     then :
       FEATURES="${FEATURES} sapporo_light"
    diff --git a/support/configure.ac b/support/configure.ac
    index 3f956f37ec..bad6700de5 100644
    --- a/support/configure.ac
    +++ b/support/configure.ac
    @@ -84,6 +84,8 @@ else
             AMUSE_CONDA_PACKAGE(FOUND_FFTW, fftw)
             AMUSE_CONDA_PACKAGE(with_hdf5, hdf5)
             AMUSE_CONDA_PACKAGE(FOUND_NETCDF, netcdf4)
    +        AMUSE_CONDA_PACKAGE(FOUND_QHULL, qhull)
    +        AMUSE_CONDA_PACKAGE(FOUND_HEALPIX_CXX, healpix_cxx)
     
             # Export conda list output so setup doesn't have to rerun it to detect pip and wheel
             CONDA_LIST="$amuse_conda_list"
    @@ -160,6 +162,8 @@ else
                 AX_FFTW()
                 AX_LIB_HDF5()
                 AX_LIB_NETCDF4()
    +            AMUSE_LIB_QHULL()
    +            AMUSE_LIB_HEALPIX_CXX()
     
                 AC_LANG_POP([C])
             else
    @@ -217,6 +221,8 @@ ENABLE_FEATURE_IF_EQUALS([mpfr], [FOUND_MPFR], [yes])
     ENABLE_FEATURE_IF_EQUALS([fftw], [FOUND_FFTW], [yes])
     ENABLE_FEATURE_IF_DEFINED([hdf5], [with_hdf5])
     ENABLE_FEATURE_IF_EQUALS([netcdf4], [FOUND_NETCDF], [yes])
    +ENABLE_FEATURE_IF_EQUALS([qhull], [FOUND_QHULL], [yes])
    +ENABLE_FEATURE_IF_EQUALS([healpix-cxx], [FOUND_HEALPIX_CXX], [yes])
     ENABLE_FEATURE_IF_EQUALS([sapporo_light], [FOUND_SAPPORO_LIGHT], [yes])
     
     AC_SUBST(GMAKE)
    diff --git a/support/setup/dependencies.sh b/support/setup/dependencies.sh
    index 960ce3ecf6..e91a274dad 100644
    --- a/support/setup/dependencies.sh
    +++ b/support/setup/dependencies.sh
    @@ -26,6 +26,8 @@
     # - GNU MPFR
     # - HDF5
     # - NetCDF4
    +# - QHull
    +# - HEALPix C++
     # - BLAS
     # - LAPACK
     
    @@ -34,12 +36,13 @@
     DEPS_conda="c-compiler cxx-compiler fortran-compiler 'gfortran<14' python pkgconfig"
     DEPS_conda="${DEPS_conda} coreutils patch"
     DEPS_conda="${DEPS_conda} curl tar unzip gzip bzip2 xz perl bison make cmake openmpi"
    -DEPS_conda="${DEPS_conda} gsl fftw gmp mpfr hdf5 netcdf4 libopenblas liblapack zlib"
    -DEPS_conda="${DEPS_conda} 'docutils>=0.6' 'mpi4py>=1.1.0' 'numpy>=1.2.2' 'h5py>=1.1.0'"
    +DEPS_conda="${DEPS_conda} gsl fftw gmp mpfr hdf5 netcdf4 qhull healpix_cxx libopenblas"
    +DEPS_conda="${DEPS_conda} liblapack zlib 'docutils>=0.6' 'mpi4py>=1.1.0' 'numpy>=1.2.2'"
    +DEPS_conda="${DEPS_conda} 'h5py>=1.1.0'"
     
     DEPS_macports="gcc12 python312 pkgconfig curl gpatch gnutar unzip gzip bzip2 xz perl5"
     DEPS_macports="${DEPS_macports} gmake cmake openmpi-gcc12 gsl fftw-3 gmp mpfr hdf5"
    -DEPS_macports="${DEPS_macports} netcdf netcdf-fortran openblas lapack"
    +DEPS_macports="${DEPS_macports} netcdf netcdf-fortran qhull healpix-cxx openblas lapack"
     
     DEPS_POST_macports="
     
    @@ -51,20 +54,22 @@ sudo port select --set mpi openmpi-gcc12-fortran
     DEPS_homebrew="gcc@13 python pkg-config curl gpatch gnu-tar unzip gzip"
     DEPS_homebrew="${DEPS_homebrew} bzip2 xz"
     DEPS_homebrew="${DEPS_homebrew} perl bison make cmake open-mpi gsl fftw gmp mpfr hdf5"
    -DEPS_homebrew="${DEPS_homebrew} netcdf netcdf-cxx netcdf-fortran openblas lapack"
    +DEPS_homebrew="${DEPS_homebrew} netcdf netcdf-cxx netcdf-fortran qhull healpix openblas"
    +DEPS_homebrew="${DEPS_homebrew} lapack"
     
     DEPS_apt="gcc g++ gfortran python3 python3-dev pkg-config curl patch tar unzip gzip"
     DEPS_apt="${DEPS_apt} bzip2 xz-utils"
     DEPS_apt="${DEPS_apt} perl bison make cmake libopenmpi-dev openmpi-bin"
     DEPS_apt="${DEPS_apt} libgsl-dev libfftw3-dev libgmp3-dev libmpfr6"
    -DEPS_apt="${DEPS_apt} libmpfr-dev libhdf5-dev hdf5-tools libnetcdf-dev"
    -DEPS_apt="${DEPS_apt} liblapack-dev libblas-dev"
    +DEPS_apt="${DEPS_apt} libmpfr-dev libhdf5-dev hdf5-tools libnetcdf-dev libqhull-dev"
    +DEPS_apt="${DEPS_apt} libhealpix-cxx-dev liblapack-dev libblas-dev"
     
     DEPS_dnf="gcc gcc-c++ gcc-gfortran python3 python3-devel pkgconf-pkg-config curl patch"
     DEPS_dnf="${DEPS_dnf} tar unzip gzip"
     DEPS_dnf="${DEPS_dnf} bzip2 xz perl-core bison make cmake openmpi-devel"
     DEPS_dnf="${DEPS_dnf} gsl-devel fftw-devel gmp-devel mpfr-devel hdf5-devel netcdf-devel"
    -DEPS_dnf="${DEPS_dnf} netcdf-cxx-devel netcdf-fortran-devel blas-devel lapack-devel"
    +DEPS_dnf="${DEPS_dnf} netcdf-cxx-devel netcdf-fortran-devel healpix-devel"
    +DEPS_dnf="${DEPS_dnf} libqhull-devel blas-devel lapack-devel"
     
     
     # Help messages for the user, used by help.sh
    diff --git a/support/shared/m4/amuse_lib.m4 b/support/shared/m4/amuse_lib.m4
    index bad9101ae1..a378d8de44 100644
    --- a/support/shared/m4/amuse_lib.m4
    +++ b/support/shared/m4/amuse_lib.m4
    @@ -11,7 +11,7 @@
     # appropriate values if it is found.
     #
     # prefix: prefix for the variables to be set
    -# module: name of the pkg-config module to seach for if needed
    +# module: name of the pkg-config module to search for if needed
     # library: name of the library to be searched for
     # function: name of a function in the library to use for the link check
     AC_DEFUN([AMUSE_LIB], [
    diff --git a/support/shared/m4/amuse_lib_healpix.m4 b/support/shared/m4/amuse_lib_healpix.m4
    new file mode 100644
    index 0000000000..07b6ef6c5e
    --- /dev/null
    +++ b/support/shared/m4/amuse_lib_healpix.m4
    @@ -0,0 +1,48 @@
    +# Helper macro for detecting libhealpix_cxx
    +#
    +# AMUSE_LIB_HEALPIX_CXX()
    +#
    +# Searches for libhealpix_cxx and sets FOUND_HEALPIX_CXX to "yes" if found.
    +#
    +# Also sets HEALPIX_CXX_LIBS to any needed link commands, and HEALPIX_CXX_CFLAGS to any
    +# needed compiler flags.
    +#
    +AC_DEFUN([AMUSE_LIB_HEALPIX_CXX], [
    +    amuse_lib_healpix_cxx_save_libs="$LIBS"
    +
    +    AC_MSG_CHECKING([for HEALPix])
    +
    +    AC_LANG_PUSH([C++])
    +
    +    LIBS="-lhealpix_cxx"
    +
    +    AC_LINK_IFELSE([
    +        AC_LANG_PROGRAM([
    +            #include 
    +        ], [
    +            Healpix_Base hb;
    +        ])
    +    ], [
    +        FOUND_HEALPIX_CXX="yes"
    +        HEALPIX_CXX_CFLAGS=""
    +        HEALPIX_CXX_LIBS="$LIBS"
    +
    +        AC_MSG_RESULT([yes])
    +    ],
    +    [
    +        # Not found, try pkg-config instead
    +        PKG_CHECK_MODULES([HEALPIX_CXX], [healpix_cxx], [
    +            FOUND_HEALPIX_CXX="yes"
    +            AC_MSG_RESULT([yes])
    +        ], [
    +            FOUND_HEALPIX_CXX="no"
    +            AC_MSG_RESULT([no])
    +        ])
    +    ])
    +
    +    AC_LANG_POP([C++])
    +
    +    AC_SUBST([HEALPIX_CXX_CFLAGS])
    +    AC_SUBST([HEALPIX_CXX_LIBS])
    +])
    +
    diff --git a/support/shared/m4/amuse_lib_qhull.m4 b/support/shared/m4/amuse_lib_qhull.m4
    new file mode 100644
    index 0000000000..8761694163
    --- /dev/null
    +++ b/support/shared/m4/amuse_lib_qhull.m4
    @@ -0,0 +1,30 @@
    +# Helper macro for detecting libqhull
    +#
    +# AMUSE_LIB_QHULL()
    +#
    +# Searches for libqhull and sets FOUND_QHULL to "yes" if found.
    +#
    +# Also sets QHULL_LIBS to any needed link commands, and QHULL_FLAGS to any needed
    +# compiler flags.
    +#
    +# Recent versions of libqhull have a reentrant libqhull_r and also a libqhull_p, but we
    +# test only for libqhull.
    +#
    +AC_DEFUN([AMUSE_LIB_QHULL], [
    +    amuse_lib_qhull_save_libs="$LIBS"
    +
    +    LIBS=""
    +    AC_SEARCH_LIBS([qh_freeqhull], [qhull_r], [
    +        FOUND_QHULL="yes"
    +    ], [])
    +    QHULL_LIBS="$LIBS"
    +    QHULL_FLAGS=""
    +
    +    LIBS="$amuse_lib_qhull_save_libs"
    +
    +    AC_CHECK_HEADERS([libqhull_r/libqhull_r.h], [], [FOUND_QHULL="no"])
    +
    +    AC_SUBST([QHULL_LIBS])
    +    AC_SUBST([QHULL_FLAGS])
    +])
    +