docs: public static <E> double dotProduct(Counter<E> c, double[] a, Index<E> idx) {
      double dotProd = 0;
      for (Map.Entry<E, Double> entry : c.entrySet()) {
        int keyIdx = idx.indexOf(entry.getKey());
        if (keyIdx == -1) {
          continue;
        }
        dotProd += entry.getValue() * a[keyIdx];
      }
      return dotProd;
    }