void PutPsFile() { Prologue(); Variables(); BorderOutlineBox(); if (bflag) { BigTitleOutlineBox(); BigTitleText(); } else { TitleOutlineBox(); TitleText(); } CurvesInit(); Axes(); if (TWENTY) Key(); Curves(); if (!yflag) Marks(); fprintf(psfp, "showpage\n"); }
void PutPsFile(void) { Prologue(); Variables(); CurvesInit(); DoTitleAndBox(); if (multipageflag) { Key(); // print multi-page key even if there are more than 20 bands NextPage(); } Axes(); if (!multipageflag && (TWENTY != 0)) Key(); Curves(); if (!yflag) Marks(); fprintf(psfp, "showpage\n"); }
void TGraphCascade::TopologicalSort(TIntV& SortedNIdV) { int Nodes = Graph.GetNodes(); SortedNIdV.Gen(Nodes, 0); // result THash<TInt, TBool> Marks(Nodes); // nodeid -> mark map THash<TInt,TBool> TempMarks(Nodes); // nodeid -> temp mark map THash<TInt, TBool> Added(Nodes); TIntV NIdV; Graph.GetNIdV(NIdV); // all node ids // set marks for (int NodeN = 0; NodeN < Nodes; NodeN++) { int NodeId = NIdV[NodeN]; Marks.AddDat(NodeId, false); TempMarks.AddDat(NodeId, false); Added.AddDat(NodeId, false); } TSStack<TInt> Stack; for (int NodeN = 0; NodeN < Nodes; NodeN++) { int NodeId = NIdV[NodeN]; // select an unmarked node if (!Marks.GetDat(NodeId)) { Stack.Push(NodeId); while (!Stack.Empty()) { // visit TopNode int TopNodeId = Stack.Top(); Marks.GetDat(TopNodeId) = true; TempMarks.GetDat(TopNodeId) = true; // add children, set their temp marks to true TNGraph::TNodeI NI = Graph.GetNI(TopNodeId); int Children = NI.GetOutDeg(); bool IsFinal = true; for (int ChildN = 0; ChildN < Children; ChildN++) { int ChildId = NI.GetOutNId(ChildN); EAssertR(!TempMarks.GetDat(ChildId), "TGraphCascade::TopologicalSort: the graph is not a DAG!"); if (!Marks.GetDat(ChildId)) { // unvisited node IsFinal = false; Stack.Push(ChildId); } } if (IsFinal) { // push TopNode to tail if (!Added.GetDat(TopNodeId)) { SortedNIdV.Add(TopNodeId); Added.GetDat(TopNodeId) = true; } TempMarks.GetDat(TopNodeId) = false; Stack.Pop(); } } } } SortedNIdV.Reverse(); }
void PutFile() { MakeIdentTable(); SortIdentTable(); /* Sort identifiers by size. */ TopBands(); /* Keep only noOfBands bands and put rest in an other group. */ Dimensions(); Scale(); #if PRINT_IDENT_TABLE printIdentTable(); #endif /* Start printing graph. */ Prologue(); output->Fonts(); BorderOutlineBox(); TitleOutlineBox(); TitleText(); CurvesInit(); Key(); Curves(); Axes(); if (showMax) drawMaxValue(maxValue, maxValueStr); if (mflag) Marks(); if (cflag) Comments(); output->Prologue(); return; }