NEWS
transport 0.15-4 (2024-09-16)
OVERVIEW
- CRAN maintenance update. Replace ancient "Calloc"s by
"R_Calloc"s (and so on). Remove WSGeometry from suggested
packages as it is no longer on CRAN.
transport 0.15-3
OVERVIEW
- Works around a (very) rare infinite loop in the
networkflow algorithm that seems to have to do with
numerical precision by introducing a (generous) iteration
limit and making the loop interruptible by the user.
transport 0.15-2 (2024-05-09)
OVERVIEW
- Bug fix. The function gen_cost0 introduced in the
previous version was only designed for 2d scenarios.
There is now another function gen_cost0d for the
"single thread, more than 2d" case.
transport 0.15-1
OVERVIEW
- Dependence on R version >= 4.1 is now in DESCRIPTION.
This R version was required before, but rather than
being stated explicitly, installation failed with an
obscure error. Reported by Chao Zhang [#1].
- Bug fix in internal function gen_cost used to compute
distance matrices. For points at (almost) the same
position negative entries of squared cost matrices
were possible. Fixed.
- The computation of distance matrices is almost twice
as fast now by use of a new internal function gen_cost0
when running functions in a single thread.
transport 0.15-0 (2024-03-26)
OVERVIEW
- unbalanced is now a generic function with methods for
class pgrid (corresponding to the previous function
unbalanced) and wpp (new functionality).
- plot.ubtrans has been replaced by plot.ut_grid and there
is a new method plot.ut_wpp, where ut_grid and ut_wpp
are (now) the classes of the outputs of the two unbalanced
methods when setting output="all".
transport 0.14-8
OVERVIEW
- Bug fix in function unbalanced. The function returned zero
even if only one of the measures was the zero measure
(for p=1, after reduction).
transport 0.14-7 (2024-02-18)
OVERVIEW
- Maintenance update to fix a new note in CRAN checks.
transport 0.14-6 (2023-07-02)
OVERVIEW
- Skip new semidiscrete test on CRAN as the special
configurations only give slightly perturbed results
(which seem random in spite of the seed).
Re-reduce the tolerance everywhere else.
transport 0.14-5
OVERVIEW
- Increase tolerance in new semidiscrete test. Previously,
it failed for some of the more special configurations,
in particular if there was no long double.
transport 0.14-4 (2023-06-25)
OVERVIEW
transport 0.14-3
OVERVIEW
- Bug fix in src/Makevars. Object files in subfolders were
not cleaned properly. This had no practical implications
for the most usual installation procedures, but has been
fixed now.
transport 0.14-2
OVERVIEW
- We thank Peter Jacobs for contributions.
- Bug fixes: The C code underlying the functions computing
semidiscrete optimal transport for p=2 resulted in a
segmentation fault for certain (not so rare) input
combinations. Also there was a memory leak. Both are
fixed.
transport 0.14-1 (2023-05-21)
OVERVIEW
- We thank Mauro Ferrante and Oskar Nenoff for contributions.
- Bug fix: The output of 'transport.default' with
method="networkflow" was typically wrong if both mass
vectors a and b had only one non-zero entry each.
- Bug fix: function 'unbalanced' with output="all" (and
sometimes output="rawres") threw an error if one of a and b
had only one non-zero entry.
transport 0.14-0
OVERVIEW
- Computation of semidiscrete optimal transport for p=1
did not work with newer versions of CGAL due to conflicting
C++ standards. This appears to be fixed completely.
- The colors of the mass points in plots of semidiscrete
optimal transport plans can now be controlled via a parameter
pcol.
transport 0.13-2
OVERVIEW
- Important bug fix in the recently added function
unbalanced. If p=1 and image a has more total mass than
image b, then the returned solution was typically wrong
if there are pixels with zero mass.
In most cases this came with suspicious warning messages
and the computed distance was still correct.
Fixed.
transport 0.13-1
OVERVIEW
- Add WSGeometry to suggested packages.
transport 0.13-0 (2022-10-30)
OVERVIEW
- New function unbalanced for computing unbalanced transport
(and unbalanced Wasserstein distance) between pgrids.
- New function plot.ubtrans for plotting the result from
unbalanced.
- Resolves recent R CMD check warnings due to C function
declarations without prototypes.
transport 0.12-5
OVERVIEW
- Bug fix: transport.pgrid with method "networkflow" and a
non-square grid was typically wrong. Seems to be correct now.
- Bug fix: transport.pgrid with method "shielding" caused an
error if the grid had fewer than 200 points in total
(e.g. 14x14). Largely fixed (a problem may remain for very
small grids (e.g. below 4x4), but this is clearly not an
application case for the shielding method anyway).
- Bug fixes: some non-standard parameter combinations caused
errors in the transport function. Fixed.
- pgrid.plot has a new option "angle" to make the heads of
the arrows wider for very small transport problems
transport 0.12-4 (2022-08-12)
OVERVIEW
- Minor changes in the internal code for easier maintenance.
- Minor fixes in NEWS and man files to make the newest
package check happy.
transport 0.12-3
OVERVIEW
- We thank Jiahua Chen, Michel Groppe and Heather Turner
for contributions.
- Several bugs in connection with mass/weight vectors not
being ordered or containing zeroes have been fixed.
- The function wasserstein1d is considerably faster now for
large datasets.
SIGNIFICANT CHANGES
- Speed improvement for function wasserstein1d due to a more
efficient counting procedure.
BUG FIXES
- Function wasserstein1d. In previous versions the result was
typically wrong if locations were not ordered *and* varying
weights were specified. Fixed.
- Function wasserstein1d. There was an uncaught error if one
or several of the (inner) weights were zero. This is fixed
and the function works with general non-negative weights
(with positive sum) now.
- Function transport.default and wasserstein. For the
default networkflow method the from and to indices in the
returned transport plan referred to the vectors of positive
entries in a and b (rather than the full vectors a and b).
In particular this typically led to wrong distance
computations in the function wasserstein if entries with
mass 0 were present (the Wasserstein distance / cost
returned by the function transport with option fullreturn
= TRUE was correct). Fixed.
- Function transport.default. There was an uncaught error
if in one of the vectors only one of the masses was
non-zero. Fixed.
transport 0.12-2 (2020-03-11)
OVERVIEW
- We thank Christoph Weitkamp for contributions.
- Fixes a serious bug in the main transport function.
For method = "networkflow" and mass vectors a, b
containing zeroes, the results were typically wrong before.
- Function transport_track now uses argument fps (frames
per second) instead of delay.time for generation of
animated gifs. This argument is used consistently.
transport 0.12-1 (2019-08-19)
OVERVIEW
- Fixes a compilation error under Solaris.
- Returns to using a Makevars file instead of the
configure script for the same openmp functionality
as in the previous version.
- We thank Brian Ripley for pertinent hints on both.
transport 0.12-0 (2019-08-06)
OVERVIEW
- We thank Nicolas Bonneel for contributions.
- The main workhorse function transport has a new method
"networkflow". This is currently the recommended method for
solving the discrete optimal transport problems directly
via a simplex algorithm (it is fastest unless special
structure is known, e.g. p=2).
The method is available for objects of classes pp, wpp,
pgrid. The code is based on the modified version of
the Lemon Library provided by Nicolas Bonneel.
https://github.com/nbonneel/network_simplex
- A new configure script checks for openmp support at install time.
If supported the installed version allows the user to run a
multithreaded version of the "networkflow" method via a new
argument "threads" in the appropriate transport functions.
- Fixes a bug in the transport.track function which could cause
an error when trying to generate a gif using this function.
Also adds some minor customization options to this function.
transport 0.11-2 (2019-07-06)
OVERVIEW
- We thank Luc Lehericy for contributions.
- A bug in the function transport.wpp was fixed which
for strongly unbalanced weights created sometimes
an infinite loop.
transport 0.11-1 (2019-04-17)
OVERVIEW
- We thank Samuel Ackerman for contributions.
- The functions subwasserstein and transport.pp are
faster now. Depending on the example the speed increase
can be very substantial.
SIGNIFICANT CHANGES
- Function subwasserstein is much faster now for large objects
because distance matrixes are not precomputed anymore. Set
the new argument precompute=TRUE if you must reproduce the
old behaviour.
BUG FIXES
- Due to the misplacement of a line of code, epsilon-scaling
in the auction algorithm was not working properly for the
function transport.pp. In some simple pathological examples
the algorithm took very long. Reported by Samuel Ackerman.
Fixed.
transport 0.11-0 (2019-02-04)
OVERVIEW
- Several improvements regarding exact and approximate
computations of Wasserstein distances, including a
bug fix.
NEW FUNCTIONS
- subwasserstein
Allow for approximate computation of Wasserstein distances
via subsampling. Code by Jörn Schrieber
SIGNIFICANT CHANGES
- Function wasserstein can now also compute Wasserstein
distances in the vanilla case of two mass vectors with
cost matrix.
BUG FIXES
- The result was incorrectly normed when applying function
wasserstein to objects of class "wpp" with prob=TRUE. Fixed.
transport 0.10-0 (2019-01-02)
OVERVIEW
- Semidiscrete optimal transport can now also be
computed for p=1 (in addition to p=2) if CGAL is
available. Adapt then src/Makevars and install this
package from source. This functionality is based on
stand-alone C++ code by Valentin Hartmann
- Easier extraction of the Wasserstein distance
from semidiscrete optimal transport results
NEW FUNCTIONS
- semidiscrete1
The workhorse function for computing semidiscrete
optimal transport for p=1. This is called by the
function transport (if first input object has class
pgrid, second input object has class wpp and p=1) and
by the function semidiscrete (if p=1).
Calling semidiscrete1 directly offers finer control
of the algorithm.
- plot_apollonius
The workhorse function for plotting the semidiscrete
optimal transport plan for p=1. This is called by the
function plot.pgrid (if the second input object has
class wpp and p=1).
Calling plot_apollonius directly allows to plot
arbitrary Apollonius diagrams (a.k.a. weighted Voronoi
tesselations) based on a two-column matrix of centers
and a vector of weights. It allows offers finer
control over plotting.
SIGNIFICANT CHANGES
- Functions transport and plot.pgrid can now compute
and plot semidiscrete optimal transport plans also
for p=1 (in addition to p=2) using an object of class
pgrid and an object of class wpp. The result of the
plot is an Apollonius diagram (a.k.a. weighted
Voronoi tesselations) consisting of hyperbola
segments.
- The object returned by semidiscrete now always contains
a component giving the Wasserstein distance between the
input objects. The function wasserstein simply extracts
this component.
transport 0.9-4 (2017-10-03)
OVERVIEW
- Compilation with the most recent version of clang resulted in
an error. Fixed.
transport 0.9-3 (2017-09-29)
OVERVIEW
- Minor change to remove a compiler warning
transport 0.9-2
OVERVIEW
- Minor changes in Makevars to enable compilation under Windows and
pass CRAN checks
transport 0.9-1
OVERVIEW
transport 0.9-0
OVERVIEW
- Fixed serious bug, introduced in version 0.7-0,
by which the algorithm hanged for pgrid-objects if p>1
method="revsimplex" (the default) if masses are not integer valued
- New method "shielding" for pgrid-objects if p=2 that is considerably
faster than the existing methods. Option to link package
against CPLEX makes this combination even much faster and enables
computation for 128x128 grids within a few seconds.
C++ code by Bernhard Schmitzer
transport 0.8-2 (2017-03-09)
OVERVIEW
- New function wasserstein1d to compute the Wasserstein
distance between two univariate samples (with weights)
transport 0.8-1 (2016-12-08)
OVERVIEW
- We thank Atreju Tauschinsky for contributions
- The wasserstein function supports now the wpp class
- Several minor bug fixes
transport 0.8-0
OVERVIEW
- We thank Florian Heinemann and Timo Wilm for contributions
- New class weighted point patterns with full functionality
- Optimal transport between pgrid and wpp that returns
transport tesselation
- Dynamic optimal transport (displacement interpolation)
NEW CLASSES
- wpp
The class wpp describes general discrete measures with
finite support, i.e. patterns of finitely many "weighted"
points (without specific structure for the locations or
weights). There are constructors for this class,
as well as plot, print and summary functions. The
function 'transport' can deal with this class.
We thank Timo Wilm for help with creating this class.
NEW FUNCTIONS
- semidiscrete
Computes the transport map (in the form of a power
diagram) for the semidiscrete transport problem
from a pgrid to a wpp object for the case p=2.
This function is not usually called by the user
because the function transport offers the same
flexibility now.
- plot_pgrid_wpp
Plots a representation of a transport map (available
as a power diagram) between a pgrid and a wpp object.
This function gets called when using the generic plot
function with a pgrid and a wpp object (in that order),
but a direct call to plot_pgrid_wpp by the user offers
more possibilites for customizing the plot.
- transport_track
Computes a dynamic version of a given transference plan
by interpolating in time. The linear interpolation of
the projections of the transference plan is computed,
which in many important cases corresponds to the
displacement interpolation. The result can be either
returned as an array or is saved as an animated gif.
We thank Florian Heinemann for contributing large
parts of this function.
SIGNIFICANT CHANGES
- transport
Can now deal with two wpp objects and in the case p=2
also with one pgrid and one wpp object as inputs
(in that order).
- aha
It is now possible to return the parameters for the optimal
power diagram, rather than the (approximative) optimal transference
plan in terms of the pixel centers of the source measure. For
this, use the new option powerdiag.
OTHER USER-VISIBLE CHANGES
- pgrid
If no information is provided on the positions of the pixels, it is
now assumed that we have square pixels and the boundary points
in the first dimension are 0 and 1 (previous behaviour: boundary
points in every dimension are 0 and 1, leading to non-square pixels
if the pgrid is non-square).
- pgrid
A pgrid object has two additional components 'totmass' giving
the sum of pixel values, and 'totcontmass' giving the sum of
pixel values divided by pixel areas. The former may be interpreted
as totol mass of pgrid if interpreted as a discrete measure on the
grid of pixel centers. The latter may be interpreted as total
mass of pgrid if interpreted as a continuous measure with constant
density on each pixel (seen as small contiguous rectangles).
BUG FIXES
- Various smaller bug fixes for special input.
transport 0.7-5
OVERVIEW
- We thank Ramon Diaz-Uriarte for contributions
- aha can return optimal power diagram now
- Several minor bug fixes
SIGNIFICANT CHANGES
- aha
It is now possible to return the parameters for the optimal
power diagram, rather than the (approximative) optimal transference
plan in terms of the pixel centers of the source measure. For
this, use the new option powerdiag.
BUG FIXES
- transport.pp, transport.default
Computing the optimal transport from a mass distribution
to itself resulted in an error.
Fixed.
transport 0.7-4
OVERVIEW
- We thank Yann Abraham and Stefan Kain for contributions
- Several unnecessary outputs are now suppressed by default
(timing information, warnings about degenerate bases that
did not affect the result)
- Several minor bug fixes
BUG FIXES
- transport.pgrid
For p=1 computing the optimal transport from a mass distribution
to itself resulted in a segfault or an error (depending on the
method used).
Fixed.
- transport.pgrid
Having a mass distribution of integers and at least one zero could
cause an integer overflow.
Fixed.
transport 0.7-3 (2016-02-25)
OVERVIEW
- We thank Ludo Daemen and Stefan Kain for contributions
- Minor changes in the documentation and a bug fix
BUG FIXES
- transport.default
Using transport.default with the shortlist method gave an error
message if no shortlist parameters were set.
Fixed.
transport 0.7-0 (2015-10-22)
OVERVIEW
- There are two new ways for computing starting solutions
in transport.default and transport.pgrid with
method="revsimplex", which lead to substantial speed
improvements (mainly in transport.pgrid)
- Several minor bugfixes
SIGNIFICANT CHANGES
- transport.pgrid, transport.default
When method="revsimplex" is chosen, transport.pgrid can now
start from a solution that is based on the optimal transport
between two coarsened problems. This "multiscale" behaviour is invoked
automatically if p>1, the grid is 2-dimensional, of a certain
minimal size, and has an even number of vertices in each direction
(for p=1 use the control parameter nscales as in previous
versions). Both transport.pgrid and transport.default can also
be started from a solution based on the "Modified Row Minimum
Rule" (newly implemented in C Code). This is the default
behaviour now for transport.default, and also for transport.pgrid
if the multiscale starting solution described above cannot
be computed.
To get the behaviour of older versions, say
control=list(start="nwcorner") in the transport function.
transport 0.6-3 (2014-10-16)
OVERVIEW
- Minor changes in the documentation
transport 0.6-2 (2014-06-22)
OVERVIEW
- Minor changes in the documentation and a bug fix
BUG FIXES
- aha
In the underlying C code integer overflows were possible (usually
without noticable effects on the result).
Fixed.
transport 0.6-1 (2014-05-31)
OVERVIEW