~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to lib/atc/KD_Tree.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
KD_Tree::~KD_Tree() {
27
27
  delete sortedPts_;
 
28
  delete candElems_;
28
29
  delete leftChild_;
29
30
  delete rightChild_;
30
31
}
85
86
  // Create child tree, or NULL if there's nothing to create
86
87
  if (candElems_->size() - leftElems->size() < 4 || leftElems->size() == 0) {
87
88
    leftChild_ = NULL;
 
89
    delete leftPts;
 
90
    delete leftElems;
88
91
  } else {
89
92
    leftChild_ = new KD_Tree(leftPts, leftElems, (dimension+1) % 3);
90
93
  }
91
94
  // Create child tree, or NULL if there's nothing to create
92
95
  if (candElems_->size() - rightElems->size() < 4 || rightElems->size() == 0) {
93
96
    rightChild_ = NULL;
 
97
    delete rightPts;
 
98
    delete rightElems;
94
99
  } else {
95
100
    rightChild_ = new KD_Tree(rightPts, rightElems, (dimension+1) % 3);
96
101
  }