//!
//! Provides the dinotree data structure and ways to traverse it.
//! All divide and conquer style query algorithms that you can do on this tree would be done using the Vistr nd VistrMut visitors.
//! No actual query algorithms are provided in this crate. Only the data structure and a way to construct it are provided in this crate.
//!
//! # Overview
//!
//! ~~~~text
//! 2d Tree Divider Representation:
//!
//!
//! o ┆┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┃ ┆ o
//! ┈┈┈┈┈┈┆ o o ┃ o ┆ o o
//! ───────o─────────────────┃ o┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
//! ┆ o o o ┆
//! o ┆ o ┃┈┈┈┈┈o┈┈┈┆ o
//! ┆ o ┃ o o
//! ┆┈┈┈┈┈┈┈┈┈┈┃ ┆ o
//! o o o ┃───────o────────────────────────
//! ┆ ┃ ┆ o
//! ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┆ o o o ┆┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
//! o ┆ ┃┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┆ o
//! o ┆ o ┃ o ┆ o
//! ┆ ┃ ┆
//!
//! Axis alternates every level.
//! Divider placement is placed at the median at each level.
//! objects that intersect a divider belong to that node.
//! Every divider keeps track of how thick a line would have to be
//! to cover all the bots it owns.
//! All the objects in a node are sorted along that node's axis.
//!
//! ~~~~
//!
//! # Unsafety
//!
//! The HasAabb trait is marked as unsafe. See its description.
//! Unsafety used to have slices of bots in the tree, but also a slice of all the bots
//! so that we can efficiently return a slice of all the bots.
//! Unsafety is used to reused code between sequential and parallel build algorithms.
//!
extern crate dists;
extern crate test;
extern crate axgeom;
extern crate compt;
extern crate is_sorted;
extern crate itertools;
extern crate pdqselect;
extern crate rayon;
extern crate reorder;
///Contains code to write generic code that can be run in parallel, or sequentially. Not intended to be used directly by the user.
///Used by algorithms that operate on the tree.
///Provides low level functionality to construct a dyntree.
pub use crate DinoTree;
pub use crate DinoTreeBuilder;
pub use crate DinoTreeNoCopy;
pub use crate DinoTreeNoCopyBuilder;
pub use crate NotSorted;
pub use crate DinoTreeRef;
pub use crate DinoTreeRefMut;
pub use crate NodeRef;
pub use crate NodeRefMut;
pub use crate Vistr;
pub use crate VistrMut;
///Contains code to construct the dyntree.
///Main property is that the nodes and the bots are all copied into one
///segment of memory.
///A collection of 1d functions that operate on lists of 2d objects.
///Provies some debugging and misc functions.
///The underlying number type used for the dinotree.
///It is auto implemented by all types that satisfy the type constraints.
///Notice that no arithmatic is possible. The tree is constructed
///using only comparisons and copying.
///Marker trait to signify that this object has an axis aligned bounding box.
///If two HasAabb objects have aabb's that do not intersect, then it must be safe to have a mutable reference
///to each simultaneously.
///
///The aabb must not change while the object is contained in the tree.
///So multiple calls to get() must return the same bounding box region while the object is in the tree.
///Not doing so would violate invariants of the tree, and would thus make all the
///query algorithms performed on the tree would not be correct.
///
///Not only will the algorithms not be correct, but undefined behavior may be introduced.
///Some algorithms rely on the positions of the bounding boxes to determined if two aabbs can
///be mutably borrowed at the same time. For example the multirect algorithm makes this assumption.
pub unsafe
///A wrapper type around a type T and bounding box where the bounding box is hidden.
///This is what is inserted into the tree. This way the user
///cannot modify the bounding box since it is hidden, with only read access.
use Debug;
use Formatter;
unsafe