Exemple #1
0
 @Override
 public double get() {
   if (dimensions == 0) {
     return data[offset];
   } else {
     throw new UnsupportedOperationException(ErrorMessages.invalidIndex(this));
   }
 }
Exemple #2
0
 @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));
   }
 }
Exemple #3
0
 @Override
 public double get(int i) {
   if (i < 0 || (i >= length))
     throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, i));
   return 0.0;
 }