Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Kdtree_d< Traits >::Box Class Reference

#include <kdtree_d.h>

Collaboration diagram for Kdtree_d< Traits >::Box:

Public Member Functions

 Box ()
 
 Box (const Box &box)
 
 Box (const Point &l, const Point &r, int _dim)
 
 Box (int _dim)
 
ExtPointget_vertex (bool f_left)
 
void set_left (Point &l)
 
void set_right (Point &r)
 
const ExtPointget_left () const
 
const ExtPointget_right () const
 
void set_coord_left (int k, Point &p)
 
void set_coord_right (int k, Point &p)
 
bool is_in (const Box &o) const
 
bool is_in (const Point &o) const
 
bool is_coord_in_range (int k, const Point &o) const
 
bool is_intersect (const Box &o) const
 
bool is_intersect_in_dim (int d, const Box &o) const
 
bool is_intersect_in_dim_closed (int d, const Box &o) const
 
bool intersect (Box &o)
 
bool is_empty () const
 
bool is_empty_open () const
 
int comp (const Box &o) const
 
 ~Box ()
 

Public Attributes

int dim
 
ExtPoint left
 
ExtPoint right
 

Detailed Description

template<class Traits>
class Kdtree_d< Traits >::Box

Definition at line 349 of file kdtree_d.h.

Constructor & Destructor Documentation

Box ( )
inline

Definition at line 359 of file kdtree_d.h.

360  {
361  }
Box ( const Box box)
inline

Definition at line 363 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

364  {
365  dim = box.dim;
366  left = box.left;
367  right = box.right;
368  }
KD_tree::Box box
Definition: Overlay_0d.C:47
ExtPoint left
Definition: kdtree_d.h:353
ExtPoint right
Definition: kdtree_d.h:353
Box ( const Point l,
const Point r,
int  _dim 
)
inline

Definition at line 371 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

372  {
373  dim = _dim;
374  left = ExtPoint( l, dim );
375  right = ExtPoint( r, dim );
376  }
ExtPoint left
Definition: kdtree_d.h:353
ExtPoint right
Definition: kdtree_d.h:353
Box ( int  _dim)
inline

Definition at line 378 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim.

~Box ( )
inline

Definition at line 548 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::Box::left, Kdtree_d< Traits >::Box::right, and Kdtree_d< Traits >::ExtPoint::term().

549  {
550  left.term();
551  right.term();
552  dim = 0;
553  }
ExtPoint left
Definition: kdtree_d.h:353
ExtPoint right
Definition: kdtree_d.h:353

Here is the call graph for this function:

Member Function Documentation

int comp ( const Box o) const
inline

Definition at line 536 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare_vector(), Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

Referenced by plag_processeulerfield().

537  {
538  int res;
539 
540  res = left.compare_vector( o.left );
541  if ( res != 0 )
542  return res;
543 
544  return right.compare_vector( o.right );
545  }
ExtPoint left
Definition: kdtree_d.h:353
ExtPoint right
Definition: kdtree_d.h:353
int compare_vector(const ExtPoint &point) const
Definition: kdtree_d.h:300

Here is the call graph for this function:

Here is the caller graph for this function:

const ExtPoint& get_left ( ) const
inline

Definition at line 400 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::left.

Referenced by Kdtree_d< Traits >::Box::intersect(), Kdtree_d< Traits >::Box::is_intersect_in_dim(), and Kdtree_d< Traits >::Box::is_intersect_in_dim_closed().

401  {
402  return left;
403  }
ExtPoint left
Definition: kdtree_d.h:353

Here is the caller graph for this function:

const ExtPoint& get_right ( ) const
inline

Definition at line 405 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::right.

Referenced by Kdtree_d< Traits >::Box::intersect(), Kdtree_d< Traits >::Box::is_intersect_in_dim(), and Kdtree_d< Traits >::Box::is_intersect_in_dim_closed().

406  {
407  return right;
408  }
ExtPoint right
Definition: kdtree_d.h:353

Here is the caller graph for this function:

ExtPoint& get_vertex ( bool  f_left)
inline

Definition at line 384 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

Referenced by Kdtree_d< Traits >::Node::Plane::split().

385  {
386  return f_left? left : right;
387  }
ExtPoint left
Definition: kdtree_d.h:353
ExtPoint right
Definition: kdtree_d.h:353

Here is the caller graph for this function:

bool intersect ( Box o)
inline

Definition at line 494 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), Kdtree_d< Traits >::Box::get_left(), Kdtree_d< Traits >::Box::get_right(), i, Kdtree_d< Traits >::Box::is_empty(), Kdtree_d< Traits >::Box::left, Kdtree_d< Traits >::Box::right, and Kdtree_d< Traits >::ExtPoint::set_coord().

497  {
498  int dim = left.dimension();
499  for (int i = 0; i < dim; i++)
500  {
501  // left is the maximal of the lefts
502  if (left.compare(i, o.get_left()) == -1)
503  left.set_coord(i, o.get_left());
504 
505  // right is the minimal of the rights
506  if (right.compare(i, o.get_right()) == 1)
507  right.set_coord(i, o.get_right());
508  }
509  return !(is_empty());
510  }
bool is_empty() const
Definition: kdtree_d.h:512
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
void set_coord(int k, Point &point)
Definition: kdtree_d.h:253
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

