[mdds] 06/62: Imported Upstream version 0.3.1
This is an automated email from the git hooks/post-receive script.
rene pushed a commit to branch master
in repository mdds.
commit c802da8aaad6a5391c47a5891d94fe6d59a00a09
Author: Rene Engelhard <rene@debian.org>
Date: Thu Apr 21 14:50:45 2016 +0200
Imported Upstream version 0.3.1
---
Makefile => Makefile.in | 76 +-
NEWS | 5 +
configure | 2889 ++++++++++++++++++++
example/Makefile | 2 +-
example/point_quad_tree.cpp | 2 +-
{inc => include}/mdds/flat_segment_tree.hpp | 0
{inc => include}/mdds/global.hpp | 0
.../mdds/hash_container/map.hpp | 39 +-
{inc => include}/mdds/node.hpp | 0
{inc => include}/mdds/point_quad_tree.hpp | 141 +-
{inc => include}/mdds/quad_node.hpp | 4 +-
include/mdds/quad_type_matrix.hpp | 1269 +++++++++
{inc => include}/mdds/rectangle_set.hpp | 4 +-
{inc => include}/mdds/segment_tree.hpp | 24 +-
{inc => include}/nodecontainer.hpp | 0
{inc => include}/rangetree.hpp | 0
src/point_quad_tree_test.cpp | 75 +-
src/quad_type_matrix_test.cpp | 676 +++++
18 files changed, 5101 insertions(+), 105 deletions(-)
diff --git a/Makefile b/Makefile.in
similarity index 61%
rename from Makefile
rename to Makefile.in
index 7244d60..145afc5 100644
--- a/Makefile
+++ b/Makefile.in
@@ -1,17 +1,17 @@
-OBJDIR=./obj
-SRCDIR=./src
-INCDIR=./inc
+OBJDIR=@OBJDIR@
+SRCDIR=@SRCDIR@
+INCDIR=@INCDIR@
-CPPFLAGS=-I$(INCDIR) -DDEBUG_NODE_BASE -DUNIT_TEST -Wall -Os -g -std=c++0x
+CPPFLAGS=@CPPFLAGS@
LDFLAGS=
EXECS= \
flat_segment_tree_test \
segment_tree_test \
point_quad_tree_test \
- rectangle_set_test \
- stlperf_test
+ quad_type_matrix_test \
+ rectangle_set_test
HEADERS= \
$(INCDIR)/mdds/node.hpp \
@@ -20,20 +20,34 @@ HEADERS= \
$(INCDIR)/mdds/flat_segment_tree.hpp \
$(INCDIR)/mdds/point_quad_tree.hpp \
$(INCDIR)/mdds/segment_tree.hpp \
+ $(INCDIR)/mdds/quad_type_matrix.hpp \
$(INCDIR)/mdds/rectangle_set.hpp
-OBJFILES= \
- $(OBJDIR)/flat_segment_tree_test.o \
- $(OBJDIR)/segment_tree_test.o \
- $(OBJDIR)/rectangle_set_test.o
-
DEPENDS= \
$(HEADERS)
+TESTS = \
+ test.fst \
+ test.recset \
+ test.pqt \
+ test.st
+
+TESTS_MEM = \
+ test.pqt.mem \
+ test.recset.mem \
+ test.fst.mem \
+ test.st.mem
+
+# You may add $(TESTS_MEM) if valgrind is available on your platform
+ALL_TESTS = $(TESTS)
+
+nothing:
+ @echo There is nothing to build since this is a header-only library.
+
all: $(EXECS)
pre:
- mkdir $(OBJDIR) 2>/dev/null || /bin/true
+ mkdir -p $(OBJDIR)
$(OBJDIR)/flat_segment_tree_test.o: $(SRCDIR)/flat_segment_tree_test.cpp $(DEPENDS)
$(CXX) $(CPPFLAGS) -c -o $@ $(SRCDIR)/flat_segment_tree_test.cpp
@@ -47,6 +61,9 @@ $(OBJDIR)/rectangle_set_test.o: $(SRCDIR)/rectangle_set_test.cpp $(DEPENDS)
$(OBJDIR)/point_quad_tree_test.o: $(SRCDIR)/point_quad_tree_test.cpp $(DEPENDS)
$(CXX) $(CPPFLAGS) -c -o $@ $(SRCDIR)/point_quad_tree_test.cpp
+$(OBJDIR)/quad_type_matrix_test.o: $(SRCDIR)/quad_type_matrix_test.cpp $(DEPENDS)
+ $(CXX) $(CPPFLAGS) -c -o $@ $(SRCDIR)/quad_type_matrix_test.cpp
+
flat_segment_tree_test: pre $(OBJDIR)/flat_segment_tree_test.o
$(CXX) $(LDFLAGS) $(OBJDIR)/flat_segment_tree_test.o -o $@
@@ -59,6 +76,9 @@ rectangle_set_test: pre $(OBJDIR)/rectangle_set_test.o
point_quad_tree_test: pre $(OBJDIR)/point_quad_tree_test.o
$(CXX) $(LDFLAGS) $(OBJDIR)/point_quad_tree_test.o -o $@
+quad_type_matrix_test: pre $(OBJDIR)/quad_type_matrix_test.o
+ $(CXX) $(LDFLAGS) $(OBJDIR)/quad_type_matrix_test.o -o $@
+
stlperf_test: pre $(SRCDIR)/stlperf_test.cpp
$(CXX) $(LDFLAGS) $(CPPFLAGS) $(SRCDIR)/stlperf_test.cpp -o $@
@@ -68,8 +88,8 @@ $(OBJDIR)/template_test.o: $(SRCDIR)/template_test.cpp $(DEPENDS)
test.fst: flat_segment_tree_test
./flat_segment_tree_test
-test.recset: rectangle_set_test
- ./rectangle_set_test func
+test.fst.mem: flat_segment_tree_test
+ valgrind --tool=memcheck --leak-check=full ./flat_segment_tree_test
test.pqt: point_quad_tree_test
./point_quad_tree_test
@@ -77,14 +97,14 @@ test.pqt: point_quad_tree_test
test.pqt.mem: point_quad_tree_test
valgrind --tool=memcheck --leak-check=full ./point_quad_tree_test
-test.recset.perf: rectangle-set_test
+test.recset: rectangle_set_test
+ ./rectangle_set_test func
+
+test.recset.perf: rectangle_set_test
./rectangle_set_test perf
test.recset.mem: rectangle_set_test
- valgrind --tool=memcheck --leak-check=full ./rectangle-set_test func
-
-test.fst.mem: flat_segment_tree_test
- valgrind --tool=memcheck --leak-check=full ./flat_segment_tree_test
+ valgrind --tool=memcheck --leak-check=full ./rectangle_set_test func
test.st: segment_tree_test
./segment_tree_test func
@@ -95,9 +115,27 @@ test.st.perf: segment_tree_test
test.st.mem: segment_tree_test
valgrind --tool=memcheck --leak-check=full ./segment_tree_test func
+test.qtm: quad_type_matrix_test
+ ./quad_type_matrix_test
+
+test.qtm.mem: quad_type_matrix_test
+ valgrind --tool=memcheck --leak-check=full ./quad_type_matrix_test func
+
test.stl: stlperf_test
./stlperf_test
+install: $(HEADERS)
+ install -d @PREFIX@/include/mdds
+ install -d @PREFIX@/include/mdds/hash_container
+ install -d @PREFIX@/share/mdds-devel/example
+ install -d @PREFIX@/share/doc/packages/mdds-devel/
+ install -m 644 -t @PREFIX@/include/mdds $(INCDIR)/mdds/*.hpp
+ install -m 644 -t @PREFIX@/include/mdds/hash_container $(INCDIR)/mdds/hash_container/*.hpp
+ install -m 644 -t @PREFIX@/share/mdds-devel/example/ example/*
+ install -m 644 -t @PREFIX@/share/doc/packages/mdds-devel/ AUTHORS NEWS README
+
+check: $(ALL_TESTS)
+
clean:
rm -rf $(OBJDIR) 2>/dev/null || /bin/true
rm $(EXECS) 2>/dev/null || /bin/true
diff --git a/NEWS b/NEWS
index 681479a..0a922a6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+mdds 0.3.1
+
+ * added support for boost::unordered_map (boost) and std::hash_map
+ (stlport) in addition to C++0x's std::unordered_map.
+
mdds 0.3.0
* implemented point_quad_tree.
diff --git a/configure b/configure
new file mode 100755
index 0000000..3a951dc
--- /dev/null
+++ b/configure
@@ -0,0 +1,2889 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for mdds 0.3.1.
+#
+# Report bugs to <kohei.yoshida@gmail.com>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='mdds'
+PACKAGE_TARNAME='mdds'
+PACKAGE_VERSION='0.3.1'
+PACKAGE_STRING='mdds 0.3.1'
+PACKAGE_BUGREPORT='kohei.yoshida@gmail.com'
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+CPPFLAGS
+INCDIR
+SRCDIR
+OBJDIR
+PREFIX
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_hash_container
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures mdds 0.3.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/mdds]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of mdds 0.3.1:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+
+ --with-hash-container specify the type of hash containers to use in test
+ programs. Supported types are: boost, c++0x, or
+ stlport. c++0x is used if unspecified.
+
+ With c++0x, we assume that unordered_map and
+ unordered_set are available under the std namespace,
+ whereas with boost they are assumed to be defined in
+ the boost namespace. When stlport is specified, we
+ assume that hash_map and hash_set are available
+ under the std namespace.
+
+ Example: --with-hash-container=boost
+
+Report bugs to <kohei.yoshida@gmail.com>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+mdds configure 0.3.1
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by mdds $as_me 0.3.1, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+# Check whether --with-hash-container was given.
+if test "${with_hash_container+set}" = set; then
+ withval=$with_hash_container;
+else
+ with_hash_container=c++0x
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking prefix" >&5
+$as_echo_n "checking prefix... " >&6; }
+if test "$prefix" = "NONE"; then
+ prefix=/usr/local
+fi
+PREFIX=$prefix
+{ $as_echo "$as_me:$LINENO: result: $prefix" >&5
+$as_echo "$prefix" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking hash container type" >&5
+$as_echo_n "checking hash container type... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_hash_container" >&5
+$as_echo "$with_hash_container" >&6; }
+
+OBJDIR=./obj
+SRCDIR=./src
+INCDIR=./include
+
+
+
+
+CPPFLAGS="-I$INCDIR -DDEBUG_NODE_BASE -DUNIT_TEST -Wall -Os -g -pedantic-errors"
+if test $with_hash_container = stlport; then
+ CPPFLAGS="$CPPFLAGS -DMDDS_HASH_CONTAINER_STLPORT"
+elif test $with_hash_container = boost; then
+ CPPFLAGS="$CPPFLAGS -DMDDS_HASH_CONTAINER_BOOST"
+else
+ CPPFLAGS="$CPPFLAGS -std=c++0x"
+fi
+
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by mdds $as_me 0.3.1, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+mdds config.status 0.3.1
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/example/Makefile b/example/Makefile
index 724a863..9cfd314 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -25,7 +25,7 @@
#
#***********************************************************************
-CPPFLAGS=-I../inc -Wall -Os -std=c++0x
+CPPFLAGS=-Wall -Os -std=c++0x
EXEC= \
segment_tree \
diff --git a/example/point_quad_tree.cpp b/example/point_quad_tree.cpp
index 41a68da..2f4f145 100644
--- a/example/point_quad_tree.cpp
+++ b/example/point_quad_tree.cpp
@@ -7,7 +7,7 @@ using namespace std;
int main()
{
- typedef ::mdds::point_quad_tree<double, string> db_type;
+ typedef ::mdds::point_quad_tree<double, const string*> db_type;
db_type db;
string chicago("Chicago");
diff --git a/inc/mdds/flat_segment_tree.hpp b/include/mdds/flat_segment_tree.hpp
similarity index 100%
rename from inc/mdds/flat_segment_tree.hpp
rename to include/mdds/flat_segment_tree.hpp
diff --git a/inc/mdds/global.hpp b/include/mdds/global.hpp
similarity index 100%
copy from inc/mdds/global.hpp
copy to include/mdds/global.hpp
diff --git a/inc/mdds/global.hpp b/include/mdds/hash_container/map.hpp
similarity index 72%
rename from inc/mdds/global.hpp
rename to include/mdds/hash_container/map.hpp
index 147e018..46ff775 100644
--- a/inc/mdds/global.hpp
+++ b/include/mdds/hash_container/map.hpp
@@ -1,6 +1,6 @@
/*************************************************************************
*
- * Copyright (c) 2008-2010 Kohei Yoshida
+ * Copyright (c) 2010 Kohei Yoshida
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -25,28 +25,21 @@
*
************************************************************************/
-#ifndef __MDDS_GLOBAL_HPP__
-#define __MDDS_GLOBAL_HPP__
+#ifndef __MDDS_HASH_CONTAINER_MAP_HPP__
+#define __MDDS_HASH_CONTAINER_MAP_HPP__
-#include <exception>
-#include <string>
-
-namespace mdds {
-
-class general_error : public ::std::exception
-{
-public:
- general_error(const ::std::string& msg) : m_msg(msg) {}
- virtual ~general_error() throw() {}
-
- virtual const char* what() const throw()
- {
- return m_msg.c_str();
- }
-private:
- ::std::string m_msg;
-};
-
-}
+#if defined (MDDS_HASH_CONTAINER_STLPORT)
+// stlport
+#include <hash_map>
+#define _mdds_unordered_map_type ::std::hash_map
+#elif defined (MDDS_HASH_CONTAINER_BOOST)
+// boost
+#include <boost/unordered_map.hpp>
+#define _mdds_unordered_map_type ::boost::unordered_map
+#else
+// c++0x
+#include <unordered_map>
+#define _mdds_unordered_map_type ::std::unordered_map
+#endif
#endif
diff --git a/inc/mdds/node.hpp b/include/mdds/node.hpp
similarity index 100%
rename from inc/mdds/node.hpp
rename to include/mdds/node.hpp
diff --git a/inc/mdds/point_quad_tree.hpp b/include/mdds/point_quad_tree.hpp
similarity index 92%
rename from inc/mdds/point_quad_tree.hpp
rename to include/mdds/point_quad_tree.hpp
index b396037..e515e20 100644
--- a/inc/mdds/point_quad_tree.hpp
+++ b/include/mdds/point_quad_tree.hpp
@@ -114,7 +114,9 @@ public:
typedef _Key key_type;
typedef _Data data_type;
typedef size_t size_type;
- typedef ::std::vector<data_type*> data_array_type;
+ typedef ::std::vector<data_type> data_array_type;
+
+ class data_not_found : public ::std::exception {};
private:
struct node;
@@ -122,8 +124,8 @@ private:
struct node : quad_node_base<node_ptr, node, key_type>
{
- data_type* data;
- node(key_type _x, key_type _y, data_type* _data) :
+ data_type data;
+ node(key_type _x, key_type _y, data_type _data) :
quad_node_base<node_ptr, node, key_type>(_x, _y),
data(_data) {}
@@ -131,9 +133,7 @@ private:
quad_node_base<node_ptr, node, key_type>(r),
data(r.data) {}
- void dispose()
- {
- }
+ void dispose() {}
bool operator== (const node& r) const
{
@@ -152,6 +152,44 @@ private:
typedef ::std::pair<key_type, key_type> key_range_type;
public:
+
+ /**
+ * Node wrapper to allow read-only access to the internal quad node
+ * structure.
+ */
+ class node_access
+ {
+ friend class point_quad_tree<_Key,_Data>;
+ public:
+ node_access northeast() const { return node_access(mp->northeast.get()); }
+ node_access northwest() const { return node_access(mp->northwest.get()); }
+ node_access southeast() const { return node_access(mp->southeast.get()); }
+ node_access southwest() const { return node_access(mp->southwest.get()); }
+
+ data_type data() const { return mp->data; }
+ key_type x() const { return mp->x; }
+ key_type y() const { return mp->y; }
+
+ operator bool() const { return mp != NULL; }
+ bool operator== (const node_access& r) const { return mp == r.mp; }
+
+ node_access& operator= (const node_access& r)
+ {
+ mp = r.mp;
+ return *this;
+ }
+
+ node_access() : mp(NULL) {}
+ node_access(const node_access& r) : mp(r.mp) {}
+ ~node_access() {}
+
+ private:
+ node_access(const node* p) : mp(p) {}
+
+ private:
+ const node* mp;
+ };
+
struct point
{
key_type x;
@@ -201,17 +239,17 @@ public:
return !operator==(r);
}
- const ::std::pair<point, const data_type*>& operator*() const
+ const ::std::pair<point, data_type>& operator*() const
{
return m_cur_value;
}
- const ::std::pair<point, const data_type*>* operator->() const
+ const ::std::pair<point, data_type>* operator->() const
{
return get_current_value();
}
- const ::std::pair<point, const data_type*>* operator++()
+ const ::std::pair<point, data_type>* operator++()
{
// The only difference between the last data position and the
// end iterator position must be the value of m_end_pos;
@@ -229,7 +267,7 @@ public:
return operator->();
}
- const ::std::pair<point, const data_type*>* operator--()
+ const ::std::pair<point, const data_type>* operator--()
{
if (m_end_pos)
{
@@ -274,7 +312,7 @@ public:
m_cur_value.second = p->data;
}
- const ::std::pair<point, const data_type*>* get_current_value() const
+ const ::std::pair<point, data_type>* get_current_value() const
{
return &m_cur_value;
}
@@ -282,7 +320,7 @@ public:
private:
res_nodes_ptr mp_res_nodes;
typename res_nodes_type::const_iterator m_cur_pos;
- ::std::pair<point, const data_type*> m_cur_value;
+ ::std::pair<point, data_type> m_cur_value;
bool m_end_pos:1;
};
@@ -325,12 +363,9 @@ public:
*
* @param x x coordinate of new data position
* @param y y coordinate of new data position
- * @param data pointer to data being inserted. The client data is
- * expected to manage the life time of inserted data; this
- * data structure does not manage the life cycle of inserted
- * data.
+ * @param data data being inserted at the specified coordinates.
*/
- void insert(key_type x, key_type y, data_type* data);
+ void insert(key_type x, key_type y, data_type data);
/**
* Perform region search (aka window search), that is, find all points
@@ -363,19 +398,19 @@ public:
/**
* Find data at specified coordinates. If no data exists at the specified
- * coordinates, this method returns NULL.
+ * coordinates, this method throws a
+ * <code>point_quad_tree::data_not_found</code> exception.
*
* @param x x coordinate
* @param y y coordinate
*
- * @return pointer to data found at the specified coordinates, or NULL if
- * no data is found at the coordinates.
+ * @return data found at the specified coordinates.
*/
- data_type* find(key_type x, key_type y) const;
+ data_type find(key_type x, key_type y) const;
/**
- * Remove data from specified coordinates. This method does nothing if
- * not data exists at the specified coordinates.
+ * Remove data from specified coordinates. This method does nothing if no
+ * data exists at the specified coordinates.
*
* @param x x coordinate
* @param y y coordinate
@@ -408,6 +443,13 @@ public:
*/
size_t size() const;
+ /**
+ * Get read-only access to the internal quad node tree.
+ *
+ * @return root node
+ */
+ node_access get_node_access() const;
+
point_quad_tree& operator= (const point_quad_tree& r);
bool operator== (const point_quad_tree& r) const;
@@ -427,8 +469,8 @@ private:
{
key_type x;
key_type y;
- data_type* data;
- node_data(key_type _x, key_type _y, data_type* _data) :
+ data_type data;
+ node_data(key_type _x, key_type _y, data_type _data) :
x(_x), y(_y), data(_data) {}
node_data(const node_data& r) :
x(r.x), y(r.y), data(r.data) {}
@@ -460,6 +502,9 @@ private:
bool verify_data(::std::vector<node_data>& expected) const;
+ bool verify_node_iterator(const node_access& nac) const;
+ static bool verify_node_iterator(const node_access& nac, const node* p);
+
void get_all_stored_data(::std::vector<node_data>& stored_data) const;
void dump_tree_svg(const ::std::string& fpath) const;
@@ -569,7 +614,7 @@ point_quad_tree<_Key,_Data>::~point_quad_tree()
}
template<typename _Key, typename _Data>
-void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type* data)
+void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type data)
{
m_xrange.first = ::std::min(m_xrange.first, x);
m_xrange.second = ::std::max(m_xrange.second, x);
@@ -665,11 +710,13 @@ point_quad_tree<_Key,_Data>::search_region(key_type x1, key_type y1, key_type x2
}
template<typename _Key, typename _Data>
-typename point_quad_tree<_Key,_Data>::data_type*
+typename point_quad_tree<_Key,_Data>::data_type
point_quad_tree<_Key,_Data>::find(key_type x, key_type y) const
{
const node* p = find_node_ptr(x, y);
- return p ? p->data : NULL;
+ if (!p)
+ throw data_not_found();
+ return p->data;
}
template<typename _Key, typename _Data>
@@ -820,8 +867,8 @@ template<typename _Key, typename _Data>
void point_quad_tree<_Key,_Data>::swap(point_quad_tree& r)
{
m_root.swap(r.m_root);
- m_xrange.swap(r.m_xrange);
- m_yrange.swap(r.m_yrange);
+ ::std::swap(m_xrange, r.m_xrange);
+ ::std::swap(m_yrange, r.m_yrange);
}
template<typename _Key, typename _Data>
@@ -845,6 +892,13 @@ size_t point_quad_tree<_Key,_Data>::size() const
}
template<typename _Key, typename _Data>
+typename point_quad_tree<_Key,_Data>::node_access
+point_quad_tree<_Key,_Data>::get_node_access() const
+{
+ return node_access(m_root.get());
+}
+
+template<typename _Key, typename _Data>
point_quad_tree<_Key,_Data>& point_quad_tree<_Key,_Data>::operator= (const point_quad_tree& r)
{
m_xrange = key_range_type(0, 0);
@@ -996,6 +1050,33 @@ bool point_quad_tree<_Key,_Data>::verify_data(::std::vector<node_data>& expected
}
template<typename _Key, typename _Data>
+bool point_quad_tree<_Key,_Data>::verify_node_iterator(const node_access& nac) const
+{
+ return verify_node_iterator(nac, m_root.get());
+}
+
+template<typename _Key, typename _Data>
+bool point_quad_tree<_Key,_Data>::verify_node_iterator(const node_access& nac, const node* p)
+{
+ if (!nac)
+ return (p == NULL);
+
+ if (!p)
+ return false;
+
+ if (!verify_node_iterator(nac.northeast(), p->northeast.get()))
+ return false;
+ if (!verify_node_iterator(nac.northwest(), p->northwest.get()))
+ return false;
+ if (!verify_node_iterator(nac.southeast(), p->southeast.get()))
+ return false;
+ if (!verify_node_iterator(nac.southwest(), p->southwest.get()))
+ return false;
+
+ return true;
+}
+
+template<typename _Key, typename _Data>
void point_quad_tree<_Key,_Data>::get_all_stored_data(const node* p, ::std::vector<node_data>& stored_data) const
{
if (!p)
diff --git a/inc/mdds/quad_node.hpp b/include/mdds/quad_node.hpp
similarity index 98%
rename from inc/mdds/quad_node.hpp
rename to include/mdds/quad_node.hpp
index bb66f95..59f3e10 100644
--- a/inc/mdds/quad_node.hpp
+++ b/include/mdds/quad_node.hpp
@@ -36,7 +36,7 @@ namespace mdds {
#ifdef DEBUG_NODE_BASE
size_t node_instance_count = 0;
-size_t get_node_instance_count()
+inline size_t get_node_instance_count()
{
return node_instance_count;
}
@@ -93,7 +93,7 @@ enum direction_t
dir_east
};
-node_quadrant_t opposite(node_quadrant_t quad)
+inline node_quadrant_t opposite(node_quadrant_t quad)
{
switch (quad)
{
diff --git a/include/mdds/quad_type_matrix.hpp b/include/mdds/quad_type_matrix.hpp
new file mode 100644
index 0000000..4093e2b
--- /dev/null
+++ b/include/mdds/quad_type_matrix.hpp
@@ -0,0 +1,1269 @@
+/*************************************************************************
+ *
+ * Copyright (c) 2010 Kohei Yoshida
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ ************************************************************************/
+
+#ifndef __MDDS_QUAD_TYPE_MATRIX_HPP__
+#define __MDDS_QUAD_TYPE_MATRIX_HPP__
+
+#include "mdds/global.hpp"
+#include "mdds/hash_container/map.hpp"
+
+#include <iostream>
+#include <cstdlib>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
+
+namespace mdds {
+
+enum matrix_density_t
+{
+ matrix_density_filled_zero,
+ matrix_density_filled_empty,
+ matrix_density_sparse_zero,
+ matrix_density_sparse_empty
+};
+
+enum matrix_element_t
+{
+ element_empty = 0,
+ element_numeric = 1,
+ element_boolean = 2,
+ element_string = 3
+};
+
+enum matrix_init_element_t
+{
+ matrix_init_element_zero,
+ matrix_init_element_empty
+};
+
+class matrix_error : public ::mdds::general_error
+{
+public:
+ matrix_error(const ::std::string& msg) : general_error(msg) {}
+};
+
+matrix_init_element_t get_init_element_type(matrix_density_t density)
+{
+ switch (density)
+ {
+ case matrix_density_filled_empty:
+ case matrix_density_sparse_empty:
+ return matrix_init_element_empty;
+ case matrix_density_filled_zero:
+ case matrix_density_sparse_zero:
+ return matrix_init_element_zero;
+ default:
+ throw matrix_error("unknown matrix density type.");
+ }
+}
+
+/**
+ * This data structure represents a matrix where each individual element may
+ * be of one of four types: value, boolean, string, or empty.
+ */
+template<typename _String, typename _Flag>
+class quad_type_matrix
+{
+public:
+ typedef _String string_type;
+ typedef _Flag flag_type;
+ typedef size_t size_type;
+ typedef ::std::pair<size_type, size_type> size_pair_type;
+
+ /**
+ * Default constructor.
+ */
+ quad_type_matrix();
+
+ /**
+ * Construct an empty matrix with specified density type.
+ */
+ quad_type_matrix(matrix_density_t density);
+
+ /**
+ * Construct a matrix of specified size with specified density type.
+ */
+ quad_type_matrix(size_t rows, size_t cols, matrix_density_t density);
+
+ quad_type_matrix(const quad_type_matrix& r);
+ ~quad_type_matrix();
+
+ quad_type_matrix& operator= (const quad_type_matrix& r);
+
+ /**
+ * Get the type of element specified by its position. The type can be one
+ * of empty, string, numeric, or boolean.
+ *
+ * @return element type.
+ */
+ matrix_element_t get_type(size_t row, size_t col) const;
+
+ double get_numeric(size_t row, size_t col) const;
+ bool get_boolean(size_t row, size_t col) const;
+ const string_type* get_string(size_t row, size_t col) const;
+
+ void set_numeric(size_t row, size_t col, double val);
+ void set_boolean(size_t row, size_t col, bool val);
+ void set_string(size_t row, size_t col, string_type* str);
+ void set_empty(size_t row, size_t col);
+
+ void set(size_t row, size_t col, double val);
+ void set(size_t row, size_t col, bool val);
+ void set(size_t row, size_t col, string_type* str);
+
+ /**
+ * Set flag value at specified position.
+ *
+ * @param row row position
+ * @param col column position
+ * @param flag_type flag value
+ */
+ void set_flag(size_t row, size_t col, flag_type flag);
+
+ /**
+ * Get flag value at specified position.
+ *
+ * @param row row position
+ * @param col column position
+ *
+ * @return flag value stored at specified position
+ */
+ flag_type get_flag(size_t row, size_t col) const;
+
+ void clear_flag(size_t row, size_t cols);
+
+ /**
+ * Return the size of matrix as a pair. The first value is the row size,
+ * while the second value is the column size.
+ *
+ * @return matrix size as a value pair.
+ */
+ size_pair_type size() const;
+
+ /**
+ * Transpose the stored matrix data.
+ *
+ * @return reference to this matrix instance.
+ */
+ quad_type_matrix& transpose();
+
+ /**
+ * Assign values from the passed matrix instance. If the size of the
+ * passed matrix is smaller, then the element values are assigned by their
+ * positions, while the rest of the elements that fall outside the size of
+ * the passed matrix instance will remain unmodified. If the size of the
+ * pass matrix instance is larger, then only the elements within the size
+ * of this matrix instance will get assigned.
+ *
+ * @param r passed matrix object to assign element values from.
+ */
+ void assign(const quad_type_matrix& r);
+
+ /**
+ * Resize the matrix to specified size. This method supports resizing to
+ * zero-sized matrix; however, either specifying the row or column size to
+ * zero will resize the matrix to 0 x 0.
+ *
+ * @param row new row size
+ * @param col new column size
+ */
+ void resize(size_t row, size_t col);
+
+ /**
+ * Empty the matrix.
+ */
+ void clear();
+
+ /**
+ * Check whether or not this matrix is numeric. A numeric matrix contains
+ * only numeric or boolean elements.
+ *
+ * @return true if the matrix contains only numeric or boolean elements,
+ * or false otherwise.
+ */
+ bool numeric() const;
+
+ /**
+ * Check whether or not this matrix is empty.
+ *
+ * @return true if this matrix is empty, or false otherwise.
+ */
+ bool empty() const;
+
+ /**
+ * Swap the content of the matrix with another instance.
+ */
+ void swap(quad_type_matrix& r);
+
+#ifdef UNIT_TEST
+ void dump() const;
+ void dump_flags() const;
+#endif
+
+private:
+ struct size_pair_type_hash
+ {
+ size_t operator() (const size_pair_type& val) const
+ {
+ size_t n = val.first + (val.second << 8);
+ return n;
+ }
+ };
+ typedef _mdds_unordered_map_type<size_pair_type, flag_type, size_pair_type_hash> flag_store_type;
+
+ class flag_storage
+ {
+ public:
+ flag_storage() {}
+ flag_storage(const flag_storage& r) : m_flags(r.m_flags) {}
+
+ void set_flag(size_t row, size_t col, flag_type flag)
+ {
+ size_pair_type pos = size_pair_type(row, col);
+ typename flag_store_type::iterator itr = m_flags.find(pos);
+ if (itr == m_flags.end())
+ {
+ // flag not stored for this position.
+ ::std::pair<typename flag_store_type::iterator, bool> r =
+ m_flags.insert(typename flag_store_type::value_type(pos, flag));
+ return;
+ }
+ itr->second = flag;
+ }
+
+ flag_type get_flag(size_t row, size_t col)
+ {
+ size_pair_type pos = size_pair_type(row, col);
+ typename flag_store_type::iterator itr = m_flags.find(pos);
+ return itr == m_flags.end() ? static_cast<flag_type>(0) : itr->second;
+ }
+
+ void clear_flag(size_t row, size_t col)
+ {
+ size_pair_type pos = size_pair_type(row, col);
+ typename flag_store_type::iterator itr = m_flags.find(pos);
+ if (itr != m_flags.end())
+ // Flag is stored at this position. Remove it.
+ m_flags.erase(itr);
+ }
+#if UNIT_TEST
+ void dump() const
+ {
+ using namespace std;
+ if (m_flags.empty())
+ {
+ cout << "no flags stored" << endl;
+ return;
+ }
+
+ cout << "flags stored:" << endl;
+ typename flag_store_type::const_iterator itr = m_flags.begin(), itr_end = m_flags.end();
+ for (; itr != itr_end; ++itr)
+ {
+ const size_pair_type& pos = itr->first;
+ flag_type val = itr->second;
+ cout << "(row=" << pos.first << ",col=" << pos.second << ") = 0x" << hex << static_cast<size_t>(val) << endl;
+ }
+ }
+#endif
+ private:
+ flag_store_type m_flags;
+ };
+
+ struct element
+ {
+ matrix_element_t m_type:2;
+
+ union
+ {
+ double m_numeric;
+ bool m_boolean;
+ string_type* mp_string;
+ };
+
+ element() : m_type(element_empty) {}
+ element(const element& r) : m_type(r.m_type)
+ {
+ switch (m_type)
+ {
+ case element_boolean:
+ m_boolean = r.m_boolean;
+ break;
+ case element_numeric:
+ m_numeric = r.m_numeric;
+ break;
+ case element_string:
+ mp_string = new string_type(*r.mp_string);
+ break;
+ case element_empty:
+ default:
+ ;
+ }
+ }
+
+ explicit element(double v) : m_type(element_numeric), m_numeric(v) {}
+ explicit element(bool v) : m_type(element_boolean), m_boolean(v) {}
+ explicit element(string_type* p) : m_type(element_string), mp_string(p) {}
+
+ bool operator== (const element& r) const
+ {
+ if (m_type != r.m_type)
+ return false;
+
+ switch (m_type)
+ {
+ case element_boolean:
+ return m_boolean == r.m_boolean;
+ case element_numeric:
+ return m_numeric == r.m_numeric;
+ case element_string:
+ return *mp_string == *r.mp_string;
+ case element_empty:
+ default:
+ ;
+ }
+
+ return true;
+ }
+
+ element& operator= (const element& r)
+ {
+ if (m_type == element_string)
+ delete mp_string;
+
+ m_type = r.m_type;
+
+ switch (m_type)
+ {
+ case element_boolean:
+ m_boolean = r.m_boolean;
+ break;
+ case element_numeric:
+ m_numeric = r.m_numeric;
+ break;
+ case element_string:
+ mp_string = new string_type(*r.mp_string);
+ break;
+ case element_empty:
+ default:
+ ;
+ }
+ return *this;
+ }
+
+ ~element()
+ {
+ if (m_type == element_string)
+ delete mp_string;
+ }
+
+ void set_empty()
+ {
+ if (m_type == element_string)
+ delete mp_string;
+ m_type = element_empty;
+ }
+
+ void set_numeric(double val)
+ {
+ if (m_type == element_string)
+ delete mp_string;
+ m_type = element_numeric;
+ m_numeric = val;
+ }
+
+ void set_boolean(bool val)
+ {
+ if (m_type == element_string)
+ delete mp_string;
+ m_type = element_boolean;
+ m_boolean = val;
+ }
+
+ void set_string(string_type* str)
+ {
+ if (m_type == element_string)
+ delete mp_string;
+ m_type = element_string;
+ mp_string = str;
+ }
+ };
+
+ class storage_base
+ {
+ public:
+ storage_base(matrix_init_element_t init) : m_init_type(init) {}
+ storage_base(const storage_base& r) : m_init_type(r.m_init_type), m_flags(r.m_flags) {}
+
+ virtual ~storage_base() {}
+
+ virtual element& get_element(size_t row, size_t col) = 0;
+
+ virtual matrix_element_t get_type(size_t row, size_t col) const = 0;
+
+ virtual double get_numeric(size_t row, size_t col) const = 0;
+ virtual const string_type* get_string(size_t row, size_t col) const = 0;
+ virtual bool get_boolean(size_t row, size_t col) const = 0;
+
+ virtual size_t rows() const = 0;
+ virtual size_t cols() const = 0;
+
+ virtual void transpose() = 0;
+ virtual void resize(size_t row, size_t col) = 0;
+ virtual void clear() = 0;
+ virtual bool numeric() = 0;
+ virtual bool empty() const = 0;
+
+ virtual storage_base* clone() const = 0;
+
+ flag_storage& get_flag_storage() { return m_flags; }
+
+ protected:
+ matrix_init_element_t get_init_type() const { return m_init_type; }
+
+ private:
+ matrix_init_element_t m_init_type;
+ flag_storage m_flags;
+ };
+
+ /**
+ * This storage creates instance for every single element, even for the
+ * empty elements.
+ */
+ class storage_filled : public storage_base
+ {
+ typedef ::boost::ptr_vector<element> row_type;
+ typedef ::boost::ptr_vector<row_type> rows_type;
+
+ public:
+ storage_filled(size_t _rows, size_t _cols, matrix_init_element_t init_type) :
+ storage_base(init_type),
+ m_numeric(false),
+ m_valid(false)
+ {
+ m_rows.reserve(_rows);
+ for (size_t i = 0; i < _rows; ++i)
+ {
+ m_rows.push_back(new row_type);
+ init_row(m_rows.back(), _cols);
+ }
+ }
+
+ storage_filled(const storage_filled& r) :
+ storage_base(r),
+ m_rows(r.m_rows),
+ m_numeric(r.m_numeric),
+ m_valid(r.m_valid) {}
+
+ virtual ~storage_filled() {}
+
+ virtual element& get_element(size_t row, size_t col)
+ {
+ m_valid = false;
+ return m_rows.at(row).at(col);
+ }
+
+ virtual matrix_element_t get_type(size_t row, size_t col) const
+ {
+ return m_rows.at(row).at(col).m_type;
+ }
+
+ virtual double get_numeric(size_t row, size_t col) const
+ {
+ const element& elem = m_rows.at(row).at(col);
+ if (elem.m_type != element_numeric && elem.m_type != element_boolean)
+ throw matrix_error("element type is not numeric.");
+
+ if (elem.m_type == element_boolean)
+ return static_cast<double>(elem.m_boolean);
+
+ return elem.m_numeric;
+ }
+
+ virtual const string_type* get_string(size_t row, size_t col) const
+ {
+ const element& elem = m_rows.at(row).at(col);
+ if (elem.m_type != element_string)
+ throw matrix_error("element type is not string.");
+
+ return elem.mp_string;
+ }
+
+ virtual bool get_boolean(size_t row, size_t col) const
+ {
+ const element& elem = m_rows.at(row).at(col);
+ if (elem.m_type != element_boolean)
+ throw matrix_error("element type is not boolean.");
+
+ return elem.m_boolean;
+ }
+
+ virtual size_t rows() const
+ {
+ return m_rows.size();
+ }
+
+ virtual size_t cols() const
+ {
+ return m_rows.empty() ? 0 : m_rows[0].size();
+ }
+
+ virtual void transpose()
+ {
+ rows_type trans_mx;
+ size_t row_size = rows(), col_size = cols();
+ trans_mx.reserve(col_size);
+ for (size_t col = 0; col < col_size; ++col)
+ {
+ trans_mx.push_back(new row_type);
+ row_type& trans_row = trans_mx.back();
+ trans_row.reserve(row_size);
+ for (size_t row = 0; row < row_size; ++row)
+ trans_row.push_back(new element(m_rows[row][col]));
+ }
+ m_rows.swap(trans_mx);
+ }
+
+ virtual void resize(size_t row, size_t col)
+ {
+ m_valid = false;
+ if (!row || !col)
+ {
+ // Empty the matrix.
+ clear();
+ return;
+ }
+
+ size_t cur_rows = rows(), cur_cols = cols();
+
+ if (row > cur_rows)
+ {
+ // Insert extra rows...
+ size_t new_row_count = row - cur_rows;
+ m_rows.reserve(row);
+ for (size_t i = 0; i < new_row_count; ++i)
+ {
+ m_rows.push_back(new row_type);
+ init_row(m_rows.back(), col);
+ }
+
+ resize_rows(cur_rows-1, cur_cols, col);
+ }
+ else if (cur_rows > row)
+ {
+ // Remove rows to new size.
+ m_rows.resize(row);
+ resize_rows(row-1, cur_cols, col);
+ }
+ else
+ {
+ assert(cur_rows == row);
+ resize_rows(cur_rows-1, cur_cols, col);
+ }
+ }
+
+ virtual void clear()
+ {
+ m_rows.clear();
+ m_valid = true;
+ m_numeric = false;
+ }
+
+ virtual bool numeric()
+ {
+ if (m_valid)
+ return m_numeric;
+
+ typename rows_type::const_iterator itr_row = m_rows.begin(), itr_row_end = m_rows.end();
+ for (; itr_row != itr_row_end; ++itr_row)
+ {
+ typename row_type::const_iterator itr_col = itr_row->begin(), itr_col_end = itr_row->end();
+ for (; itr_col != itr_col_end; ++itr_col)
+ {
+ matrix_element_t elem_type = itr_col->m_type;
+ if (elem_type != element_numeric && elem_type != element_boolean)
+ {
+ m_numeric = false;
+ m_valid = true;
+ return m_numeric;
+ }
+ }
+ }
+
+ m_numeric = true;
+ m_valid = true;
+ return m_numeric;
+ }
+
+ virtual bool empty() const
+ {
+ return m_rows.empty();
+ }
+
+ virtual storage_base* clone() const
+ {
+ return new storage_filled(*this);
+ }
+
+ private:
+
+ /**
+ * Resize rows to a new column size, from row 0 up to specified upper
+ * row.
+ */
+ void resize_rows(size_t upper_row, size_t cur_cols, size_t new_cols)
+ {
+ for (size_t i = 0; i <= upper_row; ++i)
+ {
+ // Resize pre-existing rows to new column size.
+ if (new_cols > cur_cols)
+ {
+ size_t new_col_count = new_cols - cur_cols;
+ for (size_t j = 0; j < new_col_count; ++j)
+ insert_new_elem(m_rows[i]);
+ }
+ else if (new_cols < cur_cols)
+ m_rows[i].resize(new_cols);
+ }
+ }
+
+ void init_row(row_type& row, size_t col_size)
+ {
+ row.reserve(col_size);
+ for (size_t j = 0; j < col_size; ++j)
+ insert_new_elem(row);
+ }
+
+ void insert_new_elem(row_type& row)
+ {
+ matrix_init_element_t init_type = storage_base::get_init_type();
+ switch (init_type)
+ {
+ case matrix_init_element_zero:
+ row.push_back(new element(static_cast<double>(0.0)));
+ break;
+ case matrix_init_element_empty:
+ row.push_back(new element);
+ break;
+ default:
+ throw matrix_error("unknown init type.");
+ }
+ }
+
+ private:
+ rows_type m_rows;
+ bool m_numeric:1;
+ bool m_valid:1;
+ };
+
+ /**
+ * This storage stores only non-empty elements.
+ */
+ class storage_sparse : public storage_base
+ {
+ typedef ::boost::ptr_map<size_t, element> row_type;
+ typedef ::boost::ptr_map<size_t, row_type> rows_type;
+
+ public:
+ storage_sparse(size_t _rows, size_t _cols, matrix_init_element_t init_type) :
+ storage_base(init_type),
+ m_row_size(_rows), m_col_size(_cols),
+ m_numeric(_rows && _cols), m_valid(true)
+ {
+ switch (storage_base::get_init_type())
+ {
+ case matrix_init_element_zero:
+ m_empty_elem.m_type = element_numeric;
+ m_empty_elem.m_numeric = 0.0;
+ break;
+ default:
+ m_empty_elem.m_type = element_empty;
+ m_numeric = false;
+ }
+ }
+
+ storage_sparse(const storage_sparse& r) :
+ storage_base(r),
+ m_rows(r.m_rows),
+ m_empty_elem(r.m_empty_elem),
+ m_row_size(r.m_row_size),
+ m_col_size(r.m_col_size) {}
+
+ virtual ~storage_sparse() {}
+
+ virtual element & get_element(size_t row, size_t col)
+ {
+ if (row >= m_row_size || col >= m_col_size)
+ throw matrix_error("specified element is out-of-bound.");
+
+ m_valid = false;
+
+ typename rows_type::iterator itr = m_rows.find(row);
+ if (itr == m_rows.end())
+ {
+ // Insert a brand-new row.
+ ::std::pair<typename rows_type::iterator, bool> r = m_rows.insert(row, new row_type);
+ if (!r.second)
+ throw matrix_error("failed to insert a new row instance into storage_sparse.");
+ itr = r.first;
+ }
+
+ row_type& row_store = *itr->second;
+ typename row_type::iterator itr_elem = row_store.find(col);
+ if (itr_elem == row_store.end())
+ {
+ // Insert a new element at this column position.
+ ::std::pair<typename row_type::iterator, bool> r = row_store.insert(col, new element);
+ if (!r.second)
+ throw matrix_error("failed to insert a new element instance.");
+ itr_elem = r.first;
+ }
+ return *itr_elem->second;
+ }
+
+ virtual matrix_element_t get_type(size_t row, size_t col) const
+ {
+ typename rows_type::const_iterator itr = m_rows.find(row);
+ if (itr == m_rows.end())
+ return m_empty_elem.m_type;
+
+ const row_type& row_store = *itr->second;
+ typename row_type::const_iterator itr_elem = row_store.find(col);
+ if (itr_elem == row_store.end())
+ return m_empty_elem.m_type;
+
+ return itr_elem->second->m_type;
+ }
+
+ virtual double get_numeric(size_t row, size_t col) const
+ {
+ matrix_element_t elem_type = get_type(row, col);
+ if (elem_type != element_numeric && elem_type != element_boolean)
+ throw matrix_error("element type is not numeric.");
+
+ const element& elem = get_non_empty_element(row, col);
+
+ if (elem.m_type == element_boolean)
+ return static_cast<double>(elem.m_boolean);
+
+ return elem.m_numeric;
+ }
+
+ virtual const string_type* get_string(size_t row, size_t col) const
+ {
+ matrix_element_t elem_type = get_type(row, col);
+ if (elem_type != element_string)
+ throw matrix_error("element type is not string.");
+
+ return get_non_empty_element(row, col).mp_string;
+ }
+
+ virtual bool get_boolean(size_t row, size_t col) const
+ {
+ matrix_element_t elem_type = get_type(row, col);
+ if (elem_type != element_boolean)
+ throw matrix_error("element type is not string.");
+
+ return get_non_empty_element(row, col).m_boolean;
+ }
+
+ virtual size_t rows() const
+ {
+ return m_row_size;
+ }
+
+ virtual size_t cols() const
+ {
+ return m_col_size;
+ }
+
+ typedef ::std::pair<size_t, size_t> elem_pos_type;
+
+ struct elem_pos_sorter : ::std::binary_function<elem_pos_type, elem_pos_type, bool>
+ {
+ bool operator() (const elem_pos_type& left, const elem_pos_type& right) const
+ {
+ if (left.first != right.first)
+ return left.first < right.first;
+ return left.second < right.second;
+ }
+ };
+
+ virtual void transpose()
+ {
+ using namespace std;
+
+ rows_type trans;
+
+ // First, pick up the positions of all non-empty elements.
+ vector<elem_pos_type> filled_elems;
+ {
+ typename rows_type::const_iterator itr_row = m_rows.begin(), itr_row_end = m_rows.end();
+ for (; itr_row != itr_row_end; ++itr_row)
+ {
+ size_t row_idx = itr_row->first;
+ const row_type& row = *itr_row->second;
+ typename row_type::const_iterator itr_col = row.begin(), itr_col_end = row.end();
+ for (; itr_col != itr_col_end; ++itr_col)
+ {
+ // Be sure to swap the row and column indices.
+ filled_elems.push_back(elem_pos_type(itr_col->first, row_idx));
+ }
+ }
+ }
+ // Sort by row index first, then by column index.
+ sort(filled_elems.begin(), filled_elems.end(), elem_pos_sorter());
+
+ // Iterate through the non-empty element positions and perform
+ // transposition.
+ typename vector<elem_pos_type>::const_iterator
+ itr_pos = filled_elems.begin(), itr_pos_end = filled_elems.end();
+ while (itr_pos != itr_pos_end)
+ {
+ // First item of the new row.
+ size_t row_idx = itr_pos->first;
+ size_t col_idx = itr_pos->second;
+ pair<typename rows_type::iterator, bool> r = trans.insert(row_idx, new row_type);
+ if (!r.second)
+ throw matrix_error("failed to insert a new row instance during transposition.");
+
+ typename rows_type::iterator itr_row = r.first;
+ row_type& row = *itr_row->second;
+ pair<typename row_type::iterator, bool> r2 =
+ row.insert(col_idx, new element(m_rows[col_idx][row_idx]));
+ if (!r2.second)
+ throw matrix_error("afiled to insert a new element instance during transposition.");
+
+ // Keep iterating until we get a different row index.
+ for (++itr_pos; itr_pos != itr_pos_end && itr_pos->first == row_idx; ++itr_pos)
+ {
+ col_idx = itr_pos->second;
+ r2 = row.insert(col_idx, new element(m_rows[col_idx][row_idx]));
+ if (!r2.second)
+ throw matrix_error("afiled to insert a new element instance during transposition.");
+ }
+ }
+
+ m_rows.swap(trans);
+ ::std::swap(m_row_size, m_col_size);
+ }
+
+ virtual void resize(size_t row, size_t col)
+ {
+ m_valid = false;
+
+ if (!row || !col)
+ {
+ clear();
+ return;
+ }
+
+ // Resizing a sparse matrix need to modify the data only when
+ // shrinking.
+
+ if (m_row_size > row)
+ {
+ // Remove all rows where the row index is greater than or
+ // equal to 'row'.
+ typename rows_type::iterator itr = m_rows.lower_bound(row);
+ m_rows.erase(itr, m_rows.end());
+ }
+
+ if (m_col_size > col)
+ {
+ typename rows_type::iterator itr = m_rows.begin(), itr_end = m_rows.end();
+ for (; itr != itr_end; ++itr)
+ {
+ // Now, remove all columns where the column index is
+ // greater than or equal to 'col'.
+ row_type& row_container = *itr->second;
+ typename row_type::iterator itr_elem = row_container.lower_bound(col);
+ row_container.erase(itr_elem, row_container.end());
+ }
+ }
+
+ m_row_size = row;
+ m_col_size = col;
+ }
+
+ virtual void clear()
+ {
+ m_rows.clear();
+ m_row_size = 0;
+ m_col_size = 0;
+ m_valid = true;
+ m_numeric = false;
+ }
+
+ virtual bool numeric()
+ {
+ using namespace std;
+
+ if (m_valid)
+ return m_numeric;
+
+ size_t non_empty_count = 0;
+ typename rows_type::const_iterator itr_row = m_rows.begin(), itr_row_end = m_rows.end();
+ for (; itr_row != itr_row_end; ++itr_row)
+ {
+ const row_type& row = *itr_row->second;
+ non_empty_count += row.size();
+ assert(row.size() <= m_col_size);
+ typename row_type::const_iterator itr_col = row.begin(), itr_col_end = row.end();
+ for (; itr_col != itr_col_end; ++itr_col)
+ {
+ const element& elem = *itr_col->second;
+ if (elem.m_type != element_numeric && elem.m_type != element_boolean)
+ {
+ m_valid = true;
+ m_numeric = false;
+ return m_numeric;
+ }
+ }
+ }
+
+ // All non-empty elements are numeric.
+
+ matrix_init_element_t init_type = storage_base::get_init_type();
+ if (init_type == matrix_init_element_zero)
+ m_numeric = true;
+ else
+ {
+ size_t total_elem_count = m_row_size * m_col_size;
+ assert(non_empty_count <= total_elem_count);
+ m_numeric = total_elem_count == non_empty_count;
+ }
+
+ m_valid = true;
+ return m_numeric;
+ }
+
+ virtual bool empty() const
+ {
+ // If one of row and column sizes are zero, the other size must be
+ // zero, and vise versa.
+ assert((!m_row_size && !m_col_size) || (m_row_size && m_col_size));
+
+ return m_row_size == 0 || m_col_size == 0;
+ }
+
+ virtual storage_base* clone() const
+ {
+ return new storage_sparse(*this);
+ }
+
+ private:
+ const element& get_non_empty_element(size_t row, size_t col) const
+ {
+ typename rows_type::const_iterator itr = m_rows.find(row);
+ if (itr == m_rows.end())
+ return m_empty_elem;
+
+ const row_type& row_store = *itr->second;
+ typename row_type::const_iterator itr_elem = row_store.find(col);
+ if (itr_elem == row_store.end())
+ return m_empty_elem;
+ return *itr_elem->second;
+ }
+
+ private:
+ rows_type m_rows;
+ element m_empty_elem;
+ size_t m_row_size;
+ size_t m_col_size;
+ bool m_numeric:1;
+ bool m_valid:1;
+ };
+
+private:
+ static storage_base* create_storage(size_t rows, size_t cols, matrix_density_t density);
+
+private:
+ storage_base* mp_storage;
+};
+
+template<typename _String, typename _Flag>
+typename quad_type_matrix<_String,_Flag>::storage_base*
+quad_type_matrix<_String,_Flag>::create_storage(size_t rows, size_t cols, matrix_density_t density)
+{
+ switch (density)
+ {
+ case matrix_density_filled_zero:
+ return new storage_filled(rows, cols, matrix_init_element_zero);
+ case matrix_density_filled_empty:
+ return new storage_filled(rows, cols, matrix_init_element_empty);
+ case matrix_density_sparse_zero:
+ return new storage_sparse(rows, cols, matrix_init_element_zero);
+ case matrix_density_sparse_empty:
+ return new storage_sparse(rows, cols, matrix_init_element_empty);
+ default:
+ throw matrix_error("unknown density type");
+ }
+ return NULL;
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>::quad_type_matrix() :
+ mp_storage(NULL)
+{
+ mp_storage = create_storage(0, 0, matrix_density_filled_zero);
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>::quad_type_matrix(matrix_density_t density) :
+ mp_storage(NULL)
+{
+ mp_storage = create_storage(0, 0, density);
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>::quad_type_matrix(size_t rows, size_t cols, matrix_density_t density) :
+ mp_storage(NULL)
+{
+ mp_storage = create_storage(rows, cols, density);
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>::quad_type_matrix(const quad_type_matrix& r) :
+ mp_storage(r.mp_storage->clone())
+{
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>::~quad_type_matrix()
+{
+ delete mp_storage;
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>&
+quad_type_matrix<_String,_Flag>::operator= (const quad_type_matrix& r)
+{
+ if (this == &r)
+ // self assignment.
+ return *this;
+
+ delete mp_storage;
+ mp_storage = r.mp_storage->clone();
+ return *this;
+}
+
+template<typename _String, typename _Flag>
+matrix_element_t quad_type_matrix<_String,_Flag>::get_type(size_t row, size_t col) const
+{
+ return mp_storage->get_type(row, col);
+}
+
+template<typename _String, typename _Flag>
+double quad_type_matrix<_String,_Flag>::get_numeric(size_t row, size_t col) const
+{
+ return mp_storage->get_numeric(row, col);
+}
+
+template<typename _String, typename _Flag>
+bool quad_type_matrix<_String,_Flag>::get_boolean(size_t row, size_t col) const
+{
+ return mp_storage->get_boolean(row, col);
+}
+
+template<typename _String, typename _Flag>
+const typename quad_type_matrix<_String,_Flag>::string_type*
+quad_type_matrix<_String,_Flag>::get_string(size_t row, size_t col) const
+{
+ return mp_storage->get_string(row, col);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set_numeric(size_t row, size_t col, double val)
+{
+ mp_storage->get_element(row, col).set_numeric(val);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set_boolean(size_t row, size_t col, bool val)
+{
+ mp_storage->get_element(row, col).set_boolean(val);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set_string(size_t row, size_t col, string_type* str)
+{
+ mp_storage->get_element(row, col).set_string(str);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set_flag(size_t row, size_t col, flag_type flag)
+{
+ mp_storage->get_flag_storage().set_flag(row, col, flag);
+}
+
+template<typename _String, typename _Flag>
+typename quad_type_matrix<_String,_Flag>::flag_type
+quad_type_matrix<_String,_Flag>::get_flag(size_t row, size_t col) const
+{
+ return mp_storage->get_flag_storage().get_flag(row, col);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::clear_flag(size_t row, size_t col)
+{
+ return mp_storage->get_flag_storage().clear_flag(row, col);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set_empty(size_t row, size_t col)
+{
+ mp_storage->get_element(row, col).set_empty();
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set(size_t row, size_t col, double val)
+{
+ set_numeric(row, col, val);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set(size_t row, size_t col, bool val)
+{
+ set_boolean(row, col, val);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::set(size_t row, size_t col, string_type* str)
+{
+ set_string(row, col, str);
+}
+
+template<typename _String, typename _Flag>
+typename quad_type_matrix<_String,_Flag>::size_pair_type
+quad_type_matrix<_String,_Flag>::size() const
+{
+ size_pair_type size_pair(mp_storage->rows(), mp_storage->cols());
+ return size_pair;
+}
+
+template<typename _String, typename _Flag>
+quad_type_matrix<_String,_Flag>&
+quad_type_matrix<_String,_Flag>::transpose()
+{
+ mp_storage->transpose();
+ return *this;
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::assign(const quad_type_matrix& r)
+{
+ if (this == &r)
+ // assignment to self.
+ return;
+
+ size_t row_count = ::std::min(mp_storage->rows(), r.mp_storage->rows());
+ size_t col_count = ::std::min(mp_storage->cols(), r.mp_storage->cols());
+ for (size_t i = 0; i < row_count; ++i)
+ for (size_t j = 0; j < col_count; ++j)
+ mp_storage->get_element(i, j) = r.mp_storage->get_element(i, j);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::resize(size_t row, size_t col)
+{
+ mp_storage->resize(row, col);
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::clear()
+{
+ mp_storage->clear();
+}
+
+template<typename _String, typename _Flag>
+bool quad_type_matrix<_String,_Flag>::numeric() const
+{
+ return mp_storage->numeric();
+}
+
+template<typename _String, typename _Flag>
+bool quad_type_matrix<_String,_Flag>::empty() const
+{
+ return mp_storage->empty();
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::swap(quad_type_matrix& r)
+{
+ ::std::swap(mp_storage, r.mp_storage);
+}
+
+#ifdef UNIT_TEST
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::dump() const
+{
+ using namespace std;
+ size_t rows = mp_storage->rows(), cols = mp_storage->cols();
+ cout << "rows: " << mp_storage->rows() << " cols: " << mp_storage->cols() << endl;
+ for (size_t i = 0; i < rows; ++i)
+ {
+ cout << "row " << i << ": ";
+ for (size_t j = 0; j < cols; ++j)
+ {
+ matrix_element_t etype = mp_storage->get_type(i, j);
+ if (j > 0)
+ cout << ", ";
+ cout << "(col " << j << ": ";
+ switch (etype)
+ {
+ case element_boolean:
+ cout << boolalpha << mp_storage->get_boolean(i, j) << noboolalpha;
+ break;
+ case element_empty:
+ cout << "-";
+ break;
+ case element_numeric:
+ cout << mp_storage->get_numeric(i, j);
+ break;
+ case element_string:
+ cout << "'" << mp_storage->get_string(i, j) << "'";
+ break;
+ default:
+ ;
+ }
+ cout << ")";
+ }
+ cout << endl;
+ }
+}
+
+template<typename _String, typename _Flag>
+void quad_type_matrix<_String,_Flag>::dump_flags() const
+{
+ mp_storage->get_flag_storage().dump();
+}
+#endif
+
+}
+
+#endif
diff --git a/inc/mdds/rectangle_set.hpp b/include/mdds/rectangle_set.hpp
similarity index 99%
rename from inc/mdds/rectangle_set.hpp
rename to include/mdds/rectangle_set.hpp
index d34e08e..5cfd99e 100644
--- a/inc/mdds/rectangle_set.hpp
+++ b/include/mdds/rectangle_set.hpp
@@ -30,9 +30,9 @@
#include "segment_tree.hpp"
#include "global.hpp"
+#include "hash_container/map.hpp"
#include <vector>
-#include <unordered_map>
#include <boost/ptr_container/ptr_map.hpp>
namespace mdds {
@@ -81,7 +81,7 @@ private:
return !operator==(r);
}
};
- typedef ::std::unordered_map<data_type*, rectangle> dataset_type;
+ typedef _mdds_unordered_map_type<data_type*, rectangle> dataset_type;
private:
typedef segment_tree<key_type, data_type> inner_type;
typedef segment_tree<key_type, inner_type> outer_type;
diff --git a/inc/mdds/segment_tree.hpp b/include/mdds/segment_tree.hpp
similarity index 97%
rename from inc/mdds/segment_tree.hpp
rename to include/mdds/segment_tree.hpp
index b89ca23..9c07739 100644
--- a/inc/mdds/segment_tree.hpp
+++ b/include/mdds/segment_tree.hpp
@@ -29,11 +29,12 @@
#define __MDDS_SEGMENTTREE_HPP__
#include "node.hpp"
+#include "hash_container/map.hpp"
#include <vector>
#include <list>
#include <iostream>
-#include <unordered_map>
+#include <map>
#include <boost/shared_ptr.hpp>
#include <boost/ptr_container/ptr_map.hpp>
@@ -161,7 +162,8 @@ public:
private:
#endif
typedef ::std::vector<data_type*> data_chain_type;
- typedef ::std::unordered_map<data_type*, ::std::pair<key_type, key_type> > segment_map_type;
+ typedef _mdds_unordered_map_type<data_type*, ::std::pair<key_type, key_type> > segment_map_type;
+ typedef ::std::map<data_type*, ::std::pair<key_type, key_type> > sorted_segment_map_type;
struct nonleaf_value_type
{
@@ -735,11 +737,11 @@ bool segment_tree<_Key, _Data>::operator==(const segment_tree& r) const
if (m_valid_tree != r.m_valid_tree)
return false;
- // First, we need to re-organize the segment data so that they are sorted
- // by the data pointer values.
-
- typename segment_map_type::const_iterator itr1 = m_segment_data.begin(), itr1_end = m_segment_data.end();
- typename segment_map_type::const_iterator itr2 = r.m_segment_data.begin(), itr2_end = r.m_segment_data.end();
+ // Sort the data by key values first.
+ sorted_segment_map_type seg1(m_segment_data.begin(), m_segment_data.end());
+ sorted_segment_map_type seg2(r.m_segment_data.begin(), r.m_segment_data.end());
+ typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
+ typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
for (; itr1 != itr1_end; ++itr1, ++itr2)
{
@@ -1174,8 +1176,12 @@ bool segment_tree<_Key, _Data>::verify_leaf_nodes(const ::std::vector<leaf_node_
template<typename _Key, typename _Data>
bool segment_tree<_Key, _Data>::verify_segment_data(const segment_map_type& checks) const
{
- typename segment_map_type::const_iterator itr1 = checks.begin(), itr1_end = checks.end();
- typename segment_map_type::const_iterator itr2 = m_segment_data.begin(), itr2_end = m_segment_data.end();
+ // Sort the data by key values first.
+ sorted_segment_map_type seg1(checks.begin(), checks.end());
+ sorted_segment_map_type seg2(m_segment_data.begin(), m_segment_data.end());
+
+ typename sorted_segment_map_type::const_iterator itr1 = seg1.begin(), itr1_end = seg1.end();
+ typename sorted_segment_map_type::const_iterator itr2 = seg2.begin(), itr2_end = seg2.end();
for (; itr1 != itr1_end; ++itr1, ++itr2)
{
if (itr2 == itr2_end)
diff --git a/inc/nodecontainer.hpp b/include/nodecontainer.hpp
similarity index 100%
rename from inc/nodecontainer.hpp
rename to include/nodecontainer.hpp
diff --git a/inc/rangetree.hpp b/include/rangetree.hpp
similarity index 100%
rename from inc/rangetree.hpp
rename to include/rangetree.hpp
diff --git a/src/point_quad_tree_test.cpp b/src/point_quad_tree_test.cpp
index d3d8bea..edc8736 100644
--- a/src/point_quad_tree_test.cpp
+++ b/src/point_quad_tree_test.cpp
@@ -27,11 +27,11 @@
#include "mdds/point_quad_tree.hpp"
-#include <cstdint>
#include <algorithm>
#include <vector>
#include <sstream>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/cstdint.hpp>
#include <stdio.h>
#include <string>
@@ -78,6 +78,7 @@ private:
using namespace std;
using namespace mdds;
using ::boost::ptr_vector;
+using ::boost::uint16_t;
struct data_printer : public unary_function<string*, void>
{
@@ -88,9 +89,9 @@ struct data_printer : public unary_function<string*, void>
};
template<typename _DbType>
-struct search_result_printer : public unary_function<pair<typename _DbType::point, typename _DbType::data_type*>, void>
+struct search_result_printer : public unary_function<pair<typename _DbType::point, typename _DbType::data_type>, void>
{
- void operator() (const pair<const typename _DbType::point, const typename _DbType::data_type*>& r) const
+ void operator() (const pair<const typename _DbType::point, const typename _DbType::data_type>& r) const
{
cout << " (x=" << r.first.x << ", y=" << r.first.y << ", value='" << *r.second << "')" << endl;
}
@@ -99,7 +100,7 @@ struct search_result_printer : public unary_function<pair<typename _DbType::poin
void pqt_test_basic()
{
StackPrinter __stack_printer__("::pqt_test");
- typedef point_quad_tree<uint16_t, string> db_type;
+ typedef point_quad_tree<uint16_t, const string*> db_type;
db_type db;
string A("A");
@@ -176,7 +177,7 @@ void pqt_test_basic()
void pqt_test_insertion_removal()
{
StackPrinter __stack_printer__("::pqt_test_insertion_removal");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
db_type db;
// Check its empty-ness...
@@ -202,7 +203,7 @@ void pqt_test_insertion_removal()
{
int32_t x = i*10 + 1, y = j*10 + 1;
size_t index = i*10 + j;
- string* data_ptr = &data_store[index];
+ const string* data_ptr = &data_store[index];
cout << "inserting '" << *data_ptr << "' at (" << x << "," << y << ")" << endl;
db.insert(x, y, data_ptr);
expected.push_back(db_type::node_data(x, y, data_ptr));
@@ -236,7 +237,7 @@ void pqt_test_insertion_removal()
void pqt_test_remove_root()
{
StackPrinter __stack_printer__("::pqt_test_remove_root");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
string O("O");
string NW("NW");
string NE("NE");
@@ -279,7 +280,7 @@ void pqt_test_equality()
{
StackPrinter __stack_printer__("::pqt_test_equality");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
db_type db1, db2;
string A("A");
@@ -329,7 +330,7 @@ void pqt_test_equality()
void pqt_test_assignment()
{
StackPrinter __stack_printer__("::pqt_test_assignment");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
db_type db1, db2;
string A("A");
string B("B");
@@ -368,7 +369,7 @@ void pqt_test_assignment()
void pqt_test_swap()
{
StackPrinter __stack_printer__("::pqt_test_swap");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
db_type db1, db2;
string A("A");
string B("B");
@@ -401,21 +402,26 @@ template<typename _DbType>
bool verify_find(
const _DbType& db,
typename _DbType::key_type x, typename _DbType::key_type y,
- const typename _DbType::data_type* data)
+ const typename _DbType::data_type data)
{
- const typename _DbType::data_type* found = db.find(x, y);
- if (found)
- cout << "found at (" << x << "," << y << "): " << *found << endl;
- else
+ try
+ {
+ typename _DbType::data_type found = db.find(x, y);
+ cout << "found at (" << x << "," << y << "): " << found << endl;
+ if (found == data)
+ return true;
+ }
+ catch (const typename _DbType::data_not_found&)
+ {
cout << "nothing found at (" << x << "," << y << ")" << endl;
-
- return found && (found == data);
+ }
+ return false;
}
void pqt_test_find()
{
StackPrinter __stack_printer__("::pqt_test_find");
- typedef point_quad_tree<int32_t, string> db_type;
+ typedef point_quad_tree<int32_t, const string*> db_type;
db_type db;
string A("A");
string B("B");
@@ -455,6 +461,38 @@ void pqt_test_find()
assert(!check);
}
+void pqt_test_node_access()
+{
+ StackPrinter __stack_printer__("::pqt_test_node_access");
+ typedef point_quad_tree<int32_t, const string*> db_type;
+ db_type db;
+ db_type::node_access nac = db.get_node_access();
+ assert(!nac);
+ string A("A");
+ string B("B");
+ string C("C");
+ string D("D");
+ string E("E");
+ string F("F");
+ db.insert(92, 27, &A);
+ db.insert(53, 26, &B);
+ db.insert(69, 18, &C);
+ db.insert(0, 78, &D);
+ db.insert(17, 7, &E);
+ db.insert(91, 88, &F);
+ assert(db.size() == 6);
+
+ nac = db.get_node_access();
+ // Test root node.
+ assert(nac);
+ assert(nac.x() == 92);
+ assert(nac.y() == 27);
+ assert(nac.data() == &A);
+
+ bool success = db.verify_node_iterator(nac);
+ assert(success);
+}
+
int main()
{
pqt_test_basic();
@@ -464,6 +502,7 @@ int main()
pqt_test_assignment();
pqt_test_swap();
pqt_test_find();
+ pqt_test_node_access();
assert(get_node_instance_count() == 0);
cout << "Test finished successfully!" << endl;
return EXIT_SUCCESS;
diff --git a/src/quad_type_matrix_test.cpp b/src/quad_type_matrix_test.cpp
new file mode 100644
index 0000000..ed4648c
--- /dev/null
+++ b/src/quad_type_matrix_test.cpp
@@ -0,0 +1,676 @@
+/*************************************************************************
+ *
+ * Copyright (c) 2010 Kohei Yoshida
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ ************************************************************************/
+
+#include "mdds/quad_type_matrix.hpp"
+
+#include <sstream>
+#include <cassert>
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+#include <stdio.h>
+#include <sys/time.h>
+
+namespace {
+
+class StackPrinter
+{
+public:
+ explicit StackPrinter(const char* msg) :
+ msMsg(msg)
+ {
+ fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+ mfStartTime = getTime();
+ }
+
+ ~StackPrinter()
+ {
+ double fEndTime = getTime();
+ fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
+ }
+
+ void printTime(int line) const
+ {
+ double fEndTime = getTime();
+ fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
+ }
+
+private:
+ double getTime() const
+ {
+ timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec + tv.tv_usec / 1000000.0;
+ }
+
+ ::std::string msMsg;
+ double mfStartTime;
+};
+
+}
+
+using namespace std;
+using namespace mdds;
+
+typedef quad_type_matrix<string, uint8_t> mx_type;
+typedef void (test_func_type)(matrix_density_t);
+
+/**
+ * Run specified test on all matrix density types.
+ *
+ * @param func function pointer to the test function to be performed.
+ */
+void run_tests_on_all_density_types(test_func_type* func)
+{
+ func(matrix_density_filled_zero);
+ func(matrix_density_filled_empty);
+ func(matrix_density_sparse_zero);
+ func(matrix_density_sparse_empty);
+}
+
+string get_mx_density_name(matrix_density_t dens)
+{
+ switch (dens)
+ {
+ case matrix_density_filled_zero:
+ return "density filled with zero base elements";
+ case matrix_density_filled_empty:
+ return "density filled with empty base elements";
+ case matrix_density_sparse_zero:
+ return "density sparse with zero base elements";
+ case matrix_density_sparse_empty:
+ return "density sparse with empty base elements";
+ default:
+ ;
+ }
+ return "unknown density";
+}
+
+void print_mx_density_type(matrix_density_t dens)
+{
+ cout << "matrix density type: " << get_mx_density_name(dens) << endl;
+}
+
+template<typename _Mx>
+bool verify_transposed_matrix(const _Mx& original, const _Mx& transposed)
+{
+ pair<size_t, size_t> mx_size = original.size(), mx_size_trans = transposed.size();
+ if (mx_size.first != mx_size_trans.second || mx_size.second != mx_size_trans.first)
+ return false;
+
+ for (size_t row = 0; row < mx_size.first; ++row)
+ {
+ for (size_t col = 0; col < mx_size.second; ++col)
+ {
+ matrix_element_t elem_type = original.get_type(row, col);
+ if (elem_type != transposed.get_type(col, row))
+ return false;
+
+ switch (elem_type)
+ {
+ case element_boolean:
+ if (original.get_boolean(row, col) != transposed.get_boolean(col, row))
+ return false;
+ break;
+ case element_numeric:
+ if (original.get_numeric(row, col) != transposed.get_numeric(col, row))
+ return false;
+ break;
+ case element_string:
+ if (*original.get_string(row, col) != *transposed.get_string(col, row))
+ return false;
+ break;
+ case element_empty:
+ default:
+ ;
+ }
+ }
+ }
+ return true;
+}
+
+template<typename _Mx>
+bool verify_init_zero(const _Mx& mx)
+{
+ pair<size_t,size_t> mxsize = mx.size();
+ for (size_t row = 0; row < mxsize.first; ++row)
+ {
+ for (size_t col = 0; col < mxsize.second; ++col)
+ {
+ if (mx.get_type(row, col) != element_numeric)
+ return false;
+ if (mx.get_numeric(row, col) != 0.0)
+ return false;
+ }
+ }
+ return true;
+}
+
+template<typename _Mx>
+bool verify_init_empty(const _Mx& mx)
+{
+ pair<size_t,size_t> mxsize = mx.size();
+ for (size_t row = 0; row < mxsize.first; ++row)
+ {
+ for (size_t col = 0; col < mxsize.second; ++col)
+ {
+ if (mx.get_type(row, col) != element_empty)
+ return false;
+ }
+ }
+ return true;
+}
+
+template<typename _Mx>
+bool verify_assign(const _Mx& mx1, const _Mx& mx2)
+{
+ size_t row_count = min(mx1.size().first, mx2.size().first);
+ size_t col_count = min(mx1.size().second, mx2.size().second);
+ for (size_t i = 0; i < row_count; ++i)
+ {
+ for (size_t j = 0; j < col_count; ++j)
+ {
+ matrix_element_t elem_type = mx1.get_type(i, j);
+ if (elem_type != mx2.get_type(i, j))
+ return false;
+
+ switch (elem_type)
+ {
+ case element_boolean:
+ if (mx1.get_boolean(i, j) != mx2.get_boolean(i, j))
+ return false;
+ break;
+ case element_numeric:
+ if (mx1.get_numeric(i, j) != mx2.get_numeric(i, j))
+ return false;
+ break;
+ case element_string:
+ if (*mx1.get_string(i, j) != *mx2.get_string(i, j))
+ return false;
+ break;
+ case element_empty:
+ default:
+ ;
+ }
+ }
+ }
+ return true;
+}
+
+template<typename _Mx>
+bool verify_assignment(const _Mx& mx1, const _Mx& mx2)
+{
+ if (mx1.size() != mx2.size())
+ return false;
+
+ return verify_assign<_Mx>(mx1, mx2);
+}
+
+void qtm_test_resize(matrix_density_t density)
+{
+ StackPrinter __stack_printer__("::qtm_test_resize");
+ print_mx_density_type(density);
+ pair<size_t,size_t> mxsize;
+ mx_type mx(3, 3, density);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 3);
+ assert(mxsize.second == 3);
+
+ mx.set_string(0, 0, new string("test"));
+ mx.set_numeric(0, 1, 2.3);
+ mx.set_boolean(1, 1, false);
+ mx.set_numeric(1, 2, 45.4);
+ mx.set_empty(2, 0);
+ mx.set_empty(2, 1);
+ mx.set_empty(2, 2);
+ mx.dump();
+ mx.resize(6, 4);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 6);
+ assert(mxsize.second == 4);
+ mx.resize(6, 6);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 6);
+ assert(mxsize.second == 6);
+ mx.resize(3, 6);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 3);
+ assert(mxsize.second == 6);
+
+ mx.resize(3, 3);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 3);
+ assert(mxsize.second == 3);
+
+ mx.resize(0, 0);
+ mx.dump();
+ mxsize = mx.size();
+ assert(mxsize.first == 0);
+ assert(mxsize.second == 0);
+ assert(mx.empty());
+}
+
+void qtm_test_value_store(matrix_density_t density)
+{
+ StackPrinter __stack_printer__("::qtm_test_value_store");
+ print_mx_density_type(density);
+ mx_type mx(5, 5, density);
+ mx.dump();
+ pair<size_t,size_t> mxsize = mx.size();
+ assert(mxsize.first == 5);
+ assert(mxsize.second == 5);
+ assert(!mx.empty());
+
+ // Make sure all elements have been initialized properly according to the
+ // matrix type.
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ matrix_element_t elem_type = mx.get_type(i, j);
+ switch (density)
+ {
+ case matrix_density_filled_zero:
+ case matrix_density_sparse_zero:
+ {
+ // filled matrices are initialized to numeric elements
+ // having a value of 0.
+ assert(elem_type == element_numeric);
+ double val = mx.get_numeric(i, j);
+ assert(val == 0.0);
+ }
+ break;
+ case matrix_density_filled_empty:
+ case matrix_density_sparse_empty:
+ // sparse matrices are initialized to empty elements.
+ assert(elem_type == element_empty);
+ break;
+ }
+ }
+ }
+
+ // Insert strings into all elements.
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ ostringstream os;
+ os << "(" << i << "," << j << ")";
+ mx.set_string(i, j, new string(os.str()));
+ }
+ }
+ mx.dump();
+
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ matrix_element_t elem_type = mx.get_type(i, j);
+ assert(elem_type == element_string);
+ string s = *mx.get_string(i, j);
+ cout << s << " ";
+ }
+ cout << endl;
+ }
+
+ // Now, boolean values. Note that these operations should de-alloocate
+ // all previously stored strings.
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ bool b = (i+j)%2 ? true : false;
+ mx.set_boolean(i, j, b);
+ }
+ }
+ mx.dump();
+
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ matrix_element_t elem_type = mx.get_type(i, j);
+ assert(elem_type == element_boolean);
+ bool stored = mx.get_boolean(i, j);
+ bool expected = (i+j)%2 ? true : false;
+ assert(stored == expected);
+ }
+ }
+
+ // Make all elements empty.
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ mx.set_empty(i, j);
+ }
+ }
+ mx.dump();
+
+ for (size_t i = 0; i < 5; ++i)
+ {
+ for (size_t j = 0; j < 5; ++j)
+ {
+ matrix_element_t elem_type = mx.get_type(i, j);
+ assert(elem_type == element_empty);
+ }
+ }
+}
+
+template<typename _Mx>
+void print_transposed_mx(const _Mx& original, const _Mx& transposed)
+{
+ cout << "original matrix:" << endl;
+ original.dump();
+ cout << "transposed matrix:" << endl;
+ transposed.dump();
+}
+
+void qtm_test_transpose(matrix_density_t density)
+{
+ StackPrinter __stack_printer__("::qtm_test_transpose");
+ print_mx_density_type(density);
+
+ {
+ // Transposition of square matrix.
+ mx_type mx(3, 3, density);
+ mx.set_numeric(0, 1, 1);
+ mx.set_numeric(0, 2, 1);
+ mx.set_numeric(1, 2, 1);
+ mx.set_numeric(1, 0, 2);
+ mx.set_numeric(2, 0, 2);
+ mx.set_numeric(2, 1, 2);
+ mx_type mx_trans(mx);
+ mx_trans.transpose();
+ print_transposed_mx(mx, mx_trans);
+ bool success = verify_transposed_matrix(mx, mx_trans);
+ assert(success);
+ }
+
+ {
+ // Non-square matrix.
+ mx_type mx(5, 3, density);
+ mx.set_numeric(0, 0, 10);
+ mx.set_boolean(1, 0, true);
+ mx.set_boolean(2, 0, false);
+ mx.set_numeric(3, 0, 23);
+ mx.set_string(3, 2, new string("test"));
+ mx.set_empty(4, 0);
+ mx_type mx_trans(mx);
+ mx_trans.transpose();
+ print_transposed_mx(mx, mx_trans);
+ bool success = verify_transposed_matrix(mx, mx_trans);
+ assert(success);
+ }
+
+ {
+ // Empty matrix.
+ mx_type mx, mx_trans;
+ mx_trans.transpose();
+ print_transposed_mx(mx, mx_trans);
+ bool success = verify_transposed_matrix(mx, mx_trans);
+ assert(success);
+ }
+}
+
+void qtm_test_initial_elements()
+{
+ StackPrinter __stack_printer__("::qtm_test_initial_elements");
+ {
+ mx_type mx(3, 3, matrix_density_filled_zero);
+ mx.dump();
+ bool success = verify_init_zero(mx);
+ assert(success);
+ assert(mx.numeric());
+ mx.resize(15, 14);
+ assert(mx.numeric());
+ }
+
+ {
+ mx_type mx(3, 3, matrix_density_filled_empty);
+ mx.dump();
+ bool success = verify_init_empty(mx);
+ assert(success);
+ assert(!mx.numeric());
+ }
+
+ {
+ mx_type mx(3, 3, matrix_density_sparse_zero);
+ mx.dump();
+ bool success = verify_init_zero(mx);
+ assert(success);
+ assert(mx.numeric());
+ mx.resize(10, 32);
+ assert(mx.numeric());
+ }
+
+ {
+ mx_type mx(3, 3, matrix_density_sparse_empty);
+ mx.dump();
+ bool success = verify_init_empty(mx);
+ assert(success);
+ assert(!mx.numeric());
+ }
+}
+
+void qtm_test_numeric_matrix()
+{
+ StackPrinter __stack_printer__("::qtm_test_numeric_matrix");
+ {
+ print_mx_density_type(matrix_density_filled_zero);
+ mx_type mx(3, 3, matrix_density_filled_zero);
+ mx.dump();
+ assert(mx.numeric());
+ mx.set_empty(0, 0);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.resize(5, 5);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.resize(2, 2);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.set_numeric(0, 0, 50);
+ mx.dump();
+ assert(mx.numeric());
+ mx.set_boolean(1, 1, true);
+ mx.dump();
+ assert(mx.numeric());
+ assert(mx.get_numeric(1, 1) == 1.0);
+ mx.set_string(1, 0, new string("test"));
+ mx.dump();
+ assert(!mx.numeric());
+ }
+
+ {
+ print_mx_density_type(matrix_density_sparse_zero);
+ mx_type mx(3, 3, matrix_density_sparse_zero);
+ mx.dump();
+ assert(mx.numeric());
+ mx.set_empty(0, 0);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.resize(5, 5);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.resize(2, 2);
+ mx.dump();
+ assert(!mx.numeric());
+ mx.set_numeric(0, 0, 50);
+ mx.dump();
+ assert(mx.numeric());
+ mx.set_boolean(1, 1, true);
+ mx.dump();
+ assert(mx.numeric());
+ assert(mx.get_numeric(1, 1) == 1.0);
+ mx.set_string(1, 0, new string("test"));
+ mx.dump();
+ assert(!mx.numeric());
+ }
+}
+
+void qtm_test_assign(matrix_density_t dens1, matrix_density_t dens2)
+{
+ StackPrinter __stack_printer__("::qtm_test_assign");
+ print_mx_density_type(dens1);
+ print_mx_density_type(dens2);
+
+ // Assigning from a smaller matrix to a bigger one.
+ mx_type mx1(5, 5, dens1), mx2(2, 2, dens2);
+ mx2.set(0, 0, 1.2);
+ mx2.set(1, 1, true);
+ mx2.set(0, 1, new string("test"));
+ mx2.set(1, 0, new string("foo"));
+ cout << "matrix 1:" << endl;
+ mx1.dump();
+ cout << "matrix 2:" << endl;
+ mx2.dump();
+ mx1.assign(mx2);
+ cout << "matrix 1 after assign:" << endl;
+ mx1.dump();
+
+ bool success = verify_assign(mx1, mx2);
+ assert(success);
+
+ mx2.resize(8, 8);
+ mx2.assign(mx1);
+ cout << "matrix 2 after resize and assign:" << endl;
+ mx2.dump();
+ success = verify_assign(mx1, mx2);
+ assert(success);
+
+ // from a larger matrix to a smaller one.
+ mx1.set(0, 0, new string("test1"));
+ mx2.set(0, 0, new string("test2"));
+ mx2.set(4, 4, true);
+ mx2.set(7, 7, false);
+ mx1.assign(mx2);
+ cout << "matrix 1 after assign:" << endl;
+ mx1.dump();
+ success = verify_assign(mx1, mx2);
+ assert(success);
+
+ // self assignment (should be no-op).
+ mx1.assign(mx1);
+ success = verify_assign(mx1, mx1);
+ assert(success);
+
+ mx2.assign(mx2);
+ success = verify_assign(mx2, mx2);
+ assert(success);
+}
+
+void qtm_test_assignment(matrix_density_t density)
+{
+ StackPrinter __stack_printer__("::qtm_test_assignment");
+ print_mx_density_type(density);
+ mx_type mx1(0, 0, density), mx2(3, 3, density);
+ mx2.set(0, 0, 3.4);
+ mx2.set(2, 1, new string("hmm..."));
+ mx2.set(1, 2, new string("help"));
+ cout << "matrix 1 initial:" << endl;
+ mx1.dump();
+ cout << "matrix 2 initial:" << endl;
+ mx2.dump();
+ mx1 = mx2;
+ cout << "matrix 1 after assignment:" << endl;
+ mx1.dump();
+ bool success = verify_assignment(mx1, mx2);
+ assert(success);
+
+ // self assignment.
+ mx2 = mx2;
+ cout << "matrix 2 after self-assignment:" << endl;
+ mx2.dump();
+ success = verify_assignment(mx1, mx2);
+ assert(success);
+
+ mx1.set(0, 1, true);
+ mx1.set(1, 0, false);
+ mx2 = mx1;
+ cout << "matrix 2 after assignment:" << endl;
+ mx2.dump();
+ success = verify_assignment(mx1, mx2);
+ assert(success);
+
+ // Assigning an empty matrix.
+ mx2 = mx_type();
+ assert(mx2.empty());
+}
+
+void qtm_test_flag_storage(matrix_density_t density)
+{
+ StackPrinter __stack_printer__("::qtm_test_flag_storage");
+ print_mx_density_type(density);
+ mx_type mx(3, 3, density);
+ mx.dump();
+ mx.dump_flags();
+ assert(mx.get_flag(0, 0) == 0);
+
+ mx_type::flag_type flag = 0x01;
+ mx.set_flag(0, 0, flag);
+ mx.dump_flags();
+ assert(mx.get_flag(0, 0) == flag);
+
+ flag |= 0xF0;
+ mx.set_flag(0, 0, flag);
+ mx.set_flag(2, 1, flag);
+ mx.dump_flags();
+ assert(mx.get_flag(0, 0) == flag);
+ assert(mx.get_flag(2, 1) == flag);
+ assert(mx.get_flag(2, 2) == 0);
+
+ mx.clear_flag(0, 0);
+ mx.dump_flags();
+ assert(mx.get_flag(0, 0) == 0);
+ assert(mx.get_flag(2, 1) == flag);
+}
+
+int main()
+{
+ run_tests_on_all_density_types(qtm_test_resize);
+ run_tests_on_all_density_types(qtm_test_value_store);
+ run_tests_on_all_density_types(qtm_test_transpose);
+ run_tests_on_all_density_types(qtm_test_assignment);
+
+ qtm_test_initial_elements();
+ qtm_test_numeric_matrix();
+ qtm_test_assign(matrix_density_filled_zero, matrix_density_filled_zero);
+ qtm_test_assign(matrix_density_filled_empty, matrix_density_filled_zero);
+ qtm_test_assign(matrix_density_filled_zero, matrix_density_filled_empty);
+ qtm_test_assign(matrix_density_filled_empty, matrix_density_filled_empty);
+
+ run_tests_on_all_density_types(qtm_test_flag_storage);
+ cout << "Test finished successfully!" << endl;
+ return EXIT_SUCCESS;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/mdds.git
Reply to: