qbfdag.h

来自「算断裂的」· C头文件 代码 · 共 113 行

H
113
字号
// ------------------------------------------------------------------// qbfdag.h//// This file contains a class for holding the dag (directed acyclic// graph) on box faces.// ------------------------------------------------------------------// Author: Stephen A. Vavasis// Copyright (c) 1999 by Cornell University.  All rights reserved.// // See the accompanying file 'Copyright' for authorship information,// the terms of the license governing this software, and disclaimers// concerning this software.// ------------------------------------------------------------------// This file is part of the QMG software.  // Version 2.0 of QMG, release date September 3, 1999.// ------------------------------------------------------------------#ifndef QBFDAG_H#define QBFDAG_H#include "qmgnamesp.h"#include "qsimpcomp.h"#include "qsmall.h"#include "qmatvec.h"class QMG::MG::BoxFaceDag {public:  typedef int Index; private:  // The dag has two types of nodes, FACETNODE which is generated  // when align launches a new facet of a box, and MERGENODE  // when deduplicate_orbit merges two identical boxes.  class DagNode {  private:    Index parent1_;    SimpComplex::VertexOrdinalIndex vnum_o_;    bool is_leaf_ : 1;    unsigned int side1_ : 1;    unsigned int dim1_ : 3;    unsigned int is_front_ : 2;  public:    SimpComplex::VertexOrdinalIndex vertex_index() const {      return vnum_o_;    }    unsigned int side1() const { return side1_;}    unsigned int dim1() const { return dim1_; }    unsigned int is_front() const { return is_front_;}    bool is_leaf() const { return is_leaf_; }    Index parent1() const { return parent1_;}    DagNode() { }    ~DagNode() { }    void initialize_node(int par1,      int side1,      int dim1,      SimpComplex::VertexOrdinalIndex vnum_o,      bool is_leaf1,      int is_front1) {      parent1_ = par1;      side1_ = side1;      dim1_ = dim1;      vnum_o_ = vnum_o;      is_leaf_ = is_leaf1;      is_front_ = is_front1;    }  };private:  int di_;  vector<DagNode> linkstack_;  mutable vector<int> permut_;  mutable vector<int> wksp_;  mutable vector<int> side_;  BoxFaceDag(const BoxFaceDag&) { }  void operator=(const BoxFaceDag&) { }public:  Index add_protected_box(const ActiveBox& b, SimpComplex::VertexOrdinalIndex vnum_o);  // Data is retrieved from the dag by tracing a path to the root.  // In particular, a leaf node is selected, then trace_path_to_rot  // traces the path to the root box.  Root boxes are the  // full-dimensional boxes in the dag.  // Return the sign and the path to the root.  void trace_path_to_root(Index starting_link,    vector<SimpComplex::VertexOrdinalIndex>& volist,    int& permut_sgn,    int& surf_ori) const;  bool is_leaf(Index ind) const {return linkstack_[ind].is_leaf();}  int size() const {return linkstack_.size();}  explicit BoxFaceDag(int di) : di_(di), permut_(di), wksp_(di) { }  ~BoxFaceDag() { }};#endif

⌨️ 快捷键说明

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