code: public void setSparseComponent(int component, int[] indices, double[] values) {
      if (component >= pointers.length) {
        increaseSizeTo(component + 1);
      }
  
      assert (indices.length == values.length);
  
      if (indices.length == 0) {
        pointers[component] = new double[2];
        sparse[component] = true;
        copyOnWrite[component] = false;
      } else {
        double[] sparseInfo = new double[indices.length * 2];
        for (int i = 0; i < indices.length; i++) {
          sparseInfo[i * 2] = indices[i];
          sparseInfo[(i * 2) + 1] = values[i];
        }
        pointers[component] = sparseInfo;
        sparse[component] = true;
        copyOnWrite[component] = false;
      }
    }
docs: Sets a component to a set of sparse indices, each with a value.
  
  @param component the index of the component to set
  @param indices   the indices of the vector to give values to
  @param values    their values