propose patch to fix Values constructor from ConstFiltered, and unit tests
							parent
							
								
									d4b868aa12
								
							
						
					
					
						commit
						290f0ab8a4
					
				|  | @ -215,7 +215,7 @@ namespace gtsam { | |||
|   Values::Values(const Values::ConstFiltered<ValueType>& view) { | ||||
|     BOOST_FOREACH(const typename ConstFiltered<ValueType>::KeyValuePair& key_value, view) { | ||||
|       Key key = key_value.key; | ||||
|       insert<ValueType>(key, key_value.value); | ||||
|       insert(key, static_cast<const ValueType&>(key_value.value)); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
|  | @ -383,6 +383,12 @@ TEST(Values, filter) { | |||
|   expectedSubValues1.insert(3, pose3); | ||||
|   EXPECT(assert_equal(expectedSubValues1, actualSubValues1)); | ||||
| 
 | ||||
|   // ConstFilter by Key
 | ||||
|   Values::ConstFiltered<Value> constfiltered = values.filter(boost::bind(std::greater_equal<Key>(), _1, 2)); | ||||
|   EXPECT_LONGS_EQUAL(2, (long)constfiltered.size()); | ||||
|   Values fromconstfiltered(constfiltered); | ||||
|   EXPECT(assert_equal(expectedSubValues1, fromconstfiltered)); | ||||
| 
 | ||||
|   // Filter by type
 | ||||
|   i = 0; | ||||
|   Values::ConstFiltered<Pose3> pose_filtered = values.filter<Pose3>(); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue