Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index
505371
private void calcHiLoValues(double y, int index) {
        if (y < lo) {
            lo = y;
            loIndex = index;
        }

        if (y > hi) {
            hi = y;
            hiIndex = index;
        }
    }
1370452
public void updateAxis(Integer index, Matrix4d newAxis){
		axes.get(index).setOperator(newAxis);
	}
1206343
def _set_subset_indices(self, y_min, y_max, x_min, x_max):
        
        y_coords, x_coords = self.xd.lsm.coords
        dx = self.xd.lsm.dx
        dy = self.xd.lsm.dy

        lsm_y_indices_from_y, lsm_x_indices_from_y = \
            np.where((y_coords >= (y_min - 2*dy)) &
                     (y_coords <= (y_max + 2*dy)))
        lsm_y_indices_from_x, lsm_x_indices_from_x = \
            np.where((x_coords >= (x_min - 2*dx)) &
                     (x_coords <= (x_max + 2*dx)))

        lsm_y_indices = np.intersect1d(lsm_y_indices_from_y,
                                       lsm_y_indices_from_x)
        lsm_x_indices = np.intersect1d(lsm_x_indices_from_y,
                                       lsm_x_indices_from_x)

        self.xslice = slice(np.amin(lsm_x_indices),
                            np.amax(lsm_x_indices)+1)
        self.yslice = slice(np.amin(lsm_y_indices),
                            np.amax(lsm_y_indices)+1)
66220
private void updateMinMax(int index)
    {
        if (index >= min.getSize())
        {
            return;
        }
        int sum = 0;
        for (int i=0; i<index; i++)
        {
            sum += Math.abs(current.get(i));
        }
        int m = radius - sum;
        min.set(index, -m);
        max.set(index, m);
    }
669310
public void setAll(int index, ByteArray items) {
    rangeCheck(index, index + items.size);
    for (int i = index, j = 0; j < items.size; i++, j++) {
      elements[i] = items.elements[j];
    }
  }
316737
@Override
	public void set(int x, int y, int value) {
		if (!isInBounds(x, y))
			throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y);

		data[getIndex(x, y)] = (byte) value;
	}
367426
function (x, y) {
		return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
	}
745702
public void moveCoordinate(Coordinate coordinate, int index) {
		if (index < coordinates.length) {
			coordinates[index] = (Coordinate) coordinate.clone();
		}
		setCoordinates(coordinates);
	}
566612
public void set(int index, long value) {
    assert index >= 0 : "index (" + index + ") should >= 0";
    assert index < length : "index (" + index + ") should < length (" + length + ")";
    Platform.putLong(baseObj, baseOffset + index * WIDTH, value);
  }
494796
public void add(double x, double y)
    {
        if (count >= xarr.length)
        {
            grow();
        }
        xarr[count] = x;
        yarr[count++] = y;
        minX = Math.min(minX, x);
        minY = Math.min(minY, y);
        maxX = Math.max(maxX, x);
        maxY = Math.max(maxY, y);
    }
1199533
def set_y(idx, val)
      check_bounds(idx)
      FFIGeos.GEOSCoordSeq_setY_r(Geos.current_handle_pointer, ptr, idx, val.to_f)
    end
617829
@Override
    public int getInt(int index) {
        check(index);
        final FLValue flValue = values.get(index);
        return flValue != null ? (int) flValue.asInt() : 0;
    }
516506
protected final int index (int tx, int ty)
    {
//         if (!_bounds.contains(tx, ty)) {
//             String errmsg = "Coordinates out of bounds: +" + tx + "+" + ty +
//                 " not in " + StringUtil.toString(_bounds);
//             throw new IllegalArgumentException(errmsg);
//         }
        return (ty-_bounds.y)*_bounds.width + (tx-_bounds.x);
    }
891083
private void checkRange(long index) {
    Assert.indexNot(isEmpty(), "segment is empty");
    Assert.indexNot(index < firstIndex(), index + " is less than the first index in the segment");
    Assert.indexNot(index > lastIndex(), index + " is greater than the last index in the segment");
  }
701885
def value_index(idx)
      node = self
      while node.parent
        idx += node.parent.offsets[node.index_in_parent_node]
        node = node.parent
      end

      idx
    end
854726
private boolean increment(int index)
    {
        if (index == -1)
        {
            return false;
        }
        int value = current.get(index);
        if (value < max.get(index))
        {
            current.set(index, value+1);
            updateMinMax(index+1);
            return true;
        }
        boolean hasNext = increment(index-1);
        if (hasNext)
        {
            current.set(index, min.get(index));            
        }
        return hasNext;
    }
1145804
private int incrementIndex(int index, int maxIndex) {
		int newIndex = index + 1;
		if (newIndex >= elements.length) {
			newIndex = maxIndex;
		}
		return newIndex;
	}