code: def rogers_huff_r_between(gna, gnb):
      
  
      # check inputs
      gna = asarray_ndim(gna, 2, dtype='i1')
      gnb = asarray_ndim(gnb, 2, dtype='i1')
      gna = memoryview_safe(gna)
      gnb = memoryview_safe(gnb)
  
      # compute correlation coefficients
      r = gn_pairwise2_corrcoef_int8(gna, gnb)
  
      # convenience for singletons
      if r.size == 1:
          r = r[0, 0]
  
      return r
docs: Estimate the linkage disequilibrium parameter *r* for each pair of
      variants between the two input arrays, using the method of Rogers and
      Huff (2008).
  
      Parameters
      ----------
      gna, gnb : array_like, int8, shape (n_variants, n_samples)
          Diploid genotypes at biallelic variants, coded as the number of
          alternate alleles per call (i.e., 0 = hom ref, 1 = het, 2 = hom alt).
  
      Returns
      -------
      r : ndarray, float, shape (m_variants, n_variants )
          Matrix in rectangular form.