docs: public static double angleSparseDense(SparseNumberVector v1, NumberVector v2) {
      // TODO: exploit precomputed length, when available.
      final int dim2 = v2.getDimensionality();
      double l1 = 0., l2 = 0., cross = 0.;
      int i1 = v1.iter(), d2 = 0;
      while(v1.iterValid(i1)) {
        final int d1 = v1.iterDim(i1);
        while(d2 < d1 && d2 < dim2) {
          final double val = v2.doubleValue(d2);
          l2 += val * val;
          ++d2;
        }
        if(d2 < dim2) {
          assert (d1 == d2) : "Dimensions not ordered";
          final double val1 = v1.iterDoubleValue(i1);
          final double val2 = v2.doubleValue(d2);
          l1 += val1 * val1;
          l2 += val2 * val2;
          cross += val1 * val2;
          i1 = v1.iterAdvance(i1);
          ++d2;
        }
        else {
          final double val = v1.iterDoubleValue(i1);
          l1 += val * val;
          i1 = v1.iterAdvance(i1);
        }
      }
      while(d2 < dim2) {
        final double val = v2.doubleValue(d2);
        l2 += val * val;
        ++d2;
      }
      final double a = (cross == 0.) ? 0. : //
          (l1 == 0. || l2 == 0.) ? 1. : //
              FastMath.sqrt((cross / l1) * (cross / l2));
      return (a < 1.) ? a : 1.;
    }