本文整理汇总了C++中TreeType::LocalDataset方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeType::LocalDataset方法的具体用法?C++ TreeType::LocalDataset怎么用?C++ TreeType::LocalDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeType
的用法示例。
在下文中一共展示了TreeType::LocalDataset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckSync
void CheckSync(const TreeType& tree)
{
if (tree.IsLeaf())
{
for (size_t i = 0; i < tree.Count(); i++)
{
for (size_t j = 0; j < tree.LocalDataset().n_rows; j++)
{
BOOST_REQUIRE_EQUAL(tree.LocalDataset().col(i)[j],
tree.Dataset().col(tree.Points()[i])[j]);
}
}
}
else
{
for (size_t i = 0; i < tree.NumChildren(); i++)
CheckSync(*tree.Children()[i]);
}
}
示例2: CheckExactContainment
void CheckExactContainment(const TreeType& tree)
{
if (tree.NumChildren() == 0)
{
for (size_t i = 0; i < tree.Bound().Dim(); i++)
{
double min = DBL_MAX;
double max = -1.0 * DBL_MAX;
for(size_t j = 0; j < tree.Count(); j++)
{
if (tree.LocalDataset().col(j)[i] < min)
min = tree.LocalDataset().col(j)[i];
if (tree.LocalDataset().col(j)[i] > max)
max = tree.LocalDataset().col(j)[i];
}
BOOST_REQUIRE_EQUAL(max, tree.Bound()[i].Hi());
BOOST_REQUIRE_EQUAL(min, tree.Bound()[i].Lo());
}
}
else
{
for (size_t i = 0; i < tree.Bound().Dim(); i++)
{
double min = DBL_MAX;
double max = -1.0 * DBL_MAX;
for (size_t j = 0; j < tree.NumChildren(); j++)
{
if(tree.Child(j).Bound()[i].Lo() < min)
min = tree.Child(j).Bound()[i].Lo();
if(tree.Child(j).Bound()[i].Hi() > max)
max = tree.Child(j).Bound()[i].Hi();
}
BOOST_REQUIRE_EQUAL(max, tree.Bound()[i].Hi());
BOOST_REQUIRE_EQUAL(min, tree.Bound()[i].Lo());
}
for (size_t i = 0; i < tree.NumChildren(); i++)
CheckExactContainment(tree.Child(i));
}
}