From 741df283d098536857bdacfb9140828a0dc3aca2 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Fri, 19 Jun 2020 09:00:15 +0200 Subject: [PATCH] Finish undo of #310 fill with zeros (not actually needed) --- gtsam/base/SymmetricBlockMatrix.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gtsam/base/SymmetricBlockMatrix.h b/gtsam/base/SymmetricBlockMatrix.h index c2996109f1..4e030606da 100644 --- a/gtsam/base/SymmetricBlockMatrix.h +++ b/gtsam/base/SymmetricBlockMatrix.h @@ -71,24 +71,22 @@ namespace gtsam { } /// Construct from a container of the sizes of each block. - /// Uninitialized blocks are filled with zeros. template SymmetricBlockMatrix(const CONTAINER& dimensions, bool appendOneDimension = false) : blockStart_(0) { fillOffsets(dimensions.begin(), dimensions.end(), appendOneDimension); - matrix_.setZero(variableColOffsets_.back(), variableColOffsets_.back()); + matrix_.resize(variableColOffsets_.back(), variableColOffsets_.back()); assertInvariants(); } /// Construct from iterator over the sizes of each vertical block. - /// Uninitialized blocks are filled with zeros. template SymmetricBlockMatrix(ITERATOR firstBlockDim, ITERATOR lastBlockDim, bool appendOneDimension = false) : blockStart_(0) { fillOffsets(firstBlockDim, lastBlockDim, appendOneDimension); - matrix_.setZero(variableColOffsets_.back(), variableColOffsets_.back()); + matrix_.resize(variableColOffsets_.back(), variableColOffsets_.back()); assertInvariants(); } @@ -418,4 +416,3 @@ namespace gtsam { class CholeskyFailed; } -