Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

BTreeFromSoftPacking Class Reference

#include <btreefromsstree.h>

Inheritance diagram for BTreeFromSoftPacking:

Inheritance graph
[legend]
Collaboration diagram for BTreeFromSoftPacking:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MoveType { SWAP, ROTATE, MOVE }

Public Member Functions

 BTreeFromSoftPacking (const HardBlockInfoType &nBlockinfo, const SoftPacking &spk)
 BTreeFromSoftPacking (const HardBlockInfoType &nBlockinfo, const SoftPacking &spk, double nTolerance)
const vector< double > & xloc () const
double xloc (int index) const
const vector< double > & yloc () const
double yloc (int index) const
double width (int index) const
double height (int index) const
double blockArea () const
double totalArea () const
double totalWidth () const
double totalHeight () const
void setTree (const vector< BTreeNode > &ntree)
void evaluate (const vector< BTreeNode > &ntree)
void evaluate (const vector< int > &tree_bits, const vector< int > &perm, const vector< int > &orient)
void swap (int indexOne, int indexTwo)
void rotate (int index, int newOrient)
void move (int index, int target, bool leftChild)
void save_bbb (const string &filename) const

Static Public Member Functions

void bits2tree (const vector< int > &tree_bits, const vector< int > &perm, const vector< int > &orient, vector< BTreeNode > &ntree)
void clean_tree (vector< BTreeNode > &otree)
void clean_contour (vector< ContourNode > &oContour)

Public Attributes

const vector< BTreeNode > & tree
const vector< ContourNode > & contour
const int NUM_BLOCKS

Static Public Attributes

const int UNDEFINED = Dimension::UNDEFINED

Protected Member Functions

void EvaluateTree (const SoftPacking &spk)
void contour_evaluate ()
void contour_add_block (int treePtr)
void swap_parent_child (int parent, bool isLeft)
void remove_left_up_right_down (int index)

Protected Attributes

vector< SymbolicNodeTypein_buffer
const HardBlockInfoTypein_blockinfo
vector< BTreeNode > in_tree
vector< ContourNode > in_contour
vector< double > in_xloc
vector< double > in_yloc
vector< double > in_width
vector< double > in_height
double in_blockArea
double in_totalArea
double in_totalWidth
double in_totalHeight
const double TOLERANCE

Member Enumeration Documentation

enum BTree::MoveType [inherited]
 

Enumeration values:
SWAP 
ROTATE 
MOVE 

Definition at line 83 of file btree.h.

Referenced by BTreeAreaWireAnnealer::get_move(), and BTreeAreaWireAnnealer::makeMove().

00083 {SWAP, ROTATE, MOVE};


Constructor & Destructor Documentation

BTreeFromSoftPacking::BTreeFromSoftPacking const HardBlockInfoType nBlockinfo,
const SoftPacking &  spk
 

Definition at line 67 of file btreefromsstree.cxx.

References BTree::evaluate(), EvaluateTree(), and BTree::in_tree.

00069    : BTree(nBlockinfo)
00070 {
00071    EvaluateTree(spk);
00072    evaluate(in_tree);
00073 }

Here is the call graph for this function:

BTreeFromSoftPacking::BTreeFromSoftPacking const HardBlockInfoType nBlockinfo,
const SoftPacking &  spk,
double  nTolerance
 

Definition at line 75 of file btreefromsstree.cxx.

References BTree::evaluate(), EvaluateTree(), and BTree::in_tree.

00078    : BTree(nBlockinfo, nTolerance)
00079 {
00080    EvaluateTree(spk);
00081    evaluate(in_tree);
00082 }

Here is the call graph for this function:


Member Function Documentation

void BTree::bits2tree const vector< int > &  tree_bits,
const vector< int > &  perm,
const vector< int > &  orient,
vector< BTreeNode > &  ntree
[static, inherited]
 

Definition at line 197 of file btree.cxx.

References BTree::clean_tree(), and BTree::UNDEFINED.

Referenced by BTree::evaluate().

00201 {
00202    int perm_size = perm.size();
00203    ntree.resize(perm_size+2);
00204    clean_tree(ntree);
00205 
00206    int treePtr = perm_size;
00207    int bitsPtr = 0;
00208 
00209    int lastAct = -1;
00210    for (int i = 0; i < perm_size; i++)
00211    {
00212       int currAct = tree_bits[bitsPtr];
00213       while (currAct == 1)
00214       {
00215          // move up a level/sibling
00216          if (lastAct == 1)
00217             treePtr = ntree[treePtr].parent;
00218 
00219          // move among siblings
00220          while (ntree[treePtr].right != UNDEFINED)
00221             treePtr = ntree[treePtr].parent;
00222          bitsPtr++;
00223          lastAct = 1;
00224          currAct = tree_bits[bitsPtr];
00225       }
00226 
00227       if (lastAct != 1)
00228          ntree[treePtr].left = perm[i];
00229       else // lastAct == 1
00230          ntree[treePtr].right = perm[i];
00231       
00232       ntree[perm[i]].parent = treePtr;
00233       ntree[perm[i]].block_index = perm[i];
00234       ntree[perm[i]].orient = orient[i];
00235 
00236       treePtr = perm[i];
00237       lastAct = 0;
00238       bitsPtr++;
00239    }         
00240 }

