this.setDimensions(ts.getDimensions()); ptToReadTo = (int) Math.round(reducedPtSize * (this.size() + 1)) - 1; // determine end of current range final int ptsToRead = ptToReadTo - ptToReadFrom + 1; this.add(timeSum, measurementSums);
private static TimeWarpInfo fastDTW(final MultivariateTimeSeries tsI, final MultivariateTimeSeries tsJ, int searchRadius, final DistanceFunction distFn) { if (searchRadius < 0) searchRadius = 0; final int minTSsize = searchRadius + 2; if ((tsI.size() <= minTSsize) || (tsJ.size() <= minTSsize)) { // Perform full Dynamic Time Warping. return DTW.getWarpInfoBetween(tsI, tsJ, distFn); } else { final PAA shrunkI = new PAA(tsI, tsI.size() / 2); final PAA shrunkJ = new PAA(tsJ, tsJ.size() / 2); // Determine the search window that constrains the area of the cost matrix that will be evaluated based on // the warp path found at the previous resolution (smaller time series). final WarpPath warpPath = getWarpInfoBetween(shrunkI, shrunkJ, searchRadius, distFn).getPath(); final SearchWindow window = new ExpandedResWindow(tsI, tsJ, shrunkI, shrunkJ, warpPath, searchRadius); // Find the optimal warp path through this search window constraint. return DTW.getWarpInfoBetween(tsI, tsJ, window, distFn); } } }
final int warpedJ = currentCell.getRow(); final int blockISize = shrunkI.aggregatePtSize(warpedI); final int blockJSize = shrunkJ.aggregatePtSize(warpedJ); currentJ += shrunkJ.aggregatePtSize(lastWarpedJ); currentI += shrunkI.aggregatePtSize(lastWarpedI);