code: public SDVariable segmentMax(String name, SDVariable data, SDVariable segmentIds) {
          validateNumerical("segmentMax", "data", data);
          validateInteger("segmentMax", "segmentIds", segmentIds);
          SDVariable ret = f().segmentMax(data, segmentIds);
          return updateVariableNameAndReference(ret, name);
      }
docs: Segment max operation.<br>
  If data =     [3, 6, 1, 4, 9, 2, 8]<br>
  segmentIds =  [0, 0, 1, 1, 1, 2, 2]<br>
  then output = [6, 9, 8] = [max(3,6), max(1,4,9), max(2,8)]<br>
  Note that the segment IDs must be sorted from smallest to largest segment.
  See {@link #unsortedSegmentMax(String, SDVariable, SDVariable, int)}
  for the same op without this sorted requirement
  
  @param name       Name of the output variable. May be null
  @param data       Data to perform segment max on
  @param segmentIds Variable for the segment IDs
  @return Segment max output