code: public int[] getNonZeroIndices() {
          if (vectorOffset == 0 && vectorLength == sparseVector.length())
              return sparseVector.getNonZeroIndices();
          // If the sparse vector is a sub-view, calculate which indices are
          // reflected in this view
          else {
              int inRange = 0;
              int[] indices = sparseVector.getNonZeroIndices();
              for (int nz : indices) {
                  if (nz >= vectorOffset && nz < vectorOffset + vectorLength)
                      inRange++;
              }
              int[] arr = new int[inRange];
              int idx = 0;
              for (int nz : indices) {
                  if (nz >= vectorOffset && nz < vectorOffset + vectorLength)
                      arr[idx++] = nz;
              }
              return arr;
          }
      }
docs: {@inheritDoc}