Exemple #1
0
void gvn(IRUnit& unit) {
  auto rpoBlocksWithIds = rpoSortCfgWithIds(unit);
  auto& rpoBlocks = rpoBlocksWithIds.blocks;
  auto dominators = findDominators(unit, rpoBlocksWithIds);
  ValueNumberTable vnTable(unit, ValueNumberMetadata { nullptr, nullptr });

  // This is an implementation of the RPO version of the global value numbering
  // algorithm presented in the 1996 paper "SCC-based Value Numbering" by
  // Cooper and Simpson.
  runAnalysis(unit, rpoBlocks, vnTable);
  replaceRedundantComputations(unit, dominators, rpoBlocks, vnTable);
}
Exemple #2
0
int main(int argc, char ** argv)
{
  if (argc != 2)
    {
      printf("\n ./runAnalysis <filename>\n\n");
      
      return -1;
    }

  runAnalysis(argv[1]);

  return 0;
}
// Syntax (typical):
//   computeLocalSolutions case=<ecl_case_prefix> step=<report_number>
int main(int argc, char* argv[])
try {
    example::Setup setup(argc, argv);
    auto& fdTool = setup.toolbox;

    {
        const auto inj = injectors(setup);
        const auto fwd = fdTool.computeInjectionDiagnostics(inj);

        runAnalysis(inj, fwd.fd, true);
    }

    {
        const auto prod = producers(setup);
        const auto rev  = fdTool.computeProductionDiagnostics(prod);

        runAnalysis(prod, rev.fd, false);
    }
}
catch (const std::exception& e) {
    std::cerr << "Caught exception: " << e.what() << '\n';
}
Exemple #4
0
void AnalysisView::setCurrentWindowValues(float * imagL, float * imagR, float * isubEnergy, int * isubBeats, int ibeat) {
	subEnergy = isubEnergy;
	subBeats = isubBeats;
	beat = ibeat;
	
	memcpy(magLHistory[historyCounter],imagL, EQ_POINTS* sizeof(float));
	memcpy(magRHistory[historyCounter],imagR, EQ_POINTS* sizeof(float));
	runAnalysis();
	
	historyCounter++;
	historyCounter %= NUMBER_OF_EQS;
	
}
Exemple #5
0
int main(int argc, char ** argv)
{
  if (argc != 3)
    {
      printf("\n ./runAnalysis <filename> <systematic>\n");
      printf("\n The output will be saved in\n\n");
      printf("            minitrees/<systematic>\n");
      printf("            rootfiles/<systematic>\n");
      printf("            txt/<systematic>\n\n");
      
      return -1;
    }

  runAnalysis(argv[1], argv[2]);

  return 0;
}
Exemple #6
0
void gvn(IRUnit& unit) {
  PassTracer tracer{&unit, Trace::hhir_gvn, "gvn"};

  GVNState state;
  auto const rpoBlocks = rpoSortCfg(unit);
  auto const idoms = findDominators(
    unit,
    rpoBlocks,
    numberBlocks(unit, rpoBlocks)
  );

  ValueNumberTable globalTable(unit, ValueNumberMetadata{});
  state.globalTable = &globalTable;

  // This is an implementation of the RPO version of the global value numbering
  // algorithm presented in the 1996 paper "SCC-based Value Numbering" by
  // Cooper and Simpson.
  runAnalysis(state, unit, rpoBlocks);
  replaceRedundantComputations(unit, idoms, rpoBlocks, globalTable);
  state.globalTable = nullptr;
}
DetailWindow::DetailWindow(QWidget *parent, QString path) : QMainWindow(parent), ui(new Ui::DetailWindow){
  ui->setupUi(this);
  //: The title of the Detail window
  this->setWindowTitle(GuiStrings::getInstance()->appName() + GuiStrings::getInstance()->delim() + tr("Detailed Analysis"));
  //: A tooltip on the Detail window
  ui->chromaColourCombo->setToolTip(wrapToolTip(tr("Choose the colour scheme for the chromagram. Some provide higher contrast than others.")));
  //: A tooltip on the Detail window
  ui->colourScaleLabel->setToolTip(wrapToolTip(tr("This is the colour scale of the current chromagram. You can change the colour scheme using the dropdown below.")));
  connect(&analysisWatcher, SIGNAL(finished()), this, SLOT(analysisFinished()));
  allowDrops = true;
  ui->progressBar->setVisible(false);
  ui->runButton->setEnabled(false);
  layoutScaling();
  drawColourScale();
  drawPianoKeys();
  blankVisualisations();
  blankKeyLabel();
  if(path != ""){
    filePath = path;
    runAnalysis();
  }
}
Exemple #8
0
int proview(int argc, char *argv[])
{
	/* commands that can be set from the command line */

	/* default values for arguments */
	Args args;
	args.cdel='\t';
	args.qdel='/';
	args.pro=false;
	args.min=4;
	args.c=5;
	args.pvalue=0.001;
	args.notrim=false;
	args.noheader=false;

	std::string infile="";
	std::string outfile="";

	std::ifstream inFile;				// the file to read data from (if not stdin).

	env_t env;
	env.setname("mapgd proview");
	env.setver("0.6a");
	env.setauthor("Bernhard Haubold");
	env.setdescription("prints data in the '.pro' file quartet format");
	
	env.optional_arg('m',"minimum",	 &args.min, 	&arg_setint, 	"an error occured", "prints a line iff at least one line has coverage greater than the minimum coverage (defauld 4)");
	env.optional_arg('q',"qdel",	&args.qdel,	&arg_setchar, 	"an error occured", "sets the quartet delimiter (default tab)");
	env.optional_arg('d',"cdel",	&args.cdel,	&arg_setchar, 	"an error occured", "sets the column delimiter (default tab)");
	env.optional_arg('c',"coulmn",	&args.c, 	&arg_setint, 	"an error occured", "sets the number of column in the output (default 6)");
	env.optional_arg('i',"input",	&infile,	&arg_setstr, 	"an error occured", "sets the input file (default stdin)");
	env.optional_arg('o',"output",	&outfile,	&arg_setstr, 	"an error occured", "sets the output file (default stdout)");
	env.optional_arg('t',"trim",	&args.pvalue,	&arg_setfloat_t,	"an error occured", "skip printing lines where an allele occurs primarly in one direction, \n\t\tgive that the p-value < the number provided");
	env.flag(	'n',"notrim",	&args.notrim,	&flag_set,	"an error occured", "disable trimming");
	env.flag(	'h',"help", 	&env, 		&flag_help, 	"an error occured while displaying the help message", "prints this message");
	env.flag(	'v',"version", 	&env, 		&flag_version, 	"an error occured while displaying the version message", "prints the program version");
	env.flag(	'P',"pro",	&args.pro, 	&flag_set, 	"an error occured", "input is a the pro format");
	env.flag(	'N',"noheader",	&args.noheader, &flag_set, 	"an error occured", "don't print a header.");
	parsargs(argc, argv, env) ;

	if ( args.c!=6 && args.c!=5 && args.c!=7) {std::cerr << "columns must be 5, 6 or 7 (e.g. -c 5).\n"; exit(0);}

	int dic[256]; //A dictionary for translating text characters to ints, currently set to map forward reads and reverse reads to different ints.

	//memset(dic, 8, sizeof(int)*256);
	for (int x=0; x<256; ++x)dic[x]=8;

	dic['A'] = 0;
	dic['C'] = 1;
	dic['G'] = 2;
	dic['T'] = 3;
	dic['a'] = 4;
	dic['c'] = 5;
	dic['g'] = 6;
	dic['t'] = 7;

	//Setting up the input/output

	profile pro;
	profile pro_in;
	std::istream *in;
	in=&std::cin;

	if (not (args.pro) ){	
		if (infile.size()!=0) {
			inFile.open(infile, std::ifstream::in);
			if (!inFile) {printUsage(env);} 
			else in=&inFile;
		}
	}
	else{
		if (infile.size()!=0) pro_in.open(infile.c_str(), 'r');	
		else pro_in.open('r');
	};
	if (outfile.size()!=0) {
		pro.open(outfile.c_str(), 'w');
		if (!pro.is_open() ) {printUsage(env); exit(0);} 
	}
	else pro.open('w');

	/* Open the input file. */

	/* ************************************************************************************************************ */

	if (not (args.pro) ) runAnalysis(dic, args, in, pro);
	else {
		pro_in.readheader();
		pro.copyheader(pro_in);
		pro.setcolumns(args.c);
		pro.set_delim_column(args.cdel);
		pro.set_delim_quartet(args.qdel);
		if (not (args.noheader) ) pro.writeheader();

		while(pro_in.read()!=EOF ){
			pro.copy(pro_in);
			pro.write();
		}
	};
	pro.close();
	if(infile.size()!=0){
		if (args.pro) inFile.close();
		else pro_in.close();
	};
	env.close();
	exit(0);
}
void DetailWindow::dropEvent(QDropEvent *e){
  allowDrops = false;
  filePath = e->mimeData()->urls().at(0).toLocalFile();
  runAnalysis();
}
void DetailWindow::on_runButton_clicked(){
  if(filePath != "") runAnalysis();
}