code: private static double calAfpDis(int afp1, int afp2, FatCatParameters params, AFPChain afpChain)
  	{
  
  		List<AFP> afpSet = afpChain.getAfpSet();
  
  		Matrix disTable1 = afpChain.getDisTable1();
  		Matrix disTable2 = afpChain.getDisTable2();
  
  		int fragLen = params.getFragLen();
  		double afpDisCut = params.getAfpDisCut();
  		double disCut = params.getDisCut();
  		double fragLenSq = params.getFragLenSq();
  
  		int     i, j, ai, bi, aj, bj;
  		double  d;
  		double  rms = 0;
  		for(i = 0; i < fragLen; i ++)   {
  			ai = afpSet.get(afp1).getP1() + i;
  			bi = afpSet.get(afp1).getP2() + i;
  			for(j = 0; j < fragLen; j ++)   {
  				aj = afpSet.get(afp2).getP1() + j;
  				bj = afpSet.get(afp2).getP2() + j;
  				d = disTable1.get(aj,ai) - disTable2.get(bj,bi);
  				rms += d * d;
  				if(rms > afpDisCut)     { return (disCut); }
  			}
  		}
  		return (Math.sqrt(rms / fragLenSq));
  	}
docs: return the root mean square of the distance matrix between the residues
  from the segments that form the given AFP list
  this value can be a measurement (2) for the connectivity of the AFPs
  and its calculation is quicker than the measurement (1), rmsd
  currently only deal with AFP pair
  
  |-d1--|
  |--d2---|
  |---d3----|
  -----------------------------------------------------------------------
  this module is optimized
  
  @param afp1
  @param afp2
  @return