From 3ad9c9494e64f02dd3d4779c8765c181178ce693 Mon Sep 17 00:00:00 2001 From: Yong-Dian Jian Date: Tue, 23 Nov 2010 15:27:23 +0000 Subject: [PATCH] add interface to access block matrix --- gtsam/linear/GaussianFactor.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtsam/linear/GaussianFactor.h b/gtsam/linear/GaussianFactor.h index 87f46203e..682b758fd 100644 --- a/gtsam/linear/GaussianFactor.h +++ b/gtsam/linear/GaussianFactor.h @@ -151,6 +151,10 @@ namespace gtsam { ABlock getA(iterator variable) { return Ab_(variable - keys_.begin()); } + // direct indexing + constABlock getA(size_t idx) const { return Ab_(idx); } + ABlock getA(size_t idx) { return Ab_(idx); } + /** Return the dimension of the variable pointed to by the given key iterator * todo: Remove this in favor of keeping track of dimensions with variables? */