2732 lines
79 KiB
Plaintext
2732 lines
79 KiB
Plaintext
## This file is part of SECONDO.
|
|
##
|
|
## Copyright (C) 2015, University in Hagen, Department of Computer Science,
|
|
## Database Systems for New Applications.
|
|
##
|
|
## SECONDO is free software; you can redistribute it and/or modify
|
|
## it under the terms of the GNU General Public License as published by
|
|
## the Free Software Foundation; either version 2 of the License, or
|
|
## (at your option) any later version.
|
|
##
|
|
## SECONDO is distributed in the hope that it will be useful,
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
## GNU General Public License for more details.
|
|
##
|
|
## You should have received a copy of the GNU General Public License
|
|
## along with SECONDO; if not, write to the Free Software
|
|
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
delete database tsa_test_db;
|
|
|
|
#setup pst_test \
|
|
TrajectorySimilarityAlgebra \
|
|
StandardAlgebra \
|
|
DateTimeAlgebra \
|
|
SpatialAlgebra \
|
|
TemporalAlgebra \
|
|
SymbolicTrajectoryAlgebra
|
|
|
|
|
|
### Create temporary database for tests.
|
|
|
|
create database tsa_test_db;
|
|
open database tsa_test_db;
|
|
|
|
|
|
|
|
###
|
|
### Test type constructor 'pointseq'.
|
|
###
|
|
|
|
### Create valid objects.
|
|
|
|
#testcase PointSeqUndefined
|
|
#yields (pointseq undefined)
|
|
query [const pointseq value undefined]
|
|
|
|
#testcase PointSeqEmpty
|
|
#yields (pointseq ())
|
|
query [const pointseq value ()]
|
|
|
|
#testcase PointSeq1Element
|
|
#yields (pointseq ((1.0 2.3)))
|
|
query [const pointseq value ((1.0 2.3))]
|
|
|
|
#testcase PointSeq2Elements
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
query [const pointseq value ((1.0 2.3) (-2.0 0.0))]
|
|
|
|
#testcase PointSeqLet
|
|
#yields ()
|
|
let ps = [const pointseq value ((1.0 2.3) (-2.0 0.0))]
|
|
|
|
#testcase PointSeqReadObject
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
## Works only after test case PointSeqLet.
|
|
query ps
|
|
|
|
|
|
### Create invalid objects.
|
|
|
|
#testcase PointSeqErrorAtom
|
|
#yields error
|
|
query [const pointseq value bad]
|
|
|
|
#testcase PointSeqErrorAtomElement
|
|
#yields error
|
|
query [const pointseq value (bad)]
|
|
|
|
#testcase PointSeqErrorEmptyElement
|
|
#yields error
|
|
query [const pointseq value (())]
|
|
|
|
#testcase PointSeqErrorElement1Value
|
|
#yields error
|
|
query [const pointseq value ((1.0))]
|
|
|
|
#testcase PointSeqErrorElement3Values
|
|
#yields error
|
|
query [const pointseq value ((1.0 2.0 3.0))]
|
|
|
|
#testcase PointSeqErrorElementIntValue1
|
|
#yields error
|
|
query [const pointseq value ((1 2.0))]
|
|
|
|
#testcase PointSeqErrorElementIntValue2
|
|
#yields error
|
|
query [const pointseq value ((1.0 2))]
|
|
|
|
#testcase PointSeqErrorElementNAN
|
|
#yields error
|
|
query [const pointseq value ((NAN 1.0))]
|
|
|
|
#testcase PointSeqErrorElementINF
|
|
#yields error
|
|
query [const pointseq value ((INF 1.0))]
|
|
|
|
|
|
|
|
###
|
|
### Test type constructor 'tpointseq'.
|
|
###
|
|
|
|
### Create valid objects.
|
|
|
|
#testcase TPointSeqUndefined
|
|
#yields (tpointseq undefined)
|
|
query [const tpointseq value undefined]
|
|
|
|
#testcase TPointSeqEmpty
|
|
#yields (tpointseq ())
|
|
query [const tpointseq value ()]
|
|
|
|
#testcase TPointSeq1Element
|
|
#yields (tpointseq (("2015-12-29-01:23:45" (1.0 2.3))))
|
|
query [const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))]
|
|
|
|
#testcase TPointSeq2Elements
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0))))
|
|
query [const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0)))]
|
|
|
|
#testcase TPointSeqLet
|
|
#yields ()
|
|
let tps = [const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))]
|
|
|
|
#testcase TPointSeqReadObject
|
|
#yields (tpointseq (("2015-12-29-01:23:45" (1.0 2.3))))
|
|
## Works only after test case TPointSeqLet.
|
|
query tps
|
|
|
|
|
|
### Create invalid objects.
|
|
|
|
#testcase TPointSeqWrongOrder
|
|
#yields error
|
|
query [const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:23:44" (-2.0 0.0)))]
|
|
|
|
#testcase TPointSeqErrorAtom
|
|
#yields error
|
|
query [const tpointseq value bad]
|
|
|
|
#testcase TPointSeqErrorAtomElement
|
|
#yields error
|
|
query [const tpointseq value (bad)]
|
|
|
|
#testcase TPointSeqErrorEmptyElement
|
|
#yields error
|
|
query [const tpointseq value (())]
|
|
|
|
#testcase TPointSeqErrorElement1Value
|
|
#yields error
|
|
query [const tpointseq value ((1))]
|
|
|
|
#testcase TPointSeqErrorElement3Values
|
|
#yields error
|
|
query [const tpointseq value ((1 2 3))]
|
|
|
|
#testcase PointSeqErrorInstantUndefined
|
|
#yields error
|
|
query [const tpointseq value ((undefined (1.0 2.0)))]
|
|
|
|
#testcase PointSeqErrorInstantInvalid
|
|
#yields error
|
|
query [const tpointseq value ((bad (1.0 2.0)))]
|
|
|
|
#testcase PointSeqErrorPointInvalid
|
|
#yields error
|
|
query [const tpointseq value (("2015-12-29-01:23:45" (bad 2.0)))]
|
|
|
|
|
|
|
|
###
|
|
### Test (general) operator 'isdefined'.
|
|
###
|
|
|
|
#testcase IsDefinedPointSeqUndefined
|
|
#yields (bool FALSE)
|
|
query isdefined([const pointseq value undefined])
|
|
|
|
#testcase IsDefinedPointSeq0
|
|
#yields (bool TRUE)
|
|
query isdefined([const pointseq value ()])
|
|
|
|
#testcase IsDefinedPointSeq1
|
|
#yields (bool TRUE)
|
|
query isdefined([const pointseq value ((1.0 2.3))])
|
|
|
|
#testcase IsDefinedTPointSeqUndefined
|
|
#yields (bool FALSE)
|
|
query isdefined([const tpointseq value undefined])
|
|
|
|
#testcase IsDefinedTPointSeq0
|
|
#yields (bool TRUE)
|
|
query isdefined([const tpointseq value ()])
|
|
|
|
#testcase IsDefinedTPointSeq1
|
|
#yields (bool TRUE)
|
|
query isdefined([const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'isempty'.
|
|
###
|
|
|
|
#testcase IsDefinedPointSeqUndefined
|
|
#yields (bool TRUE)
|
|
query isempty([const pointseq value undefined])
|
|
|
|
#testcase IsDefinedPointSeq0
|
|
#yields (bool TRUE)
|
|
query isempty([const pointseq value ()])
|
|
|
|
#testcase IsDefinedPointSeq1
|
|
#yields (bool FALSE)
|
|
query isempty([const pointseq value ((1.0 2.3))])
|
|
|
|
#testcase IsDefinedTPointSeqUndefined
|
|
#yields (bool TRUE)
|
|
query isempty([const tpointseq value undefined])
|
|
|
|
#testcase IsDefinedTPointSeq0
|
|
#yields (bool TRUE)
|
|
query isempty([const tpointseq value ()])
|
|
|
|
#testcase IsDefinedTPointSeq1
|
|
#yields (bool FALSE)
|
|
query isempty([const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'no_components'.
|
|
###
|
|
|
|
#testcase NoComponentsPointSeqUndefined
|
|
#yields (int 0)
|
|
query no_components([const pointseq value undefined])
|
|
|
|
#testcase NoComponentsPointSeq0
|
|
#yields (int 0)
|
|
query no_components([const pointseq value ()])
|
|
|
|
#testcase NoComponentsPointSeq1
|
|
#yields (int 1)
|
|
query no_components([const pointseq value ((1.0 2.3))])
|
|
|
|
#testcase NoComponentsPointSeq2
|
|
#yields (int 2)
|
|
query no_components([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase NoComponentsTPointSeqUndefined
|
|
#yields (int 0)
|
|
query no_components([const tpointseq value undefined])
|
|
|
|
#testcase NoComponentsTPointSeq0
|
|
#yields (int 0)
|
|
query no_components([const tpointseq value ()])
|
|
|
|
#testcase NoComponentsTPointSeq1
|
|
#yields (int 1)
|
|
query no_components([const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))])
|
|
|
|
#testcase NoComponentsTPointSeq2
|
|
#yields (int 2)
|
|
query no_components([const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'to_dline'.
|
|
###
|
|
|
|
#testcase ToDLinePointSeqUndefined
|
|
#yields (dline undefined)
|
|
## The list representation of the undefined dline is '()' and not 'undefined'.
|
|
query to_dline([const pointseq value undefined])
|
|
|
|
#testcase ToDLinePointSeq0
|
|
#yields (dline ())
|
|
query to_dline([const pointseq value ()])
|
|
|
|
#testcase ToDLinePointSeq1
|
|
#yields (dline ())
|
|
query to_dline([const pointseq value ((1.0 2.3))])
|
|
|
|
#testcase ToDLinePointSeq2
|
|
#yields (dline ((1.0 2.3 -2.0 0.0)))
|
|
query to_dline([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase ToDLinePointSeq3
|
|
#yields (dline ((1.0 2.3 -2.0 0.0) (-2.0 0.0 4.5 6.7)))
|
|
query to_dline([const pointseq value ((1.0 2.3) (-2.0 0.0) (4.5 6.7))])
|
|
|
|
#testcase ToDLineTPointSeqUndefined
|
|
#yields (dline undefined)
|
|
## The list representation of the undefined dline is '()' and not 'undefined'.
|
|
query to_dline([const tpointseq value undefined])
|
|
|
|
#testcase ToDLineTPointSeq0
|
|
#yields (dline ())
|
|
query to_dline([const tpointseq value ()])
|
|
|
|
#testcase ToDLineTPointSeq1
|
|
#yields (dline ())
|
|
query to_dline([const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))])
|
|
|
|
#testcase ToDLineTPointSeq2
|
|
#yields (dline ((1.0 2.3 -2.0 0.0)))
|
|
query to_dline([const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0)))])
|
|
|
|
#testcase ToDLineTPointSeq3
|
|
#yields (dline ((1.0 2.3 -2.0 0.0) (-2.0 0.0 4.5 6.7)))
|
|
query to_dline([const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0))
|
|
("2015-12-29-01:35:05" (4.5 6.7)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'to_pointseq'.
|
|
###
|
|
|
|
### to_pointseq : mpoint -> pointseq
|
|
|
|
#testcase ToPointSeqMPointUndefined
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value undefined])
|
|
|
|
#testcase ToPointSeqMPoint0
|
|
#yields (pointseq ())
|
|
query to_pointseq([const mpoint value ()])
|
|
|
|
#testcase ToPointSeqMPoint1
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
)])
|
|
|
|
#testcase ToPointSeqMPoint2
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0) (4.5 6.7)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToPointSeqMPointTemporalGap
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToPointSeqMPointSpatialGap
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-1.5 0.5 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToPointSeqMPointTeleport
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToPointSeqMPointInstantUnitWithNoMove
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
## Second unit contains just one instant and does not move in time. Therefore it
|
|
## shall be skipped.
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 -2.0 0.0))
|
|
)])
|
|
|
|
|
|
### to_pointseq : mpoint x bool -> pointseq
|
|
|
|
#testcase ToPointSeqMPointBoolUndefined
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value undefined], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBool0
|
|
#yields (pointseq ())
|
|
query to_pointseq([const mpoint value ()], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBool1
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBool2
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0) (4.5 6.7)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBoolTemporalGap
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0) (-2.0 0.0) (4.5 6.7)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBoolTemporalGap2
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0) (-2.0 1.0) (4.5 6.7)))
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 1.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBoolSpatialGap
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-1.5 0.5 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBoolTeleport
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToPointSeqMPointBoolInstantUnitWithNoMove
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
## Second unit contains just one instant and does not move in time. Therefore it
|
|
## shall be skipped.
|
|
query to_pointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 -2.0 0.0))
|
|
)], TRUE)
|
|
|
|
|
|
### to_pointseq : tpointseq -> pointseq
|
|
|
|
#testcase ToPointSeqTPointSeqUndefined
|
|
#yields (pointseq undefined)
|
|
query to_pointseq([const tpointseq value undefined])
|
|
|
|
#testcase ToPointSeqTPointSeq0
|
|
#yields (pointseq ())
|
|
query to_pointseq([const tpointseq value ()])
|
|
|
|
#testcase ToPointSeqTPointSeq1
|
|
#yields (pointseq ((1.0 2.3)))
|
|
query to_pointseq([const tpointseq value (("2015-12-29-01:23:45" (1.0 2.3)))])
|
|
|
|
#testcase ToPointSeqTPointSeq2
|
|
#yields (pointseq ((1.0 2.3) (-2.0 0.0)))
|
|
query to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'to_tpointseq'.
|
|
###
|
|
|
|
### to_tpointseq : mpoint -> tpointseq
|
|
|
|
#testcase ToTPointSeqMPointUndefined
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value undefined])
|
|
|
|
#testcase ToTPointSeqMPoint0
|
|
#yields (tpointseq ())
|
|
query to_tpointseq([const mpoint value ()])
|
|
|
|
#testcase ToTPointSeqMPoint1
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
)])
|
|
|
|
#testcase ToTPointSeqMPoint2
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) \
|
|
("2015-12-29-01:30:20" (-2.0 0.0)) \
|
|
("2015-12-29-01:33:05" (4.5 6.7))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToTPointSeqMPointTemporalGap
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToTPointSeqMPointSpatialGap
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-1.5 0.5 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToTPointSeqMPointTeleport
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 4.5 6.7))
|
|
)])
|
|
|
|
#testcase ToTPointSeqMPointInstantUnitWithNoMove
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0))))
|
|
## Second unit contains just one instant and does not move in time. Therefore it
|
|
## shall be skipped.
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 -2.0 0.0))
|
|
)])
|
|
|
|
|
|
### to_tpointseq : mpoint x bool -> tpointseq
|
|
|
|
#testcase ToTPointSeqMPointBoolUndefined
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value undefined], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBool0
|
|
#yields (tpointseq ())
|
|
query to_tpointseq([const mpoint value ()], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBool1
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBool2
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) \
|
|
("2015-12-29-01:30:20" (-2.0 0.0)) \
|
|
("2015-12-29-01:33:05" (4.5 6.7))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBoolTemporalGap
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) \
|
|
("2015-12-29-01:30:20" (-2.0 0.0)) \
|
|
("2015-12-29-01:31:20" (-2.0 0.0)) \
|
|
("2015-12-29-01:33:05" (4.5 6.7))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBoolTemporalGap2
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) \
|
|
("2015-12-29-01:30:20" (-2.0 0.0)) \
|
|
("2015-12-29-01:31:20" (-2.0 1.0)) \
|
|
("2015-12-29-01:33:05" (4.5 6.7))))
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:31:20" "2015-12-29-01:33:05" TRUE FALSE) (-2.0 1.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBoolSpatialGap
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) (-1.5 0.5 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBoolTeleport
|
|
#yields (tpointseq undefined)
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 4.5 6.7))
|
|
)], TRUE)
|
|
|
|
#testcase ToTPointSeqMPointBoolInstantUnitWithNoMove
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (1.0 2.3)) ("2015-12-29-01:30:20" (-2.0 0.0))))
|
|
## Second unit contains just one instant and does not move in time. Therefore it
|
|
## shall be skipped.
|
|
query to_tpointseq([const mpoint value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) (1.0 2.3 -2.0 0.0))
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:30:20" TRUE TRUE) (-2.0 0.0 -2.0 0.0))
|
|
)], TRUE)
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'sample_to_pointseq'.
|
|
###
|
|
|
|
### sample_to_pointseq : tpointseq x duration [x bool [x bool]] -> pointseq
|
|
|
|
#testcase SampleToPointSeqTPointSeqUndefined
|
|
#yields (pointseq undefined)
|
|
query sample_to_pointseq(
|
|
[const tpointseq value undefined], [const duration value (0 1000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq0
|
|
#yields (pointseq ())
|
|
query sample_to_pointseq(
|
|
[const tpointseq value ()], [const duration value (0 1000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq1
|
|
#yields (pointseq ((0.0 0.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq2
|
|
#yields (pointseq ((0.0 0.0) (1.0 0.5) (2.0 1.0) (3.0 1.5)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq2NoEndPoint
|
|
#yields (pointseq ((0.0 0.0) (2.0 1.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 2000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq2KeepEndPoint
|
|
#yields (pointseq ((0.0 0.0) (2.0 1.0) (3.0 1.5)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 2000)],
|
|
[const bool value TRUE])
|
|
|
|
#testcase SampleToPointSeqTPointSeq3
|
|
#yields (pointseq ( \
|
|
(0.0 0.0) (1.0 0.5) (2.0 1.0) (3.0 1.5) (3.0 2.0) (3.0 2.5) (3.0 3.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq3NoMidPoint
|
|
#yields (pointseq ((0.0 0.0) (2.0 1.0) (3.0 2.0) (3.0 3.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 2000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeq3ExactPath
|
|
#yields (pointseq ((0.0 0.0) (2.0 1.0) (3.0 1.5) (3.0 2.0) (3.0 3.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 2000)],
|
|
[const bool value TRUE],
|
|
[const bool value TRUE])
|
|
|
|
#testcase SampleToPointSeqTPointSeqDownSample
|
|
#yields (pointseq ((0.0 0.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 10000)])
|
|
|
|
#testcase SampleToPointSeqTPointSeqDownSampleKeepEndPoint
|
|
#yields (pointseq ((0.0 0.0) (3.0 3.0)))
|
|
query sample_to_pointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 10000)],
|
|
[const bool value TRUE])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'sample_to_tpointseq'.
|
|
###
|
|
|
|
### sample_to_tpointseq : tpointseq x duration [x bool [x bool]] -> tpointseq
|
|
|
|
#testcase SampleToTPointSeqTPointSeqUndefined
|
|
#yields (tpointseq undefined)
|
|
query sample_to_tpointseq(
|
|
[const tpointseq value undefined], [const duration value (0 1000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq0
|
|
#yields (tpointseq ())
|
|
query sample_to_tpointseq(
|
|
[const tpointseq value ()], [const duration value (0 1000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq1
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq2
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:46" (1.0 0.5)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0)) \
|
|
("2015-12-29-01:23:48" (3.0 1.5))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq2NoEndPoint
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 2000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq2KeepEndPoint
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0)) \
|
|
("2015-12-29-01:23:48" (3.0 1.5))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5)))],
|
|
[const duration value (0 2000)],
|
|
[const bool value TRUE])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq3
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:46" (1.0 0.5)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0)) \
|
|
("2015-12-29-01:23:48" (3.0 1.5)) \
|
|
("2015-12-29-01:23:49" (3.0 2.0)) \
|
|
("2015-12-29-01:23:50" (3.0 2.5)) \
|
|
("2015-12-29-01:23:51" (3.0 3.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 1000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq3NoMidPoint
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0)) \
|
|
("2015-12-29-01:23:49" (3.0 2.0)) \
|
|
("2015-12-29-01:23:51" (3.0 3.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 2000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeq3ExactPath
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:47" (2.0 1.0)) \
|
|
("2015-12-29-01:23:48" (3.0 1.5)) \
|
|
("2015-12-29-01:23:49" (3.0 2.0)) \
|
|
("2015-12-29-01:23:51" (3.0 3.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 2000)],
|
|
[const bool value TRUE],
|
|
[const bool value TRUE])
|
|
|
|
#testcase SampleToTPointSeqTPointSeqDownSample
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 10000)])
|
|
|
|
#testcase SampleToTPointSeqTPointSeqDownSampleKeepEndPoint
|
|
#yields (tpointseq ( \
|
|
("2015-12-29-01:23:45" (0.0 0.0)) \
|
|
("2015-12-29-01:23:51" (3.0 3.0))))
|
|
query sample_to_tpointseq([const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:23:48" (3.0 1.5))
|
|
("2015-12-29-01:23:51" (3.0 3.0)))],
|
|
[const duration value (0 10000)],
|
|
[const bool value TRUE])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_origin'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistOriginParams0
|
|
#yields error
|
|
query dist_origin()
|
|
|
|
#testcase DistOriginParams1
|
|
#yields error
|
|
query dist_origin([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistOriginParams3
|
|
#yields error
|
|
query dist_origin(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
|
|
### dist_origin : pointseq x pointseq [x geoid] -> real
|
|
|
|
#tolerance_real %0.1
|
|
|
|
#testcase DistOriginPointSeq
|
|
#yields (real 1.86)
|
|
query dist_origin(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginPointSeqSymmetry
|
|
#yields (real 1.86)
|
|
query dist_origin(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistOriginPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_origin(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginPointSeqGeoid
|
|
#yields (real 206000.0)
|
|
query dist_origin(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
create_geoid("WGS1984"))
|
|
|
|
#testcase DistOriginPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_origin(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_origin(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined])
|
|
|
|
#testcase DistOriginPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_origin(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_origin(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()])
|
|
|
|
|
|
### dist_origin : tpointseq x tpointseq [x geoid] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistOriginTPointSeq
|
|
#yields (real 1.86)
|
|
query dist_origin(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_destination'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistDestinationParams0
|
|
#yields error
|
|
query dist_destination()
|
|
|
|
#testcase DistDestinationParams1
|
|
#yields error
|
|
query dist_destination([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistDestinationParams3
|
|
#yields error
|
|
query dist_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
|
|
### dist_destination : pointseq x pointseq [x geoid] -> real
|
|
|
|
#tolerance_real %0.1
|
|
|
|
#testcase DistDestinationPointSeq
|
|
#yields (real 4.06)
|
|
query dist_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistDestinationPointSeqSymmetry
|
|
#yields (real 4.06)
|
|
query dist_destination(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistDestinationPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_destination(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistDestinationPointSeqGeoid
|
|
#yields (real 449500.0)
|
|
query dist_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
create_geoid("WGS1984"))
|
|
|
|
#testcase DistDestinationPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_destination(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistDestinationPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined])
|
|
|
|
#testcase DistDestinationPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_destination(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistDestinationPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()])
|
|
|
|
|
|
### dist_destination : tpointseq x tpointseq [x geoid] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistDestinationTPointSeq
|
|
#yields (real 4.06)
|
|
query dist_destination(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_origin_and_destination'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistOriginAndDestinationParams0
|
|
#yields error
|
|
query dist_origin_and_destination()
|
|
|
|
#testcase DistOriginAndDestinationParams1
|
|
#yields error
|
|
query dist_origin_and_destination([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistOriginAndDestinationParams3
|
|
#yields error
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
|
|
### dist_origin_and_destination : pointseq x pointseq [x geoid] -> real
|
|
|
|
#tolerance_real %0.1
|
|
|
|
#testcase DistOriginAndDestinationPointSeq
|
|
#yields (real 5.92)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqSymmetry
|
|
#yields (real 5.92)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqGeoid
|
|
#yields (real 655570.0)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
create_geoid("WGS1984"))
|
|
|
|
#testcase DistOriginAndDestinationPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistOriginAndDestinationPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_origin_and_destination(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()])
|
|
|
|
|
|
### dist_origin_and_destination : tpointseq x tpointseq [x geoid] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistOriginAndDestinationTPointSeq
|
|
#yields (real 5.92)
|
|
query dist_origin_and_destination(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_euclidean'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistEuclideanParams0
|
|
#yields error
|
|
query dist_euclidean()
|
|
|
|
#testcase DistEuclideanParams1
|
|
#yields error
|
|
query dist_euclidean([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistEuclideanParams3
|
|
#yields error
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
|
|
### dist_euclidean : pointseq x pointseq [x geoid] -> real
|
|
|
|
#tolerance_real %0.1
|
|
|
|
#testcase DistEuclideanPointSeq
|
|
#yields (real 4.467)
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistEuclideanPointSeqSymmetry
|
|
#yields (real 4.467)
|
|
query dist_euclidean(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistEuclideanPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_euclidean(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistEuclideanPointSeqGeoid
|
|
#yields (real 494480.0)
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
create_geoid("WGS1984"))
|
|
|
|
#testcase DistEuclideanPointSeqDifferentLengths
|
|
#yields (real undefined)
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0) (-2.5 0.7))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistEuclideanPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_euclidean(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistEuclideanPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined])
|
|
|
|
#testcase DistEuclideanPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_euclidean(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistEuclideanPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_euclidean(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()])
|
|
|
|
|
|
### dist_euclidean : tpointseq x tpointseq [x geoid] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistEuclideanTPointSeq
|
|
#yields (real 4.467)
|
|
query dist_euclidean(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'lcss'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase LCSSParams0
|
|
#yields error
|
|
query lcss()
|
|
|
|
#testcase LCSSParams1
|
|
#yields error
|
|
query lcss([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase LCSSParams2
|
|
#yields error
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase LCSSParams3
|
|
#yields error
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5],
|
|
[const real value 2.5])
|
|
|
|
|
|
### lcss : pointseq x pointseq x real [x int] -> int
|
|
|
|
#testcase LCSSPointSeq
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqSymmetry
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqVariant2
|
|
#yields (int 2)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (-0.6 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqVariant3
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqVariant4
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.8))],
|
|
[const pointseq value ((2.5 -0.7) (2.6 3.8))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqDelta0
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 0])
|
|
|
|
#testcase LCSSPointSeqDelta1
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 1])
|
|
|
|
#testcase LCSSPointSeqEqual
|
|
#yields (int 2)
|
|
query lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqDifferentLengths
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0) (-2.5 0.7))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqUndefined1
|
|
#yields (int undefined)
|
|
query lcss(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqUndefined2
|
|
#yields (int undefined)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqEmpty1
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase LCSSPointSeqEmpty2
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()],
|
|
[const real value 1.5])
|
|
|
|
|
|
### lcss : tpointseq x tpointseq x real [x int] -> int
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase LCSSTPointSeq
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))],
|
|
[const real value 1.5])
|
|
|
|
|
|
### lcss : mlabel x mlabel [x int] -> int
|
|
|
|
#testcase LCSSMLabel
|
|
#yields (int 2)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase LCSSMLabelSymmetry
|
|
#yields (int 2)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase LCSSMLabelVariant2
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_D'))])
|
|
|
|
#testcase LCSSMLabelVariant3
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_A'))])
|
|
|
|
#testcase LCSSMLabelVariant4
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_D')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_E'))])
|
|
|
|
#testcase LCSSMLabelDelta0
|
|
#yields (int 1)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))],
|
|
0)
|
|
|
|
#testcase LCSSMLabelDelta1
|
|
#yields (int 2)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))],
|
|
1)
|
|
|
|
#testcase LCSSMLabelEqual
|
|
#yields (int 3)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase LCSSMLabelUndefined1
|
|
#yields (int undefined)
|
|
query lcss(
|
|
[const mlabel value undefined],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase LCSSMLabelUndefined2
|
|
#yields (int undefined)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value undefined])
|
|
|
|
#testcase LCSSMLabelEmpty1
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const mlabel value ()],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase LCSSMLabelEmpty2
|
|
#yields (int 0)
|
|
query lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value ()])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'rel_lcss'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase RelLCSSParams0
|
|
#yields error
|
|
query rel_lcss()
|
|
|
|
#testcase RelLCSSParams1
|
|
#yields error
|
|
query rel_lcss([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase RelLCSSParams2
|
|
#yields error
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase RelLCSSParams3
|
|
#yields error
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5],
|
|
[const real value 2.5])
|
|
|
|
|
|
### rel_lcss : pointseq x pointseq x real [x int] -> real
|
|
|
|
#testcase RelLCSSPointSeq
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqSymmetry
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqVariant2
|
|
#yields (real 1.0)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (-0.6 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqVariant3
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqVariant4
|
|
#yields (real 0.0)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.8))],
|
|
[const pointseq value ((2.5 -0.7) (2.6 3.8))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqDelta0
|
|
#yields (real 0.0)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 0])
|
|
|
|
#testcase RelLCSSPointSeqDelta1
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 1])
|
|
|
|
#testcase RelLCSSPointSeqEqual
|
|
#yields (real 1.0)
|
|
query rel_lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqDifferentLengths
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0) (-2.5 0.7))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query rel_lcss(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query rel_lcss(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase RelLCSSPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query rel_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()],
|
|
[const real value 1.5])
|
|
|
|
|
|
### rel_lcss : tpointseq x tpointseq x real [x int] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase RelLCSSTPointSeq
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))],
|
|
[const real value 1.5])
|
|
|
|
|
|
### rel_lcss : mlabel x mlabel [x int] -> real
|
|
# (Performing only basic tests, since this is the same implementation as for
|
|
# pointseqs in combination with the lcss implementation for mlabels.)
|
|
|
|
#testcase RelLCSSMLabel
|
|
#yields (real 1.0)
|
|
query rel_lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase RelLCSSMLabelDelta
|
|
#yields (real 0.5)
|
|
query rel_lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))],
|
|
0)
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_lcss'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistLCSSParams0
|
|
#yields error
|
|
query dist_lcss()
|
|
|
|
#testcase DistLCSSParams1
|
|
#yields error
|
|
query dist_lcss([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistLCSSParams2
|
|
#yields error
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistLCSSParams3
|
|
#yields error
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5],
|
|
[const real value 2.5])
|
|
|
|
|
|
### dist_lcss : pointseq x pointseq x real [x int] -> real
|
|
|
|
#testcase DistLCSSPointSeq
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqSymmetry
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqVariant2
|
|
#yields (real 0.0)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 1.2) (-0.6 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqVariant3
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 1.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqVariant4
|
|
#yields (real 1.0)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.8))],
|
|
[const pointseq value ((2.5 -0.7) (2.6 3.8))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqDelta0
|
|
#yields (real 1.0)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 0])
|
|
|
|
#testcase DistLCSSPointSeqDelta1
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (2.0 0.0))],
|
|
[const pointseq value ((2.5 0.2) (-2.0 3.2))],
|
|
[const real value 1.5], [const int value 1])
|
|
|
|
#testcase DistLCSSPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_lcss(
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqDifferentLengths
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0) (-2.5 0.7))],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_lcss(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_lcss(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const real value 1.5])
|
|
|
|
#testcase DistLCSSPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_lcss(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()],
|
|
[const real value 1.5])
|
|
|
|
|
|
### dist_lcss : tpointseq x tpointseq x real [x int] -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistLCSSTPointSeq
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (1.0 2.3))
|
|
("2015-12-29-01:30:20" (-2.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (2.5 1.2))
|
|
("2015-12-29-01:32:28" (0.5 3.2)))],
|
|
[const real value 1.5])
|
|
|
|
|
|
### dist_lcss : mlabel x mlabel [x int] -> real
|
|
# (Performing only basic tests, since this is the same implementation as for
|
|
# pointseqs in combination with the lcss implementation for mlabels.)
|
|
|
|
#testcase DistLCSSMLabel
|
|
#yields (real 0.0)
|
|
query dist_lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))])
|
|
|
|
#testcase DistLCSSMLabelDelta
|
|
#yields (real 0.5)
|
|
query dist_lcss(
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_B')
|
|
(("2015-12-29-01:33:05" "2015-12-29-01:35:00" TRUE FALSE) 'Label_C'))],
|
|
[const mlabel value (
|
|
(("2015-12-29-01:23:45" "2015-12-29-01:30:20" TRUE FALSE) 'Label_A')
|
|
(("2015-12-29-01:30:20" "2015-12-29-01:33:05" TRUE FALSE) 'Label_C'))],
|
|
0)
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_lip'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistLIPParams0
|
|
#yields error
|
|
query dist_lip()
|
|
|
|
#testcase DistLIPParams1
|
|
#yields error
|
|
query dist_lip([const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
#testcase DistLIPParams3
|
|
#yields error
|
|
query dist_lip(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))])
|
|
|
|
|
|
### dist_lip : pointseq x pointseq -> real
|
|
|
|
#testcase DistLIPPointSeq
|
|
#yields (real 0.75)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))])
|
|
|
|
#testcase DistLIPPointSeqSymmetry1
|
|
#yields (real 0.75)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))])
|
|
|
|
#testcase DistLIPPointSeqSymmetry2
|
|
#yields (real 0.75)
|
|
query dist_lip(
|
|
[const pointseq value ((1.0 0.0) (0.0 0.0))],
|
|
[const pointseq value ((1.0 0.5) (0.0 1.0))])
|
|
|
|
#testcase DistLIPPointSeqVariant2
|
|
#yields (real 0.75)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (0.2 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))])
|
|
|
|
#testcase DistLIPPointSeqCross
|
|
#yields (real 0.25)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.0))])
|
|
|
|
#testcase DistLIPPointSeqCrossExplicit
|
|
#yields (real 0.25)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (0.5 0.5) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (0.5 0.5) (1.0 0.0))])
|
|
|
|
#testcase DistLIPPointSeqNoSegments
|
|
#yields (real undefined)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0))])
|
|
|
|
#testcase DistLIPPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))])
|
|
|
|
#testcase DistLIPPointSeqFlat
|
|
#yields (real 0.0)
|
|
query dist_lip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0) (2.0 0.0) (3.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.3 0.0))])
|
|
|
|
#testcase DistLIPPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query dist_lip(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistLIPPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query dist_lip(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined])
|
|
|
|
#testcase DistLIPPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query dist_lip(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))])
|
|
|
|
#testcase DistLIPPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query dist_lip(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()])
|
|
|
|
#testcase DistLIPPointSeqLoops
|
|
#yields (real 6.0)
|
|
query dist_lip(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.0 0.0) (2.0 -1.0) (3.0 -1.0))])
|
|
|
|
#testcase DistLIPPointSeqLoops2
|
|
#yields (real 6.0)
|
|
query dist_lip(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.8 2.0) (1.6 2.0) (1.4 2.0)
|
|
(1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.8 0.0) (1.6 0.0) (1.4 0.0)
|
|
(1.0 0.0) (2.0 -1.0) (3.0 -1.0))])
|
|
|
|
|
|
### dist_lip : tpointseq x tpointseq -> real
|
|
# (Performing only a basic test, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase DistLIPTPointSeq
|
|
#yields (real 0.75)
|
|
query dist_lip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (0.0 1.0))
|
|
("2015-12-29-01:32:28" (1.0 0.5)))])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_stlip'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistSTLIPParams0
|
|
#yields error
|
|
query dist_stlip()
|
|
|
|
#testcase DistSTLIPParams1
|
|
#yields error
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))])
|
|
|
|
#testcase DistSTLIPParams2
|
|
#yields error
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0)) ("2015-12-29-01:30:20" (1.0 0.5)))])
|
|
|
|
#testcase DistSTLIPParams3
|
|
#yields error
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0)) ("2015-12-29-01:30:20" (1.0 0.5)))])
|
|
|
|
|
|
### dist_stlip : tpointseq x tpointseq x real x duration -> real
|
|
|
|
#testcase DistSTLIPTPointSeq
|
|
#yields (real 0.75)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0))
|
|
("2015-12-29-01:30:20" (1.0 0.5)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPTPointSeqSymmetry
|
|
#yields (real 0.75)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0))
|
|
("2015-12-29-01:30:20" (1.0 0.5)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPTPointSeqVariant2
|
|
#yields (real 0.75)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:25:00" (0.5 0.75))
|
|
("2015-12-29-01:30:00" (1.0 0.5)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPTPointSeqVariant3
|
|
#yields (real 0.75)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0))
|
|
("2015-12-29-01:30:20" (1.0 0.5)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 60000)])
|
|
|
|
#testcase DistSTLIPTPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPTPointSeqSkewedInstants
|
|
#yields (real 0.75)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:22:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:28:00" (0.5 0.75))
|
|
("2015-12-29-01:30:00" (1.0 0.5)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqCross
|
|
#yields (real 0.375)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqCrossExplicit
|
|
#yields (real 0.375)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:25:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqSkewedCross
|
|
#yields (real 0.425)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:27:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqSkewedCrossSymmetry
|
|
#yields (real 0.425)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:27:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqSkewedCrossSTFactor0
|
|
## (This yields the same result as the dist_lip operator.)
|
|
#yields (real 0.25)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:27:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)])
|
|
|
|
#testcase DistSTLIPPointSeqSkewedCrossDelta4Min
|
|
## (This cancels out the effects of the skewed intersection.)
|
|
#yields (real 0.375)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:27:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 240000)])
|
|
|
|
#testcase DistSTLIPPointSeqSkewedCrossDelta1Min
|
|
## (This lowers the effects of the skewed intersection.)
|
|
#yields (real 0.4125)
|
|
query dist_stlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:27:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 1.0],
|
|
[const duration value (0 60000)])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'dist_spstlip2'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase DistSPSTLIP2Params0
|
|
#yields error
|
|
query dist_spstlip2()
|
|
|
|
#testcase DistSPSTLIP2Params1
|
|
#yields error
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))])
|
|
|
|
#testcase DistSPSTLIP2Params2
|
|
#yields error
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0)) ("2015-12-29-01:30:20" (1.0 0.5)))])
|
|
|
|
#testcase DistSPSTLIP2Params3
|
|
#yields error
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0)) ("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 1.0)) ("2015-12-29-01:30:20" (1.0 0.5)))])
|
|
|
|
|
|
### dist_spstlip2 : tpointseq x tpointseq x real x duration x real -> real
|
|
|
|
#testcase DistSPSTLIP2TPointSeq
|
|
#yields (real 1.0)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqTimeShift
|
|
#yields (real 1.0)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:40:00" (0.0 1.0))
|
|
("2015-12-29-01:50:00" (1.0 1.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqTimeStretch
|
|
#yields (real 1.333)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:15:00" (0.0 0.0))
|
|
("2015-12-29-01:35:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqTimeStretchSymmetry
|
|
#yields (real 1.333)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:15:00" (0.0 0.0))
|
|
("2015-12-29-01:35:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqVariant
|
|
#yields (real 0.792)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-02:23:45" (0.0 1.0))
|
|
("2015-12-29-02:30:20" (1.0 0.5)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqVariant2
|
|
#yields (real 0.792)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-02:20:00" (0.0 1.0))
|
|
("2015-12-29-02:25:00" (0.5 0.75))
|
|
("2015-12-29-02:30:00" (1.0 0.5)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2TPointSeqEqual
|
|
#yields (real 0.0)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2PointSeqCross
|
|
#yields (real 0.25)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-02:20:00" (0.0 1.0))
|
|
("2015-12-29-02:30:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2PointSeqCrossExplicit
|
|
#yields (real 0.25)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:25:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-02:20:00" (0.0 1.0))
|
|
("2015-12-29-02:25:00" (0.5 0.5))
|
|
("2015-12-29-02:30:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2PointSeqSkewedCross
|
|
#yields (real 0.35)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-02:20:00" (0.0 1.0))
|
|
("2015-12-29-02:27:00" (0.5 0.5))
|
|
("2015-12-29-02:30:00" (1.0 0.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
#testcase DistSPSTLIP2PointSeqSkewedCrossSymmetry
|
|
#yields (real 0.35)
|
|
query dist_spstlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-02:20:00" (0.0 1.0))
|
|
("2015-12-29-02:27:00" (0.5 0.5))
|
|
("2015-12-29-02:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:23:00" (0.5 0.5))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0])
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'genlip'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase GenLIPPointSeqParamsInconsistent
|
|
#yields error
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqParamsFunctionWithBadParamType
|
|
#yields error
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq)
|
|
dist_stlip(seq1, seq2, 0.0, [const duration value (0 0)]))
|
|
|
|
|
|
### genlip : pointseq x pointseq x int x (pointseq x pointseq -> real) -> real
|
|
# (This repeats the dist_lip tests.)
|
|
|
|
#testcase GenLIPPointSeq
|
|
#yields (real 0.75)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqSymmetry1
|
|
#yields (real 0.75)
|
|
query genlip(
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqSymmetry2
|
|
#yields (real 0.75)
|
|
query genlip(
|
|
[const pointseq value ((1.0 0.0) (0.0 0.0))],
|
|
[const pointseq value ((1.0 0.5) (0.0 1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqVariant2
|
|
# (Note: GenLIP considers only the minimum length of the two sequences.)
|
|
#yields (real 0.55)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (0.2 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqCross
|
|
#yields (real 0.25)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqCrossExplicit
|
|
#yields (real 0.25)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (0.5 0.5) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (0.5 0.5) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqNoSegments
|
|
#yields (real undefined)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqEqual
|
|
#yields (real 0.0)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqFlat
|
|
#yields (real 0.0)
|
|
query genlip(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0) (2.0 0.0) (3.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.3 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqUndefined1
|
|
#yields (real undefined)
|
|
query genlip(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqUndefined2
|
|
#yields (real undefined)
|
|
query genlip(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqEmpty1
|
|
#yields (real undefined)
|
|
query genlip(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqEmpty2
|
|
#yields (real undefined)
|
|
query genlip(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqLoops
|
|
#yields (real 6.0)
|
|
query genlip(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.0 0.0) (2.0 -1.0) (3.0 -1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPPointSeqLoops2
|
|
# (The GenLIP algorithm detects such long loop.)
|
|
#yields (real 7.36)
|
|
query genlip(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.8 2.0) (1.6 2.0) (1.4 2.0)
|
|
(1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.8 0.0) (1.6 0.0) (1.4 0.0)
|
|
(1.0 0.0) (2.0 -1.0) (3.0 -1.0))],
|
|
[const int value 2],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
|
|
### genlip : tpointseq x tpointseq x int x (tpointseq x tpointseq -> real)
|
|
### -> real
|
|
# (Performing only few basic tests, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase GenLIPTPointSeq
|
|
#yields (real 0.75)
|
|
query genlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (0.0 1.0))
|
|
("2015-12-29-01:32:28" (1.0 0.5)))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIPTPointSeq2
|
|
#yields (real 1.0)
|
|
query genlip(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq)
|
|
dist_spstlip2(seq1, seq2,
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0]))
|
|
|
|
|
|
|
|
###
|
|
### Test operator 'genlip2'.
|
|
###
|
|
|
|
### Bad parameters
|
|
|
|
#testcase GenLIP2PointSeqParamsInconsistent
|
|
#yields error
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqParamsFunctionWithBadParamType
|
|
#yields error
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq)
|
|
dist_stlip(seq1, seq2, 0.0, [const duration value (0 0)]))
|
|
|
|
|
|
### genlip2 : pointseq x pointseq x int x (pointseq x pointseq -> real) -> real
|
|
# (This repeats the dist_lip tests.)
|
|
|
|
#testcase GenLIP2PointSeq
|
|
#yields (real 0.75)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqSymmetry1
|
|
#yields (real 0.75)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqSymmetry2
|
|
#yields (real 0.75)
|
|
query genlip2(
|
|
[const pointseq value ((1.0 0.0) (0.0 0.0))],
|
|
[const pointseq value ((1.0 0.5) (0.0 1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqVariant2
|
|
# (Note: In contrast to GenLIP, GenLIP2 also considers additional segments of
|
|
# the longer sequence.)
|
|
#yields (real 0.75)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (0.2 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.5))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqCross
|
|
#yields (real 0.25)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqCrossExplicit
|
|
#yields (real 0.25)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (0.5 0.5) (1.0 1.0))],
|
|
[const pointseq value ((0.0 1.0) (0.5 0.5) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqNoSegments
|
|
#yields (real undefined)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqEqual
|
|
#yields (real 0.0)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqFlat
|
|
#yields (real 0.0)
|
|
query genlip2(
|
|
[const pointseq value ((0.0 0.0) (1.0 0.0) (2.0 0.0) (3.0 0.0))],
|
|
[const pointseq value ((0.0 0.0) (1.3 0.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqUndefined1
|
|
#yields (real undefined)
|
|
query genlip2(
|
|
[const pointseq value undefined],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqUndefined2
|
|
#yields (real undefined)
|
|
query genlip2(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value undefined],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqEmpty1
|
|
#yields (real undefined)
|
|
query genlip2(
|
|
[const pointseq value ()],
|
|
[const pointseq value ((2.5 1.2) (0.5 3.2))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqEmpty2
|
|
#yields (real undefined)
|
|
query genlip2(
|
|
[const pointseq value ((1.0 2.3) (-2.0 0.0))],
|
|
[const pointseq value ()],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqLoops
|
|
#yields (real 6.0)
|
|
query genlip2(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.0 0.0) (2.0 -1.0) (3.0 -1.0))],
|
|
[const int value 3],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2PointSeqLoops2
|
|
# (The GenLIP algorithm detects such long loop.)
|
|
#yields (real 7.36)
|
|
query genlip2(
|
|
[const pointseq value (
|
|
(0.0 1.0) (1.0 1.0) (2.0 2.0) (1.8 2.0) (1.6 2.0) (1.4 2.0)
|
|
(1.0 2.0) (2.0 1.0) (3.0 1.0))],
|
|
[const pointseq value (
|
|
(0.0 -1.0) (1.0 -1.0) (2.0 0.0) (1.8 0.0) (1.6 0.0) (1.4 0.0)
|
|
(1.0 0.0) (2.0 -1.0) (3.0 -1.0))],
|
|
[const int value 2],
|
|
fun(seq1 : pointseq, seq2 : pointseq) dist_lip(seq1, seq2))
|
|
|
|
|
|
### genlip2 : tpointseq x tpointseq x int x (tpointseq x tpointseq -> real)
|
|
### -> real
|
|
# (Performing only few basic tests, since this is the same implementation as for
|
|
# pointseqs.)
|
|
|
|
#testcase GenLIP2TPointSeq
|
|
#yields (real 0.75)
|
|
query genlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:23:45" (0.0 0.0))
|
|
("2015-12-29-01:30:20" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:21:16" (0.0 1.0))
|
|
("2015-12-29-01:32:28" (1.0 0.5)))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq) dist_lip(seq1, seq2))
|
|
|
|
#testcase GenLIP2TPointSeq2
|
|
#yields (real 1.0)
|
|
query genlip2(
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 0.0))
|
|
("2015-12-29-01:30:00" (1.0 0.0)))],
|
|
[const tpointseq value (
|
|
("2015-12-29-01:20:00" (0.0 1.0))
|
|
("2015-12-29-01:30:00" (1.0 1.0)))],
|
|
[const int value 3],
|
|
fun(seq1 : tpointseq, seq2 : tpointseq)
|
|
dist_spstlip2(seq1, seq2,
|
|
[const real value 0.0],
|
|
[const duration value (0 0)],
|
|
[const real value 1.0]))
|
|
|
|
|
|
|
|
#teardown
|
|
|
|
close database;
|
|
delete database tsa_test_db;
|