/** * 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); } }