Merge remote-tracking branch 'svn/trunk' into NLO

Conflicts:
	.cproject
release/4.3a0
Richard Roberts 2012-05-15 14:03:57 +00:00
commit cc9558aa12
66 changed files with 830 additions and 490 deletions

359
.cproject
View File

@ -21,7 +21,7 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.2031210194" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base.677243255" name="cdt.managedbuild.toolchain.gnu.macosx.base" superClass="cdt.managedbuild.toolchain.gnu.macosx.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.MachO64" id="cdt.managedbuild.target.gnu.platform.macosx.base.752782918" name="Debug Platform" osList="macosx" superClass="cdt.managedbuild.target.gnu.platform.macosx.base"/>
<builder arguments="" buildPath="${ProjDirPath}/build" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.319933862" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="8" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<builder arguments="" buildPath="${ProjDirPath}/build" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.319933862" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="5" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.base.457360678" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base.1011140787" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base">
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.1032375444" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">
@ -149,57 +149,6 @@
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1113830107">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1113830107" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="gtsam" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1113830107" name="Release" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.macosx.base.1359703544.1113830107." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base.112152768" name="cdt.managedbuild.toolchain.gnu.macosx.base" superClass="cdt.managedbuild.toolchain.gnu.macosx.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.MachO64" id="cdt.managedbuild.target.gnu.platform.macosx.base.520183569" name="Debug Platform" osList="macosx" superClass="cdt.managedbuild.target.gnu.platform.macosx.base"/>
<builder arguments="" buildPath="${ProjDirPath}/build-release" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.1584625067" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="8" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.base.1693289539" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base.445516979" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base">
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.520547179" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.macosx.base.2037529941" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1986939833" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.981720742" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base.164695058" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base">
<option id="gnu.cpp.compiler.option.include.paths.740748252" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/gtsam}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6.1"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/backward"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1418357370" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.base.257069922" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1085424637" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="gtsam.null.1344331286" name="gtsam"/>
@ -644,6 +593,38 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testBTree.run" path="build/gtsam_unstable/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testBTree.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testDSF.run" path="build/gtsam_unstable/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testDSF.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testDSFVector.run" path="build/gtsam_unstable/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testDSFVector.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testFixedVector.run" path="build/gtsam_unstable/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testFixedVector.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="release" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
@ -796,18 +777,58 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="nonlinear.testValues.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="testValues.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>nonlinear.testValues.run</buildTarget>
<buildTarget>testValues.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="nonlinear.testOrdering.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="testOrdering.run" path="build/gtsam/nonlinear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>nonlinear.testOrdering.run</buildTarget>
<buildTarget>testOrdering.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="schedulingExample.run" path="build/gtsam_unstable/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>schedulingExample.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testCSP.run" path="build/gtsam_unstable/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testCSP.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testScheduler.run" path="build/gtsam_unstable/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testScheduler.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="schedulingQuals12.run" path="build/gtsam_unstable/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>schedulingQuals12.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testSudoku.run" path="build/gtsam_unstable/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testSudoku.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
@ -844,26 +865,10 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="install" path="wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="testDiscreteFactor.run" path="build/gtsam/discrete" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="check" path="wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>check</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="wrap" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>clean</buildTarget>
<buildArguments>-j5</buildArguments>
<buildTarget>testDiscreteFactor.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
@ -1044,14 +1049,6 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="SimpleRotation.run" path="examples" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>SimpleRotation.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
@ -1657,82 +1654,82 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testVectorValues.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testVectorValues.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="linear.testNoiseModel.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="testVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>linear.testNoiseModel.run</buildTarget>
<buildTarget>testVector.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testGaussianFactor.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testGaussianFactor.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testHessianFactor.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testHessianFactor.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testGaussianConditional.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testGaussianConditional.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testGaussianFactorGraph.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testGaussianFactorGraph.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testGaussianJunctionTree.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testGaussianJunctionTree.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testKalmanFilter.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testKalmanFilter.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests/testGaussianDensity.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>tests/testGaussianDensity.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="linear.testSerializationLinear.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="testVectorValues.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>linear.testSerializationLinear.run</buildTarget>
<buildTarget>testVectorValues.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testNoiseModel.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testNoiseModel.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testHessianFactor.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testHessianFactor.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testGaussianConditional.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testGaussianConditional.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testGaussianFactorGraph.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testGaussianFactorGraph.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testGaussianJunctionTree.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testGaussianJunctionTree.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testKalmanFilter.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testKalmanFilter.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testGaussianDensity.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testGaussianDensity.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testSerializationLinear.run" path="build/gtsam/linear" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>testSerializationLinear.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
@ -1817,6 +1814,14 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="UGM_small.run" path="build/examples" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>UGM_small.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="check" path="build/slam" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
@ -2031,18 +2036,58 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testMarginals.run" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="wrap_gtsam" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8</buildArguments>
<buildTarget>testMarginals.run</buildTarget>
<buildArguments>-j5</buildArguments>
<buildTarget>wrap_gtsam</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testNonlinearOptimizer.run" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="verbose wrap_gtsam" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8</buildArguments>
<buildTarget>testNonlinearOptimizer.run</buildTarget>
<buildArguments>VERBOSE=1</buildArguments>
<buildTarget>wrap_gtsam</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Generate DEB Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cpack</buildCommand>
<buildArguments/>
<buildTarget>-G DEB</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Generate RPM Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cpack</buildCommand>
<buildArguments/>
<buildTarget>-G RPM</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Generate TGZ Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cpack</buildCommand>
<buildArguments/>
<buildTarget>-G TGZ</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Generate TGZ Source Package" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cpack</buildCommand>
<buildArguments/>
<buildTarget>--config CPackSourceConfig.cmake</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="check.discrete" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j5</buildArguments>
<buildTarget>check.discrete</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>