Here is the call graph for this function:

double BTree::blockArea  )  const [inline, inherited]
 

Definition at line 217 of file btree.h.

References BTree::in_blockArea.

Referenced by BTreeCompactSlice(), OutputBTree(), BTreeAreaWireAnnealer::packOneBlock(), and BTreeCompactor::slimAssign().

00218 {  return in_blockArea; }

void BTree::clean_contour vector< ContourNode > &  oContour  )  [inline, static, inherited]
 

Definition at line 248 of file btree.h.

References basepacking_h::Dimension::INFTY, and BTree::UNDEFINED.

Referenced by BTreeCompactor::build_orth_tree(), and BTree::contour_evaluate().

00249 {
00250    int vec_size = oContour.size();
00251    int Ledge = vec_size-2;
00252    int Bedge = vec_size-1;
00253 
00254    oContour[Ledge].next = Bedge;
00255    oContour[Ledge].prev = UNDEFINED;
00256    oContour[Ledge].begin = 0;
00257    oContour[Ledge].end = 0;
00258    oContour[Ledge].CTL = basepacking_h::Dimension::INFTY;
00259 
00260    oContour[Bedge].next = UNDEFINED;
00261    oContour[Bedge].prev = Ledge;
00262    oContour[Bedge].begin = 0;
00263    oContour[Bedge].end = basepacking_h::Dimension::INFTY;
00264    oContour[Bedge].CTL = 0;
00265 }

void BTree::clean_tree vector< BTreeNode > &  otree  )  [inline, static, inherited]
 

Definition at line 232 of file btree.h.

References BTree::UNDEFINED.

Referenced by BTree::bits2tree(), BTreeSlackEval::BTreeSlackEval(), BTreeCompactor::build_orth_tree(), and BTreeSlackEval::reverse_tree().

00233 {
00234    int vec_size = otree.size();
00235    for (int i = 0; i < vec_size; i++)
00236    {
00237       otree[i].parent = UNDEFINED;
00238       otree[i].left = UNDEFINED;
00239       otree[i].right = UNDEFINED;
00240    }
00241    otree[vec_size-2].block_index = vec_size-2;
00242    otree[vec_size-1].block_index = vec_size-1;
00243 
00244    otree[vec_size-2].orient = UNDEFINED;
00245    otree[vec_size-1].orient = UNDEFINED;
00246 }

void BTree::contour_add_block int  treePtr  )  [protected, inherited]
 

Definition at line 484 of file btree.cxx.

References BTree::in_blockinfo, BTree::in_contour, BTree::in_height, BTree::in_tree, BTree::in_width, BTree::in_xloc, BTree::in_yloc, BTree::TOLERANCE, and BTree::UNDEFINED.

Referenced by BTree::contour_evaluate().

00485 {
00486    int tree_parent = in_tree[tree_ptr].parent;
00487    double maxCTL = -1;
00488    int contour_ptr = UNDEFINED;
00489    int contour_prev = UNDEFINED;
00490    
00491    if (tree_ptr == in_tree[in_tree[tree_ptr].parent].left)
00492    {
00493       in_contour[tree_ptr].begin = in_contour[tree_parent].end;
00494       contour_ptr = in_contour[tree_parent].next;
00495    }
00496    else
00497    {
00498       in_contour[tree_ptr].begin = in_contour[tree_parent].begin;
00499       contour_ptr = tree_parent;
00500    }
00501    contour_prev = in_contour[contour_ptr].prev; // begins of cPtr/tPtr match
00502    maxCTL = in_contour[contour_ptr].CTL;
00503 
00504    int block = in_tree[tree_ptr].block_index;
00505    int theta = in_tree[tree_ptr].orient;
00506    in_contour[tree_ptr].end =
00507       in_contour[tree_ptr].begin + in_blockinfo[block].width[theta];
00508 
00509    while (in_contour[contour_ptr].end <=
00510           in_contour[tree_ptr].end + TOLERANCE)
00511    {
00512       maxCTL = max(maxCTL, in_contour[contour_ptr].CTL);
00513       contour_ptr = in_contour[contour_ptr].next;
00514    }
00515 
00516    if (in_contour[contour_ptr].begin + TOLERANCE < in_contour[tree_ptr].end)
00517       maxCTL = max(maxCTL, in_contour[contour_ptr].CTL);
00518    
00519    in_xloc[tree_ptr] = in_contour[tree_ptr].begin;
00520    in_yloc[tree_ptr] = maxCTL;
00521    in_width[tree_ptr] = in_blockinfo[block].width[theta];
00522    in_height[tree_ptr] = in_blockinfo[block].height[theta];
00523       
00524    in_contour[tree_ptr].CTL =  maxCTL + in_blockinfo[block].height[theta];
00525    in_contour[tree_ptr].next = contour_ptr;
00526    in_contour[contour_ptr].prev = tree_ptr;
00527    in_contour[contour_ptr].begin = in_contour[tree_ptr].end;
00528 
00529    in_contour[tree_ptr].prev = contour_prev;
00530    in_contour[contour_prev].next = tree_ptr;
00531    in_contour[tree_ptr].begin = in_contour[contour_prev].end;
00532 }

