[SCM] Gerris Flow Solver branch, upstream, updated. e211f9f5b22b1b35b785821bf84c76fd3eccc0a5
Drew Parsons
dparsons at debian.org
Tue Apr 5 15:57:42 UTC 2011
The following commit has been merged in the upstream branch:
commit 2bd07e5f9c71d5112a2ab005ba179fe360119e36
Author: Drew Parsons <Drew.Parsons at anu.edu.au>
Date: Wed Apr 6 00:35:57 2011 +1000
DFSG: remove RStarTree and fes2004 modules
Same DSFG contravention as previously:
RStarTree: copyright licence not found
fes2004: uses the Aktarus tide library which is explicitly
non-free.
fes2004_kernel.c: "You don't have the right to use these
functions in other programs than the FES2004 prediction."
Wavewatch is assumed public domain
(see http://polar.ncep.noaa.gov/waves/wavewatch/wavewatch.html )
New module kdt falls under the Gerris licence (GPLv2 or later)
diff --git a/configure.in b/configure.in
index 32e0aeb..9c3d023 100644
--- a/configure.in
+++ b/configure.in
@@ -509,9 +509,7 @@ src/gerris2D.pc
src/gerris3D.pc
tools/Makefile
modules/Makefile
-modules/RStarTree/Makefile
modules/kdt/Makefile
-modules/fes2004/Makefile
modules/wavewatch/Makefile
test/Makefile
doc/Makefile
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 2317ce2..9b7c7c4 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1,6 +1,7 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = RStarTree kdt fes2004 wavewatch
+#SUBDIRS = RStarTree kdt fes2004 wavewatch
+SUBDIRS = kdt wavewatch
AM_CPPFLAGS = -DGFS_MODULES_DIR=\"$(libdir)/gerris\"
diff --git a/modules/RStarTree/Makefile.am b/modules/RStarTree/Makefile.am
deleted file mode 100644
index ebb7d85..0000000
--- a/modules/RStarTree/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-noinst_LTLIBRARIES = libcSmRST.la
-
-libcSmRST_la_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
-libcSmRST_la_SOURCES = \
- RStarTree.c \
- RStarTree.h \
- RSTInstDel.c \
- RSTInstDel.h \
- RSTJoin.c \
- RSTJoin.h \
- RSTUtil.c \
- RSTUtil.h \
- RSTInOut.c \
- RSTInOut.h \
- RSTInterUtil.c \
- RSTInterUtil.h \
- RSTQuery.c \
- RSTQuery.h \
- RSTBase.h
diff --git a/modules/RStarTree/Makefile.in b/modules/RStarTree/Makefile.in
deleted file mode 100644
index b10c7da..0000000
--- a/modules/RStarTree/Makefile.in
+++ /dev/null
@@ -1,583 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# This Makefile.in 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.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = modules/RStarTree
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libcSmRST_la_LIBADD =
-am_libcSmRST_la_OBJECTS = libcSmRST_la-RStarTree.lo \
- libcSmRST_la-RSTInstDel.lo libcSmRST_la-RSTJoin.lo \
- libcSmRST_la-RSTUtil.lo libcSmRST_la-RSTInOut.lo \
- libcSmRST_la-RSTInterUtil.lo libcSmRST_la-RSTQuery.lo
-libcSmRST_la_OBJECTS = $(am_libcSmRST_la_OBJECTS)
-libcSmRST_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcSmRST_la_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-SOURCES = $(libcSmRST_la_SOURCES)
-DIST_SOURCES = $(libcSmRST_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FC = @FC@
-FCFLAGS = @FCFLAGS@
-FFLAGS = @FFLAGS@
-FGREP = @FGREP@
-GFS2D_LIBS = @GFS2D_LIBS@
-GFS3D_LIBS = @GFS3D_LIBS@
-GFS_COMPILATION_FLAGS = @GFS_COMPILATION_FLAGS@
-GFS_MAJOR_VERSION = @GFS_MAJOR_VERSION@
-GFS_MICRO_VERSION = @GFS_MICRO_VERSION@
-GFS_MINOR_VERSION = @GFS_MINOR_VERSION@
-GFS_VERSION = @GFS_VERSION@
-GREP = @GREP@
-GSL_CFLAGS = @GSL_CFLAGS@
-GSL_CONFIG = @GSL_CONFIG@
-GSL_LIBS = @GSL_LIBS@
-GTS_CFLAGS = @GTS_CFLAGS@
-GTS_CONFIG = @GTS_CONFIG@
-GTS_DEPLIBS = @GTS_DEPLIBS@
-GTS_LIBS = @GTS_LIBS@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-MODULES = @MODULES@
-NM = @NM@
-NMEDIT = @NMEDIT@
-NO_UNDEFINED = @NO_UNDEFINED@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-ODE_CFLAGS = @ODE_CFLAGS@
-ODE_LIBS = @ODE_LIBS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-W3INIT = @W3INIT@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_FC = @ac_ct_FC@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-gts_cflags = @gts_cflags@
-gts_libs = @gts_libs@
-have_awk = @have_awk@
-have_gmodule = @have_gmodule@
-have_m4 = @have_m4@
-have_pkg_config = @have_pkg_config@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-ode = @ode@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-use_mpicc = @use_mpicc@
-noinst_LTLIBRARIES = libcSmRST.la
-libcSmRST_la_CFLAGS = $(AM_CFLAGS) -D_FILE_OFFSET_BITS=64
-libcSmRST_la_SOURCES = \
- RStarTree.c \
- RStarTree.h \
- RSTInstDel.c \
- RSTInstDel.h \
- RSTJoin.c \
- RSTJoin.h \
- RSTUtil.c \
- RSTUtil.h \
- RSTInOut.c \
- RSTInOut.h \
- RSTInterUtil.c \
- RSTInterUtil.h \
- RSTQuery.c \
- RSTQuery.h \
- RSTBase.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/RStarTree/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu modules/RStarTree/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libcSmRST.la: $(libcSmRST_la_OBJECTS) $(libcSmRST_la_DEPENDENCIES)
- $(libcSmRST_la_LINK) $(libcSmRST_la_OBJECTS) $(libcSmRST_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTInOut.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTInstDel.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTInterUtil.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTJoin.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTQuery.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RSTUtil.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcSmRST_la-RStarTree.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-libcSmRST_la-RStarTree.lo: RStarTree.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RStarTree.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RStarTree.Tpo -c -o libcSmRST_la-RStarTree.lo `test -f 'RStarTree.c' || echo '$(srcdir)/'`RStarTree.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RStarTree.Tpo $(DEPDIR)/libcSmRST_la-RStarTree.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RStarTree.c' object='libcSmRST_la-RStarTree.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RStarTree.lo `test -f 'RStarTree.c' || echo '$(srcdir)/'`RStarTree.c
-
-libcSmRST_la-RSTInstDel.lo: RSTInstDel.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTInstDel.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTInstDel.Tpo -c -o libcSmRST_la-RSTInstDel.lo `test -f 'RSTInstDel.c' || echo '$(srcdir)/'`RSTInstDel.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTInstDel.Tpo $(DEPDIR)/libcSmRST_la-RSTInstDel.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTInstDel.c' object='libcSmRST_la-RSTInstDel.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTInstDel.lo `test -f 'RSTInstDel.c' || echo '$(srcdir)/'`RSTInstDel.c
-
-libcSmRST_la-RSTJoin.lo: RSTJoin.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTJoin.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTJoin.Tpo -c -o libcSmRST_la-RSTJoin.lo `test -f 'RSTJoin.c' || echo '$(srcdir)/'`RSTJoin.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTJoin.Tpo $(DEPDIR)/libcSmRST_la-RSTJoin.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTJoin.c' object='libcSmRST_la-RSTJoin.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTJoin.lo `test -f 'RSTJoin.c' || echo '$(srcdir)/'`RSTJoin.c
-
-libcSmRST_la-RSTUtil.lo: RSTUtil.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTUtil.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTUtil.Tpo -c -o libcSmRST_la-RSTUtil.lo `test -f 'RSTUtil.c' || echo '$(srcdir)/'`RSTUtil.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTUtil.Tpo $(DEPDIR)/libcSmRST_la-RSTUtil.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTUtil.c' object='libcSmRST_la-RSTUtil.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTUtil.lo `test -f 'RSTUtil.c' || echo '$(srcdir)/'`RSTUtil.c
-
-libcSmRST_la-RSTInOut.lo: RSTInOut.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTInOut.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTInOut.Tpo -c -o libcSmRST_la-RSTInOut.lo `test -f 'RSTInOut.c' || echo '$(srcdir)/'`RSTInOut.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTInOut.Tpo $(DEPDIR)/libcSmRST_la-RSTInOut.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTInOut.c' object='libcSmRST_la-RSTInOut.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTInOut.lo `test -f 'RSTInOut.c' || echo '$(srcdir)/'`RSTInOut.c
-
-libcSmRST_la-RSTInterUtil.lo: RSTInterUtil.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTInterUtil.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTInterUtil.Tpo -c -o libcSmRST_la-RSTInterUtil.lo `test -f 'RSTInterUtil.c' || echo '$(srcdir)/'`RSTInterUtil.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTInterUtil.Tpo $(DEPDIR)/libcSmRST_la-RSTInterUtil.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTInterUtil.c' object='libcSmRST_la-RSTInterUtil.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTInterUtil.lo `test -f 'RSTInterUtil.c' || echo '$(srcdir)/'`RSTInterUtil.c
-
-libcSmRST_la-RSTQuery.lo: RSTQuery.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -MT libcSmRST_la-RSTQuery.lo -MD -MP -MF $(DEPDIR)/libcSmRST_la-RSTQuery.Tpo -c -o libcSmRST_la-RSTQuery.lo `test -f 'RSTQuery.c' || echo '$(srcdir)/'`RSTQuery.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcSmRST_la-RSTQuery.Tpo $(DEPDIR)/libcSmRST_la-RSTQuery.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RSTQuery.c' object='libcSmRST_la-RSTQuery.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcSmRST_la_CFLAGS) $(CFLAGS) -c -o libcSmRST_la-RSTQuery.lo `test -f 'RSTQuery.c' || echo '$(srcdir)/'`RSTQuery.c
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/modules/RStarTree/README b/modules/RStarTree/README
deleted file mode 100644
index 672da83..0000000
--- a/modules/RStarTree/README
+++ /dev/null
@@ -1,20 +0,0 @@
-User guide for RStarTree Version R2.xx (VR2.xx)
------------------------------------------------
-
-The files "RStarTree.h", "RSTBase.h" and "libcSmRST.a" should reside in the
-directory, where this README file resides. We will call this directory "dest".
-RStarTree.h is the user interface. RSTBase.h is a private header file included
-by RStarTree.h. Provided that, RSTREE is a typed pointer (not a void).
-
-SYNOPSYS
-
-Compilation:
-#include "dest/RStarTree.h"
-
-Linking:
--Ldest -lcSmRST
-
-The usage of the RStarTree implementation is explained in RStarTree.h.
-You might have a look at dest/src/trst.c as an example as well. trst uses a
-little set implementation also located in dest/src.
-Installation hints you'll find in dest/src/READMEInstall.
diff --git a/modules/RStarTree/RSTBase.h b/modules/RStarTree/RSTBase.h
deleted file mode 100644
index f7633b0..0000000
--- a/modules/RStarTree/RSTBase.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ----- RSTBase.h ----- */
-#ifndef __RSTBase_h
-#define __RSTBase_h
-
-
-/*** Begin ----- naming rules for structured types ----- **********/
-/*
-Non vector types are always called "typ<..>",
- Exceptions:
- Side, rstree.
-References to non vector types are always called "ref<..>".
- Exceptions:
-
- RSTREE.
-Vector types are always called <..>Array.
- Exceptions:
- RSTName, typpoint, typrect, typfixblock,
- and the internal arrays of the R*-tree as
- typpath, typentrynumbs, typpagenrs, typflagarray, typpagecountarr.
-*/
-/*** End ----- naming rules for structured types ----- **********/
-
-/* constants */
-
-#define SIZEfixblock 512
-#define maxnum (((SIZEfixblock-2*sizeof(int)) / sizeof(int))-1)
-#define maxentries MaxNumbOfEntriesPerPage
-#define EntryRange (maxentries+sizeof(int))
-
-#define chainlen 42 /* 3^ 40 = 12,157,665,459,056,928,801 */
-
-#define datasuffix ".Data"
-#define dirPDsuffix ".DirPD"
-#define dataPDsuffix ".DataPD"
-
-#define STDMODE 0644
-
-#define paramblocknumb 0
-#define firstPDblocknumb (paramblocknumb+1)
-#define rootblocknumb 0
-
-
-/* types */
-
-typedef typinterval *refinterval;
-
-typedef char RSTName[MaxNameLength];
-typedef double typpoint[NumbOfDim];
-
-typedef double ValueArray[EntryRange];
-typedef int IndexArray[EntryRange];
-typedef byte ByteArray[EntryRange];
-typedef typrect RectArray[EntryRange];
-typedef typrect NbrsArray[EntryRange];
-typedef typpoint PointArray[EntryRange];
-
-typedef enum {
- low,
- high
- } Side;
-
-typedef struct {
- typrect rect;
- int ptrtosub;
- PADDING_32_BITS;
- typdirinfo info;
- } typDIRent, *refDIRent; /* inner entry */
-typedef struct {
- typrect rect;
- typinfo info;
- } typDATAent, *refDATAent; /* data entry */
-typedef union {
- typDIRent DIR;
- typDATAent DATA;
- } typentry, *refentry; /* universal entry */
- /* If typentry v; Then */
- /* every access to rect by v.DIR.rect */
- /* End */
- /* hope the compiler-designers agree. */
-
-
-typedef typDIRent typDIRentries[EntryRange];
-typedef typDATAent typDATAentries[EntryRange];
-
-
-typedef struct {
- int nofentries;
- PADDING_32_BITS;
- typDIRentries entries; /* 0 .. nofentries-1 !! */
- } typDIRnode, *refDIRnode; /* inner node */
-typedef struct {
- int nofentries;
- typDATAentries entries; /* 0 .. nofentries-1 !! */
- } typDATAnode, *refDATAnode; /* data node */
-typedef union {
- typDIRnode DIR;
- typDATAnode DATA;
- } typnode, *refnode; /* universal node */
- /* If typnode v; Then */
- /* every access to nofentries by v.DIR.nofentries */
- /* End */
- /* hope the compiler-designers agree. */
-
-
-typedef refnode typpath[chainlen+1]; /* 1 .. height !! */
-typedef int typentrynumbs[chainlen+1]; /* 1 .. height !! */
-typedef int typpagenrs[chainlen+1]; /* 1 .. height !! */
-typedef boolean typflagarray[chainlen+1]; /* 1 .. height !! */
-
-typedef byte typfixblock[SIZEfixblock];
-
-typedef struct {
- int childnr;
- int nofnumbers;
- int number[maxnum+1]; /* 0 + [1 .. maxnum] !! */
- } typpagedir, *refpagedir;
-
-typedef union {
- typpagedir _; /* call the intrinsics "_" */
- typfixblock fixblock; /* adjust to SIZEfixblock */
- } typPDblock, *refPDblock;
-
-typedef int typpagecountarr[chainlen+1]; /* 1 .. height !! */
-
-typedef struct {
- boolean unique;
- int height;
- int SIZE_DIRnofentries, SIZE_DATAnofentries;
- int SIZEinfo;
- int direntrylen, dataentrylen;
- int nbrsexam;
- int reinstpercent;
- int minfillpercent;
- int dirreinsertqty, datareinsertqty;
- int pagelen;
- int dirM, dirMwords, dirm;
- int dataM, dataMwords, datam;
- int maxdim;
- int dirpagecount, datapagecount, recordcount;
- typpagecountarr pagecountarr;
- } typparameters, *refparameters;
-
-typedef union {
- typparameters _; /* call the intrinsics "_" */
- typfixblock fixblock; /* adjust to SIZEfixblock */
- } typparamblock, *refparamblock;
-
-typedef struct {
- boolean countflag;
- int dirvisitcount, datavisitcount;
- int dirreadcount, datareadcount;
- int dirmodifycount, datamodifycount;
- int dirwritecount, datawritecount;
- } typcount, *refcount;
-
-typedef struct {
- File f;
- int bl;
- } typfiledesc;
-
-typedef struct {
- int dirnodelen, datanodelen;
- typpath N, NInst, NDel;
- typentrynumbs E, EInst;
- typpagenrs P;
- typflagarray Nmodified, ReInsert;
- typPDblock dirpagedir, datapagedir;
- typparamblock parameters;
- typcount count;
- boolean RSTDone;
- PADDING_32_BITS;
- refnode helpdirnode, helpdatanode, Ntosplit, Nsibling;
- typfiledesc dir, data, dirPD, dataPD;
- RSTName dirname;
- boolean readonly;
- } rstree;
-
-
-/****************************************************************/
-/* begin **** --- types to check for alignment problems --- *****/
-
-typedef
- typDIRent typ2DIRentries[2];
-typedef
- typDATAent typ2DATAentries[2];
-typedef
- struct {
- int nofentries;
- PADDING_32_BITS;
- typ2DIRentries entries;
- } typDIRnodeOf2; /* inner node containing 2 entries */
-typedef
- struct {
- int nofentries;
- typ2DATAentries entries;
- } typDATAnodeOf2; /* data node containing 2 entries */
-
-typedef
- typDIRent typ3DIRentries[3];
-typedef
- typDATAent typ3DATAentries[3];
-typedef
- struct {
- int nofentries;
- PADDING_32_BITS;
- typ3DIRentries entries;
- } typDIRnodeOf3; /* inner node containing 3 entries */
-typedef
- struct {
- int nofentries;
- typ3DATAentries entries;
- } typDATAnodeOf3; /* data node containing 3 entries */
-
-/* end **** --- types to check for alignment problems --- *****/
-/****************************************************************/
-
-
-#endif /* !__RSTBase_h */
diff --git a/modules/RStarTree/RSTInOut.c b/modules/RStarTree/RSTInOut.c
deleted file mode 100644
index df60485..0000000
--- a/modules/RStarTree/RSTInOut.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* ----- RSTInOut.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTInOut.h"
-
-
-/* declarations */
-
-/************************************************************************/
-
-void PutNode(RSTREE R,
- refnode nodeptr,
- int pagenr,
- int depth)
-
-{
- refparameters par;
- refcount c;
-
- par= &(*R).parameters._;
-
- if (depth == (*par).height) {
- WritePage(R,(*R).data,pagenr,nodeptr);
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datawritecount++;
- }
- }
- else {
- WritePage(R,(*R).dir,pagenr,nodeptr);
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirwritecount++;
- }
- }
-}
-
-/************************************************************************/
-
-void GetNode(RSTREE R,
- refnode nodeptr,
- int pagenr,
- int depth)
-
-{
- refparameters par;
- refcount c;
-
- par= &(*R).parameters._;
-
- if (depth == (*par).height) {
- ReadPage(R,(*R).data,pagenr,nodeptr);
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datareadcount++;
- }
- }
- else {
- ReadPage(R,(*R).dir,pagenr,nodeptr);
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirreadcount++;
- }
- }
-}
-
-/************************************************************************/
-
-void NewNode(RSTREE R,
- int depth)
-
-{
- if ((*R).Nmodified[depth]) {
- PutNode(R,(*R).N[depth],(*R).P[depth],depth);
- (*R).Nmodified[depth]= FALSE;
- }
- (*R).P[depth]= (*(*R).N[depth-1]).DIR.entries[(*R).E[depth-1]].ptrtosub;
- GetNode(R,(*R).N[depth],(*R).P[depth],depth);
-}
-
-/************************************************************************/
-
-void ReadPage(RSTREE R,
- typfiledesc fd,
- int pagenr,
- void *block)
-
-{
- int pnb; /* position or nbytes */
-
- pnb= lseek(fd.f,(off_t)pagenr*(off_t)fd.bl,SEEK_SET);
- if (pnb != -1) {
- pnb= read(fd.f,block,fd.bl);
- }
- if (pnb <= 0) {
- (*R).RSTDone= FALSE;
- }
-}
-
-/************************************************************************/
-
-void WritePage(RSTREE R,
- typfiledesc fd,
- int pagenr,
- void *block)
-
-{
- int pnb; /* position or nbytes */
-
- pnb= lseek(fd.f,(off_t)pagenr*(off_t)fd.bl,SEEK_SET);
- if (pnb != -1) {
- pnb= write(fd.f,block,fd.bl);
- }
- if (pnb <= 0) {
- (*R).RSTDone= FALSE;
- }
-}
-
-/************************************************************************/
-
-void GetPageNr(RSTREE R, int *pagenr, int depth)
-
-{
- refparameters par;
- refpagedir dpd;
-
- par= &(*R).parameters._;
-
- if (depth == (*par).height) {
-
- dpd= &(*R).datapagedir._;
-
- if ((*dpd).nofnumbers == 0) {
- if ((*dpd).childnr == firstPDblocknumb) {
- (*dpd).number[0]++;
- *pagenr= (*dpd).number[0];
- }
- else {
- ReadPage(R,(*R).dataPD,(*dpd).childnr,&(*R).datapagedir._);
- (*dpd).childnr--;
- *pagenr= (*dpd).number[maxnum];
- (*dpd).nofnumbers= maxnum - 1;
- }
- }
- else {
- *pagenr= (*dpd).number[(*dpd).nofnumbers];
- (*dpd).nofnumbers--;
- }
- (*par).datapagecount++;
- }
- else {
-
- dpd= &(*R).dirpagedir._;
-
- if ((*dpd).nofnumbers == 0) {
- if ((*dpd).childnr == firstPDblocknumb) {
- (*dpd).number[0]++;
- *pagenr= (*dpd).number[0];
- }
- else {
- ReadPage(R,(*R).dirPD,(*dpd).childnr,&(*R).dirpagedir._);
- (*dpd).childnr--;
- *pagenr= (*dpd).number[maxnum];
- (*dpd).nofnumbers= maxnum - 1;
- }
- }
- else {
- *pagenr= (*dpd).number[(*dpd).nofnumbers];
- (*dpd).nofnumbers--;
- }
- (*par).dirpagecount++;
- }
- (*par).pagecountarr[depth]++;
-}
-
-/************************************************************************/
-
-void PutPageNr(RSTREE R, int pagenr, int depth)
-
-{
- refparameters par;
- refpagedir dpd;
-
- par= &(*R).parameters._;
-
- if (depth == (*par).height) {
-
- dpd= &(*R).datapagedir._;
-
- if ((*dpd).nofnumbers == maxnum) {
- (*dpd).childnr++;
- WritePage(R,(*R).dataPD,(*dpd).childnr,&(*R).datapagedir._);
- (*dpd).nofnumbers= 1;
- (*dpd).number[1]= pagenr;
- }
- else {
- (*dpd).nofnumbers++;
- (*dpd).number[(*dpd).nofnumbers]= pagenr;
- }
- (*par).datapagecount--;
- }
- else {
-
- dpd= &(*R).dirpagedir._;
-
- if ((*dpd).nofnumbers == maxnum) {
- (*dpd).childnr++;
- WritePage(R,(*R).dirPD,(*dpd).childnr,&(*R).dirpagedir._);
- (*dpd).nofnumbers= 1;
- (*dpd).number[1]= pagenr;
- }
- else {
- (*dpd).nofnumbers++;
- (*dpd).number[(*dpd).nofnumbers]= pagenr;
- }
- (*par).dirpagecount--;
- }
- (*par).pagecountarr[depth]--;
-}
-
-/************************************************************************/
diff --git a/modules/RStarTree/RSTInOut.h b/modules/RStarTree/RSTInOut.h
deleted file mode 100644
index 33ea1b9..0000000
--- a/modules/RStarTree/RSTInOut.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ----- RSTInOut.h ----- */
-#ifndef __RSTInOut_h
-#define __RSTInOut_h
-
-
-#include "RStarTree.h"
-
-
-/* declarations */
-
-void PutNode(RSTREE R,
- refnode nodeptr,
- int pagenr,
- int depth);
-
-void GetNode(RSTREE R,
- refnode nodeptr,
- int pagenr,
- int depth);
-
-void NewNode(RSTREE R,
- int depth);
-
-void ReadPage(RSTREE R,
- typfiledesc fd,
- int pagenr,
- void *block);
-
-void WritePage(RSTREE R,
- typfiledesc fd,
- int pagenr,
- void *block);
-
-void GetPageNr(RSTREE R,
- int *pagenr,
- int depth);
-
-void PutPageNr(RSTREE R,
- int pagenr,
- int depth);
-
-
-#endif /* !__RSTInOut_h */
diff --git a/modules/RStarTree/RSTInstDel.c b/modules/RStarTree/RSTInstDel.c
deleted file mode 100644
index 2962798..0000000
--- a/modules/RStarTree/RSTInstDel.c
+++ /dev/null
@@ -1,1176 +0,0 @@
-/* ----- RSTInstDel.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTInstDel.h"
-#include "RSTUtil.h"
-#include "RSTInOut.h"
-
-
-/* declarations */
-
-static void ExcludeDataEntries(RSTREE R,
- refDATAent newentry,
- typrect newrect,
- int depth,
- int M,
- int reinsertqty);
-static void ExcludeDirEntries(RSTREE R,
- refDIRent newentry,
- typrect newrect,
- int depth,
- int M,
- int reinsertqty);
-static void Split(RSTREE R,
- refentry newentry,
- int *depth,
- int M,
- int m);
-static void SplitAndDistributDir(RSTREE R,
- int depth,
- refDIRent newentry,
- int M,
- int m);
-static void SplitAndDistributData(RSTREE R,
- int depth,
- refDATAent newentry,
- int M,
- int m);
-static void UnDistributData(RSTREE R,
- refDATAent newentry);
-static void GetInstChain(RSTREE R,
- typrect newrect,
- int depth);
-static void NtoNDel(RSTREE R,
- int depth);
-static void ShrinkTree(RSTREE R);
-
-
-/***********************************************************************/
-
-static void GetInstChain(RSTREE R,
- typrect newrect,
- int depth)
-
-{
- int i;
- refcount c;
-
- i= 1;
- while (i < depth) {
- if ((*R).NInst[i+1] != NULL) {
- /* already in path */
- (*R).E[i]= (*R).EInst[i]; (*R).EInst[i]= -1;
- i++;
- if ((*R).N[i] != (*R).NInst[i]) {
- (*R).P[i]= (*(*R).N[i-1]).DIR.entries[(*R).E[i-1]].ptrtosub;
- free((*R).N[i]); (*R).N[i]= NULL;
- (*R).N[i]= (*R).NInst[i];
- }
- (*R).NInst[i]= NULL;
- }
- else if ((*R).EInst[i] != -1) {
- /* known ... */
- (*R).E[i]= (*R).EInst[i]; (*R).EInst[i]= -1;
- i++;
- if ((*(*R).N[i-1]).DIR.entries[(*R).E[i-1]].ptrtosub != (*R).P[i]) {
- /* but not in path */
- NewNode(R,i);
- }
- }
- else {
- /* not known */
- ChooseSubtree(R,newrect,i,&(*(*R).N[i]).DIR,&(*R).E[i]);
- i++;
- if ((*(*R).N[i-1]).DIR.entries[(*R).E[i-1]].ptrtosub != (*R).P[i]) {
- /* and not in path */
- NewNode(R,i);
- }
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- if (depth == (*R).parameters._.height) {
- (*c).dirvisitcount+= depth - 1;
- (*c).datavisitcount++;
- }
- else {
- (*c).dirvisitcount+= depth;
- }
- }
-}
-
-/***********************************************************************/
-
-void Insert(RSTREE R, typentry *newentry, int depth)
-
-{
- typrect newrect;
- int M, m;
- int reinsertqty, heightbefore;
- refparameters par;
- refDIRnode DIN, DINdel;
- refDATAnode DAN, DANdel;
- refcount c;
- int j;
-
- CopyRect(R,(*newentry).DIR.rect,newrect); /* see RSTBase.h "hope ..." */
- GetInstChain(R,newrect,depth);
-
- par= &(*R).parameters._;
-
- for (;;) {
- if (depth == (*par).height) {
- M= (*par).dataM; m= (*par).datam;
-
- DAN= &(*(*R).N[depth]).DATA;
-
- if ((*DAN).nofentries < M) {
- (*DAN).entries[(*DAN).nofentries]= (*newentry).DATA; /* 0.. */
- (*DAN).nofentries++;
- (*R).Nmodified[depth]= TRUE;
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datamodifycount++;
- }
-
- depth--;
- AdjustChain(R,depth,newrect);
- break;
- }
- }
- else {
- M= (*par).dirM; m= (*par).dirm;
-
- DIN= &(*(*R).N[depth]).DIR;
-
- if ((*DIN).nofentries < M) {
- (*DIN).entries[(*DIN).nofentries]= (*newentry).DIR; /* 0.. */
- (*DIN).nofentries++;
- (*R).Nmodified[depth]= TRUE;
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
-
- depth--;
- AdjustChain(R,depth,newrect);
- break;
- }
- }
-
- /*** --- LOOP not EXITed by direct insert --- ***/
-
- if ((*R).ReInsert[depth] && depth != 1 && M > 1) {
- if (depth == (*par).height) {
- reinsertqty= (*par).datareinsertqty;
- (*R).NDel[depth]= (refnode)malloc((*R).datanodelen);
- ExcludeDataEntries(R,&(*newentry).DATA,newrect,depth,M,reinsertqty);
- }
- else {
- reinsertqty= (*par).dirreinsertqty;
- (*R).NDel[depth]= (refnode)malloc((*R).dirnodelen);
- ExcludeDirEntries(R,&(*newentry).DIR,newrect,depth,M,reinsertqty);
- }
- heightbefore= (*par).height;
- (*R).ReInsert[depth]= FALSE;
- (*R).ReInsert[depth-1]= TRUE;
- (*R).Nmodified[depth]= TRUE;
- AdjustChainAfterDeletion(R,depth);
-
- if (depth == (*par).height) {
-
- DANdel= &(*(*R).NDel[depth]).DATA;
-
- for (j= reinsertqty; j >= 0; j--) {
- Insert(R,(refentry)&(*DANdel).entries[j],depth);
- if ((*par).height > heightbefore) {
- depth+= (*par).height - heightbefore;
- heightbefore= (*par).height;
- }
- }
- }
- else {
-
- DINdel= &(*(*R).NDel[depth]).DIR;
-
- for (j= reinsertqty; j >= 0; j--) {
- Insert(R,(refentry)&(*DINdel).entries[j],depth);
- if ((*par).height > heightbefore) {
- depth+= (*par).height - heightbefore;
- heightbefore= (*par).height;
- }
- }
- }
- free((*R).NDel[depth]); (*R).NDel[depth]= NULL;
- if (depth != 1) {
- (*R).ReInsert[depth-1]= FALSE;
- /* ReInitialisation for the case, that the LOOP
- did not call ReInsert in the next higher level */
- }
- break;
- }
- else {
- Split(R,newentry,&depth,M,m);
- }
- }
-}
-
-/***********************************************************************/
-
-static void ExcludeDataEntries(RSTREE R,
- typDATAent *newentry,
- typrect newrect,
- int depth,
- int M,
- int reinsertqty)
-
-{
- refparameters par;
- typpoint allcenter, newrectcenter, center;
- refDATAnode n, nd;
- ValueArray distarr;
- IndexArray I;
- ByteArray chosen;
- int j, k, sortind;
-
- par= &(*R).parameters._;
-
- EvalCenter(R,(*(*R).N[depth-1]).DIR.entries[(*R).E[depth-1]].rect,allcenter);
- EvalCenter(R,newrect,newrectcenter);
-
- n= &(*(*R).N[depth]).DATA;
-
- for (j= 0; j < M; j++) {
- EvalCenter(R,(*n).entries[j].rect,center);
- distarr[j]= RSTDistance(R,allcenter,center);
- I[j]= j;
- }
- distarr[M]= RSTDistance(R,allcenter,newrectcenter);
- I[M]= M;
- QuickSortValArr(0,M,distarr,I);
-
- nd= &(*(*R).NDel[depth]).DATA;
-
- FalseArray((int *)chosen,(*par).dataMwords);
- j= 0; k= M;
- while (j < reinsertqty) {
- sortind= I[k];
- chosen[sortind]= 1;
- if (sortind != M) {
- (*nd).entries[j]= (*n).entries[sortind];
- }
- else {
- (*nd).entries[j]= *newentry;
- }
- j++;
- k--;
- }
- /* entry referenced by distarr[I[M]], [I[M-1]], ...
- becomes NDel[depth]->entries[0], [1], ... */
-
- if (chosen[M] == 1) {
- (*nd).entries[reinsertqty]= (*n).entries[I[M-reinsertqty]];
- chosen[I[M-reinsertqty]]= 1;
- }
- else {
- (*nd).entries[reinsertqty]= *newentry;
- }
- /* entry referenced by I[M-reinsertqty] or newentry (referenced
- by I[?] == 0) becomes NDel[depth]->entries[reinsertqty] */
- /* Entries to reinsert now in NDel[depth] sorted by */
- /* decreasing distances to the midpoint. */
- /* !!! newentry is reinserted in any case !!! */
-
- (*n).nofentries= M - reinsertqty;
- j= 0; k= M - 1;
- do {
- if (chosen[j] == 1) {
- while (chosen[k] == 1) {
- k--;
- }
- (*n).entries[j]= (*n).entries[k];
- chosen[k]= 1;
- }
- j++;
- } while (j < (*n).nofentries);
-}
-
-/***********************************************************************/
-
-static void ExcludeDirEntries(RSTREE R,
- typDIRent *newentry,
- typrect newrect,
- int depth,
- int M,
- int reinsertqty)
-
-{
- refparameters par;
- typpoint allcenter, newrectcenter, center;
- refDIRnode n, nd;
- ValueArray distarr;
- IndexArray I;
- ByteArray chosen;
- int j, k, sortind;
-
- par= &(*R).parameters._;
-
- EvalCenter(R,(*(*R).N[depth-1]).DIR.entries[(*R).E[depth-1]].rect,allcenter);
- EvalCenter(R,newrect,newrectcenter);
-
- n= &(*(*R).N[depth]).DIR;
-
- for (j= 0; j < M; j++) {
- EvalCenter(R,(*n).entries[j].rect,center);
- distarr[j]= RSTDistance(R,allcenter,center);
- I[j]= j;
- }
- distarr[M]= RSTDistance(R,allcenter,newrectcenter);
- I[M]= M;
- QuickSortValArr(0,M,distarr,I);
-
- nd= &(*(*R).NDel[depth]).DIR;
-
- FalseArray((int *)chosen,(*par).dirMwords);
- j= 0; k= M;
- while (j < reinsertqty) {
- sortind= I[k];
- chosen[sortind]= 1;
- if (sortind != M) {
- (*nd).entries[j]= (*n).entries[sortind];
- }
- else {
- (*nd).entries[j]= *newentry;
- }
- j++;
- k--;
- }
- /* entry referenced by distarr[I[M]], [I[M-1]], ...
- becomes NDel[depth]->entries[0], [1], ... */
-
- if (chosen[M] == 1) {
- (*nd).entries[reinsertqty]= (*n).entries[I[M-reinsertqty]];
- chosen[I[M-reinsertqty]]= 1;
- }
- else {
- (*nd).entries[reinsertqty]= *newentry;
- }
- /* entry referenced by I[M-reinsertqty] or newentry (referenced
- by I[?] == 0) becomes NDel[depth]->entries[reinsertqty] */
- /* Entries to reinsert now in NDel[depth] sorted by */
- /* decreasing distances to the midpoint. */
- /* !!! newentry is reinserted in any case !!! */
-
- (*n).nofentries= M - reinsertqty;
- j= 0; k= M - 1;
- do {
- if (chosen[j] == 1) {
- while (chosen[k] == 1) {
- k--;
- }
- (*n).entries[j]= (*n).entries[k];
- chosen[k]= 1;
- }
- j++;
- } while (j < (*n).nofentries);
-}
-
-/***********************************************************************/
-
-static void Split(RSTREE R,
- typentry *newentry,
- int *depth,
- int M,
- int m)
-
-{
- refparameters par;
- refcount c;
- int pagenr;
- boolean isdata;
- int i;
-
- par= &(*R).parameters._;
-
- if (*depth == (*par).height) {
- if (M == 1) {
- UnDistributData(R,&(*newentry).DATA);
- }
- else
- {
- SplitAndDistributData(R,*depth,&(*newentry).DATA,M,m);
- }
- }
- else {
- SplitAndDistributDir(R,*depth,&(*newentry).DIR,M,m);
- }
- if (*depth == 1) {
- (*par).height++;
- *depth= 2;
- for (i= (*par).height; i >= 2; i--) {
- (*R).N[i]= (*R).N[i-1];
- (*R).NDel[i]= (*R).NDel[i-1]; /* for ReInsert */
- (*R).ReInsert[i]= (*R).ReInsert[i-1]; /* for ReInsert */
- /* following assignments not necessary for i=2: */
- (*R).P[i]= (*R).P[i-1]; /* set(i=2) */
- (*R).Nmodified[i]= (*R).Nmodified[i-1]; /* set(i=2) */
- (*par).pagecountarr[i]= (*par).pagecountarr[i-1];
- }
- (*R).N[1]= (refnode)malloc((*R).dirnodelen);
- /* R->P[1] is RSTBase.rootblocknumb forever */
- /* R->Nmodified[1] set inserting the sibling */
- (*R).NDel[1]= NULL; /* for ReInsert */
- (*R).ReInsert[1]= FALSE; /* for ReInsert */
- /* initiate first root entry: */
- (*(*R).N[1]).DIR.nofentries= 1;
- (*R).E[1]= 0;
- GetPageNr(R,&pagenr,*depth);
- (*(*R).N[1]).DIR.entries[0].ptrtosub= pagenr;
- (*R).P[2]= pagenr;
- }
- isdata= *depth == (*par).height;
- (*R).Nmodified[*depth]= TRUE;
- GetPageNr(R,&pagenr,*depth);
- (*newentry).DIR.ptrtosub= pagenr;
-
- if (isdata) {
- EvalDataEnclRect(R,&(*(*R).Nsibling).DATA,(*newentry).DIR.rect);
- EvalDataEnclRect(R,&(*(*R).N[*depth]).DATA,
- (*(*R).N[*depth-1]).DIR.entries[(*R).E[*depth-1]].rect);
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datamodifycount+= 2;
- }
- }
- else {
- EvalDirEnclRect(R,&(*(*R).Nsibling).DIR,(*newentry).DIR.rect);
- EvalDirEnclRect(R,&(*(*R).N[*depth]).DIR,
- (*(*R).N[*depth-1]).DIR.entries[(*R).E[*depth-1]].rect);
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirmodifycount+= 2;
- }
- }
- PutNode(R,(*R).Nsibling,pagenr,*depth);
- (*depth)--;
-}
-
-/***********************************************************************/
-
-static void SplitAndDistributDir(RSTREE R,
- int depth,
- typDIRent *newentry,
- int M,
- int m)
-
-{
- ValueArray edgearray, spacearray;
- RectArray rectarray;
- refparameters par;
- refDIRnode n;
- refinterval re;
-
- IndexArray I;
- Side sortside, currsortside, axsortside;
- int axis;
- int mlow, mhigh,
- index, backind,
- axisindex;
- typrect leftrect, rightrect;
- double leftspace, rightspace,
- leftedge, rightedge, edge, validedge, backvaledge, axisedge,
- ovlp,
- value, validvalue, backvalvalue;
- int i, j, ii;
-
- par= &(*R).parameters._;
-
- (*R).Ntosplit= (*R).N[depth];
- (*R).N[depth]= (*R).helpdirnode;
- (*R).helpdirnode= (*R).Ntosplit;
- for (j= 0; j <= M; j++) {
- I[j]= j;
- }
- mhigh= M-m+1;
- mlow= m-1;
-
- n= &(*(*R).Ntosplit).DIR;
-
- (*n).entries[M]= *newentry;
- for (i= 0; i <= (*par).maxdim; i++) {
- sortside= low;
- currsortside= low;
- QuickSortDirEnt(0,M,i,low,(*n).entries,I);
- CopyRect(R,(*n).entries[I[M]].rect,rightrect);
- rightrect[i].l= (*n).entries[I[mhigh]].rect[i].l;
- for (j= M-1; j >= m; j--) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < rightrect[ii].l) {
- rightrect[ii].l= (*re).l;
- }
- if ((*re).h > rightrect[ii].h) {
- rightrect[ii].h= (*re).h;
- }
- }
- if (j <= mhigh) {
- rightedge= 0.0; rightspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightedge+= rightrect[ii].h - rightrect[ii].l;
- rightspace*= rightrect[ii].h - rightrect[ii].l;
- }
- CopyRect(R,rightrect,rectarray[j]);
- edgearray[j]= rightedge;
- spacearray[j]= rightspace;
- }
- }
- /* fill array from M-m+1 down to m
- with rightrect, rightedge, rightspace */
- CopyRect(R,(*n).entries[I[0]].rect,leftrect);
- for (j= 1; j < mhigh; j++) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < leftrect[ii].l) {
- leftrect[ii].l= (*re).l;
- }
- if ((*re).h > leftrect[ii].h) {
- leftrect[ii].h= (*re).h;
- }
- }
- if (j >= mlow) {
- leftedge= 0.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftedge+= leftrect[ii].h - leftrect[ii].l;
- }
- if (Overlaps(R,leftrect,rectarray[j+1])) {
- GetOverlap(R,leftrect,rectarray[j+1],&ovlp);
- if (j == mlow) {
- validedge= leftedge+edgearray[j+1];
- validvalue= ovlp;
- index= m;
- }
- else {
- edge= leftedge+edgearray[j+1];
- validedge= validedge+edge;
- value= ovlp;
- if (value < validvalue) {
- validvalue= value;
- index= j+1;
- }
- }
- }
- else {
- leftspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftspace*= leftrect[ii].h - leftrect[ii].l;
- }
- if (j == mlow) {
- validedge= leftedge+edgearray[j+1];
- validvalue= -1.0/(leftspace+spacearray[j+1]);
- index= m;
- }
- else {
- edge= leftedge+edgearray[j+1];
- validedge= validedge+edge;
- value= -1.0/(leftspace+spacearray[j+1]);
- if (value < validvalue) {
- validvalue= value;
- index= j+1;
- }
- }
- }
- }
- }
- /* Compute sum of the edges
- from leftedge[m-1]+rightedge[m]
- up to leftedge[M-m]+rightedge[M-m+1], -> axis;
- minimal area resp. overlap, -> index. */
- currsortside= high;
- QuickSortDirEnt(0,M,i,high,(*n).entries,I);
- CopyRect(R,(*n).entries[I[0]].rect,leftrect);
- leftrect[i].h= (*n).entries[I[mlow]].rect[i].h;
- for (j= 1; j < mhigh; j++) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < leftrect[ii].l) {
- leftrect[ii].l= (*re).l;
- }
- if ((*re).h > leftrect[ii].h) {
- leftrect[ii].h= (*re).h;
- }
- }
- if (j >= mlow) {
- leftedge= 0.0; leftspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftedge+= leftrect[ii].h - leftrect[ii].l;
- leftspace*= leftrect[ii].h - leftrect[ii].l;
- }
- CopyRect(R,leftrect,rectarray[j]);
- edgearray[j]= leftedge;
- spacearray[j]= leftspace;
- }
- }
- /* fill array from m-1 up to M-m
- with leftrect, leftedge, leftspace */
- CopyRect(R,(*n).entries[I[M]].rect,rightrect);
- for (j= M-1; j >= m; j--) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re = &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < rightrect[ii].l) {
- rightrect[ii].l= (*re).l;
- }
- if ((*re).h > rightrect[ii].h) {
- rightrect[ii].h= (*re).h;
- }
- }
- if (j <= mhigh) {
- rightedge= 0.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightedge+= rightrect[ii].h- rightrect[ii].l;
- }
- if (Overlaps(R,rightrect,rectarray[j-1])) {
- GetOverlap(R,rightrect,rectarray[j-1],&ovlp);
- if (j == mhigh) {
- backvaledge= rightedge+edgearray[j-1];
- backvalvalue= ovlp;
- backind= j;
- }
- else {
- edge= rightedge+edgearray[j-1];
- backvaledge= backvaledge+edge;
- value= ovlp;
- if (value < backvalvalue) {
- backvalvalue= value;
- backind= j;
- }
- }
- }
- else {
- rightspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightspace*= rightrect[ii].h - rightrect[ii].l;
- }
- if (j == mhigh) {
- backvaledge= rightedge+edgearray[j-1];
- backvalvalue= -1.0/(rightspace+spacearray[j-1]);
- backind= j;
- }
- else {
- edge= rightedge+edgearray[j-1];
- backvaledge= backvaledge+edge;
- value= -1.0/(rightspace+spacearray[j-1]);
- if (value < backvalvalue) {
- backvalvalue= value;
- backind= j;
- }
- }
- }
- }
- }
- /* Compute sum of the edges
- from rightedge[M-m+1]+leftedge[M-m]
- down to rightedge[m] +leftedge[m-1], -> axis;
- minimal area resp. overlap, -> index. */
- if (backvalvalue <= validvalue) {
- sortside= high;
- index= backind;
- }
- validedge= validedge+backvaledge;
- if (i == 0) {
- axsortside= sortside;
- axis= i;
- axisedge= validedge;
- axisindex= index;
- }
- else if (validedge < axisedge) {
- axsortside= sortside;
- axis= i;
- axisedge= validedge;
- axisindex= index;
- }
-
- }
- if (axis != (*par).maxdim || axsortside != currsortside) {
- QuickSortDirEnt(0,M,axis,axsortside,(*n).entries,I);
- }
-
- n= &(*(*R).N[depth]).DIR;
-
- (*n).nofentries= axisindex;
- for (j= 0; j < (*n).nofentries; j++) {
- (*n).entries[j]= (*(*R).Ntosplit).DIR.entries[I[j]];
- }
- /* printf("%3d",axisindex); */
- /* N[depth] gets entries 0 up to axisindex-1 */
-
- n= &(*(*R).Nsibling).DIR;
-
- (*n).nofentries= M-axisindex+1;
- for (j= 0; j < (*n).nofentries; j++) {
- (*n).entries[j]= (*(*R).Ntosplit).DIR.entries[I[axisindex+j]];
- }
- /* printf("%3d",M-axisindex+1); */
- /* printf("%3d\n",M+1); */
-}
-
-/***********************************************************************/
-
-static void SplitAndDistributData(RSTREE R,
- int depth,
- typDATAent *newentry,
- int M,
- int m)
-
-{
- ValueArray edgearray, spacearray;
- RectArray rectarray;
- refparameters par;
- refDATAnode n;
- refinterval re;
-
- IndexArray I;
- Side sortside, currsortside, axsortside;
- int axis;
- int mlow, mhigh,
- index, backind,
- axisindex;
- typrect leftrect, rightrect;
- double leftspace, rightspace,
- leftedge, rightedge, edge, validedge, backvaledge, axisedge,
- ovlp,
- value, validvalue, backvalvalue;
- int i, j, ii;
-
- par= &(*R).parameters._;
-
- (*R).Ntosplit= (*R).N[depth];
- (*R).N[depth]= (*R).helpdatanode;
- (*R).helpdatanode= (*R).Ntosplit;
- for (j= 0; j <= M; j++) {
- I[j]= j;
- }
- mhigh= M-m+1;
- mlow= m-1;
-
- n= &(*(*R).Ntosplit).DATA;
-
- (*n).entries[M]= *newentry;
- for (i= 0; i <= (*par).maxdim; i++) {
- sortside= low;
- currsortside= low;
- QuickSortDataEnt(0,M,i,low,(*n).entries,I);
- CopyRect(R,(*n).entries[I[M]].rect,rightrect);
- rightrect[i].l= (*n).entries[I[mhigh]].rect[i].l;
- for (j= M-1; j >= m; j--) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < rightrect[ii].l) {
- rightrect[ii].l= (*re).l;
- }
- if ((*re).h > rightrect[ii].h) {
- rightrect[ii].h= (*re).h;
- }
- }
- if (j <= mhigh) {
- rightedge= 0.0; rightspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightedge+= rightrect[ii].h - rightrect[ii].l;
- rightspace*= rightrect[ii].h - rightrect[ii].l;
- }
- CopyRect(R,rightrect,rectarray[j]);
- edgearray[j]= rightedge;
- spacearray[j]= rightspace;
- }
- }
- /* fill array from M-m+1 down to m
- with rightrect, rightedge, rightspace */
- CopyRect(R,(*n).entries[I[0]].rect,leftrect);
- for (j= 1; j < mhigh; j++) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < leftrect[ii].l) {
- leftrect[ii].l= (*re).l;
- }
- if ((*re).h > leftrect[ii].h) {
- leftrect[ii].h= (*re).h;
- }
- }
- if (j >= mlow) {
- leftedge= 0.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftedge+= leftrect[ii].h - leftrect[ii].l;
- }
- if (Overlaps(R,leftrect,rectarray[j+1])) {
- GetOverlap(R,leftrect,rectarray[j+1],&ovlp);
- if (j == mlow) {
- validedge= leftedge+edgearray[j+1];
- validvalue= ovlp;
- index= m;
- }
- else {
- edge= leftedge+edgearray[j+1];
- validedge= validedge+edge;
- value= ovlp;
- if (value < validvalue) {
- validvalue= value;
- index= j+1;
- }
- }
- }
- else {
- leftspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftspace*= leftrect[ii].h - leftrect[ii].l;
- }
- if (j == mlow) {
- validedge= leftedge+edgearray[j+1];
- validvalue= -1.0/(leftspace+spacearray[j+1]);
- index= m;
- }
- else {
- edge= leftedge+edgearray[j+1];
- validedge= validedge+edge;
- value= -1.0/(leftspace+spacearray[j+1]);
- if (value < validvalue) {
- validvalue= value;
- index= j+1;
- }
- }
- }
- }
- }
- /* Compute sum of the edges
- from leftedge[m-1]+rightedge[m]
- up to leftedge[M-m]+rightedge[M-m+1], -> axis;
- minimal area resp. overlap, -> index. */
- currsortside= high;
- QuickSortDataEnt(0,M,i,high,(*n).entries,I);
- CopyRect(R,(*n).entries[I[0]].rect,leftrect);
- leftrect[i].h= (*n).entries[I[mlow]].rect[i].h;
- for (j= 1; j < mhigh; j++) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re= &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < leftrect[ii].l) {
- leftrect[ii].l= (*re).l;
- }
- if ((*re).h > leftrect[ii].h) {
- leftrect[ii].h= (*re).h;
- }
- }
- if (j >= mlow) {
- leftedge= 0.0; leftspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- leftedge+= leftrect[ii].h - leftrect[ii].l;
- leftspace*= leftrect[ii].h - leftrect[ii].l;
- }
- CopyRect(R,leftrect,rectarray[j]);
- edgearray[j]= leftedge;
- spacearray[j]= leftspace;
- }
- }
- /* fill array from m-1 up to M-m
- with leftrect, leftedge, leftspace */
- CopyRect(R,(*n).entries[I[M]].rect,rightrect);
- for (j= M-1; j >= m; j--) {
- for (ii= 0; ii <= (*par).maxdim; ii++) {
-
- re = &(*n).entries[I[j]].rect[ii];
-
- if ((*re).l < rightrect[ii].l) {
- rightrect[ii].l= (*re).l;
- }
- if ((*re).h > rightrect[ii].h) {
- rightrect[ii].h= (*re).h;
- }
- }
- if (j <= mhigh) {
- rightedge= 0.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightedge+= rightrect[ii].h- rightrect[ii].l;
- }
- if (Overlaps(R,rightrect,rectarray[j-1])) {
- GetOverlap(R,rightrect,rectarray[j-1],&ovlp);
- if (j == mhigh) {
- backvaledge= rightedge+edgearray[j-1];
- backvalvalue= ovlp;
- backind= j;
- }
- else {
- edge= rightedge+edgearray[j-1];
- backvaledge= backvaledge+edge;
- value= ovlp;
- if (value < backvalvalue) {
- backvalvalue= value;
- backind= j;
- }
- }
- }
- else {
- rightspace= 1.0;
- for (ii= 0; ii <= (*par).maxdim; ii++) {
- rightspace*= rightrect[ii].h - rightrect[ii].l;
- }
- if (j == mhigh) {
- backvaledge= rightedge+edgearray[j-1];
- backvalvalue= -1.0/(rightspace+spacearray[j-1]);
- backind= j;
- }
- else {
- edge= rightedge+edgearray[j-1];
- backvaledge= backvaledge+edge;
- value= -1.0/(rightspace+spacearray[j-1]);
- if (value < backvalvalue) {
- backvalvalue= value;
- backind= j;
- }
- }
- }
- }
- }
- /* Compute sum of the edges
- from rightedge[M-m+1]+leftedge[M-m]
- down to rightedge[m] +leftedge[m-1], -> axis;
- minimal area resp. overlap, -> index. */
- if (backvalvalue <= validvalue) {
- sortside= high;
- index= backind;
- }
- validedge= validedge+backvaledge;
- if (i == 0) {
- axsortside= sortside;
- axis= i;
- axisedge= validedge;
- axisindex= index;
- }
- else if (validedge < axisedge) {
- axsortside= sortside;
- axis= i;
- axisedge= validedge;
- axisindex= index;
- }
-
- }
- if (axis != (*par).maxdim || axsortside != currsortside) {
- QuickSortDataEnt(0,M,axis,axsortside,(*n).entries,I);
- }
-
- n= &(*(*R).N[depth]).DATA;
-
- (*n).nofentries= axisindex;
- for (j= 0; j < (*n).nofentries; j++) {
- (*n).entries[j]= (*(*R).Ntosplit).DATA.entries[I[j]];
- }
- /* printf("%3d",axisindex); */
- /* N[depth] gets entries 0 up to axisindex-1 */
-
- n= &(*(*R).Nsibling).DATA;
-
- (*n).nofentries= M-axisindex+1;
- for (j= 0; j < (*n).nofentries; j++) {
- (*n).entries[j]= (*(*R).Ntosplit).DATA.entries[I[axisindex+j]];
- }
- /* printf("%3d",M-axisindex+1); */
- /* printf("%3d\n",M+1); */
-}
-
-/***********************************************************************/
-
-static void UnDistributData(RSTREE R,
- typDATAent *newentry)
-
-{
- refDATAnode DAN;
-
- DAN= &(*(*R).Nsibling).DATA;
-
- (*DAN).nofentries= 1;
- (*DAN).entries[0]= *newentry;
- /* printf(" Un\n"); */
-}
-
-/***********************************************************************/
-
-void DeleteOneRec(RSTREE R)
-
-{
- refparameters par;
- refDIRnode DIN;
- refDATAnode DAN;
- refcount c;
- int depth, heightbefore;
- int i, j;
-
- par = &(*R).parameters._;
-
- depth= (*par).height;
- for (;;) {
- if (depth == (*par).height) {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- (*DAN).nofentries--;
- (*DAN).entries[(*R).E[depth]]= (*DAN).entries[(*DAN).nofentries];
- if ((*DAN).nofentries >= (*par).datam || depth == 1) {
- (*R).Nmodified[depth]= TRUE;
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datamodifycount++;
- }
-
- AdjustChainAfterDeletion(R,depth);
- break;
- }
- }
- else {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- (*DIN).nofentries--;
- (*DIN).entries[(*R).E[depth]]= (*DIN).entries[(*DIN).nofentries];
- if ((*DIN).nofentries >= (*par).dirm || depth == 1) {
- (*R).Nmodified[depth]= TRUE;
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
-
- AdjustChainAfterDeletion(R,depth);
- break;
- }
- }
- /*** --- LOOP not EXITed by deletion without underflow --- ***/
- NtoNDel(R,depth);
- depth--;
- }
- /*** --- ReInsertion --- ***/
- i= 2; heightbefore= (*par).height;
- while (i <= (*par).height) {
- if ((*R).NDel[i] != NULL) {
-
- c= &(*R).count;
- if ((*c).countflag) {
- if (i == (*par).height) {
- (*c).datavisitcount++;
- }
- else {
- (*c).dirvisitcount++;
- }
- }
- if (i == (*par).height) {
-
- DAN= &(*(*R).NDel[i]).DATA;
-
- for (j= 0; j < (*DAN).nofentries; j++) {
- Insert(R,(refentry)&(*DAN).entries[j],i);
- if ((*par).height > heightbefore) {
- i++; heightbefore++;
- }
- }
- }
- else {
-
- DIN= &(*(*R).NDel[i]).DIR;
-
- for (j= 0; j < (*DIN).nofentries; j++) {
- Insert(R,(refentry)&(*DIN).entries[j],i);
- if ((*par).height > heightbefore) {
- i++; heightbefore++;
- }
- }
- }
- free((*R).NDel[i]); (*R).NDel[i]= NULL;
- }
- i++;
- }
- /*** --- Shrink the tree --- ***/
- if ((*par).height != 1 && (*(*R).N[1]).DIR.nofentries == 1) {
- ShrinkTree(R);
- }
-}
-
-/***********************************************************************/
-
-static void NtoNDel(RSTREE R,
- int depth)
-
-{
- refparameters par;
-
- par= &(*R).parameters._;
-
- if ((*(*R).N[depth]).DIR.nofentries != 0) { /* see RSTBase.h "hope ..." */
- (*R).NDel[depth]= (*R).N[depth];
- if (depth == (*par).height) {
- (*R).N[depth]= (refnode)malloc((*R).datanodelen);
- }
- else {
- (*R).N[depth]= (refnode)malloc((*R).dirnodelen);
- }
- }
- else {
- /* this is only possible for data nodes. NDel[height] stays NULL. */
- /* ==> no ReInsertion(height). P[height] set to 0 in any case. */
- /* if height == 2 and shrink is done NewNode(R,2) is called. */
- }
- PutPageNr(R,(*R).P[depth],depth);
- (*R).P[depth]= 0;
- (*R).Nmodified[depth]= FALSE;
-}
-
-/***********************************************************************/
-
-static void ShrinkTree(RSTREE R)
-
-{
- refparameters par;
- refcount c;
- int i;
-
- par= &(*R).parameters._;
-
- if ((*R).P[2] == 0) {
- (*R).E[1]= 0;
- NewNode(R,2);
- }
- free((*R).N[1]);
- for (i= 1; i <= (*par).height; i++) {
- (*R).N[i]= (*R).N[i+1];
- }
- (*R).Nmodified[1]= TRUE;
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
-
- PutPageNr(R,(*R).P[2],2);
- for (i= 2; i <= (*par).height; i++) {
- (*R).P[i]= (*R).P[i+1];
- (*R).Nmodified[i]= (*R).Nmodified[i+1];
- (*par).pagecountarr[i]= (*par).pagecountarr[i+1];
- }
- (*R).E[(*par).height]= -1;
- (*par).height--;
-}
-
-/***********************************************************************/
diff --git a/modules/RStarTree/RSTInstDel.h b/modules/RStarTree/RSTInstDel.h
deleted file mode 100644
index 4779160..0000000
--- a/modules/RStarTree/RSTInstDel.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* ----- RSTInstDel.h ----- */
-#ifndef __RSTInstDel_h
-#define __RSTInstDel_h
-
-
-#include "RStarTree.h"
-
-
-/* declarations */
-
-void Insert(RSTREE R, refentry newentry, int depth);
-void DeleteOneRec(RSTREE R);
-
-
-#endif /* !__RSTInstDel_h */
diff --git a/modules/RStarTree/RSTInterUtil.c b/modules/RStarTree/RSTInterUtil.c
deleted file mode 100644
index be01685..0000000
--- a/modules/RStarTree/RSTInterUtil.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/* ----- RSTInterUtil.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTInterUtil.h"
-
-
-/* ----- declarations ----- */
-
-/***********************************************************************/
-
-void CreateRSFiles(RSTREE R)
-
-{
- RSTName SufName;
- int O_MODE= O_RDWR | O_CREAT | O_EXCL;
- /* int O_MODE= O_RDWR | O_CREAT | O_TRUNC; "forced Creation" */
-
- (*R).dir.f= open((*R).dirname,O_MODE,STDMODE);
- if ((*R).dir.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,datasuffix);
- (*R).data.f= open(SufName,O_MODE,STDMODE);
- if ((*R).data.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,dirPDsuffix);
- (*R).dirPD.f= open(SufName,O_MODE,STDMODE);
- if ((*R).dirPD.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,dataPDsuffix);
- (*R).dataPD.f= open(SufName,O_MODE,STDMODE);
- if ((*R).dataPD.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
-}
-
-/***********************************************************************/
-
-void OpenRSFiles(RSTREE R, int O_MODE)
-
-{
- RSTName SufName;
-
- (*R).dir.f= open((*R).dirname,O_MODE,STDMODE);
- if ((*R).dir.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,datasuffix);
- (*R).data.f= open(SufName,O_MODE,STDMODE);
- if ((*R).data.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,dirPDsuffix);
- (*R).dirPD.f= open(SufName,O_MODE,STDMODE);
- if ((*R).dirPD.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
- strcpy(SufName,(*R).dirname);
- strcat(SufName,dataPDsuffix);
- (*R).dataPD.f= open(SufName,O_MODE,STDMODE);
- if ((*R).dataPD.f == -1) {
- (*R).RSTDone= FALSE;
- return;
- }
-}
-
-/***********************************************************************/
-
-void FastCloseRSFiles(RSTREE R)
-
-{
- close((*R).dir.f);
- close((*R).data.f);
- close((*R).dirPD.f);
- close((*R).dataPD.f);
-}
-
-/***********************************************************************/
-
-void CloseRSFiles(RSTREE R)
-
-{
- if (close((*R).dir.f) == -1) {
- (*R).RSTDone= FALSE;
- }
- if (close((*R).data.f) == -1) {
- (*R).RSTDone= FALSE;
- }
- if (close((*R).dirPD.f) == -1) {
- (*R).RSTDone= FALSE;
- }
- if (close((*R).dataPD.f) == -1) {
- (*R).RSTDone= FALSE;
- }
-}
-
-/***********************************************************************/
-
-void SetBase(RSTREE R, int pagelen, boolean unique)
-
-{
- refparameters par;
- refpagedir dpd;
- int dirminfill, dataminfill;
- int i;
-
- par= &(*R).parameters._;
-
- (*par).minfillpercent= minimumFillPercentage;
- (*par).reinstpercent= ReInsertPercentage;
- (*par).nbrsexam= maximumNeighborsToExamine;
- (*par).maxdim= NumbOfDim-1;
- (*par).SIZEinfo= sizeof(typinfo);
- (*par).unique= unique;
- (*par).pagelen= pagelen;
-
- /* ----- set directory level parameters ----- */
- SetCheckDir(R,TRUE);
- (*par).dirM= ((*par).pagelen-(*par).SIZE_DIRnofentries) / (*par).direntrylen;
- if ((*par).dirM > maxentries) {
- (*R).RSTDone= FALSE;
- return;
- }
- if ((*par).dirM < 3) {
- (*R).RSTDone= FALSE;
- return;
- }
- if ((*par).dirM < 5) {
- dirminfill= minFillPercSmallFanout;
- }
- else {
- dirminfill= minimumFillPercentage;
- }
- (*par).dirMwords= (*par).dirM / sizeof(int) + 1;
- (*par).dirm= (dirminfill * (*par).dirM + 50) / 100;
- (*par).dirreinsertqty= ((*par).reinstpercent * (*par).dirM + 50) / 100;
-
- /* ----- set data level parameters ----- */
- SetCheckData(R,TRUE);
- (*par).dataM= ((*par).pagelen-(*par).SIZE_DATAnofentries) /
- (*par).dataentrylen;
- if ((*par).dataM > maxentries) {
- (*R).RSTDone= FALSE;
- return;
- }
- if ((*par).dataM < 1) {
- (*R).RSTDone= FALSE;
- return;
- }
- if ((*par).dataM < 5) {
- dataminfill= minFillPercSmallFanout;
- }
- else {
- dataminfill= minimumFillPercentage;
- }
- (*par).dataMwords= (*par).dataM / sizeof(int) + 1;
- (*par).datam= (dataminfill * (*par).dataM + 50) / 100;
- (*par).datareinsertqty=
- ((*par).reinstpercent * (*par).dataM + 50) / 100;
-
- /* ----- set defaults ----- */
- (*par).height= 1;
- (*par).dirpagecount= 1;
- (*par).datapagecount= 0;
- for (i= 0; i < chainlen; i++) {
- (*par).pagecountarr[i]= 0;
- }
- (*par).recordcount= 0;
-
- dpd= &(*R).dirpagedir._;
-
- (*dpd).childnr= firstPDblocknumb;
- (*dpd).nofnumbers= 0;
- (*dpd).number[0]= rootblocknumb;
-
- dpd= &(*R).datapagedir._;
-
- (*dpd).childnr= firstPDblocknumb;
- (*dpd).nofnumbers= 0;
- (*dpd).number[0]= rootblocknumb;
-}
-
-/***********************************************************************/
-
-void SetCheckDir(RSTREE R, boolean creation)
-
-{
- /* Alignment and compatibility checks */
-
- refparameters par;
- int SIZE_DIRnodeOf3, SIZE_DIRnodeOf2,
- PACKEDdirentrylen, REALdirentrylen,
- PACKEDSIZE_DIRnofentries, REALSIZE_DIRnofentries;
-
- par= &(*R).parameters._;
-
- if (creation) {
- (*par).direntrylen= sizeof(typDIRent); /* set */
- PACKEDdirentrylen= sizeof(typrect) + sizeof(int);
-#if 0
- if (PACKEDdirentrylen != (*par).direntrylen) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Directory entries are not packed!");
- fprintf(stderr,"%s %d\n","Packed directory entry length:",PACKEDdirentrylen);
- fprintf(stderr,"%s %d\n"," Real space needed:",(*par).direntrylen);
- fprintf(stderr,"%s\n",/* implicitly */"Applying the latter!");
- }
-#endif
- }
-
- SIZE_DIRnodeOf3= sizeof(typDIRnodeOf3);
- SIZE_DIRnodeOf2= sizeof(typDIRnodeOf2);
- REALdirentrylen= SIZE_DIRnodeOf3 - SIZE_DIRnodeOf2;
- if (creation) {
- if (REALdirentrylen != (*par).direntrylen) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Directory nodes are not packed!");
- fprintf(stderr,"%s %d\n","Directory entry length:",(*par).direntrylen);
- fprintf(stderr,"%s %d\n","Space needed in a node:",REALdirentrylen);
- fprintf(stderr,"%s\n",/* explicitly */"Applying the latter!");
- (*par).direntrylen= REALdirentrylen; /* reset */
- }
- }
- else {
- if ((*par).direntrylen != REALdirentrylen) { /* check */
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"Incompatible R*-tree file '%s'\n", R->dirname);
- fprintf(stderr,"%s %d\n","Size of a directory entry:",(*par).direntrylen);
- fprintf(stderr,"%s %d\n"," Expecting:",REALdirentrylen);
- }
- }
-
- PACKEDSIZE_DIRnofentries= sizeof(int);
- REALSIZE_DIRnofentries= SIZE_DIRnodeOf3 - 3 * (*par).direntrylen;
- (*par).SIZE_DIRnofentries= REALSIZE_DIRnofentries; /* set */
- if (creation) {
-#if 0
- if (PACKEDSIZE_DIRnofentries != (*par).SIZE_DIRnofentries) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Gap before directory entries!");
- }
-#endif
- }
- else {
- if ((*par).SIZE_DIRnofentries != REALSIZE_DIRnofentries) {
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"Incompatible R*-tree file '%s'\n", R->dirname);
- fprintf(stderr,"%s %d\n","Offset for entries:",(*par).SIZE_DIRnofentries);
- fprintf(stderr,"%s %d\n"," Expecting:",REALSIZE_DIRnofentries);
- }
- }
-
- if (! creation) {
- if ((*par).maxdim+1 != NumbOfDim) {
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"Incompatible R*-tree file '%s'\n", R->dirname);
- fprintf(stderr,"%s %d\n","Number of dimensions:",(*par).maxdim+1);
- fprintf(stderr,"%s %d\n"," Expecting:",NumbOfDim);
- }
- }
-
- (*R).dirnodelen= (*par).pagelen + (*par).direntrylen;
-}
-
-/***********************************************************************/
-
-void SetCheckData(RSTREE R, boolean creation)
-
-{
- /* Alignment and compatibility checks */
-
- refparameters par;
- int SIZE_DATAnodeOf3, SIZE_DATAnodeOf2,
- PACKEDdataentrylen, REALdataentrylen,
- PACKEDSIZE_DATAnofentries, REALSIZE_DATAnofentries;
-
- par= &(*R).parameters._;
-
- if (creation) {
- (*par).dataentrylen= sizeof(typDATAent); /* set */
- PACKEDdataentrylen= sizeof(typrect) + sizeof(typinfo);
- if (PACKEDdataentrylen != (*par).dataentrylen) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Data entries are not packed!");
- fprintf(stderr,"%s %d\n","Packed data entry length:",PACKEDdataentrylen);
- fprintf(stderr,"%s %d\n"," Real space needed:",(*par).dataentrylen);
- fprintf(stderr,"%s\n",/* implicitly */"Applying the latter!");
- }
- }
-
- SIZE_DATAnodeOf3= sizeof(typDATAnodeOf3);
- SIZE_DATAnodeOf2= sizeof(typDATAnodeOf2);
- REALdataentrylen= SIZE_DATAnodeOf3 - SIZE_DATAnodeOf2;
- if (creation) {
- if (REALdataentrylen != (*par).dataentrylen) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Data nodes are not packed!");
- fprintf(stderr,"%s %d\n"," Data entry length:",(*par).dataentrylen);
- fprintf(stderr,"%s %d\n","Space needed in a node:",REALdataentrylen);
- fprintf(stderr,"%s\n",/* explicitly */"Applying the latter!");
- (*par).dataentrylen= REALdataentrylen; /* reset */
- }
- }
- else {
- if ((*par).dataentrylen != REALdataentrylen) { /* check */
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"Incompatible R*-tree file '%s'\n", R->dirname);
- fprintf(stderr,"%s %d\n","Size of a data entry:",(*par).dataentrylen);
- fprintf(stderr,"%s %d\n"," Expecting:",REALdataentrylen);
- }
- }
-
- PACKEDSIZE_DATAnofentries= sizeof(int);
- REALSIZE_DATAnofentries= SIZE_DATAnodeOf3 - 3 * (*par).dataentrylen;
- (*par).SIZE_DATAnofentries= REALSIZE_DATAnofentries; /* set */
- if (creation) {
- if (PACKEDSIZE_DATAnofentries != (*par).SIZE_DATAnofentries) {
- fprintf(stderr,"\n%s\n"," ----- WARNING -----");
- fprintf(stderr,"%s\n","Gap before data entries!");
- }
- }
- else {
- if ((*par).SIZE_DATAnofentries != REALSIZE_DATAnofentries) {
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"Incompatible R*-tree file '%s'\n", R->dirname);
- fprintf(stderr,"%s %d\n","Offset for entries:",(*par).SIZE_DATAnofentries);
- fprintf(stderr,"%s %d\n"," Expecting:",REALSIZE_DATAnofentries);
- }
- }
-
- if (! creation) {
- if ((*par).SIZEinfo != sizeof(typinfo)) {
- fprintf(stderr,"\n%s\n","FATAL ERROR:");
- fprintf(stderr,"%s %d\n","Size of an info part:",(*par).SIZEinfo);
- fprintf(stderr,"%s %d\n"," Expecting:",sizeof(typinfo));
- }
- }
-
- (*R).datanodelen= (*par).pagelen + (*par).dataentrylen;
-}
-
-/***********************************************************************/
-
-void InitChainFlags(RSTREE R)
-
-{
- int i;
-
- for (i= 1; i <= chainlen; i++) {
- (*R).N[i]= NULL; (*R).NInst[i]= NULL; (*R).NDel[i]= NULL;
- (*R).E[i]= -1; (*R).EInst[i]= -1;
- (*R).P[i]= 0;
- (*R).Nmodified[i]= FALSE;
- (*R).ReInsert[i]= FALSE;
- }
-}
-
-/***********************************************************************/
-
-void AllocBuffers(RSTREE R)
-
-{
- refparameters par;
- int i;
-
- par= &(*R).parameters._;
-
- for (i= 1; i < (*par).height; i++) {
- (*R).N[i]= (refnode)malloc((*R).dirnodelen);
- }
- (*R).N[(*par).height]= (refnode)malloc((*R).datanodelen);
- if ((*R).dirnodelen > (*R).datanodelen) {
- (*R).Nsibling= (refnode)malloc((*R).dirnodelen);
- }
- else {
- (*R).Nsibling= (refnode)malloc((*R).datanodelen);
- }
- (*R).helpdirnode= (refnode)malloc((*R).dirnodelen);
- (*R).helpdatanode= (refnode)malloc((*R).datanodelen);
-}
-
-/***********************************************************************/
-
-void DeallocBuffers(RSTREE R)
-
-{
- refparameters par;
- int i;
-
- par= &(*R).parameters._;
-
- for (i= 1; i < (*par).height; i++) {
- free((*R).N[i]); (*R).N[i]= NULL;
- }
- free((*R).N[(*par).height]); (*R).N[(*par).height]= NULL;
- free((*R).Nsibling);
- free((*R).helpdirnode);
- free((*R).helpdatanode);
-}
-
-/***********************************************************************/
-
-void InitCount(RSTREE R)
-
-{
- refcount c;
-
- c= &(*R).count;
- (*c).countflag= FALSE;
- (*c).dirvisitcount= 0; (*c).datavisitcount= 0;
- (*c).dirreadcount= 0; (*c).datareadcount= 0;
- (*c).dirmodifycount= 0; (*c).datamodifycount= 0;
- (*c).dirwritecount= 0; (*c).datawritecount= 0;
-}
-
-/***********************************************************************/
diff --git a/modules/RStarTree/RSTInterUtil.h b/modules/RStarTree/RSTInterUtil.h
deleted file mode 100644
index 4c30a23..0000000
--- a/modules/RStarTree/RSTInterUtil.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ----- RSTInterUtil.h ----- */
-#ifndef __RSTInterUtil_h
-#define __RSTInterUtil_h
-
-
-#include "RStarTree.h"
-
-
-/* constants */
-
-#define minimumFillPercentage 40
-#define minFillPercSmallFanout 50
-#define ReInsertPercentage 30
-#define maximumNeighborsToExamine 32
-
-
-/* declarations */
-
-void CreateRSFiles(RSTREE R);
-void OpenRSFiles(RSTREE R, int O_MODE);
-void FastCloseRSFiles(RSTREE R);
-void CloseRSFiles(RSTREE R);
-void SetBase(RSTREE R, int pagelen, boolean unique);
-void SetCheckDir(RSTREE R, boolean creation);
-void SetCheckData(RSTREE R, boolean creation);
-void InitChainFlags(RSTREE R);
-void AllocBuffers(RSTREE R);
-void DeallocBuffers(RSTREE R);
-void InitCount(RSTREE R);
-
-
-#endif /* !__RSTInterUtil_h */
diff --git a/modules/RStarTree/RSTJoin.c b/modules/RStarTree/RSTJoin.c
deleted file mode 100644
index 86669e6..0000000
--- a/modules/RStarTree/RSTJoin.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/* ----- RSTJoin.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTJoin.h"
-#include "RSTUtil.h"
-#include "RSTInOut.h"
-
-
-/* declarations */
-
-static void JnRgnCntNv(RSTREE R, RSTREE Rx,
- boolean order,
- int depth,
- typrect dataqueryrect1,
- typrect dataqueryrect2,
- typrect joinrect,
- DataQueryProc DataQuery,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *keysqualifying);
-
-static void JnRgnQueryNv(RSTREE R, RSTREE Rx,
- boolean order,
- int depth,
- typrect dataqueryrect1,
- typrect dataqueryrect2,
- typrect joinrect,
- refinfo ptr_to_info_of_other_tree,
- DataQueryProc DataQuery,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *buf1,
- void *buf2,
- boolean *finish);
-
-
-/************************************************************************/
-
-void JnCntNv(RSTREE R1, RSTREE R2,
- int depth,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *keysqualifying,
- int *mark)
-
-{
- refDATAnode n;
- refcount c;
- boolean istoread1, istoread2;
- int downqualifying;
- typrect unused;
- int i, j;
-
- boolean verbosejoincount= TRUE;
-
- if (depth != (*R1).parameters._.height && depth !=
- (*R2).parameters._.height) {
- for (i= 0; i < (*(*R1).N[depth]).DIR.nofentries; i++) {
- for (j= 0; j < (*(*R2).N[depth]).DIR.nofentries; j++) {
- if ( Dir1Query(R1,(*(*R1).N[depth]).DIR.entries[i].rect,
- R1rectangle1,R1rectangle2) &&
- Dir2Query(R2,(*(*R2).N[depth]).DIR.entries[j].rect,
- R2rectangle1,R2rectangle2) ) {
- if (DirJoin(R1,(*(*R1).N[depth]).DIR.entries[i].rect,
- (*(*R2).N[depth]).DIR.entries[j].rect,unused)) {
- /* R1 sets the number of dimensions and type */
- (*R1).E[depth]= i; (*R2).E[depth]= j;
- istoread1= (*(*R1).N[depth]).DIR.entries[i].ptrtosub !=
- (*R1).P[depth+1];
- if ( istoread1 ) {
- NewNode(R1,depth+1);
- }
- istoread2= (*(*R2).N[depth]).DIR.entries[j].ptrtosub !=
- (*R2).P[depth+1];
- if ( istoread2 ) {
- NewNode(R2,depth+1);
- }
- JnCntNv(R1,R2,
- depth+1,
- R1rectangle1,R1rectangle2,R2rectangle1,R2rectangle2,
- Dir1Query,Data1Query,Dir2Query,Data2Query,DirJoin,DataJoin,
- keysqualifying,
- mark);
- }
- }
- }
- }
-
- c= &(*R1).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
-
- c= &(*R2).count;
- if ( (*c).countflag ) {
- (*c).dirvisitcount++;
- }
- }
- else {
- if (depth == (*R1).parameters._.height) {
-
- n= &(*(*R1).N[depth]).DATA;
-
- for (i= 0; i < (*n).nofentries; i++) {
- downqualifying= 0;
- if (Data1Query(R1,(*n).entries[i].rect,R1rectangle1,R1rectangle2)) {
- JnRgnCntNv(R2,R1,FALSE,depth,
- R2rectangle1,R2rectangle2,
- (*n).entries[i].rect,
- Data2Query,
- DirJoin,DataJoin,
- &downqualifying);
- *keysqualifying+= downqualifying;
- if (verbosejoincount) {
- if (*keysqualifying > *mark) {
- printf("%s%10d%s\n","More than",*mark," record pairs.");
- if (*mark < 1000) {
- *mark+= 100;
- }
- else if (*mark < 10000) {
- *mark+= 1000;
- }
- else {
- *mark+= 10000;
- }
- }
- }
- }
- }
-
- c= &(*R1).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
- }
- else {
-
- n= &(*(*R2).N[depth]).DATA;
-
- for (i= 0; i < (*n).nofentries; i++) {
- downqualifying= 0;
- if (Data2Query(R2,(*n).entries[i].rect,R2rectangle1,R2rectangle2)) {
- JnRgnCntNv(R1,R2,TRUE,depth,
- R1rectangle1,R1rectangle2,
- (*n).entries[i].rect,
- Data1Query,
- DirJoin,DataJoin,
- &downqualifying);
- *keysqualifying+= downqualifying;
- if (verbosejoincount) {
- if (*keysqualifying > *mark) {
- printf("%s%10d%s\n","More than",*mark," record pairs.");
- if (*mark < 1000) {
- *mark+= 100;
- }
- else if (*mark < 10000) {
- *mark+= 1000;
- }
- else {
- *mark+= 10000;
- }
- }
- }
- }
- }
-
- c= &(*R2).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- }
- }
-}
-
-/************************************************************************/
-
-static void JnRgnCntNv(RSTREE R, RSTREE Rx,
- boolean order,
- int depth,
- typrect dataqueryrect1,
- typrect dataqueryrect2,
- typrect joinrect,
- DataQueryProc DataQuery,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *keysqualifying)
-
-{
- refDIRnode DIN;
- refDATAnode DAN;
- refcount c;
- boolean istoread;
- typrect unused;
- int i;
-
-
- if (depth != (*R).parameters._.height) {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- if (order) {
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (DirJoin(R,(*DIN).entries[i].rect,joinrect,unused)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if ( istoread ) {
- NewNode(R,depth+1);
- }
- JnRgnCntNv(R,Rx,order,depth+1,
- dataqueryrect1,dataqueryrect2,joinrect,
- DataQuery,DirJoin,DataJoin,
- keysqualifying);
- }
- }
- }
- else {
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (DirJoin(Rx,joinrect,(*DIN).entries[i].rect,unused)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- JnRgnCntNv(R,Rx,order,depth+1,
- dataqueryrect1,dataqueryrect2,joinrect,
- DataQuery,DirJoin,DataJoin,
- keysqualifying);
- }
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
- }
- else {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- if (order) {
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (DataQuery(R,(*DAN).entries[i].rect,dataqueryrect1,dataqueryrect2)) {
- if (DataJoin(R,(*DAN).entries[i].rect,joinrect,unused)) {
- (*R).E[depth]= i;
- (*keysqualifying)++;
- }
- }
- }
- }
- else {
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (DataQuery(R,(*DAN).entries[i].rect,dataqueryrect1,dataqueryrect2)) {
- if (DataJoin(Rx,joinrect,(*DAN).entries[i].rect,unused)) {
- (*R).E[depth]= i;
- (*keysqualifying)++;
- }
- }
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- }
-}
-
-/************************************************************************/
-
-void JnNv(RSTREE R1, RSTREE R2,
- int depth,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *buf1,
- void *buf2,
- boolean *finish)
-
-{
- refDATAnode n;
- refcount c;
- boolean istoread1, istoread2;
- typrect unused;
- int i, j;
-
- if (depth != (*R1).parameters._.height && depth !=
- (*R2).parameters._.height) {
- c= &(*R1).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
- c= &(*R2).count;
- if ( (*c).countflag ) {
- (*c).dirvisitcount++;
- }
-
- for (i= 0; i < (*(*R1).N[depth]).DIR.nofentries; i++) {
- if (*finish) {return;}
- for (j= 0; j < (*(*R2).N[depth]).DIR.nofentries; j++) {
- if (*finish) {return;}
- if ( Dir1Query(R1,(*(*R1).N[depth]).DIR.entries[i].rect,
- R1rectangle1,R1rectangle2) &&
- Dir2Query(R2,(*(*R2).N[depth]).DIR.entries[j].rect,
- R2rectangle1,R2rectangle2) ) {
- if (DirJoin(R1,(*(*R1).N[depth]).DIR.entries[i].rect,
- (*(*R2).N[depth]).DIR.entries[j].rect,unused)) {
- /* R1 sets the number of dimensions and type */
- (*R1).E[depth]= i; (*R2).E[depth]= j;
- istoread1= (*(*R1).N[depth]).DIR.entries[i].ptrtosub !=
- (*R1).P[depth+1];
- if ( istoread1 ) {
- NewNode(R1,depth+1);
- }
- istoread2= (*(*R2).N[depth]).DIR.entries[j].ptrtosub !=
- (*R2).P[depth+1];
- if ( istoread2 ) {
- NewNode(R2,depth+1);
- }
- JnNv(R1,R2,
- depth+1,
- R1rectangle1,R1rectangle2,R2rectangle1,R2rectangle2,
- Dir1Query,Data1Query,Dir2Query,Data2Query,DirJoin,DataJoin,
- Manage,buf1,buf2,finish);
- }
- }
- }
- }
- }
- else {
- if (depth == (*R1).parameters._.height) {
-
- c= &(*R1).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- n= &(*(*R1).N[depth]).DATA;
-
- for (i= 0; i < (*n).nofentries; i++) {
- if (*finish) {return;}
- if (Data1Query(R1,(*n).entries[i].rect,R1rectangle1,R1rectangle2)) {
- JnRgnQueryNv(R2,R1,FALSE,depth,
- R2rectangle1,R2rectangle2,
- (*n).entries[i].rect,
- &(*n).entries[i].info,
- Data2Query,
- DirJoin,DataJoin,
- Manage,buf1,buf2,finish);
- }
- }
- }
- else {
-
- c= &(*R2).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- n= &(*(*R2).N[depth]).DATA;
-
- for (i= 0; i < (*n).nofentries; i++) {
- if (*finish) {return;}
- if (Data2Query(R2,(*n).entries[i].rect,R2rectangle1,R2rectangle2)) {
- JnRgnQueryNv(R1,R2,TRUE,depth,
- R1rectangle1,R1rectangle2,
- (*n).entries[i].rect,
- &(*n).entries[i].info,
- Data1Query,
- DirJoin,DataJoin,
- Manage,buf1,buf2,finish);
- }
- }
- }
- }
-}
-
-/************************************************************************/
-
-static void JnRgnQueryNv(RSTREE R, RSTREE Rx,
- boolean order,
- int depth,
- typrect dataqueryrect1,
- typrect dataqueryrect2,
- typrect joinrect,
- typinfo *joininfo,
- DataQueryProc DataQuery,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *buf1,
- void *buf2,
- boolean *finish)
-{
- refDIRnode DIN;
- refDATAnode DAN;
- refcount c;
- boolean istoread;
- typrect rectR1, rectR2, unused;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
-
- DIN= &(*(*R).N[depth]).DIR;
-
- if (order) {
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (*finish) {return;}
- if (DirJoin(R,(*DIN).entries[i].rect,joinrect,unused)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if ( istoread ) {
- NewNode(R,depth+1);
- }
- JnRgnQueryNv(R,Rx,order,depth+1,
- dataqueryrect1,dataqueryrect2,
- joinrect,
- joininfo,
- DataQuery,DirJoin,DataJoin,
- Manage,buf1,buf2,finish);
- }
- }
- }
- else {
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (*finish) {return;}
- if (DirJoin(Rx,joinrect,(*DIN).entries[i].rect,unused)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- JnRgnQueryNv(R,Rx,order,depth+1,
- dataqueryrect1,dataqueryrect2,
- joinrect,
- joininfo,
- DataQuery,DirJoin,DataJoin,
- Manage,buf1,buf2,finish);
- }
- }
- }
- }
- else {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- DAN= &(*(*R).N[depth]).DATA;
-
- if (order) {
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (*finish) {return;}
- if (DataQuery(R,(*DAN).entries[i].rect,dataqueryrect1,dataqueryrect2)) {
- if (DataJoin(R,(*DAN).entries[i].rect,joinrect,unused)) {
- (*R).E[depth]= i;
- CopyRect(R,(*DAN).entries[i].rect,rectR1);
- CopyRect(R,joinrect,rectR2);
- Manage(R,Rx,
- rectR1,rectR2,
- &(*DAN).entries[i].info,joininfo,
- buf1,buf2,
- finish);
- }
- }
- }
- }
- else {
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (*finish) {return;}
- if (DataQuery(R,(*DAN).entries[i].rect,dataqueryrect1,dataqueryrect2)) {
- if (DataJoin(Rx,joinrect,(*DAN).entries[i].rect,unused)) {
- (*R).E[depth]= i;
- CopyRect(Rx,joinrect,rectR1);
- CopyRect(Rx,(*DAN).entries[i].rect,rectR2);
- Manage(Rx,R,
- rectR1,rectR2,
- joininfo,&(*DAN).entries[i].info,
- buf1,buf2,
- finish);
- }
- }
- }
- }
- }
-}
-
-/************************************************************************/
diff --git a/modules/RStarTree/RSTJoin.h b/modules/RStarTree/RSTJoin.h
deleted file mode 100644
index 075fee5..0000000
--- a/modules/RStarTree/RSTJoin.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ----- RSTJoin.h ----- */
-#ifndef __RSTJoin_h
-#define __RSTJoin_h
-
-
-#include "RStarTree.h"
-
-
-/* declarations */
-
-void JnCntNv(RSTREE R1, RSTREE R2,
- int depth,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *keysqualifying,
- int *mark);
-
-
-void JnNv(RSTREE R1, RSTREE R2,
- int depth,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *buf1,
- void *buf2,
- boolean *finish);
-
-
-#endif /* !__RSTJoin_h */
-
diff --git a/modules/RStarTree/RSTQuery.c b/modules/RStarTree/RSTQuery.c
deleted file mode 100644
index 6d8658f..0000000
--- a/modules/RStarTree/RSTQuery.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/* ----- RSTQuery.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTQuery.h"
-#include "RSTUtil.h"
-#include "RSTInOut.h"
-
-
-/* declarations */
-
-/************************************************************************/
-
-boolean FoundRect(RSTREE R,
- int depth,
- typrect rectangle,
- boolean isinsert,
- refinfo *infoadr)
-
-{
- refparameters par;
- refcount c;
- refDATAnode n;
- int instind;
- boolean found;
- int i;
-
- i= -1; instind= -1; found= FALSE;
-
- par= &(*R).parameters._;
-
- if (depth != (*par).height) {
- if (isinsert) {
- ChooseSubtree(R,rectangle,depth,&(*(*R).N[depth]).DIR,&instind);
- (*R).EInst[depth]= instind;
- }
- do {
- i++;
- if (Covers(R,(*(*R).N[depth]).DIR.entries[i].rect,rectangle)) {
- (*R).E[depth]= i;
- depth++;
- if ((*R).N[depth] == (*R).NInst[depth]) {
- if ((*R).Nmodified[depth]) {
- PutNode(R,(*R).N[depth],(*R).P[depth],depth);
- (*R).Nmodified[depth]= FALSE;
- }
- if (depth == (*par).height) {
- (*R).N[depth]= (refnode)malloc((*R).datanodelen);
- }
- else {
- (*R).N[depth]= (refnode)malloc((*R).dirnodelen);
- }
- (*R).P[depth]= (*(*R).N[depth-1]).DIR.entries[i].ptrtosub;
- GetNode(R,(*R).N[depth],(*R).P[depth],depth);
- }
- else if ((*(*R).N[depth-1]).DIR.entries[i].ptrtosub != (*R).P[depth]) {
- NewNode(R,depth);
- }
- if ( i == instind) {
- (*R).NInst[depth]= (*R).N[depth];
- }
- found= FoundRect(R,depth,rectangle,i==instind,infoadr);
- depth--;
- }
- } while (! found && i != (*(*R).N[depth]).DIR.nofentries - 1);
-
- c = &(*R).count;
-
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
- }
- else {
-
- n= &(*(*R).N[depth]).DATA;
-
- while (! found && i != (*n).nofentries - 1) {
- i++;
- found= RSTEqual(R,(*n).entries[i].rect,rectangle);
- if (found) {
- (*R).E[depth]= i;
- *infoadr= &(*n).entries[i].info;
- }
- }
-
- c = &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
- }
- if (found) {
- (*R).EInst[depth]= -1;
- depth++;
- if ((*R).NInst[depth] != NULL) {
- if ((*R).NInst[depth] != (*R).N[depth]) {
- free((*R).NInst[depth]);
- }
- (*R).NInst[depth]= NULL;
- }
- depth--;
- }
- return found;
-}
-
-/************************************************************************/
-
-void XstsRgn(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- boolean *found)
-
-{
- refcount c;
- refDIRnode DIN;
- refDATAnode DAN;
- boolean istoread;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- i= -1;
- do {
- i++;
- if (DirQuery(R,(*DIN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- XstsRgn(R,depth+1,rectangle1,rectangle2,DirQuery,DataQuery,found);
- }
- } while (! *found && i != (*DIN).nofentries - 1);
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
- }
- else {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- i= -1;
- while (! *found && i != (*DAN).nofentries - 1) {
- i++;
- if (DataQuery(R,(*DAN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
- *found= TRUE;
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
- }
-}
-
-/************************************************************************/
-
-void RgnCnt(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- int *keysqualifying)
-
-{
- refcount c;
- refDIRnode DIN;
- refDATAnode DAN;
- boolean istoread;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (DirQuery(R,(*DIN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- RgnCnt(R,depth+1,rectangle1,rectangle2,
- DirQuery, DataQuery,keysqualifying);
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
- }
- else {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (DataQuery(R,(*DAN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
- (*keysqualifying)++;
- }
- }
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- }
-}
-
-/************************************************************************/
-
-void RgnQuery(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- QueryManageProc Manage,
- void *buf,
- boolean *finish)
-
-{
- refcount c;
- refDIRnode DIN;
- refDATAnode DAN;
- boolean istoread;
- typrect rectfound;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
-
- DIN= &(*(*R).N[depth]).DIR;
-
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (*finish) {return;}
-
- if (DirQuery(R,(*DIN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- RgnQuery(R,depth+1,rectangle1,rectangle2,
- DirQuery,DataQuery,
- Manage,buf,finish);
- }
- }
- }
- else {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- DAN= &(*(*R).N[depth]).DATA;
-
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (*finish) {return;}
-
- if (DataQuery(R,(*DAN).entries[i].rect,rectangle1,rectangle2)) {
- (*R).E[depth]= i;
-
- CopyRect(R,(*DAN).entries[i].rect,rectfound); /* avoid modification */
- Manage(R,rectfound,
- &(*DAN).entries[i].info,
- buf,
- &(*R).Nmodified[depth],
- finish);
-
- }
- }
- }
-}
-
-/************************************************************************/
-
-void All(RSTREE R,
- int depth,
- QueryManageProc Manage,
- void *buf,
- boolean *finish)
-
-{
- refDIRnode DIN;
- refDATAnode DAN;
- typrect rectfound;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- for (i= 0; i < (*DIN).nofentries; i++) {
- if (*finish) {return;}
-
- (*R).E[depth]= i;
- if ((*DIN).entries[i].ptrtosub != (*R).P[depth+1]) {
- NewNode(R,depth+1);
- }
- All(R,depth+1,Manage,buf,finish);
- }
- }
- else {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- for (i= 0; i < (*DAN).nofentries; i++) {
- if (*finish) {return;}
-
- (*R).E[depth]= i;
-
- CopyRect(R,(*DAN).entries[i].rect,rectfound); /* avoid modification */
- Manage(R,rectfound,
- &(*DAN).entries[i].info,
- buf,
- &(*R).Nmodified[depth],
- finish);
-
- }
- }
-}
-
-/************************************************************************/
-
-static void dirinfo_init (typdirinfo * info)
-{
- memset (info, 0, sizeof (typdirinfo));
- info->Hmin = 1e30;
- info->Hmax = - 1e30;
-}
-
-static void relative (typrect rect, double * o, double * h)
-{
- o[0] = (((double)rect[0].l) + ((double)rect[0].h))/2.;
- o[1] = (((double)rect[1].l) + ((double)rect[1].h))/2.;
- *h = ((double)rect[0].h) - ((double)rect[0].l);
- if (((double)rect[1].h) - ((double)rect[1].l) > *h)
- *h = ((double)rect[1].h) - ((double)rect[1].l);
-}
-
-static void dirinfo_add_dir (typrect parent, typdirinfo * info, typrect rect, typdirinfo * a)
-{
- double op[2], oa[2], hp, ha;
-
- relative (parent, op, &hp);
- relative (rect, oa, &ha);
-
- double oap0 = oa[0] - op[0], oap1 = oa[1] - op[1];
- double an = a->n;
- double ha2 = ha*ha, hp2 = hp*hp;
- info->m01 += (an*oap0 + a->m01*ha)/hp;
- info->m02 += (an*oap1 + a->m02*ha)/hp;
- info->m03 += (oap0*(an*oap1 + a->m02*ha) + ha*(a->m01*oap1 + a->m03*ha))/hp2;
- double m11 = (oap0*(an*oap0 + 2.*a->m01*ha) + a->m11*ha2)/hp2;
- info->m11 += m11;
- double m13 = ha*(oap0*(a->m02*oap0 + 2.*a->m03*ha) + a->m13*ha2)/hp2;
- info->m13 += (oap1*m11 + m13)/hp;
- double m22 = (oap1*(an*oap1 + 2.*a->m02*ha) + a->m22*ha2)/hp2;
- info->m22 += m22;
- info->m23 += (oap0*m22 + ha*(oap1*(oap1*a->m01 + 2.*a->m03*ha) + a->m23*ha2)/hp2)/hp;
- info->m33 += (oap1*(oap1*m11 + 2.*m13) +
- ha2*(oap0*(oap0*a->m22 + 2.*a->m23*ha) + ha2*a->m33)/hp2)/hp2;
- double ha3 = ha2*ha, hp3 = hp2*hp;
- info->m44 += (oap0*(oap0*(oap0*an + 3.*ha*a->m01) + 3.*ha2*a->m11) + ha3*a->m44)/hp3;
- info->m55 += (oap1*(oap1*(oap1*an + 3.*ha*a->m02) + 3.*ha2*a->m22) + ha3*a->m55)/hp3;
- double ha4 = ha3*ha, hp4 = hp3*hp;
- info->m66 += (oap0*(oap0*(oap0*(oap0*an + 4.*ha*a->m01) + 6.*ha2*a->m11)
- + 4.*ha3*a->m44) + ha4*a->m66)/hp4;
- info->m77 += (oap1*(oap1*(oap1*(oap1*an + 4.*ha*a->m02) + 6.*ha2*a->m22)
- + 4.*ha3*a->m55) + ha4*a->m77)/hp4;
- info->m67 += (oap1*(oap0*(oap0*(oap0*an + 3.*ha*a->m01) + 3.*ha2*a->m11) + ha3*a->m44)
- + oap0*(oap0*(ha*a->m02*oap0 + 3.*ha2*a->m03) + 3.*ha3*a->m13)
- + ha4*a->m67)/hp4;
- info->m76 += (oap0*(oap1*(oap1*(oap1*an + 3.*ha*a->m02) + 3.*ha2*a->m22) + ha3*a->m55)
- + oap1*(oap1*(ha*a->m01*oap1 + 3.*ha2*a->m03) + 3.*ha3*a->m23)
- + ha4*a->m76)/hp4;
- info->H0 += a->H0;
- info->H1 += (a->H0*oap0 + a->H1*ha)/hp;
- info->H2 += (a->H0*oap1 + a->H2*ha)/hp;
- info->H3 += (ha*(ha*a->H3 + oap0*a->H2 + oap1*a->H1) + oap0*oap1*a->H0)/hp2;
- info->H4 += a->H4;
- info->H5 += (oap0*(2.*ha*a->H1 + oap0*a->H0) + ha2*a->H5)/hp2;
- info->H6 += (oap1*(2.*ha*a->H2 + oap1*a->H0) + ha2*a->H6)/hp2;
- info->n += a->n;
- if (a->Hmin < info->Hmin) info->Hmin = a->Hmin;
- if (a->Hmax > info->Hmax) info->Hmax = a->Hmax;
-}
-
-static void dirinfo_add_data (typrect parent, typdirinfo * info, typrect rect, refinfo data)
-{
- double p[3], o[2], h;
-
- relative (parent, o, &h);
-
- p[0] = (((double) rect[0].l) - o[0])/h; p[1] = (((double)rect[1].l) - o[1])/h;
- p[2] = data->height;
- info->m01 += p[0];
- info->m02 += p[1];
- info->m03 += p[0]*p[1];
- info->m11 += p[0]*p[0];
- info->m13 += p[0]*p[0]*p[1];
- info->m22 += p[1]*p[1];
- info->m23 += p[0]*p[1]*p[1];
- info->m33 += p[0]*p[0]*p[1]*p[1];
- info->m44 += p[0]*p[0]*p[0];
- info->m55 += p[1]*p[1]*p[1];
- info->m66 += p[0]*p[0]*p[0]*p[0];
- info->m77 += p[1]*p[1]*p[1]*p[1];
- info->m67 += p[0]*p[0]*p[0]*p[1];
- info->m76 += p[1]*p[1]*p[1]*p[0];
- info->H0 += p[2];
- info->H1 += p[0]*p[2];
- info->H2 += p[1]*p[2];
- info->H3 += p[0]*p[1]*p[2];
- info->H4 += p[2]*p[2];
- info->H5 += p[0]*p[0]*p[2];
- info->H6 += p[1]*p[1]*p[2];
- info->n++;
- if (p[2] < info->Hmin) info->Hmin = p[2];
- if (p[2] > info->Hmax) info->Hmax = p[2];
-}
-
-void UpdateAll(RSTREE R,
- int depth,
- typrect rect,
- typdirinfo * info)
-
-{
- refDIRnode DIN;
- refDATAnode DAN;
- typrect rectfound;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- DIN= &(*(*R).N[depth]).DIR;
-
- for (i= 0; i < (*DIN).nofentries; i++) {
- (*R).E[depth]= i;
- if ((*DIN).entries[i].ptrtosub != (*R).P[depth+1]) {
- NewNode(R,depth+1);
- }
- dirinfo_init (&(*DIN).entries[i].info);
- (*R).Nmodified[depth] = 1;
- UpdateAll(R,depth+1,(*DIN).entries[i].rect,&(*DIN).entries[i].info);
- dirinfo_add_dir (rect,info,(*DIN).entries[i].rect,&(*DIN).entries[i].info);
- }
- }
- else {
-
- DAN= &(*(*R).N[depth]).DATA;
-
- for (i= 0; i < (*DAN).nofentries; i++) {
- (*R).E[depth]= i;
-
- CopyRect(R,(*DAN).entries[i].rect,rectfound); /* avoid modification */
- dirinfo_add_data (rect,info,rectfound,&(*DAN).entries[i].info);
- }
- }
-}
-
-/************************************************************************/
-
-void RgnQueryInfo(RSTREE R,
- int depth,
- Check includes,
- Check intersects,
- void * data,
- typrect rect,
- typdirinfo * info)
-
-{
- refcount c;
- refDIRnode DIN;
- refDATAnode DAN;
- boolean istoread;
- typrect rectfound;
- int i;
-
- if (depth != (*R).parameters._.height) {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).dirvisitcount++;
- }
-
- DIN= &(*(*R).N[depth]).DIR;
-
- for (i= 0; i < (*DIN).nofentries; i++) {
- if ((* includes) ((*DIN).entries[i].rect,data,depth))
- dirinfo_add_dir (rect, info, (*DIN).entries[i].rect, &(*DIN).entries[i].info);
- else if ((* intersects) ((*DIN).entries[i].rect,data,depth)) {
- (*R).E[depth]= i;
- istoread= (*DIN).entries[i].ptrtosub != (*R).P[depth+1];
- if (istoread) {
- NewNode(R,depth+1);
- }
- RgnQueryInfo(R,depth+1,includes,intersects,data,rect,info);
- }
- }
- }
- else {
-
- c= &(*R).count;
- if ((*c).countflag) {
- (*c).datavisitcount++;
- }
-
- DAN= &(*(*R).N[depth]).DATA;
-
- for (i= 0; i < (*DAN).nofentries; i++) {
-
- if ((* includes) ((*DAN).entries[i].rect,data,depth)) {
- (*R).E[depth]= i;
-
- CopyRect(R,(*DAN).entries[i].rect,rectfound); /* avoid modification */
- dirinfo_add_data (rect, info, rectfound, &(*DAN).entries[i].info);
- }
- }
- }
-}
-
-/************************************************************************/
diff --git a/modules/RStarTree/RSTQuery.h b/modules/RStarTree/RSTQuery.h
deleted file mode 100644
index 7404cca..0000000
--- a/modules/RStarTree/RSTQuery.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ----- RSTQuery.h ----- */
-#ifndef __RSTQuery_h
-#define __RSTQuery_h
-
-
-#include "RStarTree.h"
-
-
-/* declarations */
-
-boolean FoundRect(RSTREE R,
- int depth,
- typrect rectangle,
- boolean isinsert,
- refinfo *infoadr);
-
-void XstsRgn(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- boolean *found);
-
-
-void RgnCnt(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- int *keysqualifying);
-
-
-void RgnQuery(RSTREE R,
- int depth,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- QueryManageProc Manage,
- void *buf,
- boolean *finish);
-
-void All(RSTREE R,
- int depth,
- QueryManageProc Manage,
- void *buf,
- boolean *finish);
-
-void UpdateAll(RSTREE R,
- int depth,
- typrect rect,
- typdirinfo * info);
-
-void RgnQueryInfo(RSTREE R,
- int depth,
- Check includes,
- Check intersects,
- void * data,
- typrect rect,
- typdirinfo * info);
-
-#endif /* !__RSTQuery_h */
-
diff --git a/modules/RStarTree/RSTUtil.c b/modules/RStarTree/RSTUtil.c
deleted file mode 100644
index 6763c58..0000000
--- a/modules/RStarTree/RSTUtil.c
+++ /dev/null
@@ -1,843 +0,0 @@
-/* ----- RSTUtil.c ----- */
-
-
-#include "RStarTree.h"
-#include "RSTUtil.h"
-
-
-/* declarations */
-
-static void ExChange(int *x, int *y);
-static void CSWorkAround(RSTREE R,
- typrect newrect,
- refDIRnode node,
- int index,
- double space,
- double newspace);
-
-
-/***********************************************************************/
-
-void FalseArray(int *ptr, int wordsqty)
-
-{
- int i;
-
- i= 1;
- while (i <= wordsqty) {
- *ptr= FALSE;
- ptr++;
- i++;
- }
-}
-
-/***********************************************************************/
-
-void CopyRect(RSTREE R,
- typrect from,
- typrect to)
-
-{
- int d;
- for (d= 0; d <= (*R).parameters._.maxdim; d++) {
- to[d]= from[d];
- }
-}
-
-/***********************************************************************/
-
-void EvalCenter(RSTREE R, typrect rectangle, typpoint center)
-
-{
- int i;
-
- for (i= 0; i <= (*R).parameters._.maxdim; i++) {
- center[i]= (rectangle[i].l + rectangle[i].h) / 2.0;
- }
-}
-
-/***********************************************************************/
-
-double RSTDistance(RSTREE R, typpoint point1, typpoint point2)
-
-{
- double sum, factor;
- int i;
-
- sum= 0.0;
- for (i= 0; i <= (*R).parameters._.maxdim; i++) {
- factor= point1[i] - point2[i];
- sum= sum+factor*factor;
- }
- return sum; /* relativ distance (sqrt avoided) */
-}
-
-/***********************************************************************/
-
-void EvalDirEnclRect(RSTREE R, typDIRnode *node, typrect rectangle)
-
-{
- int maxdim;
- refinterval re;
- int i, j;
-
- maxdim= (*R).parameters._.maxdim;
- CopyRect(R,(*node).entries[0].rect,rectangle);
- for (i= 0; i < (*node).nofentries; i++) {
- for (j= 0; j <= maxdim; j++) {
-
- re= &(*node).entries[i].rect[j];
-
- if (rectangle[j].l > (*re).l) {
- rectangle[j].l= (*re).l;
- }
- if (rectangle[j].h < (*re).h) {
- rectangle[j].h= (*re).h;
- }
- }
- }
-}
-
-/***********************************************************************/
-
-void EvalDataEnclRect(RSTREE R, typDATAnode *node, typrect rectangle)
-
-{
- int maxdim;
- refinterval re;
- int i, j;
-
- maxdim= (*R).parameters._.maxdim;
- CopyRect(R,(*node).entries[0].rect,rectangle);
- for (i= 0; i < (*node).nofentries; i++) {
- for (j= 0; j <= maxdim; j++) {
-
- re= &(*node).entries[i].rect[j];
-
- if (rectangle[j].l > (*re).l) {
- rectangle[j].l= (*re).l;
- }
- if (rectangle[j].h < (*re).h) {
- rectangle[j].h= (*re).h;
- }
- }
- }
-}
-
-/***********************************************************************/
-
-boolean Overlaps(RSTREE R,
- typrect rect1,
- typrect rect2)
-
-{
- boolean ovlp;
- int maxdim;
- int d;
-
- maxdim= (*R).parameters._.maxdim;
- d= -1;
- do {
- d++;
- ovlp= rect1[d].l <= rect2[d].h &&
- rect1[d].h >= rect2[d].l;
- } while (ovlp && d != maxdim);
- return ovlp;
-}
-
-/***********************************************************************/
-
-void GetOverlap(RSTREE R,
- typrect r1,
- typrect r2,
- double *spc)
-
-{
- double low, high;
- int i;
-
- *spc= 1.0;
- for (i= 0; i <= (*R).parameters._.maxdim; i++) {
- if (r1[i].l < r2[i].l) {
- low= r2[i].l;
- }
- else {
- low= r1[i].l;
- }
- if (r1[i].h < r2[i].h) {
- high= r1[i].h;
- }
- else {
- high= r2[i].h;
- }
- *spc= *spc * (high-low);
- }
-}
-
-/***********************************************************************/
-
-boolean RSTEqual(RSTREE R,
- typrect rect1,
- typrect rect2)
-
-{
- boolean eql;
- int d;
-
- d= -1;
- do {
- d++;
- eql= rect1[d].l == rect2[d].l &&
- rect1[d].h == rect2[d].h;
- } while (eql && d != (*R).parameters._.maxdim);
- return eql;
-}
-
-/***********************************************************************/
-
-boolean Covers(RSTREE R,
- typrect crect,
- typrect rect)
-
-{
- boolean cov;
- int maxdim;
- int d;
-
- maxdim= (*R).parameters._.maxdim;
- d= -1;
- do {
- d++;
- cov= crect[d].l <= rect[d].l &&
- crect[d].h >= rect[d].h;
- } while (cov && d != (*R).parameters._.maxdim);
- return cov;
-}
-
-/***********************************************************************/
-
-void QuickSortValArr(int begin,
- int end,
- ValueArray value,
- IndexArray I)
-/* Sorts I
- by value[I[i]]. */
-
-{
- double midelem;
- int i, j;
-
- i= begin; j= end;
- midelem= value[I[(i+j) / 2]];
- do {
- while (value[I[i]] < midelem) {
- i++;
- }
- while (value[I[j]]>midelem) {
- j--;
- }
- if (i < j) {
- ExChange(&I[i],&I[j]);
- i++; j--;
- }
- else if (i == j) {
- i++; j--;
- }
- } while (i <= j);
- if (begin < j) {
- if (j - begin > 1) {
- QuickSortValArr(begin,j,value,I);
- }
- else {
- if (value[I[begin]] > value[I[j]]) {
- ExChange(&I[begin],&I[j]);
- }
- }
- }
- if (i < end) {
- if (end - i > 1) {
- QuickSortValArr(i,end,value,I);
- }
- else {
- if (value[I[i]] > value[I[end]]) {
- ExChange(&I[i],&I[end]);
- }
- }
- }
-}
-
-/***********************************************************************/
-
-void QuickSortDirEnt(int begin,
- int end,
- int dim,
- Side side,
- typDIRentries Ntosort,
- IndexArray I)
-/* Sorts I
- primarily by Ntosort[I[i]].rect[dim].side,
- secondarily by Ntosort[I[i]].rect[dim]."otherside". */
-
-{
- refinterval re;
- typatomkey midlow, midhigh;
- typinterval int1, int2;
- int i, j;
-
- i= begin; j= end;
- if (side == low) {
-
- re = &Ntosort[I[(i+j) / 2]].rect[dim];
-
- midlow= (*re).l;
- midhigh= (*re).h;
- do {
- while ( Ntosort[I[i]].rect[dim].l < midlow ||
- ( Ntosort[I[i]].rect[dim].l == midlow &&
- Ntosort[I[i]].rect[dim].h < midhigh ) ) {
- i++;
- }
- while ( Ntosort[I[j]].rect[dim].l > midlow ||
- ( Ntosort[I[j]].rect[dim].l == midlow &&
- Ntosort[I[j]].rect[dim].h > midhigh ) ) {
- j--;
- }
- if (i < j) {
- ExChange(&I[i],&I[j]);
- i++; j--;
- }
- else if (i == j) {
- i++; j--;
- }
- } while (i <= j);
- if (begin < j) {
- if (j - begin > 1) {
- QuickSortDirEnt(begin,j,dim,low,Ntosort,I);
- }
- else {
- int1= Ntosort[I[begin]].rect[dim];
- int2= Ntosort[I[j]].rect[dim];
- if ( int1.l > int2.l ||
- ( int1.l == int2.l &&
- int1.h > int2.h ) ) {
- ExChange(&I[begin],&I[j]);
- }
- }
- }
- if (i < end) {
- if (end - i > 1) {
- QuickSortDirEnt(i,end,dim,low,Ntosort,I);
- }
- else {
- int1= Ntosort[I[i]].rect[dim];
- int2= Ntosort[I[end]].rect[dim];
- if ( int1.l > int2.l ||
- ( int1.l == int2.l &&
- int1.h > int2.h ) ) {
- ExChange(&I[i],&I[end]);
- }
- }
- }
- }
- else {
-
- re = &Ntosort[I[(i+j) / 2]].rect[dim];
-
- midhigh= (*re).h;
- midlow= (*re).l;
- do {
- while ( Ntosort[I[i]].rect[dim].h < midhigh ||
- ( Ntosort[I[i]].rect[dim].h == midhigh &&
- Ntosort[I[i]].rect[dim].l < midlow ) ) {
- i++;
- };
- while ( Ntosort[I[j]].rect[dim].h > midhigh ||
- ( Ntosort[I[j]].rect[dim].h == midhigh &&
- Ntosort[I[j]].rect[dim].l > midlow ) ) {
- j--;
- };
- if (i < j) {
- ExChange(&I[i],&I[j]);
- i++; j--;
- }
- else if (i == j) {
- i++; j--;
- }
- } while (i <= j);
- if (begin < j) {
- if (j - begin > 1) {
- QuickSortDirEnt(begin,j,dim,high,Ntosort,I);
- }
- else {
- int1= Ntosort[I[begin]].rect[dim];
- int2= Ntosort[I[j]].rect[dim];
- if ( int1.h > int2.h ||
- ( int1.h == int2.h &&
- int1.l > int2.l ) ) {
- ExChange(&I[begin],&I[j]);
- }
- }
- }
- if (i < end) {
- if (end - i > 1) {
- QuickSortDirEnt(i,end,dim,high,Ntosort,I);
- }
- else {
- int1= Ntosort[I[i]].rect[dim];
- int2= Ntosort[I[end]].rect[dim];
- if ( int1.h > int2.h ||
- ( int1.h == int2.h &&
- int1.l > int2.l ) ) {
- ExChange(&I[i],&I[end]);
- }
- }
- }
- }
-}
-
-/***********************************************************************/
-
-void QuickSortDataEnt(int begin,
- int end,
- int dim,
- Side side,
- typDATAentries Ntosort,
- IndexArray I)
-/* Sorts I
- primarily by Ntosort[I[i]].rect[dim].side,
- secondarily by Ntosort[I[i]].rect[dim]."otherside". */
-
-{
- refinterval re;
- typatomkey midlow, midhigh;
- typinterval int1, int2;
- int i, j;
-
- i= begin; j= end;
- if (side == low) {
-
- re = &Ntosort[I[(i+j) / 2]].rect[dim];
-
- midlow= (*re).l;
- midhigh= (*re).h;
- do {
- while ( Ntosort[I[i]].rect[dim].l < midlow ||
- ( Ntosort[I[i]].rect[dim].l == midlow &&
- Ntosort[I[i]].rect[dim].h < midhigh ) ) {
- i++;
- }
- while ( Ntosort[I[j]].rect[dim].l > midlow ||
- ( Ntosort[I[j]].rect[dim].l == midlow &&
- Ntosort[I[j]].rect[dim].h > midhigh ) ) {
- j--;
- }
- if (i < j) {
- ExChange(&I[i],&I[j]);
- i++; j--;
- }
- else if (i == j) {
- i++; j--;
- }
- } while (i <= j);
- if (begin < j) {
- if (j - begin > 1) {
- QuickSortDataEnt(begin,j,dim,low,Ntosort,I);
- }
- else {
- int1= Ntosort[I[begin]].rect[dim];
- int2= Ntosort[I[j]].rect[dim];
- if ( int1.l > int2.l ||
- ( int1.l == int2.l &&
- int1.h > int2.h ) ) {
- ExChange(&I[begin],&I[j]);
- }
- }
- }
- if (i < end) {
- if (end - i > 1) {
- QuickSortDataEnt(i,end,dim,low,Ntosort,I);
- }
- else {
- int1= Ntosort[I[i]].rect[dim];
- int2= Ntosort[I[end]].rect[dim];
- if ( int1.l > int2.l ||
- ( int1.l == int2.l &&
- int1.h > int2.h ) ) {
- ExChange(&I[i],&I[end]);
- }
- }
- }
- }
- else {
-
- re = &Ntosort[I[(i+j) / 2]].rect[dim];
-
- midhigh= (*re).h;
- midlow= (*re).l;
- do {
- while ( Ntosort[I[i]].rect[dim].h < midhigh ||
- ( Ntosort[I[i]].rect[dim].h == midhigh &&
- Ntosort[I[i]].rect[dim].l < midlow ) ) {
- i++;
- };
- while ( Ntosort[I[j]].rect[dim].h > midhigh ||
- ( Ntosort[I[j]].rect[dim].h == midhigh &&
- Ntosort[I[j]].rect[dim].l > midlow ) ) {
- j--;
- };
- if (i < j) {
- ExChange(&I[i],&I[j]);
- i++; j--;
- }
- else if (i == j) {
- i++; j--;
- }
- } while (i <= j);
- if (begin < j) {
- if (j - begin > 1) {
- QuickSortDataEnt(begin,j,dim,high,Ntosort,I);
- }
- else {
- int1= Ntosort[I[begin]].rect[dim];
- int2= Ntosort[I[j]].rect[dim];
- if ( int1.h > int2.h ||
- ( int1.h == int2.h &&
- int1.l > int2.l ) ) {
- ExChange(&I[begin],&I[j]);
- }
- }
- }
- if (i < end) {
- if (end - i > 1) {
- QuickSortDataEnt(i,end,dim,high,Ntosort,I);
- }
- else {
- int1= Ntosort[I[i]].rect[dim];
- int2= Ntosort[I[end]].rect[dim];
- if ( int1.h > int2.h ||
- ( int1.h == int2.h &&
- int1.l > int2.l ) ) {
- ExChange(&I[i],&I[end]);
- }
- }
- }
- }
-}
-
-/***********************************************************************/
-
-static void ExChange(int *x, int *y)
-
-{
- int z;
-
- z= *x; *x= *y; *y= z;
-}
-
-/***********************************************************************/
-
-void ChooseSubtree(RSTREE R,
- typrect newrect,
- int depth,
- typDIRnode *node,
- int *found)
-
-{
- int maxexam, inv;
- typatomkey low, high;
- double space, newspace,
- enlarge,
- validspace, ovlpspc, overlap, leastovlp;
- boolean didfit, first, ok;
- ValueArray enlarr;
- IndexArray I;
- typrect enlargedrect;
- int maxdim;
- refparameters par;
- refinterval re;
- refDIRent e;
- int i, j, k;
-
- didfit= FALSE; ok= TRUE;
- maxdim= (*R).parameters._.maxdim;
- for (i= 0; i < (*node).nofentries; i++) {
- space= 1.0; newspace= 1.0;
- for (j= 0; j <= maxdim; j++) {
-
- re= &(*node).entries[i].rect[j];
-
- low= (*re).l;
- high= (*re).h;
- space= space * (high - low);
-
- re= &newrect[j];
-
- if (low > (*re).l) {
- low= (*re).l;
- }
- if (high < (*re).h) {
- high= (*re).h;
- }
- newspace= newspace * (high - low);
- }
- if (space == 0.0) {
- CSWorkAround(R,newrect,node,i,space,newspace);
- ok= FALSE;
- } /* trap degenerated rectangles */
- if (didfit) {
- if (newspace == space) { /* it fits */
- if (space < validspace) {
- validspace= space;
- *found= i;
- }
- }
- }
- else {
- enlarge= newspace - space;
- if (enlarge == 0.0) {
- validspace= space;
- *found= i;
- didfit= TRUE;
- }
- else {
- enlarr[i]= enlarge;
- }
- }
- }
- if (! didfit) {
- for (i= 0; i < (*node).nofentries; i++) {
- I[i]= i;
- }
- QuickSortValArr(0,(*node).nofentries - 1,enlarr,I);
- if (ok && depth == (*R).parameters._.height - 1) { /* Subtrees are leafs */
-
- par = &(*R).parameters._;
-
- if ((*node).nofentries < (*par).nbrsexam) {
- maxexam= (*node).nofentries;
- }
- else {
- maxexam= (*par).nbrsexam;
- }
-
-/* maxexam= (*node).nofentries; *//* <- all *) */
-
- first= TRUE;
- for (i= 0; i < maxexam; i++) {
- for (j= 0; j <= maxdim; j++) {
-
- re= &(*node).entries[I[i]].rect[j];
-
- low= (*re).l;
- high= (*re).h;
-
- re= &enlargedrect[j];
-
- (*re).l= low;
- (*re).h= high;
- if (low > newrect[j].l) {
- (*re).l= newrect[j].l;
- }
- if (high < newrect[j].h) {
- (*re).h= newrect[j].h;
- }
- } /* Create enlargedrect */
- overlap= 0.0;
- for (k= 0; k < (*node).nofentries; k++) {
- if (k != i) {
-
- e= &(*node).entries[I[k]];
-
- if (Overlaps(R,enlargedrect,(*e).rect)) {
- GetOverlap(R,enlargedrect,(*e).rect,&ovlpspc);
- overlap= overlap+ovlpspc;
- if (Overlaps(R,(*node).entries[I[i]].rect,(*e).rect)) {
- GetOverlap(R,(*node).entries[I[i]].rect,(*e).rect,&ovlpspc);
- overlap= overlap-ovlpspc;
- }
- }
- }
- }
- if (first) {
- leastovlp= overlap;
- *found= I[0];
- inv= 1;
- first= FALSE;
- }
- else {
- if (overlap < leastovlp) {
- leastovlp= overlap;
- *found= I[i];
- inv= i;
- }
- }
- }
- }
- else { /* Subtrees are not leafs */
- *found= I[0];
- }
- }
-}
-
-/***********************************************************************/
-
-static void CSWorkAround(RSTREE R,
- typrect newrect,
- typDIRnode *node,
- int index,
- double space,
- double newspace)
-
-{
-#define epsilon (1.0e-100)
-
- typatomkey low, high;
- double distance;
- refinterval re;
- int j;
-
- space= 1.0; newspace= 1.0;
- for (j= 0; j <= (*R).parameters._.maxdim; j++) {
-
- re= &(*node).entries[index].rect[j];
-
- low= (*re).l;
- high= (*re).h;
- distance= high - low;
- if (distance == 0.0) {
- distance= epsilon;
- }
- space= space * distance;
-
- re= &newrect[j];
-
- if (low > (*re).l) {
- low= (*re).l;
- }
- if (high < (*re).h) {
- high= (*re).h;
- }
- distance= high - low;
- if (distance == 0.0) {
- distance= epsilon;
- }
- newspace= newspace * distance;
- }
-
-#undef epsilon
-}
-
-/***********************************************************************/
-
-void AdjustChain(RSTREE R,
- int depth,
- typrect newrect)
-
-{
- refinterval re;
- refcount c;
- int maxdim;
- boolean adjusting;
- int j;
-
- c= &(*R).count;
- maxdim= (*R).parameters._.maxdim;
-
- adjusting= TRUE;
-
- if (depth == (*R).parameters._.height) {
- adjusting= FALSE;
- for (j= 0; j <= maxdim; j++) {
-
- re = &(*(*R).N[depth]).DATA.entries[(*R).E[depth]].rect[j];
-
- if ((*re).l > newrect[j].l) {
- (*re).l= newrect[j].l;
- adjusting= TRUE;
- }
- if ((*re).h < newrect[j].h) {
- (*re).h= newrect[j].h;
- adjusting= TRUE;
- }
- }
- if (adjusting) {
- (*R).Nmodified[depth]= TRUE;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
- }
- depth--;
- }
- while (depth != 0 && adjusting) {
- adjusting= FALSE;
- for (j= 0; j <= maxdim; j++) {
-
- re = &(*(*R).N[depth]).DIR.entries[(*R).E[depth]].rect[j];
-
- if ((*re).l > newrect[j].l) {
- (*re).l= newrect[j].l;
- adjusting= TRUE;
- }
- if ((*re).h < newrect[j].h) {
- (*re).h= newrect[j].h;
- adjusting= TRUE;
- }
- }
- if (adjusting) {
- (*R).Nmodified[depth]= TRUE;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
- }
- depth--;
- }
-}
-
-/***********************************************************************/
-
-void AdjustChainAfterDeletion(RSTREE R,
- int depth)
-
-{
- refDIRent e;
- refcount c;
- boolean changed;
- typrect helprect;
-
- c= &(*R).count;
-
- changed= TRUE;
-
- if (depth == (*R).parameters._.height && depth != 1) {
- EvalDataEnclRect(R,&(*(*R).N[depth]).DATA,helprect);
- depth--;
-
- e = &(*(*R).N[depth]).DIR.entries[(*R).E[depth]];
-
- changed= ! RSTEqual(R,helprect,(*e).rect);
- if (changed) {
- CopyRect(R,helprect,(*e).rect);
- (*R).Nmodified[depth]= TRUE;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
- }
- }
- while (depth != 1 && changed) {
- EvalDirEnclRect(R,&(*(*R).N[depth]).DIR,helprect);
- depth--;
-
- e = &(*(*R).N[depth]).DIR.entries[(*R).E[depth]];
-
- changed= ! RSTEqual(R,helprect,(*e).rect);
- if (changed) {
- CopyRect(R,helprect,(*e).rect);
- (*R).Nmodified[depth]= TRUE;
- if ((*c).countflag) {
- (*c).dirmodifycount++;
- }
- }
- }
-}
-
-/***********************************************************************/
diff --git a/modules/RStarTree/RSTUtil.h b/modules/RStarTree/RSTUtil.h
deleted file mode 100644
index 6e00213..0000000
--- a/modules/RStarTree/RSTUtil.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ----- RSTUtil.h ----- */
-#ifndef __RSTUtil_h
-#define __RSTUtil_h
-
-
-#include "RStarTree.h"
-
-
-/* declarations */
-
-void FalseArray(int *ptr,
- int wordsqty);
-
-void CopyRect(RSTREE,
- typrect from,
- typrect to);
-
-void EvalCenter(RSTREE R,
- typrect rectangle,
- typpoint center);
-
-double RSTDistance(RSTREE R,
- typpoint point1,
- typpoint point2);
-
-void EvalDirEnclRect(RSTREE R,
- refDIRnode node,
- typrect rect);
-
-void EvalDataEnclRect(RSTREE R,
- refDATAnode node,
- typrect rect);
-
-boolean Overlaps(RSTREE R,
- typrect rect1,
- typrect rect2);
-
-boolean RSTEqual(RSTREE R,
- typrect rect1,
- typrect rect2);
-
-boolean Covers(RSTREE R,
- typrect crect,
- typrect rect);
-
-void GetOverlap(RSTREE R,
- typrect r1,
- typrect r2,
- double *spc);
-
-void QuickSortValArr(int begin,
- int end,
- ValueArray value,
- IndexArray I);
-
-void QuickSortDirEnt(int begin,
- int end,
- int dim,
- Side side,
- typDIRentries Ntosort,
- IndexArray I);
-
-void QuickSortDataEnt(int begin,
- int end,
- int dim,
- Side side,
- typDATAentries Ntosort,
- IndexArray I);
-
-void ChooseSubtree(RSTREE R,
- typrect newrect,
- int depth,
- refDIRnode node,
- int *found);
-
-void AdjustChain(RSTREE R,
- int depth,
- typrect newrect);
-
-void AdjustChainAfterDeletion(RSTREE R,
- int depth);
-
-
-#endif /* !__RSTUtil_h */
diff --git a/modules/RStarTree/RStarTree.c b/modules/RStarTree/RStarTree.c
deleted file mode 100644
index 3eb2e3a..0000000
--- a/modules/RStarTree/RStarTree.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/* ----- RStarTree.c ----- */
-
-#include <stdlib.h>
-
-#include "RStarTree.h"
-#include "RSTInterUtil.h"
-#include "RSTInOut.h"
-#include "RSTInstDel.h"
-#include "RSTQuery.h"
-#include "RSTJoin.h"
-
-
-/* constants */
-
-
-/* types */
-
-
-/* declarations */
-
-static void BasicCheck(void);
-/*** --- Begin --- unused ***
-static boolean InternEqual(RSTREE rst,
- typrect RSTrect,
- typrect qrect1,
- typrect qrect2);
-static boolean InternEncloses(RSTREE rst,
- typrect RSTrect,
- typrect qrect1,
- typrect qrect2);
- *** --- End --- unused ***/
-
-/************************************************************************/
-
-void NoRSTree(RSTREE *r)
-
-{
- *r= NULL;
-}
-
-/************************************************************************/
-
-boolean CreateRST(const
-char *name,
- int pagelen,
- boolean unique)
-
-{
- RSTREE R;
- refparameters par;
-
- BasicCheck();
-
- R= (RSTREE)malloc(sizeof(rstree));
- (*R).readonly = FALSE;
- strcpy((*R).dirname,name);
- (*R).RSTDone= TRUE;
- CreateRSFiles(R);
- if (! (*R).RSTDone) {
- free(R); R= NULL;
- return FALSE;
- }
- SetBase(R,pagelen,unique);
- if (! (*R).RSTDone) {
- free(R); R= NULL;
- return FALSE;
- }
- (*R).dirPD.bl= SIZEfixblock;
-
- par= &(*R).parameters._;
-
- WritePage(R,(*R).dirPD,paramblocknumb,par);
- WritePage(R,(*R).dirPD,firstPDblocknumb,&(*R).dirpagedir);
- (*R).dataPD.bl= SIZEfixblock;
- WritePage(R,(*R).dataPD,paramblocknumb,par); /* -- unused -- */
- WritePage(R,(*R).dataPD,firstPDblocknumb,&(*R).datapagedir);
- (*R).data.bl= (*par).pagelen;
- (*R).N[1]= (refnode)malloc((*R).datanodelen);
- (*(*R).N[1]).DATA.nofentries= 0;
- PutNode(R,(*R).N[1],rootblocknumb,1);
- free((*R).N[1]);
- if (! (*R).RSTDone) {
- free(R); R= NULL;
- return FALSE;
- }
- CloseRSFiles(R);
- if (! (*R).RSTDone) {
- free(R); R= NULL;
- return FALSE;
- }
- free(R); R= NULL;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean RemoveRST(const char *name)
-
-{
- RSTName SufName;
- boolean success= TRUE;
-
- if (unlink(name) != 0) {
- success= FALSE;
- }
- strcpy(SufName,name);
- strcat(SufName,datasuffix);
- if (unlink(SufName) != 0) {
- success= FALSE;
- }
- strcpy(SufName,name);
- strcat(SufName,dirPDsuffix);
- if (unlink(SufName) != 0) {
- success= FALSE;
- }
- strcpy(SufName,name);
- strcat(SufName,dataPDsuffix);
- if (unlink(SufName) != 0) {
- success= FALSE;
- }
- return success;
-}
-
-/************************************************************************/
-
-boolean OpenRST(RSTREE *r,
- const char *name,
- const char *mode)
-
-{
- RSTREE R;
- refparameters par;
-
- if (*r != NULL) {
- return FALSE;
- }
- *r= (RSTREE)malloc(sizeof(rstree));
- R= *r;
- strcpy((*R).dirname,name);
- (*R).RSTDone= TRUE;
- (*R).readonly = strcmp (mode, "rw");
- OpenRSFiles(R, (*R).readonly ? O_RDONLY : O_RDWR);
- if (! (*R).RSTDone) {
- free(R); *r= NULL;
- return FALSE;
- }
- InitChainFlags(R);
- (*R).dirPD.bl= SIZEfixblock;
-
- par= &(*R).parameters._;
-
- ReadPage(R,(*R).dirPD,paramblocknumb,par);
- ReadPage(R,(*R).dirPD,firstPDblocknumb,&(*R).dirpagedir);
- (*R).dataPD.bl= SIZEfixblock;
- ReadPage(R,(*R).dataPD,firstPDblocknumb,&(*R).datapagedir);
- if (! (*R).RSTDone) {
- FastCloseRSFiles(R);
- free(R); *r= NULL;
- return FALSE;
- }
- SetCheckDir(R,FALSE);
- SetCheckData(R,FALSE);
- AllocBuffers(R);
- (*R).dir.bl= (*par).pagelen;
- (*R).data.bl= (*par).pagelen;
- GetNode(R,(*R).N[1],rootblocknumb,1); (*R).P[1]= rootblocknumb;
- InitCount(R);
- if (! (*R).RSTDone) {
- FastCloseRSFiles(R);
- DeallocBuffers(R);
- free(R); *r= NULL;
- return FALSE;
- }
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean CloseRST(RSTREE *r)
-
-{
- RSTREE R;
- refparameters par;
- boolean success;
- int i;
-
- if (*r == NULL) {
- return FALSE;
- }
- R= *r;
- (*R).RSTDone= TRUE;
-
- if (!(*R).readonly) {
- par= &(*R).parameters._;
- WritePage(R,(*R).dirPD,paramblocknumb,par);
- WritePage(R,(*R).dirPD,firstPDblocknumb,&(*R).dirpagedir);
- WritePage(R,(*R).dataPD,paramblocknumb,par); /* -- unused -- */
- WritePage(R,(*R).dataPD,firstPDblocknumb,&(*R).datapagedir);
- for (i= 1; i <= (*par).height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- }
- }
- }
- if (! (*R).RSTDone) {
- return (*R).RSTDone;
- }
- CloseRSFiles(R);
- if (! (*R).RSTDone) {
- return (*R).RSTDone;
- }
- DeallocBuffers(R);
- success= (*R).RSTDone;
- free(R); *r= NULL;
- return success;
-}
-
-/************************************************************************/
-
-boolean SetUnique(RSTREE R,
- boolean mode)
-
-{
- if (R == NULL) {
- return FALSE;
- }
- (*R).parameters._.unique= mode;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean InsertRecord(RSTREE R,
- typrect rectangle,
- typinfo *info,
- boolean *inserted)
-
-{
- refparameters par;
- typentry entry;
- refinfo infoadr;
- int d;
-
- if (R == NULL) {
- *inserted= FALSE;
- return FALSE;
- }
-
- (*R).RSTDone= TRUE;
-
- par= &(*R).parameters._;
-
- if ((*par).unique) {
- *inserted= ! FoundRect(R,1,rectangle,TRUE,&infoadr);
- }
- else {
- *inserted= TRUE;
- }
- if (*inserted) {
- for (d= 0; d <= (*par).maxdim; d++) {
- entry.DATA.rect[d]= rectangle[d];
- }
- entry.DATA.info= *info;
- (*R).ReInsert[(*par).height]= TRUE; /* general switch for Forced ReInsert */
- Insert(R,&entry,(*par).height);
- (*R).ReInsert[(*par).height]= FALSE;
- *inserted= (*R).RSTDone;
- if (*inserted) {
- (*par).recordcount++;
- }
- }
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean DeleteRecord(RSTREE R,
- typrect rectangle,
- boolean *deleted)
-
-{
- refinfo infoadr;
-
- if (R == NULL) {
- *deleted= FALSE;
- return FALSE;
- }
-
- (*R).RSTDone= TRUE;
-
- *deleted= FoundRect(R,1,rectangle,FALSE,&infoadr);
- if (*deleted) {
- DeleteOneRec(R);
- *deleted= (*R).RSTDone;
- if (*deleted) {
- (*R).parameters._.recordcount--;
- }
- }
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean ExistsRegion(RSTREE R,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- boolean *regionfound)
-
-{
- if (R == NULL) {
- *regionfound= FALSE;
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- (*R).RSTDone= TRUE;
- *regionfound= FALSE;
- XstsRgn(R,1,rectangle1,rectangle2,DirQuery,DataQuery,regionfound);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean RegionCount(RSTREE R,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- int *recordcount)
-
-{
- if (R == NULL) {
- *recordcount= 0;
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- (*R).RSTDone= TRUE;
- *recordcount= 0;
- RgnCnt(R,1,rectangle1,rectangle2,DirQuery,DataQuery,recordcount);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean RegionQuery(RSTREE R,
- typrect rectangle1,
- typrect rectangle2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- QueryManageProc ManageProc,
- void *buf)
-
-{
- boolean finish;
-
- if (R == NULL) {
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- (*R).RSTDone= TRUE;
- finish= FALSE;
- RgnQuery(R,1,rectangle1,rectangle2,DirQuery,DataQuery,
- ManageProc,buf,&finish);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean RegionQueryInfo(RSTREE R,
- Check includes,
- Check intersects,
- void * data,
- typrect rect,
- typdirinfo * info)
-
-{
- if (R == NULL) {
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- (*R).RSTDone= TRUE;
- RgnQueryInfo(R,1,includes,intersects,data,rect,info);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean AllQuery(RSTREE R,
- QueryManageProc ManageProc,
- void *buf)
-
-{
- boolean finish;
-
- if (R == NULL) {
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- (*R).RSTDone= TRUE;
- finish= FALSE;
- All(R,1,ManageProc,buf,&finish);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean Update(RSTREE R)
-
-{
- typdirinfo info;
-
- if (R == NULL) {
- return FALSE;
- }
- /*
- int i;
- for (i= 2; i <= (*R).parameters._.height; i++) {
- if ((*R).Nmodified[i]) {
- PutNode(R,(*R).N[i],(*R).P[i],i);
- (*R).Nmodified[i]= FALSE;
- }
- (*R).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- typrect rect;
- rect[0].l = -0.5; rect[0].h = 0.5;
- rect[1].l = -0.5; rect[1].h = 0.5;
- (*R).RSTDone= TRUE;
- UpdateAll(R,1,rect,&info);
- return (*R).RSTDone;
-}
-
-/************************************************************************/
-
-boolean JoinCountNv(RSTREE R1, RSTREE R2,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *paircount)
-
-{
- int mark;
- boolean twiceopen, success;
- int i;
-
- if (R1 == NULL || R2 == NULL) {
- *paircount= 0;
- return FALSE;
- }
- twiceopen= R1 == R2;
- if (twiceopen) {
- for (i= 1; i <= (*R1).parameters._.height; i++) {
- if ((*R1).Nmodified[i]) {
- PutNode(R1,(*R1).N[i],(*R1).P[i],i);
- (*R1).Nmodified[i]= FALSE;
- }
- } /* syncronize R1 */
- R2= NULL;
- success= OpenRST(&R2,(*R1).dirname,"rw"); /* NEW(R2) */
- if (! success) {
- fprintf(stderr,"%s\n","FATAL INTERNAL ERROR");
- fprintf(stderr,"%s\n","JoinCountNv 1");
- abort();
- }
- }
- /*
- for (i= 2; i <= (*R1).parameters._.height; i++) {
- if ((*R1).Nmodified[i]) {
- PutNode(R1,(*R1).N[i],(*R1).P[i],i);
- (*R1).Nmodified[i]= FALSE;
- }
- (*R1).P[i]= 0;
- }
- for (i= 2; i <= (*R2).parameters._.height; i++) {
- if ((*R2).Nmodified[i]) {
- PutNode(R2,(*R2).N[i],(*R2).P[i],i);
- (*R2).Nmodified[i]= FALSE;
- }
- (*R2).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- if (! ((*R1).RSTDone && (*R2).RSTDone) ) {
- *paircount= 0;
- return FALSE;
- }
- *paircount= 0;
- mark= 0;
- JnCntNv(R1,R2,
- 1,
- R1rectangle1,R1rectangle2,R2rectangle1,R2rectangle2,
- Dir1Query,Data1Query,Dir2Query,Data2Query,DirJoin,DataJoin,
- paircount,
- &mark);
- success= (*R1).RSTDone && (*R2).RSTDone;
- if (twiceopen) {
- success= success && CloseRST(&R2);
- }
- return success;
-}
-
-/************************************************************************/
-
-boolean JoinNv(RSTREE R1, RSTREE R2,
- typrect R1rectangle1,
- typrect R1rectangle2,
- typrect R2rectangle1,
- typrect R2rectangle2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *buf1,
- void *buf2)
-
-{
- boolean twiceopen, success;
- boolean finish;
- int i;
-
- if (R1 == NULL || R2 == NULL) {
- return FALSE;
- }
- twiceopen= R1 == R2;
- if (twiceopen) {
- for (i= 1; i <= (*R1).parameters._.height; i++) {
- if ((*R1).Nmodified[i]) {
- PutNode(R1,(*R1).N[i],(*R1).P[i],i);
- (*R1).Nmodified[i]= FALSE;
- }
- } /* syncronize R1 */
- R2= NULL;
- success= OpenRST(&R2,(*R1).dirname,"rw"); /* NEW(R2) */
- if (! success) {
- fprintf(stderr,"%s\n","FATAL INTERNAL ERROR");
- fprintf(stderr,"%s\n","JoinCountNv 1");
- abort();
- }
- }
- /*
- for (i= 2; i <= (*R1).parameters._.height; i++) {
- if ((*R1).Nmodified[i]) {
- PutNode(R1,(*R1).N[i],(*R1).P[i],i);
- (*R1).Nmodified[i]= FALSE;
- }
- (*R1).P[i]= 0;
- }
- for (i= 2; i <= (*R2).parameters._.height; i++) {
- if ((*R2).Nmodified[i]) {
- PutNode(R2,(*R2).N[i],(*R2).P[i],i);
- (*R2).Nmodified[i]= FALSE;
- }
- (*R2).P[i]= 0;
- }
- *//* to be inserted, if main memory path shall be initialized
- for test purpose */
-
- if (! ((*R1).RSTDone && (*R2).RSTDone) ) {
- return FALSE;
- }
- finish= FALSE;
- JnNv(R1,R2,
- 1,
- R1rectangle1,R1rectangle2,R2rectangle1,R2rectangle2,
- Dir1Query,Data1Query,Dir2Query,Data2Query,DirJoin,DataJoin,
- Manage,buf1,buf2,&finish);
- success= (*R1).RSTDone && (*R2).RSTDone;
- if (twiceopen) {
- success= success && CloseRST(&R2);
- }
- return success;
-}
-
-/************************************************************************/
-
-boolean InquireRSTDesc(RSTREE R,
- char *name,
- int *numbofdim,
- int *pagesize,
- int *sizedirentry,
- int *sizedataentry,
- int *sizeinfo,
- int *maxdirfanout,
- int *maxdatafanout,
- int *numbofdirpages,
- int *numbofdatapages,
- int pagesperlevel[],
- int *numbofrecords,
- int *height,
- boolean *unique)
-
-{
- refparameters par;
- int i;
-
- if (R == NULL) {
- return FALSE;
- }
-
- strcpy(name,(*R).dirname);
-
- par= &(*R).parameters._;
-
- *numbofdim= (*par).maxdim+1;
- *pagesize= (*par).pagelen;
- *sizedirentry= (*par).direntrylen;
- *sizedataentry= (*par).dataentrylen;
- *sizeinfo= (*par).SIZEinfo;
- *maxdirfanout= (*par).dirM;
- *maxdatafanout= (*par).dataM;
- *numbofdirpages= (*par).dirpagecount;
- *numbofdatapages= (*par).datapagecount;
- pagesperlevel[0]= 1;
- for (i= 1; i < (*par).height; i++) {
- pagesperlevel[i]= (*par).pagecountarr[i+1];
- }
- *numbofrecords= (*par).recordcount;
- *height= (*par).height;
- *unique= (*par).unique;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean CountsOn0(RSTREE R)
-
-{
- refcount c;
-
- if (R == NULL) {
- return FALSE;
- }
- c= &(*R).count;
- (*c).countflag= TRUE;
- (*c).dirvisitcount= 0; (*c).datavisitcount= 0;
- (*c).dirreadcount= 0; (*c).datareadcount= 0;
- (*c).dirmodifycount= 0; (*c).datamodifycount= 0;
- (*c).dirwritecount= 0; (*c).datawritecount= 0;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean CountsOn(RSTREE R)
-
-{
- if (R == NULL) {
- return FALSE;
- }
- (*R).count.countflag= TRUE;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean CountsOff(RSTREE R)
-
-{
- if (R == NULL) {
- return FALSE;
- }
- (*R).count.countflag= FALSE;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean GetCountRead(RSTREE R,
- int *dirvis, int *datavis,
- int *dirread, int *dataread)
-
-{
- refcount c;
-
- if (R == NULL) {
- *dirvis= 0;
- *datavis= 0;
- *dirread= 0;
- *dataread= 0;
- return FALSE;
- }
- c= &(*R).count;
- *dirvis= (*c).dirvisitcount;
- *datavis= (*c).datavisitcount;
- *dirread= (*c).dirreadcount;
- *dataread= (*c).datareadcount;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean GetCountWrite(RSTREE R,
- int *dirmod, int *datamod,
- int *dirwrite, int *datawrite)
-
-{
- refcount c;
-
- if (R == NULL) {
- *dirmod= 0;
- *datamod= 0;
- *dirwrite= 0;
- *datawrite= 0;
- return FALSE;
- }
- c= &(*R).count;
- *dirmod= (*c).dirmodifycount;
- *datamod= (*c).datamodifycount;
- *dirwrite= (*c).dirwritecount;
- *datawrite= (*c).datawritecount;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean GetMemory(RSTREE R,
- int *dirpages, int *datapages)
-
-{
- refparameters par;
-
- if (R == NULL) {
- *dirpages= 0;
- *datapages= 0;
- return FALSE;
- }
- par= &(*R).parameters._;
- *dirpages= (*par).dirpagecount;
- *datapages= (*par).datapagecount;
- return TRUE;
-}
-
-/************************************************************************/
-
-boolean GetHeight(RSTREE R,
- int *height)
-
-{
- if (R == NULL) {
- *height= 0;
- return FALSE;
- }
- *height= (*R).parameters._.height;
- return TRUE;
-}
-
-/************************************************************************/
-
-static void BasicCheck()
-{
- if (sizeof(byte) != 1) {
- fprintf(stderr,"%s\n","FATAL ERROR:");
- fprintf(stderr,"%s\n","BasicCheck 1");
- fprintf(stderr,"%s\n","sizeof(byte) != 1");
- fprintf(stderr,"%s %ld\n","sizeof(byte):",sizeof(byte));
- abort();
- /* concerning application of type ByteArray */
- }
- if (sizeof(int) < 4) {
- fprintf(stderr,"%s\n","BasicCheck 2");
- fprintf(stderr,"%s\n","sizeof(int) < 4");
- fprintf(stderr,"%s %ld\n","sizeof(int):",sizeof(int));
- fprintf(stderr,"%s\n","WARNING: bigger int range assumed.");
- }
- if (sizeof(typinfo) < sizeof(int)) {
- fprintf(stderr,"%s\n","FATAL ERROR:");
- fprintf(stderr,"%s\n","BasicCheck 3");
- fprintf(stderr,"%s\n","sizeof(typinfo) < sizeof(int)");
- fprintf(stderr,"%s %ld\n","sizeof(typinfo):",sizeof(typinfo));
- fprintf(stderr,"%s %ld\n"," sizeof(int):",sizeof(int));
- abort();
- }
- if (sizeof(typpagedir) > sizeof(typfixblock)) {
- fprintf(stderr,"%s\n","FATAL ERROR:");
- fprintf(stderr,"%s\n","BasicCheck 4");
- fprintf(stderr,"%s\n","sizeof(typpagedir) > sizeof(typfixblock)");
- fprintf(stderr,"%s %ld\n"," sizeof(typpagedir):",sizeof(typpagedir));
- fprintf(stderr,"%s %ld\n","sizeof(typfixblock):",sizeof(typfixblock));
- abort();
- }
- if (sizeof(typparameters) > sizeof(typfixblock)) {
- fprintf(stderr,"%s\n","FATAL ERROR:");
- fprintf(stderr,"%s\n","BasicCheck 5");
- fprintf(stderr,"%s\n","sizeof(typparameters) > sizeof(typfixblock)");
- fprintf(stderr,"%s %ld\n","sizeof(typparameters):",sizeof(typparameters));
- fprintf(stderr,"%s %ld\n"," sizeof(typfixblock):",sizeof(typfixblock));
- abort();
- }
-}
-
-/************************************************************************/
-/*** --- Begin --- unused ***
-
-static boolean InternEqual(RSTREE R,
- typrect RSTrect,
- typrect queryrect,
- typrect unused)
-
-{
- boolean eql;
- int d;
-
- d= -1;
- do {
- d++;
- eql= RSTrect[d].l == queryrect[d].l &&
- RSTrect[d].h == queryrect[d].h;
- } while (eql && d != (*R).parameters._.maxdim);
- return eql;
-}
-
-static boolean InternEncloses(RSTREE R,
- typrect RSTrect,
- typrect queryrect,
- typrect unused)
-
-{
- int maxdim;
- boolean encl;
- int d;
-
- maxdim= (*R).parameters._.maxdim;
- d= -1;
- do {
- d++;
- encl= RSTrect[d].l <= queryrect[d].l &&
- RSTrect[d].h >= queryrect[d].h;
- } while (encl && d != maxdim);
- return encl;
-}
-
- *** --- End --- unused ***/
-/***********************************************************************/
-
-boolean Find(RSTREE R,
- typrect rectangle,
- boolean *found,
- void *buf,
- int nbytes)
-
-{
- refinfo infoadr;
-
- if (R == NULL) {
- *found= FALSE;
- return FALSE;
- }
-
- *found= FoundRect(R,1,rectangle,FALSE,&infoadr);
- if (*found) {
- memcpy(buf,infoadr,nbytes);
- }
- return (*R).RSTDone;
-}
-
-/************************************************************************/
diff --git a/modules/RStarTree/RStarTree.h b/modules/RStarTree/RStarTree.h
deleted file mode 100644
index 21bef4d..0000000
--- a/modules/RStarTree/RStarTree.h
+++ /dev/null
@@ -1,780 +0,0 @@
-/* ----- RStarTree.h ----- */
-#ifndef __RStarTree_h
-#define __RStarTree_h
-
-
-
-/** R*-tree
- ======= **/
-
-
-/** Implementation: Norbert Beckmann
- Version: R.2.0
- Date: 6/93 **/
-
-
-/** Praktische Informatik,
- Universitaet Bremen, D-2800 Bremen 33, Germany **/
-
-
-
-/* ---------------------- operating system version --------------------- */
-/*
-#ifndef SVR4
-# define SVR4
-#endif
-*/
-#include <stddef.h>
-#include <sys/file.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/stat.h>
-
-#include <fcntl.h>
-
-
-/* padding on 32 bits systems (to match automatic 64 bits padding) */
-
-#if defined (__LP64__) || defined (__64BIT__) || defined (_LP64) || (__WORDSIZE == 64)
- #define PADDING_32_BITS
-#else
- #define PADDING_32_BITS int padding
-#endif
-
-/* ----------------------------- constants ----------------------------- */
-
-#define byte unsigned char
-#define boolean int
-#define FALSE 0
-#define TRUE 1
-
-#define int int /**V**/ /* large data sets require a 32 bit int */
-
-#define MaxNameLength 160 /* including less than 10 bytes for a suffix */
-
-#define MaxNumbOfEntriesPerPage 512 /**V**/
-
-#define NumbOfDim 2 /**V**/
-
-
-/* ------------------------------- types ------------------------------- */
-
-typedef int File;
-
-
-typedef float typatomkey; /**V**/
-
- /* typatomkey may be of any type as far as the standard comparisons
- apply */
-
-
-typedef struct {
- typatomkey l, h;
- } typinterval;
-
-
-typedef typinterval typrect[NumbOfDim];
-
- /* A typrect is the key type an R*-tree handles. The smallest
- entity which may be used as a key is an interval,
- i.e. a typrect[1]. */
-
-
-typedef struct {
- float height;
- } typinfo, *refinfo;
-
- /* A typinfo is a struct which may contain arbitrary information
- associated with a data record.
- RESTRICTION: sizeof(typinfo) >= sizeof(int) must hold! */
-
-typedef struct {
- double m01, m02, m03;
- double m11, m13;
- double m22, m23, m33;
- double m44, m55, m66, m77;
- double m67, m76;
- double H0, H1, H2, H3, H4;
- double H5, H6;
- float Hmin, Hmax;
- int n;
- PADDING_32_BITS;
-} typdirinfo;
-
-/* A typdirinfo is a struct which may contain arbitrary information
- associated with a directory record. */
-
-typedef int (* Check) (typrect rect, void * data, int depth);
-
-/* ------------------------- private includes -------------------------- */
-
-#include "RSTBase.h"
-
-
-/* ----------------------------- R*-tree ------------------------------- */
-
-typedef rstree *RSTREE; /* R*-tree identifier */
-
-
-/* ------------------------- procedure types --------------------------- */
-
-typedef boolean (*DirQueryProc) (RSTREE /* rst */,
- typrect /* dirrect */,
- typrect /* queryrect1 */,
- typrect /* queryrect2 */);
-
- /* rst:
- contains the R*-tree identifier as passed to the procedures
- RegionQuery, ExistsRegion and RegionCount respectively.
-
- dirrect:
- contains a multidimensional directory rectangle.
-
- queryrect1, queryrect2:
- contain queryrect1 and queryrect2 as passed to the procedures
- RegionQuery, ExistsRegion and RegionCount respectively.
-
- This type is also used in the JoinXX procedures to perform the
- join. Then the parameters will have a slightly different
- contents, see the JoinXX procedures. */
-
-
-typedef boolean (*DataQueryProc) (RSTREE /* rst */,
- typrect /* datarect */,
- typrect /* queryrect1 */,
- typrect /* queryrect2 */);
-
- /* rst:
- contains the R*-tree identifier as passed to the procedures
- RegionQuery, ExistsRegion and RegionCount respectively.
-
- datarect:
- contains a multidimensional data rectangle.
-
- queryrect1, queryrect2:
- contain queryrect1 and queryrect2 as passed to the procedures
- RegionQuery, ExistsRegion and RegionCount respectively.
-
- This type is also used in the JoinXX procedures to perform the
- join. Then the parameters will have a slightly different
- contents, see the JoinXX procedures. */
-
-
-typedef void (*QueryManageProc) (RSTREE /* rst */,
- typrect /* rectangle */,
- refinfo /* info */,
- void* /* pointer */,
- boolean* /* modify */,
- boolean* /* finish */);
-
- /* rst:
- contains the R*-tree identifier as passed to the procedure
- RegionQuery.
-
- rectangle:
- contains the multidimensional data rectangle currently found.
-
- info:
- points to the concerning information part.
-
- pointer:
- is an arbitrary pointer as passed to the procedure RegionQuery.
- It may be used as a pointer to a buffer structure.
-
- modify:
- points to a flag labeling the node to be written back.
- BEWARE:
- record modified | modify | result
- --------------------------------------------------------
- no | FALSE | record is not modified
- no | TRUE | undefined
- yes | FALSE | undefined
- yes | TRUE | record is modified
- (See also RegionQuery)
-
- finish:
- points to a flag labeling the query to be finished when the
- procedure is left. */
-
-
-typedef void (*JoinManageProc) (RSTREE /* rst1 */,
- RSTREE /* rst2 */,
- typrect /* rectangle1 */,
- typrect /* rectangle2 */,
- refinfo /* info1 */ ,
- refinfo /* info2 */,
- void* /* pointer1 */,
- void* /* pointer2 */,
- boolean* /* finish */);
-
- /* rst1, rst2:
- contain the R*-tree identifiers as passed to the JoinXX
- procedures.
-
- rectangle1, rectangle2:
- contain the two rectangles currently found by the join.
-
- info1, info2:
- point to the concerning information parts.
-
- pointer1, pointer2:
- are arbitrary pointers as passed to the JoinXX procedures.
- They may be used as pointers to buffer structures.
-
- finish:
- points to a flag labeling the join to be finished when the
- procedure is left. */
-
-
-/* ---------------------- procedure declarations ----------------------- */
-
-/*
- Almost all procedures return a boolean result.
- If a procedure returns FALSE an error has occured. The implementation
- attempts to detect errors before any update operations are performed.
-*/
-
-
-void NoRSTree(RSTREE *rst);
-
- /* Initializes an R*-tree identifier (at least sets *rst to NULL).
- Each procedure which requires an R*-tree identifier checks the
- value of this identifier at its entry.
- OpenRST for example demands a NULL identifier while CloseRST
- demands a non NULL identifier. */
-
-
-boolean CreateRST(const char *name,
- int pagesize,
- boolean unique);
-
- /* CreateRST creates an R*-tree on secondary memory.
- To work on it, it has to be opened by the procedure OpenRST.
-
- name:
- is the main filename under which the created R*-tree will be
- stored, additionally a few files named filename.suffix with
- different suffixes will be created. name is not fixed in the
- internal parameter table, thus after renaming the files, the
- R*-tree may be opened under another name.
-
- pagesize:
- is the size in bytes, a page (directory or data) will occupy.
-
- unique:
- if unique is set TRUE the procedure InsertRecord will not store
- more than one record with the same rectangle (key) in the
- R*-tree (rectangles will be real keys).
- The unique flag may be reset with the procedure SetUnique
- without further internal tests. */
-
-
-boolean RemoveRST(const char *name);
-
- /* RemoveRST removes all files corresponding to an R*-tree. */
-
-
-boolean OpenRST(RSTREE *rst,
- const char *name,
- const char *mode);
-
- /* OpenRST opens the R*-tree named name. */
-
-
-boolean CloseRST(RSTREE *rst);
-
- /* CloseRST closes the R*-tree referenced by rst. */
-
-
-boolean SetUnique(RSTREE rst,
- boolean mode);
-
- /* The unique state, defined in procedure CreateRST may be reset
- by this procedure (see also CreateRST). The unique flag is set
- without internal checks (even to TRUE). */
-
-
-boolean InquireRSTDesc(RSTREE rst,
- char *name,
- int *numbofdim,
- int *sizedirentry,
- int *sizedataentry,
- int *sizeinfo,
- int *maxdirfanout,
- int *maxdatafanout,
- int *pagesize,
- int *numbofdirpages,
- int *numbofdatapages,
- int pagesperlevel[],
- int *numbofrecords,
- int *height,
- boolean *unique);
-
- /* InquireRSTDesc provides some useful information about the
- R*-tree referenced by rst.
-
- name: see CreateRST.
-
- numbofdim:
- contains the number of dimensions of the R*-tree referenced by
- rst, i.e. the value the constant NumbOfDim was set to when it
- was created.
-
- sizedirentry, sizedataentry:
- contain the size (in bytes) of a directory and data entry
- respectively.
-
- sizeinfo:
- contains the size (in bytes) of an information part.
-
- maxdirfanout, maxdatafanout:
- contain the maximum possible number of entries a directory
- and data node respectively can store.
-
- pagesize: see CreateRST.
-
- numbofdirpages, numbofdatapages:
- total number of directory and data pages respectively in use.
-
- pagesperlevel:
- For each level i, beginning at the root, pagesperlevel[i]
- contains the number of pages in use.
-
- numbofrecords:
- total number of data records stored in the R*-tree.
-
- height:
- height of the tree, the lowest height is "1" (only the root
- exists).
-
- unique: see CreateRST. */
-
-
-boolean InsertRecord(RSTREE rst,
- typrect rectangle,
- typinfo *info,
- boolean *inserted);
-
- /* InsertRecord inserts a new record in the R*-tree.
- If the unique flag is set TRUE (see CreateRST) a new record is
- not inserted if a record with the same rectangle is found. In
- this case inserted yields FALSE, but the return value is TRUE
- (if no error occurred).
-
- rectangle:
- is the rectangle part of the new record.
-
- info:
- is the information part of the new record. */
-
-
-boolean DeleteRecord(RSTREE rst,
- typrect rectangle,
- boolean *deleted);
-
- /* DeleteRecord deletes the first record with the given rectangle
- it finds. It provides a fast deletion in trees where entries
- are unique and may be used in trees where entries are not
- unique, to delete iteratively all entries with the same
- rectangle as passed. */
-
-
-boolean ExistsRegion(RSTREE rst,
- typrect queryrect1,
- typrect queryrect2,
- DirQueryProc DirQuery,
- DataQueryProc DataQuery,
- boolean *recordfound);
-
- /* ExistsRegion performs a RegionQuery on the R*-tree referenced
- by rst. It stops after the first record satisfying the query
- condition is found.
- See also RegionQuery.
-
- recordfound:
- is set to TRUE if a record satisfying the query condition
- exists, otherwise FALSE. */
-
-
-boolean RegionCount(RSTREE rst,
- typrect queryrect1,
- typrect queryrect2,
- DirQueryProc DirQuery,
- DataQueryProc DatQuery,
- int *recordcount);
-
- /* RegionCount performs a RegionQuery on the R*-tree referenced
- by rst. It does not return records but only counts the number
- of records found.
- See also RegionQuery.
-
- recordcount:
- is set to the number of records satisfying the query
- condition. */
-
-
-boolean RegionQuery(RSTREE rst,
- typrect queryrect1,
- typrect queryrect2,
- DirQueryProc DirQuery,
- DataQueryProc DatQuery,
- QueryManageProc Manage,
- void *pointer);
-
- /* RegionQuery performs a RegionQuery on the R*-tree referenced
- by rst. Up to two query rectangles may be passed by queryrect1
- and queryrect2. Two different procedures have two be provided
- (DirQuery, DataQuery) which perform the query in the directory
- and the data level respectively. A third procedure (Manage) must
- be provided to deal with the records successively found.
- A query is closed either if it did not find an additional
- record satisfying the query condition or if the finish flag is
- set by the procedure Manage.
- See also DirQueryProc, DataQueryProc, QueryManageProc.
-
- queryrect1, queryrect2:
- query rectangles to be compared with directory rectangles and
- data rectangles respectively.
-
- DirQuery, DataQuery:
- Procedure parameters passing comparison procedures of type
- boolean.
-
- Manage:
- Procedure parameter passing a management procedure.
- Manage is called each time a new data rectangle satisfying the
- query condition is found.
- Procedures of type QueryManageProc may provide the following
- facilities:
- Inspection of the data records rectangle and info part.
- Communication to another structure, pointed to by pointer.
- To modify the info part (the rectangle cannot be modified), and
- label the node to be written back.
- To finish the query.
-
- pointer:
- Arbitrary pointer passed through to the procedure Manage. */
-
-boolean RegionQueryInfo(RSTREE R,
- Check includes,
- Check intersects,
- void * data,
- typrect rect,
- typdirinfo * info);
-
-boolean AllQuery(RSTREE rst,
- QueryManageProc Manage,
- void *pointer);
-
- /* AllQuery performs a fast query which returns all records stored
- in the R*-tree referenced by rst.
-
- Manage:
- Procedure parameter passing a management procedure.
- Manage is called each time a new data rectangle satisfying the
- query condition is found.
- The type QueryManageProc provides the following functions:
- To inspect a data records rectangle and info part.
- To copy a record to the location pointer points to.
- To modify the info part (the rectangle cannot be modified),
- and label the node to be written back.
- To finish the query.
-
- pointer:
- Arbitrary pointer passed through to the procedure Manage.
-
- Since AllQuery is designed to be fast it does not support the
- complete counting facility.
-
- See also RegionQuery. */
-
-boolean Update(RSTREE rst);
-
- /* Updates the directory nodes typdirinfo. */
-
-boolean JoinCountNv(RSTREE rst1,
- RSTREE rst2,
- typrect R1queryrect1,
- typrect R1queryrect2,
- typrect R2queryrect1,
- typrect R2queryrect2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- int *paircount);
-
- /* JoinCountNv performs a Join on the two R*-trees referenced by
- rst1 and rst2. It does not return record pairs but only counts
- the number of record pairs found.
- See also JoinNv.
-
- paircount:
- is set to the number of recordpairs satisfying the join
- condition. */
-
-
-boolean JoinNv(RSTREE rst1,
- RSTREE rst2,
- typrect rst1queryrect1,
- typrect rst1queryrect2,
- typrect rst2queryrect1,
- typrect rst2queryrect2,
- DirQueryProc Dir1Query,
- DataQueryProc Data1Query,
- DirQueryProc Dir2Query,
- DataQueryProc Data2Query,
- DirQueryProc DirJoin,
- DataQueryProc DataJoin,
- JoinManageProc Manage,
- void *pointer1,
- void *pointer2);
-
- /* The functionality of the join can be considered as follows:
- On each of the two R*-trees to be joined a query is performed.
- On the resulting restricted sets of records of the two R*-trees
- the join is applied depending on the given join condition.
-
- Join performs a join on the two R*-trees referenced by rst1 and
- rst2. A join is closed either if it did not find an additional
- pair of records satisfying the join condition or if the finish
- flag is set by the procedure Manage.
- See also DirQueryProc, DataQueryProc, JoinManageProc.
-
- rst1queryrect1, rst1queryrect2:
- Used in connection with the pre-query on rst1;
- query rectangles to be compared with directory and data
- rectangles respectively of rst1.
-
- rst2queryrect1, rst2queryrect2:
- Used in connection with the pre-query on rst2;
- query rectangles to be compared with directory and data
- rectangles respectively of rst2.
-
- Dir1Query, Data1Query:
- Procedure parameters passing comparison procedures of type
- boolean.
- The two procedures have to perform the pre-query on rst1.
- See also DirQueryProc, DataQueryProc and RegionQuery.
-
- Dir2Query, Data2Query:
- Procedure parameters passing comparison procedures of type
- boolean.
- The two procedures have to perform the pre-query on rst2.
- See also DirQueryProc, DataQueryProc and RegionQuery.
-
- DirJoin, DataJoin:
- Procedure parameters passing comparison procedures of type
- boolean.
- DirJoin has to determine if two directory rectangles, one of
- rst1 the other of rst2 have to be joined,
- DataJoin has to determine if two data rectangles, one of
- rst1 the other of rst2 have to be joined.
- Here the types DirQueryProc and DataQueryProc are used as
- follows:
- DQP(RSTREE rst1,
- typrect rst1rect,
- typrect rst2rect,
- typrect unused);
- rst1 contains rst1.
- rst1rect contains a directory or data rectangle respectively
- of rst1.
- rst2rect contains a directory or data rectangle respectively
- of rst2.
- The last parameter is unused.
-
- Manage:
- Procedure parameter passing a management procedure.
- Manage is called each time a new pair of data rectangles
- satisfying the join condition is found.
- Procedures of type JoinManageProc may provide the following
- facilities:
- Inspection of the data records' rectangles and info parts.
- Communication to two other structures, pointed to by pointer1
- and pointer2.
- To finish the join.
-
- pointer1, pointer2:
- Arbitrary pointers passed through to the procedure Manage. */
-
-
-/*************** ----- Performance Controll Routines ----- ***************/
-
-/* ------ Counts-Switch: */
-
-boolean CountsOn0(RSTREE rst);
- /* put ON, set 0 */
-
-boolean CountsOn(RSTREE rst);
- /* put ON */
-
-boolean CountsOff(RSTREE rst);
- /* put OFF */
-
- /* the Counts-Switch applies to the variables set by the
- procedures GetCountRead, GetCountWrite.
-
- The procedure OpenRST initializes counting:
- the count variables are set to 0, the count switch is set to
- OFF. */
-
-
-boolean GetCountRead(RSTREE rst,
- int *DirVisitCount,
- int *DataVisitCount,
- int *DirReadCount,
- int *DataReadCount);
-
- /* DirVisitCount is set to the number of directory nodes visited
- traversing the tree.
- DataVisitCount is set to the number of data nodes visited
- traversing the tree.
- DirReadCount directory nodes and DataReadCount data nodes had
- actually to be read from secondary memory.
-
- If the function returns FALSE these variables are set to 0.
- DirVisitCount, DataVisitCount is counted:
- for all query, join and update procedures.
- DirReadCount, DataReadCount is counted:
- whenever a read occurs. */
-
-
-boolean GetCountWrite(RSTREE rst,
- int *DirModifyCount,
- int *DataModifyCount,
- int *DirWriteCount,
- int *DataWriteCount);
-
- /* DirModifyCount is set to the number of directory nodes
- modified.
- DataModifyCount is set to the number of data nodes modified.
- DirWriteCount is set to the number of directory nodes written
- to secondary memory.
- DataWriteCount is set to the number of data nodes written to
- secondary memory.
- If the function returns FALSE these variables are set to 0.
- DirModifyCount, DataModifyCount is counted:
- for all update procedures.
- DirWriteCount, DataWriteCount is counted:
- whenever a write occurs. */
-
-
-boolean GetMemory(RSTREE rst,
- int *numbofdirpages,
- int *numbofdatapages);
-
- /* numbofdirpages and numbofdatapages are set to the number of
- pages in use for the directory and the data level respectively.
- If the function returns FALSE these variables are set to 0. */
-
-
-boolean GetHeight(RSTREE rst,
- int *height);
-
- /* height is set to the height of the tree, the lowest height
- is "1" (only the root exists).
- If the function returns FALSE these variables are set to 0. */
-
-
-/*************************************************************************/
-
-/* Layout of a directory and data node respectively (pidgin C)
- -----------------------------------------------------------
-
- directory node layout:
-
- struct {
- typrect rectangle;
- int subtree_pointer;
- } directory_entry;
-
- struct {
- int n;
- directory_entry entries[M];
- } directory_node;
-
- The maximum number of entries M varies with different page sizes. The
- minimum is M = 3.
- The minimum number of entries m is calculated as max(round(0.4 * M), 2).
-
- data node layout:
-
- struct {
- typrect rectangle;
- typinfo information_part;
- } data_entry;
-
- struct {
- int n;
- data_entry entries[M];
- } data_node;
-
- The maximum number of entries M varies with different page sizes. The
- minimum is M = 1.
- The minimum number of entries m is calculated as max(round(0.4 * M), 1).
-*/
-
-/*************************************************************************/
-
-/* BUGS:
-
- The implementation does not provide packing, thus depending on the
- design of the machine and the compiler, and the choice of typatomkey and
- typinfo nodes may have gaps, i.e. the fanout may be smaller than you
- expect.
- Alignment problems, i.e. gaps between the entities stored in the nodes
- cause warning messages on stdout (with one restriction):
- The implementation does not know the internal structure of typinfo (it
- only knows its size). Thus, if typinfo intrinsically contains gaps, this
- cannot be detected. Information about the actual values of important
- parameters may be obtained by calling InquireRSTDesc.
-
- R*-tree identifiers are only checked for NULL and non NULL. Though
- passing a non NULL invalid identifier is not detected as an error.
-
- To open an R*-tree twice may damage consistency. But the implementation
- does not detect this mistake.
-
- Early detection of memory limitations is not available. If accidentally
- the file system fills up during an update operation, the tree may be
- left in an inconsistent state.
-
- Although (aside from the lacks mentioned above) internal error detection
- is nearly exhaustive, all you get is a boolean return value.
-
- Passing the same R*-tree identifier twice to the JoinXX procedures is
- save. If a join is performed on one and the same R*-tree, a second
- R*-tree is opened virtually, but the performance control parameters are
- only available for one of them. Since the join internally does not work
- symmetrically this information generally is useless.
-
- If deletions are performed the files holding the directory and data
- pages will not shrink. Free pages are reoccupied by following
- insertions. A file reorganization algorithm is not implemented.
-
- The procedures of type QueryManageProc and JoinManageProc permit
- unprotected access to parts of the internal data structure of the
- R*-tree. This avoids copying but is unsafe of course.
-
- The implementation restricts the informational part of a data record to
- contain at least an integer sized contents.
-
-*/
-
-
-/*************************************************************************/
-/*************** ----- For Private Test Purpose Only ----- ***************/
-
-boolean Find(RSTREE rst,
- typrect rectangle,
- boolean *found,
- void *buf,
- int nbytes);
-
-
-#endif /* !__RStarTree_h */
diff --git a/modules/fes2004/AUTHORS b/modules/fes2004/AUTHORS
deleted file mode 100644
index 08f2c94..0000000
--- a/modules/fes2004/AUTHORS
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-The FES2004_distribution_soft-1.0.2 was written by :
-
-Thierry LETELLIER (tletelli @ notos.cst.cnes.fr)
-LEGOS Toulouse FRANCE
-in October 2005
-
-
-
-
-The FES2004_distribution_soft-1.0.2 used some functions from Aktarus library
-The Aktarus library was written by :
-
-Thierry LETELLIER and Laurent ROBLOU
-LEGOS Toulouse FRANCE
-in 2003
-(tletelli @ notos.cst.cnes.fr) and (laurent.roblou @ noveltis.fr)
-
diff --git a/modules/fes2004/COPYING b/modules/fes2004/COPYING
deleted file mode 100644
index d60c31a..0000000
--- a/modules/fes2004/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program 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.
-
- This program 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 this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/modules/fes2004/ChangeLog b/modules/fes2004/ChangeLog
deleted file mode 100644
index e69de29..0000000
diff --git a/modules/fes2004/Makefile.am b/modules/fes2004/Makefile.am
deleted file mode 100644
index 9c22935..0000000
--- a/modules/fes2004/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-if BUILD_TIDE
-TIDE = libfes.la
-endif
-
-noinst_LTLIBRARIES = $(TIDE)
-
-libfes_la_CFLAGS = $(AM_CFLAGS) $(GSL_CFLAGS)
-libfes_la_SOURCES = \
- fes2004_alloc.c \
- fes2004_error.c \
- fes2004_extraction.c \
- fes2004_init.c \
- fes2004_io.c \
- fes2004_prediction.c \
- fes2004_kernel.c \
- fes.h \
- fes2004_lib.h
diff --git a/modules/fes2004/Makefile.in b/modules/fes2004/Makefile.in
deleted file mode 100644
index 6ca2b52..0000000
--- a/modules/fes2004/Makefile.in
+++ /dev/null
@@ -1,580 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# This Makefile.in 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.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = modules/fes2004
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- AUTHORS COPYING ChangeLog NEWS
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libfes_la_LIBADD =
-am_libfes_la_OBJECTS = libfes_la-fes2004_alloc.lo \
- libfes_la-fes2004_error.lo libfes_la-fes2004_extraction.lo \
- libfes_la-fes2004_init.lo libfes_la-fes2004_io.lo \
- libfes_la-fes2004_prediction.lo libfes_la-fes2004_kernel.lo
-libfes_la_OBJECTS = $(am_libfes_la_OBJECTS)
-libfes_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfes_la_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- at BUILD_TIDE_TRUE@am_libfes_la_rpath =
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-SOURCES = $(libfes_la_SOURCES)
-DIST_SOURCES = $(libfes_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FC = @FC@
-FCFLAGS = @FCFLAGS@
-FFLAGS = @FFLAGS@
-FGREP = @FGREP@
-GFS2D_LIBS = @GFS2D_LIBS@
-GFS3D_LIBS = @GFS3D_LIBS@
-GFS_COMPILATION_FLAGS = @GFS_COMPILATION_FLAGS@
-GFS_MAJOR_VERSION = @GFS_MAJOR_VERSION@
-GFS_MICRO_VERSION = @GFS_MICRO_VERSION@
-GFS_MINOR_VERSION = @GFS_MINOR_VERSION@
-GFS_VERSION = @GFS_VERSION@
-GREP = @GREP@
-GSL_CFLAGS = @GSL_CFLAGS@
-GSL_CONFIG = @GSL_CONFIG@
-GSL_LIBS = @GSL_LIBS@
-GTS_CFLAGS = @GTS_CFLAGS@
-GTS_CONFIG = @GTS_CONFIG@
-GTS_DEPLIBS = @GTS_DEPLIBS@
-GTS_LIBS = @GTS_LIBS@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-MODULES = @MODULES@
-NM = @NM@
-NMEDIT = @NMEDIT@
-NO_UNDEFINED = @NO_UNDEFINED@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-ODE_CFLAGS = @ODE_CFLAGS@
-ODE_LIBS = @ODE_LIBS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-W3INIT = @W3INIT@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_FC = @ac_ct_FC@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-gts_cflags = @gts_cflags@
-gts_libs = @gts_libs@
-have_awk = @have_awk@
-have_gmodule = @have_gmodule@
-have_m4 = @have_m4@
-have_pkg_config = @have_pkg_config@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-ode = @ode@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-use_mpicc = @use_mpicc@
- at BUILD_TIDE_TRUE@TIDE = libfes.la
-noinst_LTLIBRARIES = $(TIDE)
-libfes_la_CFLAGS = $(AM_CFLAGS) $(GSL_CFLAGS)
-libfes_la_SOURCES = \
- fes2004_alloc.c \
- fes2004_error.c \
- fes2004_extraction.c \
- fes2004_init.c \
- fes2004_io.c \
- fes2004_prediction.c \
- fes2004_kernel.c \
- fes.h \
- fes2004_lib.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/fes2004/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu modules/fes2004/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libfes.la: $(libfes_la_OBJECTS) $(libfes_la_DEPENDENCIES)
- $(libfes_la_LINK) $(am_libfes_la_rpath) $(libfes_la_OBJECTS) $(libfes_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_alloc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_error.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_extraction.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_init.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_io.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_kernel.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfes_la-fes2004_prediction.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-libfes_la-fes2004_alloc.lo: fes2004_alloc.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_alloc.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_alloc.Tpo -c -o libfes_la-fes2004_alloc.lo `test -f 'fes2004_alloc.c' || echo '$(srcdir)/'`fes2004_alloc.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_alloc.Tpo $(DEPDIR)/libfes_la-fes2004_alloc.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_alloc.c' object='libfes_la-fes2004_alloc.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_alloc.lo `test -f 'fes2004_alloc.c' || echo '$(srcdir)/'`fes2004_alloc.c
-
-libfes_la-fes2004_error.lo: fes2004_error.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_error.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_error.Tpo -c -o libfes_la-fes2004_error.lo `test -f 'fes2004_error.c' || echo '$(srcdir)/'`fes2004_error.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_error.Tpo $(DEPDIR)/libfes_la-fes2004_error.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_error.c' object='libfes_la-fes2004_error.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_error.lo `test -f 'fes2004_error.c' || echo '$(srcdir)/'`fes2004_error.c
-
-libfes_la-fes2004_extraction.lo: fes2004_extraction.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_extraction.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_extraction.Tpo -c -o libfes_la-fes2004_extraction.lo `test -f 'fes2004_extraction.c' || echo '$(srcdir)/'`fes2004_extraction.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_extraction.Tpo $(DEPDIR)/libfes_la-fes2004_extraction.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_extraction.c' object='libfes_la-fes2004_extraction.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_extraction.lo `test -f 'fes2004_extraction.c' || echo '$(srcdir)/'`fes2004_extraction.c
-
-libfes_la-fes2004_init.lo: fes2004_init.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_init.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_init.Tpo -c -o libfes_la-fes2004_init.lo `test -f 'fes2004_init.c' || echo '$(srcdir)/'`fes2004_init.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_init.Tpo $(DEPDIR)/libfes_la-fes2004_init.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_init.c' object='libfes_la-fes2004_init.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_init.lo `test -f 'fes2004_init.c' || echo '$(srcdir)/'`fes2004_init.c
-
-libfes_la-fes2004_io.lo: fes2004_io.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_io.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_io.Tpo -c -o libfes_la-fes2004_io.lo `test -f 'fes2004_io.c' || echo '$(srcdir)/'`fes2004_io.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_io.Tpo $(DEPDIR)/libfes_la-fes2004_io.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_io.c' object='libfes_la-fes2004_io.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_io.lo `test -f 'fes2004_io.c' || echo '$(srcdir)/'`fes2004_io.c
-
-libfes_la-fes2004_prediction.lo: fes2004_prediction.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_prediction.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_prediction.Tpo -c -o libfes_la-fes2004_prediction.lo `test -f 'fes2004_prediction.c' || echo '$(srcdir)/'`fes2004_prediction.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_prediction.Tpo $(DEPDIR)/libfes_la-fes2004_prediction.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_prediction.c' object='libfes_la-fes2004_prediction.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_prediction.lo `test -f 'fes2004_prediction.c' || echo '$(srcdir)/'`fes2004_prediction.c
-
-libfes_la-fes2004_kernel.lo: fes2004_kernel.c
- at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -MT libfes_la-fes2004_kernel.lo -MD -MP -MF $(DEPDIR)/libfes_la-fes2004_kernel.Tpo -c -o libfes_la-fes2004_kernel.lo `test -f 'fes2004_kernel.c' || echo '$(srcdir)/'`fes2004_kernel.c
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfes_la-fes2004_kernel.Tpo $(DEPDIR)/libfes_la-fes2004_kernel.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fes2004_kernel.c' object='libfes_la-fes2004_kernel.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfes_la_CFLAGS) $(CFLAGS) -c -o libfes_la-fes2004_kernel.lo `test -f 'fes2004_kernel.c' || echo '$(srcdir)/'`fes2004_kernel.c
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/modules/fes2004/NEWS b/modules/fes2004/NEWS
deleted file mode 100644
index e69de29..0000000
diff --git a/modules/fes2004/README b/modules/fes2004/README
deleted file mode 100644
index 62a3666..0000000
--- a/modules/fes2004/README
+++ /dev/null
@@ -1,217 +0,0 @@
-################################################################
-#
-# FES2004_distribution_soft-1.0.2
-#
-# -----------------------------------------------------------------------------------------------------------------------
-# THE SOFTWARE IS DISTRIBUTED FOR THE SCIENTIC COMMUNITY WITHOUT ANY GARANTEE
-# -----------------------------------------------------------------------------------------------------------------------
-#
-# Author : T. LETELLIER Legos Toulouse FRANCE
-#
-################################################################
-
-
-
-
- REQUIREMENTS :
-================
-
-1---
-
-You need GSL (the Gnu Scientific Library) to be installed on your computer
-see : http://www.gnu.org/software/gsl/
-
-By default GSL is installed by root in the classical /usr/bin /usr/lib /usr/include
-some times in /usr/local/bin /usr/local/lib /usr/local/include
-
-If the installation was made made be a default user or if the configure script not found the GSL files
-you need to configure the environement :
-in bash :
-export PATH=$PATH:/home/user/softs/gsl/bin
-export CFLAGS="$CFLAGS -I/home/user/softs/gsl/include"
-export LDFLAGS="$LDLAGS -I/home/user/softs/gsl/lib"
-
-2---
-
-You need NETCDF (network Common Data Form) to be installed on your computer
-see : http://www.unidata.ucar.edu/software/netcdf/
-
-By default NETCDF is installed by root in the classical /usr/bin /usr/lib /usr/include
-some times in /usr/local/bin /usr/local/lib /usr/local/include
-
-If the installation was made made be a default user or if the configure script not found the NETCDF files
-you need to configure the environement :
-in bash :
-export PATH=$PATH:/home/user/softs/netcdf/bin
-export CFLAGS="$CFLAGS -I/home/user/softs/netcdf/include"
-export LDFLAGS="$LDLAGS -I/home/user/softs/netcdf/lib"
-
-
-
-
-
- COMPILATION :
-================
-
-You just have to execute the 3 commands :
- ./configure
- make
- make install
-
-in the major compilation case you do not have to install this program in the system path
-(and also if oyu are not root you do not have the right)
-
-Then use the option --prefix=/home/user/bin/... (path that pointing to an existing directory)
-to the configure script
-example :
- mkdir /home/user/bin/FES2004_EXEC_DIR
- ./configure --prefix=/home/user/bin/FES2004_EXEC_DIR
-
-
-
-
- INSTALLATION :
-================
-
-The "make install" script will install 3 files
-the executable FES2004.exe in bin directory
-the header file fes2004.h in include directory
-the lib file libfes.a in lib directory
-
-
-
-
- USE FES2004.exe :
-===================
-
-Usage : FES2004.exe [parameters] [option] file ...
-
- ----PARAMETERS---- :
- ------------------
- -t [argument] Process type : extraction - prediction Note : this option can be use two times ...
- -s [argument] Data set for process : tide - loading Note : this option can be use two times ...
- -A [FILE] Necessary (with -s tide) path and filename of the --TIDE-- FES netcdf data file
- -B [FILE] Necessary (with -s load) path and filename of the --LOAD-- FES netcdf data file
- -----VARIABLE PARAMETER---- :
- ----------------------------
- -r [value] Necessary for prediction :
- This is the time refence of the input file.
- Use : 0 --> 01Jan1950 0H00
- 1 --> 01Jan1958 0H00
- 2 --> 01Jan1985 0H00
- 3 --> 01Jan2000 0H00
- DEFAULT is 0
- ----OPTION---- :
- ---------------
- -o [file] Optionnal give a specific root output file name
-
- ----EXAMPLES---- :
- ----------------
-
- 1- FES2004.exe -t extraction -s loading -B load.nc inputFILE --> extraction of the loading data in out_file.loading.extract
-
- 2- FES2004.exe -t extraction -t prediction -s tide -A tide.nc inputFILE --> extraction of the tide data in out_file.tide.extract
- and prediction of the tide data in out_file.tide.pred
-
- 3- FES2004.exe -t prediction -s tide -s loading -A tide.nc -B load.nc inputFILE --> prediction of both the tide and loading data
- in out_file.tide.pred and out_file.loading.extract
-
- 4- FES2004.exe -t prediction -A tide.nc -s tide -o my_output inputFILE --> prediction of the tide data in my_output.tide.pred
-
- 5- FES2004.exe -t prediction -s tide -A tide.nc -d /MYPATH/ inputFILE --> prediction of the tide data (FES2004.nc) found in /MYPATH/
-
-
-The inputFile MUST HAVE THIS FORMAT
-
-Latitude Longitude Time
-Latitude Longitude Time
-Latitude Longitude Time
-Latitude Longitude Time
-Latitude Longitude Time
-Latitude Longitude Time
- .
- .
- .
-Where latitude longitude and time are double
-With Latitude and Longitude in degrees (-180 +180) or (0 360)
-and time in hours since the time reference ...
-
-For the extraction process you do not have to indicate a valid time
-because it is not use
-BUT IT MUST PRESENT
-
-
-
-
-
- USE libfes.a :
-===================
-
-The libfes can be used in C and C++ language
-
-You just have to include the file fes2004.h (that prototype the prediction and extraction functions)
-and use the libfes2004.a the gsl gslcblas and netcdf libraries during the linking
-
-Example
-
----
-C sources
-
-#include "fes2004.h"
-
-int main()
-{
-char netcdf_filename[256];
-int nb_position=600;
-double *lat,double *lon,double **amplitude,double **phase;
-int nb_CPU;
-
-//allocation
-
-rstatus=fes2004_extraction (netcdf_filename,nb_position,lat,lon,amplitude,phase,nb_CPU);
-
-}
-
----
-compilation
-
-gcc -g -IFES_Directory/include -lfes -lnetcdf -lgsl -lgslcblas -o My_own_extract.exe
-
-
-For the Fortran We think that the liffes.a can also be use
-all the parameters used for the CALL are classical and correspond to Fortran tabular
-But yet it was never been tested ....
-
-
----
-experts
-
-You can use libfes on a defined number of processors
-You need to uncoment the
-#define MULTI
-in the src/fes2004_kernel.c file and then recompile the lib
-with
-./configure --prefix= ...
-make
-make install
-
-You can now use the nb_cpu parameters of the extraction and prediction functions
- ...
- It's easy
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/fes2004/fes.h b/modules/fes2004/fes.h
deleted file mode 100644
index c606cc9..0000000
--- a/modules/fes2004/fes.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-// this file is a hearder file that prototype the libfes.a functions
-// The inputs are :
-// char an string that contain the ath to load the NETCDF SOLUTION
-// int time reference 0->01/01/1950 1->01/01/1958 2->01/01/1985 3->01/0/2000
-// int nb_position the number of point the predict and or to extract
-// double lat lon time 3 tabulars(nb_position) that contain the position and time for the prediction extraction
-// The returns are :
-// double prediction tabular(nb_position) that contains the prediction in meters
-// double amplitude phase 2 dimension tabular[nb_position][nb_wave=14] that contain the amplitude and the phase_lag extracted for each point and all waves
-
-// the int nb_cpu can be use if chachc in the source code src/fes2004_kernel.c
-// and activate the multithread mode ... read the end of the README file
-
-//extern int fes2004_prediction (char *netcdf_filename,int time_reference,int nb_position,double *lat,double *lon,double *time,double *prediction,int nb_CPU);
-//extern int fes2004_extraction (char *netcdf_filename,int nb_position,double *lat,double *lon,double **amplitude,double **phase,int nb_CPU);
-
-// prototypes
-
-
-
-extern int fes2004_prediction (char *,int ,int ,double *,double *,double *,double *,int );
-extern int fes2004_extraction (char *,int ,double *,double *,double **,double **,int );
diff --git a/modules/fes2004/fes2004_alloc.c b/modules/fes2004/fes2004_alloc.c
deleted file mode 100644
index 8c949d8..0000000
--- a/modules/fes2004/fes2004_alloc.c
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "fes2004_lib.h"
-
-
-/*####################################################*/
-/* */
-/* spectrum variable allocation */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void alloc_tide_spectrum(spectrum_struct **spectrum )
-{
- int nb_wave;
- nb_wave=NB_WAVE_IN_SPECTRUM;
- *spectrum=(spectrum_struct *)calloc(nb_wave,sizeof(spectrum_struct));
- if(*spectrum==NULL) print_error_3("error in spectrum allocation, you may use a larger memory computer -->exit");
-
-}
-
-
-
-/*####################################################*/
-/* */
-/* threads variable allocation */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void alloc_prediction_threads(mega_struct *P,int CPU)
-{
- int i;
-
- for(i=0;i<CPU;i++)
- {
- P[i].Mat=gsl_matrix_calloc(coef_spline,coef_spline);
- if(P[i].Mat==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].sec_r=gsl_vector_calloc(coef_spline);
- if(P[i].sec_r==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].sec_i=gsl_vector_calloc(coef_spline);
- if(P[i].sec_i==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].res_r=gsl_vector_calloc(coef_spline);
- if(P[i].res_r==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].res_i=gsl_vector_calloc(coef_spline);
- if(P[i].res_i==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].Perm=gsl_permutation_calloc(coef_spline);
- if(P[i].Perm==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].spectrum=calloc(36,sizeof(spectrum_struct));
- if(P[i].spectrum==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
-
- P[i].data_amp=malloc(56*sizeof(float));
- P[i].data_phi=malloc(56*sizeof(float));
-
- P[i].weight=malloc(4*sizeof(double));
- P[i].sindice=malloc(3*sizeof(int));
- P[i].aindice=malloc(10*sizeof(int));
-
-
- }
-}
-
-/*####################################################*/
-/* */
-/* threads variable allocation */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void alloc_extraction_threads(mega_struct *P,int CPU)
-{
- int i;
- for(i=0;i<CPU;i++)
- {
- P[i].spectrum=calloc(36,sizeof(spectrum_struct));
- if(P[i].spectrum==NULL) print_error_3("error in threads allocation, you may use a larger memory computer or reduce the number of CPU -->exit");
- P[i].data_amp=malloc(56*sizeof(float));
- P[i].data_phi=malloc(56*sizeof(float));
- P[i].weight=malloc(4*sizeof(double));
- }
-
-}
-
-/*####################################################*/
-/* */
-/* threads variable free */
-/* */
-/* */
-/* Thierry LETELLIER 06Oct2005 */
-/* */
-/*####################################################*/
-
-
-void free_threads(mega_struct *P,int CPU)
-{
- int i;
- for(i=0;i<CPU;i++)
- {
- if(P[i].Mat!=NULL)gsl_matrix_free( P[i].Mat);
- if(P[i].sec_r!=NULL)gsl_vector_free(P[i].sec_r);
- if(P[i].sec_i!=NULL)gsl_vector_free(P[i].sec_i);
- if(P[i].res_r!=NULL)gsl_vector_free(P[i].res_r);
- if(P[i].res_i!=NULL)gsl_vector_free(P[i].res_i);
- if(P[i].Perm!=NULL)gsl_permutation_free(P[i].Perm);
-
- if(P[i].spectrum!=NULL)free(P[i].spectrum);
- if(P[i].data_amp!=NULL)free(P[i].data_amp);
- if( P[i].data_phi!=NULL)free( P[i].data_phi);
- if(P[i].weight!=NULL) free(P[i].weight);
- if(P[i].sindice!=NULL)free(P[i].sindice);
- if(P[i].aindice!=NULL)free(P[i].aindice);
- }
-}
diff --git a/modules/fes2004/fes2004_error.c b/modules/fes2004/fes2004_error.c
deleted file mode 100644
index a7510ef..0000000
--- a/modules/fes2004/fes2004_error.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-void print_error_1()
-{
- printf("error: wrong run parameters\n use: [executable] [time origine (CNES:0,CTO:1,ESA:2)] [input file] [Nb CPU dispo]\nexit");
- exit(101);
-
-}
-
-void print_error_2()
-{
- printf("a strange error occur, certainly due to the memory allocation in the spectrum initialisation --> exit\n");
- exit(102);
-
-}
-
-void print_error_3(char *message)
-{
- printf("%s\n",message);
- exit(103);
-
-}
-
-void print_error_4(char *message)
-{
- printf("%s\n",message);
- exit(104);
-
-}
-
-void print_error_5(char *message)
-{
- printf("can not open the file : %s , please check this error --> exit\n",message);
- exit(105);
-
-}
diff --git a/modules/fes2004/fes2004_extraction.c b/modules/fes2004/fes2004_extraction.c
deleted file mode 100644
index 10d19db..0000000
--- a/modules/fes2004/fes2004_extraction.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "fes2004_lib.h"
-
-
-
-
-int fes2004_extraction (char *netcdf_filename,int nb_position,double *lat,double *lon,double **amplitude, double **phase,int nb_CPU)
-{
-
- /*####################################################*/
- /* variable*/
- /*####################################################*/
- //classical variables
- int rstatus;
-
- //prediction typedef variables
- spectrum_struct *spectrum=NULL;
- mega_struct *P=NULL;
-
- /*####################################################*/
- /* allocation*/
- /*####################################################*/
-
- alloc_tide_spectrum(&spectrum);
- P=calloc(nb_CPU,sizeof(mega_struct));
- alloc_extraction_threads(P,nb_CPU);
-
- /*####################################################*/
- /*init prediction spectrum*/
- /*####################################################*/
-
- rstatus=init_spectrum(spectrum,99);
- if (rstatus != 0 ) print_error_2();
-
- /*####################################################*/
- /* load data files*/
- /*####################################################*/
-
- load_netcdf_fes2004_data(netcdf_filename,P,nb_CPU);
-
-
- /*####################################################*/
- /*init thread struct*/
- /*####################################################*/
-
- init_thread_struct(nb_CPU, P, 99, lat, lon, NULL, NULL, spectrum,amplitude,phase);
-
- /*####################################################*/
- /*Multithreaded extraction*/
- /*####################################################*/
-
- multi_t_extraction( nb_position, nb_CPU, P);
-
- /*####################################################*/
- /*free memory and exit*/
- /*####################################################*/
- free_threads(P,nb_CPU);
- free(P);
-
- return 0;
-}/*end*/
diff --git a/modules/fes2004/fes2004_init.c b/modules/fes2004/fes2004_init.c
deleted file mode 100644
index 8f6960f..0000000
--- a/modules/fes2004/fes2004_init.c
+++ /dev/null
@@ -1,287 +0,0 @@
-#define LIB
-#include "fes2004_lib.h"
-
-
-/*####################################################*/
-/* */
-/* received : 1 name */
-/* return : 2 pointers (type FILE) */
-/* */
-/* the 2 files are open in r (in) and w (out) */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void in_out_file_open(char *name,FILE **in,FILE **out)
-{
- char *outfilename;
- int len;
-
- *in=fopen(name,"r");
- len=strlen(name);
- outfilename=(char *)malloc( (len+15)*sizeof(char));
- sprintf(outfilename,"%s.output_file",name);
- *out=fopen(outfilename,"w");
-
-}
-
-/*####################################################*/
-/* */
-/* received and return: 1 spectrum */
-/* */
-/* all the information in the spectrum are */
-/* readable in the prediction.h */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-int init_spectrum(spectrum_struct *spectrum, int CTO)
-{
- int rstatus;
- int i;
-
- //the rstatus return code is not test YET
-
- // spectrum waves initialisation
- /*------------FES2004-------------------*/
- rstatus=Wave_select(8,&spectrum[0].wave,2); /*2N2*/
- rstatus=Wave_select(5,&spectrum[1].wave,2); /*K1*/
- rstatus=Wave_select(4,&spectrum[2].wave,2); /*K2*/
- rstatus=Wave_select(1,&spectrum[3].wave,2); /*M2*/
- rstatus=Wave_select(37,&spectrum[4].wave,2); /*M4*/
- rstatus=Wave_select(27,&spectrum[5].wave,2);/*Mf*/
- rstatus=Wave_select(28,&spectrum[6].wave,2);/*Mm*/
- rstatus=Wave_select(30,&spectrum[7].wave,2);/*Msqm*/
- rstatus=Wave_select(29,&spectrum[8].wave,2);/*Mtm*/
- rstatus=Wave_select(3,&spectrum[9].wave,2); /*N2*/
- rstatus=Wave_select(6,&spectrum[10].wave,2); /*O1*/
- rstatus=Wave_select(16,&spectrum[11].wave,2); /*P1*/
- rstatus=Wave_select(7,&spectrum[12].wave,2); /*Q1*/
- rstatus=Wave_select(2,&spectrum[13].wave,2); /*S2*/
- /*------------ADMITTED------------------*/
- /*semidiurne*/
- rstatus=Wave_select(10,&spectrum[14].wave,2);/*nu2*/
- rstatus=Wave_select(9, &spectrum[15].wave,2);/*mu2*/
- rstatus=Wave_select(11,&spectrum[16].wave,2);/*L2*/
- rstatus=Wave_select(12,&spectrum[17].wave,2);/*T2*/
- rstatus=Wave_select(13,&spectrum[18].wave,2);/*LA1*/
- rstatus=Wave_select(14,&spectrum[19].wave,2);/*KJ2*/
- rstatus=Wave_select(15,&spectrum[20].wave,2);/*R2*/
- /*diurne*/
- rstatus=Wave_select(17,&spectrum[21].wave,2);/*OO1*/
- rstatus=Wave_select(18,&spectrum[22].wave,2);/*J1*/
- rstatus=Wave_select(19,&spectrum[23].wave,2);/*PHI1*/
- rstatus=Wave_select(20,&spectrum[24].wave,2);/*PI1*/
- rstatus=Wave_select(21,&spectrum[25].wave,2);/*PSI1*/
- rstatus=Wave_select(22,&spectrum[26].wave,2);/*RO1*/
- rstatus=Wave_select(23,&spectrum[27].wave,2);/*SIG1*/
- rstatus=Wave_select(24,&spectrum[28].wave,2);/*TTA1*/
- rstatus=Wave_select(25,&spectrum[29].wave,2);/*2Q1*/
- rstatus=Wave_select(26,&spectrum[30].wave,2);/*Ki1*/
- /*long*/
- rstatus=Wave_select(33,&spectrum[31].wave,2);/*Msm*/
- rstatus=Wave_select(34,&spectrum[32].wave,2);/*Msf*/
- rstatus=Wave_select(35,&spectrum[33].wave,2);/*Mqm*/
- rstatus=Wave_select(36,&spectrum[34].wave,2);/*Mstm*/
- /*------------computed------------------*/
- rstatus=Wave_select(31,&spectrum[35].wave,2);/*SSA*/
-
- //spectrum data initialisation
- for(i=0;i<13;i++)
- {
- spectrum[i].buffer=NULL;
- spectrum[i].rstatus=-1;
- sprintf(spectrum[i].PATH,"../data/%s.nc",spectrum[i].wave.name);
- }
- for(i=0;i<36;i++) spectrum[i].CTO=CTO;
- return(0);
-}
-
-
-/*####################################################*/
-/* */
-/* */
-/* init the mega struct P to prepare the */
-/* multithreaded part of the prediction */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void init_thread_struct(int CPU, mega_struct *P, int CTO,double *lat,double *lon, double *time, double *Otide, spectrum_struct *spectrum, double **amplitude,double **phase)
-{
- int i,j;
- for(i=0;i<CPU;i++)
- {
- P[i].CTO=CTO;
- P[i].lat=lat;
- P[i].lon=lon;
- P[i].time=time;
- P[i].Otide=Otide;
- P[i].amplitude=amplitude;
- P[i].phase=phase;
- for(j=0;j<36;j++)P[i].spectrum[j]=spectrum[j];
- }
-}
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* init select the wave in prediction.h */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* this routine is a part of the aktarus lib LEGOS */
-/*####################################################*/
-int Wave_select(int i, tidal_wave *carac,int detided)
-{
-
- int verbose=1;
-
-switch (i)
-{
-
- case 1 : {*carac=wM2; break;}
- case 2 : {*carac=wS2; break;}
- case 3 : {*carac=wN2; break;}
- case 4 : {*carac=wK2; break;}
- case 5 : {*carac=wK1; break;}
- case 6 : {*carac=wO1; break;}
- case 7 : {*carac=wQ1; break;}
- case 8 : {*carac=w2N2; break;}
-/*-----------------------------*/
- case 9 : {*carac=wMu2; break;}
- case 10 : { *carac=wNu2;break;}
- case 11 : {*carac=wL2; break;}
- case 12 : {*carac=wT2; break;}
- case 13 : {*carac=wLa2; break;}
- case 14 :
- {
- if (detided==2) {*carac=wKJ2; break;}
- else {verbose=0;break;}
- }
- case 15 :
- {
- if (detided==2) {*carac=wR2; break;}
- else {verbose=0;break;}
- }
-/*-----------------------------*/
- case 16 : {*carac=wP1; break;}
- case 17 : {*carac=wOO1; break;}
- case 18 : {*carac=wJ1; break;}
- case 19 : {*carac=wPhi1; break;}
- case 20 : {*carac=wPi1; break;}
- case 21 :
- {
- if (detided==0) {verbose=0;break; }
- else {*carac=wPsi1; break;}
- }
- case 22 : {*carac=wRo1; break;}
- case 23 : {*carac=wSig1; break;}
- case 24 : {*carac=wTta1; break;}
- case 25 : {*carac=w2Q1; break;}
- case 26 : {*carac=wKi1; break;}
-/*-----------------------------*/
- case 27 : {*carac=wMf; break;}
- case 28 : {*carac=wMm; break;}
- case 29 : {*carac=wMtm; break;}
- case 30 :
- {
- if (detided==2) {*carac=wMSqm; break;}
- else {verbose=0;break;}
- }
- case 31 : {*carac=wSsa; break;}
- case 32 : {*carac=wSa; break;}
- case 33 :
- {
- if (detided==2) {*carac=wMSm; break;}
- else {verbose=0;break;}
- }
- case 34 : {*carac=wMSf; break;}
- case 35 : {*carac=wMqm; break;}
- case 36 : {*carac=wMStm; break;}
-
-/*-----------------------------*/
- case 37 : {*carac=wM4; break;}
- case 38 : {*carac=wMS4; break;}
- case 39 : {*carac=wMN4; break;}
- case 40 : {*carac=wS4; break;}
- case 41 : {*carac=wN4; break;}
-
-/*-----------------------------*/
- case 42 : {*carac=wS1; break;}
-
- default : verbose=0;}/*switch*/
-
-
-return(verbose);
-
-
-}/*end*/
-
-
-
-/*####################################################*/
-/* */
-/* init the coef for the splien admittance */
-/* */
-/* Thierry LETELLIER 04Oct2005 */
-/* */
-/*####################################################*/
-
-void init_admittance_coeff(int *sindice,int *aindice,int *nb,int GROUPE)
-{
- switch(GROUPE)
- {
- case SEMI_DIURNAL :
- {
- sindice[0]=2;
- sindice[1]=3;
- sindice[2]=9;
- aindice[0]=14;
- aindice[1]=15;
- aindice[2]=16;
- aindice[3]=17;
- aindice[4]=18;
- aindice[5]=19;
- aindice[6]=20;
- *nb=7;
- break;
- }
- case DIURNAL :
- {
- sindice[0]=1;
- sindice[1]=10;
- sindice[2]=12;
- aindice[0]=21;
- aindice[1]=22;
- aindice[2]=23;
- aindice[3]=24;
- aindice[4]=25;
- aindice[5]=26;
- aindice[6]=27;
- aindice[7]=28;
- aindice[8]=29;
- aindice[9]=30;
- *nb=10;
- break;
- }
- case LONG :
- {
- sindice[0]=5;
- sindice[1]=6;
- sindice[2]=8;
- aindice[0]=31;
- aindice[1]=32;// LR, modif: 2008/12/18
- aindice[2]=33;// LR, modif: 2008/12/18
- aindice[3]=34;// LR, modif: 2008/12/18
- *nb=4;
- break;
- }
- }
-
-}
diff --git a/modules/fes2004/fes2004_io.c b/modules/fes2004/fes2004_io.c
deleted file mode 100644
index 8bb8215..0000000
--- a/modules/fes2004/fes2004_io.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <netcdf.h>
-#include "fes2004_lib.h"
-
-
-/*####################################################*/
-/* */
-/* load the FES2004 data from FES2004.nc */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-void load_netcdf_fes2004_data(char *filename,mega_struct *P,int CPU)
-{
-
-
- int i,rstatus;
-
- for(i=0;i<CPU;i++)
- {
- rstatus=nc_open( filename, NC_NOWRITE,&P[i].ncid );
- // if (rstatus != NC_NOERR) handle_error(rstatus);
- }
-}
diff --git a/modules/fes2004/fes2004_kernel.c b/modules/fes2004/fes2004_kernel.c
deleted file mode 100644
index b51f665..0000000
--- a/modules/fes2004/fes2004_kernel.c
+++ /dev/null
@@ -1,1277 +0,0 @@
-#include <netcdf.h>
-#include "fes2004_lib.h"
-
-//#define H_THREAD
-//
-// Uncomment this define to compile with the multithread option
-
-
-/*####################################################*/
-/* */
-/* */
-/* running the multithread prediction */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-void multi_t_prediction(int nocycle, int CPU, mega_struct *P)
-{
-
-#ifdef H_THREAD
- pthread_t *tid;
-#endif
-
- int cnt,i;
-
-#ifdef H_THREAD
- tid=malloc(CPU*sizeof(pthread_t));
- printf("starting a multithread prediction on %d processors \n",CPU);
-#endif
- cnt=0;
- while(cnt<nocycle)
- {
- for(i=0;i<CPU;i++)
- {
- P[i].cnt=cnt;
-#ifdef H_THREAD
- pthread_create(&tid[i], NULL,pred_coeur,(void *)&(P[i]));
-#else
- pred_coeur( (void *)&(P[i]) );
-#endif
- cnt++;
- }
-#ifdef H_THREAD
- for (i=0;i<CPU;i++)pthread_join(tid[i], NULL);
-#endif
-
- if(CPU>(nocycle-cnt))CPU=nocycle-cnt;
- }/* end loop on AT points*/
-}
-
-
-/*####################################################*/
-/* */
-/* */
-/* running the multithread extraction */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-void multi_t_extraction(int nocycle, int CPU, mega_struct *P)
-{
-
-#ifdef H_THREAD
- pthread_t *tid;
-#endif
- int cnt,i;
-
-#ifdef H_THREAD
- tid=malloc(CPU*sizeof(pthread_t));
- printf("starting a multithread extraction on %d processors \n",CPU);
-#endif
- cnt=0;
- while(cnt<nocycle)
- {
- for(i=0;i<CPU;i++)
- {
- P[i].cnt=cnt;
-#ifdef H_THREAD
- pthread_create(&tid[i], NULL,extract_coeur,(void *)&(P[i]));
-#else
- extract_coeur( (void *)&(P[i]) );
-#endif
- cnt++;
- }
-#ifdef H_THREAD
- for (i=0;i<CPU;i++)pthread_join(tid[i], NULL);
-#endif
- if(CPU>(nocycle-cnt))CPU=nocycle-cnt;
- }/* end loop on AT points*/
-}
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* the thread prediction function */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void * pred_coeur(void *input)
-{
- int i,cnt;
- mega_struct *P;
- double lat,lon,decal_lat,decal_lon;
-
- size_t start[3],count[3];
- int indice_y,indice_x,rstatus;
- double pi;
-
- double prediction;
-
- //THE FAMOUS PI
- pi=acos(-1.0);
-
- //simplifie the variables name
- P=(mega_struct *) input;
- cnt=P->cnt;
- lat=P->lat[cnt];
- lon=P->lon[cnt];
-
- //to recale lat with the indice I must :
- decal_lat=lat+90;
- if(lon<0.0) decal_lon=360.0+lon; else decal_lon=lon;
-
-
- //find the indice in the data tab
- indice_x=(int) floor( decal_lon/(RESOLUTION) );
- indice_y=(int) floor( decal_lat /(RESOLUTION) );
-
- //configure the loading parameters
- start[0]=0;start[1]=indice_y;start[2]=indice_x;
- count[0]=14;count[1]=2;count[2]=2;
-
- //load data
- rstatus=nc_get_vara_float(P->ncid,3,start,count,P->data_amp );
- rstatus=nc_get_vara_float(P->ncid,4,start,count,P->data_phi );
-
- //interpolation
- rstatus=interpolation_w_mask(decal_lon,decal_lat,indice_x,indice_y,P->weight,P->data_amp);
-
- if(rstatus==-99)
- {
- P->Otide[cnt]=MASK;
- return input;
- }
-
- //initialisation of the prediction output
- P->Otide[cnt]=0;
-
- //prediction
- for(i=0;i<4;i++)
- {
- if(P->weight[i]!=0.0)
- {
- prediction=predic_and_admit(P->data_amp,P->data_phi,i,P,lat,lon);
- P->Otide[cnt]+=P->weight[i]*prediction;
- }
- }
- return input;
-}/*fin de pred_coeur*/
-
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* the thread prediction function */
-/* */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-void * extract_coeur(void *input)
-{
- int i,j,cnt;
- mega_struct *P;
- double lat,lon,decal_lat,decal_lon;
-
- size_t start[3],count[3];
- int indice_y,indice_x,rstatus;
- double pi;
-
- //THE FAMOUS PI
- pi=acos(-1.0);
-
- //simplifie the variables name
- P=(mega_struct *) input;
- cnt=P->cnt;
- lat=P->lat[cnt];
- lon=P->lon[cnt];
-
- //to recale lat with the indice I must :
- decal_lat=lat+90;
- if(lon<0.0) decal_lon=360.0+lon; else decal_lon=lon;
-
-
- //find the indice in the data tab
- indice_x=(int) floor( decal_lon/(RESOLUTION) );
- indice_y=(int) floor( decal_lat /(RESOLUTION) );
-
- //configure the loading parameters
- start[0]=0;start[1]=indice_y;start[2]=indice_x;
- count[0]=14;count[1]=2;count[2]=2;
-
- //load data
- rstatus=nc_get_vara_float(P->ncid,3,start,count,P->data_amp );
- rstatus=nc_get_vara_float(P->ncid,4,start,count,P->data_phi );
-
- //interpolation
- rstatus=interpolation_w_mask(decal_lon,decal_lat,indice_x,indice_y,P->weight,P->data_amp);
-
- if(rstatus==-99)
- {
- for(i=0;i<14;i++)
- {
- P->amplitude[cnt][i]=MASK;
- P->phase[cnt][i]=MASK;
- }
- return input;
- }
-
- //extraction
-
- for(i=0;i<14;i++)
- {
-
- for(j=0;j<4;j++)
- {
- if(i==4) //the M4 case//
- {
- if((P->data_amp[i*4+j]!=MASK)&&(P->data_amp[i*4+j]==MASK) )
- {
- P->amplitude[cnt][i]=MASK; //M4 has a different Mask
- P->phase[cnt][i]=MASK;
- } //M4 has a different Mask
- }
- else
- {
- P->amplitude[cnt][i]+=P->data_amp[i*4+j]*P->weight[j];
- P->phase[cnt][i]+=P->data_phi[i*4+j]*P->weight[j];
- }
-
- }
-
- }
- return input;
-}/*fin de extract_coeur*/
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* the prediction and admittance function */
-/* */
-/* */
-/* Thierry LETELLIER 04Oct2005 */
-/* */
-/*####################################################*/
-
-double predic_and_admit(float *data_amp,float *data_phi,int pt,mega_struct *P,double lat,double lon)
-{
- int i;
- double ampli,phase;
- double prediction=0;
- double Amp,G;
- for(i=0;i<14;i++)
- {
- ampli=data_amp[i*4+pt];
- if(ampli==MASK)
- {
- // printf("wave %s is masked --> not inclued in prediction\n lat : %lf --- lon : %lf\n", P->spectrum[i].wave.name,lat,lon);
- P->spectrum[i].prediction=0;
- }
- else
- {
- phase=data_phi[i*4+pt];
- //going the complex space
- P->spectrum[i].Z.reel=ampli*cos(phase*-1.0*3.14/180.0);
- P->spectrum[i].Z.imag=ampli*sin(phase*-1.0*3.14/180.0);
- //prediction !!!!
- P->spectrum[i].prediction=Tide_prediction(P->time[P->cnt],P->spectrum[i].wave,P->spectrum[i].Z,0,P->CTO);
- }
- }
- /*------------------------------------------------------------------------------*/
- /* spline admittance coefficients for semi-diurnal tidal waves */
- /*------------------------------------------------------------------------------*/
- // compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, SEMI_DIURNAL,P->sindice,P->aindice); LR, change: 2008/12/17
- compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, SEMI_DIURNAL,P->sindice,P->aindice,P->time[P->cnt]);
-
- /*------------------------------------------------------------------------------*/
- /* spline admittance coefficients for diurnal tidal waves */
- /*------------------------------------------------------------------------------*/
- // compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, DIURNAL,P->sindice,P->aindice); LR, change: 2008/12/17
- compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, DIURNAL,P->sindice,P->aindice,P->time[P->cnt]);
-
- /*------------------------------------------------------------------------------*/
- /* spline admittance coefficients for long period tidal waves */
- /*------------------------------------------------------------------------------*/
- // compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, LONG,P->sindice,P->aindice); LR, change: 2008/12/17
- compute_admittance(P->Mat,P->Perm,P->sec_r,P->sec_i,P->res_r,P->res_i,P->spectrum, LONG,P->sindice,P->aindice,P->time[P->cnt]);
-
- /*------------------------------------------------------------------------------*/
- /* compute prediction for Ssa tidal wave */
- /*------------------------------------------------------------------------------*/
- tidal_potential( P->spectrum[35].wave, lat, lon, &Amp, &G,0 );
- P->spectrum[35].Z.reel=Amp*cos(G);
- P->spectrum[35].Z.imag=Amp*sin(G);
- P->spectrum[35].prediction=Tide_prediction(P->time[P->cnt],P->spectrum[34].wave,P->spectrum[34].Z,0,P->CTO);
-
- for(i=0;i<36;i++)prediction+=P->spectrum[i].prediction;
- return(prediction);
-
-}
-
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* an simple interpolation funtion */
-/* */
-/* it take in account the mask */
-/* */
-/* Thierry LETELLIER 04Oct2005 */
-/* */
-/*####################################################*/
-
-int interpolation_w_mask(double lon,double lat,int indice_x,int indice_y,double *weight,float *data_amp)
-{
- int i,nb_data;
- int mask_true[4],redo;
- double surface;
- //DEBUG
- double somme;
-
- nb_data=4;
- //init mask_true
- for(i=0;i<4;i++)mask_true[i]=1;
-
- for(i=0;i<4;i++){if(data_amp [i]==MASK) {mask_true[i]=0; nb_data--; } }
-
- redo=1;
- while(redo==1)
- {
- switch (nb_data)
- {
- case 0 :
- {
- return(-99);
- break;
- }
- case 1 :
- {
- for(i=0;i<4;i++)weight[i]=1.00*mask_true[i];
- redo=0;
- break;
- }
- case 2 :
- {
- weight[0]=geo_d_km(lon,lat,indice_x*RESOLUTION,indice_y*RESOLUTION) * mask_true[0];
- weight[1]=geo_d_km(lon,lat,(indice_x+1)*RESOLUTION,indice_y*RESOLUTION) * mask_true[1];
- weight[2]=geo_d_km(lon,lat,indice_x*RESOLUTION,(indice_y+1)*RESOLUTION) * mask_true[2];
- weight[3]=geo_d_km(lon,lat,(indice_x+1)*RESOLUTION,(indice_y+1)*RESOLUTION) * mask_true[3];
- redo=0;
- break;
- }
- case 3 :
- {
- surface=RESOLUTION*RESOLUTION;
- somme=( (indice_x+1)*RESOLUTION - lon )*((indice_y+1)*RESOLUTION - lat);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[0]=surface*somme;
-
- somme=( lon - indice_x*RESOLUTION )*((indice_y+1)*RESOLUTION - lat);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[1]=surface*somme;
-
- somme=( (indice_x+1)*RESOLUTION - lon )*(lat - indice_y*RESOLUTION);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[2]=surface*somme;
-
- somme=( lon - indice_x*RESOLUTION )*(lat - indice_y*RESOLUTION);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[3]=surface*somme;
- redo=0;
-
- break;
- }
- case 4 :
- {
- surface=RESOLUTION*RESOLUTION;
- somme=( (indice_x+1)*RESOLUTION - lon )*((indice_y+1)*RESOLUTION - lat);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[0]=surface*somme;
-
- somme=( lon - indice_x*RESOLUTION )*((indice_y+1)*RESOLUTION - lat);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[1]=surface*somme;
-
- somme=( (indice_x+1)*RESOLUTION - lon )*(lat - indice_y*RESOLUTION);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[2]=surface*somme;
-
- somme=( lon - indice_x*RESOLUTION )*(lat - indice_y*RESOLUTION);
- if(somme==0){mask_true[0]=0;nb_data--;break;}
- weight[3]=surface*somme;
- redo=0;
- break;
- }
- }
-
- }
- surface=weight[0]+weight[1]+weight[2]+weight[3];
-
- weight[0]/=surface;
- weight[1]/=surface;
- weight[2]/=surface;
- weight[3]/=surface;
-
- //DEBUG
- somme=weight[0]+weight[1]+weight[2]+weight[3];
-
- return(0);
-
-}
-
-
-
-
-/*####################################################*/
-/* */
-/* */
-/* compute the admittance to extend */
-/* the prediction spectrum */
-/* */
-/* Thierry LETELLIER 04Oct2005 */
-/* */
-/*####################################################*/
-
-void compute_admittance(gsl_matrix *Mat,gsl_permutation *Perm,gsl_vector *sec_r,gsl_vector *sec_i,gsl_vector *res_r,gsl_vector *res_i,spectrum_struct *spectrum,int GROUPE,int *sindice ,int *aindice, double time)
-{
-
- int i,n,gsl_out;
- double d2r,tau;
- int signum;
- double omega;
- int nb;
-
- d2r=pi/180.0;
- tau=2*24;
- n=0;
-
- init_admittance_coeff(sindice,aindice,&nb,GROUPE);
-
- for(i=0;i<3;i++)
- {
- omega=pulsation(spectrum[sindice[i]].wave);
- gsl_matrix_set(Mat,n,0,cos(tau*omega*d2r)*spectrum[sindice[i]].wave.Ap);
- gsl_matrix_set(Mat,n,1,sin(tau*omega*d2r)*spectrum[sindice[i]].wave.Ap);
- gsl_matrix_set(Mat,n,2,spectrum[sindice[i]].wave.Ap);
- gsl_vector_set(sec_r,n,spectrum[sindice[i]].Z.reel);
- gsl_vector_set(sec_i,n,spectrum[sindice[i]].Z.imag);
- n++;
- }
- gsl_out=gsl_linalg_LU_decomp(Mat,Perm,&signum);
- gsl_out=gsl_linalg_LU_solve(Mat,Perm,sec_r,res_r);
- gsl_out=gsl_linalg_LU_solve(Mat,Perm,sec_i,res_i);
-
- for(i=0;i<nb;i++)
- {
- omega=pulsation(spectrum[aindice[i]].wave);
-
- spectrum[aindice[i]].Z.reel=(gsl_vector_get(res_r,0)*cos(tau*omega*d2r)+gsl_vector_get(res_r,1)*sin(tau*omega*d2r)+gsl_vector_get(res_r,2))*spectrum[aindice[i]].wave.Ap;
- spectrum[aindice[i]].Z.imag=(gsl_vector_get(res_i,0)*cos(tau*omega*d2r)+gsl_vector_get(res_i,1)*sin(tau*omega*d2r)+gsl_vector_get(res_i,2))*spectrum[aindice[i]].wave.Ap;
- spectrum[aindice[i]].prediction=Tide_prediction(time,spectrum[aindice[i]].wave,spectrum[aindice[i]].Z,0,spectrum[aindice[i]].CTO);
- }
-
-}
-
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
- double geo_d_km(double t1,double p1,double t2,double p2)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-{
- double dt,dp;
- double a1,a2,b1,b2,ux,uy,uz,vx,vy,vz,pds,angle;
- double ro;
- double pi=3.14159265358979323846;
-
- double dtr=pi/180.0;
-
-
- dt=t2-t1;
- dp=p2-p1;
-
- if ((dt == 0.0) && (dp == 0.0)) return(0.);
-
- a1=t1*dtr;
- b1=p1*dtr;
- a2=t2*dtr;
- b2=p2*dtr;
-
- ux=cos(a1)*cos(b1);
- uy=sin(a1)*cos(b1);
- uz=sin(b1);
- vx=cos(a2)*cos(b2);
- vy=sin(a2)*cos(b2);
- vz=sin(b2);
-
- pds=ux*vx+uy*vy+uz*vz;
-
- if(pds < 1.0)
- {
- angle=acos(pds);
- /* Conversion real double de geo_mean_radius*/
- ro=(double)(6400.*angle);
- return(ro);
- }
- else return(0.);
-
-}
-
-
-
-
-
-
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-
-
-
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-
-
-
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-
-// the next functions are a part of the Aktarus tide library developped
-// By Thierry LETELLIER [LEGOS]
-// and Laurent ROBLOU [Noveltis]
-//
-// These functions are the prediction kernel YOU DON'T NEED TO CHANGE THEM ...
-// ----------------------------------
-
-// You don't have the right to use these functions in other programs than the FES2004 prediction
-// If you want more information please contact --- thierry.letellier at free.fr ---
-
-
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-//##############################################################################################################################
-
-
-
-
-
-
-double Tide_prediction(double time,tidal_wave wave,fcomplex Z,int verbose,int CTO)
-/*---------------------------------------------------------------*/
-/* The prediction is made from a true complex, */
-/* Z = (A cos(-G), A sin(-G) ) */
-/*---------------------------------------------------------------*/
-{
- double V,f,ret;
- astro_ang_struct astro_ang;
-
- init_argument(time,verbose,CTO,&astro_ang);
- V=greenwhich_argument(wave,&astro_ang)+nodal_phase(wave,&astro_ang);
- f=nodal_factort(wave.formula,&astro_ang);
-
- ret=f*(cos(V)*Z.reel-sin(V)*Z.imag);
- return(ret);
-}
-
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
- void init_argument(double first_time, int verbose, int CTO,astro_ang_struct *astro_ang)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-{
- int N;
-
- date_t t_schureman={1,1,1900,0.0}; /* LR: 21/07/2003, -43200 -> 0 */
- date_t date58= { 1, 1, 1958, 0.0};/* LR: 21/07/2003, -43200 -> 0 */
- date_t date50= { 1, 1, 1950, 0.0};/* LR: 21/07/2003, -43200 -> 0 */
- date_t date85= { 1, 1, 1985, 0.0};/* LR: 21/07/2003, -43200 -> 0 */
- date_t date2000= { 1, 1, 2000, 0.0};/* LR: 21/07/2003, -43200 -> 0 */
- date_t date;
- double tj;
-
-
- switch (CTO)
- {
- case(0): {date =date50;break;}
- case(1): {date =date58;break;}
- case(2): {date =date85;break;}
- case(3): {date =date2000;break;}
- default: {printf("error in time reference, exit\n");exit(22);}
- }
-
- N= julian_day(date.month,date.day,date.year)
- -julian_day(t_schureman.month,t_schureman.day,t_schureman.year);
- /* number of day elapsed between 1950 and 1900 (CNES Time and SCHUREMAN Time) */
- /*or number of day elapsed between 1958 and 1900 (CTO Time and SCHUREMAN Time) */
- /*or number of day elapsed between 1985 and 1900 (ESA Time and SCHUREMAN Time) */
-
- tj=((double) N + first_time/(double) 24.) /(double) 36525.0;
-
- astronomic_angle(tj,verbose,astro_ang);
-
-}
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
- void astronomic_angle(double tj, int verbose, astro_ang_struct *astro_ang)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-
-/*----------------------------------------------------------------------
-
- tj is time elapsed since 1st January 1900, 0 hour, counted in julian
- century (e.g. time in days divide by 36525)
-----------------------------------------------------------------------*/
-
-{
- double dtr,days,tt;
- date_t actual;
- double cosI,p,q;
- double t2,t4,sin2I,s2;
- double tgI2,P;
- double sh_tgn2,at1,at2;
-
- pi=acos(-1.0);
- dtr=pi/180.0;
-
-/*----------------------------------------------------------------------
- Sh_n Longitude of ascending lunar node
-----------------------------------------------------------------------*/
-
- astro_ang->sh_N=(259.1560563 -1934.1423972 *tj)*dtr;
-
-/*----------------------------------------------------------------------
- T mean solar angle (Greenwhich time)
-----------------------------------------------------------------------*/
- days=36525.0*tj;
- astro_ang->sh_T=((days - (int)days)*24.0*15.0+180.0)*dtr;
-
-/*----------------------------------------------------------------------
- h mean solar Longitude
-----------------------------------------------------------------------*/
-
- astro_ang->sh_h=(280.1895015 +36000.76892 *tj)*dtr;
-
-/*----------------------------------------------------------------------
- s mean lunar Longitude
-----------------------------------------------------------------------*/
-
- astro_ang->sh_s=(277.0256206 +481267.892 *tj)*dtr;
-
-/*----------------------------------------------------------------------
- p1 Longitude of solar perigee
-----------------------------------------------------------------------*/
-
- astro_ang->sh_p1=(281.2208568 +1.719175 *tj)*dtr;
-
-/*----------------------------------------------------------------------
- p Longitude of lunar perigee
-----------------------------------------------------------------------*/
-
- astro_ang->sh_p=(334.3837214 +4069.0322056 *tj)*dtr;
-
- astro_ang->sh_N =fmod(astro_ang->sh_N ,2*pi);
- astro_ang->sh_s =fmod(astro_ang->sh_s ,2*pi);
- astro_ang->sh_h =fmod(astro_ang->sh_h, 2*pi);
- astro_ang->sh_p =fmod(astro_ang->sh_p, 2*pi);
- astro_ang->sh_p1=fmod(astro_ang->sh_p1,2*pi);
-
- cosI=0.913694997 -0.035692561 *cos(astro_ang->sh_N);
-
- astro_ang->sh_I=acos(cosI);
-
- sin2I=sin(astro_ang->sh_I);
- sh_tgn2=tan(astro_ang->sh_N/2.0);
-
- at1=atan(1.01883*sh_tgn2);
- at2=atan(0.64412*sh_tgn2);
-
- astro_ang->sh_xi=-at1-at2+astro_ang->sh_N;
-
- if (astro_ang->sh_N > pi) astro_ang->sh_xi=astro_ang->sh_xi-2.0*pi;
-
- astro_ang->sh_nu=at1-at2;
-
-/*----------------------------------------------------------------------
- For constituents l2 k1 k2
-----------------------------------------------------------------------*/
-
- tgI2=tan(astro_ang->sh_I/2.0);
- P=astro_ang->sh_p-astro_ang->sh_xi;
-
- t2=tgI2*tgI2;
- t4=t2*t2;
- astro_ang->sh_x1ra=sqrt(1.0-12.0*t2*cos(2.0*P)+36.0*t4);
-
- p=sin(2.0*P);
- q=1.0/(6.0*t2)-cos(2.0*P);
- astro_ang->sh_R=atan(p/q);
-
- p=sin(2.0*astro_ang->sh_I)*sin(astro_ang->sh_nu);
- q=sin(2.0*astro_ang->sh_I)*cos(astro_ang->sh_nu)+0.3347;
- astro_ang->sh_nuprim=atan(p/q);
-
- s2=sin(astro_ang->sh_I)*sin(astro_ang->sh_I);
- p=s2*sin(2.0*astro_ang->sh_nu);
- q=s2*cos(2.0*astro_ang->sh_nu)+0.0727;
- astro_ang->sh_nusec=0.5*atan(p/q);
-
- tt=(tj*36525.-18262)*24;
- getcnesdate(tt,&actual);
-
-
- if (verbose)
- {
- printf ("%d/%d/%d \n",actual.day,actual.month,actual.year);
- printf ("s: %f h: %f p: %f p1: %f \n",astro_ang->sh_s/dtr,astro_ang->sh_h/dtr,astro_ang->sh_p/dtr,astro_ang->sh_p1/dtr);
- printf ("I: %f N: %f \n",astro_ang->sh_I/dtr,astro_ang->sh_N/dtr);
- }
-
-}
-
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
- double greenwhich_argument(tidal_wave w,astro_ang_struct *astro_ang)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-/*----------------------------------------------------------------------
-
- Returns the phase of the tidal potential relative to the Greenwhich
- meridian (e.g. the position of the fictuous celestial body). Units are
- radian.
-
-----------------------------------------------------------------------*/
-
-{
- double V0;
-
- V0=astro_ang->sh_T*w.nT+astro_ang->sh_s*w.ns+astro_ang->sh_h*w.nh+astro_ang->sh_p*w.np+astro_ang->sh_p1*w.np1+w.shift*deg_to_rad;
- V0=fmod(V0,pi2);
- return(V0);
-
-}
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
- double nodal_phase(tidal_wave w,astro_ang_struct *astro_ang)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-/*----------------------------------------------------------------------
-
- Returns the phase correction u due to nodal motion. Units are radian.
-
-----------------------------------------------------------------------*/
-
-{
- double u;
-
- u=astro_ang->sh_xi*w.nksi+astro_ang->sh_nu*w.nnu0+astro_ang->sh_nuprim*w.nnu1+astro_ang->sh_nusec*w.nnu2+astro_ang->sh_R*w.R;
- return(u);
-
-}
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-int julian_day(int mm,int id,int iyyy)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-/*-----------------------------------------------------------------------
- tides_julianday routine returns the julian day number which begins at noon
- of the calendar date specified by month mm, day id, and year iyyy.
- positive year signifies a.d.; negative, b.c. (remember that the
- year after 1 b.c. was 1 a.d.
- this routine has been lifted directly from the book
- press et al., numerical recipes, cambridge univ. press, 1986.
- routine handles changeover to gregorian calendar on oct. 15, 1582.
- note: to get the corresponding modified julian day,
- set mjd = julday - 2400001.
-
- f77 to C: 7/10/2001 (Thierry)
------------------------------------------------------------------------*/
-
- {
- int igreg=15+31*(10+12*1582);
- int jy,jm,ja, tmp_iyyy;
- double temp_tides_juliandays = 0.;
-
- tmp_iyyy=iyyy;
-
- if (tmp_iyyy != 0)
-/* if (tmp_iyyy == 2000) printf("Probleme avec le passage a l annee 2000"); */
-/* else */
- {
- if (tmp_iyyy < 0) tmp_iyyy = tmp_iyyy + 1;
- if (mm > 2)
- {
- jy = tmp_iyyy;
- jm = mm + 1;
- }
- else
- {
- jy = tmp_iyyy - 1;
- jm = mm + 13;
- }
- temp_tides_juliandays=floor(365.25*jy)+floor(30.6001*jm)+id+1720995;
- if(id+31*(mm+12*tmp_iyyy) >= igreg)
- {
- ja=floor(0.01*jy);
- temp_tides_juliandays=temp_tides_juliandays+2-ja+floor(0.25*ja);
- }
- }/*else*/
-
- return(temp_tides_juliandays);
-
- }/*end*/
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-double nodal_factort(int formula, astro_ang_struct *astro_ang)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-{
- double s,f=0.;
-
- switch (formula)
- {
-
-/* formule 0, solar waves */
-
- case 0:
- f=1.0;
- break;
-
-/* formule 1, compound waves (78 x 78)*/
-
- case 1:
- f=nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang);
- break;
-
-/* formule 2, compound waves (78 x 0) === (78)*/
-
- case 2:
- f=nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-
-
-/* formule 4, compound waves (78 x 235) */
-
- case 4:
- f=nodal_factort(78,astro_ang)*nodal_factort(235,astro_ang);
- break;
-
-
-/* formule 5, compound waves (78 *78 x 235) */
-
- case 5:
- f=nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang)*nodal_factort(235,astro_ang);
- break;
-
-/* formule 6, compound waves (78 *78 x 0) */
-
- case 6:
- f=nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 7, compound waves (75 x 75)*/
-
- case 7:
- f=nodal_factort(75,astro_ang)*nodal_factort(75,astro_ang);
- break;
-
-/* formule 8, compound waves (78 x 0 x 235) */
-
- case 8:
- f=nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang)*nodal_factort(235,astro_ang);
- break;
-
-/* formule 9, compound waves (78 x 0 x 227) */
-
- case 9:
- f=nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang)*nodal_factort(227,astro_ang);
- break;
-
-/* formule 10, compound waves (78 x 227) */
-
- case 10:
- f=nodal_factort(78,astro_ang)*nodal_factort(227,astro_ang);
- break;
-
-/* formule 11, compound waves (75 x 0) */
-
- case 11:
- f=nodal_factort(75,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 12, compound waves (78 x 78 x 78 x 0) */
-
- case 12:
- f=nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 13, compound waves (78 x 75)*/
-
- case 13:
- f=nodal_factort(78,astro_ang)*nodal_factort(75,astro_ang);
- break;
-
-/* formule 14, compound waves (235 x 0) === (235)*/
-
- case 14:
- f=nodal_factort(235,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 15, compound waves (235 x 75) */
-
- case 15:
- f=nodal_factort(235,astro_ang)*nodal_factort(75,astro_ang);
- break;
-
-/* formule 16, compound waves (78 x 0 x 0) === (78)*/
-
- case 16:
- f=nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 17, compound waves (227 x 0) */
-
- case 17:
- f=nodal_factort(227,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-/* formule 18, compound waves (78 x 78 x 78 ) */
-
- case 18:
- f=nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang)*nodal_factort(78,astro_ang);
- break;
-
-/* formule 19, compound waves (78 x 0 x 0 x 0) === (78)*/
-
- case 19:
- f=nodal_factort(78,astro_ang)*nodal_factort(0,astro_ang)*nodal_factort(0,astro_ang);
- break;
-
-
-/* formule 73 */
-
- case 73:
- s=sin(astro_ang->sh_I);
- f=(2./3.-s*s)/0.5021;
- break;
-
-/* formule 74 */
-
- case 74:
- s=sin(astro_ang->sh_I);
- f=s*s/0.1578;
- break;
-
-/* formule 75 */
-
- case 75:
- s=cos (astro_ang->sh_I/2);
- f=sin (astro_ang->sh_I)*s*s/0.3800;
- break;
-
-/* formule 76 */
-
- case 76:
- f=sin (2*astro_ang->sh_I)/0.7214;
- break;
-
-/* formule 77 */
-
- case 77:
- s=sin (astro_ang->sh_I/2);
- f=sin (astro_ang->sh_I)*s*s/0.0164;
- break;
-
-/* formule 78 */
-
- case 78:
- s=cos (astro_ang->sh_I/2);
- f=s*s*s*s/0.9154;
- break;
-
-/* formule 79 */
-
- case 79:
- s=sin(astro_ang->sh_I);
- f=s*s/0.1565;
- break;
-
-/* formule 144 */
-
- case 144:
- s=sin (astro_ang->sh_I/2);
- f=(1-10*s*s+15*s*s*s*s)*cos(astro_ang->sh_I/2)/0.5873;
- break;
-
-/* formule 149 */
-
- case 149:
- s=cos (astro_ang->sh_I/2);
- f=s*s*s*s*s*s/0.8758;
- break;
-
-/* formule 215 */
-
- case 215:
- s=cos (astro_ang->sh_I/2);
- f=s*s*s*s/0.9154*astro_ang->sh_x1ra;
- break;
-
-/* formule 227 */
-
- case 227:
- s=sin (2*astro_ang->sh_I);
- f=sqrt (0.8965*s*s+0.6001*s*cos (astro_ang->sh_nu)+0.1006);
- break;
-
-/* formule 235 */
-
- case 235:
- s=sin (astro_ang->sh_I);
- f=sqrt (19.0444*s*s*s*s+2.7702*s*s*cos (2*astro_ang->sh_nu)+.0981);
- break;
-
-
- default:
- exit (1);
- }
- return(f);
-}
-/*-----------------------------------------------------------------------*/
-
-void calendary(int njd,date_t *actual)
-
-/*-----------------------------------------------------------------------*/
-
-{
- int njul,nj,nb,nm1,nj3,m,j,ndj;
- int na,nm,nd;
- int n[12]= {31,28,31,30,31,30,31,31,30,31,30,31};
-
-/*-----------------------------------------------------------------------
-! Input = njd: nombre ecoules depuis le 1er Janvier 1950, 0 heure
-! Output= nd,nm,na: jour, mois annee calendaire
-!-----------------------------------------------------------------------*/
-
- njul=njd+1;
- na=njul/365;
- nj=njul-na*365;
- nb=(na+1)/ 4;
- nj=nj-nb;
-
- if (nj > 0) goto a1;
-
- na=na+1949;
- nm=12;
- nd=nj+31;
- goto a9000;
-
- a1:
- j=na-2-nb*4;
- na=na+1950;
-
- if (j < 0) goto a5000;
-
- if (60-nj < 0) goto a4500;
- if (60-nj == 0) goto a7000;
- goto a5000;
-
- a4500:
- nm1=60;
-
- m=3;
- goto a6000;
-
- a5000:
- nm1=0;
-
- m=1;
-
- a6000:
- ndj=nm1+n[m-1];
-
- nj3=nj-ndj;
-
- if (nj3 <= 0) goto a8000;
-
- m=m+1;
-
- nm1=ndj;
- goto a6000;
-
- a7000:
- nm=2;
-
- nd=29;
-
- goto a9000;
-
- a8000:
- nm=m;
-
- nd=nj-nm1;
-
- a9000:
- actual->year=na;
- actual->month=nm;
- actual->day=nd;
- actual->second=0;
-
-}
-
-/*-------------------------------------------*/
-
-void getcnesdate(double t,date_t *actual)
-
-/*-------------------------------------------*/
-{
- int nday;
- float second;
-
-/* t is time elapsed from 1/1/1950 in hours */
-
- nday=floor(t/24.0);
-
- calendary(nday,actual);
- second=(t-nday*24)*3600.;
- actual->second=second;
-}
-
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-
-double pulsation( tidal_wave wave)
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
-/* redundant with tide_wavearray_initC */
-
-{
- double scale=36525*24.0;
- double omega;
-
-
-double omega_T= 13149000.0;
-double omega_s= 481267.892;
-double omega_h= 36000.76892;
-double omega_p= 4069.0322056;
-double omega_p1= 1.719175;
-
- omega = omega_T * wave.nT
- + omega_s * wave.ns
- + omega_h * wave.nh
- + omega_p * wave.np
- + omega_p1* wave.np1;
- omega /= scale;
- return(omega);
-}
-
-
-/*--------------------------------------------------------------------------------*/
-
-void tidal_potential(tidal_wave wave,double lat,double lon, double *Amp, double *G,int terrestre)
-
-/*--------------------------------------------------------------------------------*/
-{
- float k2=0.3,h2=0.6;
- double C,S,a,dV,pi,dtr;
-
- pi=acos(-1.0);
- dtr=pi/180.0;
-
- if (terrestre) a=wave.Ap*h2;
- else a=wave.Ap*(1+k2-h2);
- switch (wave.nT)
- {
- case (0):
-
-/*######################### Long period tide #########################
-
- potential/g = A*(1/2 -3/2 sin^2(Y)*cos(w*t+V0)
-
- dP/dx= 0
- dP/dy= -3*A*cos(Y)sin(Y)*cos(w*t+V0)
-
-----------------------------------------------------------------------*/
- dV=0.0;
- C=cos(lat*dtr);
- S=sin(lat*dtr);
- *Amp = a*(0.5-1.5*S*S)/100;
- *G = -dV*dtr;
- break;
-
- case (1):
-
-/*########################### Diurnal tide ###########################
-
- potential/g = A*sin(2Y)*cos(w*t+V0+X)
-
-----------------------------------------------------------------------*/
-
- dV=lon;
- C=cos(lat*dtr);
- S=sin(lat*dtr);
- *Amp = 2*a*S*C/100;
- *G = -dV*dtr;
- break;
-
- case (2):
-
-/*######################### Semi-diurnal tide #########################
-
- potential/g = A*cos^2(Y)*cos(w*t+V0+2*X)
-
-----------------------------------------------------------------------*/
-
- dV=2*lon;
- C=cos(lat*dtr);
- S=sin(lat*dtr);
- *Amp = a*C*C/100;
- *G = -dV*dtr;
- break;
-
-/*####################### non-astronomical tide #######################
- potential/g = 0
-
-----------------------------------------------------------------------*/
- default:
- break;
-
- }/*end switch */
-}/* end*/
-
diff --git a/modules/fes2004/fes2004_lib.h b/modules/fes2004/fes2004_lib.h
deleted file mode 100644
index dc1fe98..0000000
--- a/modules/fes2004/fes2004_lib.h
+++ /dev/null
@@ -1,415 +0,0 @@
-
-
-
-/*####################################################*/
-/* */
-/* Includes for the prediction program */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-// standard include //
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <strings.h>
-
-// standard multithread include //
-//#include <pthread.h>
-
-// Gnu Scientific library include //
-// www.gnu.org/software/gsl/ //
-#include <gsl/gsl_cblas.h>
-#include <gsl/gsl_linalg.h>
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_matrix.h>
-#include <gsl/gsl_permutation.h>
-
-
-/*####################################################*/
-/* */
-/* constantes definitions */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-#define coef_spline 3
-#define NB_WAVE_IN_SPECTRUM 36
-#define RESOLUTION 0.125
-#define SEMI_DIURNAL 1
-#define DIURNAL 2
-#define LONG 3
-
-#define MASK -9999.000
-
-/*####################################################*/
-/* */
-/* variables struct definitions */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-
-//wave struct contains all the tials waves parameters
-typedef struct {
- float Ap; /* specify tidal potentiel amplitude */
- int nT,ns,nh,np,np1; /* specify the main wave fequency V */
- int nksi,nnu0,nnu1,nnu2,R; /* specify nodal argument u */
- float shift; /* specify nodal argument u */
- int formula,code; /* formula index for nodal factor f + code for JMM */
- double omega; /* specify pulsation, redondant with nT,ns,nh,np,np1 */
- char name[10]; /* */
- char spec;
- int admit;
-} tidal_wave;
-
-//simple complex definition
-typedef struct
- {
- float reel,imag;
- } fcomplex;
-
-//the struct that contains all the predicted wave parameters
-typedef struct
-{
- fcomplex *buffer;
- tidal_wave wave;
- fcomplex mask,Z;
- char PATH[256];
- int rstatus, headN ,founded,CTO;
- double lat,lon,time, prediction;
-} spectrum_struct;
-
-
-
-typedef struct
-{
- double amp,phi;
-} wave_cst_struct;
-
-/* typedef struct */
-/* { */
-/* wave_cst_struct M2,M4,K1,K2,O1,P1,Q1,S2,N2,DN2,MM,MF,MTM,MSQM; */
-/* wave_cst_struct NU2,MU2,L2,T2,LA2,KJ2,R2,OO1,J1,PHI1,PI1,PSI1,RO1,SIG1,TTA1,DQ1,KI1,MSM,MSF,MQM,MSTM,SSA; */
-
-/* } fes2004_extract_struct; */
-
-
-
-
-//the multithread struct
-typedef struct
-{
- int cnt,CTO,ncid;
- double *lat,*lon,*time,*Otide;
- spectrum_struct *spectrum;
- gsl_matrix *Mat;
- gsl_vector *sec_r,*sec_i,*res_r,*res_i;
- gsl_permutation *Perm;
- //fes2004_extract_struct *constante;
- double **amplitude,**phase;
- //allocatable variable need in the thread
- float *data_amp;
- float *data_phi;
- double *weight;
- int *sindice,*aindice;
-} mega_struct;
-
-typedef struct
-{
- double sh_T,sh_h,sh_s,sh_p1,sh_p;
- double sh_xi,sh_nu,sh_R,sh_x1ra,sh_nuprim,sh_nusec;
- double sh_I,sh_N;
-}astro_ang_struct;
-
-typedef struct
-{
- int day,month,year; /* Gregorian date (define uniquely a given day) */
- float second; /* elapsed time in second from 0h00)*/
-} date_t;
-
-
-
-
-/*####################################################*/
-/* */
-/* functions prototype */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-//fes2004_alloc.c
-extern void alloc_tide_spectrum(spectrum_struct ** );
-extern void alloc_prediction_threads(mega_struct *,int );
-extern void alloc_extraction_threads(mega_struct *,int );
-extern void free_threads(mega_struct *,int );
-
-//fes2004_extraction.c
-extern int fes2004_extraction (char *,int ,double *,double *,double **,double **,int );
-
-//fes2004_prediction.c
-extern int fes2004_prediction (char *,int ,int ,double *,double *,double *,double *,int );
-
-//fes2004_io.c
-extern void load_netcdf_fes2004_data(char *,mega_struct *,int );
-
-//fes2004_init.c
-extern void in_out_file_open(char *,FILE **,FILE **);
-extern int init_spectrum(spectrum_struct *, int );
-extern void init_thread_struct(int , mega_struct *, int ,double *,double *, double *, double *, spectrum_struct *, double ** ,double **);
-extern int Wave_select(int i, tidal_wave *,int );
-extern void init_admittance_coeff(int *,int *,int *,int );
-
-//fes2004_error.c
-extern void print_error_1() ;
-extern void print_error_2() ;
-extern void print_error_3(char *) ;
-extern void print_error_4(char *) ;
-extern void print_error_5(char *) ;
-
-//fes2004_kernel.c
-extern void multi_t_prediction(int , int , mega_struct *);
-extern void multi_t_extraction(int , int , mega_struct *);
-extern void * pred_coeur(void *);
-extern void * extract_coeur(void *);
-extern double predic_and_admit(float *,float *,int ,mega_struct *,double ,double );
-extern int interpolation_w_mask(double ,double ,int ,int ,double *,float *);
-extern void compute_admittance(gsl_matrix *,gsl_permutation *,gsl_vector *,gsl_vector *,gsl_vector *,gsl_vector *,spectrum_struct *,int ,int * ,int *,double);
-extern double geo_d_km(double ,double ,double ,double );
-//##############################################################################################################################
-// the next functions are a part of the Aktarus tide library developped
-// By Thierry LETELLIER [LEGOS]
-// and Laurent ROBLOU [Noveltis]
-//
-// These functions are the prediction kernel YOU DON'T NEED TO CHANGE THEM ...
-// ----------------------------------
-
-// You don't have the right to use these functions in other programs than the FES2004 prediction
-// If you want more information please contact --- thierry.letellier at free.fr ---
-//##############################################################################################################################
-extern double Tide_prediction(double time,tidal_wave wave,fcomplex Z,int verbose,int CTO);
-extern void init_argument(double first_time, int verbose, int CTO,astro_ang_struct *astro_ang);
-extern void astronomic_angle(double tj, int verbose, astro_ang_struct *astro_ang);
-extern double greenwhich_argument(tidal_wave w,astro_ang_struct *astro_ang);
-extern double nodal_phase(tidal_wave w,astro_ang_struct *astro_ang);
-extern int julian_day(int mm,int id,int iyyy);
-extern double nodal_factort(int formula, astro_ang_struct *astro_ang);
-extern void calendary(int njd,date_t *actual);
-extern void getcnesdate(double t,date_t *actual);
-extern double pulsation( tidal_wave wave);
-extern void tidal_potential(tidal_wave wave,double lat,double lon, double *Amp, double *G,int terrestre);
-//##############################################################################################################################
-
-
-
-
-
-/*####################################################*/
-/* */
-/* waves definitions */
-/* */
-/* Thierry LETELLIER 03Oct2005 */
-/* */
-/*####################################################*/
-#ifdef LIB
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
-
- tidal_wave wmean = { 0.0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 0.0, "mean",'p',999};/*LR: code=187*/
-
- tidal_wave wSa = { 0.0000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0.0, "Sa",'p',999};
- tidal_wave wSsa = { 1.9416, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0.0, "Ssa",'p',999};
- tidal_wave wMm = { 2.2056, 0, +1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 73, 38, 0.0, "Mm",'p',999};
- tidal_wave wMSm = { 0.3094, 0, +1, -2, +1, 0, 0, 0, 0, 0, 0, 0, 73, 41, 0.0, "MSm",'p',38};/*LR: 31/03/03 */
- tidal_wave wMSf = { 0.2240, 0, +2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 73, 39, 0.0, "MSf",'p',40};/*LR: 31/03/03 */
- tidal_wave wMf = { 4.1765, 0, +2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 74, 40, 0.0, "Mf",'p',999};
- tidal_wave wMtm = { 0.8081, 0, +3, 0, -1, 0, -2, 0, 0, 0, 0, 0, 74, 42, 0.0, "Mtm",'p',999};/*LR: 24/01/02 */
- tidal_wave wMqm = { 0.0000, 0, +4, 0, -2, 0, -2, 0, 0, 0, 0, 0, 74, 43, 0.0, "Mqm",'p',999};
- tidal_wave wMStm = { 0.1147, 0, +3, -2, 1, 0, -2, 0, 0, 0, 0, 0, 74, 44, 0.0, "MStm",'p',42};/*LR: 31/03/03 */
- tidal_wave wMSqm = { 0.0667, 0, +4, -2, 0, 0, -2, 0, 0, 0, 0, 0, 74, 45, 0.0, "MSqm",'p',999};/*LR: 24/01/02 */
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wO1 = {10.0573, +1, -2, +1, 0, 0, +2, -1, 0, 0, 0, +90, 75, 1, 0.0, "O1",'p',999};
- tidal_wave wQ1 = { 1.9469, +1, -3, +1, +1, 0, +2, -1, 0, 0, 0, +90, 75, 27, 0.0, "Q1",'p',999};
- tidal_wave w2Q1 = { 0.2587, +1, -4, +1, +2, 0, +2, -1, 0, 0, 0, +90, 75, 67, 0.0, "2Q1",'p',999};/*LR: 24/01/02 */
- tidal_wave wRo1 = { 0.3787, +1, -3, +3, -1, 0, +2, -1, 0, 0, 0, +90, 75, 69, 0.0, "Ro1",'p',999};/*LR: 24/01/02 */
- tidal_wave wSig1 = { 0.1627, +1, -4, +3, 0, 0, +2, -1, 0, 0, 0, +90, 75, 68, 0.0, "Sig1",'p',999};/*LR: 24/01/02 */
- tidal_wave wJ1 = { 0.7921, +1, +1, +1, -1, 0, 0, -1, 0, 0, 0, -90, 76, 29, 0.0, "J1",'p',999};/*avant s=-2*/
- tidal_wave wKi1 = { 0.1120, +1, -1, +3, -1, 0, 0, -1, 0, 0, 0, -90, 76, 70, 0.0, "Ki1",'p',999};/*LR: 24/01/02 */
- tidal_wave wTta1 = { 0.1120, +1, +1, -1, +1, 0, 0, -1, 0, 0, 0, -90, 76, 73, 0.0, "Tta1",'p',999};/*LR: 24/01/02 */
- tidal_wave wS1 = { 0.0000, +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0.0, "S1",'p',3};/* LR: 28/03/03 */
- tidal_wave wPi1 = { 0.2747, +1, 0, -2, 0, +1, 0, 0, 0, 0, 0, +90, 0, 71, 0.0, "Pi1",'p',999};
- tidal_wave wK1 = {14.1484, +1, 0, +1, 0, 0, 0, 0, -1, 0, 0, -90, 227, 3, 0.0, "K1",'p',999};
- tidal_wave wP1 = { 4.6806, +1, 0, -1, 0, 0, 0, 0, 0, 0, 0, +90, 0, 2, 0.0, "P1",'p',3};
- tidal_wave wPsi1 = { 0.1120, +1, 0, +2, 0, -1, 0, 0, 0, 0, 0, -90, 0, 0, 0.0, "Psi1",'p',3};/*LR: 31/03/03 */
- tidal_wave wPhi1 = { 0.2027, +1, 0, +3, 0, 0, 0, 0, 0, 0, 0, -90, 0, 72, 0.0, "Phi1",'p',999};/*LR: 24/01/02 */
- tidal_wave wOO1 = { 0.4347, +1, +2, +1, 0, 0, -2, -1, 0, 0, 0, -90, 77, 28, 0.0, "OO1",'p',999};
- tidal_wave wMP1 = { 0.0000, +1, -2, +3, 0, 0, 0, -1, 0, 0, 0, -90, 76, 49, 0.0, "MP1",'n',999};/*LR: 2/04/02*/
- tidal_wave wSO1 = { 0.0000, +1, +2, -1, 0, 0, 0, -1, 0, 0, 0, -90, 76, 48, 0.0, "SO1",'n',999};/*LR: 2/04/02*/
- tidal_wave wKQ1 = { 0.0000, +1, +3, +1, -1, 0, -2, -1, 0, 0, 0, -90, 15, 76, 0.0, "KQ1",'n',999};/*LR: 2/04/02*/
- tidal_wave wM1 = { 0.9788, +1, -1, +1, 0, 0, +1, -1, 0, 0, 0, 0, 144, 74, 0.0, "M1",'p',999};/*LR: 2/04/02*/
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wE2 = { 0.1789, +2, -5, +4, +1, 0, +2, -2, 0, 0, 0, 0, 78, 4, 0.0, "E2",'p',5};/*LR: 2/04/02*/
- tidal_wave w2N2 = { 0.6267, +2, -4, +2, +2, 0, +2, -2, 0, 0, 0, 0, 78, 5, 0.0, "2N2",'p',999};
- tidal_wave wMu2 = { 0.5841, +2, -4, +4, 0, 0, +2, -2, 0, 0, 0, 0, 78, 6, 0.0, "Mu2",'p',5};/*avant p=-1*/
- tidal_wave wN2 = { 4.6313, +2, -3, +2, +1, 0, +2, -2, 0, 0, 0, 0, 78, 7, 0.0, "N2",'p',999};
- tidal_wave wNu2 = { 0.9094, +2, -3, +4, -1, 0, +2, -2, 0, 0, 0, 0, 78, 8, 0.0, "Nu2",'p',7};
- tidal_wave wL2 = { 0.6694, +2, -1, +2, -1, 0, +2, -2, 0, 0, 1,+180, 215, 11, 0.0, "L2",'p',14};
- tidal_wave wLa2 = { 0.1760, +2, -1, 0, +1, 0, +2, -2, 0, 0, 0,+180, 78, 10, 0.0, "La2",'p',999};/*LR: 24/01/02 */
- tidal_wave wT2 = { 0.6614, +2, 0, -1, 0, +1, 0, 0, 0, 0, 0, 0, 0, 12, 0.0, "T2",'p',14};/*LR: 31/03/03 */
- tidal_wave wS2 = {11.2734, +2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0.0, "S2",'p',999};
- tidal_wave wM2 = {24.2297, +2, -2, +2, 0, 0, +2, -2, 0, 0, 0, 0, 78, 9, 0.0, "M2",'p',999};
- tidal_wave wK2 = { 3.0697, +2, 0, +2, 0, 0, 0, 0, 0, -2, 0, 0, 235, 14, 0.0, "K2",'p',13};/*LR: 06/06/04 */
- tidal_wave wKJ2 = { 0.1707, +2, +1, +2, -1, 0, 0, 0, 0, -2, 0, 0, 79, 77, 0.0, "KJ2",'n',999};/*LR: 24/01/02 */
- tidal_wave wR2 = { 0.0933, +2, 0, +1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 50, 0.0, "R2",'p',14};/*LR: 31/03/03 */
- tidal_wave wOQ2 = { 0.0000, +2, -5, +2, +1, 0, 0, 0, 0, 0, 0,+180, 7, 51, 0.0, "OQ2",'n',999};/*LR: 2/04/02*/
- tidal_wave w2MK2 = { 0.0000, +2, +4, +2, 0, 0, 4, -4, 0, +2, 0, 0, 5, 65, 0.0, "2MK2",'n',999};/*LR: 2/04/02*/
- tidal_wave wMSK2 = { 0.0000, +2, -2, 0, 0, 0, +2, -2, 0, +2, 0, 0, 8, 31, 0.0, "MSK2",'n',999};/*LR: 2/04/02*/
- tidal_wave wMSN2 = { 0.0000, +2, +1, 0, +1, 0, +2, -2, 0, +2, 0, 0, 6, 15, 0.0, "MSN2",'n',999};/*LR: 2/04/02*/
- tidal_wave w2SM2 = { 0.0000, +2, +2, -2, 0, 0, -2, +2, 0, 0, 0, 0, 16, 16, 0.0, "2SM2",'n',999};/*LR: 2/04/02*/
- tidal_wave wM_SK_2={ 0.0000, +2, -2, +1, 0, 0, +2, -2, 1, 0, 0, +90, 9, 37, 0.0, "M(SK)2",'n',999};/*LR: 2/04/02*/
- tidal_wave wM_KS_2={ 0.0000, +2, -2, +3, 0, 0, +2, -2, -1, 0, 0, -90, 9, 36, 0.0, "M(KS)2",'n',999};/*LR: 2/04/02*/
- tidal_wave wMKS2 = { 0.0000, +2, -2, +4, 0, 0, -2, -2, 0, 0, 0, 0, 8, 30, 0.0, "MKS2",'n',999};/*LR: 2/04/02*/
- tidal_wave wOP2 = { 0.0000, +2, -2, 0, 0, 0, +2, -1, 0, 0, 0,+180, 11,100, 0.0, "OP2",'n',999};/*LR: 2/04/02*/
- tidal_wave wMNS2 = { 0.0000, +2, -5, +4, +1, 0, +4, -4, 0, 0, 0, 0, 6,101, 0.0, "MNS2",'n',999};/*LR: 24/01/02 */
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wM3 = { 0.4747, +3, -3, +3, 0, 0, +3, -3, 0, 0, 0, 0, 1, 34, 0.0, "M3",'n',999};/*LR: 24/01/02 */
- tidal_wave wS3 = { 0.0000, +3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 35, 0.0, "S3",'n',999};/*LR: 2/04/02*/
- tidal_wave w2MK3 = { 0.0000, +3, -4, +3, 0, 0, +4, -4, +1, 0, 0, +90, 10, 25, 0.0, "2MK3",'n',999};/*LR: 2/04/02*/
- tidal_wave wSO3 = { 0.0000, +3, -2, +1, 0, 0, +2, -1, 0, 0, 0, +90, 11, 53, 0.0, "SO3",'n',999};/*LR: 2/04/02*/
- tidal_wave wMK3 = { 0.0000, +3, -2, +3, 0, 0, +2, -2, -1, 0, 0, -90, 10, 24, 0.0, "MK3",'n',999};/*LR: 2/04/02*/
- tidal_wave wSK3 = { 0.0000, +3, 0, +1, 0, 0, 0, 0, -1, 0, 0, -90, 17, 54, 0.0, "SK3",'n',999};/*LR: 2/04/02*/
- tidal_wave wMO3 = { 0.0000, +3, -4, +1, 0, 0, +2, -2, 0, 0, 0, +90, 13,102, 0.0, "MO3",'n',999};/*LR: 2/04/02*/
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wN4 = { 0.0000, +4, -6, +4, +2, 0, +4, -4, 0, 0, 0, 0, 1, 33, 0.0, "N4",'n',999};
- tidal_wave wM4 = { 0.0000, +4, -4, +4, 0, 0, +4, -4, 0, 0, 0, 0, 1, 18, 0.0, "M4",'n',999};
- tidal_wave wS4 = { 0.0000, +4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0.0, "S4",'n',999};
- tidal_wave wMN4 = { 0.0000, +4, -5, +4, 1, 0, +4, -4, 0, 0, 0, 0, 1, 17, 0.0, "MN4",'n',999};
- tidal_wave wMS4 = { 0.0000, +4, -2, +2, 0, 0, +2, -2, 0, 0, 0, 0, 2, 19, 0.0, "MS4",'n',999};
- tidal_wave wMK4 = { 0.0000, +4, -2, +4, 0, 0, +2, -2, 0, -2, 0, 0, 4, 20, 0.0, "MK4",'n',999};
- tidal_wave wSN4 = { 0.0000, +4, -3, +2, +1, 0, +2, -2, 0, 0, 0, 0, 2, 55, 0.0, "SN4",'n',999};/*LR: 29/03/02 */
- tidal_wave w3MS4 = { 0.0000, +4, -6, +6, 0, 0, +6, -6, 0, 0, 0, 0, 12, 58, 0.0, "3MS4",'n',999};/*LR: 29/03/02 */
- tidal_wave wSK4 = { 0.0000, +4, 0, +2, 0, 0, 0, 0, 0, -2, 0, 0, 14,103, 0.0, "SK4",'n',999};
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wM6 = { 0.0000, +6, -6, +6, 0, 0, +6, -6, 0, 0, 0, 0, 18, 22, 0.0, "M6",'n',999};
- tidal_wave w2MN6 = { 0.0000, +6, -7, +6, 1, 0, +6, -6, 0, 0, 0, 0, 18, 21, 0.0, "2MN6",'n',999};
- tidal_wave w2MS6 = { 0.0000, +6, -4, +4, 0, 0, +4, -4, 0, 0, 0, 0, 6, 59, 0.0, "2MS6",'n',999};
- tidal_wave w2MK6 = { 0.0000, +6, -4, +6, 0, 0, +4, -4, 0, -2, 0, 0, 5, 60, 0.0, "2MK6",'n',999};
- tidal_wave wMSN6 = { 0.0000, +6, -5, +4, +1, 0, +4, -4, 0, 0, 0, 0, 6, 23, 0.0, "MSN6",'n',999};/*LR: 29/03/02 */
- tidal_wave w2SM6 = { 0.0000, +6, -2, +2, 0, 0, +2, -2, 0, 0, 0, 0, 16,104, 0.0, "2SM6",'n',999};/*LR: 2/04/02*/
- tidal_wave wMSK6 = { 0.0000, +6, -2, +4, 0, 0, +2, -2, 0, -2, 0, 0, 8,105, 0.0, "MSK6",'n',999};/*LR: 2/04/02*/
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave w3MS8 = { 0.0000, +8, -6, +6, 0, 0, +6, -6, 0, 0, 0, 0, 19, 61, 0.0, "3MS8",'n',999};/*LR: 2/04/02*/
-
-/*----------------potentiel---T---s---h---p--p1-ksi--nu-nu1-nu2-R--shift-form-code-frq--name-spec-admit*/
- tidal_wave wRH5 = { 0.0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 3.0, "RH5",'a',999};
-
-
-/*----------------potentiel---T---s---h---p--p1--ksi-nu-nu1-nu2-shift-form-code-frq--name-linear*/
- tidal_wave wNUL = {0.0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0.0, "NUL",'p',999}; /*TL: 08/06/2004*/
-
- double pi = 3.14159265358979323844;
- double pi2 = 3.14159265358979323844*2.;
- double deg_to_rad = 3.14159265358979323844/180.;
-
-#else
- extern tidal_wave wmean;
-
- extern tidal_wave wSa ;
- extern tidal_wave wSsa ;
- extern tidal_wave wMm ;
- extern tidal_wave wMSm ;
- extern tidal_wave wMSf ;
- extern tidal_wave wMf ;
- extern tidal_wave wMtm ;
- extern tidal_wave wMqm ;
- extern tidal_wave wMStm ;
- extern tidal_wave wMSqm ;
-
- extern tidal_wave wO1 ;
- extern tidal_wave wQ1 ;
- extern tidal_wave w2Q1 ;
- extern tidal_wave wRo1 ;
- extern tidal_wave wSig1 ;
- extern tidal_wave wJ1 ;
- extern tidal_wave wKi1 ;
- extern tidal_wave wTta1 ;
- extern tidal_wave wS1 ;
- extern tidal_wave wPi1 ;
- extern tidal_wave wK1 ;
- extern tidal_wave wP1 ;
- extern tidal_wave wPsi1 ;
- extern tidal_wave wPhi1 ;
- extern tidal_wave wOO1 ;
- extern tidal_wave wMP1 ;/*LR: 2/04/02*/
- extern tidal_wave wSO1 ;/*LR: 2/04/02*/
- extern tidal_wave wKQ1 ;/*LR: 2/04/02*/
- extern tidal_wave wM1 ;/*LR: 2/04/02*/
-
- extern tidal_wave wE2 ;
- extern tidal_wave w2N2 ;
- extern tidal_wave wMu2 ;
- extern tidal_wave wN2 ;
- extern tidal_wave wNu2 ;
- extern tidal_wave wM2 ;
- extern tidal_wave wL2 ;
- extern tidal_wave wLa2 ;
- extern tidal_wave wT2 ;
- extern tidal_wave wS2 ;
- extern tidal_wave wK2 ;
- extern tidal_wave wKJ2 ;
- extern tidal_wave wR2 ;
- extern tidal_wave wOQ2 ;/*LR: 2/04/02*/
- extern tidal_wave w2MK2 ;/*LR: 2/04/02*/
- extern tidal_wave wMSK2 ;/*LR: 2/04/02*/
- extern tidal_wave wMSN2 ;/*LR: 2/04/02*/
- extern tidal_wave w2SM2 ;/*LR: 2/04/02*/
- extern tidal_wave wM_SK_2 ;/*LR: 2/04/02*/
- extern tidal_wave wM_KS_2;/*LR: 2/04/02*/
- extern tidal_wave wMKS2 ;/*LR: 2/04/02*/
- extern tidal_wave wOP2 ;/*LR: 2/04/02*/
- extern tidal_wave wMNS2 ;/*LR: 2/04/02*/
-
- extern tidal_wave wM3 ;
- extern tidal_wave wS3 ;
- extern tidal_wave w2MK3 ;/*LR: 2/04/02*/
- extern tidal_wave wSO3 ;/*LR: 2/04/02*/
- extern tidal_wave wMK3 ;/*LR: 2/04/02*/
- extern tidal_wave wSK3 ;/*LR: 2/04/02*/
- extern tidal_wave wMO3 ;/*LR: 2/04/02*/
-
- extern tidal_wave wN4 ;
- extern tidal_wave wM4 ;
- extern tidal_wave wS4 ;
- extern tidal_wave wMN4 ;
- extern tidal_wave wMS4 ;
- extern tidal_wave wMK4 ;
- extern tidal_wave wSN4 ;/*LR: 2/04/02*/
- extern tidal_wave w3MS4 ;/*LR: 2/04/02*/
- extern tidal_wave wSK4 ;/*LR: 2/04/02*/
-
- extern tidal_wave wM6 ;
- extern tidal_wave w2MN6 ;
- extern tidal_wave w2MS6 ;
- extern tidal_wave w2MK6 ;
- extern tidal_wave wMSN6 ;/*LR: 29/03/02 */
- extern tidal_wave w2SM6 ;/*LR: 2/04/02*/
- extern tidal_wave wMSK6 ;/*LR: 2/04/02*/
-
- extern tidal_wave w3MS8 ;/*LR: 2/04/02*/
-
- extern tidal_wave wRH5 ;
- extern tidal_wave wNUL ;
-
- extern double pi;
- extern double pi2;
- extern double deg_to_rad;
-
-
-#endif
diff --git a/modules/fes2004/fes2004_prediction.c b/modules/fes2004/fes2004_prediction.c
deleted file mode 100644
index 9aaeef1..0000000
--- a/modules/fes2004/fes2004_prediction.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "fes2004_lib.h"
-
-
-int fes2004_prediction (char *netcdf_filename,int time_reference,int nb_position,double *lat,double *lon,double *time,double *prediction,int nb_CPU)
-{
-
- /*####################################################*/
- /* variable*/
- /*####################################################*/
-
- //classical variables
- int rstatus;
-
- //prediction typedef variables
- spectrum_struct *spectrum=NULL;
- mega_struct *P=NULL;
-
- /*####################################################*/
- /* allocation*/
- /*####################################################*/
-
- alloc_tide_spectrum(&spectrum);
- P=calloc(nb_CPU,sizeof(mega_struct));
- alloc_prediction_threads(P,nb_CPU);
-
- /*####################################################*/
- /*init prediction spectrum*/
- /*####################################################*/
-
- rstatus=init_spectrum(spectrum,time_reference);
- if (rstatus != 0 ) print_error_2();
-
- /*####################################################*/
- /* load data files*/
- /*####################################################*/
-
- load_netcdf_fes2004_data(netcdf_filename,P,nb_CPU);
-
- /*####################################################*/
- /*init thread struct*/
- /*####################################################*/
-
- init_thread_struct(nb_CPU, P, time_reference, lat, lon, time, prediction, spectrum,NULL,NULL);
-
- /*####################################################*/
- /*Multithreaded prediction*/
- /*####################################################*/
-
- multi_t_prediction(nb_position , nb_CPU, P);
-
- /*####################################################*/
- /*free memory and exit*/
- /*####################################################*/
- free_threads(P,nb_CPU);
- free(P);
-
-
- printf("\n------------- prediction completed -------------\n");
-
- return 0;
-}/*end*/
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list