View File

@ -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

177
README
View File

@ -1,7 +1,18 @@
README - Georgia Tech Smoothing and Mapping library
---------------------------------------------------
What is GTSAM ?
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
mapping (SAM) in robotics and vision, using factor graphs and Bayes
@ -11,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
@ -24,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
@ -38,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
@ -65,44 +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)
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.
- 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
@ -110,47 +81,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
- CMake Configuration 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 ..
ccmake the curses GUI for cmake
cmake-gui a real GUI for 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.
Important Options:
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.
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
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.
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_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.
@ -176,35 +133,25 @@ $] 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".
"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".
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.
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.

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -13,24 +13,13 @@ 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 "")
# Add all tests
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}")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -116,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<Domain>& 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<Domain>&) const {
throw std::runtime_error("DecisionTreeFactor::partiallyApply not implemented");
}
/// @}
};
// DecisionTreeFactor

View File

@ -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 <gtsam/discrete/DiscreteBayesNet.h>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -14,7 +25,6 @@ namespace gtsam {
class DecisionTreeFactor;
class DiscreteConditional;
class Domain;
/**
* Base class for discrete probabilistic factors
@ -88,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<Domain>& 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<Domain>&) const = 0;
/// @}
};
// DiscreteFactor

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <gtsam/discrete/DiscreteSequentialSolver.h>
#include <gtsam/discrete/PotentialTable.h>
#include <gtsam/inference/GenericSequentialSolver-inl.h>
#include <gtsam/base/timing.h>

View File

@ -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

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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
*/

View File

@ -5,10 +5,10 @@
* @date Mar 5, 2011
*/
#include <boost/make_shared.hpp>
#include <gtsam/discrete/TypedDiscreteFactor.h>
#include <gtsam_unstable/discrete/TypedDiscreteFactor.h>
#include <gtsam/discrete/DecisionTree.h>
#include <gtsam/inference/Factor-inl.h>
#include <gtsam/discrete/DecisionDiagram-inl.h>
#include <boost/make_shared.hpp>
using namespace std;

View File

@ -7,10 +7,10 @@
#pragma once
#include <map>
#include <gtsam/inference/Factor.h>
#include <gtsam/discrete/DiscreteFactor.h>
#include <gtsam/discrete/AlgebraicDecisionDiagram.h>
#include <gtsam/discrete/AlgebraicDecisionTree.h>
#include <gtsam/inference/Factor.h>
#include <map>
namespace gtsam {

View File

@ -5,16 +5,15 @@
* @date Mar 1, 2011
*/
#include <gtsam_unstable/discrete/TypedDiscreteFactorGraph.h>
#include <gtsam/discrete/parseUAI.h>
#include <gtsam/discrete/DiscreteFactor.h>
#include <gtsam/inference/FactorGraph.h>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <gtsam/discrete/DiscreteFactor.h>
#include <gtsam/discrete/TypedDiscreteFactorGraph.h>
#include <gtsam/discrete/parseUAI.h>
#include <gtsam/inference/FactorGraph.h>
using namespace std;

View File

@ -8,10 +8,10 @@
#pragma once
#include <gtsam_unstable/discrete/TypedDiscreteFactor.h>
#include <gtsam/inference/FactorGraph.h>
#include <vector>
#include <set>
#include <gtsam/inference/FactorGraph.h>
#include <gtsam/discrete/TypedDiscreteFactor.h>
namespace gtsam {

View File

@ -5,13 +5,12 @@
* @date Mar 5, 2011
*/
#include <gtsam_unstable/discrete/TypedDiscreteFactor.h>
#include <gtsam/base/Testable.h>
#include <CppUnitLite/TestHarness.h>
#include <boost/assign/std/vector.hpp>
using namespace boost::assign;
#include <CppUnitLite/TestHarness.h>
#include <gtsam/base/Testable.h>
#include <gtsam/discrete/TypedDiscreteFactor.h>
using namespace std;
using namespace gtsam;

View File

@ -6,16 +6,9 @@
* @date Feb 14, 2011
*/
//#include <map>
//#include <fstream>
#include <boost/foreach.hpp>
#include <gtsam_unstable/discrete/TypedDiscreteFactorGraph.h>
#include <CppUnitLite/TestHarness.h>
//#include <gtsam/inference/JunctionTree.h>
//#include <gtsam/inference/JunctionTree-inl.h>
#include <gtsam/discrete/TypedDiscreteFactorGraph.h>
//#include <gtsam/discrete/DiscreteSequentialSolver.h>
#include <boost/foreach.hpp>
using namespace std;
using namespace gtsam;

View File

@ -2,6 +2,7 @@
# and also build tests
set (gtsam_unstable_subdirs
base
discrete
dynamics
slam
)

View File

@ -5,8 +5,8 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/Domain.h>
#include <gtsam/discrete/AllDiff.h>
#include <gtsam_unstable/discrete/Domain.h>
#include <gtsam_unstable/discrete/AllDiff.h>
#include <gtsam/base/Testable.h>
#include <boost/make_shared.hpp>
@ -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<Domain>& domains) const {
DiscreteFactor::Values known;
BOOST_FOREACH(Index k, keys_) {

View File

@ -7,8 +7,8 @@
#pragma once
#include <gtsam_unstable/discrete/BinaryAllDiff.h>
#include <gtsam/discrete/DiscreteKey.h>
#include <gtsam/discrete/BinaryAllDiff.h>
namespace gtsam {
@ -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<Index,size_t> cardinalities_;
@ -55,10 +55,10 @@ namespace gtsam {
bool ensureArcConsistency(size_t j, std::vector<Domain>& 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<Domain>&) const;
virtual Constraint::shared_ptr partiallyApply(const std::vector<Domain>&) const;
};
} // namespace gtsam

View File

@ -7,6 +7,8 @@
#pragma once
#include <gtsam_unstable/discrete/Domain.h>
#include <gtsam_unstable/discrete/Constraint.h>
#include <gtsam/discrete/DecisionTreeFactor.h>
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<Domain>&) const {
throw std::runtime_error("BinaryAllDiff::partiallyApply not implemented");
}

View File

@ -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 "${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}")
# add examples
foreach(example schedulingExample schedulingQuals12)
add_executable(${example} "examples/${example}.cpp")
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)

View File

@ -5,8 +5,8 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/Domain.h>
#include <gtsam/discrete/CSP.h>
#include <gtsam_unstable/discrete/Domain.h>
#include <gtsam_unstable/discrete/CSP.h>
#include <gtsam/discrete/DiscreteSequentialSolver.h>
#include <gtsam/base/Testable.h>
#include <boost/foreach.hpp>
@ -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<Index> 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

View File

@ -7,8 +7,8 @@
#pragma once
#include <gtsam/discrete/AllDiff.h>
#include <gtsam/discrete/SingleValue.h>
#include <gtsam_unstable/discrete/AllDiff.h>
#include <gtsam_unstable/discrete/SingleValue.h>
#include <gtsam/discrete/DiscreteFactorGraph.h>
namespace gtsam {
@ -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<Constraint> {
public:
/** A map from keys to values */
typedef std::vector<Index> Indices;
typedef Assignment<Index> Values;
typedef boost::shared_ptr<Values> sharedValues;
public:
/// Constructor
CSP() {
}
template<class SOURCE>
void add(const DiscreteKey& j, SOURCE table) {
DiscreteKeys keys;
keys.push_back(j);
push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
}
template<class SOURCE>
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<DecisionTreeFactor>(keys, table));
}
/** add shared discreteFactor immediately from arguments */
template<class SOURCE>
void add(const DiscreteKeys& keys, SOURCE table) {
push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
}
/// Add a unary constraint, allowing only a single value
void addSingleValue(const DiscreteKey& dkey, size_t value) {
boost::shared_ptr<SingleValue> factor(new SingleValue(dkey, value));

View File

@ -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 <gtsam/discrete/DiscreteFactor.h>
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<Constraint> shared_ptr;
protected:
/// Construct n-way factor
Constraint(const std::vector<Index>& 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<class KeyIterator>
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<Domain>& 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<Domain>&) const = 0;
/// @}
};
// DiscreteFactor
}// namespace gtsam

