From 8b6382664b5b2a28948bd530d97483fc519ae272 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 14 May 2012 21:14:39 +0000 Subject: [PATCH 01/12] quickstart to top --- README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README b/README index 595bbccf4..1a3b21c54 100644 --- a/README +++ b/README @@ -1,6 +1,16 @@ README - Georgia Tech Smoothing and Mapping library --------------------------------------------------- +Quickstart + +In the root library folder execute: + +$] mkdir build +$] cd build +$] cmake .. +$] make check (optional, runs unit tests) +$] make install + What is GTSAM ? GTSAM is a library of C++ classes that implement smoothing and From 5d538cbdc290978bc5c04906c961f492712bbe93 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 14 May 2012 22:19:42 +0000 Subject: [PATCH 02/12] made leaner --- README | 92 ++++++++++++++++------------------------------------------ 1 file changed, 25 insertions(+), 67 deletions(-) diff --git a/README b/README index 1a3b21c54..5f84dbb81 100644 --- a/README +++ b/README @@ -100,11 +100,6 @@ doxygen. To create html documentation for GTSAM, run the the script makedoc.sh. 4) -For developers, we primarily use the Eclipse IDE for development, and provide -an Eclipse project file with a variety of make targets to build and debug -from within Eclipse. - -5) After installing prerequisites for building GTSAM, you can configure and build GTSAM using CMake with the default options with the quickstart options. For details on the full functionality of CMake, see the CMake documentation. @@ -120,47 +115,33 @@ $] cmake .. $] make check (optional, runs unit tests) $] make install -This will build the library and unit tests, run all of the unit tests, and then install -the library itself, as well as the Matlab toolbox. +This will build the library and unit tests, run all of the unit tests, +and then install the library itself. - Additional CMake Options and Details -The cmake scripts force a out-of-source build, so inside gtsam, -create a new folder called "build", and run cmake. From the command line: +GTSAM has a number of options that can be configured, which is best done with +one of the following: -$] mkdir build -$] cd build -$] cmake .. - -Note the ".." after the cmake command - it tells cmake to look for the -root CMakeLists.txt file in the root gtsam folder instead of in the build folder. -This is a necessary argument for starting cmake in all of its variations. -There a few ways of actually doing the configuration to make adjusting options easier. - - cmake the regular command-line version of cmake, allows configuration with scripts - ccmake the curses GUI for cmake, which lets you see the various options, change them, and run configuration. - cmake-gui a real GUI for cmake, which has a similar interface to ccmake, but with easier controls. - -Note that during configuration, the settings get cached so if you rerun cmake later, -it will keep your previous settings. In particular, you can use the "cmake" build target -within the Eclipse project to update the configuration, which will be necessary -when file structures change. - -While it is possible to use command-line arguments to cmake to change configuration -options, it is usually easier to use cmake-gui or ccmake to set parameters and use the other flags. + ccmake the curses GUI for cmake + cmake-gui a real GUI for cmake Important CMake configuration options: -CMAKE_INSTALL_PREFIX: this is the folder where installed files will go, and for -our development purposes, should be set to the home folder, like so +CMAKE_BUILD_TYPE: We support several build configurations for GTSAM (case insensitive) + Debug (default) All error checking options on, no optimization. Use for development. + Release Optimizations turned on, no debug symbols. + Timing Adds ENABLE_TIMING flag to provide statistics on operation + Profiling Standard configuration for use during profiling + RelWithDebInfo Same as Release, but with the -g flag for debug symbols + +CMAKE_INSTALL_PREFIX: The install folder. The default is typically /usr/local/ +To configure to install to your home directory, you could execute: $] cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME .. -GTSAM_TOOLBOX_INSTALL_PATH: When the library is installed with "make install", -the generated matlab toolbox code (created by wrap) gets installed as well in -this path. For example, use "/home/username/borg/toolbox" to install the -toolbox in your borg/toolbox folder. The matlab toolbox will get installed -into borg/toolbox/gtsam. -$] cmake -DGTSAM_TOOLBOX_INSTALL_PATH:PATH=$HOME/borg/toolbox .. +GTSAM_TOOLBOX_INSTALL_PATH: The Matlab toolbox will be installed in a subdirectory +of this folder, called 'gtsam'. +$] cmake -DGTSAM_TOOLBOX_INSTALL_PATH:PATH=$HOME/toolbox .. GTSAM_BUILD_CONVENIENCE_LIBRARIES: This is a build option to allow for tests in subfolders to be linked against convenience libraries rather than the full libgtsam. @@ -186,35 +167,12 @@ $] cmake -DGTSAM_BUILD_UNSTABLE:OPTION=ON .. folder called "gtsam_unstable". OFF (Default) If disabled, no gtsam_unstable code will be included in build or install. -CMAKE_BUILD_TYPE: We support several build configurations for GTSAM (case insensitive) - Debug (default) All error checking options on, no optimization. Use for development. - Release Optimizations turned on, no debug symbols. - Timing Adds ENABLE_TIMING flag to provide statistics on operation - Profiling Standard configuration for use during profiling - RelWithDebInfo Same as Release, but with the -g flag for debug symbols - - -Build and Install - -After configuring, you use make just as you normally would, and the all, check and -install targets work as in autotools. Note that all targets are at the root level -of the build folder. You can also build any of the subfolders individually as -individual targets, such as "make geometry slam" to build both geometry and slam. -Running "make install" will install the library to the prefix location. - Check -As with autotools, "make check" will build and run all of the tests. Note that the -tests will only be built when using the "check" targets, to prevent "make install" from -building the tests unnecessarily. You can also run "make timing" to build all of -the timing scripts. To run check on a particular subsection, there is a convention -of "make check.[subfolder]", so to run just the geometry tests, -run "make check.geometry". Individual tests can be run by appending ".run" to the -name of the test, for example, to run testMatrix, run "make testMatrix.run". - -The make target "wrap" will build the wrap binary, and the "wrap_gtsam" target will -generate code for the toolbox. By default, the toolbox will be created and installed -by the install target for the library. To change the install folder for the toolbox, -choose a different setting during cmake settings for the toolbox install path. - - +"make check" will build and run all of the tests. Note that the tests will only be +built when using the "check" targets, to prevent "make install" from building the tests +unnecessarily. You can also run "make timing" to build all of the timing scripts. +To run check on a particular module only, run "make check.[subfolder]", so to run +just the geometry tests, run "make check.geometry". Individual tests can be run by +appending ".run" to the name of the test, for example, to run testMatrix, run +"make testMatrix.run". \ No newline at end of file From 00627604a2ce444753ad6d5c429041b0d7d9e119 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 14 May 2012 23:35:32 +0000 Subject: [PATCH 03/12] cleaned up some more --- README | 85 ++++++++++++++++++++++------------------------------------ 1 file changed, 32 insertions(+), 53 deletions(-) diff --git a/README b/README index 5f84dbb81..d7a2184e2 100644 --- a/README +++ b/README @@ -11,7 +11,8 @@ $] cmake .. $] make check (optional, runs unit tests) $] make install -What is GTSAM ? +--------------------------------------------------- +What is GTSAM? GTSAM is a library of C++ classes that implement smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes @@ -21,10 +22,7 @@ What is GTSAM ? GTSAM is not (yet) open source: See COPYING & LICENSE Please see USAGE for an example on how to use GTSAM. -The core GTSAM code within the folder gtsam, with source, headers, and -unit tests. After building, this will generate a single library "libgtsam" - -The libgtsam code is organized according to the following directory structure: +The library is organized according to the following directory structure: 3rdparty local copies of third party libraries - Eigen3 and CCOLAMD base provides some base Math and data structures, as well as test-related utilities @@ -34,12 +32,6 @@ The libgtsam code is organized according to the following directory structure: nonlinear non-linear factor graphs and non-linear optimization slam SLAM and visual SLAM application code -Additionally, in the SVN development version of GTSAM, there is an area for -unstable code directly under development in the folder gtsam_unstable, which contains -a directory structuring mirroring the libgtsam structure as necessary. This section produces -a single library "libgtsam_unstable". Building of gtsam_unstable is disabled by default, see -CMake configuration options for information on enabling building. - This library contains unchanged copies of two third party libraries, with documentation of licensing in LICENSE and as follows: - CCOLAMD 2.73: Tim Davis' constrained column approximate minimum degree ordering library @@ -48,26 +40,19 @@ of licensing in LICENSE and as follows: - Eigen 3.0.5: General C++ matrix and linear algebra library - Licenced under LGPL v3, provided in gtsam/3rdparty/Eigen/COPYING.LGPL -After this is built, you can also run the more involved tests, which test the entire library: - - tests More involved unit tests that depend on slam - examples Demo applications as a tutorial for using gtsam - cmake CMake scripts used within the library, as well as for finding GTSAM by dependent projects -Finally, there are some local libraries built needed in the rest of the code: +There are two supporting libraries: CppUnitLite unit test library customized for use with gtsam wrap code generation utility for the Matlab interface to gtsam -Important Installation Notes Specific to GTSAM ----------------------------------------------- +Important Installation Notes +---------------------------- 1) GTSAM requires the following libraries to be installed on your system: - BOOST version 1.40 or greater (install through Linux repositories or MacPorts) - -GTSAM uses CMake (http://www.cmake.org/) for build automation - - Installed cmake version must be 2.6 or higher + - Cmake version 2.6 or higher Tested compilers - gcc @@ -75,39 +60,20 @@ Tested compilers - OSX gcc 2) -GTSAM makes extensive use of debug assertions, even for checking input of -the functions you will call. These assertions are disabled when NDEBUG is -defined. Thus, we strongly recommend compiling GTSAM and your own code without -this symbol during debugging. - -After debugging, GTSAM will run much faster when compiled with NDEBUG defined, -so that debug checks are disabled. - -Another useful debugging symbol is _GLIBCXX_DEBUG, which enables debug checks -and safe containers in the standard C++ library and makes problems much easier -to find. - -NOTE: The native Snow Leopard g++ compiler/library contains a bug that makes -it impossible to use _GLIBCXX_DEBUG. MacPorts g++ compilers do work with it though. - -NOTE: If _GLIBCXX_DEBUG is used to compile gtsam, anything that links against -gtsam will need to be compiled with _GLIBCXX_DEBUG as well, due to the use of -header-only Eigen. +GTSAM makes extensive use of debug assertions, and we highly recommend you work +in Debug mode while developing (enabled by default). Likewise, it is imperative +that you switch to release mode when running finished code and for timing. GTSAM +will run up to 10x faster in Release mode! See the end of this document for +additional debugging tips. 3) -GTSAM has been written to support the creation of API documentation using -doxygen. To create html documentation for GTSAM, run the the script +GTSAM has Doxygen documentation. To generate, run the the script makedoc.sh. 4) -After installing prerequisites for building GTSAM, you can configure and build -GTSAM using CMake with the default options with the quickstart options. For -details on the full functionality of CMake, see the CMake documentation. - -- CMake Quickstart -Installs to the default system install path and builds all components. From a terminal, -starting in the root library folder, execute commands as follows for an out-of-source -build: +The instructions below install the library to the default system install path and +build all components. From a terminal, starting in the root library folder, +execute commands as follows for an out-of-source build: $] mkdir build $] cd build @@ -118,7 +84,7 @@ $] make install This will build the library and unit tests, run all of the unit tests, and then install the library itself. -- Additional CMake Options and Details +- CMake Configuration Options and Details GTSAM has a number of options that can be configured, which is best done with one of the following: @@ -126,7 +92,7 @@ one of the following: ccmake the curses GUI for cmake cmake-gui a real GUI for cmake -Important CMake configuration options: +Important Options: CMAKE_BUILD_TYPE: We support several build configurations for GTSAM (case insensitive) Debug (default) All error checking options on, no optimization. Use for development. @@ -175,4 +141,17 @@ unnecessarily. You can also run "make timing" to build all of the timing scripts To run check on a particular module only, run "make check.[subfolder]", so to run just the geometry tests, run "make check.geometry". Individual tests can be run by appending ".run" to the name of the test, for example, to run testMatrix, run -"make testMatrix.run". \ No newline at end of file +"make testMatrix.run". + +Debugging tips: + +Another useful debugging symbol is _GLIBCXX_DEBUG, which enables debug checks +and safe containers in the standard C++ library and makes problems much easier +to find. + +NOTE: The native Snow Leopard g++ compiler/library contains a bug that makes +it impossible to use _GLIBCXX_DEBUG. MacPorts g++ compilers do work with it though. + +NOTE: If _GLIBCXX_DEBUG is used to compile gtsam, anything that links against +gtsam will need to be compiled with _GLIBCXX_DEBUG as well, due to the use of +header-only Eigen. From 1ea83ef56527118d3536711052228c0c9a25af9b Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 00:20:45 +0000 Subject: [PATCH 04/12] Moved TypedDiscreteFactor graph to unstable (which is not compiled, I presume) --- .../{ => unstable}/discrete/TypedDiscreteFactor.cpp | 6 +++--- gtsam/{ => unstable}/discrete/TypedDiscreteFactor.h | 6 +++--- .../discrete/TypedDiscreteFactorGraph.cpp | 13 ++++++------- .../discrete/TypedDiscreteFactorGraph.h | 4 ++-- .../discrete/tests/testTypedDiscreteFactor.cpp | 7 +++---- .../discrete/tests/testTypedDiscreteFactorGraph.cpp | 11 ++--------- .../discrete/tests/testTypedDiscreteVariable.cpp | 0 7 files changed, 19 insertions(+), 28 deletions(-) rename gtsam/{ => unstable}/discrete/TypedDiscreteFactor.cpp (97%) rename gtsam/{ => unstable}/discrete/TypedDiscreteFactor.h (96%) rename gtsam/{ => unstable}/discrete/TypedDiscreteFactorGraph.cpp (97%) rename gtsam/{ => unstable}/discrete/TypedDiscreteFactorGraph.h (95%) rename gtsam/{ => unstable}/discrete/tests/testTypedDiscreteFactor.cpp (96%) rename gtsam/{ => unstable}/discrete/tests/testTypedDiscreteFactorGraph.cpp (96%) rename gtsam/{ => unstable}/discrete/tests/testTypedDiscreteVariable.cpp (100%) diff --git a/gtsam/discrete/TypedDiscreteFactor.cpp b/gtsam/unstable/discrete/TypedDiscreteFactor.cpp similarity index 97% rename from gtsam/discrete/TypedDiscreteFactor.cpp rename to gtsam/unstable/discrete/TypedDiscreteFactor.cpp index 86f902e89..51f3ff791 100644 --- a/gtsam/discrete/TypedDiscreteFactor.cpp +++ b/gtsam/unstable/discrete/TypedDiscreteFactor.cpp @@ -5,10 +5,10 @@ * @date Mar 5, 2011 */ -#include -#include +#include +#include #include -#include +#include using namespace std; diff --git a/gtsam/discrete/TypedDiscreteFactor.h b/gtsam/unstable/discrete/TypedDiscreteFactor.h similarity index 96% rename from gtsam/discrete/TypedDiscreteFactor.h rename to gtsam/unstable/discrete/TypedDiscreteFactor.h index 3d9fd6ee6..e6a8b2f32 100644 --- a/gtsam/discrete/TypedDiscreteFactor.h +++ b/gtsam/unstable/discrete/TypedDiscreteFactor.h @@ -7,10 +7,10 @@ #pragma once -#include -#include #include -#include +#include +#include +#include namespace gtsam { diff --git a/gtsam/discrete/TypedDiscreteFactorGraph.cpp b/gtsam/unstable/discrete/TypedDiscreteFactorGraph.cpp similarity index 97% rename from gtsam/discrete/TypedDiscreteFactorGraph.cpp rename to gtsam/unstable/discrete/TypedDiscreteFactorGraph.cpp index 2f8c2d22b..65ffe2cc8 100644 --- a/gtsam/discrete/TypedDiscreteFactorGraph.cpp +++ b/gtsam/unstable/discrete/TypedDiscreteFactorGraph.cpp @@ -5,16 +5,15 @@ * @date Mar 1, 2011 */ +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include - -#include using namespace std; diff --git a/gtsam/discrete/TypedDiscreteFactorGraph.h b/gtsam/unstable/discrete/TypedDiscreteFactorGraph.h similarity index 95% rename from gtsam/discrete/TypedDiscreteFactorGraph.h rename to gtsam/unstable/discrete/TypedDiscreteFactorGraph.h index 010113bda..d466358f8 100644 --- a/gtsam/discrete/TypedDiscreteFactorGraph.h +++ b/gtsam/unstable/discrete/TypedDiscreteFactorGraph.h @@ -8,10 +8,10 @@ #pragma once +#include +#include #include #include -#include -#include namespace gtsam { diff --git a/gtsam/discrete/tests/testTypedDiscreteFactor.cpp b/gtsam/unstable/discrete/tests/testTypedDiscreteFactor.cpp similarity index 96% rename from gtsam/discrete/tests/testTypedDiscreteFactor.cpp rename to gtsam/unstable/discrete/tests/testTypedDiscreteFactor.cpp index af69eab41..6f90dcb22 100644 --- a/gtsam/discrete/tests/testTypedDiscreteFactor.cpp +++ b/gtsam/unstable/discrete/tests/testTypedDiscreteFactor.cpp @@ -5,13 +5,12 @@ * @date Mar 5, 2011 */ +#include +#include +#include #include using namespace boost::assign; -#include -#include -#include - using namespace std; using namespace gtsam; diff --git a/gtsam/discrete/tests/testTypedDiscreteFactorGraph.cpp b/gtsam/unstable/discrete/tests/testTypedDiscreteFactorGraph.cpp similarity index 96% rename from gtsam/discrete/tests/testTypedDiscreteFactorGraph.cpp rename to gtsam/unstable/discrete/tests/testTypedDiscreteFactorGraph.cpp index 90c4617ba..c0244ec88 100644 --- a/gtsam/discrete/tests/testTypedDiscreteFactorGraph.cpp +++ b/gtsam/unstable/discrete/tests/testTypedDiscreteFactorGraph.cpp @@ -6,16 +6,9 @@ * @date Feb 14, 2011 */ -//#include -//#include - -#include +#include #include -//#include -//#include - -#include -//#include +#include using namespace std; using namespace gtsam; diff --git a/gtsam/discrete/tests/testTypedDiscreteVariable.cpp b/gtsam/unstable/discrete/tests/testTypedDiscreteVariable.cpp similarity index 100% rename from gtsam/discrete/tests/testTypedDiscreteVariable.cpp rename to gtsam/unstable/discrete/tests/testTypedDiscreteVariable.cpp From f7349704f82a1b38ee57793cf0f124361e5e7d97 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 00:47:19 +0000 Subject: [PATCH 05/12] Moved constraint satisfaction stuff to gtsam_unstable (in progress!). --- .cproject | 515 +++++++++--------- gtsam/discrete/CMakeLists.txt | 8 - gtsam_unstable/CMakeLists.txt | 1 + .../discrete/AllDiff.cpp | 4 +- {gtsam => gtsam_unstable}/discrete/AllDiff.h | 2 +- .../discrete/BinaryAllDiff.h | 0 gtsam_unstable/discrete/CMakeLists.txt | 31 ++ {gtsam => gtsam_unstable}/discrete/CSP.cpp | 4 +- {gtsam => gtsam_unstable}/discrete/CSP.h | 4 +- {gtsam => gtsam_unstable}/discrete/Domain.cpp | 2 +- {gtsam => gtsam_unstable}/discrete/Domain.h | 0 .../discrete/Scheduler.cpp | 2 +- .../discrete/Scheduler.h | 2 +- .../discrete/SingleValue.cpp | 4 +- .../discrete/SingleValue.h | 0 .../discrete/examples/Doodle.csv | 0 .../discrete/examples/Doodle.xls | Bin .../discrete/examples/Doodle2012.csv | 0 .../discrete/examples/Doodle2012.xls | Bin .../discrete/examples/intrusive.xlsx | Bin .../discrete/examples/schedulingExample.cpp | 2 +- .../discrete/examples/schedulingQuals12.cpp | 2 +- .../discrete/examples/small.csv | 0 .../discrete/tests/testCSP.cpp | 4 +- .../discrete/tests/testScheduler.cpp | 4 +- .../discrete/tests/testSudoku.cpp | 2 +- 26 files changed, 321 insertions(+), 272 deletions(-) rename {gtsam => gtsam_unstable}/discrete/AllDiff.cpp (97%) rename {gtsam => gtsam_unstable}/discrete/AllDiff.h (97%) rename {gtsam => gtsam_unstable}/discrete/BinaryAllDiff.h (100%) create mode 100644 gtsam_unstable/discrete/CMakeLists.txt rename {gtsam => gtsam_unstable}/discrete/CSP.cpp (96%) rename {gtsam => gtsam_unstable}/discrete/CSP.h (95%) rename {gtsam => gtsam_unstable}/discrete/Domain.cpp (98%) rename {gtsam => gtsam_unstable}/discrete/Domain.h (100%) rename {gtsam => gtsam_unstable}/discrete/Scheduler.cpp (99%) rename {gtsam => gtsam_unstable}/discrete/Scheduler.h (99%) rename {gtsam => gtsam_unstable}/discrete/SingleValue.cpp (96%) rename {gtsam => gtsam_unstable}/discrete/SingleValue.h (100%) rename {gtsam => gtsam_unstable}/discrete/examples/Doodle.csv (100%) rename {gtsam => gtsam_unstable}/discrete/examples/Doodle.xls (100%) rename {gtsam => gtsam_unstable}/discrete/examples/Doodle2012.csv (100%) rename {gtsam => gtsam_unstable}/discrete/examples/Doodle2012.xls (100%) rename {gtsam => gtsam_unstable}/discrete/examples/intrusive.xlsx (100%) rename {gtsam => gtsam_unstable}/discrete/examples/schedulingExample.cpp (99%) rename {gtsam => gtsam_unstable}/discrete/examples/schedulingQuals12.cpp (99%) rename {gtsam => gtsam_unstable}/discrete/examples/small.csv (100%) rename {gtsam => gtsam_unstable}/discrete/tests/testCSP.cpp (98%) rename {gtsam => gtsam_unstable}/discrete/tests/testScheduler.cpp (97%) rename {gtsam => gtsam_unstable}/discrete/tests/testSudoku.cpp (99%) diff --git a/.cproject b/.cproject index 54f296c33..efdaf0c8a 100644 --- a/.cproject +++ b/.cproject @@ -311,14 +311,6 @@ true true - - make - -j2 - testGaussianFactor.run - true - true - true - make -j2 @@ -345,6 +337,7 @@ make + tests/testBayesTree.run true false @@ -352,6 +345,7 @@ make + testBinaryBayesNet.run true false @@ -399,6 +393,7 @@ make + testSymbolicBayesNet.run true false @@ -406,6 +401,7 @@ make + tests/testSymbolicFactor.run true false @@ -413,6 +409,7 @@ make + testSymbolicFactorGraph.run true false @@ -428,11 +425,20 @@ make + tests/testBayesTree true false true + + make + -j2 + testGaussianFactor.run + true + true + true + make -j2 @@ -459,7 +465,6 @@ make - testGraph.run true false @@ -531,7 +536,6 @@ make - testInference.run true false @@ -539,7 +543,6 @@ make - testGaussianFactor.run true false @@ -547,7 +550,6 @@ make - testJunctionTree.run true false @@ -555,7 +557,6 @@ make - testSymbolicBayesNet.run true false @@ -563,7 +564,6 @@ make - testSymbolicFactorGraph.run true false @@ -593,6 +593,38 @@ true true + + make + -j5 + testBTree.run + true + true + true + + + make + -j5 + testDSF.run + true + true + true + + + make + -j5 + testDSFVector.run + true + true + true + + + make + -j5 + testFixedVector.run + true + true + true + make -j2 @@ -633,22 +665,6 @@ false true - - make - -j2 - all - true - true - true - - - make - -j2 - clean - true - true - true - make -j2 @@ -665,6 +681,22 @@ true true + + make + -j2 + all + true + true + true + + + make + -j2 + clean + true + true + true + make -j2 @@ -689,18 +721,26 @@ true true - + make - -j5 - nonlinear.testValues.run + -j2 + all true true true - + make - -j5 - nonlinear.testOrdering.run + -j2 + check + true + true + true + + + make + -j2 + clean true true true @@ -737,26 +777,58 @@ true true - + make - -j2 - all + -j5 + testValues.run true true true - + make - -j2 - check + -j5 + testOrdering.run true true true - + make - -j2 - clean + -j5 + schedulingExample.run + true + true + true + + + make + -j5 + testCSP.run + true + true + true + + + make + -j5 + testScheduler.run + true + true + true + + + make + -j5 + schedulingQuals12.run + true + true + true + + + make + -j5 + testSudoku.run true true true @@ -793,10 +865,10 @@ true true - + make -j5 - check + testDiscreteFactor.run true true true @@ -1067,6 +1139,7 @@ make + testErrors.run true false @@ -1522,7 +1595,6 @@ make - testSimulated2DOriented.run true false @@ -1562,7 +1634,6 @@ make - testSimulated2D.run true false @@ -1570,7 +1641,6 @@ make - testSimulated3D.run true false @@ -1592,82 +1662,74 @@ true true - - make - -j2 - tests/testVectorValues.run - true - true - true - - + make -j5 - linear.testNoiseModel.run + testVectorValues.run true true true - - make - -j2 - tests/testGaussianFactor.run - true - true - true - - - make - -j2 - tests/testHessianFactor.run - true - true - true - - - make - -j2 - tests/testGaussianConditional.run - true - true - true - - - make - -j2 - tests/testGaussianFactorGraph.run - true - true - true - - - make - -j2 - tests/testGaussianJunctionTree.run - true - true - true - - - make - -j2 - tests/testKalmanFilter.run - true - true - true - - - make - -j2 - tests/testGaussianDensity.run - true - true - true - - + make -j5 - linear.testSerializationLinear.run + testNoiseModel.run + true + true + true + + + make + -j5 + testHessianFactor.run + true + true + true + + + make + -j5 + testGaussianConditional.run + true + true + true + + + make + -j5 + testGaussianFactorGraph.run + true + true + true + + + make + -j5 + testGaussianJunctionTree.run + true + true + true + + + make + -j5 + testKalmanFilter.run + true + true + true + + + make + -j5 + testGaussianDensity.run + true + true + true + + + make + -j5 + testSerializationLinear.run true true true @@ -1770,7 +1832,6 @@ make - tests/testGaussianISAM2 true false @@ -1792,102 +1853,6 @@ true true - - make - -j2 - testRot3.run - true - true - true - - - make - -j2 - testRot2.run - true - true - true - - - make - -j2 - testPose3.run - true - true - true - - - make - -j2 - timeRot3.run - true - true - true - - - make - -j2 - testPose2.run - true - true - true - - - make - -j2 - testCal3_S2.run - true - true - true - - - make - -j2 - testSimpleCamera.run - true - true - true - - - make - -j2 - testHomography2.run - true - true - true - - - make - -j2 - testCalibratedCamera.run - true - true - true - - - make - -j2 - check - true - true - true - - - make - -j2 - clean - true - true - true - - - make - -j2 - testPoint2.run - true - true - true - make -j2 @@ -2089,6 +2054,7 @@ cpack + -G DEB true false @@ -2096,6 +2062,7 @@ cpack + -G RPM true false @@ -2103,6 +2070,7 @@ cpack + -G TGZ true false @@ -2110,6 +2078,7 @@ cpack + --config CPackSourceConfig.cmake true false @@ -2123,82 +2092,98 @@ true true - + make - -j5 - wrap_gtsam_unstable + -j2 + testRot3.run true true true - + make - -j5 - check.wrap + -j2 + testRot2.run true true true - + make - -j5 - check.dynamics_unstable + -j2 + testPose3.run true true true - + make - -j5 - check.slam_unstable + -j2 + timeRot3.run true true true - + make - -j5 - check.base_unstable + -j2 + testPose2.run true true true - + make - -j5 - testSpirit.run + -j2 + testCal3_S2.run true true true - + make - -j5 - testWrap.run + -j2 + testSimpleCamera.run true true true - + make - -j5 - check.wrap + -j2 + testHomography2.run true true true - + make - -j5 - wrap_gtsam + -j2 + testCalibratedCamera.run true true true - + make - -j5 - wrap + -j2 + check + true + true + true + + + make + -j2 + clean + true + true + true + + + make + -j2 + testPoint2.run true true true @@ -2242,6 +2227,46 @@ false true + + make + -j5 + wrap.testSpirit.run + true + true + true + + + make + -j5 + wrap.testWrap.run + true + true + true + + + make + -j5 + check.wrap + true + true + true + + + make + -j5 + wrap_gtsam + true + true + true + + + make + -j5 + wrap + true + true + true + diff --git a/gtsam/discrete/CMakeLists.txt b/gtsam/discrete/CMakeLists.txt index d45340990..243359855 100644 --- a/gtsam/discrete/CMakeLists.txt +++ b/gtsam/discrete/CMakeLists.txt @@ -23,14 +23,6 @@ if (GTSAM_BUILD_TESTS) gtsam_add_subdir_tests(discrete "${discrete_local_libs}" "gtsam-static" "${discrete_excluded_tests}") endif() -# add examples -foreach(example schedulingExample schedulingQuals12) - add_executable(${example} "examples/${example}.cpp") - add_dependencies(${example} gtsam-static) - target_link_libraries(${example} gtsam-static) - add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN}) -endforeach(example) - # Build timing scripts #if (GTSAM_BUILD_TIMING) # gtsam_add_timing(discrete "${discrete_local_libs}") diff --git a/gtsam_unstable/CMakeLists.txt b/gtsam_unstable/CMakeLists.txt index 9e1daf24b..f7563f8ff 100644 --- a/gtsam_unstable/CMakeLists.txt +++ b/gtsam_unstable/CMakeLists.txt @@ -2,6 +2,7 @@ # and also build tests set (gtsam_unstable_subdirs base + discrete dynamics slam ) diff --git a/gtsam/discrete/AllDiff.cpp b/gtsam_unstable/discrete/AllDiff.cpp similarity index 97% rename from gtsam/discrete/AllDiff.cpp rename to gtsam_unstable/discrete/AllDiff.cpp index 064e0d1c8..261787691 100644 --- a/gtsam/discrete/AllDiff.cpp +++ b/gtsam_unstable/discrete/AllDiff.cpp @@ -5,8 +5,8 @@ * @author Frank Dellaert */ -#include -#include +#include +#include #include #include diff --git a/gtsam/discrete/AllDiff.h b/gtsam_unstable/discrete/AllDiff.h similarity index 97% rename from gtsam/discrete/AllDiff.h rename to gtsam_unstable/discrete/AllDiff.h index 846dc335b..b90a4b06e 100644 --- a/gtsam/discrete/AllDiff.h +++ b/gtsam_unstable/discrete/AllDiff.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include namespace gtsam { diff --git a/gtsam/discrete/BinaryAllDiff.h b/gtsam_unstable/discrete/BinaryAllDiff.h similarity index 100% rename from gtsam/discrete/BinaryAllDiff.h rename to gtsam_unstable/discrete/BinaryAllDiff.h diff --git a/gtsam_unstable/discrete/CMakeLists.txt b/gtsam_unstable/discrete/CMakeLists.txt new file mode 100644 index 000000000..73f10f1f0 --- /dev/null +++ b/gtsam_unstable/discrete/CMakeLists.txt @@ -0,0 +1,31 @@ +# Install headers +file(GLOB discrete_headers "*.h") +install(FILES ${discrete_headers} DESTINATION include/gtsam_unstable/discrete) + +# Components to link tests in this subfolder against +set(discrete_local_libs + discrete_unstable + discrete + inference + base + ccolamd +) + +set (discrete_full_libs + gtsam-static + gtsam_unstable-static) + +# Exclude tests that don't work +set (discrete_excluded_tests "") + +# Add all tests +gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_full_libs}" "${discrete_excluded_tests}") + +# add examples +foreach(example schedulingExample schedulingQuals12) + add_executable(${example} "examples/${example}.cpp") + add_dependencies(${example} gtsam-static) + target_link_libraries(${example} gtsam-static) + add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN}) +endforeach(example) + diff --git a/gtsam/discrete/CSP.cpp b/gtsam_unstable/discrete/CSP.cpp similarity index 96% rename from gtsam/discrete/CSP.cpp rename to gtsam_unstable/discrete/CSP.cpp index c0d57f320..ebc56441c 100644 --- a/gtsam/discrete/CSP.cpp +++ b/gtsam_unstable/discrete/CSP.cpp @@ -5,8 +5,8 @@ * @author Frank Dellaert */ -#include -#include +#include +#include #include #include #include diff --git a/gtsam/discrete/CSP.h b/gtsam_unstable/discrete/CSP.h similarity index 95% rename from gtsam/discrete/CSP.h rename to gtsam_unstable/discrete/CSP.h index d423426fd..517ee6796 100644 --- a/gtsam/discrete/CSP.h +++ b/gtsam_unstable/discrete/CSP.h @@ -7,8 +7,8 @@ #pragma once -#include -#include +#include +#include #include namespace gtsam { diff --git a/gtsam/discrete/Domain.cpp b/gtsam_unstable/discrete/Domain.cpp similarity index 98% rename from gtsam/discrete/Domain.cpp rename to gtsam_unstable/discrete/Domain.cpp index 130bd71ff..c8dbdb4e7 100644 --- a/gtsam/discrete/Domain.cpp +++ b/gtsam_unstable/discrete/Domain.cpp @@ -5,7 +5,7 @@ * @author Frank Dellaert */ -#include +#include #include #include #include diff --git a/gtsam/discrete/Domain.h b/gtsam_unstable/discrete/Domain.h similarity index 100% rename from gtsam/discrete/Domain.h rename to gtsam_unstable/discrete/Domain.h diff --git a/gtsam/discrete/Scheduler.cpp b/gtsam_unstable/discrete/Scheduler.cpp similarity index 99% rename from gtsam/discrete/Scheduler.cpp rename to gtsam_unstable/discrete/Scheduler.cpp index dd578930d..a586e7f33 100644 --- a/gtsam/discrete/Scheduler.cpp +++ b/gtsam_unstable/discrete/Scheduler.cpp @@ -5,7 +5,7 @@ * @author Frank Dellaert */ -#include +#include #include #include #include diff --git a/gtsam/discrete/Scheduler.h b/gtsam_unstable/discrete/Scheduler.h similarity index 99% rename from gtsam/discrete/Scheduler.h rename to gtsam_unstable/discrete/Scheduler.h index f01b1591e..e44f703b2 100644 --- a/gtsam/discrete/Scheduler.h +++ b/gtsam_unstable/discrete/Scheduler.h @@ -7,7 +7,7 @@ #pragma once -#include +#include namespace gtsam { diff --git a/gtsam/discrete/SingleValue.cpp b/gtsam_unstable/discrete/SingleValue.cpp similarity index 96% rename from gtsam/discrete/SingleValue.cpp rename to gtsam_unstable/discrete/SingleValue.cpp index 8d5fd0d8d..cfa2089fc 100644 --- a/gtsam/discrete/SingleValue.cpp +++ b/gtsam_unstable/discrete/SingleValue.cpp @@ -5,8 +5,8 @@ * @author Frank Dellaert */ -#include -#include +#include +#include #include #include #include diff --git a/gtsam/discrete/SingleValue.h b/gtsam_unstable/discrete/SingleValue.h similarity index 100% rename from gtsam/discrete/SingleValue.h rename to gtsam_unstable/discrete/SingleValue.h diff --git a/gtsam/discrete/examples/Doodle.csv b/gtsam_unstable/discrete/examples/Doodle.csv similarity index 100% rename from gtsam/discrete/examples/Doodle.csv rename to gtsam_unstable/discrete/examples/Doodle.csv diff --git a/gtsam/discrete/examples/Doodle.xls b/gtsam_unstable/discrete/examples/Doodle.xls similarity index 100% rename from gtsam/discrete/examples/Doodle.xls rename to gtsam_unstable/discrete/examples/Doodle.xls diff --git a/gtsam/discrete/examples/Doodle2012.csv b/gtsam_unstable/discrete/examples/Doodle2012.csv similarity index 100% rename from gtsam/discrete/examples/Doodle2012.csv rename to gtsam_unstable/discrete/examples/Doodle2012.csv diff --git a/gtsam/discrete/examples/Doodle2012.xls b/gtsam_unstable/discrete/examples/Doodle2012.xls similarity index 100% rename from gtsam/discrete/examples/Doodle2012.xls rename to gtsam_unstable/discrete/examples/Doodle2012.xls diff --git a/gtsam/discrete/examples/intrusive.xlsx b/gtsam_unstable/discrete/examples/intrusive.xlsx similarity index 100% rename from gtsam/discrete/examples/intrusive.xlsx rename to gtsam_unstable/discrete/examples/intrusive.xlsx diff --git a/gtsam/discrete/examples/schedulingExample.cpp b/gtsam_unstable/discrete/examples/schedulingExample.cpp similarity index 99% rename from gtsam/discrete/examples/schedulingExample.cpp rename to gtsam_unstable/discrete/examples/schedulingExample.cpp index ff3f8a26f..6ad2478ec 100644 --- a/gtsam/discrete/examples/schedulingExample.cpp +++ b/gtsam_unstable/discrete/examples/schedulingExample.cpp @@ -8,7 +8,7 @@ //#define ENABLE_TIMING #define ADD_NO_CACHING #define ADD_NO_PRUNING -#include +#include #include #include diff --git a/gtsam/discrete/examples/schedulingQuals12.cpp b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp similarity index 99% rename from gtsam/discrete/examples/schedulingQuals12.cpp rename to gtsam_unstable/discrete/examples/schedulingQuals12.cpp index 7571fbc58..32bb8ebb2 100644 --- a/gtsam/discrete/examples/schedulingQuals12.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp @@ -8,7 +8,7 @@ #define ENABLE_TIMING #define ADD_NO_CACHING #define ADD_NO_PRUNING -#include +#include #include #include diff --git a/gtsam/discrete/examples/small.csv b/gtsam_unstable/discrete/examples/small.csv similarity index 100% rename from gtsam/discrete/examples/small.csv rename to gtsam_unstable/discrete/examples/small.csv diff --git a/gtsam/discrete/tests/testCSP.cpp b/gtsam_unstable/discrete/tests/testCSP.cpp similarity index 98% rename from gtsam/discrete/tests/testCSP.cpp rename to gtsam_unstable/discrete/tests/testCSP.cpp index cce32f09f..46bf61240 100644 --- a/gtsam/discrete/tests/testCSP.cpp +++ b/gtsam_unstable/discrete/tests/testCSP.cpp @@ -5,8 +5,8 @@ * @author Frank Dellaert */ -#include -#include +#include +#include #include #include #include diff --git a/gtsam/discrete/tests/testScheduler.cpp b/gtsam_unstable/discrete/tests/testScheduler.cpp similarity index 97% rename from gtsam/discrete/tests/testScheduler.cpp rename to gtsam_unstable/discrete/tests/testScheduler.cpp index 28e3e16ed..bf9273ad6 100644 --- a/gtsam/discrete/tests/testScheduler.cpp +++ b/gtsam_unstable/discrete/tests/testScheduler.cpp @@ -5,7 +5,7 @@ */ //#define ENABLE_TIMING -#include +#include #include #include @@ -149,7 +149,7 @@ TEST( schedulingExample, test) /* ************************************************************************* */ TEST( schedulingExample, smallFromFile) { - string path("../../../gtsam/discrete/examples/"); + string path("../../../gtsam_unstable/discrete/examples/"); Scheduler s(2, path + "small.csv"); // add areas diff --git a/gtsam/discrete/tests/testSudoku.cpp b/gtsam_unstable/discrete/tests/testSudoku.cpp similarity index 99% rename from gtsam/discrete/tests/testSudoku.cpp rename to gtsam_unstable/discrete/tests/testSudoku.cpp index 7e4139818..1bbac4777 100644 --- a/gtsam/discrete/tests/testSudoku.cpp +++ b/gtsam_unstable/discrete/tests/testSudoku.cpp @@ -5,7 +5,7 @@ * @author Frank Dellaert */ -#include +#include #include #include #include From 33cdd30173b923677d38a53d9e07a04b90029537 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 01:01:31 +0000 Subject: [PATCH 06/12] Fixed link and load errors in example, added exception (rather than segfault) if file not found. --- gtsam_unstable/discrete/CMakeLists.txt | 4 ++-- gtsam_unstable/discrete/Scheduler.cpp | 4 ++++ gtsam_unstable/discrete/examples/schedulingExample.cpp | 2 +- gtsam_unstable/discrete/examples/schedulingQuals12.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gtsam_unstable/discrete/CMakeLists.txt b/gtsam_unstable/discrete/CMakeLists.txt index 73f10f1f0..b10503359 100644 --- a/gtsam_unstable/discrete/CMakeLists.txt +++ b/gtsam_unstable/discrete/CMakeLists.txt @@ -24,8 +24,8 @@ gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_fu # add examples foreach(example schedulingExample schedulingQuals12) add_executable(${example} "examples/${example}.cpp") - add_dependencies(${example} gtsam-static) - target_link_libraries(${example} gtsam-static) + add_dependencies(${example} gtsam-static gtsam_unstable-static) + target_link_libraries(${example} gtsam-static gtsam_unstable-static) add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN}) endforeach(example) diff --git a/gtsam_unstable/discrete/Scheduler.cpp b/gtsam_unstable/discrete/Scheduler.cpp index a586e7f33..6b4a19e76 100644 --- a/gtsam_unstable/discrete/Scheduler.cpp +++ b/gtsam_unstable/discrete/Scheduler.cpp @@ -29,6 +29,10 @@ namespace gtsam { // open file ifstream is(filename.c_str()); + if (!is) { + cerr << "Scheduler: could not open file " << filename << endl; + throw runtime_error("Scheduler: could not open file " + filename); + } string line; // buffer diff --git a/gtsam_unstable/discrete/examples/schedulingExample.cpp b/gtsam_unstable/discrete/examples/schedulingExample.cpp index 6ad2478ec..485f0ea1c 100644 --- a/gtsam_unstable/discrete/examples/schedulingExample.cpp +++ b/gtsam_unstable/discrete/examples/schedulingExample.cpp @@ -53,7 +53,7 @@ void addStudent(Scheduler& s, size_t i) { } /* ************************************************************************* */ Scheduler largeExample(size_t nrStudents = 7) { - string path("/Users/dellaert/borg/gtsam/gtsam/discrete/examples/"); + string path("../../../gtsam_unstable/discrete/examples/"); Scheduler s(nrStudents, path + "Doodle.csv"); s.addArea("Harvey Lipkin", "Mechanics"); diff --git a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp index 32bb8ebb2..d0fa041c9 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp @@ -65,7 +65,7 @@ void addStudent(Scheduler& s, size_t i) { /* ************************************************************************* */ Scheduler largeExample(size_t nrStudents = NRSTUDENTS) { - string path("/Users/dellaert/borg/gtsam/gtsam/discrete/examples/"); + string path("../../../gtsam_unstable/discrete/examples/"); Scheduler s(nrStudents, path + "Doodle2012.csv"); s.addArea("Harvey Lipkin", "Mechanics"); From 99d3b7bad6ae2bc14277ec26914449363697405e Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Tue, 15 May 2012 03:37:51 +0000 Subject: [PATCH 07/12] Additional notes on cmake, moved previously excluded discrete files, re-enabled testPotentialTable (which fails) --- gtsam/CMakeLists.txt | 20 ++++++++++++-------- gtsam/discrete/CMakeLists.txt | 8 ++++---- gtsam/{ => unstable}/discrete/parseUAI.cpp | 0 gtsam/{ => unstable}/discrete/parseUAI.h | 0 4 files changed, 16 insertions(+), 12 deletions(-) rename gtsam/{ => unstable}/discrete/parseUAI.cpp (100%) rename gtsam/{ => unstable}/discrete/parseUAI.h (100%) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index dcbd10075..b3e639917 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -1,5 +1,6 @@ -# Build full gtsam library as a single library -# and also build tests +# We split the library in to separate subfolders, each containing +# tests, timing, and an optional convenience library. +# The following variable is the master list of subdirs to add set (gtsam_subdirs base geometry @@ -26,12 +27,14 @@ if (GTSAM_BUILD_CONVENIENCE_LIBRARIES) add_library(ccolamd STATIC ${3rdparty_srcs}) endif() +# To exclude a source from the library build (in any subfolder) +# Add the full name to this list, as in the following example # Sources to remove from builds -set (excluded_sources - "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactor.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactorGraph.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/discrete/parseUAI.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/discrete/PotentialTable.cpp") +set (excluded_sources "") +# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactor.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/TypedDiscreteFactorGraph.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/parseUAI.cpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/discrete/PotentialTable.cpp") if(GTSAM_USE_QUATERNIONS) set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3M.cpp") @@ -55,7 +58,8 @@ foreach(subdir ${gtsam_subdirs}) add_subdirectory(${subdir}) endforeach(subdir) -# assemble gtsam components +# To add additional sources to gtsam when building the full library (static or shared) +# Add the subfolder with _srcs appended to the end to this list set(gtsam_srcs ${3rdparty_srcs} ${base_srcs} diff --git a/gtsam/discrete/CMakeLists.txt b/gtsam/discrete/CMakeLists.txt index 243359855..788949b0b 100644 --- a/gtsam/discrete/CMakeLists.txt +++ b/gtsam/discrete/CMakeLists.txt @@ -13,10 +13,10 @@ set (discrete_local_libs ) # Exclude tests that don't work -set (discrete_excluded_tests -"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactor.cpp" -"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactorGraph.cpp" -"${CMAKE_CURRENT_SOURCE_DIR}/tests/testPotentialTable.cpp") +set (discrete_excluded_tests "") +#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactor.cpp" +#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactorGraph.cpp" +#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testPotentialTable.cpp") # Add all tests if (GTSAM_BUILD_TESTS) diff --git a/gtsam/discrete/parseUAI.cpp b/gtsam/unstable/discrete/parseUAI.cpp similarity index 100% rename from gtsam/discrete/parseUAI.cpp rename to gtsam/unstable/discrete/parseUAI.cpp diff --git a/gtsam/discrete/parseUAI.h b/gtsam/unstable/discrete/parseUAI.h similarity index 100% rename from gtsam/discrete/parseUAI.h rename to gtsam/unstable/discrete/parseUAI.h From 146a1adf5364e0eafb125e4d2c4ecd5e466c5f94 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 15 May 2012 05:12:13 +0000 Subject: [PATCH 08/12] Distribution tarball does not contain gtsam_unstable and cmake options related to gtsam_unstable are not available/visible in CMake in tarball builds. --- CMakeLists.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f907e14..22713c6a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,13 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ") endif() +# See whether gtsam_unstable is available (it will be present only if we're using an SVN checkout) +if(EXISTS "${PROJECT_SOURCE_DIR}/gtsam_unstable" AND IS_DIRECTORY "${PROJECT_SOURCE_DIR}/gtsam_unstable") + set(GTSAM_UNSTABLE_AVAILABLE 1) +else() + set(GTSAM_UNSTABLE_AVAILABLE 0) +endif() + # Load build type flags and default to Debug mode include(GtsamBuildTypes) @@ -41,7 +48,9 @@ endif() option(GTSAM_BUILD_TESTS "Enable/Disable building of tests" ON) option(GTSAM_BUILD_TIMING "Enable/Disable building of timing scripts" ON) option(GTSAM_BUILD_EXAMPLES "Enable/Disable building of examples" ON) -option(GTSAM_BUILD_UNSTABLE "Enable/Disable libgtsam_unstable" OFF) +if(GTSAM_UNSTABLE_AVAILABLE) + option(GTSAM_BUILD_UNSTABLE "Enable/Disable libgtsam_unstable" OFF) +endif() option(GTSAM_BUILD_WRAP "Enable/Disable building of matlab wrap utility (necessary for matlab interface)" ON) option(GTSAM_BUILD_SHARED_LIBRARY "Enable/Disable building of a shared version of gtsam" ON) option(GTSAM_BUILD_STATIC_LIBRARY "Enable/Disable building of a static version of gtsam" ON) @@ -130,7 +139,7 @@ set(CPACK_PACKAGE_VERSION_MINOR ${GTSAM_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${GTSAM_VERSION_PATCH}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") set(CPACK_INSTALLED_DIRECTORIES "doc;.") # Include doc directory -set(CPACK_SOURCE_IGNORE_FILES "/build;/\\\\.;/makedoc.sh$") +set(CPACK_SOURCE_IGNORE_FILES "/build;/\\\\.;/makedoc.sh$;/gtsam_unstable/") set(CPACK_SOURCE_PACKAGE_FILE_NAME "gtsam-${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}") #set(CPACK_SOURCE_PACKAGE_FILE_NAME "gtsam-aspn${GTSAM_VERSION_PATCH}") # Used for creating ASPN tarballs @@ -149,7 +158,9 @@ print_config_flag(${GTSAM_BUILD_WRAP} "Build Wrap print_config_flag(${GTSAM_BUILD_SHARED_LIBRARY} "Build shared GTSAM Library ") print_config_flag(${GTSAM_BUILD_STATIC_LIBRARY} "Build static GTSAM Library ") print_config_flag(${GTSAM_BUILD_CONVENIENCE_LIBRARIES} "Build Convenience Libraries ") -print_config_flag(${GTSAM_BUILD_UNSTABLE} "Build libgtsam_unstable ") +if(GTSAM_UNSTABLE_AVAILABLE) + print_config_flag(${GTSAM_BUILD_UNSTABLE} "Build libgtsam_unstable ") +endif() print_config_flag(${GTSAM_ENABLE_INSTALL_TEST_FIX} "Tests excluded from all target ") string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) message(STATUS " Build type : ${CMAKE_BUILD_TYPE}") From fac7d8f4fbc21fc77b5bd9e84c9276c0cadcd37b Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 15 May 2012 05:12:21 +0000 Subject: [PATCH 09/12] Set version number in CMakeLists.txt to 2.0.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22713c6a4..e6c9bc422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ project(GTSAM CXX C) cmake_minimum_required(VERSION 2.6) # Set the version number for the library -set (GTSAM_VERSION_MAJOR 1) -set (GTSAM_VERSION_MINOR 9) +set (GTSAM_VERSION_MAJOR 2) +set (GTSAM_VERSION_MINOR 0) set (GTSAM_VERSION_PATCH 0) # Set the default install path to home From 5d5bb0e1a8c03866ab0d2109c5f5ee61d580d639 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 09:22:55 +0000 Subject: [PATCH 10/12] Fixed headers, both license and doxygen --- gtsam/discrete/AlgebraicDecisionTree.h | 13 +++++++++++- gtsam/discrete/Assignment.h | 13 +++++++++++- gtsam/discrete/CMakeLists.txt | 3 --- gtsam/discrete/DecisionTree-inl.h | 13 +++++++++++- gtsam/discrete/DecisionTree.h | 13 +++++++++++- gtsam/discrete/DecisionTreeFactor.cpp | 17 +++++++++++++--- gtsam/discrete/DecisionTreeFactor.h | 21 +++++++++++++++----- gtsam/discrete/DiscreteBayesNet.cpp | 22 +++++++++++++++------ gtsam/discrete/DiscreteBayesNet.h | 20 ++++++++++++++----- gtsam/discrete/DiscreteConditional.cpp | 16 ++++++++++++--- gtsam/discrete/DiscreteConditional.h | 16 ++++++++++++--- gtsam/discrete/DiscreteFactor.cpp | 17 +++++++++++++--- gtsam/discrete/DiscreteFactor.h | 17 +++++++++++++--- gtsam/discrete/DiscreteFactorGraph.cpp | 17 +++++++++++++--- gtsam/discrete/DiscreteFactorGraph.h | 21 +++++++++++++++----- gtsam/discrete/DiscreteKey.cpp | 15 ++++++++++++-- gtsam/discrete/DiscreteKey.h | 15 ++++++++++++-- gtsam/discrete/DiscreteSequentialSolver.cpp | 22 +++++++++++++++------ gtsam/discrete/DiscreteSequentialSolver.h | 21 +++++++++++++++----- gtsam/discrete/Potentials.cpp | 15 ++++++++++++-- gtsam/discrete/Potentials.h | 15 ++++++++++++-- gtsam/discrete/Signature.cpp | 19 ++++++++++++++---- gtsam/discrete/Signature.h | 19 ++++++++++++++---- 23 files changed, 307 insertions(+), 73 deletions(-) diff --git a/gtsam/discrete/AlgebraicDecisionTree.h b/gtsam/discrete/AlgebraicDecisionTree.h index 029223ef3..8afb2d617 100644 --- a/gtsam/discrete/AlgebraicDecisionTree.h +++ b/gtsam/discrete/AlgebraicDecisionTree.h @@ -1,4 +1,15 @@ -/* +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** * @file AlgebraicDecisionTree.h * @brief Algebraic Decision Trees * @author Frank Dellaert diff --git a/gtsam/discrete/Assignment.h b/gtsam/discrete/Assignment.h index 0150f6ff9..06e2ac137 100644 --- a/gtsam/discrete/Assignment.h +++ b/gtsam/discrete/Assignment.h @@ -1,4 +1,15 @@ -/* +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** * @file Assignment.h * @brief An assignment from labels to a discrete value index (size_t) * @author Frank Dellaert diff --git a/gtsam/discrete/CMakeLists.txt b/gtsam/discrete/CMakeLists.txt index 788949b0b..9e4647f80 100644 --- a/gtsam/discrete/CMakeLists.txt +++ b/gtsam/discrete/CMakeLists.txt @@ -14,9 +14,6 @@ set (discrete_local_libs # Exclude tests that don't work set (discrete_excluded_tests "") -#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactor.cpp" -#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testTypedDiscreteFactorGraph.cpp" -#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testPotentialTable.cpp") # Add all tests if (GTSAM_BUILD_TESTS) diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index 867a9c824..1fa750ace 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -1,4 +1,15 @@ -/* +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** * @file DecisionTree.h * @brief Decision Tree for use in DiscreteFactors * @author Frank Dellaert diff --git a/gtsam/discrete/DecisionTree.h b/gtsam/discrete/DecisionTree.h index 003656945..8fabd6e82 100644 --- a/gtsam/discrete/DecisionTree.h +++ b/gtsam/discrete/DecisionTree.h @@ -1,4 +1,15 @@ -/* +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** * @file DecisionTree.h * @brief Decision Tree for use in DiscreteFactors * @author Frank Dellaert diff --git a/gtsam/discrete/DecisionTreeFactor.cpp b/gtsam/discrete/DecisionTreeFactor.cpp index d66d16d99..23b761b3b 100644 --- a/gtsam/discrete/DecisionTreeFactor.cpp +++ b/gtsam/discrete/DecisionTreeFactor.cpp @@ -1,6 +1,17 @@ -/* - * DecisionTreeFactor.cpp - * @brief: discrete factor +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DecisionTreeFactor.cpp + * @brief discrete factor * @date Feb 14, 2011 * @author Duy-Nguyen Ta * @author Frank Dellaert diff --git a/gtsam/discrete/DecisionTreeFactor.h b/gtsam/discrete/DecisionTreeFactor.h index e98c7020b..cbc178925 100644 --- a/gtsam/discrete/DecisionTreeFactor.h +++ b/gtsam/discrete/DecisionTreeFactor.h @@ -1,8 +1,19 @@ -/* - * DecisionTreeFactor.h - * - * @date Feb 14, 2011 - * @author Duy-Nguyen Ta +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DecisionTreeFactor.h + * @date Feb 14, 2011 + * @author Duy-Nguyen Ta + * @author Frank Dellaert */ #pragma once diff --git a/gtsam/discrete/DiscreteBayesNet.cpp b/gtsam/discrete/DiscreteBayesNet.cpp index c7f09d3c2..67f4e4333 100644 --- a/gtsam/discrete/DiscreteBayesNet.cpp +++ b/gtsam/discrete/DiscreteBayesNet.cpp @@ -1,9 +1,19 @@ -/* - * DiscreteBayesNet.cpp - * - * @date Feb 15, 2011 - * @author Duy-Nguyen Ta - * @author Frank Dellaert +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteBayesNet.cpp + * @date Feb 15, 2011 + * @author Duy-Nguyen Ta + * @author Frank Dellaert */ #include diff --git a/gtsam/discrete/DiscreteBayesNet.h b/gtsam/discrete/DiscreteBayesNet.h index 418a7aa2d..a7c35e135 100644 --- a/gtsam/discrete/DiscreteBayesNet.h +++ b/gtsam/discrete/DiscreteBayesNet.h @@ -1,8 +1,18 @@ -/* - * DiscreteBayesNet.h - * - * @date Feb 15, 2011 - * @author Duy-Nguyen Ta +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteBayesNet.h + * @date Feb 15, 2011 + * @author Duy-Nguyen Ta */ #pragma once diff --git a/gtsam/discrete/DiscreteConditional.cpp b/gtsam/discrete/DiscreteConditional.cpp index 4791af6e8..73649dce6 100644 --- a/gtsam/discrete/DiscreteConditional.cpp +++ b/gtsam/discrete/DiscreteConditional.cpp @@ -1,6 +1,16 @@ -/* - * DiscreteConditional.cpp - * +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteConditional.cpp * @date Feb 14, 2011 * @author Duy-Nguyen Ta * @author Frank Dellaert diff --git a/gtsam/discrete/DiscreteConditional.h b/gtsam/discrete/DiscreteConditional.h index a11a6368f..f6603c195 100644 --- a/gtsam/discrete/DiscreteConditional.h +++ b/gtsam/discrete/DiscreteConditional.h @@ -1,6 +1,16 @@ -/* - * DiscreteConditional.h - * +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteConditional.h * @date Feb 14, 2011 * @author Duy-Nguyen Ta * @author Frank Dellaert diff --git a/gtsam/discrete/DiscreteFactor.cpp b/gtsam/discrete/DiscreteFactor.cpp index 6112cfea9..caec9788f 100644 --- a/gtsam/discrete/DiscreteFactor.cpp +++ b/gtsam/discrete/DiscreteFactor.cpp @@ -1,6 +1,17 @@ -/* - * DiscreteFactor.cpp - * @brief: discrete factor +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteFactor.cpp + * @brief discrete factor * @date Feb 14, 2011 * @author Duy-Nguyen Ta * @author Frank Dellaert diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index a66d5b522..12c20607b 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -1,8 +1,19 @@ -/* - * DiscreteFactor.h - * +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteFactor.h * @date Feb 14, 2011 * @author Duy-Nguyen Ta + * @author Frank Dellaert */ #pragma once diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index 479bcc45a..f5fc7533d 100644 --- a/gtsam/discrete/DiscreteFactorGraph.cpp +++ b/gtsam/discrete/DiscreteFactorGraph.cpp @@ -1,8 +1,19 @@ -/* - * DiscreteFactorGraph.cpp - * +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteFactorGraph.cpp * @date Feb 14, 2011 * @author Duy-Nguyen Ta + * @author Frank Dellaert */ //#define ENABLE_TIMING diff --git a/gtsam/discrete/DiscreteFactorGraph.h b/gtsam/discrete/DiscreteFactorGraph.h index 83a065361..eefdfaf1d 100644 --- a/gtsam/discrete/DiscreteFactorGraph.h +++ b/gtsam/discrete/DiscreteFactorGraph.h @@ -1,8 +1,19 @@ -/* - * DiscreteFactorGraph.h - * - * @date Feb 14, 2011 - * @author Duy-Nguyen Ta +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteFactorGraph.h + * @date Feb 14, 2011 + * @author Duy-Nguyen Ta + * @author Frank Dellaert */ #pragma once diff --git a/gtsam/discrete/DiscreteKey.cpp b/gtsam/discrete/DiscreteKey.cpp index 01b025d80..9db8bee79 100644 --- a/gtsam/discrete/DiscreteKey.cpp +++ b/gtsam/discrete/DiscreteKey.cpp @@ -1,5 +1,16 @@ -/* - * DiscreteKey.h +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteKey.h * @brief specialized key for discrete variables * @author Frank Dellaert * @date Feb 28, 2011 diff --git a/gtsam/discrete/DiscreteKey.h b/gtsam/discrete/DiscreteKey.h index 87e6e96a6..488240286 100644 --- a/gtsam/discrete/DiscreteKey.h +++ b/gtsam/discrete/DiscreteKey.h @@ -1,5 +1,16 @@ -/* - * DiscreteKey.h +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteKey.h * @brief specialized key for discrete variables * @author Frank Dellaert * @date Feb 28, 2011 diff --git a/gtsam/discrete/DiscreteSequentialSolver.cpp b/gtsam/discrete/DiscreteSequentialSolver.cpp index b4d16a24f..1ca00875a 100644 --- a/gtsam/discrete/DiscreteSequentialSolver.cpp +++ b/gtsam/discrete/DiscreteSequentialSolver.cpp @@ -1,13 +1,23 @@ -/* - * DiscreteSequentialSolver.cpp - * - * @date Feb 16, 2011 - * @author Duy-Nguyen Ta +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteSequentialSolver.cpp + * @date Feb 16, 2011 + * @author Duy-Nguyen Ta + * @author Frank Dellaert */ //#define ENABLE_TIMING #include -#include #include #include diff --git a/gtsam/discrete/DiscreteSequentialSolver.h b/gtsam/discrete/DiscreteSequentialSolver.h index 60512b873..c453f5b96 100644 --- a/gtsam/discrete/DiscreteSequentialSolver.h +++ b/gtsam/discrete/DiscreteSequentialSolver.h @@ -1,8 +1,19 @@ -/* - * DiscreteSequentialSolver.h - * - * @date Feb 16, 2011 - * @author Duy-Nguyen Ta +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file DiscreteSequentialSolver.h + * @date Feb 16, 2011 + * @author Duy-Nguyen Ta + * @author Frank Dellaert */ #pragma once diff --git a/gtsam/discrete/Potentials.cpp b/gtsam/discrete/Potentials.cpp index 2684e6cce..ac6ecde10 100644 --- a/gtsam/discrete/Potentials.cpp +++ b/gtsam/discrete/Potentials.cpp @@ -1,5 +1,16 @@ -/* - * Potentials.cpp +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file Potentials.cpp * @date March 24, 2011 * @author Frank Dellaert */ diff --git a/gtsam/discrete/Potentials.h b/gtsam/discrete/Potentials.h index 9468745e1..8a8c2e3bc 100644 --- a/gtsam/discrete/Potentials.h +++ b/gtsam/discrete/Potentials.h @@ -1,5 +1,16 @@ -/* - * Potentials.h +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file Potentials.h * @date March 24, 2011 * @author Frank Dellaert */ diff --git a/gtsam/discrete/Signature.cpp b/gtsam/discrete/Signature.cpp index 4d808543a..ee7c1e59a 100644 --- a/gtsam/discrete/Signature.cpp +++ b/gtsam/discrete/Signature.cpp @@ -1,7 +1,18 @@ -/* - * Signature.cpp - * @brief: signatures for conditional densities - * @author: Frank dellaert +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file Signature.cpp + * @brief signatures for conditional densities + * @author Frank dellaert * @date Feb 27, 2011 */ diff --git a/gtsam/discrete/Signature.h b/gtsam/discrete/Signature.h index 84d34c1fa..873365c24 100644 --- a/gtsam/discrete/Signature.h +++ b/gtsam/discrete/Signature.h @@ -1,7 +1,18 @@ -/* - * Signature.h - * @brief: signatures for conditional densities - * @author: Frank dellaert +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file Signature.h + * @brief signatures for conditional densities + * @author Frank dellaert * @date Feb 27, 2011 */ From 44cf2478c0e9810610fb18d8029912d881673891 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 09:24:15 +0000 Subject: [PATCH 11/12] Moved unstable/obsolete code to unstable (should be in experimental?) --- gtsam/{discrete => unstable/base}/RefCounted.cpp | 0 gtsam/{discrete => unstable/base}/RefCounted.h | 0 gtsam/{ => unstable}/discrete/PotentialTable.cpp | 0 gtsam/{ => unstable}/discrete/PotentialTable.h | 0 gtsam/{ => unstable}/discrete/tests/testPotentialTable.cpp | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename gtsam/{discrete => unstable/base}/RefCounted.cpp (100%) rename gtsam/{discrete => unstable/base}/RefCounted.h (100%) rename gtsam/{ => unstable}/discrete/PotentialTable.cpp (100%) rename gtsam/{ => unstable}/discrete/PotentialTable.h (100%) rename gtsam/{ => unstable}/discrete/tests/testPotentialTable.cpp (100%) diff --git a/gtsam/discrete/RefCounted.cpp b/gtsam/unstable/base/RefCounted.cpp similarity index 100% rename from gtsam/discrete/RefCounted.cpp rename to gtsam/unstable/base/RefCounted.cpp diff --git a/gtsam/discrete/RefCounted.h b/gtsam/unstable/base/RefCounted.h similarity index 100% rename from gtsam/discrete/RefCounted.h rename to gtsam/unstable/base/RefCounted.h diff --git a/gtsam/discrete/PotentialTable.cpp b/gtsam/unstable/discrete/PotentialTable.cpp similarity index 100% rename from gtsam/discrete/PotentialTable.cpp rename to gtsam/unstable/discrete/PotentialTable.cpp diff --git a/gtsam/discrete/PotentialTable.h b/gtsam/unstable/discrete/PotentialTable.h similarity index 100% rename from gtsam/discrete/PotentialTable.h rename to gtsam/unstable/discrete/PotentialTable.h diff --git a/gtsam/discrete/tests/testPotentialTable.cpp b/gtsam/unstable/discrete/tests/testPotentialTable.cpp similarity index 100% rename from gtsam/discrete/tests/testPotentialTable.cpp rename to gtsam/unstable/discrete/tests/testPotentialTable.cpp From 913029cc93ace9c2f907d1a54ad094fe1f06e4c7 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 15 May 2012 09:51:26 +0000 Subject: [PATCH 12/12] Removed undue burden on DiscreteFactor by adding Constraint class --- gtsam/discrete/DecisionTreeFactor.h | 22 ------ gtsam/discrete/DiscreteFactor.h | 14 ---- gtsam_unstable/discrete/AllDiff.cpp | 6 +- gtsam_unstable/discrete/AllDiff.h | 6 +- gtsam_unstable/discrete/BinaryAllDiff.h | 10 +-- gtsam_unstable/discrete/CMakeLists.txt | 2 +- gtsam_unstable/discrete/CSP.cpp | 6 +- gtsam_unstable/discrete/CSP.h | 29 +++++++- gtsam_unstable/discrete/Constraint.h | 91 +++++++++++++++++++++++++ gtsam_unstable/discrete/Domain.cpp | 4 +- gtsam_unstable/discrete/Domain.h | 14 ++-- gtsam_unstable/discrete/Scheduler.cpp | 27 +++++--- gtsam_unstable/discrete/SingleValue.cpp | 4 +- gtsam_unstable/discrete/SingleValue.h | 12 ++-- 14 files changed, 169 insertions(+), 78 deletions(-) create mode 100644 gtsam_unstable/discrete/Constraint.h diff --git a/gtsam/discrete/DecisionTreeFactor.h b/gtsam/discrete/DecisionTreeFactor.h index cbc178925..c63e59517 100644 --- a/gtsam/discrete/DecisionTreeFactor.h +++ b/gtsam/discrete/DecisionTreeFactor.h @@ -127,28 +127,6 @@ namespace gtsam { */ shared_ptr combine(size_t nrFrontals, ADT::Binary op) const; - /* - * Ensure Arc-consistency - * @param j domain to be checked - * @param domains all other domains - */ - /// - bool ensureArcConsistency(size_t j, std::vector& domains) const { -// throw std::runtime_error( -// "DecisionTreeFactor::ensureArcConsistency not implemented"); - return false; - } - - /// Partially apply known values - virtual DiscreteFactor::shared_ptr partiallyApply(const Values&) const { - throw std::runtime_error("DecisionTreeFactor::partiallyApply not implemented"); - } - - /// Partially apply known values, domain version - virtual DiscreteFactor::shared_ptr partiallyApply( - const std::vector&) const { - throw std::runtime_error("DecisionTreeFactor::partiallyApply not implemented"); - } /// @} }; // DecisionTreeFactor diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index 12c20607b..8152ff726 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -25,7 +25,6 @@ namespace gtsam { class DecisionTreeFactor; class DiscreteConditional; - class Domain; /** * Base class for discrete probabilistic factors @@ -99,19 +98,6 @@ namespace gtsam { virtual operator DecisionTreeFactor() const = 0; - /* - * Ensure Arc-consistency - * @param j domain to be checked - * @param domains all other domains - */ - virtual bool ensureArcConsistency(size_t j, std::vector& domains) const = 0; - - /// Partially apply known values - virtual shared_ptr partiallyApply(const Values&) const = 0; - - - /// Partially apply known values, domain version - virtual shared_ptr partiallyApply(const std::vector&) const = 0; /// @} }; // DiscreteFactor diff --git a/gtsam_unstable/discrete/AllDiff.cpp b/gtsam_unstable/discrete/AllDiff.cpp index 261787691..46efd4499 100644 --- a/gtsam_unstable/discrete/AllDiff.cpp +++ b/gtsam_unstable/discrete/AllDiff.cpp @@ -14,7 +14,7 @@ namespace gtsam { /* ************************************************************************* */ AllDiff::AllDiff(const DiscreteKeys& dkeys) : - DiscreteFactor(dkeys.indices()) { + Constraint(dkeys.indices()) { BOOST_FOREACH(const DiscreteKey& dkey, dkeys) cardinalities_.insert(dkey); } @@ -84,7 +84,7 @@ namespace gtsam { } /* ************************************************************************* */ - DiscreteFactor::shared_ptr AllDiff::partiallyApply(const Values& values) const { + Constraint::shared_ptr AllDiff::partiallyApply(const Values& values) const { DiscreteKeys newKeys; // loop over keys and add them only if they do not appear in values BOOST_FOREACH(Index k, keys_) @@ -95,7 +95,7 @@ namespace gtsam { } /* ************************************************************************* */ - DiscreteFactor::shared_ptr AllDiff::partiallyApply( + Constraint::shared_ptr AllDiff::partiallyApply( const std::vector& domains) const { DiscreteFactor::Values known; BOOST_FOREACH(Index k, keys_) { diff --git a/gtsam_unstable/discrete/AllDiff.h b/gtsam_unstable/discrete/AllDiff.h index b90a4b06e..4f4e10511 100644 --- a/gtsam_unstable/discrete/AllDiff.h +++ b/gtsam_unstable/discrete/AllDiff.h @@ -19,7 +19,7 @@ namespace gtsam { * for each variable we have a Index and an Index. In this factor, we * keep the Indices locally, and the Indices are stored in IndexFactor. */ - class AllDiff: public DiscreteFactor { + class AllDiff: public Constraint { std::map cardinalities_; @@ -55,10 +55,10 @@ namespace gtsam { bool ensureArcConsistency(size_t j, std::vector& domains) const; /// Partially apply known values - virtual DiscreteFactor::shared_ptr partiallyApply(const Values&) const; + virtual Constraint::shared_ptr partiallyApply(const Values&) const; /// Partially apply known values, domain version - virtual DiscreteFactor::shared_ptr partiallyApply(const std::vector&) const; + virtual Constraint::shared_ptr partiallyApply(const std::vector&) const; }; } // namespace gtsam diff --git a/gtsam_unstable/discrete/BinaryAllDiff.h b/gtsam_unstable/discrete/BinaryAllDiff.h index 31fe070c2..04eeba953 100644 --- a/gtsam_unstable/discrete/BinaryAllDiff.h +++ b/gtsam_unstable/discrete/BinaryAllDiff.h @@ -7,6 +7,8 @@ #pragma once +#include +#include #include namespace gtsam { @@ -18,7 +20,7 @@ namespace gtsam { * for each variable we have a Index and an Index. In this factor, we * keep the Indices locally, and the Indices are stored in IndexFactor. */ - class BinaryAllDiff: public DiscreteFactor { + class BinaryAllDiff: public Constraint { size_t cardinality0_, cardinality1_; /// cardinality @@ -26,7 +28,7 @@ namespace gtsam { /// Constructor BinaryAllDiff(const DiscreteKey& key1, const DiscreteKey& key2) : - DiscreteFactor(key1.first, key2.first), + Constraint(key1.first, key2.first), cardinality0_(key1.second), cardinality1_(key2.second) { } @@ -73,12 +75,12 @@ namespace gtsam { } /// Partially apply known values - virtual DiscreteFactor::shared_ptr partiallyApply(const Values&) const { + virtual Constraint::shared_ptr partiallyApply(const Values&) const { throw std::runtime_error("BinaryAllDiff::partiallyApply not implemented"); } /// Partially apply known values, domain version - virtual DiscreteFactor::shared_ptr partiallyApply( + virtual Constraint::shared_ptr partiallyApply( const std::vector&) const { throw std::runtime_error("BinaryAllDiff::partiallyApply not implemented"); } diff --git a/gtsam_unstable/discrete/CMakeLists.txt b/gtsam_unstable/discrete/CMakeLists.txt index b10503359..b049562a5 100644 --- a/gtsam_unstable/discrete/CMakeLists.txt +++ b/gtsam_unstable/discrete/CMakeLists.txt @@ -16,7 +16,7 @@ set (discrete_full_libs gtsam_unstable-static) # Exclude tests that don't work -set (discrete_excluded_tests "") +set (discrete_excluded_tests "${CMAKE_CURRENT_SOURCE_DIR}/tests/testScheduler.cpp") # Add all tests gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_full_libs}" "${discrete_excluded_tests}") diff --git a/gtsam_unstable/discrete/CSP.cpp b/gtsam_unstable/discrete/CSP.cpp index ebc56441c..4da2f440a 100644 --- a/gtsam_unstable/discrete/CSP.cpp +++ b/gtsam_unstable/discrete/CSP.cpp @@ -49,7 +49,7 @@ namespace gtsam { // if not already a singleton if (!domains[v].isSingleton()) { // get the constraint and call its ensureArcConsistency method - DiscreteFactor::shared_ptr factor = (*this)[f]; + Constraint::shared_ptr factor = (*this)[f]; changed[v] = factor->ensureArcConsistency(v,domains) || changed[v]; } } // f @@ -84,8 +84,8 @@ namespace gtsam { // TODO: create a new ordering as we go, to ensure a connected graph // KeyOrdering ordering; // vector dkeys; - BOOST_FOREACH(const DiscreteFactor::shared_ptr& factor, factors_) { - DiscreteFactor::shared_ptr reduced = factor->partiallyApply(domains); + BOOST_FOREACH(const Constraint::shared_ptr& factor, factors_) { + Constraint::shared_ptr reduced = factor->partiallyApply(domains); if (print) reduced->print(); } #endif diff --git a/gtsam_unstable/discrete/CSP.h b/gtsam_unstable/discrete/CSP.h index 517ee6796..e2e2a2251 100644 --- a/gtsam_unstable/discrete/CSP.h +++ b/gtsam_unstable/discrete/CSP.h @@ -18,13 +18,40 @@ namespace gtsam { * A specialization of a DiscreteFactorGraph. * It knows about CSP-specific constraints and algorithms */ - class CSP: public DiscreteFactorGraph { + class CSP: public FactorGraph { + public: + + /** A map from keys to values */ + typedef std::vector Indices; + typedef Assignment Values; + typedef boost::shared_ptr sharedValues; public: /// Constructor CSP() { } + template + void add(const DiscreteKey& j, SOURCE table) { + DiscreteKeys keys; + keys.push_back(j); + push_back(boost::make_shared(keys, table)); + } + + template + void add(const DiscreteKey& j1, const DiscreteKey& j2, SOURCE table) { + DiscreteKeys keys; + keys.push_back(j1); + keys.push_back(j2); + push_back(boost::make_shared(keys, table)); + } + + /** add shared discreteFactor immediately from arguments */ + template + void add(const DiscreteKeys& keys, SOURCE table) { + push_back(boost::make_shared(keys, table)); + } + /// Add a unary constraint, allowing only a single value void addSingleValue(const DiscreteKey& dkey, size_t value) { boost::shared_ptr factor(new SingleValue(dkey, value)); diff --git a/gtsam_unstable/discrete/Constraint.h b/gtsam_unstable/discrete/Constraint.h new file mode 100644 index 000000000..3b9cd8b8a --- /dev/null +++ b/gtsam_unstable/discrete/Constraint.h @@ -0,0 +1,91 @@ +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @file Constraint.h + * @date May 15, 2012 + * @author Frank Dellaert + */ + +#pragma once + +#include + +namespace gtsam { + + class Domain; + + /** + * Base class for discrete probabilistic factors + * The most general one is the derived DecisionTreeFactor + */ + class Constraint : public DiscreteFactor { + + public: + + typedef boost::shared_ptr shared_ptr; + + protected: + + /// Construct n-way factor + Constraint(const std::vector& js) : + DiscreteFactor(js) { + } + + /// Construct unary factor + Constraint(Index j) : + DiscreteFactor(j) { + } + + /// Construct binary factor + Constraint(Index j1, Index j2) : + DiscreteFactor(j1, j2) { + } + + /// construct from container + template + Constraint(KeyIterator beginKey, KeyIterator endKey) : + DiscreteFactor(beginKey, endKey) { + } + + public: + + /// @name Standard Constructors + /// @{ + + /// Default constructor for I/O + Constraint(); + + /// Virtual destructor + virtual ~Constraint() {} + + /// @} + /// @name Standard Interface + /// @{ + + /* + * Ensure Arc-consistency + * @param j domain to be checked + * @param domains all other domains + */ + virtual bool ensureArcConsistency(size_t j, std::vector& domains) const = 0; + + /// Partially apply known values + virtual shared_ptr partiallyApply(const Values&) const = 0; + + + /// Partially apply known values, domain version + virtual shared_ptr partiallyApply(const std::vector&) const = 0; + /// @} + }; +// DiscreteFactor + +}// namespace gtsam diff --git a/gtsam_unstable/discrete/Domain.cpp b/gtsam_unstable/discrete/Domain.cpp index c8dbdb4e7..fd2631cec 100644 --- a/gtsam_unstable/discrete/Domain.cpp +++ b/gtsam_unstable/discrete/Domain.cpp @@ -74,7 +74,7 @@ namespace gtsam { } /* ************************************************************************* */ - DiscreteFactor::shared_ptr Domain::partiallyApply( + Constraint::shared_ptr Domain::partiallyApply( const Values& values) const { Values::const_iterator it = values.find(keys_[0]); if (it != values.end() && !contains(it->second)) throw runtime_error( @@ -83,7 +83,7 @@ namespace gtsam { } /* ************************************************************************* */ - DiscreteFactor::shared_ptr Domain::partiallyApply( + Constraint::shared_ptr Domain::partiallyApply( const vector& domains) const { const Domain& Dk = domains[keys_[0]]; if (Dk.isSingleton() && !contains(*Dk.begin())) throw runtime_error( diff --git a/gtsam_unstable/discrete/Domain.h b/gtsam_unstable/discrete/Domain.h index 934f0c306..50c534f8a 100644 --- a/gtsam_unstable/discrete/Domain.h +++ b/gtsam_unstable/discrete/Domain.h @@ -7,15 +7,15 @@ #pragma once +#include #include -#include namespace gtsam { /** * Domain restriction constraint */ - class Domain: public DiscreteFactor { + class Domain: public Constraint { size_t cardinality_; /// Cardinality std::set values_; /// allowed values @@ -26,7 +26,7 @@ namespace gtsam { // Constructor on Discrete Key initializes an "all-allowed" domain Domain(const DiscreteKey& dkey) : - DiscreteFactor(dkey.first), cardinality_(dkey.second) { + Constraint(dkey.first), cardinality_(dkey.second) { for (size_t v = 0; v < cardinality_; v++) values_.insert(v); } @@ -34,13 +34,13 @@ namespace gtsam { // Constructor on Discrete Key with single allowed value // Consider SingleValue constraint Domain(const DiscreteKey& dkey, size_t v) : - DiscreteFactor(dkey.first), cardinality_(dkey.second) { + Constraint(dkey.first), cardinality_(dkey.second) { values_.insert(v); } /// Constructor Domain(const Domain& other) : - DiscreteFactor(other.keys_[0]), values_(other.values_) { + Constraint(other.keys_[0]), values_(other.values_) { } /// insert a value, non const :-( @@ -96,11 +96,11 @@ namespace gtsam { bool checkAllDiff(const std::vector keys, std::vector& domains); /// Partially apply known values - virtual DiscreteFactor::shared_ptr partiallyApply( + virtual Constraint::shared_ptr partiallyApply( const Values& values) const; /// Partially apply known values, domain version - virtual DiscreteFactor::shared_ptr partiallyApply( + virtual Constraint::shared_ptr partiallyApply( const std::vector& domains) const; }; diff --git a/gtsam_unstable/discrete/Scheduler.cpp b/gtsam_unstable/discrete/Scheduler.cpp index 6b4a19e76..678ba1580 100644 --- a/gtsam_unstable/discrete/Scheduler.cpp +++ b/gtsam_unstable/discrete/Scheduler.cpp @@ -105,6 +105,7 @@ namespace gtsam { /** Add student-specific constraints to the graph */ void Scheduler::addStudentSpecificConstraints(size_t i, boost::optional slot) { +#ifdef BROKEN bool debug = ISDEBUG("Scheduler::buildGraph"); assert(isecond != value_) throw runtime_error( "SingleValue::partiallyApply: unsatisfiable"); @@ -66,7 +66,7 @@ namespace gtsam { } /* ************************************************************************* */ - DiscreteFactor::shared_ptr SingleValue::partiallyApply( + Constraint::shared_ptr SingleValue::partiallyApply( const vector& domains) const { const Domain& Dk = domains[keys_[0]]; if (Dk.isSingleton() && !Dk.contains(value_)) throw runtime_error( diff --git a/gtsam_unstable/discrete/SingleValue.h b/gtsam_unstable/discrete/SingleValue.h index fc3d166fd..3f7f3011d 100644 --- a/gtsam_unstable/discrete/SingleValue.h +++ b/gtsam_unstable/discrete/SingleValue.h @@ -7,15 +7,15 @@ #pragma once +#include #include -#include namespace gtsam { /** * SingleValue constraint */ - class SingleValue: public DiscreteFactor { + class SingleValue: public Constraint { /// Number of values size_t cardinality_; @@ -33,12 +33,12 @@ namespace gtsam { /// Constructor SingleValue(Index key, size_t n, size_t value) : - DiscreteFactor(key), cardinality_(n), value_(value) { + Constraint(key), cardinality_(n), value_(value) { } /// Constructor SingleValue(const DiscreteKey& dkey, size_t value) : - DiscreteFactor(dkey.first), cardinality_(dkey.second), value_(value) { + Constraint(dkey.first), cardinality_(dkey.second), value_(value) { } // print @@ -61,11 +61,11 @@ namespace gtsam { bool ensureArcConsistency(size_t j, std::vector& domains) const; /// Partially apply known values - virtual DiscreteFactor::shared_ptr partiallyApply( + virtual Constraint::shared_ptr partiallyApply( const Values& values) const; /// Partially apply known values, domain version - virtual DiscreteFactor::shared_ptr partiallyApply( + virtual Constraint::shared_ptr partiallyApply( const std::vector& domains) const; };