Diff of the two buildlogs: -- --- b1/build.log 2024-05-11 12:13:18.710411130 +0000 +++ b2/build.log 2024-05-11 12:45:13.288946501 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Fri Jun 13 06:32:50 -12 2025 -I: pbuilder-time-stamp: 1749839570 +I: Current time: Sun May 12 02:13:22 +14 2024 +I: pbuilder-time-stamp: 1715429602 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -36,52 +36,84 @@ dpkg-source: info: applying octave9.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/602900/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/D01_modify_environment starting +debug: Running on ionos1-amd64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 May 11 12:13 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.21(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=20 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='a0abe26c19db4867953d704292c82345' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='602900' - PS1='# ' - PS2='> ' + INVOCATION_ID=c6686d52238a40d1b98053530705ac23 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=567283 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.gKR3Eaie/pbuilderrc_ADV8 --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.gKR3Eaie/b1 --logfile b1/build.log octave-level-set_0.3.1~git.2019.04.13-7.dsc' - SUDO_GID='111' - SUDO_UID='106' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://213.165.73.152:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.gKR3Eaie/pbuilderrc_9jyG --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.gKR3Eaie/b2 --logfile b2/build.log octave-level-set_0.3.1~git.2019.04.13-7.dsc' + SUDO_GID=110 + SUDO_UID=105 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://46.16.76.132:3128 I: uname -a - Linux ionos15-amd64 6.6.13+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1~bpo12+1 (2024-02-15) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Jun 11 17:46 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/602900/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 May 11 11:25 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -664,7 +696,7 @@ Get: 537 http://deb.debian.org/debian trixie/main amd64 dh-octave all 1.8.0 [22.7 kB] Get: 538 http://deb.debian.org/debian trixie/main amd64 octave-struct amd64 1.0.18-3+b1 [37.6 kB] Get: 539 http://deb.debian.org/debian trixie/main amd64 octave-parallel amd64 4.0.2-1 [205 kB] -Fetched 236 MB in 2s (105 MB/s) +Fetched 236 MB in 16s (14.8 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package autoconf-archive. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19699 files and directories currently installed.) @@ -2877,7 +2909,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-level-set_0.3.1~git.2019.04.13-7_source.changes +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-level-set_0.3.1~git.2019.04.13-7_source.changes dpkg-buildpackage: info: source package octave-level-set dpkg-buildpackage: info: source version 0.3.1~git.2019.04.13-7 dpkg-buildpackage: info: source distribution unstable @@ -2929,20 +2965,20 @@ g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection Utils.cpp -o Utils.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose internal_fastmarching.cpp FastMarching.o Utils.o -o __levelset_internal_fastmarching.oct CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose internal_init_narrowband.cpp FastMarching.o Utils.o -o __levelset_internal_init_narrowband.oct +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_fastmarching.cpp -o /tmp/oct-tWWbmi.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose geomElements.cpp FastMarching.o Utils.o -o __levelset_geomElements.oct +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_init_narrowband.cpp -o /tmp/oct-lBAEic.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose geomBoundary.cpp FastMarching.o Utils.o -o __levelset_geomBoundary.oct +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomElements.cpp -o /tmp/oct-VFerkm.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomBoundary.cpp -o /tmp/oct-yroX5U.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose geomGamma.cpp FastMarching.o Utils.o -o __levelset_geomGamma.oct CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose nbFromGeom.cpp FastMarching.o Utils.o -o __levelset_nbFromGeom.oct +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomGamma.cpp -o /tmp/oct-Aei0Yq.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose internal_mesh.cpp FastMarching.o Utils.o -o __levelset_internal_mesh.oct +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection nbFromGeom.cpp -o /tmp/oct-Nd4G8K.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection" /usr/bin/mkoctfile --verbose upwindGrad.cpp FastMarching.o Utils.o -o __levelset_upwindGrad.oct -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_fastmarching.cpp -o /tmp/oct-xSxESY.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_init_narrowband.cpp -o /tmp/oct-f2oUAq.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomElements.cpp -o /tmp/oct-1Oysnz.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomBoundary.cpp -o /tmp/oct-xKTgcr.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection geomGamma.cpp -o /tmp/oct-SDo0go.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection nbFromGeom.cpp -o /tmp/oct-eRcAFU.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_mesh.cpp -o /tmp/oct-F2jxWd.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection upwindGrad.cpp -o /tmp/oct-frO374.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection internal_mesh.cpp -o /tmp/oct-b7Mury.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection upwindGrad.cpp -o /tmp/oct-edDT8E.o In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h:33, from /usr/include/c++/13/bits/allocator.h:46, from /usr/include/c++/13/string:43, @@ -2994,18 +3030,18 @@ /usr/include/c++/13/bits/new_allocator.h:151:55: note: returned from 'void* operator new(std::size_t)' 151 | return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp))); | ^ -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_init_narrowband.oct FastMarching.o Utils.o /tmp/oct-f2oUAq.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_upwindGrad.oct FastMarching.o Utils.o /tmp/oct-frO374.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_fastmarching.oct FastMarching.o Utils.o /tmp/oct-xSxESY.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomElements.oct FastMarching.o Utils.o /tmp/oct-1Oysnz.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_nbFromGeom.oct FastMarching.o Utils.o /tmp/oct-eRcAFU.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomBoundary.oct FastMarching.o Utils.o /tmp/oct-xKTgcr.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomGamma.oct FastMarching.o Utils.o /tmp/oct-SDo0go.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_mesh.oct FastMarching.o Utils.o /tmp/oct-F2jxWd.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_upwindGrad.oct FastMarching.o Utils.o /tmp/oct-edDT8E.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_fastmarching.oct FastMarching.o Utils.o /tmp/oct-tWWbmi.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_nbFromGeom.oct FastMarching.o Utils.o /tmp/oct-Nd4G8K.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_init_narrowband.oct FastMarching.o Utils.o /tmp/oct-lBAEic.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomElements.oct FastMarching.o Utils.o /tmp/oct-VFerkm.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomBoundary.oct FastMarching.o Utils.o /tmp/oct-yroX5U.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_geomGamma.oct FastMarching.o Utils.o /tmp/oct-Aei0Yq.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -o __levelset_internal_mesh.oct FastMarching.o Utils.o /tmp/oct-b7Mury.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro make[1]: Leaving directory '/build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/src' copyfile /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomBoundary.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomElements.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomGamma.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_fastmarching.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_init_narrowband.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_mesh.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_nbFromGeom.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_upwindGrad.oct /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/./inst/x86_64-pc-linux-gnu-api-v58 -octave-help-g2DsjL:150: missing @table argument -octave-help-g2DsjL:150: missing @table argument +octave-help-bGmRHA:150: missing @table argument +octave-help-bGmRHA:150: missing @table argument warning: doc_cache_create: unusable help text found in file 'ls_sign_colourmap' warning: called from doc_cache_create>handle_function at line 98 column 5 @@ -3018,10 +3054,10 @@ pkg at line 619 column 9 /usr/share/dh-octave/install-pkg.m at line 38 column 1 -octave-help-MeBHLk:145: @code expected braces -octave-help-MeBHLk:149: @code expected braces -octave-help-MeBHLk:145: @code expected braces -octave-help-MeBHLk:149: @code expected braces +octave-help-FvwgIL:145: @code expected braces +octave-help-FvwgIL:149: @code expected braces +octave-help-FvwgIL:145: @code expected braces +octave-help-FvwgIL:149: @code expected braces warning: doc_cache_create: unusable help text found in file 'so_example_problem' warning: called from doc_cache_create>handle_function at line 98 column 5 @@ -3039,28 +3075,6 @@ Checking package... Run the unit tests... Checking m files ... -[inst/ls_issubset.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_issubset.m -***** error - ls_issubset (1) -***** error - ls_issubset (1, 2, 3) -***** error - ls_issubset (1, [1, 2]) -***** test - n = 50; - x = linspace (-10, 10, n); - [XX, YY] = meshgrid (x, x); - - phi1 = XX.^2 + YY.^2 - 1^2; - phi2 = XX.^2 + YY.^2 - 5^2; - phi3 = XX.^2 + YY.^2 - 8^2; - phi4 = (XX - 3).^2 + YY.^2 - 3^2; - - assert (ls_issubset (phi1, phi2)); - assert (ls_issubset (phi4, phi3)); - assert (~ls_issubset (phi4, phi2)); -4 tests, 4 passed, 0 known failure, 0 skipped [inst/so_run_descent.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_run_descent.m ***** shared data, phi0 @@ -3136,609 +3150,6 @@ printf ("\nFinal interval: [%.6d, %.6d]\n", s.a, s.b); printf ("Final cost: %.6d\n", s.cost); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/ls_signed_distance.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_signed_distance.m -***** error - ls_signed_distance () -***** error - ls_signed_distance (1, 2, 3) -***** test - assert (ls_signed_distance ([]), []); -***** test - n = 10; - x = linspace (-2, 2, n); - h = x(2) - x(1); - phi = abs (x) - 1; - - d = ls_signed_distance (phi, h); - assert (d, phi, sqrt (eps)); -***** test - n = 50; - x = linspace (-2, 2, n); - h = x(2) - x(1); - [XX, YY, ZZ] = ndgrid (x); - RRsq = XX.^2 + YY.^2 + ZZ.^2; - phi = RRsq - 1; - - d = ls_signed_distance (phi, h); - assert (d, sqrt (RRsq) - 1, h); -***** test - phi = [5e-6, 1.7e-154, -1.3e-2]; - for h = [0.02, 0.01, 0.005] - d = ls_signed_distance (phi, h); - assert (all (isfinite (d))); - assert (d(2), 0); - endfor -***** test - phis = ls_get_tests (); - for i = 1 : length (phis) - phi = ls_normalise (phis{i}); - d = ls_signed_distance (phi); - assert (ls_equal (d, phi)); - endfor -***** test - if (exist ("signbit") == 5) - phi = [-0, 0]; - d = ls_signed_distance (phi); - assert (ls_equal (phi, d)); - else - warning ("'signbit' function not available, skipping test."); - endif -***** demo - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi0 = atan (ls_union ((XX.^2 + (YY - 5).^2) - 20, ... - (XX.^2 + (YY + 5).^2) - 20)); - %phi0 = XX.^2 / 1.3^2 + YY.^2 - 1; - d = ls_signed_distance (phi0, h); - - figure (); - subplot (1, 2, 1); - contour (XX, YY, phi0); - title ("Initial"); - colorbar (); - axis ("equal"); - - subplot (1, 2, 2); - contour (XX, YY, d); - title ("Signed Distance"); - colorbar (); - axis ("equal"); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/ls_sign_colourmap.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_sign_colourmap.m -***** shared colours - colours = [1, 1, 1; 0, 0, 0; 1, 1, 1; 0, 0, 0]; -***** error - ls_sign_colourmap (1, 2); -***** error - ls_sign_colourmap (1); -***** error - cmap = ls_sign_colourmap (); -***** error - ls_sign_colourmap ("foo"); -***** test - figure (); - ls_sign_colourmap (); - ls_sign_colourmap ("highlight"); - ls_sign_colourmap (colours); - close (); -warning: using the gnuplot graphics toolkit is discouraged - -The gnuplot graphics toolkit is not actively maintained and has a number -of limitations that are unlikely to be fixed. Communication with gnuplot -uses a one-directional pipe and limited information is passed back to the -Octave interpreter so most changes made interactively in the plot window -will not be reflected in the graphics properties managed by Octave. For -example, if the plot window is closed with a mouse click, Octave will not -be notified and will not update its internal list of open figure windows. -The qt toolkit is recommended instead. -***** error - ls_sign_colourmap (1, 2, 3); -***** error - ls_sign_colourmap ([1, 2, 3]); -***** error - ls_sign_colourmap ([1, 2], 1); -***** error - ls_sign_colourmap ([1, 2], "foo"); -***** test - cmap = ls_sign_colourmap ([1, 2]); - cmap = ls_sign_colourmap ([1; 2], "highlight"); - cmap = ls_sign_colourmap ([1; 2], colours); -***** demo - n = 100; - x = linspace (-2, 2, n); - y = linspace (-1, 3, n); - [XX, YY] = meshgrid (x, y); - phi = ls_genbasic (XX, YY, "sphere", [0, 1], 1); - - figure (); - imagesc (x, y, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - colorbar (); - title ("Type 'sign'"); -***** demo - n = 100; - x = linspace (-2, 2, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 1); - d = ls_signed_distance (phi, h); - F = YY .* exp (-10 * d.^2); - - figure (); - hold ("on"); - imagesc (x, x, F); - set (gca (), "ydir", "normal"); - ls_sign_colourmap ("highlight"); - colorbar (); - contour (XX, YY, phi, [0, 0], "k", "LineWidth", 2); - hold ("off"); - title ("Type 'highlight'"); -10 tests, 10 passed, 0 known failure, 0 skipped -[inst/ls_build_mesh.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_build_mesh.m -***** error - ls_build_mesh (1) -***** error - ls_build_mesh (1, 2, 3, 4) -***** error - x = linspace (-10, 10, 10); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - ls_build_mesh (geom, phi); -***** function verifyDirection (a, b, centre) - v1 = [a - centre; 0]; - v2 = [b - centre; 0]; - x = cross (v1, v2); - assert (x(1 : 2), zeros (2, 1)); - assert (x(3) > 0); -***** endfunction -***** function verifyMesh (geom, phi, glob) - [mesh, vmap] = ls_build_mesh (geom, phi, glob); - nPts = prod (geom.dim); - - % Verify ordering of triangle points. - for i = 1 : size (mesh.t, 2) - verifyDirection (mesh.p(:, mesh.t(1, i)), mesh.p(:, mesh.t(2, i)), ... - mesh.p(:, mesh.t(3, i))); - endfor - - % Go through all grid points and verify them with the mesh. - for i = 1 : nPts - gridInd = vmap.grid(i); - if (isna (gridInd)) - assert (!glob); - continue; - endif - - assert (vmap.mesh(gridInd), i); - assert (mesh.p(:, gridInd), geom.nodes.coord(i, :)'); - endfor - - % Go through all intersection points and verify them. - for i = 1 : geom.ispts.n - gridInd = vmap.ispt(i); - assert (vmap.mesh(gridInd), -i); - assert (mesh.p(:, gridInd), geom.ispts.coord(i, :)'); - endfor - - % Verify mesh.e against geom.bedges. - for i = 1 : geom.bedges.n - assert (mesh.e(1 : 2, i), vmap.ispt(geom.bedges.ispts(i, :)')); - assert (mesh.e(5, i), geom.bedges.comp(i)); - endfor -***** endfunction -***** function verifyPhi (phi, XX, YY, h) - for s = [-1, 1] - cur = phi * s; - cur = ls_normalise (cur, h); - geom = ls_find_geometry (cur, h); - geom = ls_absolute_geom (geom, XX, YY); - - verifyMesh (geom, cur, false); - verifyMesh (geom, cur, true); - endfor -***** endfunction -***** test - n = 20; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = ls_union (ls_genbasic (XX, YY, "sphere", [-6, -6], 3), ... - ls_genbasic (XX, YY, "sphere", [6, 6], 3)); - verifyPhi (phi, XX, YY, h); - - phi = ls_setdiff (ls_genbasic (XX, YY, "sphere", [0, 0], 8), ... - ls_genbasic (XX, YY, "sphere", [0, 0], 4)); - verifyPhi (phi, XX, YY, h); -***** demo - x = linspace (-10, 10, 11); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = ls_union (ls_genbasic (XX, YY, "sphere", [5, 5], 4.5), ... - ls_genbasic (XX, YY, "sphere", [-2, -2], 4)); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - geom = ls_absolute_geom (geom, XX, YY); - - mesh = ls_build_mesh (geom, phi, false); - meshGlob = ls_build_mesh (geom, phi, true); - - figure (); - hold ("on"); - trimesh (meshGlob.t(1 : 3, :)', meshGlob.p(1, :), meshGlob.p(2, :), "r"); - trimesh (mesh.t(1 : 3, :)', mesh.p(1, :), mesh.p(2, :), "g"); - for i = 1 : size (mesh.e, 2) - plot (mesh.p(1, mesh.e(1 : 2, i)), mesh.p(2, mesh.e(1 : 2, i)), "b"); - endfor - hold ("off"); - legend ("Global", "Domain", "Boundary"); - axis ("equal"); - axis ("square"); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/ls_disjoint.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_disjoint.m -***** error - ls_disjoint () -***** error - ls_disjoint (1, -2, [1, 2]) -***** test - assert (ls_disjoint ([-1, 0, 1], [0, 0, 0], [1, 0, -1])); - assert (~ls_disjoint ([Inf, -Inf, 1], [-1, -1, 1])); - assert (~ls_disjoint ([-1, -1, 1], [0, 0, 0], [1, -1, -1])); -***** test - n = 50; - x = linspace (-10, 10, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; - phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; - phi3 = XX.^2 + YY.^2 - 2^2; - - assert (ls_disjoint (phi1, phi2)); - assert (~ls_disjoint (phi1, phi3)); - assert (~ls_disjoint (phi2, phi3)); - assert (~ls_disjoint (phi1, phi2, phi3)); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/ls_complement.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_complement.m -***** error - ls_complement () -***** error - ls_complement (1, 2) -***** test - n = 50; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; - phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; - - assert (ls_disjoint (phi1, ls_complement (phi1))); - assert (ls_disjoint (phi2, ls_complement (phi2))); - - assert (~ls_disjoint (phi1, ls_complement (phi2))); - assert (~ls_disjoint (phi2, ls_complement (phi1))); - - sd1 = ls_signed_distance (ls_complement (phi1), h); - sd2 = ls_complement (ls_signed_distance (phi1, h)); - assert (sd1, sd2, sqrt (eps)); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/ls_intersect.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_intersect.m -***** error - ls_intersect () -***** error - ls_intersect (1, -2, [1, 2]) -***** test - n = 50; - x = linspace (-10, 10, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; - phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; - phi3 = XX.^2 + YY.^2 - 2^2; - - assert (ls_isempty (ls_intersect (phi1, phi2))); - assert (ls_intersect (phi3), phi3); - - phi = ls_intersect (phi1, phi3); - assert (~ls_isempty (phi)); - assert (ls_issubset (phi, phi1) && ls_issubset (phi, phi3)); - - phi = ls_intersect (phi2, phi3); - assert (~ls_isempty (phi)); - assert (ls_issubset (phi, phi2) && ls_issubset (phi, phi3)); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2 * cos (7/6 * pi)).^2 + (YY - 2 * sin (7/6 * pi)).^2 - 3^2; - phi2 = (XX - 2 * cos (11/6 * pi)).^2 + (YY - 2 * sin (11/6 * pi)).^2 - 3^2; - phi3 = XX.^2 + (YY - 2).^2 - 3^2; - phi = ls_intersect (phi1, phi2, phi3); - - figure (); - subplot (1, 2, 1); - hold ("on"); - contour (XX, YY, phi1, [0, 0], "k"); - contour (XX, YY, phi2, [0, 0], "k"); - contour (XX, YY, phi3, [0, 0], "k"); - hold ("off"); - axis ("equal"); - - subplot (1, 2, 2); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/ls_distance_fcn.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_distance_fcn.m -***** error - ls_distance_fcn () -***** error - ls_distance_fcn (1, 2, 3) -***** test - assert (ls_distance_fcn ([]), []); -***** test - n = 10; - x = linspace (-2, 2, n); - h = x(2) - x(1); - phi = abs (x) - 1; - - d = ls_distance_fcn (phi, h); - assert (d, max (phi, 0), sqrt (eps)); -***** test - n = 50; - x = linspace (-2, 2, n); - h = x(2) - x(1); - [XX, YY, ZZ] = ndgrid (x); - RRsq = XX.^2 + YY.^2 + ZZ.^2; - phi = RRsq - 1; - - d = ls_distance_fcn (phi, h); - assert (d, max (sqrt (RRsq) - 1, 0), h); -***** xtest - n = 500; - x = linspace (-10, 10, n); - h = x(2) - x(1); - - [XX, YY] = meshgrid (x, x); - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 8); - - id = tic (); - d = ls_distance_fcn (phi, h); - time1 = toc (id); - - id = tic (); - sd = ls_signed_distance (phi, h); - time2 = toc (id); - - assert (d, max (sd, 0), sqrt (eps)); - printf ("ls_distance_fcn faster than ls_signed_distance by %.1f%%\n", ... - 100 * ((time2 - time1) / time2)); - assert (time1 < time2); -ls_distance_fcn faster than ls_signed_distance by 24.6% -***** test - phis = ls_get_tests (); - for i = 1 : length (phis) - phi = ls_normalise (phis{i}); - d = ls_distance_fcn (phi); - sd = ls_signed_distance (phi); - assert (d, max (sd, 0), sqrt (eps)); - endfor -***** demo - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = ls_genbasic (XX, YY, "sphere", [0, 0], [8, 5]); - d = ls_distance_fcn (phi, h); - - figure (); - mesh (XX, YY, d); - view ([45, 45]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ls_genbasic.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_genbasic.m -***** shared x, y, XX, YY, XXX, YYY, ZZZ - n = 121; - x = linspace (-5, 7, n); - y = linspace (-7, 5, n); - [XX, YY] = meshgrid (x, y); - [XXX, YYY, ZZZ] = ndgrid (x, y, x); -***** error - ls_genbasic (); -***** error - ls_genbasic (1, 2); -***** error - ls_genbasic ("sphere"); -***** error - ls_genbasic (XX, YY, "unknown"); -***** test - ls_genbasic (x, "sphere", 0, 1); - ls_genbasic (x', "sphere", 0, 1); - ls_genbasic (XX, YY, "sphere", [0, 0], 1); - ls_genbasic (0, 1, "sphere", [0, 0], 1); -***** error - ls_genbasic (XX, YY, "sphere"); -***** error - ls_genbasic (XX, YY, "sphere", 1); -***** error - ls_genbasic (XX, YY, "sphere", 1, 2, 3); -***** error - ls_genbasic (XX, YY, "sphere", [1, 2, 3], 1); -***** error - ls_genbasic (XX, YY, "sphere", [1, 2], [1, 2, 3]); -***** test - assert (ls_genbasic (XX, YY, "sphere", [1, -1], 1), ... - ls_genbasic (XX, YY, "sphere", [1, -1], [1, 1])); -***** test - c = [1; -1; 2]; - r = [1; 2; 0.6]; - tol = 0.4; - phi1 = ls_genbasic (XXX, YYY, ZZZ, "sphere", c, r); - phi2 = ls_genbasic (XXX, YYY, ZZZ, "sphere", c, min (r) - tol); - assert (ls_issubset (phi2, phi1)); - coords = {XXX, YYY, ZZZ}; - for i = 1 : length (c) - assert (ls_disjoint (phi1, ... - coords{i} - (c(i) - r(i)), ... - c(i) + r(i) - coords{i})); - assert (~ls_disjoint (phi1 - tol, coords{i} - (c(i) - r(i)))); - assert (~ls_disjoint (phi1 - tol, c(i) + r(i) - coords{i})); - endfor -***** error - ls_genbasic (XX, YY, "box", 1); -***** error - ls_genbasic (XX, YY, "box", 1, 2, 3); -***** error - ls_genbasic (XX, YY, "box", [1, 2, 3], [1, 2]); -***** error - ls_genbasic (XX, YY, "box", [1; 2], [1, 2, 3]); -***** test - assert (ls_equal (ls_genbasic (x, "box", -1, 2), abs (x - 0.5) - 1.5)); - assert (ls_equal (ls_genbasic (x, "box", 2, -1), abs (x - 0.5) - 1.5)); -***** test - a = [2; -3; 1]; - b = [0; 2; -1]; - tol = 0.2; - phi1 = ls_genbasic (XXX, YYY, ZZZ, "box", a, b); - phi2 = ls_genbasic (XXX, YYY, ZZZ, "box", b, a); - assert (phi1, phi2); - coords = {XXX, YYY, ZZZ}; - for i = 1 : length (coords) - assert (ls_disjoint (phi1, ... - coords{i} - min (a(i), b(i)), ... - max (a(i), b(i)) - coords{i})); - assert (~ls_disjoint (phi1 - tol, coords{i} - min (a(i), b(i)))); - assert (~ls_disjoint (phi1 - tol, max (a(i), b(i)) - coords{i})); - endfor -***** error - ls_genbasic (XX, YY, "half", 1); -***** error - ls_genbasic (XX, YY, "half", 1, 2, 3); -***** error - ls_genbasic (XX, YY, "half", [1, 2, 3], [1, 2]); -***** error - ls_genbasic (XX, YY, "half", [1; 2], [1, 2, 3]); -***** test - p = [0, 2, 1]; - - phi = ls_genbasic (XXX, YYY, ZZZ, "half", p, [0; 0; 1]); - assert (ls_equal (phi, 1 - ZZZ)); - - normal = [1; 2; -0.5]; - phi1 = ls_genbasic (XXX, YYY, ZZZ, "half", p, normal); - phi2 = ls_genbasic (XXX, YYY, ZZZ, "half", p, 2 * normal); - assert (ls_equal (phi1, phi2)); - - phi = ls_genbasic (XX, YY, "half", [0, 0], [1, -1]); - assert (ls_equal (phi, YY - XX)); -***** demo - n = 200; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = ls_genbasic (XX, YY, "box", [-5, -3], [3, 6]); - phi2 = ls_genbasic (XX, YY, "sphere", [-1; 1], 2); - phi3 = ls_genbasic (XX, YY, "sphere", [0; 0], [6, 1]); - phi4 = ls_genbasic (XX, YY, "half", [3, -3], [1, -2]) / 8; - - phi = ls_union (ls_setdiff (phi1, phi2), phi3, phi4); - figure (); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -23 tests, 23 passed, 0 known failure, 0 skipped -[inst/ls_enforce_speed.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce_speed.m -***** error - ls_enforce_speed (1, 2) -***** error - ls_enforce_speed (1, 2, 3, 4) -***** error - ls_enforce_speed (1, "inside", [1, 2]); -***** error - ls_enforce_speed (1, "foo", true); -***** error - ls_enforce_speed (1, NA, false); -***** function checkCircleRadius (XX, YY, h, phi, r) - phiCorrect = XX.^2 + YY.^2 - r^2; - sd1 = ls_signed_distance (phi, h); - sd2 = ls_signed_distance (phiCorrect, h); - assert (sd1, sd2, h); -***** endfunction -***** test - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = XX.^2 + YY.^2 - 3^2; - F = ones (size (XX)); - whereContain = (XX.^2 + YY.^2 < 5^2); - F = ls_enforce_speed (F, "contain", whereContain); - whereInside = (XX.^2 + YY.^2 < 8^2); - F = ls_enforce_speed (F, "inside", whereInside); - dists = ls_solve_stationary (phi, F, h); - phi2 = ls_extract_solution (10, dists, phi, F); - assert (ls_check (phi2, "contain", whereContain)); - assert (ls_check (phi2, "inside", whereInside)); - checkCircleRadius (XX, YY, h, phi2, 8); - - phi = XX.^2 + YY.^2 - 8^2; - F = -ones (size (XX)); - whereContain = (XX.^2 + YY.^2 < 5^2); - F = ls_enforce_speed (F, "contain", whereContain); - whereOutside = (XX.^2 + YY.^2 >= 7^2); - F = ls_enforce_speed (F, "outside", whereOutside); - dists = ls_solve_stationary (phi, F, h); - phi2 = ls_extract_solution (10, dists, phi, F); - assert (ls_check (phi2, "contain", whereContain)); - assert (ls_check (phi2, "outside", whereOutside)); - checkCircleRadius (XX, YY, h, phi2, 5); -***** demo - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = XX.^2 + YY.^2 - 8^2; - F = -ones (size (XX)); - F = ls_enforce_speed (F, "outside", XX.^2 + YY.^2 >= 7^2); - F = ls_enforce_speed (F, "contain", XX.^2 + YY.^2 < 3^2); - times = linspace (1, 6, 40); - ls_animate_evolution (phi, F, h, times, 0.05); - - phi = XX.^2 + YY.^2 - 3^2; - F = ones (size (XX)); - F = ls_enforce_speed (F, "inside", XX.^2 + YY.^2 < 8^2); - F = ls_enforce_speed (F, "contain", XX.^2 + YY.^2 < 5^2); - ls_animate_evolution (phi, F, h, times, 0.05); -6 tests, 6 passed, 0 known failure, 0 skipped [inst/ls_extract_solution.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_extract_solution.m ***** error @@ -3800,7 +3211,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3808,7 +3219,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3816,7 +3227,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3824,7 +3235,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3832,7 +3243,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3840,7 +3251,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3848,7 +3259,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3856,7 +3267,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3864,7 +3275,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3872,7 +3283,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3880,7 +3291,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3888,7 +3299,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3896,7 +3307,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3904,7 +3315,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3912,7 +3323,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3920,7 +3331,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3928,7 +3339,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3936,7 +3347,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3944,7 +3355,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3952,7 +3363,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3960,7 +3371,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3968,7 +3379,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3976,7 +3387,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3984,7 +3395,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -3992,7 +3403,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4000,7 +3411,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4008,7 +3419,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4016,7 +3427,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4024,7 +3435,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4032,7 +3443,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4040,7 +3451,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4048,7 +3459,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4056,7 +3467,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4064,7 +3475,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4072,7 +3483,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4080,7 +3491,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4088,7 +3499,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4096,7 +3507,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4104,7 +3515,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4112,7 +3523,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4120,7 +3531,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4128,7 +3539,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4136,7 +3547,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4144,7 +3555,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4152,7 +3563,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4160,7 +3571,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4168,7 +3579,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4176,7 +3587,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 102 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 22 column 31 ***** demo n = 100; @@ -4211,6 +3622,1186 @@ phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], 3); ls_animate_evolution (phi0, F, h, linspace (0, 3, 40), 0.01); 8 tests, 8 passed, 0 known failure, 0 skipped +[inst/ls_build_mesh.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_build_mesh.m +***** error + ls_build_mesh (1) +***** error + ls_build_mesh (1, 2, 3, 4) +***** error + x = linspace (-10, 10, 10); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + ls_build_mesh (geom, phi); +***** function verifyDirection (a, b, centre) + v1 = [a - centre; 0]; + v2 = [b - centre; 0]; + x = cross (v1, v2); + assert (x(1 : 2), zeros (2, 1)); + assert (x(3) > 0); +***** endfunction +***** function verifyMesh (geom, phi, glob) + [mesh, vmap] = ls_build_mesh (geom, phi, glob); + nPts = prod (geom.dim); + + % Verify ordering of triangle points. + for i = 1 : size (mesh.t, 2) + verifyDirection (mesh.p(:, mesh.t(1, i)), mesh.p(:, mesh.t(2, i)), ... + mesh.p(:, mesh.t(3, i))); + endfor + + % Go through all grid points and verify them with the mesh. + for i = 1 : nPts + gridInd = vmap.grid(i); + if (isna (gridInd)) + assert (!glob); + continue; + endif + + assert (vmap.mesh(gridInd), i); + assert (mesh.p(:, gridInd), geom.nodes.coord(i, :)'); + endfor + + % Go through all intersection points and verify them. + for i = 1 : geom.ispts.n + gridInd = vmap.ispt(i); + assert (vmap.mesh(gridInd), -i); + assert (mesh.p(:, gridInd), geom.ispts.coord(i, :)'); + endfor + + % Verify mesh.e against geom.bedges. + for i = 1 : geom.bedges.n + assert (mesh.e(1 : 2, i), vmap.ispt(geom.bedges.ispts(i, :)')); + assert (mesh.e(5, i), geom.bedges.comp(i)); + endfor +***** endfunction +***** function verifyPhi (phi, XX, YY, h) + for s = [-1, 1] + cur = phi * s; + cur = ls_normalise (cur, h); + geom = ls_find_geometry (cur, h); + geom = ls_absolute_geom (geom, XX, YY); + + verifyMesh (geom, cur, false); + verifyMesh (geom, cur, true); + endfor +***** endfunction +***** test + n = 20; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_union (ls_genbasic (XX, YY, "sphere", [-6, -6], 3), ... + ls_genbasic (XX, YY, "sphere", [6, 6], 3)); + verifyPhi (phi, XX, YY, h); + + phi = ls_setdiff (ls_genbasic (XX, YY, "sphere", [0, 0], 8), ... + ls_genbasic (XX, YY, "sphere", [0, 0], 4)); + verifyPhi (phi, XX, YY, h); +***** demo + x = linspace (-10, 10, 11); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_union (ls_genbasic (XX, YY, "sphere", [5, 5], 4.5), ... + ls_genbasic (XX, YY, "sphere", [-2, -2], 4)); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + geom = ls_absolute_geom (geom, XX, YY); + + mesh = ls_build_mesh (geom, phi, false); + meshGlob = ls_build_mesh (geom, phi, true); + + figure (); + hold ("on"); + trimesh (meshGlob.t(1 : 3, :)', meshGlob.p(1, :), meshGlob.p(2, :), "r"); + trimesh (mesh.t(1 : 3, :)', mesh.p(1, :), mesh.p(2, :), "g"); + for i = 1 : size (mesh.e, 2) + plot (mesh.p(1, mesh.e(1 : 2, i)), mesh.p(2, mesh.e(1 : 2, i)), "b"); + endfor + hold ("off"); + legend ("Global", "Domain", "Boundary"); + axis ("equal"); + axis ("square"); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/ls_solve_stationary.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_solve_stationary.m +***** error + ls_solve_stationary (1) +***** error + ls_solve_stationary (1, 2, 3, 4, 5) +***** error + ls_solve_stationary ([1, 2], [3; 4]); +***** error + ls_solve_stationary ([1, 2], [1, 2], :, [3; 4]); +***** test + assert (ls_solve_stationary ([], []), []); +***** function checkOutput (phi, f, d) + assert (all (isna (d(f == 0)))); + where = (f ~= 0); + assert (all (isfinite (d(where)) | isinf (d(where)))); + assert (sign (d(where)), sign (phi(where))); +***** endfunction +***** test + phis = ls_get_tests (); + for i = 1 : length (phis) + f = ones (size (phis{i})); + for j = -1 : 1 + phi = ls_normalise (phis{i}); + d = ls_solve_stationary (phi, j * f); + checkOutput (phi, j * f, d); + endfor + endfor +***** test + n = 101; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + r1 = (XX - 5).^2 + YY.^2; + r2 = (XX + 5).^2 + YY.^2; + + phi = ls_union (r1 - 2^2, r2 - 2^2); + f1 = max (r1 - 3^2, 1^2 - r1); + f2 = max (r2 - 3^2, 1^2 - r2); + f = min (f1, f2) .* sign (XX); + assert (~all (f(:) ~= 0)); + + d = ls_solve_stationary (phi, f, h); + + checkOutput (phi, f, d); + where = (f ~= 0); + assert (any (isinf (d(where)))); + + %{ + contour (phi, [0, 0]); + colorbar (); + figure (); + imagesc (f); + colorbar (); + figure (); + imagesc (d); + colorbar (); + %} +***** test + phi = [3, 1, -1, 1, 3]; + f = ones (size (phi)); + dists1 = ls_solve_stationary (phi, f); + dists2 = ls_solve_stationary (phi, f, :, [NA, NA, -0.1, NA, NA]); + + assert (dists1, [1.5, 0.5, -0.5, 0.5, 1.5], sqrt (eps)); + assert (dists2, [1.9, 0.9, -0.1, 0.9, 1.9]); +***** demo + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi0 = YY - XX + 15; + f = sign (XX) + 2; + + d = ls_solve_stationary (phi0, f, h); + figure (); + contour (XX, YY, d); + line ([0, 0], [-10, 10]); + title ("Refraction"); +***** demo + n = 101; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi0 = XX + 9; + f = ones (size (phi0)); + f(XX == 0 & abs (YY) > 2) = 0; + + d = ls_solve_stationary (phi0, f, h); + figure (); + contour (XX, YY, d); + line ([0, 0], [-10, -2]); + line ([0, 0], [2, 10]); + title ("Diffraction"); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/ls_inside.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_inside.m +***** error + ls_inside () +***** error + ls_inside (1, 2) +***** test + assert (ls_inside ([1, 0, -1, 0, 1]), [false, false, true, false, false]); +***** test + if (exist ("signbit") == 5) + assert (ls_inside ([-0, 0]), [true, false]); + else + warning ("'signbit' function not available, skipping test."); + endif +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/so_replay_descent.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_replay_descent.m +***** error + so_replay_descent (1); +***** error + so_replay_descent (1, 2, 3, 4); +***** error + so_replay_descent (1, 2, 0); +***** error + so_replay_descent (1, 2, 1.5); +***** error + so_replay_descent (1, 2, [2, 3]); +***** error + so_replay_descent (struct (), 2); +***** error + so_replay_descent ([2, 3], 2); +***** error <'fload' is not available> + pkg unload -nodeps parallel; + so_replay_descent ("foo", 2); +***** function x = compressionCheckStruct (s, data) + x = struct ("weight", data.p.weight, "cost", s.cost); +***** endfunction +***** function checkCompression (s, data, field) + assert (isfield (s, field)); + assert (getfield (s, field), compressionCheckStruct (s, data)); +***** endfunction +***** function s = compressState (s, data) + s.compressed = compressionCheckStruct (s, data); +***** endfunction +***** function s = uncompressState (s, data) + checkCompression (s, data, "compressed"); + s.uncompressed = compressionCheckStruct (s, data); +***** endfunction +***** function log = initialised (data) + log = data.log; + log.mashUp = [data.s.a, data.s.b]; +***** endfunction +***** function log = beforeStep (k, data) + log = data.log; + log.mashUp = [log.mashUp, k, data.s.vol]; + + if (data.checkUncompression) + checkCompression (data.s, data, "uncompressed"); + endif +***** endfunction +***** function log = direction (k, f, dJ, data) + log = data.log; + log.mashUp = [log.mashUp, k, mean(f), sum(f), dJ, data.s.integ]; +***** endfunction +***** function log = afterStep (k, t, s, data) + log = data.log; + log.mashUp = [log.mashUp, k, t, s.a, s.b, s.cost, data.s.cost]; + + if (data.checkUncompression) + checkCompression (s, data, "uncompressed"); + endif +***** endfunction +***** function log = finished (data) + log = data.log; + log.mashUp = [log.mashUp, data.s.cost, log.steps, log.costs]; +***** endfunction +***** function data = getData () + data = struct (); + data.p = so_init_params (false); + data.p.vol = 10; + data.p.weight = 50; + + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + data.g = struct ("x", x, "h", h); + + data = so_example_problem (data); + data.handler = struct ("initialised", @initialised, ... + "before_step", @beforeStep, ... + "direction", @direction, ... + "after_step", @afterStep, ... + "finished", @finished); + + % Unless explicitly set, do not expect compressed states. + data.checkUncompression = false; + + data.phi0 = ls_genbasic (data.g.x, "box", -3, 5); +***** endfunction +***** function data = getDataForCompression (uncompress) + data = getData (); + data.compress = struct (); + data.compress.save = struct ("state", @compressState); + data.compress.load = struct ("state", @uncompressState); + data.checkUncompression = uncompress; +***** endfunction +***** function compareResults (s1, l1, s2, l2) + assert (s2, s1); + assert (l2.mashUp, l1.mashUp); +***** endfunction +***** xtest + pkg load parallel; + + nSteps = 10; + baseData = getData (); + + f = tempname (); + data = so_save_descent (f, struct (), baseData); + [s1, l1] = so_run_descent (nSteps, data.phi0, data); + [s2, l2] = so_replay_descent (f, @getData); + unlink (f); + compareResults (s1, l1, s2, l2); + + f = tmpfile (); + data = so_save_descent (f, struct (), baseData); + [s1, l1] = so_run_descent (nSteps, data.phi0, data); + frewind (f); + [s2, l2] = so_replay_descent (f, @getData); + fclose (f); + compareResults (s1, l1, s2, l2); + + [pr, pw] = pipe (); + data = so_save_descent (pw, struct (), baseData); + [s1, l1] = so_run_descent (nSteps, data.phi0, data); + fclose (pw); + [s2, l2] = so_replay_descent (pr, @getData); + fclose (pr); + compareResults (s1, l1, s2, l2); +!!!!! known failure +structure has no member 'openFile' +***** xtest + pkg load parallel; + + baseData = getData (); + [pr, pw] = pipe (); + data = so_save_descent (pw, struct (), baseData); + data.cb.check_stop = @() true; + [s1, l1] = so_run_descent (1, data.phi0, data); + fclose (pw); + assert (l1.steps, 0); + [s2, l2] = so_replay_descent (pr, @getData); + fclose (pr); + compareResults (s1, l1, s2, l2); + + baseData = getData (); + [pr, pw] = pipe (); + data = so_save_descent (pw, struct (), baseData); + [s1, l1] = so_run_descent (1, data.phi0, data); + fclose (pw); + [s2, l2] = so_replay_descent (pr, @getData, 1); + fclose (pr); + compareResults (s1, l1, s2, l2); +!!!!! known failure +structure has no member 'openFile' +***** xtest + pkg load parallel; + + nStepsShort = 5; + nStepsLong = 10; + + baseData = getData (); + [prl, pwl] = pipe (); + data = so_save_descent (pwl, struct (), baseData); + [sl, ll] = so_run_descent (nStepsLong, data.phi0, data); + fclose (pwl); + + baseData = getData (); + [prs, pws] = pipe (); + data = so_save_descent (pws, struct (), baseData); + [ss, ls] = so_run_descent (nStepsShort, data.phi0, data); + fclose (pws); + + [s, l] = so_replay_descent (prl, @getData, nStepsShort); + fclose (prl); + compareResults (s, l, ss, ls); + + [s, l] = so_replay_descent (prs, @getData, nStepsLong); + fclose (prs); + compareResults (s, l, sl, ll); +!!!!! known failure +structure has no member 'openFile' +***** xtest + pkg load parallel; + + nSteps = 10; + [pr, pw] = pipe (); + + data = getDataForCompression (false); + data = so_save_descent (pw, struct (), data); + [s1, l1] = so_run_descent (nSteps, data.phi0, data); + fclose (pw); + + init = @(header) getDataForCompression (true); + [s2, l2] = so_replay_descent (pr, init); + fclose (pr); + + % No result comparison here, since the compress / uncompress + % functions introduced changes to the state structs. +!!!!! known failure +structure has no member 'openFile' +***** demo + pkg load parallel; + + data = struct (); + data.p = so_init_params (false); + data.p.vol = 10; + data.p.weight = 50; + + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + data.g = struct ("x", x, "h", h); + + data = so_example_problem (data); + phi0 = ls_genbasic (data.g.x, "box", -3, 7); + + printf ("Computing descent...\n"); + [pr, pw] = pipe (); + d = data; + d.handler = struct (); + d = so_save_descent (pw, struct (), d); + s = so_run_descent (5, phi0, d); + fclose (pw); + printf ("Final cost: %.6d\n", s.cost); + + printf ("\nNow replaying...\n"); + d = data; + d.p.verbose = true; + init = @() d; + s = so_replay_descent (pr, init); + fclose (pr); + printf ("Final cost: %.6d\n", s.cost); +warning: test: file /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_replay_descent.m leaked file descriptors +12 tests, 8 passed, 4 known failures, 0 skipped +[inst/ls_normalise.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_normalise.m +***** error + ls_normalise () +***** error + ls_normalise (1, 2, 3, 4) +***** test + h = 0.1; + zeroTol = 0.2; + phi = ones (4, 4); + phiEx = phi; + phi(2 : 3, 2 : 3) = [-eps, -0; 0, eps]; + phiEx(2 : 3, 2 : 3) = [-zeroTol*h, -zeroTol*h; zeroTol*h, zeroTol*h]; + phin = ls_normalise (phi, h, zeroTol); + if (exist ("signbit") == 5) + assert (phin, phiEx); + else + warning ("'signbit' function not available, skipping test."); + endif +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/ls_hausdorff_dist.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_hausdorff_dist.m +***** error + ls_hausdorff_dist (1) +***** error + ls_hausdorff_dist (1, 2, 3, 4) +***** error + ls_hausdorff_dist (1, 2, [3, 3]) +***** error + ls_hausdorff_dist (1, 2, "foo") +***** test + n = 50; + x = linspace (-5, 5, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi1 = ls_genbasic (XX, YY, "sphere", [3, 0], 1); + phi2 = ls_genbasic (XX, YY, "sphere", [-2, 0], 2); + assert (ls_hausdorff_dist (phi1, phi2, h), 6, h); + + % Make sure that phi isn't a signed-distance fcn already. + % ls_genbasic should return the same, but make it explicit. + rSq = XX.^2 + YY.^2; + d = ls_hausdorff_dist (rSq - 4^2, rSq - 2^2, h); + assert (d, 2, h); + dWrong = ls_hausdorff_dist (rSq - 4^2, rSq - 2^2, "sd"); + assert (abs (d - dWrong) > 10 * h); + dRight = ls_hausdorff_dist (sqrt (rSq) - 4, sqrt (rSq) - 2, "sd"); + assert (dRight, d, h); +***** test + n = 200; + x = linspace (-5, 5, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phiA = ls_genbasic (XX, YY, "sphere", [0, 0], 4); + phiInner = ls_genbasic (XX, YY, "sphere", [0, 0], 2); + phiB = ls_setdiff (phiA, phiInner); + + d1 = ls_hausdorff_dist (phiA, phiB, h); + d2 = ls_hausdorff_dist (phiB, phiA, h); + assert (d1, d2); + assert (d1, 2, 2 * h); + dc = ls_hausdorff_dist (ls_complement (phiA), ... + ls_complement (phiB), h); + assert (dc, 4, 2 * h); + + sdA = ls_signed_distance (phiA, h); + sdB = ls_signed_distance (phiB, h); + sdDiff = norm (sdA(:) - sdB(:), inf); + assert (abs (sdDiff - d1) > 10 * h); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/ls_equal.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_equal.m +***** error + ls_equal (1) +***** error + ls_equal (1, 2, 3) +***** error + ls_equal (1, [1, 2]) +***** test + assert (ls_equal ([Inf, 0, -2, -Inf, eps], ... + [1, 0, -Inf, -eps, 1])); + assert (ls_equal ([1, 0; -1, 0], [Inf, 0; -5, 0])); + assert (!ls_equal ([1, -1; 0, 0], [1, 0; 0, 0])); +***** test + if (exist ("signbit") == 5) + assert (ls_equal ([0, -0], [1, -1])); + else + warning ("'signbit' function not available, skipping test."); + endif +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/ls_distance_fcn.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_distance_fcn.m +***** error + ls_distance_fcn () +***** error + ls_distance_fcn (1, 2, 3) +***** test + assert (ls_distance_fcn ([]), []); +***** test + n = 10; + x = linspace (-2, 2, n); + h = x(2) - x(1); + phi = abs (x) - 1; + + d = ls_distance_fcn (phi, h); + assert (d, max (phi, 0), sqrt (eps)); +***** test + n = 50; + x = linspace (-2, 2, n); + h = x(2) - x(1); + [XX, YY, ZZ] = ndgrid (x); + RRsq = XX.^2 + YY.^2 + ZZ.^2; + phi = RRsq - 1; + + d = ls_distance_fcn (phi, h); + assert (d, max (sqrt (RRsq) - 1, 0), h); +***** xtest + n = 500; + x = linspace (-10, 10, n); + h = x(2) - x(1); + + [XX, YY] = meshgrid (x, x); + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 8); + + id = tic (); + d = ls_distance_fcn (phi, h); + time1 = toc (id); + + id = tic (); + sd = ls_signed_distance (phi, h); + time2 = toc (id); + + assert (d, max (sd, 0), sqrt (eps)); + printf ("ls_distance_fcn faster than ls_signed_distance by %.1f%%\n", ... + 100 * ((time2 - time1) / time2)); + assert (time1 < time2); +ls_distance_fcn faster than ls_signed_distance by 36.9% +***** test + phis = ls_get_tests (); + for i = 1 : length (phis) + phi = ls_normalise (phis{i}); + d = ls_distance_fcn (phi); + sd = ls_signed_distance (phi); + assert (d, max (sd, 0), sqrt (eps)); + endfor +***** demo + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_genbasic (XX, YY, "sphere", [0, 0], [8, 5]); + d = ls_distance_fcn (phi, h); + + figure (); + mesh (XX, YY, d); + view ([45, 45]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_setdiff.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setdiff.m +***** error + ls_setdiff (1) +***** error + ls_setdiff (1, 2, 3) +***** error + ls_setdiff (1, [1, 2]) +***** test + assert (ls_equal (ls_setdiff ([-1, -1, 1], [1, -1, -1]), [-1, 1, 1])); + n = 50; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi1 = XX.^2 + YY.^2 - 8^2; + phi2 = XX.^2 + YY.^2 - 5^2; + + phi = ls_setdiff (phi1, phi2); + assert (ls_issubset (phi, phi1)); + assert (ls_disjoint (phi, phi2)); + + phi = ls_setdiff (phi2, phi1); + assert (ls_isempty (phi)); +***** demo + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2).^2 + YY.^2 - 3^2; + phi2 = (XX + 2).^2 + YY.^2 - 3^2; + phi = ls_setdiff (phi1, phi2); + + figure (); + subplot (1, 2, 1); + hold ("on"); + contour (XX, YY, phi1, [0, 0], "k"); + contour (XX, YY, phi2, [0, 0], "k"); + hold ("off"); + axis ("equal"); + + subplot (1, 2, 2); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); +***** demo + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = XX.^2 + YY.^2 - 6^2; + phi2 = XX.^2 + YY.^2 - 3^2; + phi = ls_setdiff (phi1, phi2); + + figure (); + subplot (1, 2, 1); + hold ("on"); + contour (XX, YY, phi1, [0, 0], "k"); + contour (XX, YY, phi2, [0, 0], "k"); + hold ("off"); + axis ("equal"); + + subplot (1, 2, 2); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/ls_signed_distance.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_signed_distance.m +***** error + ls_signed_distance () +***** error + ls_signed_distance (1, 2, 3) +***** test + assert (ls_signed_distance ([]), []); +***** test + n = 10; + x = linspace (-2, 2, n); + h = x(2) - x(1); + phi = abs (x) - 1; + + d = ls_signed_distance (phi, h); + assert (d, phi, sqrt (eps)); +***** test + n = 50; + x = linspace (-2, 2, n); + h = x(2) - x(1); + [XX, YY, ZZ] = ndgrid (x); + RRsq = XX.^2 + YY.^2 + ZZ.^2; + phi = RRsq - 1; + + d = ls_signed_distance (phi, h); + assert (d, sqrt (RRsq) - 1, h); +***** test + phi = [5e-6, 1.7e-154, -1.3e-2]; + for h = [0.02, 0.01, 0.005] + d = ls_signed_distance (phi, h); + assert (all (isfinite (d))); + assert (d(2), 0); + endfor +***** test + phis = ls_get_tests (); + for i = 1 : length (phis) + phi = ls_normalise (phis{i}); + d = ls_signed_distance (phi); + assert (ls_equal (d, phi)); + endfor +***** test + if (exist ("signbit") == 5) + phi = [-0, 0]; + d = ls_signed_distance (phi); + assert (ls_equal (phi, d)); + else + warning ("'signbit' function not available, skipping test."); + endif +***** demo + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi0 = atan (ls_union ((XX.^2 + (YY - 5).^2) - 20, ... + (XX.^2 + (YY + 5).^2) - 20)); + %phi0 = XX.^2 / 1.3^2 + YY.^2 - 1; + d = ls_signed_distance (phi0, h); + + figure (); + subplot (1, 2, 1); + contour (XX, YY, phi0); + title ("Initial"); + colorbar (); + axis ("equal"); + + subplot (1, 2, 2); + contour (XX, YY, d); + title ("Signed Distance"); + colorbar (); + axis ("equal"); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/ls_sign_colourmap.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_sign_colourmap.m +***** shared colours + colours = [1, 1, 1; 0, 0, 0; 1, 1, 1; 0, 0, 0]; +***** error + ls_sign_colourmap (1, 2); +***** error + ls_sign_colourmap (1); +***** error + cmap = ls_sign_colourmap (); +***** error + ls_sign_colourmap ("foo"); +***** test + figure (); + ls_sign_colourmap (); + ls_sign_colourmap ("highlight"); + ls_sign_colourmap (colours); + close (); +warning: using the gnuplot graphics toolkit is discouraged + +The gnuplot graphics toolkit is not actively maintained and has a number +of limitations that are unlikely to be fixed. Communication with gnuplot +uses a one-directional pipe and limited information is passed back to the +Octave interpreter so most changes made interactively in the plot window +will not be reflected in the graphics properties managed by Octave. For +example, if the plot window is closed with a mouse click, Octave will not +be notified and will not update its internal list of open figure windows. +The qt toolkit is recommended instead. +***** error + ls_sign_colourmap (1, 2, 3); +***** error + ls_sign_colourmap ([1, 2, 3]); +***** error + ls_sign_colourmap ([1, 2], 1); +***** error + ls_sign_colourmap ([1, 2], "foo"); +***** test + cmap = ls_sign_colourmap ([1, 2]); + cmap = ls_sign_colourmap ([1; 2], "highlight"); + cmap = ls_sign_colourmap ([1; 2], colours); +***** demo + n = 100; + x = linspace (-2, 2, n); + y = linspace (-1, 3, n); + [XX, YY] = meshgrid (x, y); + phi = ls_genbasic (XX, YY, "sphere", [0, 1], 1); + + figure (); + imagesc (x, y, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + colorbar (); + title ("Type 'sign'"); +***** demo + n = 100; + x = linspace (-2, 2, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 1); + d = ls_signed_distance (phi, h); + F = YY .* exp (-10 * d.^2); + + figure (); + hold ("on"); + imagesc (x, x, F); + set (gca (), "ydir", "normal"); + ls_sign_colourmap ("highlight"); + colorbar (); + contour (XX, YY, phi, [0, 0], "k", "LineWidth", 2); + hold ("off"); + title ("Type 'highlight'"); +10 tests, 10 passed, 0 known failure, 0 skipped +[inst/ls_complement.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_complement.m +***** error + ls_complement () +***** error + ls_complement (1, 2) +***** test + n = 50; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; + phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; + + assert (ls_disjoint (phi1, ls_complement (phi1))); + assert (ls_disjoint (phi2, ls_complement (phi2))); + + assert (~ls_disjoint (phi1, ls_complement (phi2))); + assert (~ls_disjoint (phi2, ls_complement (phi1))); + + sd1 = ls_signed_distance (ls_complement (phi1), h); + sd2 = ls_complement (ls_signed_distance (phi1, h)); + assert (sd1, sd2, sqrt (eps)); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/ls_init_narrowband.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_init_narrowband.m +***** error + ls_init_narrowband () +***** error + ls_init_narrowband (1, 2, 3) +***** test + assert (ls_init_narrowband ([]), []); +***** test + n = 10; + x = linspace (-2, 2, n); + h = x(2) - x(1); + phi = abs (x) - 1; + + d = ls_init_narrowband (phi, h); + where = ~isna (d); + assert (d(where), phi(where), sqrt (eps)); +***** test + n = 50; + x = linspace (-2, 2, n); + h = x(2) - x(1); + [XX, YY, ZZ] = ndgrid (x); + RRsq = XX.^2 + YY.^2 + ZZ.^2; + phi = RRsq - 1; + + d = ls_init_narrowband (phi, h); + where = ~isna (d); + assert (d(where), sqrt (RRsq(where)) - 1, h / 3); +***** test + tol = sqrt (eps); + assert (ls_init_narrowband ([Inf, -Inf, Inf]), [0.5, -0.5, 0.5], tol); + assert (ls_init_narrowband ([Inf, -1, Inf]), [1, 0, 1], tol); + %assert (ls_init_narrowband ([1, -Inf, 1]), [0, 1, 0], tol); +***** function dh = distToSegment (x, a, b) + dir = b - a; + dir /= norm (dir); + proj = dot (x - a, dir); + if (proj < 0) + dh = norm (x - a); + elseif (proj > 1) + dh = norm (x - b); + else + dh = norm (x - (a + proj * dir)); + endif +***** endfunction +***** function dh = distToLine (x, c) + assert (c(1, 1), 0); + dh = Inf; + for i = 2 : size (c, 2) - 1 + dh = min (dh, distToSegment (x, c(:, i), c(:, i + 1))); + endfor +***** endfunction +***** function dh = distOfContoursAsym (c1, c2) + dh = 0; + for i = 2 : size (c1, 2) + dh = max (dh, distToLine (c1(:, i), c2)); + endfor +***** endfunction +***** function dh = distOfContours (c1, c2) + dh = max (distOfContoursAsym (c1, c2), distOfContoursAsym (c2, c1)); +***** endfunction +***** test + phis = ls_get_tests (); + printf ("Comparing contours for %d cases...\n", length (phis)); + for i = 1 : length (phis) + d = ls_init_narrowband (phis{i}); + c1 = contourc (d, [0, 0]); + if (size (c1, 2) > 0) + c2 = contourc (phis{i}, [0, 0]); + dh = distOfContours (c1, c2); + printf ("i = %d: dist = %f\n", i, dh); + if (isfinite (dh)) + assert (dh, 0, 1e-1); + endif + endif + endfor +Comparing contours for 6 cases... +i = 1: dist = 0.060660 +i = 2: dist = Inf +i = 4: dist = 0.039039 +i = 5: dist = 0.085786 +i = 6: dist = 0.085786 +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_union.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_union.m +***** error + ls_union () +***** error + ls_union (1, -2, [1, 2]) +***** test + n = 50; + x = linspace (-10, 10, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 3).^2 + (YY - 3).^2 - 2^2; + phi2 = (XX + 3).^2 + (YY + 3).^2 - 2^2; + phi3 = XX.^2 + YY.^2 - 2^2; + + phi = ls_union (phi1, phi2, phi3); + assert (ls_issubset (phi1, phi)); + assert (ls_issubset (phi2, phi)); + assert (ls_issubset (phi3, phi)); + + assert (ls_union (phi3), phi3); +***** demo + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2 * cos (7/6 * pi)).^2 + (YY - 2 * sin (7/6 * pi)).^2 - 3^2; + phi2 = (XX - 2 * cos (11/6 * pi)).^2 + (YY - 2 * sin (11/6 * pi)).^2 - 3^2; + phi3 = XX.^2 + (YY - 2).^2 - 3^2; + phi = ls_union (phi1, phi2, phi3); + + figure (); + subplot (1, 2, 1); + hold ("on"); + contour (XX, YY, phi1, [0, 0], "k"); + contour (XX, YY, phi2, [0, 0], "k"); + contour (XX, YY, phi3, [0, 0], "k"); + hold ("off"); + axis ("equal"); + + subplot (1, 2, 2); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/so_explore_descent.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_explore_descent.m +***** error + so_explore_descent (1); +***** error + so_explore_descent (1, 2, 3); +***** error + so_explore_descent (struct (), 2); +***** error + so_explore_descent ([2, 3], 2); +***** error <'fload' is not available> + pkg unload -nodeps parallel; + so_explore_descent ("foo", 2); +***** demo + pkg load parallel; + + data = struct (); + data.p = so_init_params (false); + data.p.vol = 10; + data.p.weight = 50; + + data.p.nSteps = 10; + data.figs = struct (); + data.figs.speed = figure (); + data.figs.exploreCosts = figure (); + + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + data.g = struct ("x", x, "h", h); + + data = so_example_problem (data); + phi0 = ls_genbasic (data.g.x, "box", -3, 7); + + printf ("Computing descent...\n"); + f = tmpfile (); + d = data; + d.handler = struct (); + d = so_save_descent (f, struct (), d); + s = so_run_descent (data.p.nSteps, phi0, d); + printf ("Final cost: %.6d\n", s.cost); + + printf ("\nNow replaying...\n"); + init = @() data; + frewind (f); + so_explore_descent (f, init); + fclose (f); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/ls_setxor.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setxor.m +***** error + ls_setxor (1) +***** error + ls_setxor (1, 2, 3) +***** error + ls_setxor (1, [1, 2]) +***** test + assert (ls_equal (ls_setxor ([-1, -1, Inf], [1, -1, -Inf]), [-1, 1, -1])); + n = 50; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi1 = XX.^2 + YY.^2 - 8^2; + phi2 = XX.^2 + YY.^2 - 5^2; + + assert (ls_equal (ls_setdiff (phi1, phi2), ls_setxor (phi1, phi2))); +***** demo + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2).^2 + YY.^2 - 3^2; + phi2 = (XX + 2).^2 + YY.^2 - 3^2; + phi = ls_setxor (phi1, phi2); + + figure (); + subplot (1, 2, 1); + hold ("on"); + contour (XX, YY, phi1, [0, 0], "k"); + contour (XX, YY, phi2, [0, 0], "k"); + hold ("off"); + axis ("equal"); + + subplot (1, 2, 2); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/ls_time_step.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_time_step.m +***** error + ls_time_step (1, 2) +***** error + ls_time_step (1, 2, 3, 4, 5, 6) +***** error + ls_time_step (1, 2, 3, 4, [5, 5]) +***** error + ls_time_step ([1; 1], [2, 2], [3, 3, 3]) +***** error + ls_time_step ([1, 1], 1, [2, 2], [3, 3, 3]) +***** error + ls_time_step (ones (2, 2), 1, 1) +***** test + n = 100; + x = linspace (0, 1, n); + h = x(2) - x(1); + + phi0 = sin (x); + fPos = ones (size (phi0)); + + % Single time step, moving exactly one grid step. + phit = ls_time_step (1, phi0, fPos); + assert (phit(2 : end), phi0(1 : end - 1)); + + % t = 1 should correspond to the previous result, and t = 2 + % shifts one more time step. However, due to boundary effects, + % we have to exclude some elements in the comparisons. + phitArr = ls_time_step ([1, 2], 0.5, phi0, fPos); + assert (size (phitArr), [2, 1]); + assert (phitArr{1}(3 : end), phit(3 : end), 1e-4); + assert (phitArr{2}(5 : end), phi0(3 : end - 2), 1e-4); + + % Try out movement in the other direction. + phit = ls_time_step (0.5, 0.1, phi0, -fPos, 0.5); + assert (phit(1 : end - 4), phi0(2 : end - 3), 1e-4); +***** function compareFastMarching (t, phi0, F, h, tol) + phit = ls_time_step (t, phi0, F, h); + d = ls_solve_stationary (phi0, F, h); + phit_fm = ls_extract_solution (t, d, phi0, F); + + sd1 = ls_signed_distance (phit, h); + sd2 = ls_signed_distance (phit_fm, h); + assert (sd1, sd2, tol); +***** endfunction +***** test + warning ("off", "level-set:fast-marching:too-far-alive"); + + n = 100; + x = linspace (-5, 5, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], [3, 1.5]); + F = ones (size (phi0)); + compareFastMarching (0.5, phi0, F, h, h / 2); + compareFastMarching (1.5, phi0, F, h, h / 2); + + phi0 = ls_genbasic (XX, YY, "box", [-3, -3], [3, 3]); + F = YY / 5; + compareFastMarching (1, phi0, F, h, h); + + F = ones (size (phi0)); + compareFastMarching (1, phi0, F, h, h / 2); + + phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], 3); + F = sin (XX .* YY); + compareFastMarching (1, phi0, F, h, h); +***** test + warning ("off", "level-set:fast-marching:increased-distance"); + + n = 50; + x = linspace (-5, 5, n); + h = x(2) - x(1); + [XX, YY, ZZ] = ndgrid (x, x, x); + + phi0 = ls_genbasic (XX, YY, ZZ, "sphere", [0, 0, 0], 3); + F = ones (size (phi0)); + compareFastMarching (1, phi0, F, h, h / 2); + compareFastMarching (1, phi0, -F, h, h / 2); +***** demo + n = 500; + x = linspace (-5, 5, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + F = sin (XX .* YY); + phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], 3); + phit = ls_time_step ([0.5, 1], phi0, F, h); + + figure (); + hold ("on"); + imagesc (x, x, F); + axis ("equal"); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi0, [0, 0], "k", "LineWidth", 2); + contour (XX, YY, phit{1}, [0, 0], "k", "LineWidth", 2); + contour (XX, YY, phit{2}, [0, 0], "k", "LineWidth", 2); + hold ("off"); +9 tests, 9 passed, 0 known failure, 0 skipped [inst/ls_find_geometry.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_find_geometry.m ***** error @@ -4436,26 +5027,156 @@ set (gca (), "xtick", x, "ytick", x, "xticklabel", "", "yticklabel", ""); hold ("off"); 12 tests, 12 passed, 0 known failure, 0 skipped -[inst/ls_equal.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_equal.m +[inst/ls_genbasic.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_genbasic.m +***** shared x, y, XX, YY, XXX, YYY, ZZZ + n = 121; + x = linspace (-5, 7, n); + y = linspace (-7, 5, n); + [XX, YY] = meshgrid (x, y); + [XXX, YYY, ZZZ] = ndgrid (x, y, x); ***** error - ls_equal (1) -***** error - ls_equal (1, 2, 3) -***** error - ls_equal (1, [1, 2]) + ls_genbasic (); +***** error + ls_genbasic (1, 2); +***** error + ls_genbasic ("sphere"); +***** error + ls_genbasic (XX, YY, "unknown"); ***** test - assert (ls_equal ([Inf, 0, -2, -Inf, eps], ... - [1, 0, -Inf, -eps, 1])); - assert (ls_equal ([1, 0; -1, 0], [Inf, 0; -5, 0])); - assert (!ls_equal ([1, -1; 0, 0], [1, 0; 0, 0])); + ls_genbasic (x, "sphere", 0, 1); + ls_genbasic (x', "sphere", 0, 1); + ls_genbasic (XX, YY, "sphere", [0, 0], 1); + ls_genbasic (0, 1, "sphere", [0, 0], 1); +***** error + ls_genbasic (XX, YY, "sphere"); +***** error + ls_genbasic (XX, YY, "sphere", 1); +***** error + ls_genbasic (XX, YY, "sphere", 1, 2, 3); +***** error + ls_genbasic (XX, YY, "sphere", [1, 2, 3], 1); +***** error + ls_genbasic (XX, YY, "sphere", [1, 2], [1, 2, 3]); ***** test - if (exist ("signbit") == 5) - assert (ls_equal ([0, -0], [1, -1])); - else - warning ("'signbit' function not available, skipping test."); - endif + assert (ls_genbasic (XX, YY, "sphere", [1, -1], 1), ... + ls_genbasic (XX, YY, "sphere", [1, -1], [1, 1])); +***** test + c = [1; -1; 2]; + r = [1; 2; 0.6]; + tol = 0.4; + phi1 = ls_genbasic (XXX, YYY, ZZZ, "sphere", c, r); + phi2 = ls_genbasic (XXX, YYY, ZZZ, "sphere", c, min (r) - tol); + assert (ls_issubset (phi2, phi1)); + coords = {XXX, YYY, ZZZ}; + for i = 1 : length (c) + assert (ls_disjoint (phi1, ... + coords{i} - (c(i) - r(i)), ... + c(i) + r(i) - coords{i})); + assert (~ls_disjoint (phi1 - tol, coords{i} - (c(i) - r(i)))); + assert (~ls_disjoint (phi1 - tol, c(i) + r(i) - coords{i})); + endfor +***** error + ls_genbasic (XX, YY, "box", 1); +***** error + ls_genbasic (XX, YY, "box", 1, 2, 3); +***** error + ls_genbasic (XX, YY, "box", [1, 2, 3], [1, 2]); +***** error + ls_genbasic (XX, YY, "box", [1; 2], [1, 2, 3]); +***** test + assert (ls_equal (ls_genbasic (x, "box", -1, 2), abs (x - 0.5) - 1.5)); + assert (ls_equal (ls_genbasic (x, "box", 2, -1), abs (x - 0.5) - 1.5)); +***** test + a = [2; -3; 1]; + b = [0; 2; -1]; + tol = 0.2; + phi1 = ls_genbasic (XXX, YYY, ZZZ, "box", a, b); + phi2 = ls_genbasic (XXX, YYY, ZZZ, "box", b, a); + assert (phi1, phi2); + coords = {XXX, YYY, ZZZ}; + for i = 1 : length (coords) + assert (ls_disjoint (phi1, ... + coords{i} - min (a(i), b(i)), ... + max (a(i), b(i)) - coords{i})); + assert (~ls_disjoint (phi1 - tol, coords{i} - min (a(i), b(i)))); + assert (~ls_disjoint (phi1 - tol, max (a(i), b(i)) - coords{i})); + endfor +***** error + ls_genbasic (XX, YY, "half", 1); +***** error + ls_genbasic (XX, YY, "half", 1, 2, 3); +***** error + ls_genbasic (XX, YY, "half", [1, 2, 3], [1, 2]); +***** error + ls_genbasic (XX, YY, "half", [1; 2], [1, 2, 3]); +***** test + p = [0, 2, 1]; + + phi = ls_genbasic (XXX, YYY, ZZZ, "half", p, [0; 0; 1]); + assert (ls_equal (phi, 1 - ZZZ)); + + normal = [1; 2; -0.5]; + phi1 = ls_genbasic (XXX, YYY, ZZZ, "half", p, normal); + phi2 = ls_genbasic (XXX, YYY, ZZZ, "half", p, 2 * normal); + assert (ls_equal (phi1, phi2)); + + phi = ls_genbasic (XX, YY, "half", [0, 0], [1, -1]); + assert (ls_equal (phi, YY - XX)); +***** demo + n = 200; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = ls_genbasic (XX, YY, "box", [-5, -3], [3, 6]); + phi2 = ls_genbasic (XX, YY, "sphere", [-1; 1], 2); + phi3 = ls_genbasic (XX, YY, "sphere", [0; 0], [6, 1]); + phi4 = ls_genbasic (XX, YY, "half", [3, -3], [1, -2]) / 8; + + phi = ls_union (ls_setdiff (phi1, phi2), phi3, phi4); + figure (); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); +23 tests, 23 passed, 0 known failure, 0 skipped +[inst/ls_absolute_geom.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_absolute_geom.m +***** error + ls_absolute_geom (1, 2); +***** error + ls_absolute_geom (1, 2, 3, 4); +***** error + x = [-1, 1]; + [XX, YY, ZZ] = ndgrid (x); + ls_absolute_geom (struct (), XX, YY); +***** error + ls_absolute_geom (struct (), [-1, 0, 1], [0, 0, 0]); +***** error + ls_absolute_geom (struct (), zeros (3, 2), zeros (2, 2)); 5 tests, 5 passed, 0 known failure, 0 skipped +[inst/so_init_params.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_init_params.m +***** error + so_init_params () +***** error + so_init_params (true, 1, 2) +***** error + so_init_params (true, 0); +***** error + so_init_params (true, 1.5); +***** test + p = so_init_params (true); +***** error <'pararrayfun' is not available> + pkg unload -nodeps parallel; + p = so_init_params (true, 2); +***** test + pkg load parallel; + p = so_init_params (true, 2); +7 tests, 7 passed, 0 known failure, 0 skipped [inst/upwind_gradient_norm.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/upwind_gradient_norm.m ***** error @@ -4504,6 +5225,229 @@ r = sqrt (phi); assert (g, 2 * r, 0.1); 7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_nb_from_geom.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_nb_from_geom.m +***** error + ls_nb_from_geom (1) +***** error + ls_nb_from_geom (1, 2, 3, 4) +***** error + [a, b] = ls_nb_from_geom (1, 2); +***** error + ls_nb_from_geom (1, 2, rand (2, 2)); +***** error + x = linspace (-10, 10, 10); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + ls_nb_from_geom (geom, phi); +***** error + x = linspace (-10, 10, 10); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + ls_nb_from_geom (geom, phi, [1, 2, 3]); +***** test + n = 50; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_setdiff (ls_genbasic (XX, YY, "sphere", [0, 0], 8), ... + ls_genbasic (XX, YY, "sphere", [1, 1], 5)); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + geom = ls_absolute_geom (geom, XX, YY); + + dOld = ls_init_narrowband (phi, h); + dNew = ls_nb_from_geom (geom, phi); + + where = (!isna (dOld)); + assert (all (!isna (dNew(where)))); + assert (dNew(where), dOld(where), h / 4); +***** demo + n = 50; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = ls_genbasic (XX, YY, "sphere", [0, 0], 3); + phi = ls_normalise (phi, h); + geom = ls_find_geometry (phi, h); + geom = ls_absolute_geom (geom, XX, YY); + + g0 = NA (1, geom.bedges.n); + for i = 1 : geom.bedges.n + a = geom.ispts.coord(geom.bedges.ispts(i, 1), :); + b = geom.ispts.coord(geom.bedges.ispts(i, 2), :); + m = (a + b) / 2; + angle = abs (atan2 (m(2), m(1))); + g0(i) = min (angle, 2 * pi - angle); + endfor + + [d, g] = ls_nb_from_geom (geom, phi, g0); + [d, g] = fastmarching (d, g, h * ones (size (phi))); + + figure (); + hold ("on"); + imagesc (x, x, g); + set (gca (), "ydir", "normal"); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + colorbar (); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_enforce.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce.m +***** error + ls_enforce (1, 2) +***** error + ls_enforce (1, 2, 3, 4) +***** error + ls_enforce (1, "inside", [1, 2]); +***** error + ls_enforce (1, "foo", true); +***** error + ls_enforce (1, NA, false); +***** test + n = 100; + x = linspace (-10, 10, n); + [XX, YY] = meshgrid (x, x); + + circ2 = (XX.^2 + YY.^2 < 2^2); + circ8 = (XX.^2 + YY.^2 < 8^2); + phi = (XX.^2 + YY.^2 - 5^2); + + phi2 = ls_enforce (phi, "inside", circ8); + assert (ls_equal (phi2, phi)); + phi2 = ls_enforce (phi, "inside", circ2); + assert (ls_check (phi2, "inside", circ2)); + + phi2 = ls_enforce (phi, "contain", circ2); + assert (ls_equal (phi2, phi)); + phi2 = ls_enforce (phi, "contain", circ8); + assert (ls_check (phi2, "contain", circ8)); + + phi2 = ls_enforce (phi, "outside", ~circ8); + assert (ls_equal (phi2, phi)); + phi2 = ls_enforce (phi, "outside", ~circ2); + ls_check (phi2, "outside", ~circ2); + phi2 = ls_enforce (phi, "outside", circ2); + ls_check (phi2, "outside", circ2); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/ls_enforce_speed.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce_speed.m +***** error + ls_enforce_speed (1, 2) +***** error + ls_enforce_speed (1, 2, 3, 4) +***** error + ls_enforce_speed (1, "inside", [1, 2]); +***** error + ls_enforce_speed (1, "foo", true); +***** error + ls_enforce_speed (1, NA, false); +***** function checkCircleRadius (XX, YY, h, phi, r) + phiCorrect = XX.^2 + YY.^2 - r^2; + sd1 = ls_signed_distance (phi, h); + sd2 = ls_signed_distance (phiCorrect, h); + assert (sd1, sd2, h); +***** endfunction +***** test + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = XX.^2 + YY.^2 - 3^2; + F = ones (size (XX)); + whereContain = (XX.^2 + YY.^2 < 5^2); + F = ls_enforce_speed (F, "contain", whereContain); + whereInside = (XX.^2 + YY.^2 < 8^2); + F = ls_enforce_speed (F, "inside", whereInside); + dists = ls_solve_stationary (phi, F, h); + phi2 = ls_extract_solution (10, dists, phi, F); + assert (ls_check (phi2, "contain", whereContain)); + assert (ls_check (phi2, "inside", whereInside)); + checkCircleRadius (XX, YY, h, phi2, 8); + + phi = XX.^2 + YY.^2 - 8^2; + F = -ones (size (XX)); + whereContain = (XX.^2 + YY.^2 < 5^2); + F = ls_enforce_speed (F, "contain", whereContain); + whereOutside = (XX.^2 + YY.^2 >= 7^2); + F = ls_enforce_speed (F, "outside", whereOutside); + dists = ls_solve_stationary (phi, F, h); + phi2 = ls_extract_solution (10, dists, phi, F); + assert (ls_check (phi2, "contain", whereContain)); + assert (ls_check (phi2, "outside", whereOutside)); + checkCircleRadius (XX, YY, h, phi2, 5); +***** demo + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + [XX, YY] = meshgrid (x, x); + + phi = XX.^2 + YY.^2 - 8^2; + F = -ones (size (XX)); + F = ls_enforce_speed (F, "outside", XX.^2 + YY.^2 >= 7^2); + F = ls_enforce_speed (F, "contain", XX.^2 + YY.^2 < 3^2); + times = linspace (1, 6, 40); + ls_animate_evolution (phi, F, h, times, 0.05); + + phi = XX.^2 + YY.^2 - 3^2; + F = ones (size (XX)); + F = ls_enforce_speed (F, "inside", XX.^2 + YY.^2 < 8^2); + F = ls_enforce_speed (F, "contain", XX.^2 + YY.^2 < 5^2); + ls_animate_evolution (phi, F, h, times, 0.05); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/so_save_descent.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_save_descent.m +***** error + so_save_descent (1, 2); +***** error + so_save_descent (1, 2, 3, 4); +***** error + so_save_descent (1, 2, 3); +***** error + so_save_descent (struct (), 2, struct ()); +***** error + so_save_descent ([2, 3], 2, struct ()); +***** error <'fsave' is not available> + pkg unload -nodeps parallel; + so_save_descent ("foo", 2, struct ()); +***** test + pkg load parallel; + so_save_descent ("foo", 2, struct ()); + so_save_descent (5, 2, struct ()); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_disjoint.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_disjoint.m +***** error + ls_disjoint () +***** error + ls_disjoint (1, -2, [1, 2]) +***** test + assert (ls_disjoint ([-1, 0, 1], [0, 0, 0], [1, 0, -1])); + assert (~ls_disjoint ([Inf, -Inf, 1], [-1, -1, 1])); + assert (~ls_disjoint ([-1, -1, 1], [0, 0, 0], [1, -1, -1])); +***** test + n = 50; + x = linspace (-10, 10, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; + phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; + phi3 = XX.^2 + YY.^2 - 2^2; + + assert (ls_disjoint (phi1, phi2)); + assert (~ls_disjoint (phi1, phi3)); + assert (~ls_disjoint (phi2, phi3)); + assert (~ls_disjoint (phi1, phi2, phi3)); +4 tests, 4 passed, 0 known failure, 0 skipped [inst/so_step_armijo.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_step_armijo.m ***** function s = updateState (phi, data) @@ -4606,147 +5550,28 @@ ***** error so_step_armijo (3, d, f, dJ, baseData); 18 tests, 18 passed, 0 known failure, 0 skipped -[inst/ls_enforce.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce.m +[inst/ls_issubset.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_issubset.m ***** error - ls_enforce (1, 2) -***** error - ls_enforce (1, 2, 3, 4) -***** error - ls_enforce (1, "inside", [1, 2]); -***** error - ls_enforce (1, "foo", true); -***** error - ls_enforce (1, NA, false); + ls_issubset (1) +***** error + ls_issubset (1, 2, 3) +***** error + ls_issubset (1, [1, 2]) ***** test - n = 100; + n = 50; x = linspace (-10, 10, n); [XX, YY] = meshgrid (x, x); - circ2 = (XX.^2 + YY.^2 < 2^2); - circ8 = (XX.^2 + YY.^2 < 8^2); - phi = (XX.^2 + YY.^2 - 5^2); - - phi2 = ls_enforce (phi, "inside", circ8); - assert (ls_equal (phi2, phi)); - phi2 = ls_enforce (phi, "inside", circ2); - assert (ls_check (phi2, "inside", circ2)); - - phi2 = ls_enforce (phi, "contain", circ2); - assert (ls_equal (phi2, phi)); - phi2 = ls_enforce (phi, "contain", circ8); - assert (ls_check (phi2, "contain", circ8)); - - phi2 = ls_enforce (phi, "outside", ~circ8); - assert (ls_equal (phi2, phi)); - phi2 = ls_enforce (phi, "outside", ~circ2); - ls_check (phi2, "outside", ~circ2); - phi2 = ls_enforce (phi, "outside", circ2); - ls_check (phi2, "outside", circ2); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/so_save_descent.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_save_descent.m -***** error - so_save_descent (1, 2); -***** error - so_save_descent (1, 2, 3, 4); -***** error - so_save_descent (1, 2, 3); -***** error - so_save_descent (struct (), 2, struct ()); -***** error - so_save_descent ([2, 3], 2, struct ()); -***** error <'fsave' is not available> - pkg unload -nodeps parallel; - so_save_descent ("foo", 2, struct ()); -***** test - pkg load parallel; - so_save_descent ("foo", 2, struct ()); - so_save_descent (5, 2, struct ()); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ls_init_narrowband.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_init_narrowband.m -***** error - ls_init_narrowband () -***** error - ls_init_narrowband (1, 2, 3) -***** test - assert (ls_init_narrowband ([]), []); -***** test - n = 10; - x = linspace (-2, 2, n); - h = x(2) - x(1); - phi = abs (x) - 1; - - d = ls_init_narrowband (phi, h); - where = ~isna (d); - assert (d(where), phi(where), sqrt (eps)); -***** test - n = 50; - x = linspace (-2, 2, n); - h = x(2) - x(1); - [XX, YY, ZZ] = ndgrid (x); - RRsq = XX.^2 + YY.^2 + ZZ.^2; - phi = RRsq - 1; + phi1 = XX.^2 + YY.^2 - 1^2; + phi2 = XX.^2 + YY.^2 - 5^2; + phi3 = XX.^2 + YY.^2 - 8^2; + phi4 = (XX - 3).^2 + YY.^2 - 3^2; - d = ls_init_narrowband (phi, h); - where = ~isna (d); - assert (d(where), sqrt (RRsq(where)) - 1, h / 3); -***** test - tol = sqrt (eps); - assert (ls_init_narrowband ([Inf, -Inf, Inf]), [0.5, -0.5, 0.5], tol); - assert (ls_init_narrowband ([Inf, -1, Inf]), [1, 0, 1], tol); - %assert (ls_init_narrowband ([1, -Inf, 1]), [0, 1, 0], tol); -***** function dh = distToSegment (x, a, b) - dir = b - a; - dir /= norm (dir); - proj = dot (x - a, dir); - if (proj < 0) - dh = norm (x - a); - elseif (proj > 1) - dh = norm (x - b); - else - dh = norm (x - (a + proj * dir)); - endif -***** endfunction -***** function dh = distToLine (x, c) - assert (c(1, 1), 0); - dh = Inf; - for i = 2 : size (c, 2) - 1 - dh = min (dh, distToSegment (x, c(:, i), c(:, i + 1))); - endfor -***** endfunction -***** function dh = distOfContoursAsym (c1, c2) - dh = 0; - for i = 2 : size (c1, 2) - dh = max (dh, distToLine (c1(:, i), c2)); - endfor -***** endfunction -***** function dh = distOfContours (c1, c2) - dh = max (distOfContoursAsym (c1, c2), distOfContoursAsym (c2, c1)); -***** endfunction -***** test - phis = ls_get_tests (); - printf ("Comparing contours for %d cases...\n", length (phis)); - for i = 1 : length (phis) - d = ls_init_narrowband (phis{i}); - c1 = contourc (d, [0, 0]); - if (size (c1, 2) > 0) - c2 = contourc (phis{i}, [0, 0]); - dh = distOfContours (c1, c2); - printf ("i = %d: dist = %f\n", i, dh); - if (isfinite (dh)) - assert (dh, 0, 1e-1); - endif - endif - endfor -Comparing contours for 6 cases... -i = 1: dist = 0.060660 -i = 2: dist = Inf -i = 4: dist = 0.039039 -i = 5: dist = 0.085786 -i = 6: dist = 0.085786 -7 tests, 7 passed, 0 known failure, 0 skipped + assert (ls_issubset (phi1, phi2)); + assert (ls_issubset (phi4, phi3)); + assert (~ls_issubset (phi4, phi2)); +4 tests, 4 passed, 0 known failure, 0 skipped [inst/so_example_problem.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_example_problem.m ***** shared basicData @@ -4821,578 +5646,6 @@ testDeriv (-1, 3, data); testDeriv (-3, 1, data); 6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ls_setdiff.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setdiff.m -***** error - ls_setdiff (1) -***** error - ls_setdiff (1, 2, 3) -***** error - ls_setdiff (1, [1, 2]) -***** test - assert (ls_equal (ls_setdiff ([-1, -1, 1], [1, -1, -1]), [-1, 1, 1])); - n = 50; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi1 = XX.^2 + YY.^2 - 8^2; - phi2 = XX.^2 + YY.^2 - 5^2; - - phi = ls_setdiff (phi1, phi2); - assert (ls_issubset (phi, phi1)); - assert (ls_disjoint (phi, phi2)); - - phi = ls_setdiff (phi2, phi1); - assert (ls_isempty (phi)); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2).^2 + YY.^2 - 3^2; - phi2 = (XX + 2).^2 + YY.^2 - 3^2; - phi = ls_setdiff (phi1, phi2); - - figure (); - subplot (1, 2, 1); - hold ("on"); - contour (XX, YY, phi1, [0, 0], "k"); - contour (XX, YY, phi2, [0, 0], "k"); - hold ("off"); - axis ("equal"); - - subplot (1, 2, 2); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = XX.^2 + YY.^2 - 6^2; - phi2 = XX.^2 + YY.^2 - 3^2; - phi = ls_setdiff (phi1, phi2); - - figure (); - subplot (1, 2, 1); - hold ("on"); - contour (XX, YY, phi1, [0, 0], "k"); - contour (XX, YY, phi2, [0, 0], "k"); - hold ("off"); - axis ("equal"); - - subplot (1, 2, 2); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/ls_time_step.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_time_step.m -***** error - ls_time_step (1, 2) -***** error - ls_time_step (1, 2, 3, 4, 5, 6) -***** error - ls_time_step (1, 2, 3, 4, [5, 5]) -***** error - ls_time_step ([1; 1], [2, 2], [3, 3, 3]) -***** error - ls_time_step ([1, 1], 1, [2, 2], [3, 3, 3]) -***** error - ls_time_step (ones (2, 2), 1, 1) -***** test - n = 100; - x = linspace (0, 1, n); - h = x(2) - x(1); - - phi0 = sin (x); - fPos = ones (size (phi0)); - - % Single time step, moving exactly one grid step. - phit = ls_time_step (1, phi0, fPos); - assert (phit(2 : end), phi0(1 : end - 1)); - - % t = 1 should correspond to the previous result, and t = 2 - % shifts one more time step. However, due to boundary effects, - % we have to exclude some elements in the comparisons. - phitArr = ls_time_step ([1, 2], 0.5, phi0, fPos); - assert (size (phitArr), [2, 1]); - assert (phitArr{1}(3 : end), phit(3 : end), 1e-4); - assert (phitArr{2}(5 : end), phi0(3 : end - 2), 1e-4); - - % Try out movement in the other direction. - phit = ls_time_step (0.5, 0.1, phi0, -fPos, 0.5); - assert (phit(1 : end - 4), phi0(2 : end - 3), 1e-4); -***** function compareFastMarching (t, phi0, F, h, tol) - phit = ls_time_step (t, phi0, F, h); - d = ls_solve_stationary (phi0, F, h); - phit_fm = ls_extract_solution (t, d, phi0, F); - - sd1 = ls_signed_distance (phit, h); - sd2 = ls_signed_distance (phit_fm, h); - assert (sd1, sd2, tol); -***** endfunction -***** test - warning ("off", "level-set:fast-marching:too-far-alive"); - - n = 100; - x = linspace (-5, 5, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], [3, 1.5]); - F = ones (size (phi0)); - compareFastMarching (0.5, phi0, F, h, h / 2); - compareFastMarching (1.5, phi0, F, h, h / 2); - - phi0 = ls_genbasic (XX, YY, "box", [-3, -3], [3, 3]); - F = YY / 5; - compareFastMarching (1, phi0, F, h, h); - - F = ones (size (phi0)); - compareFastMarching (1, phi0, F, h, h / 2); - - phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], 3); - F = sin (XX .* YY); - compareFastMarching (1, phi0, F, h, h); -***** test - warning ("off", "level-set:fast-marching:increased-distance"); - - n = 50; - x = linspace (-5, 5, n); - h = x(2) - x(1); - [XX, YY, ZZ] = ndgrid (x, x, x); - - phi0 = ls_genbasic (XX, YY, ZZ, "sphere", [0, 0, 0], 3); - F = ones (size (phi0)); - compareFastMarching (1, phi0, F, h, h / 2); - compareFastMarching (1, phi0, -F, h, h / 2); -***** demo - n = 500; - x = linspace (-5, 5, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - F = sin (XX .* YY); - phi0 = ls_genbasic (XX, YY, "sphere", [0, 0], 3); - phit = ls_time_step ([0.5, 1], phi0, F, h); - - figure (); - hold ("on"); - imagesc (x, x, F); - axis ("equal"); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi0, [0, 0], "k", "LineWidth", 2); - contour (XX, YY, phit{1}, [0, 0], "k", "LineWidth", 2); - contour (XX, YY, phit{2}, [0, 0], "k", "LineWidth", 2); - hold ("off"); -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/so_replay_descent.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_replay_descent.m -***** error - so_replay_descent (1); -***** error - so_replay_descent (1, 2, 3, 4); -***** error - so_replay_descent (1, 2, 0); -***** error - so_replay_descent (1, 2, 1.5); -***** error - so_replay_descent (1, 2, [2, 3]); -***** error - so_replay_descent (struct (), 2); -***** error - so_replay_descent ([2, 3], 2); -***** error <'fload' is not available> - pkg unload -nodeps parallel; - so_replay_descent ("foo", 2); -***** function x = compressionCheckStruct (s, data) - x = struct ("weight", data.p.weight, "cost", s.cost); -***** endfunction -***** function checkCompression (s, data, field) - assert (isfield (s, field)); - assert (getfield (s, field), compressionCheckStruct (s, data)); -***** endfunction -***** function s = compressState (s, data) - s.compressed = compressionCheckStruct (s, data); -***** endfunction -***** function s = uncompressState (s, data) - checkCompression (s, data, "compressed"); - s.uncompressed = compressionCheckStruct (s, data); -***** endfunction -***** function log = initialised (data) - log = data.log; - log.mashUp = [data.s.a, data.s.b]; -***** endfunction -***** function log = beforeStep (k, data) - log = data.log; - log.mashUp = [log.mashUp, k, data.s.vol]; - - if (data.checkUncompression) - checkCompression (data.s, data, "uncompressed"); - endif -***** endfunction -***** function log = direction (k, f, dJ, data) - log = data.log; - log.mashUp = [log.mashUp, k, mean(f), sum(f), dJ, data.s.integ]; -***** endfunction -***** function log = afterStep (k, t, s, data) - log = data.log; - log.mashUp = [log.mashUp, k, t, s.a, s.b, s.cost, data.s.cost]; - - if (data.checkUncompression) - checkCompression (s, data, "uncompressed"); - endif -***** endfunction -***** function log = finished (data) - log = data.log; - log.mashUp = [log.mashUp, data.s.cost, log.steps, log.costs]; -***** endfunction -***** function data = getData () - data = struct (); - data.p = so_init_params (false); - data.p.vol = 10; - data.p.weight = 50; - - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - data.g = struct ("x", x, "h", h); - - data = so_example_problem (data); - data.handler = struct ("initialised", @initialised, ... - "before_step", @beforeStep, ... - "direction", @direction, ... - "after_step", @afterStep, ... - "finished", @finished); - - % Unless explicitly set, do not expect compressed states. - data.checkUncompression = false; - - data.phi0 = ls_genbasic (data.g.x, "box", -3, 5); -***** endfunction -***** function data = getDataForCompression (uncompress) - data = getData (); - data.compress = struct (); - data.compress.save = struct ("state", @compressState); - data.compress.load = struct ("state", @uncompressState); - data.checkUncompression = uncompress; -***** endfunction -***** function compareResults (s1, l1, s2, l2) - assert (s2, s1); - assert (l2.mashUp, l1.mashUp); -***** endfunction -***** xtest - pkg load parallel; - - nSteps = 10; - baseData = getData (); - - f = tempname (); - data = so_save_descent (f, struct (), baseData); - [s1, l1] = so_run_descent (nSteps, data.phi0, data); - [s2, l2] = so_replay_descent (f, @getData); - unlink (f); - compareResults (s1, l1, s2, l2); - - f = tmpfile (); - data = so_save_descent (f, struct (), baseData); - [s1, l1] = so_run_descent (nSteps, data.phi0, data); - frewind (f); - [s2, l2] = so_replay_descent (f, @getData); - fclose (f); - compareResults (s1, l1, s2, l2); - - [pr, pw] = pipe (); - data = so_save_descent (pw, struct (), baseData); - [s1, l1] = so_run_descent (nSteps, data.phi0, data); - fclose (pw); - [s2, l2] = so_replay_descent (pr, @getData); - fclose (pr); - compareResults (s1, l1, s2, l2); -!!!!! known failure -structure has no member 'openFile' -***** xtest - pkg load parallel; - - baseData = getData (); - [pr, pw] = pipe (); - data = so_save_descent (pw, struct (), baseData); - data.cb.check_stop = @() true; - [s1, l1] = so_run_descent (1, data.phi0, data); - fclose (pw); - assert (l1.steps, 0); - [s2, l2] = so_replay_descent (pr, @getData); - fclose (pr); - compareResults (s1, l1, s2, l2); - - baseData = getData (); - [pr, pw] = pipe (); - data = so_save_descent (pw, struct (), baseData); - [s1, l1] = so_run_descent (1, data.phi0, data); - fclose (pw); - [s2, l2] = so_replay_descent (pr, @getData, 1); - fclose (pr); - compareResults (s1, l1, s2, l2); -!!!!! known failure -structure has no member 'openFile' -***** xtest - pkg load parallel; - - nStepsShort = 5; - nStepsLong = 10; - - baseData = getData (); - [prl, pwl] = pipe (); - data = so_save_descent (pwl, struct (), baseData); - [sl, ll] = so_run_descent (nStepsLong, data.phi0, data); - fclose (pwl); - - baseData = getData (); - [prs, pws] = pipe (); - data = so_save_descent (pws, struct (), baseData); - [ss, ls] = so_run_descent (nStepsShort, data.phi0, data); - fclose (pws); - - [s, l] = so_replay_descent (prl, @getData, nStepsShort); - fclose (prl); - compareResults (s, l, ss, ls); - - [s, l] = so_replay_descent (prs, @getData, nStepsLong); - fclose (prs); - compareResults (s, l, sl, ll); -!!!!! known failure -structure has no member 'openFile' -***** xtest - pkg load parallel; - - nSteps = 10; - [pr, pw] = pipe (); - - data = getDataForCompression (false); - data = so_save_descent (pw, struct (), data); - [s1, l1] = so_run_descent (nSteps, data.phi0, data); - fclose (pw); - - init = @(header) getDataForCompression (true); - [s2, l2] = so_replay_descent (pr, init); - fclose (pr); - - % No result comparison here, since the compress / uncompress - % functions introduced changes to the state structs. -!!!!! known failure -structure has no member 'openFile' -***** demo - pkg load parallel; - - data = struct (); - data.p = so_init_params (false); - data.p.vol = 10; - data.p.weight = 50; - - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - data.g = struct ("x", x, "h", h); - - data = so_example_problem (data); - phi0 = ls_genbasic (data.g.x, "box", -3, 7); - - printf ("Computing descent...\n"); - [pr, pw] = pipe (); - d = data; - d.handler = struct (); - d = so_save_descent (pw, struct (), d); - s = so_run_descent (5, phi0, d); - fclose (pw); - printf ("Final cost: %.6d\n", s.cost); - - printf ("\nNow replaying...\n"); - d = data; - d.p.verbose = true; - init = @() d; - s = so_replay_descent (pr, init); - fclose (pr); - printf ("Final cost: %.6d\n", s.cost); -warning: test: file /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_replay_descent.m leaked file descriptors -12 tests, 8 passed, 4 known failures, 0 skipped -[inst/ls_setxor.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setxor.m -***** error - ls_setxor (1) -***** error - ls_setxor (1, 2, 3) -***** error - ls_setxor (1, [1, 2]) -***** test - assert (ls_equal (ls_setxor ([-1, -1, Inf], [1, -1, -Inf]), [-1, 1, -1])); - n = 50; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi1 = XX.^2 + YY.^2 - 8^2; - phi2 = XX.^2 + YY.^2 - 5^2; - - assert (ls_equal (ls_setdiff (phi1, phi2), ls_setxor (phi1, phi2))); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2).^2 + YY.^2 - 3^2; - phi2 = (XX + 2).^2 + YY.^2 - 3^2; - phi = ls_setxor (phi1, phi2); - - figure (); - subplot (1, 2, 1); - hold ("on"); - contour (XX, YY, phi1, [0, 0], "k"); - contour (XX, YY, phi2, [0, 0], "k"); - hold ("off"); - axis ("equal"); - - subplot (1, 2, 2); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/ls_union.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_union.m -***** error - ls_union () -***** error - ls_union (1, -2, [1, 2]) -***** test - n = 50; - x = linspace (-10, 10, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 3).^2 + (YY - 3).^2 - 2^2; - phi2 = (XX + 3).^2 + (YY + 3).^2 - 2^2; - phi3 = XX.^2 + YY.^2 - 2^2; - - phi = ls_union (phi1, phi2, phi3); - assert (ls_issubset (phi1, phi)); - assert (ls_issubset (phi2, phi)); - assert (ls_issubset (phi3, phi)); - - assert (ls_union (phi3), phi3); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); - - phi1 = (XX - 2 * cos (7/6 * pi)).^2 + (YY - 2 * sin (7/6 * pi)).^2 - 3^2; - phi2 = (XX - 2 * cos (11/6 * pi)).^2 + (YY - 2 * sin (11/6 * pi)).^2 - 3^2; - phi3 = XX.^2 + (YY - 2).^2 - 3^2; - phi = ls_union (phi1, phi2, phi3); - - figure (); - subplot (1, 2, 1); - hold ("on"); - contour (XX, YY, phi1, [0, 0], "k"); - contour (XX, YY, phi2, [0, 0], "k"); - contour (XX, YY, phi3, [0, 0], "k"); - hold ("off"); - axis ("equal"); - - subplot (1, 2, 2); - hold ("on"); - imagesc (x, x, phi); - set (gca (), "ydir", "normal"); - ls_sign_colourmap (); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - axis ("equal"); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/ls_hausdorff_dist.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_hausdorff_dist.m -***** error - ls_hausdorff_dist (1) -***** error - ls_hausdorff_dist (1, 2, 3, 4) -***** error - ls_hausdorff_dist (1, 2, [3, 3]) -***** error - ls_hausdorff_dist (1, 2, "foo") -***** test - n = 50; - x = linspace (-5, 5, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi1 = ls_genbasic (XX, YY, "sphere", [3, 0], 1); - phi2 = ls_genbasic (XX, YY, "sphere", [-2, 0], 2); - assert (ls_hausdorff_dist (phi1, phi2, h), 6, h); - - % Make sure that phi isn't a signed-distance fcn already. - % ls_genbasic should return the same, but make it explicit. - rSq = XX.^2 + YY.^2; - d = ls_hausdorff_dist (rSq - 4^2, rSq - 2^2, h); - assert (d, 2, h); - dWrong = ls_hausdorff_dist (rSq - 4^2, rSq - 2^2, "sd"); - assert (abs (d - dWrong) > 10 * h); - dRight = ls_hausdorff_dist (sqrt (rSq) - 4, sqrt (rSq) - 2, "sd"); - assert (dRight, d, h); -***** test - n = 200; - x = linspace (-5, 5, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phiA = ls_genbasic (XX, YY, "sphere", [0, 0], 4); - phiInner = ls_genbasic (XX, YY, "sphere", [0, 0], 2); - phiB = ls_setdiff (phiA, phiInner); - - d1 = ls_hausdorff_dist (phiA, phiB, h); - d2 = ls_hausdorff_dist (phiB, phiA, h); - assert (d1, d2); - assert (d1, 2, 2 * h); - dc = ls_hausdorff_dist (ls_complement (phiA), ... - ls_complement (phiB), h); - assert (dc, 4, 2 * h); - - sdA = ls_signed_distance (phiA, h); - sdB = ls_signed_distance (phiB, h); - sdDiff = norm (sdA(:) - sdB(:), inf); - assert (abs (sdDiff - d1) > 10 * h); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ls_normalise.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_normalise.m -***** error - ls_normalise () -***** error - ls_normalise (1, 2, 3, 4) -***** test - h = 0.1; - zeroTol = 0.2; - phi = ones (4, 4); - phiEx = phi; - phi(2 : 3, 2 : 3) = [-eps, -0; 0, eps]; - phiEx(2 : 3, 2 : 3) = [-zeroTol*h, -zeroTol*h; zeroTol*h, zeroTol*h]; - phin = ls_normalise (phi, h, zeroTol); - if (exist ("signbit") == 5) - assert (phin, phiEx); - else - warning ("'signbit' function not available, skipping test."); - endif -3 tests, 3 passed, 0 known failure, 0 skipped [inst/fastmarching.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/fastmarching.m ***** error @@ -5538,7 +5791,7 @@ fastmarching at line 110 column 19 __test__ at line 5 column 5 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 230 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 270 column 31 ***** test u0 = [0, NA; Inf, 2]; @@ -5550,14 +5803,14 @@ fastmarching at line 110 column 19 __test__ at line 5 column 5 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 230 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 270 column 31 warning: found too far alive point in fast marching, d = -8.000000 warning: called from fastmarching at line 110 column 19 __test__ at line 5 column 5 test at line 682 column 11 - /tmp/tmp.oKYgm6YXEv at line 230 column 31 + /tmp/tmp.Fyt3Cgdm4G at line 270 column 31 ***** test u0 = [0, NA, NA, NA, 0.1; ... @@ -5597,14 +5850,19 @@ p(1), pLogN(1)); assert (p(1), 1, 1e-1); assert (pLogN(1), 1, 1e-1); -n = 101: t = 0.013 s -n = 201: t = 0.054 s -n = 501: t = 0.372 s -n = 1001: t = 1.930 s -n = 2001: t = 9.070 s +n = 101: t = 0.040 s +n = 201: t = 0.174 s +n = 501: t = 1.242 s +n = 1001: t = 5.741 s +n = 2001: t = 34.370 s Exponents: - O(n): 1.09 - O(n log n): 1.01 + O(n): 1.12 + O(n log n): 1.03 +!!!!! known failure +ASSERT errors for: assert (p (1),1,1e-1) + + Location | Observed | Expected | Reason + () 1.1208 1 Abs err 0.12078 exceeds tol 0.1 by 0.02 ***** test T = 1.6; timeSteps = 10000; @@ -5760,195 +6018,25 @@ figure (); imshow (u); title ("Solved Maze. Blue: Walls, Red: Unreachable, Yellow: Start."); -16 tests, 16 passed, 0 known failure, 0 skipped -[inst/ls_absolute_geom.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_absolute_geom.m -***** error - ls_absolute_geom (1, 2); -***** error - ls_absolute_geom (1, 2, 3, 4); -***** error - x = [-1, 1]; - [XX, YY, ZZ] = ndgrid (x); - ls_absolute_geom (struct (), XX, YY); -***** error - ls_absolute_geom (struct (), [-1, 0, 1], [0, 0, 0]); -***** error - ls_absolute_geom (struct (), zeros (3, 2), zeros (2, 2)); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/ls_solve_stationary.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_solve_stationary.m -***** error - ls_solve_stationary (1) -***** error - ls_solve_stationary (1, 2, 3, 4, 5) -***** error - ls_solve_stationary ([1, 2], [3; 4]); -***** error - ls_solve_stationary ([1, 2], [1, 2], :, [3; 4]); -***** test - assert (ls_solve_stationary ([], []), []); -***** function checkOutput (phi, f, d) - assert (all (isna (d(f == 0)))); - where = (f ~= 0); - assert (all (isfinite (d(where)) | isinf (d(where)))); - assert (sign (d(where)), sign (phi(where))); -***** endfunction -***** test - phis = ls_get_tests (); - for i = 1 : length (phis) - f = ones (size (phis{i})); - for j = -1 : 1 - phi = ls_normalise (phis{i}); - d = ls_solve_stationary (phi, j * f); - checkOutput (phi, j * f, d); - endfor - endfor -***** test - n = 101; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - r1 = (XX - 5).^2 + YY.^2; - r2 = (XX + 5).^2 + YY.^2; - - phi = ls_union (r1 - 2^2, r2 - 2^2); - f1 = max (r1 - 3^2, 1^2 - r1); - f2 = max (r2 - 3^2, 1^2 - r2); - f = min (f1, f2) .* sign (XX); - assert (~all (f(:) ~= 0)); - - d = ls_solve_stationary (phi, f, h); - - checkOutput (phi, f, d); - where = (f ~= 0); - assert (any (isinf (d(where)))); - - %{ - contour (phi, [0, 0]); - colorbar (); - figure (); - imagesc (f); - colorbar (); - figure (); - imagesc (d); - colorbar (); - %} -***** test - phi = [3, 1, -1, 1, 3]; - f = ones (size (phi)); - dists1 = ls_solve_stationary (phi, f); - dists2 = ls_solve_stationary (phi, f, :, [NA, NA, -0.1, NA, NA]); - - assert (dists1, [1.5, 0.5, -0.5, 0.5, 1.5], sqrt (eps)); - assert (dists2, [1.9, 0.9, -0.1, 0.9, 1.9]); -***** demo - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi0 = YY - XX + 15; - f = sign (XX) + 2; - - d = ls_solve_stationary (phi0, f, h); - figure (); - contour (XX, YY, d); - line ([0, 0], [-10, 10]); - title ("Refraction"); -***** demo - n = 101; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi0 = XX + 9; - f = ones (size (phi0)); - f(XX == 0 & abs (YY) > 2) = 0; - - d = ls_solve_stationary (phi0, f, h); - figure (); - contour (XX, YY, d); - line ([0, 0], [-10, -2]); - line ([0, 0], [2, 10]); - title ("Diffraction"); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/ls_nb_from_geom.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_nb_from_geom.m -***** error - ls_nb_from_geom (1) -***** error - ls_nb_from_geom (1, 2, 3, 4) +16 tests, 15 passed, 1 known failure, 0 skipped +[inst/ls_isempty.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_isempty.m ***** error - [a, b] = ls_nb_from_geom (1, 2); -***** error - ls_nb_from_geom (1, 2, rand (2, 2)); -***** error - x = linspace (-10, 10, 10); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - ls_nb_from_geom (geom, phi); -***** error - x = linspace (-10, 10, 10); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 5); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - ls_nb_from_geom (geom, phi, [1, 2, 3]); + ls_isempty () +***** error + ls_isempty (1, 2) ***** test n = 50; x = linspace (-10, 10, n); - h = x(2) - x(1); [XX, YY] = meshgrid (x, x); - phi = ls_setdiff (ls_genbasic (XX, YY, "sphere", [0, 0], 8), ... - ls_genbasic (XX, YY, "sphere", [1, 1], 5)); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - geom = ls_absolute_geom (geom, XX, YY); - - dOld = ls_init_narrowband (phi, h); - dNew = ls_nb_from_geom (geom, phi); - - where = (!isna (dOld)); - assert (all (!isna (dNew(where)))); - assert (dNew(where), dOld(where), h / 4); -***** demo - n = 50; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); - - phi = ls_genbasic (XX, YY, "sphere", [0, 0], 3); - phi = ls_normalise (phi, h); - geom = ls_find_geometry (phi, h); - geom = ls_absolute_geom (geom, XX, YY); - - g0 = NA (1, geom.bedges.n); - for i = 1 : geom.bedges.n - a = geom.ispts.coord(geom.bedges.ispts(i, 1), :); - b = geom.ispts.coord(geom.bedges.ispts(i, 2), :); - m = (a + b) / 2; - angle = abs (atan2 (m(2), m(1))); - g0(i) = min (angle, 2 * pi - angle); - endfor - - [d, g] = ls_nb_from_geom (geom, phi, g0); - [d, g] = fastmarching (d, g, h * ones (size (phi))); + phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; + phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; - figure (); - hold ("on"); - imagesc (x, x, g); - set (gca (), "ydir", "normal"); - contour (XX, YY, phi, [0, 0], "k"); - hold ("off"); - colorbar (); -7 tests, 7 passed, 0 known failure, 0 skipped + assert (~ls_isempty (phi1) && ~ls_isempty (phi2)); + assert (ls_isempty (ls_intersect (phi1, phi2))); + assert (~ls_isempty (ls_union (phi1, phi2))); +3 tests, 3 passed, 0 known failure, 0 skipped [inst/ls_check.m] >>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_check.m ***** error @@ -5978,94 +6066,12 @@ assert (~ls_check (phi, "contain", circ8)); assert (~ls_check (phi, "outside", circ8)); 6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ls_inside.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_inside.m -***** error - ls_inside () -***** error - ls_inside (1, 2) -***** test - assert (ls_inside ([1, 0, -1, 0, 1]), [false, false, true, false, false]); -***** test - if (exist ("signbit") == 5) - assert (ls_inside ([-0, 0]), [true, false]); - else - warning ("'signbit' function not available, skipping test."); - endif -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/so_init_params.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_init_params.m -***** error - so_init_params () -***** error - so_init_params (true, 1, 2) -***** error - so_init_params (true, 0); -***** error - so_init_params (true, 1.5); -***** test - p = so_init_params (true); -***** error <'pararrayfun' is not available> - pkg unload -nodeps parallel; - p = so_init_params (true, 2); -***** test - pkg load parallel; - p = so_init_params (true, 2); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/so_explore_descent.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/so_explore_descent.m -***** error - so_explore_descent (1); -***** error - so_explore_descent (1, 2, 3); -***** error - so_explore_descent (struct (), 2); -***** error - so_explore_descent ([2, 3], 2); -***** error <'fload' is not available> - pkg unload -nodeps parallel; - so_explore_descent ("foo", 2); -***** demo - pkg load parallel; - - data = struct (); - data.p = so_init_params (false); - data.p.vol = 10; - data.p.weight = 50; - - data.p.nSteps = 10; - data.figs = struct (); - data.figs.speed = figure (); - data.figs.exploreCosts = figure (); - - n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); - data.g = struct ("x", x, "h", h); - - data = so_example_problem (data); - phi0 = ls_genbasic (data.g.x, "box", -3, 7); - - printf ("Computing descent...\n"); - f = tmpfile (); - d = data; - d.handler = struct (); - d = so_save_descent (f, struct (), d); - s = so_run_descent (data.p.nSteps, phi0, d); - printf ("Final cost: %.6d\n", s.cost); - - printf ("\nNow replaying...\n"); - init = @() data; - frewind (f); - so_explore_descent (f, init); - fclose (f); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/ls_isempty.m] ->>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_isempty.m +[inst/ls_intersect.m] +>>>>> /build/reproducible-path/octave-level-set-0.3.1~git.2019.04.13/inst/ls_intersect.m ***** error - ls_isempty () -***** error - ls_isempty (1, 2) + ls_intersect () +***** error + ls_intersect (1, -2, [1, 2]) ***** test n = 50; x = linspace (-10, 10, n); @@ -6073,14 +6079,49 @@ phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; + phi3 = XX.^2 + YY.^2 - 2^2; - assert (~ls_isempty (phi1) && ~ls_isempty (phi2)); assert (ls_isempty (ls_intersect (phi1, phi2))); - assert (~ls_isempty (ls_union (phi1, phi2))); + assert (ls_intersect (phi3), phi3); + + phi = ls_intersect (phi1, phi3); + assert (~ls_isempty (phi)); + assert (ls_issubset (phi, phi1) && ls_issubset (phi, phi3)); + + phi = ls_intersect (phi2, phi3); + assert (~ls_isempty (phi)); + assert (ls_issubset (phi, phi2) && ls_issubset (phi, phi3)); +***** demo + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); + + phi1 = (XX - 2 * cos (7/6 * pi)).^2 + (YY - 2 * sin (7/6 * pi)).^2 - 3^2; + phi2 = (XX - 2 * cos (11/6 * pi)).^2 + (YY - 2 * sin (11/6 * pi)).^2 - 3^2; + phi3 = XX.^2 + (YY - 2).^2 - 3^2; + phi = ls_intersect (phi1, phi2, phi3); + + figure (); + subplot (1, 2, 1); + hold ("on"); + contour (XX, YY, phi1, [0, 0], "k"); + contour (XX, YY, phi2, [0, 0], "k"); + contour (XX, YY, phi3, [0, 0], "k"); + hold ("off"); + axis ("equal"); + + subplot (1, 2, 2); + hold ("on"); + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); + hold ("off"); + axis ("equal"); 3 tests, 3 passed, 0 known failure, 0 skipped Checking C++ files ... Done running the unit tests. -Summary: 258 tests, 254 passed, 4 known failures, 0 skipped +Summary: 258 tests, 253 passed, 5 known failures, 0 skipped dh_installdocs -O--buildsystem=octave dh_installchangelogs -O--buildsystem=octave dh_octave_changelogs -O--buildsystem=octave @@ -6112,12 +6153,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/567283/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/602900 and its subdirectories -I: Current time: Fri Jun 13 06:36:18 -12 2025 -I: pbuilder-time-stamp: 1749839778 +I: removing directory /srv/workspace/pbuilder/567283 and its subdirectories +I: Current time: Sun May 12 02:45:12 +14 2024 +I: pbuilder-time-stamp: 1715431512