void BTree::contour_evaluate  )  [protected, inherited]
 

Definition at line 438 of file btree.cxx.

References BTree::clean_contour(), BTree::contour_add_block(), BTree::in_contour, BTree::in_totalArea, BTree::in_totalHeight, BTree::in_totalWidth, BTree::in_tree, BTree::NUM_BLOCKS, and BTree::UNDEFINED.

Referenced by BTree::evaluate(), BTree::move(), BTree::rotate(), and BTree::swap().

00439 {
00440    clean_contour(in_contour);
00441    
00442    int tree_prev = NUM_BLOCKS;
00443    int tree_curr = in_tree[NUM_BLOCKS].left; // start with first block
00444    while (tree_curr != NUM_BLOCKS) // until reach the root again
00445    {
00446 //      cout << "tree_curr: " << tree_curr << endl;
00447       if (tree_prev == in_tree[tree_curr].parent)
00448       {
00449          contour_add_block(tree_curr);
00450          tree_prev = tree_curr;
00451          if (in_tree[tree_curr].left != UNDEFINED)
00452             tree_curr = in_tree[tree_curr].left;
00453          else if (in_tree[tree_curr].right != UNDEFINED)
00454             tree_curr = in_tree[tree_curr].right;
00455          else
00456             tree_curr = in_tree[tree_curr].parent;
00457       }
00458       else if (tree_prev == in_tree[tree_curr].left)
00459       {
00460          tree_prev = tree_curr;
00461          if (in_tree[tree_curr].right != UNDEFINED)
00462             tree_curr = in_tree[tree_curr].right;
00463          else
00464             tree_curr = in_tree[tree_curr].parent;
00465       }
00466       else
00467       {
00468          tree_prev = tree_curr;
00469          tree_curr = in_tree[tree_curr].parent;
00470       }
00471    }
00472    in_totalWidth = in_contour[NUM_BLOCKS+1].begin;
00473 
00474    int contour_ptr = in_contour[NUM_BLOCKS].next;
00475    in_totalHeight = 0;
00476    while (contour_ptr != NUM_BLOCKS+1)
00477    {
00478       in_totalHeight = max(in_totalHeight, in_contour[contour_ptr].CTL);
00479       contour_ptr = in_contour[contour_ptr].next;
00480    }
00481    in_totalArea = in_totalWidth * in_totalHeight;
00482 }

Here is the call graph for this function:

void BTree::evaluate const vector< int > &  tree_bits,
const vector< int > &  perm,
const vector< int > &  orient
[inherited]
 

Definition at line 182 of file btree.cxx.

References BTree::bits2tree(), BTree::contour_evaluate(), BTree::in_tree, and BTree::NUM_BLOCKS.

00185 {
00186    if (int(perm.size()) != NUM_BLOCKS)
00187    {
00188       cout << "ERROR: the permutation length doesn't match with "
00189            << "size of the tree." << endl;
00190       exit(1);
00191    }
00192    bits2tree(tree_bits, perm, orient, in_tree);
00193 //   OutputBTree(cout, in_tree);
00194    contour_evaluate();
00195 }

Here is the call graph for this function:

void BTree::evaluate const vector< BTreeNode > &  ntree  )  [inherited]
 

Definition at line 170 of file btree.cxx.

References BTree::contour_evaluate(), and BTree::in_tree.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeFromSoftPacking(), BTreeSlackEval::evaluateXSlacks(), BTreeSlackEval::evaluateYSlacks(), BTreeAreaWireAnnealer::GenerateRandomSoln(), BTreeAreaWireAnnealer::packSoftBlocks(), and BTreeAreaWireAnnealer::takePlfromDB().

00171 {
00172    if (ntree.size() != in_tree.size())
00173    {
00174       cout << "ERROR: size of btree's doesn't match." << endl;
00175       exit(1);
00176    }
00177 
00178    in_tree = ntree;
00179    contour_evaluate();
00180 }  

