code: public float[] subVector(float[] z, int head, int tail) {
      int size = tail - head + 1;
      float[] result = new float[size];
  
      System.arraycopy(z, head, result, head - head, tail + 1 - head);
  
      return result;
    }
docs: Gets a subvector of a given vector
  (Head inclusive and tail inclusive)
  
  @param z the vector
  @return the subvector