Commit Graph

48 Commits (a647c84c1636fc7513cffab3fc60003839f0544e)

Author SHA1 Message Date
Kai Ni a647c84c16 added splitMinimumSpanningTree that uses DSF 2010-03-30 07:27:10 +00:00
Frank Dellaert 51281ea78f in-place colamd 2010-02-24 06:13:11 +00:00
Richard Roberts 4408eaf6f4 Added FactorGraph::checkGraphConsistency() to check for consistency between the variables->factors and factors->variables maps, and a unit test that tests the replace function including checking consistency. 2010-02-13 01:29:19 +00:00
Richard Roberts 5367e5a157 All std::map<Symbol,T> are now SymbolMap<T>, which is just a thin wrapper around std::map. at(Key) is used instead of first checking with find when an exception should be thrown for non-existent keys. This does not change any behavior or timing currently. This check-in also includes some functions in BayesTree for gathering clique statistics. 2010-01-22 04:41:40 +00:00
Richard Roberts aef0b42562 Refactoring to use a new Symbol key instead of strings in Bayes*, Gaussian*, Ordering, Symbolic*, VectorConfig. Renamed existing type-checking key Symbol<C,T> to TypedSymbol<C,T> 2010-01-17 19:34:57 +00:00
Chris Beall a956c1a8be svn restored from 1733.
this commit updates gtsam to version 1774, which now appears as 1734.
2010-01-16 01:16:59 +00:00
Kai Ni 1519d029dc use PredecessorMap instead of map<Key,Key> 2010-01-14 05:24:20 +00:00
Kai Ni 63440f937f almost fixed oredering except one function call 2010-01-14 02:07:14 +00:00
Kai Ni 3c66861790 fix the graph related functions in FactorGraph as well as its unit tests 2010-01-13 23:59:46 +00:00
Frank Dellaert 93465945e9 Large gtsam refactoring
To support faster development *and* better performance Richard and I pushed through a large refactoring of NonlinearFactors.

The following are the biggest changes:

1) NonLinearFactor1 and NonLinearFactor2 are now templated on Config, Key type, and X type, where X is the argument to the measurement function.

2) The measurement itself is no longer kept in the nonlinear factor. Instead, a derived class (see testVSLAMFactor, testNonlinearEquality, testPose3Factor etc...) has to implement a function to compute the errors, "evaluateErrors". Instead of (h(x)-z), it needs to return (z-h(x)), so Ax-b is an approximation of the error. IMPORTANT: evaluateErrors needs - if asked - *combine* the calculation of the function value h(x) and the derivatives dh(x)/dx. This was a major performance issue. To do this, boost::optional<Matrix&> arguments are provided, and tin EvaluateErrors you just  says something like

	if (H) *H = Matrix_(3,6,....);

3) We are no longer using int or strings for nonlinear factors. Instead, the preferred key type is now Symbol, defined in Key.h. This is both fast and cool: you can construct it from an int, and cast it to a strong. It also does type checking: a Symbol<Pose3,'x'> will not match a Symbol<Pose2,'x'>

4) minor: take a look at LieConfig.h: it help you avoid writing a lot of code bu automatically creating configs for a certain type. See e.g. Pose3Config.h. A "double" LieConfig is on the way - Thanks Richard and Manohar !
2010-01-13 22:25:03 +00:00
Kai Ni 4369cd2d92 1) add a compose function that compose all the poses in a factor graph given the spanning tree
2) add a new graph-inl.h which takes care of all the boost graph related functions to prevent the copy and paste across several classes
2010-01-12 16:12:25 +00:00
Kai Ni d4f92c7bb6 pass FactorGraph as reference into split 2010-01-08 20:27:10 +00:00
Kai Ni 06b7f8ee04 add split to FactorGraph 2010-01-08 19:07:46 +00:00
Kai Ni 6298a45050 use prim algorithm instead of kruskal for finding MST, which yields the parent map. 2010-01-07 06:25:54 +00:00
Kai Ni 9845a5ae37 add findMinimumSpanningTree to FactorGraph 2010-01-06 11:15:37 +00:00
Frank Dellaert d0b757da48 remove method to set factor to NULL 2009-12-20 21:21:01 +00:00
Richard Roberts ff817551de Added FactorGraph::replace(index, factor) to replace one factor with another (used in FrameSLAM). 2009-12-18 00:13:38 +00:00
Viorela Ila 8a9f05059c implement getOrdering_ to work in matlab 2009-12-11 22:53:48 +00:00
Richard Roberts 53af03368f Fixed indentation 2009-12-07 22:51:49 +00:00
Frank Dellaert 9bac438dbe Play nice with BOOST_FOREACH: non-const begin/end. Also removed buggy clear(). 2009-11-23 05:27:19 +00:00
Frank Dellaert d234365d53 involves is const 2009-11-20 14:17:52 +00:00
Frank Dellaert 55e85fd8a5 [involves] checks whether variable with that key is involved in any factor 2009-11-20 05:14:34 +00:00
Frank Dellaert b2eee54b5a push_back an entire factor graph 2009-11-19 06:34:07 +00:00
Frank Dellaert f677341108 Moved inference methods to new compilation unit. Added [factor], and [marginalize] now returns a factor graph. 2009-11-12 04:56:30 +00:00
Frank Dellaert 8d2d48d252 made removeAndCombineFactors a function, not a method 2009-11-11 05:12:45 +00:00
Frank Dellaert a3de1964d7 BIG CHANGE:
1) eliminate methods no longer return a shared pointer. Shared pointers are good for Factors and Conditionals (which are also non-copyable), because these are often passed around under the hood. However, a BayesNet is simple a list of shared pointers and hence does not cost a lot to return as an object (which is compiler-optimized anyway: there is no copy). So, the signature of all eliminate methods changed to simply return a BayesNet<> object (not a shared pointer).

