Add traits and main include file.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @file octree.hpp
|
||||
* @author Ryan Curtin
|
||||
*
|
||||
* Include all the necessary files to use the Octree class.
|
||||
*/
|
||||
#ifndef MLPACK_CORE_TREE_OCTREE_HPP
|
||||
#define MLPACK_CORE_TREE_OCTREE_HPP
|
||||
|
||||
#include <mlpack/core.hpp>
|
||||
#include "bounds.hpp"
|
||||
#include "octree/octree.hpp"
|
||||
#include "octree/traits.hpp"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* @file traits.hpp
|
||||
* @author Ryan Curtin
|
||||
*
|
||||
* Specialization of the TreeTraits class for the Octree class.
|
||||
*/
|
||||
#ifndef MLPACK_CORE_TREE_OCTREE_TRAITS_HPP
|
||||
#define MLPACK_CORE_TREE_OCTREE_TRAITS_HPP
|
||||
|
||||
#include <mlpack/core/tree/tree_traits.hpp>
|
||||
|
||||
namespace mlpack {
|
||||
namespace tree {
|
||||
|
||||
/**
|
||||
* This is a specialization of the TreeTraits class to the Octree tree type. It
|
||||
* defines characteristics of the octree, and is used to help write
|
||||
* tree-independent (but still optimized) tree-based algorithms. See
|
||||
* mlpack/core/tree/tree_traits.hpp for more information.
|
||||
*/
|
||||
template<typename MetricType,
|
||||
typename StatisticType,
|
||||
typename MatType>
|
||||
class TreeTraits<Octree<MetricType, StatisticType, MatType>>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* No octree nodes will overlap.
|
||||
*/
|
||||
static const bool HasOverlappingChildren = false;
|
||||
|
||||
/**
|
||||
* Points are not shared across nodes in the octree.
|
||||
*/
|
||||
static const bool HasDuplicatedPoints = false;
|
||||
|
||||
/**
|
||||
* There is no guarantee that the first point in a node is its centroid.
|
||||
*/
|
||||
static const bool FirstPointIsCentroid = false;
|
||||
|
||||
/**
|
||||
* Points are not contained at multiple levels of the octree.
|
||||
*/
|
||||
static const bool HasSelfChildren = false;
|
||||
|
||||
/**
|
||||
* Points are rearranged during building of the tree.
|
||||
*/
|
||||
static const bool RearrangesDataset = true;
|
||||
|
||||
/**
|
||||
* This is not necessarily a binary tree.
|
||||
*/
|
||||
static const bool BinaryTree = false;
|
||||
|
||||
/**
|
||||
* NumDescendants() represents the number of unique descendant points.
|
||||
*/
|
||||
static const bool UniqueNumDescendants = true;
|
||||
};
|
||||
|
||||
} // namespace tree
|
||||
} // namespace mlpack
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user