Here is the call graph for this function:

void BTreeFromSoftPacking::EvaluateTree const SoftPacking &  spk  )  [protected]
 

Definition at line 84 of file btreefromsstree.cxx.

References BTreeFromSoftPacking::SymbolicNodeType::BL_block, in_buffer, BTree::in_tree, BTreeFromSoftPacking::SymbolicNodeType::R_block, BTreeFromSoftPacking::SymbolicNodeType::TL_block, BTree::UNDEFINED, and BTreeFromSoftPacking::SymbolicNodeType::width.

Referenced by BTreeFromSoftPacking().

00085 {
00086    int expr_size = spk.expression.size();
00087    int blocknum = spk.xloc.size();
00088    for (int i = 0; i < expr_size; i++)
00089    {
00090       int sign = spk.expression[i];
00091       if (SoftSTree::isOperand(sign))
00092       {
00093          in_buffer.push_back(SymbolicNodeType(sign, sign, sign, sign,
00094                                               spk.width[sign]));
00095          in_tree[sign].parent = blocknum;
00096          in_tree[sign].left = UNDEFINED;
00097          in_tree[sign].right = UNDEFINED;
00098          in_tree[sign].block_index = sign;
00099          in_tree[sign].orient = 0;
00100       }
00101       else
00102       {
00103          SymbolicNodeType TR_cluster(in_buffer.back());
00104          in_buffer.pop_back();
00105          
00106          SymbolicNodeType BL_cluster(in_buffer.back());
00107          in_buffer.pop_back();
00108 
00109          int new_BL_block = BL_cluster.BL_block;
00110          int new_TL_block = UNDEFINED;
00111          int new_R_block = UNDEFINED;
00112          double new_width = UNDEFINED;
00113          if (sign == SoftSTree::STAR)
00114          {
00115             new_TL_block = BL_cluster.TL_block;
00116             new_R_block = TR_cluster.R_block;
00117             new_width = BL_cluster.width + TR_cluster.width;
00118 
00119             in_tree[TR_cluster.BL_block].parent = BL_cluster.R_block;
00120             in_tree[BL_cluster.R_block].left = TR_cluster.BL_block;
00121          }
00122          else if (sign == SoftSTree::PLUS)
00123          {            
00124             new_TL_block = TR_cluster.TL_block;
00125             new_R_block = (BL_cluster.width > TR_cluster.width)?
00126                BL_cluster.R_block : TR_cluster.R_block;
00127             new_width = max(BL_cluster.width, TR_cluster.width);
00128  
00129             in_tree[TR_cluster.BL_block].parent = BL_cluster.TL_block;
00130             in_tree[BL_cluster.TL_block].right = TR_cluster.BL_block;
00131          }
00132          else
00133          {
00134             cout << "ERROR in BTreeFromSoftPacking::EvaluateTree()" << endl;
00135             exit(1);
00136          }
00137          in_buffer.push_back(SymbolicNodeType(sign,
00138                                               new_BL_block, new_TL_block,
00139                                               new_R_block, new_width));
00140       }
00141    }
00142    in_tree[blocknum].left = spk.expression[0];
00143 }

double BTree::height int  index  )  const [inline, inherited]
 

Definition at line 214 of file btree.h.

References BTree::in_height.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeAreaWireAnnealer::DBfromSoln(), BTreeSlackEval::evaluateYSlacks(), BTreeAreaWireAnnealer::getSoftBlIndex(), BTreeAreaWireAnnealer::getSoftBlNewDimensions(), BTreeOrientedPacking::operator=(), OutputBTree(), BTreeAreaWireAnnealer::packOneBlock(), and BTreeAreaWireAnnealer::packSoftBlocks().

00215 {  return in_height[index]; }

void BTree::move int  index,
int  target,
bool  leftChild
[inherited]
 

Definition at line 355 of file btree.cxx.

References BTree::contour_evaluate(), BTree::in_tree, BTree::remove_left_up_right_down(), and BTree::UNDEFINED.

Referenced by BTreeAreaWireAnnealer::makeARWLMove(), BTreeAreaWireAnnealer::makeHPWLMove(), BTreeAreaWireAnnealer::makeMoveSlacksCore(), and BTreeAreaWireAnnealer::perform_move().