2) GaussianBayesNet::optimize is now replaced by optimize(GaussianBayesNet) and returns a VectorConfig and not a shared pointer

3) GaussianBayesNet and SymbolicBayesNet are now simply typedefs, not derived classes. This is desirable because the BayesTree class uses templated methods that return BayesNet<Conditional>, not a specific BayesNet derived class.
2009-11-09 07:04:26 +00:00
Frank Dellaert 532be063f9 new templated function combine 2009-11-08 02:50:19 +00:00
Frank Dellaert cc5a2c3183 Renamed double-templated functions to _eliminate and _eliminateOne, and created FactorGraph-specific eliminateOne methods to make life easier 2009-11-07 21:03:30 +00:00
Frank Dellaert df3e5f2416 BIG: eliminate and eliminateOne now doubly templated functions, not methods.
Minor: Standardized on new shared_ptr naming convention:
shared_factor -> sharedFactor
conditional_ptr -> sharedConditional
node_ptr -> sharedClique
2009-11-07 19:31:39 +00:00
Frank Dellaert 7f516394df Added dummy argument to work around compile conundrum 2009-11-05 06:30:10 +00:00
Frank Dellaert 3d334401f5 Constructor from BayesNet now in FactorGraph base class
FactorGraph::eliminate
Removed eliminate_partially
2009-11-05 04:56:59 +00:00
Frank Dellaert a8d267c4ca Small change necessitating lots of edits: Conditionals now include key of random variable
This simplifies Bayes nets quite a bit. Also created a Conditional base class, derived classes ConditionalGaussian and SymbolicConditional
Finally, some changes were needed because I moved some headers to .cpp
2009-11-02 03:50:30 +00:00
Frank Dellaert 80b162a412 LinearFactorGraph::eliminate_one is now FactorGraph::eliminateOne<ConditionalGaussian>
Symbolic version FactorGraph::eliminateOne<SymbolicConditional> also implemented and tested
2009-10-29 14:34:34 +00:00
Frank Dellaert a513ae0287 Changed names and moved two LinearFactorGraph functions to FactorGraph
Added SymbolicFactorGraph compiulation unit and unit tests
Added symbolic combine constructor
2009-10-29 05:39:13 +00:00
Frank Dellaert f0c23a2828 Moved [factors] to FactorGraph 2009-10-29 04:49:13 +00:00
Frank Dellaert b6cee73571 Significant change: Made FactorGraph templated on Factor only, and moved error and probPrime to derived classes
Moved find_and_remove_factors to base class
Added and tested symbolic factor graph constructor and conversion from any factor graph type
2009-10-29 04:11:23 +00:00
Frank Dellaert 3b30fe50b0 Moved print and equals to -inl.h 2009-10-25 22:27:18 +00:00
Frank Dellaert 57bc102548 Equals now checks for NULLs 2009-10-25 14:25:17 +00:00
Frank Dellaert f54ba387fe FactorGraph, ChordalBayesNet, and ConditionalGaussian now Testable 2009-10-24 23:14:14 +00:00
Chris Beall baef89ccf0 updated find_factors_and_remove to use map of factor indices to gather factors connected to a variable. factors are set to null instead of being erased. also updated size() to count non-NULL factors, and print() to only print non-NULL factors. added new unit test which tries to remove the same variable twice. 2009-10-23 00:56:40 +00:00
Chris Beall 52bedcad3a order 1 factors by using map 2009-10-22 21:33:00 +00:00
Alex Cunningham 7d0a30c20f Renamed FGConfig to VectorConfig in gtsam, easylib, EasySLAM, and mast. 2009-10-14 20:39:59 +00:00
Frank Dellaert 989f290c99 '''BIG CHANGE''': avoid converting back and to FGConfigs by templating on configuration type. Details:
* Factors are now templated on the configuration type. Factor Graphs are now templated on the factor type and configuration type.
 * LinearFactor is a factor on an FGConfig.
 * LinearFactorGraph uses LinearFactor and FGConfig.
 * NonLinearFactor is still templated on Config.
 * NonLinearFactorGraph uses NonLinearFactors, but is still templated on Config.
 * Tests and VSLAMFactor have been updated to reflect those changes.
2009-10-06 18:25:04 +00:00
Frank Dellaert 68e20eec2c 2 BIG changes:
(1) FactorGraph and NonlinearOptimizer now no longer have a .cpp file, but a -inl.h file as in [http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml Google's C++ Style Guide]. This means if you expect to instantiate one of the functions in a cpp file, you have to include the -inl.h file.
(1) getOrdering is now in FactorGraph, and the non-linear version does *not* take a config anymore. 
Long version: I made this change because colamd works on the graph structure alone, and should not depend on the type of graph. Instead, because getOrdering happened to implemented in LinearFactorGraph first, the non-linear version converted to a linear factor graph (at the cost of an unnecessary linearization), and then threw all that away to call colamd. To implement this in a key-neutral way (a hidden agenda), i had to modify the keys_ type to a list, so a lot of changes resulted from that.
2009-09-13 04:13:03 +00:00
Frank Dellaert 92dbc8910e correct serialization of base classes
moved all serialize functions to bottom of class declaration
2009-08-31 04:13:57 +00:00
Frank Dellaert c69d8d9b36 Factor Graph serialization, and renaming of factors -> factors_ 2009-08-31 02:40:26 +00:00
Manohar Paluri 0b1b5eca67 Added const verifiers for member functions of the class which are compatible 2009-08-26 15:25:47 +00:00
Richard Roberts d80fa24a9f Fixing directory structure 2009-08-21 22:23:24 +00:00