Use template specialization

release/4.3a0
Frank Dellaert 2023-01-06 22:50:50 -08:00
parent 18d4bdf4f4
commit 876e2e822e
1 changed files with 6 additions and 9 deletions

View File

@ -132,18 +132,15 @@ struct traits<HybridBayesTree> : public Testable<HybridBayesTree> {};
* This object stores parent keys in our base type factor so that * This object stores parent keys in our base type factor so that
* eliminating those parent keys will pull this subtree into the * eliminating those parent keys will pull this subtree into the
* elimination. * elimination.
* This does special stuff for the hybrid case.
* *
* @tparam CLIQUE * This is a template instantiation for hybrid Bayes tree cliques, storing both
* the regular keys *and* discrete keys in the HybridConditional.
*/ */
template <class CLIQUE> template <>
class BayesTreeOrphanWrapper< class BayesTreeOrphanWrapper<HybridBayesTreeClique> : public HybridConditional {
CLIQUE, typename std::enable_if<
boost::is_same<CLIQUE, HybridBayesTreeClique>::value> >
: public CLIQUE::ConditionalType {
public: public:
typedef CLIQUE CliqueType; typedef HybridBayesTreeClique CliqueType;
typedef typename CLIQUE::ConditionalType Base; typedef HybridConditional Base;
boost::shared_ptr<CliqueType> clique; boost::shared_ptr<CliqueType> clique;