Fixed bug in the n==0 case

release/4.3a0
dellaert 2014-05-28 22:30:46 -04:00
parent 0c95959510
commit e48fa756c0
1 changed files with 1 additions and 0 deletions

View File

@ -220,6 +220,7 @@ Diagonal::shared_ptr Diagonal::Variances(const Vector& variances, bool smart) {
Diagonal::shared_ptr Diagonal::Sigmas(const Vector& sigmas, bool smart) {
if (smart) {
size_t n = sigmas.size();
if (n==0) goto full;
// look for zeros to make a constraint
for (size_t j=0; j< n; ++j)
if (sigmas(j)<1e-8)