Initial conversion to Dionysus architecture
authorDmitriy Morozov <morozov@cs.duke.edu>
Mon, 30 Oct 2006 14:20:45 -0500
changeset 0 d95020656286
child 1 b227c7a027cd
Initial conversion to Dionysus architecture
.hgignore
Doxyfile
SConstruct
config.cole.py
config.metatron.py
examples/SConscript
examples/triangle/SConscript
examples/triangle/triangle.cpp
include/circular_list.h
include/counter.h
include/cycle.h
include/cycle.hpp
include/debug.h
include/dionysus.h
include/eventqueue.h
include/filtration.h
include/filtration.hpp
include/filtrationcontainer.h
include/filtrationsimplex.h
include/orderlist.h
include/orderlist.hpp
include/simplex.h
include/simplex.hpp
include/sys.h
include/types.h
include/types.hpp
include/vineyard.h
include/vineyard.hpp
include/vineyardsimplex.h
include/vineyardsimplex.hpp
sconstools/doxygen.py
src/debug.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,5 @@
+syntax: glob
+
+docs
+.sconsign.dblite
+aux
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Doxyfile	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,1161 @@
+# Doxyfile 1.3.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = Dionysus
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 0.0.1
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of source 
+# files, where putting all generated files in the same directory would otherwise 
+# cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation.
+
+SHOW_DIRECTORIES       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = 
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = examples/include/tnt aux
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+#HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SConstruct	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,78 @@
+import os
+
+optns =					Options('config.' + os.uname()[1] + '.py')
+optns.AddOptions(
+						PathOption('cgal_path', 'where CGAL is installed', ''),
+						('cgal_architecture', 'string describing CGAL architecture'),
+						('INCPATH', 'additional include paths separated with :',''),
+						('LIBPATH', 'additional library paths separated with :',''),
+						PathOption('qt4_includes', 'where Qt4 headers are installed', ''),
+						PathOption('qt4_libs', 'where Qt4 libraries are installed', ''),
+						('CXX', 'The C++ compiler'))
+
+
+
+# Setup environment
+base_env = 				Environment(options = optns,
+									ENV = os.environ,
+									tools=["default", "doxygen", "qt4"], 
+									toolpath=["sconstools"])
+Help					(optns.GenerateHelpText(base_env))
+
+opt = 					base_env.Copy(CPPFLAGS = ['-O'])
+dbg =					base_env.Copy(CPPFLAGS = ['-g'])
+opt.Append				(CPPDEFINES = ['NDEBUG'])
+
+if ARGUMENTS.get('debug', 0):
+	env = dbg
+	env.Append(CPPDEFINES = ['CWDEBUG'])
+	env.Append(LIBS = ['cwd'])
+else:
+	env = opt
+
+if ARGUMENTS.get('counters', 0):
+	env.Append			(CPPDEFINES = ['COUNTERS'])
+
+
+# Don't create .sconsign files all over the place
+SConsignFile()
+
+# Create tags file
+#tags =					env.Command('tags', 'sources',			# FIXME
+#									['ctags '])
+
+# CGAL
+cgal_path = 			env['cgal_path']
+cgal_architecture = 	env['cgal_architecture']	
+
+cgal_defines = 			['CGAL_USE_GMP', 'CGAL_USE_GMPXX', 'CGAL_USE_CORE']
+cgal_cpppath =			[cgal_path + '/include/CGAL/config/' + cgal_architecture, cgal_path + '/include']
+cgal_libs = 			['CGAL', 'core++', 'mpfr', 'gmpxx', 'gmp', 'm']
+cgal_link_flags =		['-Wl,-R' + cgal_path + '/lib/' + cgal_architecture]
+cgal_lib_paths = 		[cgal_path + '/lib/' + cgal_architecture]
+
+# Includes
+cpppath =				['#/include'] + env['INCPATH'].split(':')
+libpath = 				env['LIBPATH'].split(':')
+
+# Append variables to the environment
+env.Append				(CPPDEFINES = cgal_defines, 
+						 CPPPATH = cpppath + cgal_cpppath,
+						 LIBS = cgal_libs, 
+						 LIBPATH = libpath + cgal_lib_paths, 
+						 LINKFLAGS = cgal_link_flags)
+
+# Build documentation (in doc/)
+env.Doxygen("Doxyfile")
+
+# Build stuff in src/, and export it
+external_sources = 		SConscript(['src/SConscript'], exports = ['env'])
+
+# Build examples/ and tools/
+#SConscript				(['examples/SConscript',
+#						  'tools/SConscript'],
+#						 exports = ['env', 'external_sources'])
+SConscript				(['examples/SConscript'],
+						 exports = ['env', 'external_sources'])
+
+# vim: syntax=python
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config.cole.py	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,12 @@
+import os
+
+cgal_path = 			os.environ.get('CGAL_DIR')
+cgal_architecture =		os.environ.get('CGAL_ARCHITECTURE')
+
+INCPATH =				'/auto/sst/include'
+LIBPATH =				'/auto/sst/lib'
+
+qt4_includes = 			'/auto/sst/include'
+qt4_libs =				'/auto/sst/lib'
+
+CXX = 					'/home/home2/morozov/bin/gfilt'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config.metatron.py	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,10 @@
+import os
+
+cgal_path = 			os.environ.get('CGAL_DIR')
+cgal_architecture =		os.environ.get('CGAL_ARCHITECTURE')
+
+qt4_dir =				'/opt/qt4'
+qt4_includes = 			qt4_dir + '/include'
+qt4_libs = 				qt4_dir + '/lib'
+
+CXX = 					'/home/dmitriy/bin/gfilt'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/SConscript	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,6 @@
+Import('*')
+
+SConscript				(['triangle/SConscript'],
+#						  'alphashapes/SConscript',
+#						  'grid/SConscript'],
+						 exports=['env', 'external_sources'])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/triangle/SConscript	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,20 @@
+Import('*')
+
+Default(env.Program('triangle.cpp'))
+
+## Common variables
+##libraries = 			['dsrpdb', 'boost_serialization']
+#
+## Sources
+#sources = 				[['triangle.cpp', []]]
+##, 'grid2D.cpp', 'alphashapes.cpp', 'euclidean.cpp', 
+##						 'combustion_vineyard.cpp', 'folding.cpp', 'pdbdistance.cpp',
+##						 'geodesic_vineyard.cpp']
+#
+#local_env = 			env.Copy()
+#				 
+## Build instructions
+#for sl in sources:
+#	s,l = sl
+#	o = local_env.Object(s)
+#	t = Default(local_env.Program(o + external_sources))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/triangle/triangle.cpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,59 @@
+#include "vineyard.h"
+#include "simplex.h"
+#include <vector>
+#include <iostream>
+
+typedef 		SimplexWithValue<int> 		Simplex;
+typedef			Vineyard<Simplex>			TriangleFiltration;
+//typedef			Filtration<Simplex>			TriangleFiltration;
+
+void fillTriangleSimplices(TriangleFiltration& f)
+{
+	typedef std::vector<int> VertexVector;
+	VertexVector vertices(4);
+	vertices[0] = 0; vertices[1] = 1; vertices[2] = 2; 
+	vertices[3] = 0;
+		
+	VertexVector::const_iterator bg = vertices.begin();
+	VertexVector::const_iterator end = vertices.end();
+	f.append(Simplex(bg,     bg + 1, 0));				// 0 = A
+	f.append(Simplex(bg + 1, bg + 2, 1));				// 1 = B
+	f.append(Simplex(bg + 2, bg + 3, 2));				// 2 = C
+	f.append(Simplex(bg,     bg + 2, 2.5));				// AB
+	f.append(Simplex(bg + 1, bg + 3, 2.9));				// BC
+	f.append(Simplex(bg + 2, end, 3.5));				// CA
+	f.append(Simplex(bg,     bg + 3, 5));				// ABC
+
+	f.fill_simplex_index_map();
+}
+
+int main()
+{
+#ifdef CWDEBUG
+	dionysus::debug::init();
+
+	Debug(dc::filtration.on());
+	Debug(dc::cycle.on());
+	Debug(dc::vineyard.on());
+#endif
+
+	TriangleFiltration tf;
+	fillTriangleSimplices(tf);
+	
+	tf.pair_simplices(tf.begin());
+	
+	std::cout << "Filtration size: " << tf.size() << std::endl;
+	std::cout << tf << std::endl;
+
+#if 1
+	Simplex BC; BC.add(1); BC.add(2);
+	Simplex AB; AB.add(0); AB.add(1);
+	std::cout << BC << std::endl;
+	std::cout << *tf.get_index(BC) << std::endl;
+	tf.transpose(tf.get_index(BC));
+	std::cout << tf;
+	tf.transpose(tf.get_index(AB));
+	std::cout << tf;
+#endif
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/circular_list.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,259 @@
+/**
+ * Singly-linked circular list implementation by Donovan Rebbechi <elflord@pegasus.rutgers.edu>.
+ * Tiny modifications by DM to make ISO C++ compliant (i.e., so that the compiler stops complaining), 
+ * added size(), and boost serialization
+ */
+
+#ifndef __CIRCULAR_LIST_H__
+#define __CIRCULAR_LIST_H__
+
+#include <iterator>
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/binary_object.hpp>
+
+#include "types.h"
+
+
+template <class T>
+class List
+{
+	struct Node
+	{
+		Node(const T& x,Node* y = 0):m_data(x),m_next(y){}
+		T m_data;
+		Node* m_next;
+	
+		private:
+			// Serialization
+			friend class boost::serialization::access;
+
+			template<class Archive>
+			void serialize(Archive& ar, version_type )
+			{
+				ar & make_nvp("data", m_data);
+				ar & make_nvp("next", m_next);
+			}
+	};
+
+	Node* m_node;
+	size_t sz;
+	
+	private:
+		// Serialization
+		friend class boost::serialization::access;
+
+		template<class Archive>
+		void serialize(Archive& ar, version_type )
+		{ ar & make_nvp("root", m_node); }
+
+public:
+	class const_iterator;
+	
+	class iterator
+		: public std::iterator<std::forward_iterator_tag, T>
+	{
+		Node* m_rep;
+	public:
+		friend class List;
+		friend class const_iterator;
+		typedef T value_type;
+		typedef T& reference;
+		typedef T* pointer;
+		typedef int difference_type;
+		typedef std::forward_iterator_tag iterator_category;
+
+		inline iterator(Node* x=0):m_rep(x){}
+		inline iterator(const iterator& x):m_rep(x.m_rep) {}
+		inline iterator(const const_iterator& x):m_rep(const_cast<Node*>(x.m_rep)) {}			// not very safe
+		inline iterator& operator=(const iterator& x)
+		{ 
+			m_rep=x.m_rep; return *this; 
+		}
+		inline iterator& operator++()
+		{ 
+			m_rep = m_rep->m_next; return *this; 
+		}
+		inline iterator operator++(int)
+		{ 
+			iterator tmp(*this); m_rep = m_rep->m_next; return tmp; 
+		}
+		inline reference operator*() const { return m_rep->m_next->m_data; }
+		inline pointer operator->() const { return m_rep->m_next; }
+		inline bool operator==(const iterator& x) const
+		{
+			return m_rep == x.m_rep; 
+		}	
+		inline bool operator!=(const iterator& x) const
+		{
+			return m_rep != x.m_rep; 
+		}	
+
+	};
+
+	class const_iterator
+		: public std::iterator<std::forward_iterator_tag, const T>
+	{
+		const Node* m_rep;
+	public:
+		friend class List;
+		friend class iterator;
+		typedef T value_type;
+		typedef T& reference;
+		typedef T* pointer;
+		typedef int difference_type;
+		typedef std::forward_iterator_tag iterator_category;
+		inline const_iterator(const Node* x=0):m_rep(x){}
+		inline const_iterator(const const_iterator& x):m_rep(x.m_rep) {}
+		inline const_iterator(const iterator& x):m_rep(x.m_rep){}
+		inline const_iterator& operator=(const const_iterator& x)
+		{ 
+			m_rep=x.m_rep; return *this; 
+		}
+		inline const_iterator& operator=(const iterator& x)
+		{ 
+			m_rep=x.m_rep; return *this; 
+		}		
+		inline const_iterator& operator++()
+		{ 
+			m_rep = m_rep->m_next; return *this; 
+		}
+		inline const_iterator operator++(int)
+		{ 
+			const_iterator tmp(*this); m_rep = m_rep->m_next; return tmp; 
+		}
+		inline reference operator*() const { return m_rep->m_next->m_data; }
+		inline pointer operator->() const { return m_rep->m_next; }
+		inline bool operator==(const const_iterator& x) const
+		{
+			return m_rep == x.m_rep; 
+		}
+		inline bool operator!=(const const_iterator& x) const
+		{
+			return m_rep != x.m_rep; 
+		}
+	};
+
+	typedef			T&				reference;
+	typedef			const T&		const_reference;
+	typedef			T*				pointer;
+	typedef			const T*		const_pointer;
+
+	List() : m_node(new Node(T())), sz(0) { m_node->m_next = m_node; }
+
+	List(const List& L) : m_node(new Node(T())), sz(L.sz)
+	{
+		m_node->m_next=m_node;
+		for ( const_iterator i = L.begin(); i!= L.end(); ++i )
+			push_front(*i);
+		reverse();
+	}
+
+	void reverse()
+	{
+		if (empty())
+			return;
+		Node* new_m_node = m_node->m_next->m_next;
+		Node* p = m_node; Node* i = m_node->m_next; Node* n;
+		do  
+		{
+			n = i->m_next;
+			i->m_next = p;
+			p = i; i = n;
+		}
+		while (p!=m_node);
+		m_node = new_m_node;
+	}
+
+	void swap(List& x)
+	{
+		std::swap(m_node, x.m_node);
+		std::swap(sz, x.sz);
+	}
+
+	List& operator=(const List& x)
+	{
+		List tmp(x);
+		swap(tmp);
+		return *this;
+	}
+
+	~List() { clear(); delete m_node; }
+	void clear() { while (!empty()) pop_front(); sz = 0; }
+
+
+	inline size_t size() const					{ return sz; }
+
+	inline void push_front(const T&x)
+	{
+		insert (begin(),x);
+	}
+	inline void push_back(const T& x)
+	{
+		insert (end(),x);
+	}
+	inline void pop_front()
+	{
+		erase(begin());
+	}
+	inline bool empty() const { return m_node == m_node->m_next; }
+
+	inline T& front() { return *begin(); }
+	inline const T& front() const { return *begin(); }
+	inline T& back() { return m_node->data; }
+	inline const T& back() const { return m_node->data; }
+
+	inline iterator begin() { return iterator(m_node->m_next); }
+	inline iterator end() { return iterator(m_node); }
+	inline const_iterator begin() const 
+	{ 
+		return const_iterator(m_node->m_next); 
+	}
+	inline const_iterator end() const 
+	{ 
+		return const_iterator(m_node); 
+	}
+
+	iterator erase (iterator x)
+	{
+		if (x == end())
+			return x;
+		
+		if (x.m_rep->m_next == m_node)
+			m_node = x.m_rep;
+
+		Node* tmp = x.m_rep->m_next;
+		x.m_rep->m_next = x.m_rep->m_next->m_next;
+		delete tmp;
+		--sz;
+
+		return x;
+	}
+
+	iterator insert (iterator x, const T& y)
+	{
+		Node* tmp = new Node(y,x.m_rep->m_next);
+		if (x.m_rep == m_node)		// if inserting before end
+			m_node = tmp;
+		x.m_rep->m_next = tmp;
+		++sz;
+		
+		return x++;					// x points to the new data, return it, and slide it over
+	}
+
+	// rotate x to beginning
+	void rotate (iterator x)
+	{
+		if (x == end())
+			return;
+		Node* sentinel = m_node->m_next;
+		m_node->m_next = m_node->m_next->m_next;
+		sentinel->m_next = x.m_rep->m_next;
+		x.m_rep->m_next = sentinel;
+		m_node = x.m_rep; 
+	}
+};
+
+#endif // __CIRCULAR_LIST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/counter.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,66 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005 -- 2006
+ */
+
+#ifndef __COUNTER_H__
+#define __COUNTER_H__
+
+/* This should be integrated with the logging facilities. Written in the same framework. */
+
+#include <map>
+#include <string>
+#include <iostream>
+
+typedef 		unsigned long 		CounterType;
+typedef			std::string			KeyType;
+
+class CounterFactory
+{
+	private:
+#ifdef COUNTERS
+		typedef				std::map<int, CounterType> 			CountersMap;
+		typedef				std::map<KeyType, CountersMap>		KeyMap;
+		KeyMap				ctrs;
+#endif // COUNTERS
+		
+	public:
+		~CounterFactory()
+		{
+#ifdef COUNTERS
+			std::cout << "Counters:" << std::endl;
+			for (KeyMap::const_iterator cur = ctrs.begin(); cur != ctrs.end(); ++cur)
+			{
+				std::cout << cur->first << ": ";
+				if (cur->second.size() == 1)
+				{
+					std::cout << cur->second.begin()->second << std::endl;
+					continue;
+				}
+				std::cout << std::endl;
+				for (CountersMap::const_iterator ccur = cur->second.begin();
+														  ccur != cur->second.end();
+														  ++ccur)
+					std::cout << "  " << ccur->first << ": " << ccur->second << std::endl;
+			}
+#endif // COUNTERS
+		}
+
+		void inc(const KeyType& key, int num = 0)
+		{
+#ifdef COUNTERS
+			ctrs[key][num]++;
+#endif // COUNTERS
+		}
+
+		CounterType lookup(const KeyType& key, int num = 0) const
+		{
+#ifdef COUNTERS
+			return ctrs[key][num];
+#endif // COUNTERS
+		}
+};
+
+static CounterFactory counters;
+
+#endif // __COUNTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/cycle.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,114 @@
+/**
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005-2006
+ */
+
+#ifndef __CYCLE_H__
+#define __CYCLE_H__
+
+#include "sys.h"
+#include "debug.h"
+
+#include "types.h"
+#include "circular_list.h"
+#include <list>
+#include <boost/serialization/access.hpp>
+
+/**
+ * Class storing a cycle of simplices. Stores items in the order defined by ConsistencyCmp. 
+ * The actual order of the elements is defined by OrderCmp. Instances of those 
+ * classes are not stored in Cycle for efficiency, and are passed as arguments to those methods 
+ * that require them.
+ */
+template <class Itm, class OrderCmp, class ConsistencyCmp = OrderCmp>
+class Cycle: public List<Itm>
+{
+	public:
+		/// \name Template Parameters
+		/// @{
+		typedef			Itm												Item;
+		typedef			OrderCmp										OrderComparison;
+		typedef			ConsistencyCmp									ConsistencyComparison;
+		/// @}
+		
+		typedef 		Cycle<Item, OrderComparison, ConsistencyCmp>	Self;
+		typedef			List<Item> 										CycleRepresentation; 
+
+		/// \name Accessor typedefs
+		/// @{
+		typedef			typename CycleRepresentation::iterator			iterator; 
+		typedef			typename CycleRepresentation::const_iterator	const_iterator; 
+		typedef			typename CycleRepresentation::const_reference	const_reference; 
+		typedef			typename CycleRepresentation::reference			reference; 
+		typedef			typename CycleRepresentation::pointer			pointer; 
+		typedef			typename CycleRepresentation::const_pointer		const_pointer; 
+		/// @}
+		
+	public:		
+						Cycle();
+						Cycle(const Cycle& c);
+		
+		/// \name Whole Cycle operations
+		/// @{
+		/** Add c to *this assuming both Cycles are sorted in increasing order according to cmp. */
+		Self&			add(const Self& c, const ConsistencyComparison& cmp);
+		void			swap(Cycle& c); 								///< Swaps the contents of c and *this (like STL's swap destroys c)
+		//void 			insertion_sort(const Comparison& cmp); 			///< Sort list[i] using insertion sort
+		void			sort(const ConsistencyComparison& cmp);			///< Sort elements to enforce consistency
+		using 			CycleRepresentation::empty;
+		using 			CycleRepresentation::clear;
+		using			CycleRepresentation::size;
+		/// @}
+		
+		/// \name Modifiers
+		/// @{
+		using 			CycleRepresentation::erase;
+		void			append(const_reference x);
+		/// @}
+		
+		/// \name Accessors
+		/// @{
+		using 			CycleRepresentation::begin;
+		using 			CycleRepresentation::end;
+		const_reference	top(const OrderComparison& cmp) const;			///< First element in cmp order
+		iterator		get_second(const OrderComparison& cmp) const;	///< Second element in cmp order
+		/// @}
+
+		/// \name Block access optimizations
+		// Between operations used in optimization of transpositions for regular vertices. Maybe we don't need these? TODO
+		/// @{
+		/** Return first after i, but before or equal j; return i if no such element found */
+		const_reference	first_between(const_reference i, const_reference j, const OrderComparison& cmp);
+		/// Add lists and remove all elements after i and before or equal to j
+		const_reference	add_and_first_between(const Self& c, const ConsistencyComparison& consistency_cmp,
+											  const_reference i, const_reference j, const OrderComparison& order_cmp);
+		/// Erase everything after i, but before or equal to j
+		void 			erase_between(const_reference i, const_reference j, const OrderComparison& cmp);
+		/// @}
+	
+		/// \name Debugging
+		/// @{
+		const_reference get_first(const OrderComparison& cmp) const;	///< First element in cmp order
+		std::ostream&	operator<<(std::ostream& out) const;
+		/// @}
+		
+	private:
+		typedef			std::list<Item>									TemporaryCycleRepresenation;
+		
+		using 			CycleRepresentation::push_back;
+
+	private:
+		size_t sz;
+		
+	private:
+		// Serialization
+		typedef			List<Item>										Parent;
+		friend class 	boost::serialization::access;
+		template<class Archive> 
+		void			serialize(Archive& ar, version_type );
+};
+
+#include "cycle.hpp"
+
+#endif // __CYCLE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/cycle.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,263 @@
+#include <algorithm>
+#include <vector>
+
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/binary_object.hpp>
+#include <boost/utility.hpp>
+
+using boost::serialization::make_nvp;
+using boost::serialization::make_binary_object;
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+Cycle<I,OrderCmp,ConsistencyCmp>::
+Cycle(): sz(0)
+{}
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+Cycle<I,OrderCmp,ConsistencyCmp>::
+Cycle(const Cycle& c): CycleRepresentation(c), sz(c.sz)					
+{}
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+void
+Cycle<I,OrderCmp,ConsistencyCmp>::
+append(const_reference x)						
+{ push_back(x); }
+		
+template<class I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I,OrderCmp,ConsistencyCmp>::const_reference				
+Cycle<I,OrderCmp,ConsistencyCmp>::
+top(const OrderComparison& cmp) const
+{ 
+	AssertMsg(!empty(), "Cycle must not be empty for top()");
+	const_iterator min = begin();
+	for (const_iterator cur = ++begin(); cur != end(); ++cur)
+		if (cmp(*cur, *min))
+			min = cur;
+	return *min; 
+}
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+void 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+swap(Cycle& c)
+{
+	CycleRepresentation::swap(c);
+	std::swap(sz, c.sz);
+}
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+void 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+sort(const ConsistencyComparison& cmp)
+{ 
+	std::vector<Item> tmp(begin(), end());
+	std::sort(tmp.begin(), tmp.end(), cmp);
+	std::copy(tmp.begin(), tmp.end(), begin());
+}
+
+template<class I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I,OrderCmp,ConsistencyCmp>::iterator 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+get_second(const OrderComparison& cmp) const
+{
+	AssertMsg(!empty(), "Cycle must not be empty for get_second()");
+	if (size() < 2)			return begin();					// Indicates that there is no second.
+
+	Dout(dc::cycle, "Looking for second");
+	AssertMsg(size() >= 2, "Cycle must have at least two elements for get_second()");
+	iterator min = begin();
+	iterator second = ++begin();
+	if (cmp(*second, *min))
+		std::swap(min, second);
+	for (iterator cur = boost::next(begin(),2); cur != end(); ++cur)
+	{
+		if (cmp(*cur, *min))
+		{
+			second = min;
+			min = cur;
+		} else if (cmp(*cur, *second))
+		{
+			second = cur;
+		}
+	}
+	
+	Dout(dc::cycle, "Looked up: " << **second);
+	return second;
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I,OrderCmp,ConsistencyCmp>::const_reference				
+Cycle<I,OrderCmp,ConsistencyCmp>::
+first_between(const_reference i, const_reference j, const OrderComparison& cmp)
+{
+	// Find the first element in ConsistencyComparison order (> i and <= j)
+	const_pointer first = &i;
+	iterator cur = begin();
+	for (; cur != end(); ++cur)
+	{
+		if ((*cur == j) || (cmp(*cur, j) && cmp(i, *cur)))
+		{
+			first = &(*cur);
+			break;
+		}
+	}
+	
+	// If no such element found, then we are done
+	if (cur == end())
+		return i;
+
+	// Find first element in OrderComparison order (> i and <= j)
+	for (++cur; cur != end(); ++cur)
+	{
+		if ((*cur == j) || (cmp(*cur, j) && cmp(i, *cur)))
+		{
+			if (cmp(*cur, *first))
+				first = &(*cur);
+		}
+	}
+	return *first;
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+void 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+erase_between(const_reference i, const_reference j, const OrderComparison& cmp)
+{
+	for (iterator cur = begin(); cur != end(); ++cur)
+		while ((cur != end()) && ((*cur == j) || (cmp(*cur, j) && cmp(i, *cur))))
+		{
+			Dout(dc::cycle, "Iteration of the erase while loop");
+			cur = erase(cur);
+		}
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+std::ostream& 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+operator<<(std::ostream& out) const
+{
+	for (const_iterator cur = begin(); cur != end(); ++cur)
+	{
+		out << **cur << " ";
+	}
+	// out << "(last: " << *last << ")";  // For debugging only
+	return out;
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+std::ostream& 
+operator<<(std::ostream& out, const Cycle<I, OrderCmp, ConsistencyCmp>& c)	
+{
+	return c.operator<<(out);
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I, OrderCmp, ConsistencyCmp>::Self& 
+Cycle<I, OrderCmp, ConsistencyCmp>::
+add(const Self& c, const ConsistencyCmp& cmp)
+{
+	Dout(dc::cycle, "Adding cycles");
+	
+	iterator 			cur1 = begin();
+	const_iterator 		cur2 = c.begin();
+
+	while (cur2 != c.end())
+	{
+		if (cur1 == end())
+		{
+			while (cur2 != c.end())
+				append(*cur2++);
+			return *this;
+		}
+
+		// mod 2
+		int res = cmp.compare(*cur1, *cur2);
+		if (res == 0)		// *cur1 == *cur2
+		{
+			Dout(dc::cycle, "Equality");
+			cur1 = erase(cur1);		// erase cur1 --- as a result cur1 will be pointing at old_cur1++
+			--sz;
+			++cur2;
+		} else if (res < 0)	// *cur1 < *cur2
+		{
+			Dout(dc::cycle, "Less than");
+			cur1++;
+		} else if (res > 0) // *cur1 > *cur2
+		{
+			Dout(dc::cycle, "Greater than");
+			insert(cur1, *cur2);
+			++cur2;
+			++sz;
+		}
+	}
+
+	Dout(dc::cycle, "After addition: " << *this);
+	return *this;
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I,OrderCmp,ConsistencyCmp>::const_reference 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+add_and_first_between(const Self& c, const ConsistencyComparison& consistency_cmp,
+					  const_reference i, const_reference j, const OrderComparison& order_cmp)
+{
+	add(c, consistency_cmp);
+	return first_between(i,j, order_cmp);
+}
+
+template<typename I, class OrderCmp, class ConsistencyCmp>
+typename Cycle<I,OrderCmp,ConsistencyCmp>::const_reference 
+Cycle<I,OrderCmp,ConsistencyCmp>::
+get_first(const OrderComparison& cmp) const
+{ return top(cmp); }
+
+		
+template<typename I, class OrderCmp, class ConsistencyCmp>
+template<class Archive> 
+void						
+Cycle<I,OrderCmp,ConsistencyCmp>::
+serialize(Archive& ar, version_type )
+{
+	ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Parent);
+	ar & make_nvp("size", sz);;
+}
+
+
+/*
+template<typename I, class Cmp>
+void 
+Cycle<I, Cmp>::
+insertion_sort(const Comparison& cmp)
+{
+	TemporaryCycleRepresenation tmp;
+
+	// Insertion sort into the temporary list
+	for (const_iterator cur = begin(); cur != end(); ++cur)
+	{
+		typename TemporaryCycleRepresenation::iterator tmp_cur = tmp.end();
+		typename TemporaryCycleRepresenation::iterator tmp_next = tmp_cur--;
+
+		while (tmp_next != tmp.begin())
+		{
+			if (cmp(*cur, *tmp_cur))
+				tmp_next = tmp_cur--;
+			else 
+				break;
+		}
+		tmp.insert(tmp_next, *cur);
+	}
+
+	// Copy temporary list back into ourselves
+	iterator cur = begin();
+	typename TemporaryCycleRepresenation::const_iterator tmp_cur = tmp.begin();
+	while(tmp_cur != tmp.end())
+	{
+		*cur = *tmp_cur;
+		++cur; ++tmp_cur;
+	}
+}
+*/
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/debug.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,91 @@
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#ifndef CWDEBUG
+
+#include <iostream>     // std::cerr
+#include <cstdlib>      // std::exit, EXIT_FAILURE
+#include <cassert>
+
+#define AllocTag1(p)
+#define AllocTag2(p, desc)
+#define AllocTag_dynamic_description(p, data)
+#define AllocTag(p, data)
+#define Debug(STATEMENT...)
+#define Dout(cntrl, data)
+#define DoutFatal(cntrl, data) LibcwDoutFatal(, , cntrl, data)
+#define ForAllDebugChannels(STATEMENT...)
+#define ForAllDebugObjects(STATEMENT...)
+#define LibcwDebug(dc_namespace, STATEMENT...)
+#define LibcwDout(dc_namespace, d, cntrl, data)
+#define LibcwDoutFatal(dc_namespace, d, cntrl, data) do { ::std::cerr << data << ::std::endl; ::std::exit(EXIT_FAILURE); } while(1)
+#define LibcwdForAllDebugChannels(dc_namespace, STATEMENT...)
+#define LibcwdForAllDebugObjects(dc_namespace, STATEMENT...)
+#define NEW(x) new x
+#define CWDEBUG_ALLOC 0
+#define CWDEBUG_MAGIC 0
+#define CWDEBUG_LOCATION 0
+#define CWDEBUG_LIBBFD 0
+#define CWDEBUG_DEBUG 0
+#define CWDEBUG_DEBUGOUTPUT 0
+#define CWDEBUG_DEBUGM 0
+#define CWDEBUG_DEBUGT 0
+#define CWDEBUG_MARKER 0
+#define AssertMsg(TEST,MSG)
+//#define AssertMsg(TEST,STRM,MSG)
+
+
+#else // CWDEBUG
+
+// This must be defined before <libcwd/debug.h> is included and must be the
+// name of the namespace containing your `dc' (Debug Channels) namespace
+// (see below).  You can use any namespace(s) you like, except existing
+// namespaces (like ::, ::std and ::libcwd).
+#define DEBUGCHANNELS ::dionysus::debug::channels
+#include <libcwd/debug.h>
+
+namespace dionysus
+{
+	namespace debug 
+	{
+		void init(void);		// Initialize debugging code from main().
+		void init_thread(void);	// Initialize debugging code from new threads.
+
+		namespace channels 	// This is the DEBUGCHANNELS namespace, see above.
+		{
+			namespace dc 		// 'dc' is defined inside DEBUGCHANNELS.
+			{
+				using namespace libcwd::channels::dc;
+				using libcwd::channel_ct;
+
+				// Add the declaration of new debug channels here
+				// and add their definition in a custom debug.cc file.
+				extern channel_ct filtration;
+				extern channel_ct transpositions;
+				extern channel_ct vineyard;
+				extern channel_ct cycle;
+				extern channel_ct lsfiltration;
+				extern channel_ct lsvineyard;
+				extern channel_ct vertex_transpositions;
+			} // namespace dc
+		} // namespace DEBUGCHANNELS
+	}
+}
+
+
+#define AssertMsg(TEST,MSG)                                           \
+				 ( (TEST) ? (void)0                                   \
+						  : (std::cerr << __FILE__ "(" << __LINE__    \
+								  << "): Assertion failed " #TEST     \
+								  << MSG << std::endl,abort()))
+/*
+#define AssertMsg(TEST,STRM,MSG)                                      \
+				 ( (TEST) ? (void)0                                   \
+						  : (DoutFatal(STRM, __FILE__ "(" << __LINE__ \
+								  << "): Assertion failed " #TEST     \
+								  << MSG << std::endl)))
+*/
+								  
+#endif // CWDEBUG
+
+#endif // DEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/dionysus.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,11 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2006
+ *
+ * For now file exists only to store the main page of the documentation
+ */
+
+/** \mainpage
+ * Detailed description of Dionysus with references to all the classes, 
+ * and code samples goes here.
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/eventqueue.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,41 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005 -- 2006
+ */
+
+#ifndef __EVENTQUEUE_H__
+#define __EVENTQUEUE_H__
+
+#include <map>
+
+template<class _Key, class _Event>
+class EventQueue
+{
+
+	public:
+		typedef					_Key											Key;
+		typedef					_Event											Event;
+
+		// multimap just in case
+		typedef					std::multimap<Key,Event>						QueueRepresentation;
+		typedef					typename QueueRepresentation::iterator			iterator;
+		typedef					typename QueueRepresentation::const_iterator	const_iterator;
+		typedef					std::pair<Key, Event>							KeyValuePair;
+		
+		EventQueue()															{}
+		
+		const_iterator 			top() 	const									{ assert(!empty()); return queue.begin(); }
+		iterator 				push(Key k, Event e)							{ return queue.insert(std::make_pair(k,e)); }
+		void 					pop()											{ assert(!empty()); queue.erase(queue.begin()); }
+		void					remove(iterator i)								{ queue.erase(i); }
+
+		iterator 				end()											{ return queue.end(); }
+		const_iterator 			end() const										{ return queue.end(); }
+		bool					empty() const									{ return queue.empty(); }
+		size_t					size() const									{ return queue.size(); }
+
+	private:
+		QueueRepresentation		queue;
+};
+
+#endif // __EVENTQUEUE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/filtration.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,130 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005 -- 2006
+ */
+
+#ifndef __FILTRATION_H__
+#define __FILTRATION_H__
+
+#include "sys.h"
+#include "debug.h"
+
+#include "filtrationcontainer.h"
+#include "filtrationsimplex.h"
+
+#include <map>
+#include <vector>
+
+#include <boost/serialization/access.hpp>
+
+/**
+ * Filtration class. Serves as an (ordered) container for the simplices, 
+ * and provides pair_simplices() method that computes the RU-decomposition
+ * for the simplex order stored in the filtration. Iterators remain valid 
+ * through all the operations.
+ */
+template<class Smplx, class FltrSmplx = FiltrationSimplex<Smplx> >
+class Filtration: public FltrSmplx::Container
+{
+	public:
+		typedef 	Smplx															Simplex;
+		typedef		FltrSmplx														FiltrationSimplex;
+		typedef		Filtration<Simplex, FiltrationSimplex>							Self;
+
+	public:
+		/// \name Container Types
+		/// @{
+		/** The actual container type (which is the parent of the Filtration) */
+		typedef		typename FiltrationSimplex::Container							FiltrationContainer;
+		typedef		typename FiltrationContainer::Index								Index;
+		typedef		typename FiltrationContainer::const_Index						const_Index;
+		/// @}
+		
+		/// \name Cycles and Trails 
+		/// @{
+		typedef		typename FiltrationContainer::GreaterThanComparison				CyclesComparator;
+		typedef		typename FiltrationContainer::LessThanComparison				TrailsComparator;
+		typedef		typename FiltrationContainer::ConsistencyComparison 			ConsistencyComparator;
+		typedef		typename FiltrationContainer::Cycle								Cycle;
+		typedef		typename FiltrationContainer::Trail								Trail;
+		typedef		typename Cycle::iterator										CycleIterator;
+		typedef		typename Trail::iterator										TrailIterator;
+		/// @}
+		
+		typedef		FiltrationContainer												Parent;
+
+	public:
+										Filtration();
+		template<class OtherFltrSmplx>	Filtration(const Filtration<Simplex,OtherFltrSmplx>& filtration);
+		virtual 						~Filtration();
+	
+		/// \name Core Functionality
+		/// @{
+		/** Computes pairing of the simplices (RU decomposition) starting from bg, assuming that everything before bg has been paired */
+		void 							pair_simplices(Index bg);
+		bool							is_paired() const;
+		Index							append(const Simplex& s);					///< Appends s to the filtration
+		const_Index						get_index(const Simplex& s) const;			/**< Returns the iterator pointing to s 
+																						 (end() if s not in filtration) */
+		Index							get_index(const Simplex& s);				///< \overload
+		void							fill_simplex_index_map();					///< Fills the mapping for get_index()
+		/// @}
+	
+	protected:
+		using 							Parent::swap;
+		
+
+	public:
+		/// \name Container Operations
+		/// @{
+		using Parent::size;
+		using Parent::begin;
+		using Parent::end;
+		/// @}
+		
+		std::ostream& 					operator<<(std::ostream& out) const;
+
+		/** The usual rebind trick in absence of template typedefs */
+		template<class OtherFltrSmplx>
+		struct rebind					{ typedef Filtration<Simplex, OtherFltrSmplx> other; };
+
+	protected:
+		/// \name Comparator accessors (protected)
+		/// @{
+		const ConsistencyComparator& 	get_consistency_cmp() const					{ return consistency_cmp; }
+		const CyclesComparator& 		get_cycles_cmp() const						{ return cycles_cmp; }
+		const TrailsComparator& 		get_trails_cmp() const						{ return trails_cmp; }
+		/// @}
+		
+		/*
+		template<class Cmp> void		sort_simplices(const Cmp& cmp);
+		*/
+
+	private:
+		typedef							std::map<Simplex, Index>					SimplexMap;
+
+		/** Initializes the cycle  with the indices of the simplices in the boundary, and the trail with the index of this simplex */
+		void							init_cycle_trail(Index j);
+		
+		bool 							paired;
+		SimplexMap						inverse_simplices;
+
+		CyclesComparator				cycles_cmp;
+		TrailsComparator				trails_cmp;
+		ConsistencyComparator			consistency_cmp;
+
+	private:
+		/* Serialization */
+		friend class boost::serialization::access;
+		
+		typedef		std::map<const_Index, SizeType, ConsistencyComparator>			IndexIntMap;
+		typedef		std::vector<Index>												IndexVector;
+		
+		template<class Archive> void 	save(Archive& ar, version_type ) const;
+		template<class Archive>	void 	load(Archive& ar, version_type );
+		BOOST_SERIALIZATION_SPLIT_MEMBER()
+};
+
+#include "filtration.hpp"
+
+#endif	// __FILTRATION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/filtration.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,261 @@
+#include "counter.h"
+#include "types.h"
+
+#include <boost/utility.hpp>
+#include <boost/serialization/vector.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/list.hpp>
+#include <boost/serialization/is_abstract.hpp>
+
+using boost::serialization::make_nvp;
+
+/* Filtration Public */
+
+template<class S, class FS>
+Filtration<S, FS>::
+Filtration(): paired(false)					
+{}
+	
+template<class S, class FS>
+template<class OtherFltrSmplx>
+Filtration<S, FS>::
+Filtration(const Filtration<Simplex,OtherFltrSmplx>& filtration)
+{
+	for(typename Filtration<Simplex,OtherFltrSmplx>::const_Index cur = filtration.begin(); cur != filtration.end(); ++cur)
+		push_back(*cur);
+
+	fill_simplex_index_map();
+
+	// TODO: finish
+}
+
+template<class S, class FS>
+Filtration<S, FS>::
+~Filtration() 								
+{}
+
+template<class S, class FS>
+void 
+Filtration<S, FS>::
+pair_simplices(Index bg)
+{
+	Dout(dc::filtration, "Entered: compute_pairing");
+	for (Index j = bg; j != end(); ++j)
+	{
+		Dout(dc::filtration|flush_cf|continued_cf, *j << ": ");
+		init_cycle_trail(j); 
+		Cycle& bdry = j->cycle();
+		Dout(dc::finish, bdry);
+		
+		counters.inc("Boundaries", j->dimension());
+		counters.inc("SimplexCount");
+
+		while(!bdry.empty())
+		{
+			Index i = bdry.top(cycles_cmp);
+			Dout(dc::filtration, *i << ": " << *(i->pair()));
+			AssertMsg(i->value() <= j->value(), "Values in the cycle must be less than the value of the simplex");
+
+			// i is not paired, so we pair j with i
+			if (i->pair() == i)
+			{
+				Dout(dc::filtration, "Pairing " << *i << " and " << *j << " with cycle " << j->cycle());
+				i->set_pair(j);
+				j->set_pair(i);
+				counters.inc("DepositedCycleLength", j->cycle().size());
+				break;
+			}
+
+			// continue searching --- change the Dout to the continued mode with newlines FIXME
+			Dout(dc::filtration, "  Adding: [" << bdry << "] + ");
+			Dout(dc::filtration, "          [" << i->pair()->cycle() << "]");
+			bdry.add(i->pair()->cycle(), consistency_cmp);
+			i->pair()->trail().append(j);
+			Dout(dc::filtration, "After addition: " << bdry);
+		}
+	}
+	paired = true;
+}
+
+template<class S, class FS>
+bool							
+Filtration<S, FS>::
+is_paired() const
+{ return paired; }
+
+/* Filtration Protected */
+template<class S, class FS>
+typename Filtration<S, FS>::Index 
+Filtration<S, FS>::
+append(const Simplex& s)
+{ 
+	Index i = push_back(FiltrationSimplex(s)); 
+	i->set_pair(i);
+	return i;
+}
+		
+template<class S, class FS>
+typename Filtration<S, FS>::const_Index 
+Filtration<S, FS>::
+get_index(const Simplex& s) const
+{ 
+	typename SimplexMap::const_iterator i = inverse_simplices.find(s); 
+	if (i == inverse_simplices.end())
+		return end();
+	else
+		return i->second;
+}
+
+template<class S, class FS>
+typename Filtration<S, FS>::Index 
+Filtration<S, FS>::
+get_index(const Simplex& s)
+{ 
+	typename SimplexMap::const_iterator i = inverse_simplices.find(s); 
+	if (i == inverse_simplices.end())
+		return end();
+	else
+		return i->second;
+}
+
+template<class S, class FS>
+void
+Filtration<S, FS>::
+fill_simplex_index_map()
+{
+	for (Index i = begin(); i != end(); ++i)
+		inverse_simplices[*i] = i;
+}
+
+
+/* FIXME
+template<class S>
+template<class Cmp> 
+void Filtration<S>::sort_simplices(const Cmp& cmp)
+{
+	// Far from efficient, but should work
+	typedef std::multiset<Simplex, Cmp> SimplexSet;
+	SimplexSet ordered_simplices(cmp);
+	for (Index i = begin(); i != end(); ++i)
+		ordered_simplices.insert(*i);
+	
+	simplices.clear();
+	inverse_simplices.clear();
+	for (typename SimplexSet::const_iterator cur = ordered_simplices.begin();
+											 cur != ordered_simplices.end();
+											 ++cur)
+	{
+		append(*cur);
+	}
+}
+*/
+	
+template<class S, class FS>
+std::ostream& 
+Filtration<S, FS>::
+operator<<(std::ostream& out) const
+{
+	out << "Pairing: " << std::endl;
+	for (const_Index i = begin(); i != end(); ++i)
+	{
+		out << "(" << *i << ", " << *(i->pair()) << "): ";
+		out << i->cycle() << std::endl;
+	}
+	out << std::endl << std::endl;
+
+	return out;
+}
+
+/* Filtration Private */
+template<class S, class FS>
+void
+Filtration<S, FS>::init_cycle_trail(Index j)
+{
+	typename Simplex::Cycle bdry = j->boundary();
+
+	for (typename Simplex::Cycle::const_iterator cur = bdry.begin(); cur != bdry.end(); ++cur)
+	{
+		Dout(dc::filtration, "Appending in init_cycle_trail(): " << *cur);
+		j->cycle().append(get_index(*cur));
+	}
+	j->cycle().sort(consistency_cmp);
+
+	j->trail().append(j);
+}
+
+
+/* Serialization */
+template<class S, class FS>
+template<class Archive> 
+void 
+Filtration<S, FS>::
+save(Archive& ar, version_type ) const
+{
+	ar << BOOST_SERIALIZATION_NVP(paired);
+	ar << BOOST_SERIALIZATION_NVP(cycles_cmp);
+	ar << BOOST_SERIALIZATION_NVP(trails_cmp);
+	ar << BOOST_SERIALIZATION_NVP(consistency_cmp);
+
+	SizeType sz = size();
+	ar << make_nvp("size", sz);
+	Dout(dc::filtration, "Size: " << sz);
+
+	/* Record integer indices */
+	IndexIntMap index_map; SizeType i = 0;
+	for (const_Index cur = begin(); cur != end(); ++cur)
+	{ index_map[cur] = i++; }
+	
+	/* Save the simplices */
+	int count = 0;
+	for (const_Index cur = begin(); cur != end(); ++cur)
+	{ 
+		count++;
+		// FIXME
+		//FiltrationSimplexSerialization simplex = FiltrationSimplexSerialization(*cur, index_map);
+		//ar << make_nvp("FiltrationSimplex", simplex);	
+	}
+	Dout(dc::filtration, count << " simplices serialized");
+}
+
+template<class S, class FS>
+template<class Archive>	
+void 
+Filtration<S, FS>::
+load(Archive& ar, version_type )
+{
+	Dout(dc::filtration, "Starting to read filtration");
+	ar >> BOOST_SERIALIZATION_NVP(paired);
+	ar >> BOOST_SERIALIZATION_NVP(cycles_cmp);
+	ar >> BOOST_SERIALIZATION_NVP(trails_cmp);
+	ar >> BOOST_SERIALIZATION_NVP(consistency_cmp);
+	Dout(dc::filtration, "In Filtration: first block read");
+
+	SizeType sz;
+	ar >> make_nvp("size", sz);
+	Dout(dc::filtration, "In Filtration: size read " << sz);
+	
+	IndexVector index_vector(sz);
+	for (SizeType i = 0; i < sz; ++i)
+	{
+		index_vector[i] = append(Simplex());
+	}
+		
+	int count = 0;
+	for (SizeType i = 0; i < sz; ++i)
+	{
+		// FIXME
+		//FiltrationSimplexSerialization simplex;
+		//ar >> make_nvp("FiltrationSimplex", simplex);
+		count++;
+		Dout(dc::filtration, "In Filtration: simplex read (" << count << ")");
+		//simplex.set_filtration_simplex(*index_vector[i], index_vector);
+	}
+	Dout(dc::filtration, "In Filtration: simplices read");
+}
+
+template<class S, class FS>
+std::ostream& 
+operator<<(std::ostream& out, const Filtration<S, FS>& f)					
+{ return f.operator<<(out); }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/filtrationcontainer.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,45 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2006
+ */
+
+#ifndef __FILTRATIONCONTAINER_H__
+#define __FILTRATIONCONTAINER_H__
+
+#include "orderlist.h"
+#include "cycle.h"
+
+/**
+ * FiltrationContainer class. Serves as a parent of Filtration that 
+ * describes the container functionality. Used by FiltrationSimplex 
+ * to get Cycle representation.
+ */
+template<class FltrSmplx>
+class FiltrationContainer: public OrderList<FltrSmplx>
+{
+	public:
+		typedef		FltrSmplx														FiltrationSimplex;
+		typedef		OrderList<FiltrationSimplex>									OrderList;
+		
+		/// \name Cycles and Trails 
+		/// @{
+		/// Index is and therfore acts like an iterator. The name is preserved for historical reasons.
+		typedef		typename OrderList::iterator									Index;
+		/// const_Index is a const_iterator
+		typedef		typename OrderList::const_iterator								const_Index;
+		/// @}
+
+		/// \name Cycles and Trails 
+		/// @{
+		typedef		typename OrderList::GreaterThanComparison						CyclesComparator;
+		typedef		typename OrderList::LessThanComparison							TrailsComparator;
+		typedef		typename OrderList::ConsistencyComparison 						ConsistencyComparator;
+		typedef		::Cycle<Index, CyclesComparator, ConsistencyComparator>			Cycle;
+		typedef		::Cycle<Index, TrailsComparator, ConsistencyComparator>			Trail;
+		/// @}
+
+		template<class U>
+		struct rebind { typedef FiltrationContainer<U> other; };
+};
+
+#endif // __FILTRATIONCONTAINER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/filtrationsimplex.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,177 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2006
+ */
+
+#ifndef __FILTRATIONSIMPLEX_H__
+#define __FILTRATIONSIMPLEX_H__
+
+#include "sys.h"
+#include "debug.h"
+
+#include "filtrationcontainer.h"
+
+#include <list>
+
+#if 0
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/list.hpp>
+#endif
+
+/**
+ * FiltrationSimplex stores information needed for the RU-decomposition: 
+ * cycle (column of R), trail (row of U), and pair.
+ */
+template<class Smplx, class ContainerSimplex = void>
+class FiltrationSimplex: public Smplx
+{
+	public:
+		typedef		Smplx													Simplex;
+		typedef		FiltrationSimplex<Simplex>								Self;
+		typedef		FiltrationContainer<ContainerSimplex>					Container;
+		typedef		Simplex													Parent;
+		
+		typedef		typename Container::Cycle								Cycle;
+		typedef		typename Container::Trail								Trail;
+		typedef		typename Container::Index								Index;
+
+		
+		FiltrationSimplex(const Simplex& s): 
+			Simplex(s)														{}
+		
+
+		/// \name Core functionality
+		/// @{
+		void					set_pair(Index pair)						{ pair_ = pair; }
+		bool					sign() const								{ return cycles_column.empty(); }
+		using Parent::dimension;
+		/// @}
+
+
+		/// \name Accessors
+		/// @{
+		Cycle&					cycle()										{ return cycles_column; }
+		Trail&					trail()										{ return trails_row; }
+		const Cycle&			cycle()	const								{ return cycles_column; }
+		const Trail&			trail()	const								{ return trails_row; }
+		Index					pair() const								{ return pair_; }
+		/// @}
+
+	private:
+		Cycle																cycles_column;
+		Trail																trails_row; 
+		Index																pair_;
+};
+
+/** Specialization for ContainerSimplex = void */
+template<class Smplx>
+class FiltrationSimplex<Smplx, void> : public Smplx
+{
+	public:
+		typedef		Smplx													Simplex;
+		typedef		FiltrationSimplex<Simplex>								Self;
+		typedef		FiltrationContainer<Self>								Container;
+		typedef		Simplex													Parent;
+		
+		typedef		typename Container::Cycle								Cycle;
+		typedef		typename Container::Trail								Trail;
+		typedef		typename Container::Index								Index;
+
+		
+		FiltrationSimplex(const Simplex& s): 
+			Simplex(s)														{}
+		
+
+		/// \name Core functionality
+		/// @{
+		void					set_pair(Index pair)						{ pair_ = pair; }
+		bool					sign() const								{ return cycles_column.empty(); }
+		using Parent::dimension;
+		/// @}
+
+
+		/// \name Accessors
+		/// @{
+		Cycle&					cycle()										{ return cycles_column; }
+		Trail&					trail()										{ return trails_row; }
+		const Cycle&			cycle()	const								{ return cycles_column; }
+		const Trail&			trail()	const								{ return trails_row; }
+		Index					pair() const								{ return pair_; }
+		/// @}
+
+	private:
+		Cycle																cycles_column;
+		Trail																trails_row; 
+		Index																pair_;
+};
+
+#if 0			// FIXME
+template<class S>
+class Filtration<S>::FiltrationSimplexSerialization: public Simplex
+{
+	public:
+		typedef		std::list<IntegerIndex>									IntegerIndexList;
+		
+		// Default constructor for serialization
+		FiltrationSimplexSerialization()										{}
+		
+		FiltrationSimplexSerialization(const FiltrationSimplex& fs, const IndexIntMap& im):
+			Simplex(fs)
+		{
+			pairing = im.find(fs.pair())->second;
+			for (typename FiltrationCycle::const_iterator 	cur = fs.cycle().begin(); 
+															cur != fs.cycle().end();
+															++cur)
+			{ 	cycle.push_back(im.find(*cur)->second);	}
+			
+			for (typename FiltrationTrail::const_iterator 	cur = fs.trail().begin(); 
+															cur != fs.trail().end();
+															++cur)
+			{	trail.push_back(im.find(*cur)->second);	}			
+
+			vine = fs.get_vine();
+		}
+
+		void set_filtration_simplex(FiltrationSimplex& s, const IndexVector& index_vector) const
+		{
+			s = *this;
+			
+			s.pair_with(index_vector[pairing]);
+
+			// Just in case
+			s.cycles_column.clear();
+			s.trails_row.clear();
+
+			for (IntegerIndexList::const_iterator cur = cycle.begin(); cur != cycle.end(); ++cur)
+			{	s.cycles_column.append(index_vector[*cur]);	}
+			for (IntegerIndexList::const_iterator cur = trail.begin(); cur != trail.end(); ++cur)
+			{	s.trails_row.append(index_vector[*cur]);	}
+
+			s.set_vine(vine);
+		}
+
+	private:
+		IntegerIndexList													cycle;
+		IntegerIndexList													trail;
+		IntegerIndex														pairing;
+		Vine* 																vine;
+	
+	private:
+		// Serialization
+		friend class boost::serialization::access;
+		
+		template<class Archive>
+		void serialize(Archive& ar, version_type )
+		{
+			ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Simplex);
+			
+			ar & BOOST_SERIALIZATION_NVP(cycle);
+			ar & BOOST_SERIALIZATION_NVP(trail);
+			ar & BOOST_SERIALIZATION_NVP(pairing);
+			ar & BOOST_SERIALIZATION_NVP(vine);
+		}
+};
+#endif
+
+#endif // __FILTRATIONSIMPLEX_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/orderlist.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,214 @@
+/*
+ * Author: Dmitriy Morozov 
+ * Department of Computer Science, Duke University, 2006
+ */
+
+#ifndef __ORDERLIST_H__
+#define __ORDERLIST_H__
+
+#include <iterator>
+#include <iostream>
+#include <list>
+#include "types.h"
+//#include "counter.h"
+
+#include <boost/utility.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+//#include <boost/type_traits/is_convertible.hpp>
+//#include <boost/utility/enable_if.hpp>
+
+
+typedef					unsigned int					OrderType;
+
+template<class T> 		struct 	OrderListNode;
+template<class T>		class   OrderListIterator;
+template<class T>		class   const_OrderListIterator;
+
+/**
+ * OrderList stores a list of objects while keeping track of two orders: proper order and consistency order.
+ * Consistency order is guaranteed not to change, while proper order is affected by the swap() operation.
+ */
+template<class T>
+class OrderList: std::list<OrderListNode<T> >
+{
+	public:
+		class 			OrderComparison;				
+		class 			LessThanComparison;
+		class 			GreaterThanComparison;
+		class 			ConsistencyComparison;
+
+		/// \name Comparison types
+		/// @{
+		// Explicit typedefs for Doxygen
+		typedef			LessThanComparison							LessThanComparison;
+		typedef			GreaterThanComparison						GreaterThanComparison;
+		typedef			ConsistencyComparison						ConsistencyComparison;
+		/// @}
+	
+		typedef			OrderListNode<T>							NodeType;
+		typedef			OrderList<T>								Self;
+		typedef			std::list<NodeType >						Parent;
+		
+		typedef			T											value_type;
+		typedef			T&											reference;
+		typedef			const T&									const_reference;
+		typedef			OrderListIterator<T>						iterator;
+		typedef			const_OrderListIterator<T>					const_iterator;
+	
+						OrderList()									{}
+						~OrderList() 								{ clear(); }
+	
+		/// \name Order operations
+		void			swap(iterator i, iterator j);				///< Exchanges the order of simplices pointed to by i and j
+
+		/// \name Container operations
+		/// @{
+		// Explicit calls instead of using declarations for Doxygen
+		iterator		push_back(const_reference x);
+		void			clear()										{ return Parent::clear(); }	
+		bool			empty() const								{ return Parent::empty(); }
+		SizeType		size()	const								{ return Parent::size(); }
+		iterator		begin()										{ return iterator(Parent::begin()); }
+		const_iterator	begin() const								{ return const_iterator(Parent::begin()); }
+		iterator		end()										{ return iterator(Parent::end()); }
+		const_iterator	end() const									{ return const_iterator(Parent::end()); }
+		reference		back()										{ return Parent::back(); }
+		const_reference	back() const								{ return Parent::back(); }
+		void			pop_back()									{ return Parent::pop_back(); }
+		                                                			
+		iterator		last()										{ return iterator(boost::prior(end())); }
+		const_iterator	last() const								{ return const_iterator(boost::prior(end())); }
+		/// @}
+};
+
+/// Basic comparison that LessThan and GreaterThan derive from
+template<class T>
+class OrderList<T>::OrderComparison
+{
+	public:
+		typedef			typename OrderList<T>::const_iterator		ComparableType;				
+
+		int 			compare(ComparableType a, ComparableType b) const;				/// (-1,0,1) = a (precedes, ==, succeeds) b 
+};
+
+/// Determines if the first element is less than the second one
+template<class T>
+class OrderList<T>::LessThanComparison: public OrderComparison 
+{
+	public:
+		typedef			OrderComparison								Parent;
+		typedef			typename Parent::ComparableType				ComparableType;				
+		
+		int 			compare(ComparableType a, ComparableType b) const;	
+		bool 			operator()(ComparableType a, ComparableType b) const;
+};
+
+/// Determines if the first element is greater than the second one
+template<class T>
+class OrderList<T>::GreaterThanComparison: public OrderComparison 
+{
+	public:
+		typedef			OrderComparison								Parent;
+		typedef			typename Parent::ComparableType				ComparableType;				
+		
+		int 			compare(ComparableType a, ComparableType b) const;
+		bool 			operator()(ComparableType a, ComparableType b) const;
+};
+
+/// Determines the order of the two elements in the consistency order (that doesn't change during the execution)
+template<class T>
+class OrderList<T>::ConsistencyComparison
+{
+	public:
+		typedef			typename OrderList<T>::const_iterator		ComparableType;				
+		
+		int 			compare(ComparableType a, ComparableType b) const;				///< (-1,0,1) = a (precedes, ==, succeeds) b 
+		bool 			operator()(ComparableType a, ComparableType b) const;		
+};
+
+/// Structure storing auxilliary information requred for each node of OrderList
+template<class T>
+struct OrderListNode
+{
+	OrderListNode(const T& d, unsigned int orig, unsigned int cur):
+		data(d), original(orig), current(cur)
+	{}
+	
+	T 				data;
+	OrderType		original;
+	OrderType		current;
+};
+
+template<class T>
+class OrderListIterator: public boost::iterator_adaptor<OrderListIterator<T>,
+						 								typename OrderList<T>::Parent::iterator,
+						 								T>
+{
+	private:
+		struct			enabler										{};
+		
+	public:
+		typedef			typename OrderList<T>::Parent				OrderListParent;
+		typedef 		boost::iterator_adaptor<OrderListIterator<T>,
+												typename OrderListParent::iterator,
+												T>					Parent;
+		typedef			typename Parent::reference					reference;
+		typedef			typename Parent::base_type					base_type;
+
+						OrderListIterator()							{}
+						OrderListIterator(const typename OrderListParent::iterator& iter):
+    						OrderListIterator::iterator_adaptor_(iter)	
+						{}
+						OrderListIterator(const OrderListIterator<T>& other):
+							OrderListIterator::iterator_adaptor_(other.base())			
+						{}
+
+	private:
+		friend class	boost::iterator_core_access;
+		reference		dereference() const							{ return Parent::base_reference()->data; }
+		base_type&		get_base()									{ return Parent::base_reference(); }
+
+		friend class 	OrderList<T>;
+};
+
+template<class T>
+class const_OrderListIterator: public boost::iterator_adaptor<const_OrderListIterator<T>,
+						 									  typename OrderList<T>::Parent::const_iterator,
+						 									  const T>
+{
+	private:
+		struct			enabler										{};
+		
+	public:
+		typedef			typename OrderList<T>::Parent				OrderListParent;
+		typedef 		boost::iterator_adaptor<const_OrderListIterator<T>,
+												typename OrderListParent::const_iterator,
+												const T>			Parent;
+		typedef			typename Parent::reference					reference;
+		typedef			typename Parent::base_type					base_type;
+
+						const_OrderListIterator()					{}
+						const_OrderListIterator(const typename OrderListParent::const_iterator& iter):
+    						const_OrderListIterator::iterator_adaptor_(iter)	
+						{}
+						const_OrderListIterator(const const_OrderListIterator<T>& other):
+							const_OrderListIterator::iterator_adaptor_(other.base())			
+						{}
+						const_OrderListIterator(const OrderListIterator<T>& other):
+							const_OrderListIterator::iterator_adaptor_(other.base())			
+						{}
+
+	private:
+		friend class	boost::iterator_core_access;
+		reference		dereference() const							{ return Parent::base_reference()->data; }
+		const base_type&
+						get_base()									{ return Parent::base_reference(); }
+
+		friend class 	OrderList<T>::OrderComparison;
+		friend class 	OrderList<T>::ConsistencyComparison;
+};
+
+
+#include "orderlist.hpp"
+
+#endif // __ORDERLIST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/orderlist.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,67 @@
+/* Implementations */
+
+template<class T>
+void OrderList<T>::swap(iterator i, iterator j)
+{
+	typename Parent::iterator i_base = i.get_base();
+	typename Parent::iterator j_base = j.get_base();
+	std::swap(i_base->current, j_base->current);
+
+	// Exchange the actual elements in the list --- so that iterators behave as expected
+	typename Parent::iterator after_j = boost::next(j_base);	
+	Parent::splice(i_base, *this, j_base);
+	Parent::splice(after_j, *this, i_base);
+}
+
+template<class T>
+typename OrderList<T>::iterator OrderList<T>::push_back(const_reference x)
+{
+	OrderType index = size();
+	Parent::push_back(NodeType(x, index, index));
+	return last();
+}
+
+
+/* OrderComparison */
+template<class T>
+int OrderList<T>::OrderComparison::compare(ComparableType a, ComparableType b) const
+{
+	if (a.get_base()->current == b.get_base()->current)			return 0;
+	if (a.get_base()->current < b.get_base()->current)			return -1;
+	return 1;
+}
+
+
+/* LessThanComparison */
+template<class T>
+int OrderList<T>::LessThanComparison::compare(ComparableType a, ComparableType b) const
+{ return Parent::compare(a,b); }
+
+template<class T>
+bool OrderList<T>::LessThanComparison::operator()(ComparableType a, ComparableType b) const
+{ return compare(a,b) == -1; }
+
+
+/* GreaterThanComparison */
+template<class T>
+int OrderList<T>::GreaterThanComparison::compare(ComparableType a, ComparableType b) const
+{ return -Parent::compare(a,b); }
+
+template<class T>
+bool OrderList<T>::GreaterThanComparison::operator()(ComparableType a, ComparableType b) const
+{ return compare(a,b) == -1; }
+
+
+/* ConsistencyComparison */
+template<class T>
+int OrderList<T>::ConsistencyComparison::compare(ComparableType a, ComparableType b) const
+{ 
+	if (a.get_base()->original < b.get_base()->original) 			return -1;
+	else if (a.get_base()->original == b.get_base()->original)		return 0;
+	else															return 1;
+}
+
+template<class T>
+bool OrderList<T>::ConsistencyComparison::operator()(ComparableType a, ComparableType b) const
+{ return compare(a,b) == -1; }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/simplex.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,172 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005 -- 2006
+ */
+
+#ifndef __SIMPLEX_H__
+#define __SIMPLEX_H__
+
+#include "sys.h"
+#include "debug.h"
+
+#include <set>
+#include <list>
+#include <iostream>
+
+#include "types.h"
+
+#include <boost/serialization/access.hpp>
+
+
+/**
+ * SimplexWithVertices is a basic simplex class. It stores vertices of a given type, 
+ * and knows how to compute its own boundary. It should probably be used as a base 
+ * class for any explicit simplex representation.
+ */
+template<class V>
+class SimplexWithVertices
+{
+	public:
+		typedef		V																Vertex;
+		typedef		SimplexWithVertices<Vertex>										Self;
+	
+		typedef		std::set<Vertex>												VertexContainer;
+		typedef		std::list<Self>													Cycle;
+		
+		/// \name Constructors 
+		/// @{
+		SimplexWithVertices()														{}
+		SimplexWithVertices(const Self& s):	
+			vertices_(s.vertices_)													{}
+		template<class Iterator>
+		SimplexWithVertices(Iterator bg, Iterator end):
+			vertices_(bg, end)														{}
+		SimplexWithVertices(const VertexContainer& v):	
+			vertices_(v)															{}
+		SimplexWithVertices(Vertex v):	
+			vertices_()																{ vertices_.insert(v); }
+		/// @}
+		
+		/// \name Core 
+		/// @{
+		Cycle					boundary() const;
+		virtual RealType		value() const 										{ return 0; }
+		Dimension				dimension() const									{ return vertices_.size()-1; }
+		/// @}
+		
+		/// \name Vertex manipulation
+		/// @{
+		bool					contains(const Vertex& v) const						{ return (vertices_.find(v) != vertices_.end()); }
+		const VertexContainer&	vertices() const									{ return vertices_; }
+		void					add(const Vertex& v) 								{ vertices_.insert(v); }
+		/// @}
+
+		/// \name Assignment and comparison
+		/// Gives an ordering on simplices (for example, so that simplices can be used as keys for std::map)
+		/// @{
+		const Self&				operator=(const Self& s)							{ vertices_ = s.vertices_; return *this; }
+		bool					operator==(const Self& s) const						{ return vertices_ == s.vertices_; }
+		bool 					operator<(const Self& s) const						{ return vertices_ < s.vertices_; }
+		/// @}
+
+		std::ostream&			operator<<(std::ostream& out) const;
+	
+	private:
+		VertexContainer			vertices_;
+
+	private:
+		/* Serialization */
+		friend class boost::serialization::access;
+		
+		template<class Archive>
+		void 					serialize(Archive& ar, version_type );
+};
+
+/**
+ * SimplexWithValue explicitly adds a RealType value to the SimplexWithVertices.
+ */
+template<class Vert>
+class SimplexWithValue: public SimplexWithVertices<Vert>
+{
+	public:
+		typedef		Vert															Vertex;
+		typedef		RealType														Value;
+		typedef		SimplexWithValue<Vertex>										Self;
+		typedef		SimplexWithVertices<Vertex>										Parent;
+
+		typedef		typename Parent::VertexContainer								VertexContainer;
+	
+		/// \name Constructors
+		/// @{
+		SimplexWithValue(Value value = 0): val(value)								{}
+		SimplexWithValue(const Self& s):
+			Parent(s), val(s.val)													{}
+		SimplexWithValue(const Parent& s, Value value = 0): 
+			Parent(s), val(value)													{}
+		template<class Iterator>
+		SimplexWithValue(Iterator bg, Iterator end, Value value = 0):
+			Parent(bg, end), val(value)												{}
+		SimplexWithValue(const VertexContainer& v, Value value = 0):
+			Parent(v), val(value)													{}
+		/// @}
+
+		/// \name Core
+		/// @{
+		void 					set_value(Value value)								{ val = value; }
+		virtual Value			value() const										{ return val; }
+		/// @}
+		
+		const Self&				operator=(const Self& s);
+
+		std::ostream&			operator<<(std::ostream& out) const;
+
+	private:
+		Value					val;
+
+		/* Serialization */
+		friend class boost::serialization::access;
+		
+		template<class Archive>
+		void 					serialize(Archive& ar, version_type );
+};
+
+/**
+ * SimplexWithAttachment stores the vertex to which the simplex is attached (meant for lower-star filtrations)
+ */
+template<typename V>
+class SimplexWithAttachment: public SimplexWithVertices<V>
+{
+	public:
+		typedef 	V																VertexIndex;
+		typedef		SimplexWithVertices<VertexIndex>								Parent;
+	
+		/// \name Constructors 
+		/// @{
+		SimplexWithAttachment():
+			attachment(VertexIndex())												{}
+		template<class Iterator>
+		SimplexWithAttachment(Iterator bg, Iterator end):
+			Parent(bg, end)															{}
+		SimplexWithAttachment(const Parent& s):
+			Parent(s)																{}
+		SimplexWithAttachment(VertexIndex vi):
+			Parent(vi)																{}
+		/// @}
+
+		void 					set_attachment(VertexIndex v)						{ attachment = v; }
+		VertexIndex				get_attachment() const								{ return attachment; }
+		
+	private:
+		VertexIndex				attachment;
+	
+	private:
+		// Serialization
+		friend class boost::serialization::access;
+
+		template<class Archive>
+		void 					serialize(Archive& ar, version_type );
+};
+
+#include "simplex.hpp"
+
+#endif // __SIMPLEX_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/simplex.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,94 @@
+#include <boost/serialization/base_object.hpp>
+#include <boost/serialization/set.hpp>
+#include <boost/serialization/nvp.hpp>
+
+
+/* Implementations */
+
+/* SimplexWithVertices */
+template<class V>
+typename SimplexWithVertices<V>::Cycle	
+SimplexWithVertices<V>::
+boundary() const
+{
+	Cycle bdry;
+	if (dimension() == 0)	return bdry;
+
+	for (typename VertexContainer::const_iterator cur = vertices_.begin(); cur != vertices_.end(); ++cur)
+	{
+		bdry.push_back(*this);
+		Self& s = bdry.back();
+		s.vertices_.erase(*cur);
+	}
+
+	return bdry;
+}
+
+template<class V>
+std::ostream&			
+SimplexWithVertices<V>::
+operator<<(std::ostream& out) const
+{
+	for (typename VertexContainer::const_iterator cur = vertices_.begin(); cur != vertices_.end(); ++cur)
+		out << *cur << ' ';
+	
+	return out;
+}
+		
+template<class V>
+template<class Archive>
+void 
+SimplexWithVertices<V>::
+serialize(Archive& ar, version_type )									
+{ ar & BOOST_SERIALIZATION_NVP(vertices_); }
+
+template<class V>
+std::ostream& operator<<(std::ostream& out, const SimplexWithVertices<V>& s)		
+{ return s.operator<<(out); }
+
+
+/* SimplexWithValue */
+template<class V>
+std::ostream&
+SimplexWithValue<V>::
+operator<<(std::ostream& out) const
+{
+	Parent::operator<<(out);
+	out << "(val = " << val << ")";
+	return out;
+}
+
+template<class V>
+const typename SimplexWithValue<V>::Self&	
+SimplexWithValue<V>::
+operator=(const Self& s)									
+{ 
+	Parent::operator=(s); 
+	val = s.val; 
+	return *this; 
+}
+		
+template<class V>
+template<class Archive>
+void 
+SimplexWithValue<V>::
+serialize(Archive& ar, version_type )								
+{ 
+	ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Parent);
+	ar & BOOST_SERIALIZATION_NVP(val);
+}
+
+template<typename V>
+template<class Archive>
+void 
+SimplexWithAttachment<V>::
+serialize(Archive& ar, version_type )
+{			
+	ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Parent);
+	ar & BOOST_SERIALIZATION_NVP(attachment);
+}
+
+
+template<class V>
+std::ostream& operator<<(std::ostream& out, const SimplexWithValue<V>& s)		
+{ return s.operator<<(out); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/sys.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,26 @@
+// sys.h
+//
+// This header file is included at the top of every source file,
+// before any other header file.
+// It is intended to add defines that are needed globally and
+// to work around Operating System dependend incompatibilities.
+
+// EXAMPLE: If you use autoconf you can add the following here.
+// #ifdef HAVE_CONFIG_H
+// #include "config.h"
+// #endif
+
+// EXAMPLE: You could add stuff like this here too
+// (Otherwise add -DCWDEBUG to your CFLAGS).
+// #if defined(WANTSDEBUGGING) && defined(HAVE_LIBCWD_BLAHBLAH)
+// #define CWDEBUG
+// #endif
+
+// The following is the libcwd related mandatory part.
+// It must be included before any system header file is included!
+#ifdef CWDEBUG
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <libcwd/sys.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/types.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,51 @@
+#ifndef __TYPES_H__
+#define __TYPES_H__
+
+#include <iostream>
+
+/* Types */
+typedef 	bool					Sign;
+typedef		short int				Dimension;
+const 		Sign	 				POS = true;
+const 		Sign					NEG = false;
+typedef		double					RealType;
+typedef		unsigned int			SizeType;
+
+typedef 	const unsigned int&		version_type;
+
+
+/**
+ * Rational number type
+ */
+template<typename T>
+class Rational
+{
+	public:
+		typedef			Rational<T>			Self;
+	
+		Rational(T v);
+		Rational(const Self& other);
+
+		Self& operator/=(const Self& rhs);
+
+		/// \name Comparisons
+		/// Assume denominator is positive.
+		/// @{
+		bool operator<(const Self& rhs) const;
+		bool operator<=(const Self& rhs) const;
+		bool operator>(const Self& rhs) const;
+		bool operator>=(const Self& rhs) const;
+		/// @}
+		
+		Self& operator=(const Self& rhs);
+		RealType to_real() const;
+
+		std::ostream& operator<<(std::ostream& out) const;
+
+	private:
+		T numerator, denominator;
+};
+
+#include "types.hpp"
+
+#endif // __TYPES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/types.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,79 @@
+/* Implementations */
+
+template<typename T>
+Rational<T>::
+Rational(T v): 
+	numerator(v), denominator(1)					
+{}
+
+template<typename T>
+Rational<T>::
+Rational(const Self& other): 
+	numerator(other.numerator), denominator(other.denominator)
+{}
+
+template<typename T>
+typename Rational<T>::Self& 
+Rational<T>::
+operator/=(const Self& rhs)
+{ 
+	numerator *= rhs.denominator; 
+	denominator *= rhs.numerator; 
+
+	if (denominator < 0)
+	{
+		numerator = -numerator;
+		denominator = -denominator;
+	}
+	
+	return *this; 
+}
+
+template<typename T>
+bool 
+Rational<T>::
+operator<(const Self& rhs) const
+{ return (numerator * rhs.denominator < denominator * rhs.numerator); }
+
+template<typename T>
+bool 
+Rational<T>::
+operator<=(const Self& rhs) const
+{ return (numerator * rhs.denominator <= denominator * rhs.numerator); }
+
+template<typename T>
+bool 
+Rational<T>::
+operator>(const Self& rhs) const
+{ return rhs < (*this); }
+
+template<typename T>
+bool 
+Rational<T>::
+operator>=(const Self& rhs) const
+{ return rhs <= (*this); }
+
+template<typename T>
+typename Rational<T>::Self& 
+Rational<T>::
+operator=(const Self& rhs)
+{ numerator = rhs.numerator; denominator = rhs.denominator; return *this; }
+
+template<typename T>
+std::ostream& 
+Rational<T>::
+operator<<(std::ostream& out) const
+{ out << numerator << " / " << denominator << " = " << (numerator/denominator); return out; }
+
+template<typename T>
+RealType 
+Rational<T>::
+to_real() const
+{ return numerator/denominator; }
+
+		
+template<typename T>
+std::ostream& operator<<(std::ostream& out, const Rational<T>& r)
+{
+	return r.operator<<(out);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/vineyard.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,87 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2005 -- 2006
+ */
+
+#ifndef __VINEYARD_H__
+#define __VINEYARD_H__
+
+#include "filtration.h"
+#include "vineyardsimplex.h"
+#include "types.h"
+#include <list>
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/vector.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/list.hpp>
+#include <boost/serialization/is_abstract.hpp>
+	
+
+template<class S> class VineyardSimplex;
+
+/**
+ * Vineyard class. Provides transpose() function, and keeps track of vines and knees in the process.
+ * Derives from Filtration, which represents the current state of the filtration (after the performed 
+ * transpositions).
+ */
+template<class Smplx,
+		 class Fltr = Filtration<Smplx>, 
+		 class VnrdSmplx = VineyardSimplex<Smplx> >
+class Vineyard: public Fltr::template rebind<VnrdSmplx>::other
+{
+	public:
+		typedef							Smplx											Simplex;
+		typedef							VnrdSmplx										VineyardSimplex;
+		typedef				   typename Fltr::template rebind<VineyardSimplex>::other	Filtration;
+		
+		/// \name Vineyard types
+		/// @{
+		typedef				   typename VineyardSimplex::Knee							Knee;
+		typedef				   typename VineyardSimplex::Vine							Vine;
+		/// @}
+
+		/// \name Container  Types
+		/// @{
+		typedef				   typename Filtration::Index								Index;
+		typedef				   typename Filtration::const_Index							const_Index;
+		/// @}
+		
+		/// \name Cycles and Trails 
+		/// @{
+		typedef				   typename Filtration::CyclesComparator					CyclesComparator;
+		typedef				   typename Filtration::Cycle								Cycle;
+		typedef				   typename Filtration::TrailIterator						TrailIterator;
+		/// @}
+
+										
+	public:
+										Vineyard();
+										Vineyard(const Vineyard& vineyard); 				///< Copy-constructor
+		template<class OtherFltrSmplx>	Vineyard(const typename Filtration::template rebind<OtherFltrSmplx>::other& filtration);
+		///< Pseudo from-base constructor
+		
+		/// \name Core functionality
+		/// @{
+		void							pair_simplices(Index bg);
+		void							record_frame(Index bg);
+		bool							transpose(Index i);
+		/// @}
+
+		using Filtration::is_paired;
+		using Filtration::begin;
+		using Filtration::end;
+		using Filtration::size;
+		
+	protected:
+		bool 							transpose_simplices(Index i);				
+		typename Knee::SimplexList  	resolve_cycle(Index i) const;
+							
+	private:
+		void							start_vines(Index bg);
+		void							pairing_switch(Index i, Index j);
+};
+
+#include "vineyard.hpp"
+
+#endif // __VINEYARD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/vineyard.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,326 @@
+/* Implementations */
+
+
+template<class S, class F, class VS>
+Vineyard<S,F,VS>::
+Vineyard()
+{
+}
+	
+template<class S, class F, class VS>
+Vineyard<S,F,VS>::
+Vineyard(const Vineyard& vineyard): 
+	Filtration(vineyard)
+{
+	// TODO: copy vines
+}
+
+template<class S, class F, class VS>
+template<class OtherFltrSmplx>	
+Vineyard<S,F,VS>::
+Vineyard(const typename Filtration::template rebind<OtherFltrSmplx>::other& filtration):
+	Filtration(filtration)
+{
+	// TODO (if anything?)
+}
+
+
+template<class S, class F, class VS>
+void 
+Vineyard<S,F,VS>::
+pair_simplices(Index bg)
+{
+	Filtration::pair_simplices(bg);
+	start_vines(bg);	
+	record_frame(bg);
+}
+
+/** Starts a new frame by recording the current diagram in the vineyard */
+template<class S, class F, class VS>
+void 
+Vineyard<S,F,VS>::
+record_frame(Index bg)
+{
+	Dout(dc::vineyard, "Entered: record_frame()");
+	
+	AssertMsg(is_paired(), "Pairing must be computed before a vine frame can be recorded");
+	for (Index i = begin(); i != end(); ++i)
+	{
+		if (i->sign())		continue;
+		Knee* k = i->new_frame(Knee(i->pair()->value(), i->value(), 0));
+		k->set_cycle(resolve_cycle(i));
+	}
+}
+
+/**
+ * Transposes simplices at i and i+1, and records the knee in the vineyard if there is a change in pairing. 
+ * Returns true if the pairing changed.
+ */
+template<class S, class F, class VS>
+bool
+Vineyard<S,F,VS>::
+transpose(Index i)
+{
+	bool result = transpose_simplices(i);
+	if (result)
+	{
+		// Record pairing: TODO
+	}
+	return result;
+}
+
+/// Transposes simplices at i and i+1. Returns true if the pairing switched.
+template<class S, class F, class VS>
+bool 
+Vineyard<S,F,VS>::
+transpose_simplices(Index i)
+{
+	AssertMsg(is_paired(), "Pairing must be computed before transpositions");
+	counters.inc("SimplexTransposition");
+	
+	Index i_prev = i++;
+
+	if (i_prev->dimension() != i->dimension())
+	{
+		swap(i_prev, i);
+		Dout(dc::transpositions, "Different dimension");
+		counters.inc("Case DiffDim");
+		return false;
+	}
+	
+	bool si = i_prev->sign(), sii = i->sign();
+	if (si && sii)
+	{
+		Dout(dc::transpositions, "Trail prev: " << i_prev->trail());
+
+		// Case 1
+		TrailIterator i_prev_second = i_prev->trail().get_second(Filtration::get_trails_cmp());
+		if (*i_prev_second == i)
+		{
+			Dout(dc::transpositions, "Case 1, U[i,i+1] = 1");
+			i_prev->trail().erase(i_prev_second);
+		}
+
+		Index k = i_prev->pair();
+		Index l = i->pair();
+
+		// Explicit treatment of unpaired simplex
+		if (l == i)
+		{
+			swap(i_prev, i);
+			Dout(dc::transpositions, "Case 1.2 --- unpaired");
+			Dout(dc::transpositions, *i_prev);
+			counters.inc("Case 1.2");
+			return false;
+		} else if (k == i_prev)
+		{
+			if (*(l->cycle().get_second(Filtration::get_cycles_cmp())) != i_prev)
+			{
+				// Case 1.2
+				swap(i_prev, i);
+				Dout(dc::transpositions, "Case 1.2 --- unpaired");
+				Dout(dc::transpositions, *i_prev);
+				counters.inc("Case 1.2");
+				return false;
+			} else
+			{
+				// Case 1.1.2 --- special version (plain swap, but pairing switches)
+				swap(i_prev, i);
+				pairing_switch(i_prev, i);
+				Dout(dc::transpositions, "Case 1.1.2 --- unpaired");
+				Dout(dc::transpositions, *i_prev);
+				counters.inc("Case 1.1.2");
+				return true;
+			}
+		}
+		
+		Dout(dc::transpositions, "l cycle: " << l->cycle());
+		if (*(l->cycle().get_second(Filtration::get_cycles_cmp())) != i_prev)
+		{
+			// Case 1.2
+			swap(i_prev, i);
+			Dout(dc::transpositions, "Case 1.2");
+			counters.inc("Case 1.2");
+			return false;
+		} else
+		{
+			// Case 1.1
+			if (trails_cmp(k,l))
+			{
+				// Case 1.1.1
+				swap(i_prev, i);
+				l->cycle().add(k->cycle(), Filtration::get_consistency_cmp());		// Add column k to l
+				k->trail().add(l->trail(), Filtration::get_consistency_cmp());		// Add row l to k
+				Dout(dc::transpositions, "Case 1.1.1");
+				counters.inc("Case 1.1.1");
+				return false;
+			} else
+			{
+				// Case 1.1.2
+				swap(i_prev, i);
+				k->cycle().add(l->cycle(), Filtration::get_consistency_cmp());		// Add column l to k
+				l->trail().add(k->trail(), Filtration::get_consistency_cmp());		// Add row k to l
+				pairing_switch(i_prev, i);
+				Dout(dc::transpositions, "Case 1.1.2");
+				counters.inc("Case 1.1.2");
+				return true;
+			}
+		}
+	} else if (!si && !sii)
+	{
+		// Case 2
+		if (*(i_prev->trail().get_second(Filtration::get_trails_cmp())) != i)
+		{
+			// Case 2.2
+			swap(i_prev, i);
+			Dout(dc::transpositions, "Case 2.2");
+			counters.inc("Case 2.2");
+			return false;
+		} else
+		{
+			// Case 2.1
+			Index low_i = i_prev->pair();
+			Index low_ii = i->pair();
+			i_prev->trail().add(i->trail(), Filtration::get_consistency_cmp());			// Add row i to i_prev
+			i->cycle().add(i_prev->cycle(), Filtration::get_consistency_cmp());			// Add column i_prev to i
+			swap(i_prev, i);	
+			if (Filtration::get_trails_cmp()(low_ii, low_i))
+			{
+				// Case 2.1.2
+				i_prev->cycle().add(i->cycle(), Filtration::get_consistency_cmp());		// Add column i to i_prev (after transposition)
+				i->trail().add(i_prev->trail(), Filtration::get_consistency_cmp());			// Add row i to i_prev
+				pairing_switch(i_prev, i);
+				Dout(dc::transpositions, "Case 2.1.2");
+				counters.inc("Case 2.1.2");
+				return true;
+			} 
+			
+			// Case 2.1.1
+			Dout(dc::transpositions, "Case 2.1.1");
+			counters.inc("Case 2.1.1");
+			return false;
+		}
+	} else if (!si && sii)
+	{
+		// Case 3
+		if (*(i_prev->trail().get_second(Filtration::get_trails_cmp())) != i)
+		{
+			//AssertMsg(pair(i)->cycle_get_second(cycles_cmp) != i, dc::transpositions, "Problem in Case 3");
+			// Case 3.2
+			swap(i_prev, i);
+			Dout(dc::transpositions, "Case 3.2");
+			counters.inc("Case 3.2");
+			return false;
+		} else
+		{
+			// Case 3.1
+			i_prev->trail().add(i->trail(), Filtration::get_consistency_cmp());			// Add row i to i_prev
+			i->cycle().add(i_prev->cycle(), Filtration::get_consistency_cmp());			// Add column i_prev to i
+			swap(i_prev, i);
+			i_prev->cycle().add(i->cycle(), Filtration::get_consistency_cmp());			// Add column i_prev to i (after transposition)
+			i->trail().add(i_prev->trail(), Filtration::get_consistency_cmp());			// Add row i to i_prev
+			pairing_switch(i_prev, i);
+			Dout(dc::transpositions, "Case 3.1");
+			counters.inc("Case 3.1");
+			return true;
+		}
+	} else if (si && !sii)
+	{
+		// Case 4
+		TrailIterator i_prev_second = i_prev->trail().get_second(Filtration::get_trails_cmp());
+		if (*i_prev_second == i)
+		{
+			Dout(dc::transpositions, "Case 4, U[i,i+1] = 1");
+			i_prev->trail().erase(i_prev_second);
+		}
+		swap(i_prev, i);
+		Dout(dc::transpositions, "Case 4");
+		counters.inc("Case 4");
+		return false;
+	}
+	
+	return false; // to avoid compiler complaints, should never reach this point
+}
+
+template<class S, class F, class VS>
+typename Vineyard<S,F,VS>::Knee::SimplexList  
+Vineyard<S,F,VS>::
+resolve_cycle(Index i) const
+{
+	Dout(dc::filtration, "Entered: resolve_cycle");
+	const Cycle& cycle = i->cycle();
+		
+	const CyclesComparator& cmp = Filtration::get_cycles_cmp();
+	
+#if 0
+	// Make into canonical cycle
+	bool done = false;
+	while (!done)
+	{
+		done = true;
+		for (typename Cycle::const_iterator cur = cycle.begin(); cur != cycle.end(); ++cur)
+		{
+			if (!((*cur)->sign()))
+				continue;
+
+			if (cmp(i,(*cur)->pair()))
+			{
+				done = false;
+				cycle.add((*cur)->pair()->cycle(), get_consistency_cmp());
+				break;
+			}
+		}
+	}
+	std::cout << "Canonical cycle computed" << std::endl;
+#endif
+
+	// Resolve simplices
+	typename Knee::SimplexList lst;
+	for (typename Cycle::const_iterator cur = cycle.begin(); cur != cycle.end(); ++cur)
+		lst.push_back(**cur);
+
+	return lst;
+}
+
+
+/* Vineyard Private */
+/** Initializes vines in VineyardSimplices; should be called after pair_simplices() */
+template<class S, class F, class VS>
+void 
+Vineyard<S,F,VS>::
+start_vines(Index bg)
+{
+	for (Index i = bg; i != end(); ++i)
+	{
+		if (!i->sign())		continue;
+		Vine* v = new Vine;
+		i->set_vine(v);
+		i->pair()->set_vine(v);				// if i is unpaired i->pair() == i
+	}
+}
+
+/// Update the pairing, so that whoever was paired with i is now paired with j and vice versa.
+template<class S, class F, class VS>
+void 
+Vineyard<S,F,VS>::
+pairing_switch(Index i, Index j)
+{
+	Index i_pair = i->pair();
+	Index j_pair = j->pair();
+
+	if (i_pair == i)
+		j->set_pair(j);
+	else
+	{
+		j->set_pair(i_pair);
+		i_pair->set_pair(j);
+	}
+
+	if (j_pair == j)
+		i->set_pair(i);
+	else
+	{
+		i->set_pair(j_pair);
+		j_pair->set_pair(i);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/vineyardsimplex.h	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,125 @@
+/*
+ * Author: Dmitriy Morozov
+ * Department of Computer Science, Duke University, 2006
+ */
+
+#ifndef __VINEYARDSIMPLEX_H__
+#define __VINEYARDSIMPLEX_H__
+
+#include "types.h"
+
+#include <boost/serialization/access.hpp>
+
+template<class S> class Knee;
+template<class S> class Vine;
+
+/**
+ * VineyardSimplex class stores a Vine as a list of VineFrames, each of which is a list of Knees.
+ */
+template<class Smplx>
+class VineyardSimplex: public FiltrationSimplex<Smplx, VineyardSimplex<Smplx> >
+{
+	public:
+		typedef					Smplx											Simplex;
+		typedef					VineyardSimplex									Self;
+		typedef 				FiltrationSimplex<Simplex, Self>				FiltrationSimplex;
+
+		typedef					typename FiltrationSimplex::Container			Container;
+		typedef					typename FiltrationSimplex::Index				Index;
+			
+		typedef					Knee<Simplex>									Knee;
+		typedef					Vine<Simplex>									Vine;
+
+								VineyardSimplex(const FiltrationSimplex& fs): 
+									FiltrationSimplex(fs)						{}
+		
+		Vine*					vine() const									{ return vine_; }
+		void					set_vine(Vine* v)								{ vine_ = v; }
+		Knee*					add_knee(const Knee& k)							{ assert(vine_); return vine_->add(k); } 
+		Knee*					new_frame(const Knee& k)						{ assert(vine_); return vine_->new_frame(k); }
+		void					swap_vine(Index i)								{ std::swap(vine_, i->vine_); }
+
+		using FiltrationSimplex::set_pair;
+	
+	private:
+		Vine*																	vine_;
+};
+
+/**
+ * Knee class stores the knee in R^3 as well as the cycle that is associated with the Simplex starting from the Knee.
+ */
+template<class S>
+class Knee
+{
+	public:
+		typedef					S												Simplex;
+		typedef					std::list<Simplex>								SimplexList;
+	
+		RealType				birth;
+		RealType				death;
+		RealType				time;
+		SimplexList				cycle;
+			
+								// Default parameters for serialization
+								Knee(RealType b = 0, RealType d = 0, RealType t = 0):
+									birth(b), death(d), time(t)
+								{}
+
+		bool 					is_diagonal() const								{ return birth == death; }
+		void 					set_cycle(const SimplexList& lst)				{ cycle = lst; }
+	
+	private:
+		friend class boost::serialization::access;
+
+		template<class Archive>
+		void 					serialize(Archive& ar, version_type );
+};
+
+/**
+ * VineFrame is a list of Knees.
+ */
+template<class S>
+class VineFrame: public std::list<Knee<S> >
+{};
+
+
+/**
+ * Vine is a list of VineFrames.
+ */
+template<class S>
+class Vine: public std::list<VineFrame<S> >
+{	
+	public:
+		typedef					S												Simplex;
+		typedef					Knee<Simplex>									Knee;
+		typedef					VineFrame<Simplex>								VineFrame;
+		typedef					std::list<VineFrame>							VineRepresentation;
+		typedef					typename VineRepresentation::const_iterator		const_frame_iterator;
+		
+								Vine()											{}
+		
+		Knee* 					add(RealType b, RealType d, RealType t)			{ back().push_back(Knee(b,d,t)); return &(back().back()); }
+		Knee* 					add(const Knee& k)								{ back().push_back(k); return &(back().back()); }
+		Knee*					new_frame(const Knee& k)						{ push_back(VineFrame()); return add(k); }
+		unsigned int			num_frames()	const							{ return size(); }
+
+		// TODO: Do a proper frame_iterator here, and knee_iterator
+		using VineRepresentation::begin;
+		using VineRepresentation::end;
+		using VineRepresentation::front;
+		using VineRepresentation::back;
+		using VineRepresentation::size;
+
+	protected:
+		using VineRepresentation::push_back;
+
+	private:
+		friend class boost::serialization::access;
+
+		template<class Archive>
+		void 					serialize(Archive& ar, version_type );
+};
+
+#include "vineyardsimplex.hpp"
+
+#endif // __VINEYARDSIMPLEX_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/vineyardsimplex.hpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,27 @@
+#include <boost/serialization/vector.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/list.hpp>
+
+using boost::serialization::make_nvp;
+
+/* Implementations */
+template<class S>
+template<class Archive>
+void 
+Knee<S>::
+serialize(Archive& ar, version_type )
+{
+	ar & BOOST_SERIALIZATION_NVP(birth);
+	ar & BOOST_SERIALIZATION_NVP(death);
+	ar & BOOST_SERIALIZATION_NVP(time);
+	ar & BOOST_SERIALIZATION_NVP(cycle);
+}
+
+template<class S>
+template<class Archive>
+void 
+Vine<S>::
+serialize(Archive& ar, version_type )
+{ ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(VineRepresentation); }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sconstools/doxygen.py	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,192 @@
+# vim: set et sw=3 tw=0 fo=awqorc ft=python:
+#
+# Astxx, the Asterisk C++ API and Utility Library.
+# Copyright (C) 2005, 2006  Matthew A. Nicholson
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+import os
+import glob
+
+def DoxyfileParse(file_contents):
+   """
+   Parse a Doxygen source file and return a dictionary of all the values.
+   Values will be strings and lists of strings.
+   """
+   data = {}
+
+   import shlex
+   lex = shlex.shlex(instream = file_contents, posix = True)
+   lex.wordchars += "./-"
+   lex.whitespace = lex.whitespace.replace("\n", "")
+   lex.escape = ""
+
+   lineno = lex.lineno
+   token = lex.get_token()
+   key = token   # the first token should be a key
+   last_token = ""
+   key_token = False
+   next_key = False
+
+   while token:
+      if token in ['\n']:
+         if last_token not in ['\\']:
+            key_token = True
+      elif token in ['\\']:
+         pass
+      elif key_token:
+         key = token
+         key_token = False
+      else:
+         if token == "+=":
+            if not data.has_key(key):
+               data[key] = list()
+         elif token == "=":
+            data[key] = list()
+         else:
+            data[key].append(token)
+
+      last_token = token
+      token = lex.get_token()
+
+   # compress lists of len 1 into single strings
+   for (k, v) in data.items():
+      if len(v) == 0:
+         data.pop(k)
+
+      if k in ["INPUT", "FILE_PATTERNS"]:
+         continue
+
+      if len(v) == 1:
+         data[k] = v[0]
+
+   return data
+
+def DoxySourceScan(node, env, path):
+   """
+   Doxygen Doxyfile source scanner.  This should scan the Doxygen file and add
+   any files used to generate docs to the list of source files.
+   """
+   default_file_patterns = [
+      '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx',
+      '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++',
+      '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm',
+      '*.py',
+   ]
+
+   sources = []
+
+   data = DoxyfileParse(node.get_contents())
+
+   if data.get("RECURSIVE", "NO") == "YES":
+      recursive = True
+   else:
+      recursive = False
+
+   file_patterns = data.get("FILE_PATTERNS", default_file_patterns)
+
+   def recursively_scan_dir(dir, file_patterns):
+      matches = []
+      if not os.path.isdir(dir):
+         return matches
+
+      for pattern in file_patterns:
+         matches.extend(glob.glob("/".join([dir, pattern])))
+
+      for node in os.listdir(dir):
+         path = "/".join([dir, node])
+         if os.path.isdir(path):
+            matches.extend(recursively_scan_dir(path, file_patterns))
+
+      return matches
+
+   for node in data.get("INPUT", []):
+      if os.path.isfile(node):
+         sources.add(node)
+      elif os.path.isdir(node):
+         if recursive:
+            sources.extend(recursively_scan_dir(node, file_patterns))
+         else:
+            for pattern in file_patterns:
+               sources.extend(glob.glob("/".join([node, pattern])))
+
+   return sources
+
+def DoxySourceScanCheck(node, env):
+   """Check if we should scan this file"""
+   return os.path.isfile(node.path)
+
+def DoxyEmitter(source, target, env):
+   """Doxygen Doxyfile emitter"""
+   # possible output formats and their default values and output locations
+   output_formats = {
+      "HTML": ("YES", "html"),
+      "LATEX": ("NO", "latex"),
+      "RTF": ("NO", "rtf"),
+      "MAN": ("NO", "man"),
+      "XML": ("NO", "xml"),
+   }
+
+   data = DoxyfileParse(source[0].get_contents())
+
+   targets = []
+   out_dir = data.get("OUTPUT_DIRECTORY", ".")
+
+   # add our output locations
+   for (k, v) in output_formats.items():
+      if data.get("GENERATE_" + k, v[0]) == "YES":
+         targets.append("/".join([out_dir, data.get(k + "_OUTPUT", v[1])]))
+
+   # don't clobber targets
+   for node in targets:
+      env.Precious(node)
+
+   # set up cleaning stuff
+   for node in targets:
+      env.Clean(node, node)
+
+   return (targets, source)
+
+def generate(env):
+   """
+   Add builders and construction variables for the
+   Doxygen tool.  This is currently for Doxygen 1.4.6.
+   """
+   doxygen_scanner = env.Scanner(
+      DoxySourceScan,
+      "DoxySourceScan",
+      scan_check = DoxySourceScanCheck,
+   )
+
+   doxygen_builder = env.Builder(
+      action = env.Action("${DOXYGEN} ${SOURCE}"),
+      emitter = DoxyEmitter,
+      target_factory = env.fs.Entry,
+      single_source = True,
+      source_scanner =  doxygen_scanner,
+   )
+
+   env.Append(BUILDERS = {
+      'Doxygen': doxygen_builder,
+   })
+
+   env.AppendUnique(
+      DOXYGEN = 'doxygen',
+   )
+
+def exists(env):
+   """
+   Make sure doxygen exists.
+   """
+   return env.Detect("doxygen")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/debug.cpp	Mon Oct 30 14:20:45 2006 -0500
@@ -0,0 +1,82 @@
+#include "sys.h"
+#include "debug.h"
+
+#ifdef CWDEBUG
+
+namespace dionysus
+{
+	namespace debug 
+	{
+		namespace channels 		// DEBUGCHANNELS is set to this in debug.h
+		{
+			namespace dc 
+			{
+		        // Add new debug channels here.
+				channel_ct filtration("FILTRATION");
+				channel_ct transpositions("TRANSPOSITIONS");
+				channel_ct vineyard("VINEYARD");
+				channel_ct cycle("CYCLE");
+				channel_ct lsfiltration("LSFILTRATION");
+				channel_ct lsvineyard("LSVINEYARD");
+				channel_ct vertex_transpositions("VERTEX_TRANSPOS");
+			}
+    	} // namespace DEBUGCHANNELS
+
+		// Initialize debugging code from new threads.
+		void init_thread(void)
+		{
+			// Everything below needs to be repeated at the start of every
+			// thread function, because every thread starts in a completely
+			// reset state with all debug channels off etc.
+		
+			#if LIBCWD_THREAD_SAFE		// For the non-threaded case this is set by the rcfile.
+			// Turn on all debug channels by default.
+			ForAllDebugChannels(while(!debugChannel.is_on()) debugChannel.on());
+			// Turn off specific debug channels.
+			Debug(dc::bfd.off());
+			Debug(dc::malloc.off());
+			#endif
+		
+			// Turn on debug output.
+			// Only turn on debug output when the environment variable SUPPRESS_DEBUG_OUTPUT is not set.
+			Debug(if (getenv("SUPPRESS_DEBUG_OUTPUT") == NULL) libcw_do.on());
+			#if LIBCWD_THREAD_SAFE
+			Debug(libcw_do.set_ostream(&std::cout, &cout_mutex));
+		
+			// Set the thread id in the margin.
+			char margin[12];
+			sprintf(margin, "%-10lu ", pthread_self());
+			Debug(libcw_do.margin().assign(margin, 11));
+			#else
+			Debug(libcw_do.set_ostream(&std::cout));
+			#endif
+		
+			// Write a list of all existing debug channels to the default debug device.
+			Debug(list_channels_on(libcw_do));
+		}
+		
+		// Initialize debugging code from main().
+		void init(void)
+		{
+			// You want this, unless you mix streams output with C output.
+			// Read  http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for an explanation.
+			// We can't use it, because other code uses printf to write to the console.
+			//std::ios::sync_with_stdio(false);
+
+			// This will warn you when you are using header files that do not belong to the
+			// shared libcwd object that you linked with.
+			Debug(check_configuration());
+		
+			#if CWDEBUG_ALLOC
+			// Remove all current (pre- main) allocations from the Allocated Memory Overview.
+			libcwd::make_all_allocations_invisible_except(NULL);
+			#endif
+			
+			//Debug(read_rcfile());
+			
+			init_thread();
+		}
+	} // namespace debug
+} // namespace dionysus
+
+#endif // CWDEBUG