@Override
  public void terminate(PointCollector collector) throws Exception {
    collector.putDouble(0, dp[m][m]);
  }
This function calculates DTW distance between two input series.
library-udf/src/main/java/org/apache/iotdb/library/dmatch/UDAFDtw.java