Exemplo n.º 1
0
float MCC::rho_tun(Cylinder const & t_a, Cylinder const & t_b, Cylinder const & k_a, Cylinder const & k_b)
{
	float d1, d2, d3;

	d1 = fabs(t_a.ds(k_a.getX(),k_a.getY()) - t_b.ds(k_b.getX(),k_b.getY()))/(t_a.ds(k_a.getX(),k_a.getY()) + t_b.ds(k_b.getX(),k_b.getY()));
	d2 = fabs(t_a.dFi(t_a.dFi(t_a.getrT(),k_a.getrT()),t_b.dFi(t_b.getrT(),k_b.getrT())));
	d3 = fabs(t_a.dFi(dR(t_a,k_a),dR(t_b,k_b)));

	return Cylinder::psi(d1,MUP1,TAUP1)*Cylinder::psi(d2,MUP2,TAUP2)*Cylinder::psi(d3,MUP3,TAUP3);
}
Exemplo n.º 2
0
float Cylinder::nhs(const Cylinder &c) const
{
	int hamming = 0;
	const float P = 30;

	if (abs(dFi(getrT(),c.getrT())) > 0.785398163397 || dss(c.getX(), c.getY()) > DELTAXY*DELTAXY)
		return 0;
	
	for(unsigned int i = 0; i < NUMCELLS; ++i)
		if (getB1(i) != c.getB1(i))
			hamming++;
		
	return pow(1.0-((float)hamming)/NUMCELLS, P);
}