llvm.org GIT mirror llvm / eb75364
Remove <iostream>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79146 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 11 years ago
1 changed file(s) with 23 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
1717
1818 #include "Solver.h"
1919 #include "AnnotatedGraph.h"
20
20 #include "llvm/Support/raw_ostream.h"
2121 #include
22 #include
2322
2423 namespace PBQP {
2524
469468 }
470469
471470 void printNode(const GraphNodeIterator &nodeItr) {
472
473 std::cerr << "Node " << g.getNodeID(nodeItr) << " (" << &*nodeItr << "):\n"
474 << " costs = " << g.getNodeCosts(nodeItr) << "\n"
475 << " link degree = " << g.getNodeData(nodeItr).getLinkDegree() << "\n"
476 << " links = [ ";
471 llvm::errs() << "Node " << g.getNodeID(nodeItr) << " (" << &*nodeItr << "):\n"
472 << " costs = " << g.getNodeCosts(nodeItr) << "\n"
473 << " link degree = " << g.getNodeData(nodeItr).getLinkDegree() << "\n"
474 << " links = [ ";
477475
478476 for (typename HSIT::NodeData::AdjLinkIterator
479477 aeItr = g.getNodeData(nodeItr).adjLinksBegin(),
480478 aeEnd = g.getNodeData(nodeItr).adjLinksEnd();
481479 aeItr != aeEnd; ++aeItr) {
482 std::cerr << "(" << g.getNodeID(g.getEdgeNode1Itr(*aeItr))
483 << ", " << g.getNodeID(g.getEdgeNode2Itr(*aeItr))
484 << ") ";
485 }
486 std::cout << "]\n";
480 llvm::errs() << "(" << g.getNodeID(g.getEdgeNode1Itr(*aeItr))
481 << ", " << g.getNodeID(g.getEdgeNode2Itr(*aeItr))
482 << ") ";
483 }
484 llvm::errs() << "]\n";
487485 }
488486
489487 void dumpState() {
490
491 std::cerr << "\n";
488 llvm::errs() << "\n";
492489
493490 for (GraphNodeIterator nodeItr = g.nodesBegin(), nodeEnd = g.nodesEnd();
494491 nodeItr != nodeEnd; ++nodeItr) {
500497 for (unsigned b = 0; b < 3; ++b) {
501498 NodeList &bucket = *buckets[b];
502499
503 std::cerr << "Bucket " << b << ": [ ";
500 llvm::errs() << "Bucket " << b << ": [ ";
504501
505502 for (NodeListIterator nItr = bucket.begin(), nEnd = bucket.end();
506503 nItr != nEnd; ++nItr) {
507 std::cerr << g.getNodeID(*nItr) << " ";
508 }
509
510 std::cerr << "]\n";
511 }
512
513 std::cerr << "Stack: [ ";
504 llvm::errs() << g.getNodeID(*nItr) << " ";
505 }
506
507 llvm::errs() << "]\n";
508 }
509
510 llvm::errs() << "Stack: [ ";
514511 for (NodeStackIterator nsItr = stack.begin(), nsEnd = stack.end();
515512 nsItr != nsEnd; ++nsItr) {
516 std::cerr << g.getNodeID(*nsItr) << " ";
517 }
518 std::cerr << "]\n";
513 llvm::errs() << g.getNodeID(*nsItr) << " ";
514 }
515 llvm::errs() << "]\n";
519516 }
520517
521518 void reduce() {
548545
549546 solution.incR1Reductions();
550547
551 //std::cerr << "Applying R1 to " << g.getNodeID(xNodeItr) << "\n";
548 //llvm::errs() << "Applying R1 to " << g.getNodeID(xNodeItr) << "\n";
552549
553550 assert((g.getNodeData(xNodeItr).getLinkDegree() == 1) &&
554551 "Node in R1 bucket has degree != 1");