Better print and new `max` variant
							parent
							
								
									0076db7e20
								
							
						
					
					
						commit
						6e4f50dfac
					
				|  | @ -22,6 +22,7 @@ | |||
| #include <gtsam/base/FastSet.h> | ||||
| 
 | ||||
| #include <boost/make_shared.hpp> | ||||
| #include <boost/format.hpp> | ||||
| #include <utility> | ||||
| 
 | ||||
| using namespace std; | ||||
|  | @ -65,9 +66,13 @@ namespace gtsam { | |||
| 
 | ||||
|   /* ************************************************************************* */ | ||||
|   void DecisionTreeFactor::print(const string& s, | ||||
|       const KeyFormatter& formatter) const { | ||||
|                                  const KeyFormatter& formatter) const { | ||||
|     cout << s; | ||||
|     ADT::print("Potentials:",formatter); | ||||
|     cout << " f["; | ||||
|     for (auto&& key : keys()) | ||||
|       cout << boost::format(" (%1%,%2%),") % formatter(key) % cardinality(key); | ||||
|     cout << " ]" << endl; | ||||
|     ADT::print("Potentials:", formatter); | ||||
|   } | ||||
| 
 | ||||
|   /* ************************************************************************* */ | ||||
|  |  | |||
|  | @ -127,11 +127,16 @@ namespace gtsam { | |||
|       return combine(keys, ADT::Ring::add); | ||||
|     } | ||||
| 
 | ||||
|     /// Create new factor by maximizing over all values with the same separator values
 | ||||
|     /// Create new factor by maximizing over all values with the same separator.
 | ||||
|     shared_ptr max(size_t nrFrontals) const { | ||||
|       return combine(nrFrontals, ADT::Ring::max); | ||||
|     } | ||||
| 
 | ||||
|     /// Create new factor by maximizing over all values with the same separator.
 | ||||
|     shared_ptr max(const Ordering& keys) const { | ||||
|       return combine(keys, ADT::Ring::max); | ||||
|     } | ||||
| 
 | ||||
|     /// @}
 | ||||
|     /// @name Advanced Interface
 | ||||
|     /// @{
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue