expandedreswindow.java

来自「用java写的DTW程序组合」· Java 代码 · 共 54 行

JAVA
54
字号
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ExpandedResWindow.java

package dtw;

import matrix.ColMajorCell;
import timeseries.PAA;
import timeseries.TimeSeries;

// Referenced classes of package dtw:
//            SearchWindow, WarpPath

public class ExpandedResWindow extends SearchWindow
{

    public ExpandedResWindow(TimeSeries tsI, TimeSeries tsJ, PAA shrunkI, PAA shrunkJ, WarpPath shrunkWarpPath, int searchRadius)
    {
        super(tsI.size(), tsJ.size());
        int currentI = shrunkWarpPath.minI();
        int currentJ = shrunkWarpPath.minJ();
        int lastWarpedI = 0x7fffffff;
        int lastWarpedJ = 0x7fffffff;
        for(int w = 0; w < shrunkWarpPath.size(); w++)
        {
            ColMajorCell currentCell = shrunkWarpPath.get(w);
            int warpedI = currentCell.getCol();
            int warpedJ = currentCell.getRow();
            int blockISize = shrunkI.aggregatePtSize(warpedI);
            int blockJSize = shrunkJ.aggregatePtSize(warpedJ);
            if(warpedJ > lastWarpedJ)
                currentJ += shrunkJ.aggregatePtSize(lastWarpedJ);
            if(warpedI > lastWarpedI)
                currentI += shrunkI.aggregatePtSize(lastWarpedI);
            if(warpedJ > lastWarpedJ && warpedI > lastWarpedI)
            {
                super.markVisited(currentI - 1, currentJ);
                super.markVisited(currentI, currentJ - 1);
            }
            for(int x = 0; x < blockISize; x++)
            {
                super.markVisited(currentI + x, currentJ);
                super.markVisited(currentI + x, (currentJ + blockJSize) - 1);
            }

            lastWarpedI = warpedI;
            lastWarpedJ = warpedJ;
        }

        super.expandWindow(searchRadius);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?