Beispiel #1
0
 private static boolean unzipMatches(ZipEntry entry, Vector files) {
   if (files == Null.INSTANCE) {
     return true;
   } else {
     for (int i = 0; i != files.length(); ++i) {
       if (entry.getName().equals(files.getElementAsString(i))) {
         return true;
       }
     }
     return false;
   }
 }
 public TransposingMatrix(Vector source, AttributeMap attributes) {
   super(attributes);
   this.source = source;
   this.sourceDim = ((IntVector) source.getAttribute(Symbols.DIM)).toIntArray();
   this.sourceRowCount = sourceDim[0];
   this.sourceColCount = sourceDim[1];
 }
  @Override
  public double getElementAsDouble(int vectorIndex) {
    int row = vectorIndex % sourceColCount;
    vectorIndex = (vectorIndex - row) / sourceColCount;
    int col = vectorIndex % sourceRowCount;

    return source.getElementAsDouble(col + (row * sourceRowCount));
  }
 @Override
 public int getComputationDepth() {
   return source.getComputationDepth() + 1;
 }
 @Override
 public int length() {
   return source.length();
 }
Beispiel #6
0
 @Override
 protected Object getFirstElement(Vector value) {
   return value.getElementAsInt(0);
 }
Beispiel #7
0
 @Override
 public int length() {
   return vector.length();
 }
Beispiel #8
0
 @Override
 public double getElementAsDouble(int index) {
   return compute(vector.getElementAsDouble(index));
 }