00358 {
00359    int index_parent = in_tree[index].parent;
00360    int index_left = in_tree[index].left;
00361    int index_right = in_tree[index].right;
00362 
00363    // remove "index" from the tree
00364    if ((index_left != UNDEFINED) && (index_right != UNDEFINED))
00365       remove_left_up_right_down(index);
00366    else if (index_left != UNDEFINED)
00367    {
00368       in_tree[index_left].parent = index_parent;
00369       if (index == in_tree[index_parent].left)
00370          in_tree[index_parent].left = index_left;
00371       else
00372          in_tree[index_parent].right = index_left;
00373    }
00374    else if (index_right != UNDEFINED)
00375    {
00376       in_tree[index_right].parent = index_parent;
00377       if (index == in_tree[index_parent].left)
00378          in_tree[index_parent].left = index_right;
00379       else
00380          in_tree[index_parent].right = index_right;
00381    }
00382    else
00383    {
00384       if (index == in_tree[index_parent].left)
00385          in_tree[index_parent].left = UNDEFINED;
00386       else
00387          in_tree[index_parent].right = UNDEFINED;
00388    }
00389 
00390    int target_left = in_tree[target].left;
00391    int target_right = in_tree[target].right;
00392    
00393    // add "index" to the required location
00394    if (leftChild)
00395    {
00396       in_tree[target].left = index;
00397       if (target_left != UNDEFINED)
00398          in_tree[target_left].parent = index;
00399          
00400       in_tree[index].parent = target;
00401       in_tree[index].left = target_left;
00402       in_tree[index].right = UNDEFINED;
00403    }
00404    else
00405    {
00406       in_tree[target].right = index;
00407       if (target_right != UNDEFINED)
00408          in_tree[target_right].parent = index;
00409 
00410       in_tree[index].parent = target;
00411       in_tree[index].left = UNDEFINED;
00412       in_tree[index].right = target_right;
00413    }
00414    
00415    contour_evaluate();
00416 }

Here is the call graph for this function:

void BTree::remove_left_up_right_down int  index  )  [protected, inherited]
 

Definition at line 418 of file btree.cxx.

References BTree::in_tree, and BTree::UNDEFINED.

Referenced by BTree::move().

00419 {
00420    int index_parent = in_tree[index].parent;
00421    int index_left = in_tree[index].left;
00422    int index_right = in_tree[index].right;
00423 
00424    in_tree[index_left].parent = index_parent;
00425    if (index == in_tree[index_parent].left)
00426       in_tree[index_parent].left = index_left;
00427    else
00428       in_tree[index_parent].right = index_left;
00429 
00430    int ptr = index_left;
00431    while (in_tree[ptr].right != UNDEFINED)
00432       ptr = in_tree[ptr].right;
00433 
00434    in_tree[ptr].right = index_right;
00435    in_tree[index_right].parent = ptr;
00436 }

void BTree::rotate int  index,
int  newOrient
[inline, inherited]
 

Definition at line 267 of file btree.h.

References BTree::contour_evaluate(), and BTree::in_tree.

Referenced by BTreeAreaWireAnnealer::packOneBlock(), and BTreeAreaWireAnnealer::perform_rotate().

00269 {
00270    in_tree[index].orient = newOrient;
00271    contour_evaluate();
00272 }

Here is the call graph for this function:

void BTree::save_bbb const string &  filename  )  const [inherited]
 

Definition at line 534 of file btree.cxx.

References BTree::in_height, BTree::in_totalHeight, BTree::in_totalWidth, BTree::in_width, BTree::in_xloc, BTree::in_yloc, and BTree::NUM_BLOCKS.

Referenced by DebugBTreeAnnealerFromDB().

00535 {
00536    ofstream outfile;
00537    outfile.open(filename.c_str());
00538    if (!outfile.good())
00539    {
00540       cout << "ERROR: cannot open file" << filename << endl;
00541       exit(1);
00542    }
00543 
00544    outfile.setf(ios::fixed);
00545    outfile.precision(3);
00546 
00547    outfile << in_totalWidth << endl;
00548    outfile << in_totalHeight << endl;
00549    outfile << NUM_BLOCKS << endl;
00550    for (int i = 0; i < NUM_BLOCKS; i++)
00551       outfile << in_width[i] << " " << in_height[i] << endl;
00552    outfile << endl;
00553 
00554    for (int i = 0; i < NUM_BLOCKS; i++)
00555       outfile << in_xloc[i] << " " << in_yloc[i] << endl;
00556    outfile << endl;
00557 }

void BTree::setTree const vector< BTreeNode > &  ntree  )  [inline, inherited]
 

Definition at line 229 of file btree.h.

References BTree::in_tree.

Referenced by BTreeAreaWireAnnealer::perform_move(), and BTreeAreaWireAnnealer::perform_rotate().

00230 {   in_tree = ntree; }

void BTree::swap int  indexOne,
int  indexTwo
[inherited]
 

Definition at line 242 of file btree.cxx.

References BTree::contour_evaluate(), BTree::in_tree, BTree::swap_parent_child(), and BTree::UNDEFINED.

Referenced by BTreeAreaWireAnnealer::perform_swap().

