@Override public double get() { if (dimensions == 0) { return data[offset]; } else { throw new UnsupportedOperationException(ErrorMessages.invalidIndex(this)); } }
@Override public double get(int x, int y) { if (dimensions == 2) { return data[offset + x * getStride(0) + y * getStride(1)]; } else { throw new UnsupportedOperationException(ErrorMessages.invalidIndex(this, x, y)); } }
@Override public double get(int i) { if (i < 0 || (i >= length)) throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, i)); return 0.0; }