From 13bbaaa2f43aad84b3ed4cd4ece6b8206e021996 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Mon, 19 Mar 2012 16:24:54 +0000 Subject: [PATCH] Added extra check --- gtsam/linear/VectorValues.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtsam/linear/VectorValues.cpp b/gtsam/linear/VectorValues.cpp index 4edca2521..96bafcd16 100644 --- a/gtsam/linear/VectorValues.cpp +++ b/gtsam/linear/VectorValues.cpp @@ -168,6 +168,9 @@ VectorValues& VectorValues::operator=(const Permuted& rhs) { if(l.rows() != r.rows()) throw std::invalid_argument("VectorValues assignment from Permuted requires pre-allocation, see documentation."); l = r; + } else { + if(rhs.container().exists(rhs.permutation()[j])) + throw std::invalid_argument("VectorValues assignment from Permuted requires pre-allocation, see documentation."); } } return *this;