void Visualize(const GraphComponent<Graph>& component, ostream &os, const GraphLabeler<Graph> &labeler, const GraphColorer<Graph> &colorer, const VertexLinker<Graph> &linker) { if(paired_) { PairedGraphPrinter<Graph> printer(graph_, os, labeler, colorer, linker); Visualize(component, printer); } else { SingleGraphPrinter<Graph> printer(graph_, os, labeler, colorer, linker); Visualize(component, printer); } }
void Visualize(ostream &os, const GraphLabeler<Graph> &labeler, const GraphColorer<Graph> &colorer, const VertexLinker<Graph> &linker) { GraphComponent<Graph> component(graph_, graph_.begin(), graph_.end(), false); Visualize(component, os, labeler, colorer, linker); }
// ============================================================================ int ML_Epetra::MultiLevelPreconditioner:: VisualizeSmoothers(int NumPreCycles, int NumPostCycles) { bool viz = List_.get("viz: enable",false); if (viz) { if (IsPreconditionerComputed() == false) ML_CHK_ERR(-1); // need an already computed preconditioner bool VizPreSmoother = false; bool VizPostSmoother = false; if (NumPreCycles != 0) VizPreSmoother = true; if (NumPostCycles != 0) VizPostSmoother = true; int ierr = Visualize(false, VizPreSmoother, VizPostSmoother, false, NumPreCycles, NumPostCycles, -1); ML_CHK_ERR(ierr); } else { std::cout << PrintMsg_ << "You need to specify `viz: enable' = true" << std::endl; std::cout << PrintMsg_ << "in the parameter list before building the ML" << std::endl; std::cout << PrintMsg_ << "preconditioner in order to visualize" << std::endl; ML_CHK_ERR(-1); } return(0); }
void AI::Visualize() { #ifdef VISUALIZE_AI_DEBUG /*if (!AI_Cars.empty()) Visualize(&AI_Cars.back(), topnode);*/ for ( std::vector<AI_Car>::iterator it = AI_Cars.begin (); it != AI_Cars.end (); it++ ) { Visualize(&(*it)); } #endif }
// ============================================================================ int ML_Epetra::MultiLevelPreconditioner:: VisualizeAggregates() { bool viz = List_.get("viz: enable",false); if (viz) { if (IsPreconditionerComputed() == false) ML_CHK_ERR(-1); // need an already computed preconditioner ML_CHK_ERR(Visualize(true, false, false, false, -1, -1, -1)); } return(0); }
int App::Run() { Load(); if (ParamsInputPath_.size()) { Params_.Load(ParamsInputPath_.c_str()); } Builder_.SetParams(Params_); Builder_.SetInputCloud(Input_); PrintParameters(); Builder_.GenerateTrainingSet(); ExportForLibSVM(); if (AlphaInputPath_.size()) { std::ifstream alphaInput(AlphaInputPath_.c_str()); std::vector<SVMFloat> alphas; std::copy(std::istream_iterator<SVMFloat>(alphaInput), std::istream_iterator<SVMFloat>(), std::back_inserter(alphas)); Builder_.InitSVM(alphas); } else { Builder_.Learn(); TrainedModel_ = true; } if (AlphaOutputPath_.size()) { std::ofstream alphaOutput(AlphaOutputPath_.c_str()); std::copy(Builder_.SVM().Alphas(), Builder_.SVM().Alphas() + Builder_.Objects->size(), std::ostream_iterator<SVMFloat>(alphaOutput, "\n")); } if (ParamsOutputPath_.size()) { Params_.Save(ParamsOutputPath_.c_str()); } ExportAlphaMap(); Builder_.CalcGradients(); PrintStatistics(); Visualize(); return 0; }
// ============================================================================ int ML_Epetra::MultiLevelPreconditioner:: VisualizeCycle(int NumCycles) { bool viz = List_.get("viz: enable",false); if (viz) { if (IsPreconditionerComputed() == false) ML_CHK_ERR(-1); // need an already computed preconditioner int ierr = Visualize(false, false, false, true, -1, -1, NumCycles); ML_CHK_ERR(ierr); } else { cout << PrintMsg_ << "You need to specify `viz: enable' = true" << endl; cout << PrintMsg_ << "in the parameter list before building the ML" << endl; cout << PrintMsg_ << "preconditioner in order to visualize" << endl; ML_CHK_ERR(-1); } return(0); }
int main(int argc, char *argv[]) { #ifdef PARSEC_VERSION #define __PARSEC_STRING(x) #x #define __PARSEC_XSTRING(x) __PARSEC_STRING(x) std::cout << "PARSEC Benchmark Suite Version "__PARSEC_XSTRING(PARSEC_VERSION) << std::endl << std::flush; #else std::cout << "PARSEC Benchmark Suite" << std::endl << std::flush; #endif //PARSEC_VERSION #ifdef ENABLE_PARSEC_HOOKS __parsec_bench_begin(__parsec_fluidanimate); #endif if(argc < 4 || argc >= 6) { std::cout << "Usage: " << argv[0] << " <threadnum> <framenum> <.fluid input file> [.fluid output file]" << std::endl; return -1; } int threadnum = atoi(argv[1]); int framenum = atoi(argv[2]); //Check arguments if(threadnum != 1) { std::cerr << "<threadnum> must be 1 (serial version)" << std::endl; return -1; } if(framenum < 1) { std::cerr << "<framenum> must at least be 1" << std::endl; return -1; } #ifdef ENABLE_CFL_CHECK std::cout << "WARNING: Check for Courant–Friedrichs–Lewy condition enabled. Do not use for performance measurements." << std::endl; #endif InitSim(argv[3]); #ifdef ENABLE_VISUALIZATION InitVisualizationMode(&argc, argv, &AdvanceFrame, &numCells, &cells, &cnumPars); #endif #ifndef ENABLE_VISUALIZATION //core of benchmark program (the Region-of-Interest) #ifdef ENABLE_PARSEC_HOOKS __parsec_roi_begin(); #endif for(int i = 0; i < framenum; ++i) { AdvanceFrame(); } #ifdef ENABLE_PARSEC_HOOKS __parsec_roi_end(); #endif #else //ENABLE_VISUALIZATION Visualize(); #endif //ENABLE_VISUALIZATION if(argc > 4) SaveFile(argv[4]); CleanUpSim(); #ifdef ENABLE_PARSEC_HOOKS __parsec_bench_end(); #endif return 0; }