View File

@ -5,7 +5,7 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/Domain.h>
#include <gtsam_unstable/discrete/Domain.h>
#include <gtsam/discrete/DecisionTreeFactor.h>
#include <gtsam/base/Testable.h>
#include <boost/make_shared.hpp>
@ -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<Domain>& domains) const {
const Domain& Dk = domains[keys_[0]];
if (Dk.isSingleton() && !contains(*Dk.begin())) throw runtime_error(

View File

@ -7,15 +7,15 @@
#pragma once
#include <gtsam_unstable/discrete/Constraint.h>
#include <gtsam/discrete/DiscreteKey.h>
#include <gtsam/discrete/DiscreteFactor.h>
namespace gtsam {
/**
* Domain restriction constraint
*/
class Domain: public DiscreteFactor {
class Domain: public Constraint {
size_t cardinality_; /// Cardinality
std::set<size_t> 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<Index> keys, std::vector<Domain>& 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<Domain>& domains) const;
};

View File

@ -5,7 +5,7 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/Scheduler.h>
#include <gtsam_unstable/discrete/Scheduler.h>
#include <gtsam/discrete/DiscreteFactorGraph.h>
#include <gtsam/discrete/DiscreteSequentialSolver.h>
#include <gtsam/base/debug.h>
@ -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
@ -101,6 +105,7 @@ namespace gtsam {
/** Add student-specific constraints to the graph */
void Scheduler::addStudentSpecificConstraints(size_t i, boost::optional<size_t> slot) {
#ifdef BROKEN
bool debug = ISDEBUG("Scheduler::buildGraph");
assert(i<nrStudents());
@ -108,7 +113,7 @@ namespace gtsam {
if (!slot && !slotsAvailable_.empty()) {
if (debug) cout << "Adding availability of slots" << endl;
DiscreteFactorGraph::add(s.key_, slotsAvailable_);
CSP::add(s.key_, slotsAvailable_);
}
// For all areas
@ -118,10 +123,10 @@ namespace gtsam {
const string& areaName = s.areaName_[area];
if (debug) cout << "Area constraints " << areaName << endl;
DiscreteFactorGraph::add(areaKey, facultyInArea_[areaName]);
CSP::add(areaKey, facultyInArea_[areaName]);
if (debug) cout << "Advisor constraint " << areaName << endl;
DiscreteFactorGraph::add(areaKey, s.advisor_);
CSP::add(areaKey, s.advisor_);
if (debug) cout << "Availability of faculty " << areaName << endl;
if (slot) {
@ -129,22 +134,25 @@ namespace gtsam {
DiscreteKey dummy(0, nrTimeSlots());
Potentials::ADT p(dummy & areaKey, available_);
Potentials::ADT q = p.choose(0, *slot);
DecisionTreeFactor::shared_ptr f(new DecisionTreeFactor(areaKey, q));
DiscreteFactorGraph::push_back(f);
Constraint::shared_ptr f(new DecisionTreeFactor(areaKey, q));
CSP::push_back(f);
} else {
DiscreteFactorGraph::add(s.key_, areaKey, available_);
CSP::add(s.key_, areaKey, available_);
}
}
// add mutex
if (debug) cout << "Mutex for faculty" << endl;
addAllDiff(s.keys_[0] & s.keys_[1] & s.keys_[2]);
} // students loop
#else
throw runtime_error("addStudentSpecificConstraints is broken");
#endif
}
/** Main routine that builds factor graph */
void Scheduler::buildGraph(size_t mutexBound) {
#ifdef BROKEN
bool debug = ISDEBUG("Scheduler::buildGraph");
if (debug) cout << "Adding student-specific constraints" << endl;
@ -152,7 +160,7 @@ namespace gtsam {
addStudentSpecificConstraints(i);
// special constraint for MN
if (studentName(0) == "Michael N") DiscreteFactorGraph::add(studentKey(0),
if (studentName(0) == "Michael N") CSP::add(studentKey(0),
"0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1");
if (!mutexBound) {
@ -170,6 +178,9 @@ namespace gtsam {
}
}
}
#else
throw runtime_error("buildGraph is broken");
#endif
} // buildGraph
@ -204,7 +215,7 @@ namespace gtsam {
student.print();
cout << endl;
DiscreteFactorGraph::print(s + " Factor graph");
CSP::print(s + " Factor graph");
cout << endl;
} // print

View File

@ -7,7 +7,7 @@
#pragma once
#include <gtsam/discrete/CSP.h>
#include <gtsam_unstable/discrete/CSP.h>
namespace gtsam {

View File

@ -5,8 +5,8 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/SingleValue.h>
#include <gtsam/discrete/Domain.h>
#include <gtsam_unstable/discrete/SingleValue.h>
#include <gtsam_unstable/discrete/Domain.h>
#include <gtsam/discrete/DecisionTreeFactor.h>
#include <gtsam/base/Testable.h>
#include <boost/make_shared.hpp>
@ -58,7 +58,7 @@ namespace gtsam {
}
/* ************************************************************************* */
DiscreteFactor::shared_ptr SingleValue::partiallyApply(const Values& values) const {
Constraint::shared_ptr SingleValue::partiallyApply(const Values& values) const {
Values::const_iterator it = values.find(keys_[0]);
if (it != values.end() && it->second != 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<Domain>& domains) const {
const Domain& Dk = domains[keys_[0]];
if (Dk.isSingleton() && !Dk.contains(value_)) throw runtime_error(

View File

@ -7,15 +7,15 @@
#pragma once
#include <gtsam_unstable/discrete/Constraint.h>
#include <gtsam/discrete/DiscreteKey.h>
#include <gtsam/discrete/DiscreteFactor.h>
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<Domain>& 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<Domain>& domains) const;
};

View File

@ -8,7 +8,7 @@
//#define ENABLE_TIMING
#define ADD_NO_CACHING
#define ADD_NO_PRUNING
#include <gtsam/discrete/Scheduler.h>
#include <gtsam_unstable/discrete/Scheduler.h>
#include <gtsam/base/debug.h>
#include <gtsam/base/timing.h>
@ -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");

View File

@ -8,7 +8,7 @@
#define ENABLE_TIMING
#define ADD_NO_CACHING
#define ADD_NO_PRUNING
#include <gtsam/discrete/Scheduler.h>
#include <gtsam_unstable/discrete/Scheduler.h>
#include <gtsam/base/debug.h>
#include <gtsam/base/timing.h>
@ -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");

View File

@ -5,8 +5,8 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/CSP.h>
#include <gtsam/discrete/Domain.h>
#include <gtsam_unstable/discrete/CSP.h>
#include <gtsam_unstable/discrete/Domain.h>
#include <CppUnitLite/TestHarness.h>
#include <iostream>
#include <fstream>

View File

@ -5,7 +5,7 @@
*/
//#define ENABLE_TIMING
#include <gtsam/discrete/Scheduler.h>
#include <gtsam_unstable/discrete/Scheduler.h>
#include <gtsam/base/Testable.h>
#include <gtsam/base/timing.h>
@ -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

View File

@ -5,7 +5,7 @@
* @author Frank Dellaert
*/
#include <gtsam/discrete/CSP.h>
#include <gtsam_unstable/discrete/CSP.h>
#include <CppUnitLite/TestHarness.h>
#include <iostream>
#include <sstream>