code: public static void extract(DMatrixRMaj src, int indexes[] , int length , DMatrixRMaj dst ) {
          if( !MatrixFeatures_DDRM.isVector(dst))
              throw new MatrixDimensionException("Dst must be a vector");
          if( length != dst.getNumElements())
              throw new MatrixDimensionException("Unexpected number of elements in dst vector");
  
          for (int i = 0; i < length; i++) {
              dst.data[i] = src.data[indexes[i]];
          }
      }
docs: Extracts the elements from the source matrix by their 1D index.
  
  @param src Source matrix. Not modified.
  @param indexes array of row indexes
  @param length maximum element in row array
  @param dst output matrix.  Must be a vector of the correct length.