Fixed issue with 'count'

release/4.3a0
dellaert 2018-12-22 18:07:00 -05:00
parent 94010aee9d
commit e2363e90bd
3 changed files with 3 additions and 2 deletions

View File

@ -387,7 +387,7 @@ namespace gtsam {
// Count values of given type \c ValueType
template<class ValueType>
bool count() const {
size_t count() const {
size_t i = 0;
for (const auto& key_value : *this) {
if (dynamic_cast<const GenericValue<ValueType>*>(&key_value.value))

View File

@ -384,6 +384,7 @@ TEST(Values, filter) {
}
EXPECT_LONGS_EQUAL(2, (long)i);
EXPECT_LONGS_EQUAL(2, (long)values.count<Pose3>());
EXPECT_LONGS_EQUAL(2, (long)values.count<Pose2>());
// construct a values with the view
Values actualSubValues2(pose_filtered);

View File

@ -880,7 +880,7 @@ bool writeBALfromValues(const string& filename, const SfM_data &data,
}
} else {
cout
<< "writeBALfromValues: different number of cameras in SfM_dataValues (#cameras= "
<< "writeBALfromValues: different number of cameras in SfM_dataValues (#cameras "
<< dataValues.number_cameras() << ") and values (#cameras "
<< nrPoses << ", #poses " << nrCameras << ")!!"
<< endl;