예제 #1
0
파일: Frame.java 프로젝트: vmlaker/h2o
 /**
  * Check that the vectors are all compatible. All Vecs have their content sharded using same
  * number of rows per chunk.
  */
 public void checkCompatible() {
   try {
     Vec v0 = anyVec();
     int nchunks = v0.nChunks();
     for (Vec vec : vecs()) {
       if (vec instanceof AppendableVec) continue; // New Vectors are endlessly compatible
       if (vec.nChunks() != nchunks)
         throw new IllegalArgumentException(
             "Vectors different numbers of chunks, " + nchunks + " and " + vec.nChunks());
     }
     // Also check each chunk has same rows
     for (int i = 0; i < nchunks; i++) {
       long es = v0.chunk2StartElem(i);
       for (Vec vec : vecs())
         if (!(vec instanceof AppendableVec) && vec.chunk2StartElem(i) != es)
           throw new IllegalArgumentException(
               "Vector chunks different numbers of rows, "
                   + es
                   + " and "
                   + vec.chunk2StartElem(i));
     }
   } catch (Throwable ex) {
     Throwables.propagate(ex);
   }
 }
예제 #2
0
파일: Frame.java 프로젝트: vmlaker/h2o
 @Override
 public String toString() {
   // Across
   Vec vecs[] = vecs();
   if (vecs.length == 0) return "{}";
   String s = "{" + _names[0];
   long bs = vecs[0].byteSize();
   for (int i = 1; i < vecs.length; i++) {
     s += "," + _names[i];
     bs += vecs[i].byteSize();
   }
   s += "}, " + PrettyPrint.bytes(bs) + "\n";
   // Down
   Vec v0 = anyVec();
   if (v0 == null) return s;
   int nc = v0.nChunks();
   s += "Chunk starts: {";
   for (int i = 0; i < nc; i++) s += v0.elem2BV(i)._start + ",";
   s += "}";
   return s;
 }