Diff of the two buildlogs: -- --- b1/build.log 2023-06-07 15:04:02.966286883 +0000 +++ b2/build.log 2023-06-07 15:29:38.903057131 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Jun 7 02:54:47 -12 2023 -I: pbuilder-time-stamp: 1686149687 +I: Current time: Thu Jun 8 05:04:22 +14 2023 +I: pbuilder-time-stamp: 1686150262 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./octave-level-set_0.3.1~git.2019.04.13.orig.tar.xz] I: copying [./octave-level-set_0.3.1~git.2019.04.13-6.debian.tar.xz] I: Extracting source -gpgv: Signature made Mon Dec 5 01:26:45 2022 -12 +gpgv: Signature made Tue Dec 6 03:26:45 2022 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: issuer "rafael@debian.org" gpgv: Can't check signature: No public key @@ -35,135 +35,167 @@ dpkg-source: info: applying add-distclean-target.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/1988/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/19038/tmp/hooks/D01_modify_environment starting +debug: Running on virt32c. +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 Jun 8 05:06 /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/19038/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/19038/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='bookworm' - HOME='/root' - HOST_ARCH='armhf' + 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]="15" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='90585e3924a2484095f054996b24f74a' - 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='1988' - PS1='# ' - PS2='> ' + INVOCATION_ID=7bb471c77a0b4669a7760f2e7320cb19 + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + 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=19038 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.v9LV5xGp/pbuilderrc_Iw3n --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.v9LV5xGp/b1 --logfile b1/build.log octave-level-set_0.3.1~git.2019.04.13-6.dsc' - SUDO_GID='114' - SUDO_UID='108' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + 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.v9LV5xGp/pbuilderrc_Pw5R --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.v9LV5xGp/b2 --logfile b2/build.log --extrapackages usrmerge octave-level-set_0.3.1~git.2019.04.13-6.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux jtx1c 5.10.0-23-arm64 #1 SMP Debian 5.10.179-1 (2023-05-12) aarch64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-23-armmp-lpae #1 SMP Debian 5.10.179-1 (2023-05-12) armv7l GNU/Linux I: ls -l /bin total 5072 - -rwxr-xr-x 1 root root 838488 Apr 23 09:24 bash - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 67112 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 67632 Sep 20 2022 cat - -rwxr-xr-x 1 root root 67676 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 67644 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 67684 Sep 20 2022 chown - -rwxr-xr-x 1 root root 133532 Sep 20 2022 cp - -rwxr-xr-x 1 root root 132868 Jan 5 01:20 dash - -rwxr-xr-x 1 root root 133220 Sep 20 2022 date - -rwxr-xr-x 1 root root 67732 Sep 20 2022 dd - -rwxr-xr-x 1 root root 68104 Sep 20 2022 df - -rwxr-xr-x 1 root root 133632 Sep 20 2022 dir - -rwxr-xr-x 1 root root 59128 Mar 22 21:02 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 01:33 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 01:33 domainname -> hostname - -rwxr-xr-x 1 root root 67560 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 02:43 egrep - -rwxr-xr-x 1 root root 67548 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 02:43 fgrep - -rwxr-xr-x 1 root root 55748 Mar 22 21:02 findmnt - -rwsr-xr-x 1 root root 26208 Mar 22 20:15 fusermount - -rwxr-xr-x 1 root root 128608 Jan 24 02:43 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 64220 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 67032 Dec 19 01:33 hostname - -rwxr-xr-x 1 root root 67720 Sep 20 2022 ln - -rwxr-xr-x 1 root root 35132 Mar 22 21:51 login - -rwxr-xr-x 1 root root 133632 Sep 20 2022 ls - -rwxr-xr-x 1 root root 136808 Mar 22 21:02 lsblk - -rwxr-xr-x 1 root root 67800 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 67764 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 67596 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 38504 Mar 22 21:02 more - -rwsr-xr-x 1 root root 38496 Mar 22 21:02 mount - -rwxr-xr-x 1 root root 9824 Mar 22 21:02 mountpoint - -rwxr-xr-x 1 root root 133532 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 01:33 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 18:25 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 67608 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 09:24 rbash -> bash - -rwxr-xr-x 1 root root 67600 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 67672 Sep 20 2022 rm - -rwxr-xr-x 1 root root 67600 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 67400 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 133372 Jan 5 07:55 sed - lrwxrwxrwx 1 root root 4 Jan 5 01:20 sh -> dash - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 67644 Sep 20 2022 stty - -rwsr-xr-x 1 root root 50800 Mar 22 21:02 su - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sync - -rwxr-xr-x 1 root root 336764 Apr 6 02:25 tar - -rwxr-xr-x 1 root root 67144 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 133224 Sep 20 2022 touch - -rwxr-xr-x 1 root root 67548 Sep 20 2022 true - -rwxr-xr-x 1 root root 9768 Mar 22 20:15 ulockmgr_server - -rwsr-xr-x 1 root root 22108 Mar 22 21:02 umount - -rwxr-xr-x 1 root root 67572 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 133632 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 42608 Mar 22 21:02 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 01:33 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 6460 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8103 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/1988/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 838488 Apr 24 11:24 bash + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 67112 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 67632 Sep 21 2022 cat + -rwxr-xr-x 1 root root 67676 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 67644 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 67684 Sep 21 2022 chown + -rwxr-xr-x 1 root root 133532 Sep 21 2022 cp + -rwxr-xr-x 1 root root 132868 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 133220 Sep 21 2022 date + -rwxr-xr-x 1 root root 67732 Sep 21 2022 dd + -rwxr-xr-x 1 root root 68104 Sep 21 2022 df + -rwxr-xr-x 1 root root 133632 Sep 21 2022 dir + -rwxr-xr-x 1 root root 59128 Mar 23 23:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 67560 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 67548 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 55748 Mar 23 23:02 findmnt + -rwsr-xr-x 1 root root 26208 Mar 23 22:15 fusermount + -rwxr-xr-x 1 root root 128608 Jan 25 04:43 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 64220 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 67032 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 67720 Sep 21 2022 ln + -rwxr-xr-x 1 root root 35132 Mar 23 23:51 login + -rwxr-xr-x 1 root root 133632 Sep 21 2022 ls + -rwxr-xr-x 1 root root 136808 Mar 23 23:02 lsblk + -rwxr-xr-x 1 root root 67800 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 67764 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 67596 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 38504 Mar 23 23:02 more + -rwsr-xr-x 1 root root 38496 Mar 23 23:02 mount + -rwxr-xr-x 1 root root 9824 Mar 23 23:02 mountpoint + -rwxr-xr-x 1 root root 133532 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 67608 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:24 rbash -> bash + -rwxr-xr-x 1 root root 67600 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 67672 Sep 21 2022 rm + -rwxr-xr-x 1 root root 67600 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 67400 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 133372 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 Jun 8 05:06 sh -> /bin/bash + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 67644 Sep 21 2022 stty + -rwsr-xr-x 1 root root 50800 Mar 23 23:02 su + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sync + -rwxr-xr-x 1 root root 336764 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 67144 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 133224 Sep 21 2022 touch + -rwxr-xr-x 1 root root 67548 Sep 21 2022 true + -rwxr-xr-x 1 root root 9768 Mar 23 22:15 ulockmgr_server + -rwsr-xr-x 1 root root 22108 Mar 23 23:02 umount + -rwxr-xr-x 1 root root 67572 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 133632 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 42608 Mar 23 23:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 6460 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8103 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/19038/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -715,7 +747,7 @@ Get: 506 http://deb.debian.org/debian bookworm/main armhf dh-octave all 1.2.7 [22.8 kB] Get: 507 http://deb.debian.org/debian bookworm/main armhf octave-struct armhf 1.0.18-3 [32.2 kB] Get: 508 http://deb.debian.org/debian bookworm/main armhf octave-parallel armhf 4.0.1-6 [178 kB] -Fetched 171 MB in 15s (11.6 MB/s) +Fetched 171 MB in 44s (3914 kB/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 ... 19324 files and directories currently installed.) @@ -2798,8 +2830,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/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-6_source.changes +I: user script /srv/workspace/pbuilder/19038/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/19038/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/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-6_source.changes dpkg-buildpackage: info: source package octave-level-set dpkg-buildpackage: info: source version 0.3.1~git.2019.04.13-6 dpkg-buildpackage: info: source distribution unstable @@ -2847,12 +2890,12 @@ g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security Utils.cpp -o Utils.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /usr/bin/mkoctfile --verbose internal_fastmarching.cpp FastMarching.o Utils.o -o __levelset_internal_fastmarching.oct CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /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-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_fastmarching.cpp -o /tmp/oct-ixGnLV.o CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /usr/bin/mkoctfile --verbose geomElements.cpp FastMarching.o Utils.o -o __levelset_geomElements.oct CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /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-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_init_narrowband.cpp -o /tmp/oct-TpErMB.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomElements.cpp -o /tmp/oct-99PyvW.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_fastmarching.cpp -o /tmp/oct-Vsh0SI.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomBoundary.cpp -o /tmp/oct-75Rpfs.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_init_narrowband.cpp -o /tmp/oct-YKQORL.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomElements.cpp -o /tmp/oct-yZavn2.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomBoundary.cpp -o /tmp/oct-jPKwK2.o In file included from /usr/include/c++/12/map:60, from FastMarching.hpp:60, from Utils.hpp:24, @@ -2861,9 +2904,10 @@ /usr/include/c++/12/bits/stl_tree.h:2457:7: note: parameter passing for argument of type 'std::_Rb_tree, std::pair, IntersectionPoint>, std::_Select1st, IntersectionPoint> >, std::less >, std::allocator, IntersectionPoint> > >::const_iterator' changed in GCC 7.1 2457 | _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_init_narrowband.oct FastMarching.o Utils.o /tmp/oct-TpErMB.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_init_narrowband.oct FastMarching.o Utils.o /tmp/oct-YKQORL.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /usr/bin/mkoctfile --verbose geomGamma.cpp FastMarching.o Utils.o -o __levelset_geomGamma.oct -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomGamma.cpp -o /tmp/oct-PNnPb9.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security geomGamma.cpp -o /tmp/oct-fm9jKI.o +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_fastmarching.oct FastMarching.o Utils.o /tmp/oct-ixGnLV.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro In file included from /usr/include/c++/12/map:61: In member function 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::emplace_hint(const_iterator, _Args&& ...) [with _Args = {const std::pair, IntersectionPoint>&}; _Key = std::pair; _Tp = IntersectionPoint; _Compare = std::less >; _Alloc = std::allocator, IntersectionPoint> >]', inlined from 'std::__enable_if_t, _Pair>::value, std::pair, std::_Select1st >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other>::iterator, bool> > std::map<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Pair = const std::pair, IntersectionPoint>&; _Key = std::pair; _Tp = IntersectionPoint; _Compare = std::less >; _Alloc = std::allocator, IntersectionPoint> >]' at /usr/include/c++/12/bits/stl_map.h:858:27, @@ -2873,15 +2917,14 @@ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ 639 | std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_fastmarching.oct FastMarching.o Utils.o /tmp/oct-Vsh0SI.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /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-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security nbFromGeom.cpp -o /tmp/oct-obwqRk.o -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomElements.oct FastMarching.o Utils.o /tmp/oct-99PyvW.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security nbFromGeom.cpp -o /tmp/oct-6Hq2bM.o +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomElements.oct FastMarching.o Utils.o /tmp/oct-yZavn2.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /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-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_mesh.cpp -o /tmp/oct-Htc3Uh.o -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomBoundary.oct FastMarching.o Utils.o /tmp/oct-75Rpfs.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security internal_mesh.cpp -o /tmp/oct-mdcr3J.o +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomBoundary.oct FastMarching.o Utils.o /tmp/oct-jPKwK2.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro CXXFLAGS="-g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security" /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-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security upwindGrad.cpp -o /tmp/oct-popCHm.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security upwindGrad.cpp -o /tmp/oct-eQB61O.o nbFromGeom.cpp: In function 'octave_value_list F__levelset_nbFromGeom(const octave_value_list&, int)': nbFromGeom.cpp:107:36: warning: 'double xnorm(const ColumnVector&, double)' is deprecated: [7]: use 'octave::xnorm' instead [-Wdeprecated-declarations] 107 | const double len = xnorm (dir); @@ -2908,7 +2951,7 @@ /usr/include/octave-7.3.0/octave/../octave/oct-norm.h:92:15: note: declared here 92 | inline double xnorm (const ColumnVector& v, double p = 2) | ^~~~~ -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_upwindGrad.oct FastMarching.o Utils.o /tmp/oct-popCHm.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_nbFromGeom.oct FastMarching.o Utils.o /tmp/oct-6Hq2bM.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro In file included from /usr/include/c++/12/vector:70, from /usr/include/c++/12/functional:62, from /usr/include/octave-7.3.0/octave/../octave/oct-sort.h:92, @@ -2928,13 +2971,13 @@ /usr/include/c++/12/bits/vector.tcc:123:28: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator >' changed in GCC 7.1 123 | _M_realloc_insert(end(), std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_nbFromGeom.oct FastMarching.o Utils.o /tmp/oct-obwqRk.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_mesh.oct FastMarching.o Utils.o /tmp/oct-Htc3Uh.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomGamma.oct FastMarching.o Utils.o /tmp/oct-PNnPb9.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_upwindGrad.oct FastMarching.o Utils.o /tmp/oct-eQB61O.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_geomGamma.oct FastMarching.o Utils.o /tmp/oct-fm9jKI.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -ffile-prefix-map=/build/octave-level-set-0.3.1~git.2019.04.13=. -fstack-protector-strong -Wformat -Werror=format-security -o __levelset_internal_mesh.oct FastMarching.o Utils.o /tmp/oct-mdcr3J.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro make[1]: Leaving directory '/build/octave-level-set-0.3.1~git.2019.04.13/src' copyfile /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomBoundary.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomElements.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_geomGamma.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_fastmarching.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_init_narrowband.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_internal_mesh.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_nbFromGeom.oct /build/octave-level-set-0.3.1~git.2019.04.13/./src/__levelset_upwindGrad.oct /build/octave-level-set-0.3.1~git.2019.04.13/./inst/arm-unknown-linux-gnueabihf-api-v57 -octave-help-Axcd1l:150: table requires an argument: the formatter for @item -octave-help-Axcd1l:150: table requires an argument: the formatter for @item +octave-help-G7zJCk:150: table requires an argument: the formatter for @item +octave-help-G7zJCk:150: table requires an argument: the formatter for @item 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 @@ -2947,10 +2990,10 @@ pkg at line 612 column 9 /usr/share/dh-octave/install-pkg.m at line 38 column 1 -octave-help-E5zrgg:145: @code expected braces -octave-help-E5zrgg:149: @code expected braces -octave-help-E5zrgg:145: @code expected braces -octave-help-E5zrgg:149: @code expected braces +octave-help-ujfIM4:145: @code expected braces +octave-help-ujfIM4:149: @code expected braces +octave-help-ujfIM4:145: @code expected braces +octave-help-ujfIM4: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 @@ -2967,370 +3010,389 @@ dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... -[inst/ls_hausdorff_dist.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_hausdorff_dist.m +[inst/ls_normalise.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_normalise.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") + 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_setdiff.m] +>>>>> /build/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 (-5, 5, n); + x = linspace (-10, 10, 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); + phi1 = XX.^2 + YY.^2 - 8^2; + phi2 = XX.^2 + YY.^2 - 5^2; - % 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); + 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); - phiA = ls_genbasic (XX, YY, "sphere", [0, 0], 4); - phiInner = ls_genbasic (XX, YY, "sphere", [0, 0], 2); - phiB = ls_setdiff (phiA, phiInner); + phi1 = (XX - 2).^2 + YY.^2 - 3^2; + phi2 = (XX + 2).^2 + YY.^2 - 3^2; + phi = ls_setdiff (phi1, phi2); - 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); + 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"); - 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_absolute_geom.m] ->>>>> /build/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_explore_descent.m] ->>>>> /build/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); + 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 - pkg load parallel; + n = 100; + x = linspace (-7, 7, n); + [XX, YY] = meshgrid (x, x); - data = struct (); - data.p = so_init_params (false); - data.p.vol = 10; - data.p.weight = 50; + phi1 = XX.^2 + YY.^2 - 6^2; + phi2 = XX.^2 + YY.^2 - 3^2; + phi = ls_setdiff (phi1, phi2); - data.p.nSteps = 10; - data.figs = struct (); - data.figs.speed = figure (); - data.figs.exploreCosts = figure (); + 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/so_init_params.m] +>>>>> /build/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/ls_enforce.m] +>>>>> /build/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); - h = x(2) - x(1); - data.g = struct ("x", x, "h", h); + [XX, YY] = meshgrid (x, x); - data = so_example_problem (data); - phi0 = ls_genbasic (data.g.x, "box", -3, 7); + circ2 = (XX.^2 + YY.^2 < 2^2); + circ8 = (XX.^2 + YY.^2 < 8^2); + phi = (XX.^2 + YY.^2 - 5^2); - 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); + phi2 = ls_enforce (phi, "inside", circ8); + assert (ls_equal (phi2, phi)); + phi2 = ls_enforce (phi, "inside", circ2); + assert (ls_check (phi2, "inside", circ2)); - 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/so_replay_descent.m] ->>>>> /build/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); + 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/octave-level-set-0.3.1~git.2019.04.13/inst/so_save_descent.m ***** error - so_replay_descent (1, 2, [2, 3]); + so_save_descent (1, 2); +***** error + so_save_descent (1, 2, 3, 4); +***** error + so_save_descent (1, 2, 3); ***** error - so_replay_descent (struct (), 2); + so_save_descent (struct (), 2, struct ()); ***** error - so_replay_descent ([2, 3], 2); -***** error <'fload' is not available> + so_save_descent ([2, 3], 2, struct ()); +***** error <'fsave' 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; + 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/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); - 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); + [XX, YY] = meshgrid (x, x); - % Unless explicitly set, do not expect compressed states. - data.checkUncompression = false; + 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; - 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); + 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_build_mesh.m] +>>>>> /build/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 -***** 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); +***** 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 - [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; + % 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 - 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); + assert (vmap.mesh(gridInd), i); + assert (mesh.p(:, gridInd), geom.nodes.coord(i, :)'); + endfor - 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; + % 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 - nStepsShort = 5; - nStepsLong = 10; + % 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); - baseData = getData (); - [prl, pwl] = pipe (); - data = so_save_descent (pwl, struct (), baseData); - [sl, ll] = so_run_descent (nStepsLong, data.phi0, data); - fclose (pwl); + 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); - baseData = getData (); - [prs, pws] = pipe (); - data = so_save_descent (pws, struct (), baseData); - [ss, ls] = so_run_descent (nStepsShort, data.phi0, data); - fclose (pws); + phi = ls_union (ls_genbasic (XX, YY, "sphere", [-6, -6], 3), ... + ls_genbasic (XX, YY, "sphere", [6, 6], 3)); + verifyPhi (phi, XX, YY, h); - [s, l] = so_replay_descent (prl, @getData, nStepsShort); - fclose (prl); - compareResults (s, l, ss, ls); + 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); - [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; + 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); - nSteps = 10; - [pr, pw] = pipe (); + mesh = ls_build_mesh (geom, phi, false); + meshGlob = ls_build_mesh (geom, phi, true); - data = getDataForCompression (false); - data = so_save_descent (pw, struct (), data); - [s1, l1] = so_run_descent (nSteps, data.phi0, data); - fclose (pw); + 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_enforce_speed.m] +>>>>> /build/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); - init = @(header) getDataForCompression (true); - [s2, l2] = so_replay_descent (pr, init); - fclose (pr); + 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); - % No result comparison here, since the compress / uncompress - % functions introduced changes to the state structs. -!!!!! known failure -structure has no member 'openFile' + 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 - 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); + [XX, YY] = meshgrid (x, x); - 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); + 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); - 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/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/so_save_descent.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_save_descent.m + 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_inside.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_inside.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 ()); + ls_inside () +***** error + ls_inside (1, 2) ***** 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 + 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/ls_sign_colourmap.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_sign_colourmap.m ***** shared colours @@ -3404,18 +3466,18 @@ hold ("off"); title ("Type 'highlight'"); 10 tests, 10 passed, 0 known failure, 0 skipped -[inst/ls_enforce.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce.m +[inst/ls_check.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_check.m ***** error - ls_enforce (1, 2) -***** error - ls_enforce (1, 2, 3, 4) + ls_check (1, 2) +***** error + ls_check (1, 2, 3, 4) ***** error - ls_enforce (1, "inside", [1, 2]); + ls_check (1, "inside", [1, 2]); ***** error - ls_enforce (1, "foo", true); + ls_check (1, "foo", true); ***** error - ls_enforce (1, NA, false); + ls_check (1, NA, false); ***** test n = 100; x = linspace (-10, 10, n); @@ -3425,158 +3487,76 @@ 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)); + assert (ls_check (phi, "inside", circ8)); + assert (ls_check (phi, "contain", circ2)); + assert (ls_check (phi, "outside", ~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); + assert (~ls_check (phi, "inside", circ2)); + assert (~ls_check (phi, "contain", circ8)); + assert (~ls_check (phi, "outside", circ8)); 6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ls_signed_distance.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_signed_distance.m +[inst/ls_complement.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_complement.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)); + ls_complement () +***** error + ls_complement (1, 2) ***** 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); + phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; + phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; - figure (); - subplot (1, 2, 1); - contour (XX, YY, phi0); - title ("Initial"); - colorbar (); - axis ("equal"); + assert (ls_disjoint (phi1, ls_complement (phi1))); + assert (ls_disjoint (phi2, ls_complement (phi2))); - 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_setdiff.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setdiff.m + 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_union.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_union.m ***** error - ls_setdiff (1) -***** error - ls_setdiff (1, 2, 3) -***** error - ls_setdiff (1, [1, 2]) + ls_union () +***** error + ls_union (1, -2, [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); + 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; - 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"); + phi = ls_union (phi1, phi2, phi3); + assert (ls_issubset (phi1, phi)); + assert (ls_issubset (phi2, phi)); + assert (ls_issubset (phi3, phi)); - 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"); + assert (ls_union (phi3), phi3); ***** 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); + 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"); @@ -3588,113 +3568,123 @@ contour (XX, YY, phi, [0, 0], "k"); hold ("off"); axis ("equal"); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/ls_build_mesh.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_build_mesh.m +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/ls_genbasic.m] +>>>>> /build/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_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)); + 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 -***** 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); +***** 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 -***** endfunction +***** 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 - n = 20; - x = linspace (-10, 10, n); - h = x(2) - x(1); - [XX, YY] = meshgrid (x, x); + p = [0, 2, 1]; - 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_genbasic (XXX, YYY, ZZZ, "half", p, [0; 0; 1]); + assert (ls_equal (phi, 1 - ZZZ)); - phi = ls_setdiff (ls_genbasic (XX, YY, "sphere", [0, 0], 8), ... - ls_genbasic (XX, YY, "sphere", [0, 0], 4)); - verifyPhi (phi, XX, YY, h); + 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 - x = linspace (-10, 10, 11); - h = x(2) - x(1); + n = 200; + x = linspace (-7, 7, n); [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); + 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"); - 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 + imagesc (x, x, phi); + set (gca (), "ydir", "normal"); + ls_sign_colourmap (); + contour (XX, YY, phi, [0, 0], "k"); hold ("off"); - legend ("Global", "Domain", "Boundary"); axis ("equal"); - axis ("square"); -4 tests, 4 passed, 0 known failure, 0 skipped +23 tests, 23 passed, 0 known failure, 0 skipped [inst/so_step_armijo.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_step_armijo.m ***** function s = updateState (phi, data) @@ -3797,81 +3787,324 @@ ***** error so_step_armijo (3, d, f, dJ, baseData); 18 tests, 18 passed, 0 known failure, 0 skipped -[inst/so_run_descent.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_run_descent.m -***** shared data, phi0 +[inst/ls_distance_fcn.m] +>>>>> /build/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 30.8% +***** 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/so_explore_descent.m] +>>>>> /build/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); - data.handler = struct (); + phi0 = ls_genbasic (data.g.x, "box", -3, 7); - phi0 = ls_genbasic (data.g.x, "box", -3, 5); + 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/upwind_gradient_norm.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/upwind_gradient_norm.m ***** error - so_run_descent (1, 2); -***** error - so_run_descent (1, 2, 3, 4); + upwind_gradient_norm () +***** error + upwind_gradient_norm (1, 2, 3, 4) ***** error - so_run_descent (0, phi0, data); + upwind_gradient_norm ([1, 1], [2, 2], [3, 3]) +***** error + upwind_gradient_norm ([1, 1], [2, 2, 2]) +***** error + upwind_gradient_norm ([1, 1], [2, 2, 2], 5) +***** test + phi = [0, 2, 3]; + fPos = ones (size (phi)); + + % Propagate the original phi to the right. This should result + % in the *backward* difference to be used in the middle. + g = upwind_gradient_norm (phi); + assert (g(2), 2); + gp = upwind_gradient_norm (phi, fPos); + assert (gp, g); + gp = upwind_gradient_norm (phi, 0.5); + assert (gp, 2 * g); + gp = upwind_gradient_norm (phi, fPos, 0.5); + assert (gp, 2 * g); + + % Propagate to the left for the reverse effect. + g = upwind_gradient_norm (phi, -fPos); + assert (g(2), 1); + + % Propagate -phi, which again turns everything around. + g = upwind_gradient_norm (-phi, fPos); + assert (g(2), 1); + g = upwind_gradient_norm (-phi, -fPos); + assert (g(2), 2); +***** test + n = 50; + x = linspace (-1, 1, n); + h = x(2) - x(1); + [XX, YY, ZZ] = ndgrid (x, x, x); + + phi = XX.^2 + YY.^2 + ZZ.^2; + g = upwind_gradient_norm (phi, h); + + r = sqrt (phi); + assert (g, 2 * r, 0.1); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ls_time_step.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_time_step.m ***** error - so_run_descent (1.5, phi0, data); + ls_time_step (1, 2) +***** error + ls_time_step (1, 2, 3, 4, 5, 6) ***** error - so_run_descent ([2, 3], phi0, data); -***** error - d = data; - d.p.descent.initialStep = 0; - so_run_descent (1, phi0, d); + 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 - nSteps = 12; + n = 100; + x = linspace (0, 1, n); + h = x(2) - x(1); - [s, descentLog] = so_run_descent (nSteps, phi0, data); - assert (s.cost, 0, 1e-3); - assert (length (descentLog.costs), nSteps + 1); - assert (descentLog.costs(end), s.cost); - %semilogy (descentLog.costs, "o"); -***** test - tol = 5e-2; - nSteps = 100; - d = data; - d.cb.check_stop = @(data) (data.cost < tol); + phi0 = sin (x); + fPos = ones (size (phi0)); - [s, descentLog] = so_run_descent (nSteps, phi0, d); - assert (s.cost < tol); - printf ("Steps needed: %d\n", descentLog.steps); - assert (descentLog.steps < nSteps); -Steps needed: 8 -***** demo - data = struct (); - data.p = so_init_params (true); - data.p.vol = 10; - data.p.weight = 50; + % 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 (-10, 10, n); + x = linspace (-5, 5, n); h = x(2) - x(1); - data.g = struct ("x", x, "h", h); + [XX, YY] = meshgrid (x, x); - % Look at so_example_problem to see how the callbacks - % and the plotting handler is defined. - data = so_example_problem (data); + 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 (data.g.x, "box", -3, 7); - [s, descentLog] = so_run_descent (5, phi0, data); + 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 (); - semilogy (0 : descentLog.steps, descentLog.costs, "o"); - title ("Cost Descrease"); + 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_hausdorff_dist.m] +>>>>> /build/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); - 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 + 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_extract_solution.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_extract_solution.m ***** error @@ -3933,7 +4166,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3941,7 +4174,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3949,7 +4182,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3957,7 +4190,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3965,7 +4198,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3973,7 +4206,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3981,7 +4214,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3989,7 +4222,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -3997,7 +4230,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4005,7 +4238,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4013,7 +4246,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4021,7 +4254,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4029,7 +4262,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4037,7 +4270,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4045,7 +4278,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4053,7 +4286,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4061,7 +4294,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4069,7 +4302,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4077,7 +4310,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4085,7 +4318,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4093,7 +4326,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4101,7 +4334,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4109,7 +4342,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.088561 to 0.090209 warning: called from @@ -4117,7 +4350,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4125,7 +4358,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4133,7 +4366,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4141,7 +4374,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4149,7 +4382,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4157,7 +4390,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4165,7 +4398,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4173,7 +4406,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4181,7 +4414,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4189,7 +4422,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4197,7 +4430,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4205,7 +4438,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4213,7 +4446,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4221,7 +4454,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4229,7 +4462,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4237,7 +4470,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4245,7 +4478,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4253,7 +4486,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4261,7 +4494,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4269,7 +4502,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4277,7 +4510,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4285,7 +4518,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4293,7 +4526,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4301,7 +4534,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 warning: increased distance in fast marching 0.105699 to 0.105896 warning: called from @@ -4309,7 +4542,7 @@ ls_signed_distance at line 45 column 5 __test__ at line 16 column 7 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 110 column 31 + /tmp/tmp.Zud84SrBiU at line 174 column 31 ***** demo n = 100; @@ -4344,100 +4577,403 @@ 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_equal.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_equal.m +[inst/ls_issubset.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_issubset.m ***** error - ls_equal (1) -***** error - ls_equal (1, 2, 3) + ls_issubset (1) +***** error + ls_issubset (1, 2, 3) ***** error - ls_equal (1, [1, 2]) + ls_issubset (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])); + 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/ls_intersect.m] +>>>>> /build/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 - if (exist ("signbit") == 5) - assert (ls_equal ([0, -0], [1, -1])); - else - warning ("'signbit' function not available, skipping 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/so_replay_descent.m] +>>>>> /build/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 -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/so_example_problem.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_example_problem.m -***** shared basicData - basicData = struct (); - basicData.p = so_init_params (true); - basicData.p.vol = 4; - basicData.p.weight = 10; +***** 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]; - n = 50; - x = linspace (-4, 5, n); + 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); - basicData.g = struct ("x", x, "h", h); + 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/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/so_run_descent.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_run_descent.m +***** shared data, phi0 + 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 (); + + phi0 = ls_genbasic (data.g.x, "box", -3, 5); ***** error - so_example_problem (); -***** error - so_example_problem (1, 2); -***** error - so_example_problem (1); + so_run_descent (1, 2); +***** error + so_run_descent (1, 2, 3, 4); +***** error + so_run_descent (0, phi0, data); +***** error + so_run_descent (1.5, phi0, data); +***** error + so_run_descent ([2, 3], phi0, data); +***** error + d = data; + d.p.descent.initialStep = 0; + so_run_descent (1, phi0, d); ***** test - data = so_example_problem (basicData); - phi = ls_genbasic (data.g.x, "box", -2.5, 1.3); + nSteps = 12; - [a, b] = data.util.bounds (phi, data); - assert (a, -2.5, sqrt (eps)); - assert (b, 1.3, sqrt (eps)); + [s, descentLog] = so_run_descent (nSteps, phi0, data); + assert (s.cost, 0, 1e-3); + assert (length (descentLog.costs), nSteps + 1); + assert (descentLog.costs(end), s.cost); + %semilogy (descentLog.costs, "o"); ***** test - data = so_example_problem (basicData); - - phi = ls_genbasic (data.g.x, "box", -2, 2); - s0 = data.cb.update_state (phi, data); - - phi = ls_genbasic (data.g.x, "box", -3, 3); - s1 = data.cb.update_state (phi, data); + tol = 5e-2; + nSteps = 100; + d = data; + d.cb.check_stop = @(data) (data.cost < tol); - phi = ls_genbasic (data.g.x, "box", -1, 1); - s2 = data.cb.update_state (phi, data); + [s, descentLog] = so_run_descent (nSteps, phi0, d); + assert (s.cost < tol); + printf ("Steps needed: %d\n", descentLog.steps); + assert (descentLog.steps < nSteps); +Steps needed: 8 +***** demo + data = struct (); + data.p = so_init_params (true); + data.p.vol = 10; + data.p.weight = 50; - phi = ls_genbasic (data.g.x, "box", -1, 3); - s3 = data.cb.update_state (phi, data); + n = 100; + x = linspace (-10, 10, n); + h = x(2) - x(1); + data.g = struct ("x", x, "h", h); - phi = ls_genbasic (data.g.x, "box", -3, 1); - s4 = data.cb.update_state (phi, data); + % Look at so_example_problem to see how the callbacks + % and the plotting handler is defined. + data = so_example_problem (data); - assert (all ([s0.cost, s1.cost, s2.cost, s3.cost, s4.cost] >= 0)); - assert (s0.cost, 0, 1e-1); - assert (s1.cost > s3.cost); - assert (s1.cost > s4.cost); - assert (s2.cost > s3.cost); - assert (s2.cost > s4.cost); - assert (s3.cost > s0.cost); - assert (s4.cost > s0.cost); -***** function testDeriv (a, b, data) - phi = ls_genbasic (data.g.x, "box", a, b); - data.s = data.cb.update_state (phi, data); - [f, dJ] = data.cb.get_direction (data); - assert (dJ < 0); + phi0 = ls_genbasic (data.g.x, "box", -3, 7); + [s, descentLog] = so_run_descent (5, phi0, data); - dt = 5e-3; - dists = ls_solve_stationary (phi, f, data.g.h); - phip = ls_extract_solution (dt, dists, phi, f); - sp = data.cb.update_state (phip, data); + figure (); + semilogy (0 : descentLog.steps, descentLog.costs, "o"); + title ("Cost Descrease"); - assert (sp.cost < data.s.cost); - relErr = abs (sp.cost - (data.s.cost + dt * dJ)) / data.s.cost; - assert (relErr < 0.1); -***** endfunction + 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_isempty.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_isempty.m +***** error + ls_isempty () +***** error + ls_isempty (1, 2) ***** test - data = so_example_problem (basicData); + n = 50; + x = linspace (-10, 10, n); + [XX, YY] = meshgrid (x, x); - testDeriv (-1, 1, data); - testDeriv (-3, 3, data); - testDeriv (-1, 3, data); - testDeriv (-3, 1, data); -6 tests, 6 passed, 0 known failure, 0 skipped + phi1 = (XX - 2).^2 + (YY - 2).^2 - 2^2; + phi2 = (XX + 2).^2 + (YY + 2).^2 - 2^2; + + 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/fastmarching.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/fastmarching.m ***** error @@ -4583,7 +5119,7 @@ fastmarching at line 110 column 19 __test__ at line 5 column 5 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 134 column 31 + /tmp/tmp.Zud84SrBiU at line 222 column 31 ***** test u0 = [0, NA; Inf, 2]; @@ -4595,14 +5131,14 @@ fastmarching at line 110 column 19 __test__ at line 5 column 5 test at line 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 134 column 31 + /tmp/tmp.Zud84SrBiU at line 222 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 683 column 11 - /tmp/tmp.Gs6LA0eHHI at line 134 column 31 + /tmp/tmp.Zud84SrBiU at line 222 column 31 ***** test u0 = [0, NA, NA, NA, 0.1; ... @@ -4642,19 +5178,14 @@ p(1), pLogN(1)); assert (p(1), 1, 1e-1); assert (pLogN(1), 1, 1e-1); -n = 101: t = 0.048 s -n = 201: t = 0.208 s -n = 501: t = 1.483 s -n = 1001: t = 7.346 s -n = 2001: t = 35.702 s +n = 101: t = 0.056 s +n = 201: t = 0.226 s +n = 501: t = 1.599 s +n = 1001: t = 7.153 s +n = 2001: t = 31.471 s Exponents: - O(n): 1.11 - O(n log n): 1.02 -!!!!! known failure -ASSERT errors for: assert (p (1),1,1e-1) - - Location | Observed | Expected | Reason - () 1.1057 1 Abs err 0.10566 exceeds tol 0.1 by 0.006 + O(n): 1.06 + O(n log n): 0.98 ***** test T = 1.6; timeSteps = 10000; @@ -4810,315 +5341,97 @@ figure (); imshow (u); title ("Solved Maze. Blue: Walls, Red: Unreachable, Yellow: Start."); -16 tests, 15 passed, 1 known failure, 0 skipped -[inst/ls_union.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_union.m +16 tests, 16 passed, 0 known failure, 0 skipped +[inst/ls_nb_from_geom.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_nb_from_geom.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_disjoint.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_disjoint.m + ls_nb_from_geom (1) +***** error + ls_nb_from_geom (1, 2, 3, 4) ***** 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); + [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); - - 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_issubset.m] ->>>>> /build/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); + 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); - - 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/ls_check.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_check.m -***** error - ls_check (1, 2) -***** error - ls_check (1, 2, 3, 4) -***** error - ls_check (1, "inside", [1, 2]); -***** error - ls_check (1, "foo", true); -***** error - ls_check (1, NA, false); + 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 = 100; + n = 50; x = linspace (-10, 10, n); + h = x(2) - x(1); [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); + 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); - assert (ls_check (phi, "inside", circ8)); - assert (ls_check (phi, "contain", circ2)); - assert (ls_check (phi, "outside", ~circ8)); + dOld = ls_init_narrowband (phi, h); + dNew = ls_nb_from_geom (geom, phi); - assert (~ls_check (phi, "inside", circ2)); - assert (~ls_check (phi, "contain", circ8)); - assert (~ls_check (phi, "outside", circ8)); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ls_setxor.m] ->>>>> /build/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])); + 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); - phi1 = XX.^2 + YY.^2 - 8^2; - phi2 = XX.^2 + YY.^2 - 5^2; + 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); - assert (ls_equal (ls_setdiff (phi1, phi2), ls_setxor (phi1, phi2))); -***** demo - n = 100; - x = linspace (-7, 7, n); - [XX, YY] = meshgrid (x, x); + 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 - phi1 = (XX - 2).^2 + YY.^2 - 3^2; - phi2 = (XX + 2).^2 + YY.^2 - 3^2; - phi = ls_setxor (phi1, phi2); + [d, g] = ls_nb_from_geom (geom, phi, g0); + [d, g] = fastmarching (d, g, h * ones (size (phi))); 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); + imagesc (x, x, g); 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_complement.m] ->>>>> /build/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/upwind_gradient_norm.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/upwind_gradient_norm.m -***** error - upwind_gradient_norm () -***** error - upwind_gradient_norm (1, 2, 3, 4) -***** error - upwind_gradient_norm ([1, 1], [2, 2], [3, 3]) -***** error - upwind_gradient_norm ([1, 1], [2, 2, 2]) -***** error - upwind_gradient_norm ([1, 1], [2, 2, 2], 5) -***** test - phi = [0, 2, 3]; - fPos = ones (size (phi)); - - % Propagate the original phi to the right. This should result - % in the *backward* difference to be used in the middle. - g = upwind_gradient_norm (phi); - assert (g(2), 2); - gp = upwind_gradient_norm (phi, fPos); - assert (gp, g); - gp = upwind_gradient_norm (phi, 0.5); - assert (gp, 2 * g); - gp = upwind_gradient_norm (phi, fPos, 0.5); - assert (gp, 2 * g); - - % Propagate to the left for the reverse effect. - g = upwind_gradient_norm (phi, -fPos); - assert (g(2), 1); - - % Propagate -phi, which again turns everything around. - g = upwind_gradient_norm (-phi, fPos); - assert (g(2), 1); - g = upwind_gradient_norm (-phi, -fPos); - assert (g(2), 2); -***** test - n = 50; - x = linspace (-1, 1, n); - h = x(2) - x(1); - [XX, YY, ZZ] = ndgrid (x, x, x); - - phi = XX.^2 + YY.^2 + ZZ.^2; - g = upwind_gradient_norm (phi, h); - - r = sqrt (phi); - assert (g, 2 * r, 0.1); + colorbar (); 7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ls_enforce_speed.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_enforce_speed.m +[inst/ls_absolute_geom.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_absolute_geom.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 + 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_find_geometry.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_find_geometry.m ***** error @@ -5344,122 +5657,100 @@ set (gca (), "xtick", x, "ytick", x, "xticklabel", "", "yticklabel", ""); hold ("off"); 12 tests, 12 passed, 0 known failure, 0 skipped -[inst/ls_genbasic.m] ->>>>> /build/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); +[inst/so_example_problem.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/so_example_problem.m +***** shared basicData + basicData = struct (); + basicData.p = so_init_params (true); + basicData.p.vol = 4; + basicData.p.weight = 10; + + n = 50; + x = linspace (-4, 5, n); + h = x(2) - x(1); + basicData.g = struct ("x", x, "h", h); ***** 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)); + so_example_problem (); +***** error + so_example_problem (1, 2); +***** error + so_example_problem (1); ***** 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]); + data = so_example_problem (basicData); + phi = ls_genbasic (data.g.x, "box", -2.5, 1.3); + + [a, b] = data.util.bounds (phi, data); + assert (a, -2.5, sqrt (eps)); + assert (b, 1.3, sqrt (eps)); ***** test - p = [0, 2, 1]; + data = so_example_problem (basicData); - phi = ls_genbasic (XXX, YYY, ZZZ, "half", p, [0; 0; 1]); - assert (ls_equal (phi, 1 - ZZZ)); + phi = ls_genbasic (data.g.x, "box", -2, 2); + s0 = data.cb.update_state (phi, data); - 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 (data.g.x, "box", -3, 3); + s1 = data.cb.update_state (phi, data); - 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); + phi = ls_genbasic (data.g.x, "box", -1, 1); + s2 = data.cb.update_state (phi, data); - 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_genbasic (data.g.x, "box", -1, 3); + s3 = data.cb.update_state (phi, data); - 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 + phi = ls_genbasic (data.g.x, "box", -3, 1); + s4 = data.cb.update_state (phi, data); + + assert (all ([s0.cost, s1.cost, s2.cost, s3.cost, s4.cost] >= 0)); + assert (s0.cost, 0, 1e-1); + assert (s1.cost > s3.cost); + assert (s1.cost > s4.cost); + assert (s2.cost > s3.cost); + assert (s2.cost > s4.cost); + assert (s3.cost > s0.cost); + assert (s4.cost > s0.cost); +***** function testDeriv (a, b, data) + phi = ls_genbasic (data.g.x, "box", a, b); + data.s = data.cb.update_state (phi, data); + [f, dJ] = data.cb.get_direction (data); + assert (dJ < 0); + + dt = 5e-3; + dists = ls_solve_stationary (phi, f, data.g.h); + phip = ls_extract_solution (dt, dists, phi, f); + sp = data.cb.update_state (phip, data); + + assert (sp.cost < data.s.cost); + relErr = abs (sp.cost - (data.s.cost + dt * dJ)) / data.s.cost; + assert (relErr < 0.1); +***** endfunction +***** test + data = so_example_problem (basicData); + + testDeriv (-1, 1, data); + testDeriv (-3, 3, data); + testDeriv (-1, 3, data); + testDeriv (-3, 1, data); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/ls_equal.m] +>>>>> /build/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_init_narrowband.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_init_narrowband.m ***** error @@ -5543,274 +5834,123 @@ i = 5: dist = 0.085786 i = 6: dist = 0.085786 7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ls_distance_fcn.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_distance_fcn.m +[inst/ls_setxor.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_setxor.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)); + 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 (-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); + phi1 = XX.^2 + YY.^2 - 8^2; + phi2 = XX.^2 + YY.^2 - 5^2; - 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 19.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 + assert (ls_equal (ls_setdiff (phi1, phi2), ls_setxor (phi1, phi2))); ***** demo n = 100; - x = linspace (-10, 10, n); - h = x(2) - x(1); + x = linspace (-7, 7, n); [XX, YY] = meshgrid (x, x); - phi = ls_genbasic (XX, YY, "sphere", [0, 0], [8, 5]); - d = ls_distance_fcn (phi, h); + phi1 = (XX - 2).^2 + YY.^2 - 3^2; + phi2 = (XX + 2).^2 + YY.^2 - 3^2; + phi = ls_setxor (phi1, phi2); figure (); - mesh (XX, YY, d); - view ([45, 45]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ls_inside.m] ->>>>> /build/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 + 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_nb_from_geom.m] ->>>>> /build/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) +[inst/ls_signed_distance.m] +>>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_signed_distance.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_signed_distance () +***** error + ls_signed_distance (1, 2, 3) ***** test - n = 50; - x = linspace (-10, 10, n); + assert (ls_signed_distance ([]), []); +***** test + n = 10; + x = linspace (-2, 2, 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); + phi = abs (x) - 1; - where = (!isna (dOld)); - assert (all (!isna (dNew(where)))); - assert (dNew(where), dOld(where), h / 4); -***** demo + d = ls_signed_distance (phi, h); + assert (d, phi, sqrt (eps)); +***** test n = 50; - x = linspace (-10, 10, n); + x = linspace (-2, 2, 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); + [XX, YY, ZZ] = ndgrid (x); + RRsq = XX.^2 + YY.^2 + ZZ.^2; + phi = RRsq - 1; - 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); + 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 - - [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_normalise.m] ->>>>> /build/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); + phi = [-0, 0]; + d = ls_signed_distance (phi); + assert (ls_equal (phi, d)); else warning ("'signbit' function not available, skipping test."); endif -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/so_init_params.m] ->>>>> /build/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/ls_intersect.m] ->>>>> /build/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); + x = linspace (-10, 10, n); + h = x(2) - x(1); [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); + 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); - 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"); + contour (XX, YY, phi0); + title ("Initial"); + colorbar (); 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"); + contour (XX, YY, d); + title ("Signed Distance"); + colorbar (); axis ("equal"); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/ls_isempty.m] ->>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_isempty.m -***** error - ls_isempty () -***** error - ls_isempty (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; - - 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 +8 tests, 8 passed, 0 known failure, 0 skipped [inst/ls_solve_stationary.m] >>>>> /build/octave-level-set-0.3.1~git.2019.04.13/inst/ls_solve_stationary.m ***** error @@ -5909,110 +6049,8 @@ line ([0, 0], [2, 10]); title ("Diffraction"); 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/ls_time_step.m] ->>>>> /build/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 Checking C++ files ... -Summary: 258 tests, 253 passed, 5 known failures, 0 skipped +Summary: 258 tests, 254 passed, 4 known failures, 0 skipped dh_installdocs -O--buildsystem=octave dh_installchangelogs -O--buildsystem=octave dh_octave_changelogs -O--buildsystem=octave @@ -6035,8 +6073,8 @@ dpkg-gencontrol: warning: package octave-level-set: substitution variable ${octave:Upstream-Description} unused, but is defined dh_md5sums -O--buildsystem=octave dh_builddeb -O--buildsystem=octave -dpkg-deb: building package 'octave-level-set-dbgsym' in '../octave-level-set-dbgsym_0.3.1~git.2019.04.13-6_armhf.deb'. dpkg-deb: building package 'octave-level-set' in '../octave-level-set_0.3.1~git.2019.04.13-6_armhf.deb'. +dpkg-deb: building package 'octave-level-set-dbgsym' in '../octave-level-set-dbgsym_0.3.1~git.2019.04.13-6_armhf.deb'. dpkg-genbuildinfo --build=binary -O../octave-level-set_0.3.1~git.2019.04.13-6_armhf.buildinfo dpkg-genchanges --build=binary -O../octave-level-set_0.3.1~git.2019.04.13-6_armhf.changes dpkg-genchanges: info: binary-only upload (no source code included) @@ -6044,12 +6082,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/19038/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/19038/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/1988 and its subdirectories -I: Current time: Wed Jun 7 03:03:58 -12 2023 -I: pbuilder-time-stamp: 1686150238 +I: removing directory /srv/workspace/pbuilder/19038 and its subdirectories +I: Current time: Thu Jun 8 05:29:32 +14 2023 +I: pbuilder-time-stamp: 1686151772