MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "moab/Core.hpp"
#include "moab/AdaptiveKDTree.hpp"
#include "moab/Range.hpp"
#include "moab/CartVect.hpp"
#include <cmath>
#include <cassert>
#include <cfloat>
#include <cstdio>
#include "TestUtil.hpp"
Go to the source code of this file.
Functions | |
EntityHandle | create_tree (AdaptiveKDTree &tool, unsigned depth, int intervals, Tag *tag_handle=0) |
void | validate_tree (AdaptiveKDTree &tool, EntityHandle root, int depth, double intervals) |
void | test_tree_create () |
void | test_leaf_merge () |
void | test_tree_readwrite () |
void | test_tree_delete () |
void | test_iterator_back () |
void | test_point_search () |
int | main (int argc, char **argv) |
void | validate_tree (AdaptiveKDTree &tool, EntityHandle root, unsigned depth, int intervals, Tag data) |
Variables | |
const unsigned | INTERVALS = 4 |
const unsigned | DEPTH = 7 |
const char * | TAG_NAME = "TEST_DATA" |
EntityHandle create_tree | ( | AdaptiveKDTree & | tool, |
unsigned | depth, | ||
int | intervals, | ||
Tag * | tag_handle = 0 |
||
) |
Definition at line 62 of file kd_tree_test.cpp.
References moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), CHECK, CHECK_ERR, moab::Tree::create_root(), moab::AdaptiveKDTreeIter::depth(), ErrorCode, moab::AdaptiveKDTree::get_tree_iterator(), moab::AdaptiveKDTreeIter::handle(), leaf, MB_ENTITY_NOT_FOUND, MB_SUCCESS, MB_TAG_DENSE, MB_TAG_EXCL, MB_TYPE_INTEGER, moab::Tree::moab(), split, moab::AdaptiveKDTree::split_leaf(), moab::AdaptiveKDTreeIter::step(), moab::Interface::tag_get_handle(), TAG_NAME, and moab::Interface::tag_set_data().
Referenced by test_iterator_back(), test_leaf_merge(), test_point_search(), test_tree_create(), test_tree_delete(), and test_tree_readwrite().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 33 of file kd_tree_test.cpp.
References moab::fail(), RUN_TEST, test_iterator_back(), test_leaf_merge(), test_point_search(), test_tree_create(), test_tree_delete(), and test_tree_readwrite().
void test_iterator_back | ( | ) |
Definition at line 260 of file kd_tree_test.cpp.
References moab::AdaptiveKDTreeIter::back(), moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, create_tree(), DEPTH, ErrorCode, moab::AdaptiveKDTree::get_tree_iterator(), moab::AdaptiveKDTreeIter::handle(), INTERVALS, leaf, mb, MB_ENTITY_NOT_FOUND, MB_SUCCESS, and moab::AdaptiveKDTreeIter::step().
Referenced by main().
void test_leaf_merge | ( | ) |
Definition at line 155 of file kd_tree_test.cpp.
References moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, create_tree(), moab::AdaptiveKDTreeIter::depth(), DEPTH, ErrorCode, moab::AdaptiveKDTree::get_tree_iterator(), moab::AdaptiveKDTreeIter::handle(), INTERVALS, leaf, mb, moab::AdaptiveKDTree::merge_leaf(), moab::AdaptiveKDTreeIter::step(), moab::Core::tag_get_data(), and moab::Core::tag_set_data().
Referenced by main().
void test_point_search | ( | ) |
Definition at line 325 of file kd_tree_test.cpp.
References moab::CartVect::array(), moab::AdaptiveKDTreeIter::back(), moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, create_tree(), moab::AdaptiveKDTreeIter::depth(), DEPTH, ErrorCode, moab::AdaptiveKDTree::get_last_iterator(), moab::AdaptiveKDTree::get_tree_iterator(), moab::AdaptiveKDTreeIter::handle(), INTERVALS, leaf, mb, MB_ENTITY_NOT_FOUND, moab::AdaptiveKDTree::point_search(), and moab::AdaptiveKDTreeIter::step().
Referenced by main().
void test_tree_create | ( | ) |
Definition at line 146 of file kd_tree_test.cpp.
References create_tree(), DEPTH, INTERVALS, mb, and validate_tree().
Referenced by main().
void test_tree_delete | ( | ) |
Definition at line 245 of file kd_tree_test.cpp.
References CHECK, CHECK_ERR, create_tree(), DEPTH, moab::Range::empty(), ErrorCode, moab::Core::get_entities_by_type_and_tag(), INTERVALS, mb, MBENTITYSET, and moab::AdaptiveKDTree::reset_tree().
Referenced by main().
void test_tree_readwrite | ( | ) |
Definition at line 214 of file kd_tree_test.cpp.
References CHECK_ERR, create_tree(), moab::Core::delete_mesh(), DEPTH, ErrorCode, moab::Tree::find_all_trees(), moab::Range::front(), INTERVALS, moab::Core::load_file(), mb, MB_TYPE_INTEGER, moab::Range::size(), moab::Core::tag_get_handle(), TAG_NAME, validate_tree(), and moab::Core::write_file().
Referenced by main().
void validate_tree | ( | AdaptiveKDTree & | tool, |
EntityHandle | root, | ||
int | depth, | ||
double | intervals | ||
) |
Referenced by test_tree_create(), and test_tree_readwrite().
void validate_tree | ( | AdaptiveKDTree & | tool, |
EntityHandle | root, | ||
unsigned | depth, | ||
int | intervals, | ||
Tag | data | ||
) |
Definition at line 110 of file kd_tree_test.cpp.
References moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), CHECK, CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, moab::AdaptiveKDTreeIter::depth(), ErrorCode, moab::AdaptiveKDTree::get_tree_iterator(), moab::AdaptiveKDTreeIter::handle(), leaf, MBENTITYSET, moab::Tree::moab(), moab::AdaptiveKDTreeIter::step(), moab::Interface::tag_get_data(), and moab::TYPE_FROM_HANDLE().
const unsigned DEPTH = 7 |
Definition at line 20 of file kd_tree_test.cpp.
Referenced by test_iterator_back(), test_leaf_merge(), test_point_search(), test_tree_create(), test_tree_delete(), and test_tree_readwrite().
const unsigned INTERVALS = 4 |
Definition at line 19 of file kd_tree_test.cpp.
Referenced by test_iterator_back(), test_leaf_merge(), test_point_search(), test_tree_create(), test_tree_delete(), and test_tree_readwrite().
const char* TAG_NAME = "TEST_DATA" |
Definition at line 21 of file kd_tree_test.cpp.
Referenced by create_tree(), and test_tree_readwrite().