qtree.h

来自「在n维空间(每维范围为0-1)内对插入的数值根据坐标进行分区。从一个没有分区的空」· C头文件 代码 · 共 45 行

H
45
字号
#ifndef _QTREE_H
#define _QTREE_H

#include <string>
#include <iostream>
#include <cmath>

#include "Cache.h"
#include "BFile.h"
#include "generaldef.h"
#include "utility.h"

class CacheBlock;


class qtree_node {
     public:
             float coor_upper[DIMENSION];      //range coordinates
             float coor_lower[DIMENSION];

             
             int level;  // level=0 is root
			 bool enable_split;
             bool is_leaf;
             int num_pts;
             CacheBlock* ptr_to_cache;
//             static Cache cache_memory;
             string node_id; //initically "", append "00" for child_0, "01" for child_1...etc.
                             // node_id and block_id refer to the same thing
             qtree_node* child[2*DIMENSION];
                                 // 1(01) 3(11) 
                                 // 0(00) 2(10)    read y-axis first
      
             qtree_node (int lv);
             ~qtree_node ();
             void split ();
             bool insert_one_data (Entry* data);
             void move_data(CacheBlock* dest, int child_i);
			 int move_data_m2f(int child_i);
      };



#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?