00244 {
00245    int indexOne_left = in_tree[indexOne].left;
00246    int indexOne_right = in_tree[indexOne].right;
00247    int indexOne_parent = in_tree[indexOne].parent;
00248 
00249    int indexTwo_left = in_tree[indexTwo].left;
00250    int indexTwo_right = in_tree[indexTwo].right;
00251    int indexTwo_parent = in_tree[indexTwo].parent;
00252 
00253    if (indexOne == indexTwo_parent)
00254       swap_parent_child(indexOne, (indexTwo == in_tree[indexOne].left));
00255    else if (indexTwo == indexOne_parent)
00256       swap_parent_child(indexTwo, (indexOne == in_tree[indexTwo].left));
00257    else
00258    {
00259       // update around indexOne
00260       in_tree[indexOne].parent = indexTwo_parent;
00261       in_tree[indexOne].left = indexTwo_left;
00262       in_tree[indexOne].right = indexTwo_right;
00263 
00264       if (indexOne == in_tree[indexOne_parent].left)
00265          in_tree[indexOne_parent].left = indexTwo;
00266       else
00267          in_tree[indexOne_parent].right = indexTwo;
00268 
00269       if (indexOne_left != UNDEFINED)
00270          in_tree[indexOne_left].parent = indexTwo;
00271       
00272       if (indexOne_right != UNDEFINED)
00273          in_tree[indexOne_right].parent = indexTwo;
00274       
00275       // update around indexTwo
00276       in_tree[indexTwo].parent = indexOne_parent;
00277       in_tree[indexTwo].left = indexOne_left;
00278       in_tree[indexTwo].right = indexOne_right;
00279       
00280       if (indexTwo == in_tree[indexTwo_parent].left)
00281          in_tree[indexTwo_parent].left = indexOne;
00282       else
00283          in_tree[indexTwo_parent].right = indexOne;
00284       
00285       if (indexTwo_left != UNDEFINED)
00286          in_tree[indexTwo_left].parent = indexOne;
00287       
00288       if (indexTwo_right != UNDEFINED)
00289          in_tree[indexTwo_right].parent = indexOne;
00290    }
00291    contour_evaluate();   
00292 }

Here is the call graph for this function:

void BTree::swap_parent_child int  parent,
bool  isLeft
[protected, inherited]
 

Definition at line 294 of file btree.cxx.

References BTree::in_tree, and BTree::UNDEFINED.

Referenced by BTree::swap().

00296 {
00297    int parent_parent = in_tree[parent].parent;
00298    int parent_left = in_tree[parent].left;
00299    int parent_right = in_tree[parent].right;
00300 
00301    int child = (isLeft)? in_tree[parent].left : in_tree[parent].right;
00302    int child_left = in_tree[child].left;
00303    int child_right = in_tree[child].right;
00304 
00305    if (isLeft)
00306    {
00307       in_tree[parent].parent = child;
00308       in_tree[parent].left = child_left;
00309       in_tree[parent].right = child_right;
00310 
00311       if (parent == in_tree[parent_parent].left)
00312          in_tree[parent_parent].left = child;
00313       else
00314          in_tree[parent_parent].right = child;
00315 
00316       if (parent_right != UNDEFINED)
00317          in_tree[parent_right].parent = child;
00318 
00319       in_tree[child].parent = parent_parent;
00320       in_tree[child].left = parent;
00321       in_tree[child].right = parent_right;
00322 
00323       if (child_left != UNDEFINED)
00324          in_tree[child_left].parent = parent;
00325 
00326       if (child_right != UNDEFINED)
00327          in_tree[child_right].parent = parent;
00328    }
00329    else
00330    {
00331       in_tree[parent].parent = child;
00332       in_tree[parent].left = child_left;
00333       in_tree[parent].right = child_right;
00334 
00335       if (parent == in_tree[parent_parent].left)
00336          in_tree[parent_parent].left = child;
00337       else
00338          in_tree[parent_parent].right = child;
00339 
00340       if (parent_left != UNDEFINED)
00341          in_tree[parent_left].parent = child;
00342 
00343       in_tree[child].parent = parent_parent;
00344       in_tree[child].left = parent_left;
00345       in_tree[child].right = parent;
00346 
00347       if (child_left != UNDEFINED)
00348          in_tree[child_left].parent = parent;
00349 
00350       if (child_right != UNDEFINED)
00351          in_tree[child_right].parent = parent;
00352    }
00353 }

double BTree::totalArea  )  const [inline, inherited]
 

Definition at line 220 of file btree.h.

References BTree::in_totalArea.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeCompactSlice(), BTreeAreaWireAnnealer::compactSoln(), BTreeAreaWireAnnealer::go(), OutputBTree(), and BTreeAreaWireAnnealer::packSoftBlocks().

00221 {  return in_totalArea; }

double BTree::totalHeight  )  const [inline, inherited]
 

Definition at line 226 of file btree.h.