bool is_coord_in_range ( int  k,
const Point o 
) const
inline

Definition at line 454 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), k, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

456  {
457  return ( ! ( (left.compare( k, o ) > 0 )
458  || (right.compare( k, o ) <= 0 ) ) );
459  }
j indices k indices k
Definition: Indexing.h:6
ExtPoint left
Definition: kdtree_d.h:353
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353

Here is the call graph for this function:

bool is_empty ( ) const
inline

Definition at line 512 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), i, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

Referenced by Kdtree_d< Traits >::Box::intersect().

514  {
515  int dim = left.dimension();
516  for (int i = 0; i < dim; i++)
517  {
518  if (left.compare(i, right) == 1)
519  return true;
520  }
521  return false;
522  }
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_empty_open ( ) const
inline

Definition at line 524 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), i, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

526  {
527  int dim = left.dimension();
528  for (int i = 0; i < dim; i++)
529  {
530  if ( left.compare(i, right) >= 0 )
531  return true;
532  }
533  return false;
534  }
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

bool is_in ( const Box o) const
inline

Definition at line 424 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), i, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

Referenced by Kdtree_d< Traits >::Node::copy_subtree_points(), Kdtree_d< Traits >::Node::search(), and Kdtree_d< Traits >::Node::search_recursive().

426  {
427  int dim = left.dimension();
428 
429  for (int i = 0; i < dim; i++)
430  {
431  if ( (left.compare(i, o.get_left()) > 0 )
432  || (right.compare(i, o.get_right()) < 0 ) )
433  return false;
434  }
435 
436  return true;
437  }
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_in ( const Point o) const
inline

Definition at line 440 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), i, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

442  {
443  int dim = left.dimension();
444  for (int i = 0; i < dim; i++)
445  {
446  if ( (left.compare( i, o ) > 0 ) ||
447  (right.compare( i, o ) <= 0 ) )
448  return false;
449  }
450  return true;
451  }
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

bool is_intersect ( const Box o) const
inline

Definition at line 462 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::dim, Kdtree_d< Traits >::ExtPoint::dimension(), i, Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

464  {
465  int dim = left.dimension();
466  for (int i = 0; i < dim; i++)
467  {
468  if ( (left.compare(i, o.get_right()) >= 0) ||
469  (right.compare(i, o.get_left()) <= 0) )
470  return false;
471  }
472  return true;
473  }
ExtPoint left
Definition: kdtree_d.h:353
int dimension() const
Definition: kdtree_d.h:326
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

bool is_intersect_in_dim ( int  d,
const Box o 
) const
inline

Definition at line 478 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::get_left(), Kdtree_d< Traits >::Box::get_right(), Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

479  {
480  return (! ( (left.compare( d, o.get_right() ) >= 0 )
481  || (right.compare( d, o.get_left() ) <= 0) ));
482  }
const NT & d
ExtPoint left
Definition: kdtree_d.h:353
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353

Here is the call graph for this function:

bool is_intersect_in_dim_closed ( int  d,
const Box o 
) const
inline

Definition at line 487 of file kdtree_d.h.

References Kdtree_d< Traits >::ExtPoint::compare(), Kdtree_d< Traits >::Box::get_left(), Kdtree_d< Traits >::Box::get_right(), Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::Box::right.

Referenced by Kdtree_d< Traits >::Node::search_recursive().

488  {
489  return (! ( (left.compare( d, o.get_right() ) > 0 )
490  || (right.compare( d, o.get_left() ) < 0) ));
491  }
const NT & d
ExtPoint left
Definition: kdtree_d.h:353
int compare(int k, const ExtPoint &point) const
Definition: kdtree_d.h:276
ExtPoint right
Definition: kdtree_d.h:353

Here is the call graph for this function:

Here is the caller graph for this function:

void set_coord_left ( int  k,
Point p 
)
inline

Definition at line 411 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::left, and Kdtree_d< Traits >::ExtPoint::set_coord().

412  {
413  left.set_coord( k, p );
414  }
j indices k indices k
Definition: Indexing.h:6
ExtPoint left
Definition: kdtree_d.h:353
void set_coord(int k, Point &point)
Definition: kdtree_d.h:253

Here is the call graph for this function:

void set_coord_right ( int  k,
Point p 
)
inline

Definition at line 417 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::right, and Kdtree_d< Traits >::ExtPoint::set_coord().

418  {
419  right.set_coord( k, p );
420  }
j indices k indices k
Definition: Indexing.h:6
ExtPoint right
Definition: kdtree_d.h:353
void set_coord(int k, Point &point)
Definition: kdtree_d.h:253

Here is the call graph for this function:

void set_left ( Point l)
inline

Definition at line 390 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim, and Kdtree_d< Traits >::Box::left.

391  {
392  left = ExtPoint( l, dim );
393  };
ExtPoint left
Definition: kdtree_d.h:353
void set_right ( Point r)
inline

Definition at line 395 of file kdtree_d.h.

References Kdtree_d< Traits >::Box::dim, and Kdtree_d< Traits >::Box::right.

396  {
397  right = ExtPoint( r, dim );
398  }
ExtPoint right
Definition: kdtree_d.h:353

Member Data Documentation


The documentation for this class was generated from the following file: