renamed sparse to sparseJacobian_

release/4.3a0
Frank Dellaert 2011-10-30 20:38:08 +00:00
parent 0a101eb50f
commit 03280f2446
4 changed files with 10 additions and 8 deletions

View File

@ -74,12 +74,14 @@ initialEstimate.print('initial estimate');
result = graph.optimize_(initialEstimate);
result.print('final result');
%% Print out the corresponding dense matrix
%% Get the corresponding dense matrix
ord = graph.orderingCOLAMD(result);
gfg = graph.linearize(result,ord);
denseAb = gfg.denseJacobian
denseAb = gfg.denseJacobian;
%% Get sparse matrix
IJS = gfg.sparse();
%% Get sparse matrix A and RHS b
IJS = gfg.sparseJacobian_();
Ab=sparse(IJS(1,:),IJS(2,:),IJS(3,:));
spy(Ab(:,1:end-1));
A = Ab(:,1:end-1);
b = full(Ab(:,end));
spy(A);

View File

@ -110,7 +110,7 @@ class GaussianFactorGraph {
void combine(const GaussianFactorGraph& lfg);
Matrix denseJacobian() const;
Matrix denseHessian() const;
Matrix sparse() const;
Matrix sparseJacobian_() const;
};
class Landmark2 {

View File

@ -141,7 +141,7 @@ namespace gtsam {
}
/* ************************************************************************* */
Matrix GaussianFactorGraph::sparse() const {
Matrix GaussianFactorGraph::sparseJacobian_() const {
// call sparseJacobian
typedef boost::tuple<size_t, size_t, double> triplet;

View File

@ -160,7 +160,7 @@ namespace gtsam {
* such that S(i(k),j(k)) = s(k), which can be given to MATLAB's sparse.
* The standard deviations are baked into A and b
*/
Matrix sparse() const;
Matrix sparseJacobian_() const;
/**
* Return a dense \f$ m \times n \f$ Jacobian matrix, augmented with b