References BTree::in_totalHeight.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeCompactSlice(), BTreeAreaWireAnnealer::DBfromSoln(), DebugBTreeAnnealerFromDB(), BTreeSlackEval::evaluateYSlacks(), BTreeAreaWireAnnealer::locateSearchBlocks(), BTreeAreaWireAnnealer::makeARMove(), BTreeAreaWireAnnealer::makeARWLMove(), and OutputBTree().

00227 {  return in_totalHeight; }

double BTree::totalWidth  )  const [inline, inherited]
 

Definition at line 223 of file btree.h.

References BTree::in_totalWidth.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeCompactSlice(), BTreeAreaWireAnnealer::DBfromSoln(), DebugBTreeAnnealerFromDB(), BTreeSlackEval::evaluateXSlacks(), BTreeAreaWireAnnealer::locateSearchBlocks(), BTreeAreaWireAnnealer::makeARMove(), BTreeAreaWireAnnealer::makeARWLMove(), and OutputBTree().

00224 {  return in_totalWidth; }

double BTree::width int  index  )  const [inline, inherited]
 

Definition at line 211 of file btree.h.

References BTree::in_width.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeAreaWireAnnealer::DBfromSoln(), BTreeSlackEval::evaluateXSlacks(), BTreeAreaWireAnnealer::getSoftBlIndex(), BTreeAreaWireAnnealer::getSoftBlNewDimensions(), BTreeOrientedPacking::operator=(), OutputBTree(), BTreeAreaWireAnnealer::packOneBlock(), and BTreeAreaWireAnnealer::packSoftBlocks().

00212 {  return in_width[index]; }

double BTree::xloc int  index  )  const [inline, inherited]
 

Definition at line 205 of file btree.h.

References BTree::in_xloc.

00206 {  return in_xloc[index]; }

const vector< double > & BTree::xloc  )  const [inline, inherited]
 

Definition at line 199 of file btree.h.

References BTree::in_xloc.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeAreaWireAnnealer::DBfromSoln(), BTreeSlackEval::evaluateXSlacks(), BTreeAreaWireAnnealer::locateSearchBlocks(), BTreeOrientedPacking::operator=(), and OutputBTree().

00200 {  return in_xloc; }

double BTree::yloc int  index  )  const [inline, inherited]
 

Definition at line 208 of file btree.h.

References BTree::in_yloc.

00209 {  return in_yloc[index]; }

const vector< double > & BTree::yloc  )  const [inline, inherited]
 

Definition at line 202 of file btree.h.

References BTree::in_yloc.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeAreaWireAnnealer::DBfromSoln(), BTreeSlackEval::evaluateXSlacks(), BTreeSlackEval::evaluateYSlacks(), BTreeAreaWireAnnealer::locateSearchBlocks(), BTreeOrientedPacking::operator=(), and OutputBTree().

00203 {  return in_yloc; }


Member Data Documentation

const vector<ContourNode>& BTree::contour [inherited]
 

Definition at line 56 of file btree.h.

Referenced by OutputBTree().

double BTree::in_blockArea [protected, inherited]
 

Definition at line 128 of file btree.h.

Referenced by BTree::blockArea(), BTree::operator=(), and BTreeCompactor::slimAssign().

const HardBlockInfoType& BTree::in_blockinfo [protected, inherited]
 

Definition at line 118 of file btree.h.

Referenced by BTreeCompactor::build_orth_tree_add_block(), and BTree::contour_add_block().

vector<SymbolicNodeType> BTreeFromSoftPacking::in_buffer [protected]
 

Definition at line 78 of file btreefromsstree.h.

Referenced by EvaluateTree().

vector<ContourNode> BTree::in_contour [protected, inherited]
 

Definition at line 120 of file btree.h.

Referenced by BTree::BTree(), BTreeCompactor::build_orth_tree(), BTreeCompactor::build_orth_tree_add_block(), BTree::contour_add_block(), BTree::contour_evaluate(), and BTree::operator=().

vector<double> BTree::in_height [protected, inherited]
 

Definition at line 126 of file btree.h.

Referenced by BTree::BTree(), BTreeCompactor::build_orth_tree_add_block(), BTree::contour_add_block(), BTree::height(), BTree::operator=(), and BTree::save_bbb().

double BTree::in_totalArea [protected, inherited]
 

Definition at line 129 of file btree.h.

Referenced by BTreeCompactor::build_orth_tree(), BTree::contour_evaluate(), BTree::operator=(), and BTree::totalArea().

double BTree::in_totalHeight [protected, inherited]
 

Definition at line 131 of file btree.h.

Referenced by BTreeCompactor::build_orth_tree(), BTree::contour_evaluate(), BTree::operator=(), BTree::save_bbb(), and BTree::totalHeight().

double BTree::in_totalWidth [protected, inherited]
 

