private void setIndex2Location () { //System.out.println ("HashedSparseVector setIndex2Location indices.length="+indices.length+" maxindex="+indices[indices.length-1]); assert (index2location == null); assert (indices.length > 0); this.maxIndex = indices[indices.length - 1]; this.index2location = new TIntIntHashMap (numLocations ()); index2location.setDefaultValue (-1); for (int i = 0; i < indices.length; i++) index2location.put (indices[i], i); }