Ejemplo n.º 1
0
int Cylinder::configureAlgorithm(int argc, char *argv[])
{
	int res;
	unsigned int ns;
	bool nhs;
	bool pbit;
	
	if(argc < 4)
	{
		cerr << "ERROR: expected 4 parameters for MCC fingerprints: <Ns> {LSS|LSA|LSSR|LSAR|NHS} {y|n} {b|r}. Using default." << endl;
		ns = 8;
		res = 1;
		pbit = false;
		nhs = false;
	}
	else
	{
		ns = atoi(argv[0]);
		nhs = (strcmp(argv[1], "NHS") == 0);
		
		if(argv[3][0] == 'b')
			pbit = true;
		else if(argv[3][0] == 'r')
			pbit = false;
		else
		{
			cerr << "ERROR: the bit/real parameter should be {b|r}. Using default (real encoding)." << endl;
			pbit = false;
		}
		
		res = 0;
	}
	
	configureAlgorithm(ns, pbit, nhs);
	
	return res;
}
bool DecompressSelector::configure(Interpreter* R) {
  return IsAlgorithm ? configureAlgorithm(R) : configureData(R);
}