Commit Graph

140 Commits (fbe9aac41cbd39d83c27275a1c0bb12ce21db42b)

Author SHA1 Message Date
Abe fbe9aac41c squash local changes on top of gtsam upstream pull from 6/14/2016 2016-06-18 23:13:59 -07:00
yao a0661b3813 Almost done. Still need to figure out how to remove the remaining 3 occurrences. 2016-05-21 12:44:46 -04:00
Alex Hagiopol 76308a5d46 Deprecated Vector zero(size_t n). All unit tests pass. 2016-04-15 16:54:46 -04:00
Alex Hagiopol 70b2aab352 Deprecated all inline functions in Matrix.h. 2016-04-11 15:11:29 -04:00
Frank 0372a959ee Many small improvements, bug-fixes, and tests 2016-02-24 11:01:19 -08:00
Chris Beall cc0b7cfdc1 convert tabs to spaces. See https://bitbucket.org/gtborg/gtsam/wiki/C++%20Coding%20Conventions 2016-02-09 20:00:38 -05:00
lvzhaoyang 0b2d4f1182 feature: change rowPrefix to an indent. Now all columns are aligned 2015-10-22 15:04:53 -04:00
Chris Beall 1d44761e3c Merged develop into feature/MatrixPrinting 2015-10-16 10:41:25 -04:00
dellaert 82f6ca64a5 Merge remote-tracking branch 'origin/develop' into fix/zeroRowInQR 2015-06-15 01:09:19 -07:00
Frank Dellaert b68f763fe7 Merged in feature/LinearSolverCleanup (pull request #148)
This has
- Separate Scatter class
- change from updateATA to updateHessian as a virtual method
- Fixed-size BinaryJacobianFactor that overloads updateHessian
- SFM Timing Script that takes BAL files
2015-06-15 01:08:02 -07:00
dellaert f523db2d98 IMPORTANT CHANGE/BUGFIX: QR elimination now (I think properly) leaves a row of zeros if the RHS after QR contains a non-zero. A corresponding change in the error calculation makes that Jacobian and Hessian factors now agree on error. I think this was a bug, because it affected the error, but (I think) it only pertained to "empty" JacobianFactors which have no bearing on optimization/elimination. 2015-06-15 00:55:53 -07:00
dellaert 5771664622 Starting to diagnose issue with lower-left entry of Hessian 2015-06-14 16:01:54 -07:00
Frank Dellaert d0775faeba Save slots to bring cost down from O(n^3) to O(n^2) - again, in theory. In practice, it did seem to help for larger HessianFactors (as expected). 2015-06-13 12:26:10 -07:00
Frank Dellaert f6575323d6 Sidestep Scatter altogether and just use HessianFactor keys_. In theory, n^3 lookup cost, but in practice (as keys is contiguous memory) just as fast as map. 2015-06-13 12:06:13 -07:00
Frank Dellaert c8cff296fb Don't bother making an array 2015-06-13 09:01:13 -07:00
Frank Dellaert 6664699c4c getSlots method 2015-06-12 09:33:55 -07:00
Frank Dellaert b712a65c21 Updated gttic strings as well 2015-06-12 00:28:15 -07:00
Frank Dellaert 41a0146b05 changed updateATA -> updateHessian. Much clearer 2015-06-12 00:20:37 -07:00
Frank Dellaert 257060e8dd Scatter class in separate compilation unit 2015-06-11 21:21:01 -07:00
Frank Dellaert 39ffe3ac32 Made updateATA a virtual method for a small saving in CPU, but more importantly to allow for custom Jacobian or HessianFactors... 2015-06-10 15:53:43 -04:00
Frank Dellaert c75a76c705 Moved raw access method (possibly to be removed!) to base class as does not assume regular... 2015-06-08 20:30:55 -04:00
Abe 13a4da21b2 misc bugfixes and cleanup from skydio 2015-05-13 22:26:24 -07:00
dellaert 445b5834dc Use Eigen::format, now compatible with matlab, and stream precision affects printing. 2015-02-17 00:39:03 +01:00
Sungtae An e13243b140 Merge branch 'develop' into feature/RegularFactors
Conflicts:
	gtsam/linear/GaussianFactorGraph.cpp
	gtsam/linear/JacobianFactor.cpp
	gtsam/linear/JacobianFactor.h
	tests/testPreconditioner.cpp
2015-01-01 17:50:27 -05:00
thduynguyen 2673e1664c reapply a bug fix in isConstrained when no model exists 2014-12-13 01:05:24 -05:00
krunalchande e539738fd0 Remove support for dual keys. Added finished() after all matrices and vectors. Remove buildDualGraph from GaussianFactorGraph. Remove support for multipliedHessians for non-linear equality constraints. 2014-12-12 17:23:31 -05:00
Sungtae An 960d10582d Add pure virtual function in GaussianFactor and empty dummy virtual function in Jacobian/Hessian Factor for the raw memory access functions 2014-11-17 16:17:11 -05:00
Sungtae An fe7fc8a6ef Remove raw memory access codes 2014-11-12 04:21:46 -05:00
thduynguyen 3227766569 small comment typo 2014-10-19 00:35:01 -04:00
thduynguyen 11969b32f6 fix gradient and gradientAtZero for linear constrained Jacobian, optionally scaled by the dual variables 2014-09-24 22:19:47 -04:00
thduynguyen 43a8de01c1 Merge remote-tracking branch 'origin/feature/quadratic_programming' into feature/quadratic_programming
Conflicts:
	.cproject
	.gitignore
	gtsam/linear/GaussianFactorGraph.cpp
	gtsam/linear/GaussianFactorGraph.h
	gtsam/linear/HessianFactor.cpp
	gtsam/linear/JacobianFactor.h
	gtsam/linear/QPSolver.cpp
	gtsam/linear/tests/testQPSolver.cpp
	gtsam/nonlinear/NonlinearFactor.h
2014-09-14 01:45:27 -04:00
thduynguyen 4ca9d5757f Support optional dual key for constrained Jacobian and nonlinear factors. Default boost::none for unconstrained factors. 2014-09-13 01:34:33 -04:00
thduynguyen 6d697f2c92 heuristic in EliminationPreferCholesky to work around the Indeterminant exception while solving linear constrained systems.
Instead of turning Hessian factors into Jacobian factors -- so that they can be eliminated with constrained Jacobian factors using the special QR in Constrained's noise model -- we combine all Hessian factors, eliminate the variable first to have a conditional and a new factor 1, then combine the constrained Jacobians with this conditional (also a Jacobian) to eliminate again, producing the final conditional, and a new factor 2. The two new factors are then combined into a new Hessian factor to be returned.
2014-09-11 14:51:35 -04:00
thduynguyen 3778e3c928 constructors for JacobianFactor up to 6-ary for testing in matlab 2014-08-06 11:10:36 -04:00
thduynguyen 2895b0515c Support non positive definite Hessian factors while doing EliminatePreferCholesky with some constrained factors.
Currently, when eliminating a constrained variable, EliminatePreferCholesky converts every other factors to JacobianFactor before doing the special QR factorization for constrained variables. Unfortunately, after a constrained nonlinear graph is linearized, new hessian factors from constraints, multiplied with the dual variable  (-lambda*\hessian{c} terms in the Lagrangian objective function), might become negative definite, thus cannot be converted to JacobianFactors.

Following EliminateCholesky, this version of EliminatePreferCholesky for constrained var gathers all unconstrained factors into a big joint HessianFactor before converting it into a JacobianFactor to be eliminiated by QR together with the other constrained factors.

Of course, this might not solve the non-positive-definite problem entirely, because (1) the original hessian factors might be non-positive definite and (2) large strange value of lambdas might cause the joint factor non-positive definite [is this true?]. But at least, this will help in typical cases.
2014-08-06 11:09:25 -04:00
thduynguyen befe397f7a disable printing 2014-08-06 10:55:22 -04:00
thduynguyen cb02a95f94 fix bug in weightedPseudoInverse dealing with negative weights of ineq constraints 2014-08-06 10:55:21 -04:00
thduynguyen a31e9568a1 QPSolver in progress. Finish building dual graph, but not tested.
Use mixed constrained noise with sigma < 0 to denote inequalities.
Working set implements the active set method, turning inactive inequalities
to active one as equality constraints by setting their corresponding sigmas to 0
and vice versa. Dual graph now has to deal with mixed sigmas.
2014-08-06 10:55:20 -04:00
thduynguyen 1e3ae3b3d3 Support non positive definite Hessian factors while doing EliminatePreferCholesky with some constrained factors.
Currently, when eliminating a constrained variable, EliminatePreferCholesky converts every other factors to JacobianFactor before doing the special QR factorization for constrained variables. Unfortunately, after a constrained nonlinear graph is linearized, new hessian factors from constraints, multiplied with the dual variable  (-lambda*\hessian{c} terms in the Lagrangian objective function), might become negative definite, thus cannot be converted to JacobianFactors.

Following EliminateCholesky, this version of EliminatePreferCholesky for constrained var gathers all unconstrained factors into a big joint HessianFactor before converting it into a JacobianFactor to be eliminiated by QR together with the other constrained factors.

Of course, this might not solve the non-positive-definite problem entirely, because (1) the original hessian factors might be non-positive definite and (2) large strange value of lambdas might cause the joint factor non-positive definite [is this true?]. But at least, this will help in typical cases.
2014-05-03 18:04:37 -04:00
Luca f15f7f3893 Jacobian factors' gradientAtZero with raw memory access does nothing (to be fixed) 2014-04-24 12:02:11 -04:00
Luca 37b750411f added gradientAtZero with raw memory access 2014-04-22 18:38:12 -04:00
thduynguyen cbda04a96d disable printing 2014-04-15 16:37:32 -04:00
thduynguyen 22cbe326e3 fix bug in weightedPseudoInverse dealing with negative weights of ineq constraints 2014-04-15 13:55:04 -04:00
thduynguyen c2378204ef QPSolver in progress. Finish building dual graph, but not tested.
Use mixed constrained noise with sigma < 0 to denote inequalities.
Working set implements the active set method, turning inactive inequalities
to active one as equality constraints by setting their corresponding sigmas to 0
and vice versa. Dual graph now has to deal with mixed sigmas.
2014-04-14 22:57:55 -04:00
Luca 6edd3f10fc added raw memory access version of hessianDiagonal 2014-03-19 17:43:20 -04:00
Luca d2b6b12bba added raw memory access of hessianDiagonal 2014-03-17 19:28:49 -04:00
hchiu de27502738 Move Eigen magic inside function itself as Frank suggested. 2014-03-04 10:25:54 -05:00
hchiu b464b808ef First cut on raw MultiplyHessianAdd for HessianFactor and JacobianFactor. Unit test is passed in testGaussianFactorGraphUnordered (multiplyHessianAdd3). Note the interface currently needs the accumulated diminsions of key variables. See GaussianFactorGraph::multiplyHessianAdd(double alpha,const double* x, double* y). 2014-03-04 01:58:34 -05:00
dellaert 744d9f7c1c Cherry-picked Richard commit: Removed use of boost::range 'join' - replaced with a special flag to add one dimension in VerticalBlockMatrix and SymmetricBlockMatrix 2014-03-02 00:07:12 -05:00
dellaert f8024bd6dd Conversion from Hessian can have NULL node model 2014-02-16 12:15:52 -05:00