亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? btree.cc

?? 超大規模集成電路設計中
?? CC
字號:
// Project: B*-trees floorplanning// Advisor: Yao-Wen Chang  <ywchang@cis.nctu.edu.tw>// Authors: Jer-Ming Hsu   <barz@cis.nctu.edu.tw>// 	    Hsun-Cheng Lee <gis88526@cis.nctu.edu.tw>// Sponsor: Arcadia Inc.// Date:    7/19/2000 ~//---------------------------------------------------------------------------#include <stack>#include <algorithm>#include "btree.h"//---------------------------------------------------------------------------float rotate_rate = 0.3;float swap_rate = 0.5;//---------------------------------------------------------------------------//   Initialization//---------------------------------------------------------------------------void B_Tree::clear(){  // initial contour value  contour_root = NIL;  FPlan::clear();}void B_Tree::init(){  // initialize contour structure  contour.resize(modules_N);      // initialize b*tree by complete binary tree  nodes.resize(modules_N);  nodes_root=0;  for(int i=0; i < modules_N; i++){    nodes[i].id = i;    nodes[i].parent = (i+1)/2-1;    nodes[i].left   = (2*i+1 < modules_N ? 2*i+1 : NIL);    nodes[i].right  = (2*i+2 < modules_N ? 2*i+2 : NIL);  }  nodes[0].parent = NIL;  best_sol.clear();  last_sol.clear();  clear();  normalize_cost(10);} //---------------------------------------------------------------------------//   Testing, Debuging tools//---------------------------------------------------------------------------bool B_Tree::legal(){  int num=0;  return legal_tree(NIL,nodes_root,num);}bool B_Tree::legal_tree(int p,int n,int &num){  num++;  if(nodes[n].parent!=p) return false;  if(nodes[n].left != NIL)    if(legal_tree(n,nodes[n].left,num) != true) return false;  if(nodes[n].right != NIL)    if(legal_tree(n,nodes[n].right,num) != true) return false;  if(p==NIL) // root    return (num==modules_N);  return true;}void B_Tree::testing(){  int p,n;  Solution E;  do{    n = rand()%modules_N;    p = rand()%modules_N;    while(n==nodes_root)		// n is not root      n = rand()%modules_N;    while(n==p||nodes[n].parent==p||nodes[p].parent==n)	// n != p & n.parent != p      p = rand()%modules_N;       Node &node = nodes[n];    Node &parent = nodes[p];    get_solution(E);    swap_node(parent,node);  }while(legal());  cout << "p=" << p << ", n=" << n << endl;  recover(E);  show_tree();  cout << "\n  p=" << p << ", n=" << n << endl;  swap_node(nodes[p],nodes[n]);  show_tree();}void B_Tree::show_tree(){  cout << "root: " << nodes_root << endl;  for(int i=0; i < modules_N; i++){    cout << nodes[i].id << ": ";    cout << nodes[i].left << " ";    cout << nodes[i].parent << " ";    cout << nodes[i].right << endl;  }}//---------------------------------------------------------------------------//   Placement modules//---------------------------------------------------------------------------void B_Tree::packing(){  stack<int> S;  clear();  int p = nodes_root;  place_module(p,NIL);  Node &n = nodes[p];  if(n.right != NIL)      S.push(n.right);  if(n.left  != NIL)      S.push(n.left);  // inorder traverse  while(!S.empty()){    p = S.top();    S.pop();    Node &n = nodes[p];    assert(n.parent != NIL);    bool is_left = (nodes[n.parent].left == n.id);    place_module(p,n.parent,is_left);    if(n.right != NIL)      S.push(n.right);    if(n.left  != NIL)      S.push(n.left);  }  // compute Width, Height  double max_x=-1,max_y=-1;  for(int p= contour_root; p != NIL; p=contour[p].front){    max_x = max(max_x,double(modules_info[p].rx));      max_y = max(max_y,double(modules_info[p].ry));  }  Width  = max_x;  Height = max_y;  Area   = Height*Width;  FPlan::packing(); 	// for wirelength  }// is_left: default is truevoid B_Tree::place_module(int mod,int abut,bool is_left){  Module_Info &mod_mf = modules_info[mod];  mod_mf.rotate       = nodes[mod].rotate;  mod_mf.flip         = nodes[mod].flip;  int w =  modules[mod].width;  int h =  modules[mod].height;  if(nodes[mod].rotate)    swap(w,h);    if(abut==NIL){	// root node    contour_root = mod;    contour[mod].back = NIL;    contour[mod].front = NIL;    mod_mf.x  = mod_mf.y = 0;    mod_mf.rx = w, mod_mf.ry = h;    return;  }    int p;   // trace contour from p  if(is_left){	// left    int abut_width = (nodes[abut].rotate ? modules[abut].height :                                            modules[abut].width);    mod_mf.x  = modules_info[abut].x + abut_width;    mod_mf.rx = mod_mf.x + w;    p = contour[abut].front;    contour[abut].front = mod;    contour[mod].back = abut;    if(p==NIL){  // no obstacle in X axis      mod_mf.y = 0;      mod_mf.ry = h;      contour[mod].front = NIL;      return;    }  }else{	// upper    mod_mf.x = modules_info[abut].x;    mod_mf.rx = mod_mf.x + w;    p = abut;         int n=contour[abut].back;    if(n==NIL){ // i.e, mod_mf.x==0      contour_root = mod;      contour[mod].back = NIL;    }    else{      contour[n].front = mod;      contour[mod].back = n;    }  }    int min_y = INT_MIN;  int bx,by;  assert(p!=NIL);      for(; p!=NIL ; p=contour[p].front)  {    bx = modules_info[p].rx;    by = modules_info[p].ry;    min_y = max(min_y, by);          if(bx >= mod_mf.rx){ 	// update contour      mod_mf.y = min_y;      mod_mf.ry = mod_mf.y + h;      if(bx > mod_mf.rx){        contour[mod].front = p;        contour[p].back = mod;      }else{ 			// bx==mod_mf.rx        int n= contour[p].front;        contour[mod].front = n;        if(n!=NIL)          contour[n].back = mod;      }      break;         }  }  if(p==NIL){    mod_mf.y  = (min_y==INT_MIN? 0 : min_y);    mod_mf.ry = mod_mf.y + h;    contour[mod].front = NIL;  }}//---------------------------------------------------------------------------//   Manipulate B*Tree auxilary procedure//---------------------------------------------------------------------------void B_Tree::wire_nodes(int parent,int child,DIR edge){  assert(parent!=NIL);  (edge==LEFT? nodes[parent].left: nodes[parent].right) = child;  if(child!=NIL) nodes[child].parent = nodes[parent].id;}int B_Tree::child(int node,DIR d){  assert(node!=NIL);  return (d==LEFT? nodes[node].left:nodes[node].right);  }//---------------------------------------------------------------------------//   Simulated Annealing Temporal Solution//---------------------------------------------------------------------------void B_Tree::get_solution(Solution &sol){  sol.nodes_root = nodes_root;  sol.nodes = nodes;  sol.cost = getCost();}void B_Tree::keep_sol(){  get_solution(last_sol);}void B_Tree::keep_best(){  get_solution(best_sol);}void B_Tree::recover(){  recover(last_sol);  // recover_partial();}void B_Tree::recover_best(){  recover(best_sol);}void B_Tree::recover(Solution &sol){  nodes_root = sol.nodes_root;  nodes = sol.nodes;}void B_Tree::recover_partial(){  if(changed_root != NIL)    nodes_root = changed_root;    for(int i=0; i < changed_nodes.size(); i++){    Node &n = changed_nodes[i];    nodes[n.id] = n;  }}void B_Tree::add_changed_nodes(int n){  if(n==NIL) return;  for(int i=0; i < changed_nodes.size(); i++)    if(changed_nodes[i].id == n)	return;  changed_nodes.push_back(nodes[n]);}//---------------------------------------------------------------------------//   Simulated Annealing Permutation Operations//---------------------------------------------------------------------------void B_Tree::perturb(){  int p,n;  n = rand()%modules_N;//  changed_nodes.clear();//  changed_root = NIL;  if(rotate_rate > rand_01()){//    changed_nodes.push_back(nodes[n]);    nodes[n].rotate = !nodes[n].rotate;    if(rand_bool()) nodes[n].flip = !nodes[n].flip;  }  else{ 	    if(swap_rate >rand_01()){      do{        p = rand()%modules_N;      }while(n==p||nodes[n].parent==p||nodes[p].parent==n);//      changed_nodes.push_back(nodes[p]);//      changed_nodes.push_back(nodes[n]);      swap_node(nodes[p],nodes[n]);    }else{      do{        p = rand()%modules_N;      }while(n==p);//      changed_nodes.push_back(nodes[p]);//      changed_nodes.push_back(nodes[n]);      delete_node(nodes[n]);      insert_node(nodes[p],nodes[n]);    }  }}void B_Tree::swap_node(Node &n1, Node &n2){  if(n1.left!=NIL){      //add_changed_nodes(n1.left);    nodes[n1.left].parent  = n2.id;  }  if(n1.right!=NIL){    //add_changed_nodes(n1.right);    nodes[n1.right].parent = n2.id;    }  if(n2.left!=NIL){    //add_changed_nodes(n2.left);    nodes[n2.left].parent  = n1.id;  }  if(n2.right!=NIL){    //add_changed_nodes(n2.right);    nodes[n2.right].parent = n1.id;    }  if(n1.parent != NIL){    //add_changed_nodes(n1.parent);    if(nodes[n1.parent].left==n1.id)       nodes[n1.parent].left  = n2.id;    else       nodes[n1.parent].right = n2.id;   }else{    changed_root = n1.id;    nodes_root = n2.id;  }  if(n2.parent != NIL){    //add_changed_nodes(n2.parent);    if(nodes[n2.parent].left==n2.id)       nodes[n2.parent].left  = n1.id;    else       nodes[n2.parent].right = n1.id;   }else{//    changed_root = n2.id;    nodes_root = n1.id;  }  swap(n1.left,n2.left);  swap(n1.right,n2.right);  swap(n1.parent,n2.parent);}void B_Tree::insert_node(Node &parent, Node &node){  node.parent = parent.id;  bool edge = rand_bool();  if(edge){    //add_changed_nodes(parent.left);    node.left  = parent.left;    node.right = NIL;    if(parent.left!=NIL)      nodes[parent.left].parent = node.id;    parent.left = node.id;  }else{    //add_changed_nodes(parent.right);    node.left  = NIL;    node.right = parent.right;    if(parent.right!=NIL)      nodes[parent.right].parent = node.id;        parent.right = node.id;  }}void B_Tree::delete_node(Node &node){  int child    = NIL;	// pull which child  int subchild = NIL;   // child's subtree  int subparent= NIL;   if(!node.isleaf()){    bool left= rand_bool();			// choose a child to pull up    if(node.left ==NIL) left=false;    if(node.right==NIL) left=true;    //add_changed_nodes(node.left);    //add_changed_nodes(node.right);    if(left){      child = node.left;			// child will never be NIL      if(node.right!=NIL){        subchild  = nodes[child].right;        subparent = node.right;        nodes[node.right].parent = child;         nodes[child].right = node.right;	// abut with node's another child      }    }    else{      child = node.right;      if(node.left!=NIL){        subchild  = nodes[child].left;        subparent = node.left;	nodes[node.left].parent = child;        nodes[child].left = node.left;      }    }    //add_changed_nodes(subchild);    nodes[child].parent = node.parent;  }  if(node.parent == NIL){			// root//    changed_root = nodes_root;    nodes_root = child;  }else{					// let parent connect to child    //add_changed_nodes(node.parent);    if(node.id == nodes[node.parent].left)      nodes[node.parent].left  = child;    else      nodes[node.parent].right = child;  }  // place subtree  if(subchild != NIL){    Node &sc = nodes[subchild];    assert(subparent != NIL);    while(1){      Node &p = nodes[subparent];      if(p.left==NIL || p.right==NIL){        //add_changed_nodes(p.id);	sc.parent = p.id;        if(p.left==NIL) p.left = sc.id;        else p.right = sc.id;        break;      }else{	subparent = (rand_bool() ? p.left : p.right);      }    }  }}bool B_Tree::delete_node2(Node &node,DIR pull){  DIR npull = !pull;   int p = node.parent;  int n= node.id;  int c= child(n,pull);  int cn=child(n,npull);  assert(n!= nodes_root); // not root;  DIR p2c = (nodes[p].left==n ? LEFT:RIGHT);  if(c==NIL){    wire_nodes(p,cn,p2c);    return (cn!=NIL);   // folding  }else{    wire_nodes(p,c,p2c);  }  while(c!=NIL){    int k=child(c,npull);    wire_nodes(c,cn ,npull);    cn= k;    n= c;    c= child(c,pull);  }  if(cn != NIL){    wire_nodes(n,cn,pull);    return true;  }else     return false;}/*   Insert node into parent's left or right subtree according by "edge".   Push node into parent's subtree in  "push" direction.   if "fold" is true, then fold the leaf.   (for the boundary condition of "delete" operation)   delete <==> insert are permutating operations that can be recoved.*/void B_Tree::insert_node2(Node &parent,Node &node,                        DIR edge=LEFT,DIR push=LEFT,bool fold=false){  DIR npush = !push;  int p= parent.id;  int n= node.id;  int c= child(p,edge);  wire_nodes(p,n,edge);  wire_nodes(n,c,push);      while(c!=NIL){    wire_nodes(n,child(c,npush) ,npush);    n= c;    c= child(c,push);  }  wire_nodes(n,NIL,npush);  if(fold){    wire_nodes(nodes[n].parent,NIL,push);    wire_nodes(nodes[n].parent,n,npush);   }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大尺度电影在线| 亚洲18色成人| 爽好多水快深点欧美视频| 国产精品一区一区三区| 欧美日韩国产小视频| 国产精品人人做人人爽人人添| 日韩精品三区四区| 91视视频在线观看入口直接观看www | 自拍偷自拍亚洲精品播放| 蜜臀av一区二区三区| 色呦呦网站一区| 国产色一区二区| 麻豆精品国产传媒mv男同| 91久久精品午夜一区二区| 中文字幕第一区综合| 激情伊人五月天久久综合| 欧美视频一二三区| 一区二区三区日韩在线观看| 国产成人av福利| 精品国产乱码久久久久久久久| 亚洲二区视频在线| 在线观看日韩精品| 亚洲精品免费播放| 色综合天天天天做夜夜夜夜做| 日本一区二区三区在线观看| 极品瑜伽女神91| 欧美一卡二卡在线观看| 亚洲成人精品一区| 欧美日韩在线播放三区四区| 亚洲激情在线播放| 欧美亚洲日本国产| 亚洲一二三四区不卡| 99re在线视频这里只有精品| 国产精品久久毛片a| 成人av综合一区| 中文字幕亚洲在| 91麻豆产精品久久久久久| 亚洲人成网站影音先锋播放| 99在线视频精品| 亚洲乱码国产乱码精品精小说| 91免费视频观看| 亚洲综合久久久久| 欧美日本韩国一区二区三区视频| 午夜在线电影亚洲一区| 欧美一区二区三区电影| 久久精品久久99精品久久| 精品捆绑美女sm三区| 国产精品亚洲第一| 亚洲视频资源在线| 欧美日韩一卡二卡| 久久精品国产久精国产| 国产日韩精品视频一区| av欧美精品.com| 亚洲成av人片一区二区梦乃 | 日韩福利电影在线| 精品日韩av一区二区| 国产激情91久久精品导航 | 色婷婷综合久久久| 天堂蜜桃91精品| 久久久一区二区三区| a亚洲天堂av| 午夜伦欧美伦电影理论片| 精品入口麻豆88视频| 波多野结衣欧美| 亚洲1区2区3区4区| 欧美激情一区二区| 欧美日韩精品福利| 国产精品系列在线播放| 亚洲自拍偷拍欧美| 久久综合久久久久88| 色视频成人在线观看免| 麻豆精品视频在线观看免费| 国产精品高潮久久久久无| 日韩一区二区不卡| va亚洲va日韩不卡在线观看| 日韩av一区二区三区四区| 欧美国产精品v| 欧美人牲a欧美精品| 成人精品视频一区二区三区尤物| 亚洲成人动漫在线观看| 久久久久久久久久久久久女国产乱| 一本久久a久久免费精品不卡| 蜜臀久久99精品久久久久久9 | 日产欧产美韩系列久久99| 久久久精品tv| 91精品欧美一区二区三区综合在 | 午夜视频在线观看一区二区三区 | 国产日韩欧美综合在线| 欧美日韩精品电影| 色偷偷久久人人79超碰人人澡 | 欧美日韩一区 二区 三区 久久精品 | 免费久久99精品国产| 亚洲欧美另类久久久精品2019| 精品日韩一区二区三区| 欧美日韩美女一区二区| 成人av免费观看| 国产乱人伦偷精品视频不卡| 日韩 欧美一区二区三区| 亚洲一区二区在线观看视频| 亚洲欧洲精品一区二区精品久久久| 日韩免费一区二区| 在线播放中文字幕一区| 欧美亚洲禁片免费| 色诱视频网站一区| 国产**成人网毛片九色| 国产在线观看一区二区| 蜜臀av国产精品久久久久| 亚洲成在人线免费| 一区二区三区色| 亚洲免费观看视频| 亚洲精品国久久99热| ...av二区三区久久精品| 国产精品午夜在线| 欧美国产精品一区二区| 国产欧美日韩视频在线观看| 2欧美一区二区三区在线观看视频| 69久久夜色精品国产69蝌蚪网| 欧美视频一区二区三区| 欧美日韩视频不卡| 欧美一区二区三区系列电影| 在线电影欧美成精品| 欧美伦理视频网站| 91精品国产品国语在线不卡| 欧美日韩欧美一区二区| 7777精品伊人久久久大香线蕉| 777a∨成人精品桃花网| 欧美刺激午夜性久久久久久久| 欧美成人艳星乳罩| 久久久久久久综合日本| 国产精品毛片无遮挡高清| 中文字幕一区二区三区视频| 亚洲欧美日韩久久精品| 亚洲午夜精品17c| 日日摸夜夜添夜夜添亚洲女人| 免费观看日韩av| 国产+成+人+亚洲欧洲自线| 色中色一区二区| 欧美一级日韩免费不卡| 精品国产乱码久久久久久老虎| 欧美国产1区2区| 亚洲综合免费观看高清完整版| 青青青爽久久午夜综合久久午夜| 久久99深爱久久99精品| 成人小视频在线观看| 91福利资源站| 精品人在线二区三区| 国产亚洲精品7777| 亚洲一区二区三区中文字幕在线| 蜜桃视频在线观看一区二区| 国产精品系列在线播放| 欧美性一区二区| ww久久中文字幕| 亚洲欧美另类小说| 韩国三级在线一区| 91精品福利视频| 精品乱码亚洲一区二区不卡| 亚洲女爱视频在线| 久久99九九99精品| 欧美亚洲一区二区三区四区| 久久免费国产精品| 亚瑟在线精品视频| 成人一区在线观看| 7777精品久久久大香线蕉| 国产精品色在线观看| 日本视频免费一区| 色久综合一二码| 久久久久国产一区二区三区四区| 亚洲国产精品久久人人爱蜜臀| 国产成人精品网址| 亚洲视频在线观看一区| 久久国产精品第一页| 色综合久久天天综合网| 国产日韩精品一区| 久久精品国产99国产| 欧美日韩一级片在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 免费av成人在线| 欧亚洲嫩模精品一区三区| 国产人成一区二区三区影院| 日日摸夜夜添夜夜添国产精品| 92精品国产成人观看免费| 久久免费午夜影院| 久草精品在线观看| 欧美精品日日鲁夜夜添| 亚洲欧美一区二区三区久本道91| 韩日欧美一区二区三区| 欧美久久久久免费| 亚洲国产日韩a在线播放| 97精品久久久午夜一区二区三区 | 亚洲欧美激情小说另类| 国产精品正在播放| 久久久亚洲精品石原莉奈 | 日韩二区三区四区| 欧美日本一区二区在线观看| 一区二区三区在线看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产午夜精品一区二区| 国产一区二区剧情av在线| 日韩欧美在线观看一区二区三区| 亚洲福利一区二区三区|