code: public int dot(int[] other) {
          int dot = 0;
          for (int c = 0; c < used && indices[c] < other.length; c++) {
              if (indices[c] > Integer.MAX_VALUE) {
                  break;
              }
              dot += values[c] * other[SafeCast.safeLongToInt(indices[c])];
          }
          return dot;
      }
docs: Computes the dot product of this vector with the given vector.