/** * See if this Section intersects with another Section. ignores strides * * @param other another section * @return true if intersection is non-empty * @throws InvalidRangeException if want.getRank() not equal to this.getRank(), * ignoring vlen */ public boolean intersects(Section other) throws InvalidRangeException { if (!compatibleRank(other)) throw new InvalidRangeException("Invalid Section rank"); for (int j = 0; j < list.size(); j++) { Range base = list.get(j); Range r = other.getRange(j); if (base == Range.VLEN || r == Range.VLEN) continue; if (!base.intersects(r)) return false; } return true; }
/** * See if this Section intersects with another Section. ignores strides, vlen * * @param other another section * @return true if intersection is non-empty * @throws InvalidRangeException if want.getRank() not equal to this.getRank(), * */ public boolean intersects(Section other) throws InvalidRangeException { if (!compatibleRank(other)) throw new InvalidRangeException("Invalid Section rank"); for (int j = 0; j < list.size(); j++) { Range base = list.get(j); Range r = other.getRange(j); if (base == Range.VLEN || r == Range.VLEN) continue; if (!base.intersects(r)) return false; } return true; }
/** * See if this Section intersects with another Section. ignores strides * * @param other another section * @return true if intersection is non-empty * @throws InvalidRangeException if want.getRank() not equal to this.getRank() */ public boolean intersects(Section other) throws InvalidRangeException { if (other.getRank() != getRank()) throw new InvalidRangeException("Invalid Section rank"); for (int j = 0; j < list.size(); j++) { Range base = list.get(j); Range r = other.getRange(j); if (!base.intersects(r)) return false; } return true; }