Definition at line 130 of file btree.h.

Referenced by BTreeCompactor::build_orth_tree(), BTree::contour_evaluate(), BTree::operator=(), BTree::save_bbb(), and BTree::totalWidth().

vector<BTreeNode> BTree::in_tree [protected, inherited]
 

Definition at line 119 of file btree.h.

Referenced by BTree::BTree(), BTreeFromSoftPacking(), BTreeCompactor::build_orth_tree(), BTreeCompactor::build_orth_tree_add_block(), BTreeCompactor::compact(), BTree::contour_add_block(), BTree::contour_evaluate(), BTree::evaluate(), EvaluateTree(), BTree::move(), BTree::operator=(), BTree::remove_left_up_right_down(), BTree::rotate(), BTree::setTree(), BTreeCompactor::slimAssign(), BTree::swap(), and BTree::swap_parent_child().

vector<double> BTree::in_width [protected, inherited]
 

Definition at line 125 of file btree.h.

Referenced by BTree::BTree(), BTreeCompactor::build_orth_tree_add_block(), BTree::contour_add_block(), BTree::operator=(), BTree::save_bbb(), and BTree::width().

vector<double> BTree::in_xloc [protected, inherited]
 

Definition at line 123 of file btree.h.

Referenced by BTree::BTree(), BTreeCompactor::build_orth_tree_add_block(), BTreeCompactor::compact(), BTree::contour_add_block(), BTree::operator=(), BTree::save_bbb(), and BTree::xloc().

vector<double> BTree::in_yloc [protected, inherited]
 

Definition at line 124 of file btree.h.

Referenced by BTree::BTree(), BTreeCompactor::build_orth_tree_add_block(), BTreeCompactor::compact(), BTree::contour_add_block(), BTree::operator=(), BTree::save_bbb(), and BTree::yloc().

const int BTree::NUM_BLOCKS [inherited]
 

Definition at line 89 of file btree.h.

Referenced by BTreeAreaWireAnnealer::anneal(), BTree::BTree(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeCompactor::build_orth_tree(), BTreeCompactor::build_orth_tree_add_block(), BTreeCompactor::compact(), BTreeAreaWireAnnealer::constructor_core(), BTree::contour_evaluate(), BTreeAreaWireAnnealer::DBfromSoln(), BTree::evaluate(), BTreeSlackEval::evaluateXSlacks(), BTreeSlackEval::evaluateYSlacks(), BTreeCompactor::fix_orth_tree(), BTreeAreaWireAnnealer::getSoftBlIndex(), BTreeAreaWireAnnealer::go(), BTreeAreaWireAnnealer::locateSearchBlocks(), BTreeAreaWireAnnealer::makeARWLMove(), BTreeAreaWireAnnealer::makeHPWLMove(), BTreeAreaWireAnnealer::makeMoveSlacksCore(), BTreeOrientedPacking::operator=(), BTree::operator=(), OutputBTree(), BTreeAreaWireAnnealer::packSoftBlocks(), and BTree::save_bbb().

const double BTree::TOLERANCE [protected, inherited]
 

Definition at line 133 of file btree.h.

Referenced by BTreeCompactor::build_orth_tree_add_block(), and BTree::contour_add_block().

const vector<BTreeNode>& BTree::tree [inherited]
 

Definition at line 55 of file btree.h.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeOrientedPacking::BTreeOrientedPacking(), BTreeAreaWireAnnealer::DBfromSoln(), BTreeSlackEval::evaluateYSlacks(), BTreeAreaWireAnnealer::getSoftBlIndex(), BTreeAreaWireAnnealer::getSoftBlNewDimensions(), BTreeCompactor::operator=(), BTreeOrientedPacking::operator=(), OutputBTree(), BTreeAreaWireAnnealer::packSoftBlocks(), BTreeAreaWireAnnealer::perform_move(), BTreeAreaWireAnnealer::perform_rotate(), and BTreeCompactor::slimAssign().

const int BTree::UNDEFINED = Dimension::UNDEFINED [static, inherited]
 

Definition at line 49 of file btree.cxx.

Referenced by BTree::bits2tree(), BTree::BTree(), BTreeCompactor::BTreeCompactor(), BTreeCompactor::build_orth_tree(), BTreeCompactor::build_orth_tree_add_block(), BTree::clean_contour(), BTree::clean_tree(), BTree::contour_add_block(), BTree::contour_evaluate(), EvaluateTree(), BTree::move(), BTreeCompactor::operator=(), OutputBTree(), BTree::remove_left_up_right_down(), BTreeSlackEval::reverse_tree(), BTreeCompactor::slimAssign(), BTree::swap(), and BTree::swap_parent_child().


The documentation for this class was generated from the following files:
Generated on Mon Apr 25 01:14:00 2005 for Parquete by doxygen 1.3.2