CI fixes.
This commit is contained in:
@@ -17,26 +17,28 @@ namespace mlpack {
|
||||
namespace tree /** Trees and tree-building procedures. */ {
|
||||
namespace enumerate {
|
||||
|
||||
// Actual implementation of the enumeration. The problem is the unified detection
|
||||
// if we're on the root, because Enter and Leave expect the parent being passed.
|
||||
template <class TreeType, class Walker>
|
||||
void EnumerateTreeImpl(TreeType* tree, Walker& walker, bool root)
|
||||
// Actual implementation of the enumeration. The problem is the unified
|
||||
// detection if we're on the root, because Enter and Leave expect the
|
||||
// parent being passed.
|
||||
template <class TreeType, class Walker>
|
||||
void EnumerateTreeImpl(TreeType* tree, Walker& walker, bool root)
|
||||
{
|
||||
if (root)
|
||||
walker.Enter(tree, (const TreeType*)nullptr);
|
||||
|
||||
const size_t numChildren = tree->NumChildren();
|
||||
for (size_t i = 0; i < numChildren; ++i)
|
||||
{
|
||||
if (root)
|
||||
walker.Enter(tree, (const TreeType*)nullptr);
|
||||
|
||||
const size_t numChildren = tree->NumChildren();
|
||||
for (size_t i = 0; i < numChildren; ++i)
|
||||
{
|
||||
TreeType* child = tree->ChildPtr(i);
|
||||
walker.Enter(child, tree);
|
||||
EnumerateTreeImpl(child, walker, false);
|
||||
walker.Leave(child, tree);
|
||||
}
|
||||
|
||||
if (root)
|
||||
walker.Leave(tree, (const TreeType*)nullptr);
|
||||
TreeType* child = tree->ChildPtr(i);
|
||||
walker.Enter(child, tree);
|
||||
EnumerateTreeImpl(child, walker, false);
|
||||
walker.Leave(child, tree);
|
||||
}
|
||||
|
||||
if (root)
|
||||
walker.Leave(tree, (const TreeType*)nullptr);
|
||||
}
|
||||
|
||||
} // namespace enumerate
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,7 +77,7 @@ DTree<MatType, TagType>* Trainer(MatType& dataset,
|
||||
*/
|
||||
class PathCacher
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum PathFormat
|
||||
{
|
||||
FormatLR,
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
|
||||
size_t NumNodes() const { return pathCache.size(); }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
typedef std::list<std::pair<bool, int> > PathType;
|
||||
typedef std::vector<std::pair<int, std::string> > PathCacheType;
|
||||
|
||||
|
||||
@@ -347,7 +347,8 @@ template <typename MatType>
|
||||
PathCacher::PathCacher(PathCacher::PathFormat fmt, DTree<MatType, int>* dtree) :
|
||||
format(fmt)
|
||||
{
|
||||
// Here we use TagTree()'s output to determine the number of _nodes_ in the tree).
|
||||
// Here we use TagTree()'s output to determine the
|
||||
// number of _nodes_ in the tree.
|
||||
pathCache.resize(dtree->TagTree(0, true));
|
||||
pathCache[0] = PathCacheType::value_type(-1, "");
|
||||
tree::EnumerateTree(dtree, *this);
|
||||
@@ -411,4 +412,4 @@ const std::string& PathCacher::PathFor(int tag) const
|
||||
} // namespace det
|
||||
} // namespace mlpack
|
||||
|
||||
#endif
|
||||
#endif // MLPACK_METHODS_DET_DT_UTILS_IMPL_HPP
|
||||
|
||||
Reference in New Issue
Block a user