HiVecMap_code/src/VPQTreeNode.cpp
// Output the VPQ-tree index to external memory
Output the VPQ-tree index to external memory
Output the VPQ - tree index to external memory
void VPQTreeNode::saveToFile(std::ofstream &outFile){
    if (this->level != 0){
        nodeInfo node(this->level, this->quadType); 
        outFile.write((char*)&node, sizeof(node));
    }
    if (upLeftNode == nullptr && upRightNode == nullptr && bottomLeftNode == nullptr && bottomRightNode == nullptr){
        return;
    }
    if (upLeftNode){
        upLeftNode->saveToFile(outFile);
    }
    if (upRightNode)
    {
        upRightNode->saveToFile(outFile);
    }
    if (bottomLeftNode){
        bottomLeftNode->saveToFile(outFile);
    }
    if (bottomRightNode){
        bottomRightNode->saveToFile(outFile);
    }
}
void VPQTreeNode :: saveToFile ( std :: ofstream & outFile ) { if ( this -> level != 0 ) { nodeInfo node ( this -> level , this -> quadType ) ; outFile . write ( ( char * ) & node , sizeof ( node ) ) ; } if ( upLeftNode == nullptr && upRightNode == nullptr && bottomLeftNode == nullptr && bottomRightNode == nullptr ) { return ; } if ( upLeftNode ) { upLeftNode -> saveToFile ( outFile ) ; } if ( upRightNode ) { upRightNode -> saveToFile ( outFile ) ; } if ( bottomLeftNode ) { bottomLeftNode -> saveToFile ( outFile ) ; } if ( bottomRightNode ) { bottomRightNode -> saveToFile ( outFile ) ; } }
Output the VPQ-tree index to external memory
Output the VPQ - tree index to external memory