Hello community,
here is the log from the commit of package octave-forge-splines for
openSUSE:Factory checked in at 2016-06-09 16:14:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave-forge-splines (Old)
and /work/SRC/openSUSE:Factory/.octave-forge-splines.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-splines"
Changes:
--------
---
/work/SRC/openSUSE:Factory/octave-forge-splines/octave-forge-splines.changes
2015-12-03 13:32:54.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.octave-forge-splines.new/octave-forge-splines.changes
2016-06-09 16:17:13.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Jun 7 19:25:15 UTC 2016 - [email protected]
+
+- Update to version 1.3.1
+ * csape default is now Lagrange boundary conditions (Matlab compatible)
+ * csaps can return the fit degrees of freedom
+
+-------------------------------------------------------------------
Old:
----
splines-1.2.9.tar.gz
New:
----
splines-1.3.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ octave-forge-splines.spec ++++++
--- /var/tmp/diff_new_pack.iHltES/_old 2016-06-09 16:17:15.000000000 +0200
+++ /var/tmp/diff_new_pack.iHltES/_new 2016-06-09 16:17:15.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package octave-forge-splines
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define octpkg splines
Name: octave-forge-%{octpkg}
-Version: 1.2.9
+Version: 1.3.1
Release: 0
Summary: Additional spline functions for Octave
License: GPL-2.0+ and GPL-3.0+ and SUSE-Public-Domain
++++++ splines-1.2.9.tar.gz -> splines-1.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/DESCRIPTION new/splines/DESCRIPTION
--- old/splines/DESCRIPTION 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/DESCRIPTION 2016-06-02 15:12:06.000000000 +0200
@@ -1,6 +1,6 @@
Name: splines
-Version: 1.2.9
-Date: 2015-11-28
+Version: 1.3.1
+Date: 2016-06-02
Author: various authors
Maintainer: Nir Krakauer <[email protected]>
Title: Splines.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/Makefile new/splines/Makefile
--- old/splines/Makefile 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,90 +0,0 @@
-## Makefile to simplify Octave Forge package maintenance tasks
-
-PACKAGE = $(shell $(SED) -n -e 's/^Name: *\(\w\+\)/\1/p' DESCRIPTION |
$(TOLOWER))
-VERSION = $(shell $(SED) -n -e 's/^Version: *\(\w\+\)/\1/p' DESCRIPTION |
$(TOLOWER))
-#DEPENDS = $(shell $(SED) -n -e 's/^Depends[^,]*, \(.*\)/\1/p' DESCRIPTION |
$(SED) 's/ *([^()]*),*/ /g')
-
-RELEASE_DIR = $(PACKAGE)-$(VERSION)
-RELEASE_TARBALL = $(PACKAGE)-$(VERSION).tar.gz
-HTML_DIR = $(PACKAGE)-html
-HTML_TARBALL = $(PACKAGE)-html.tar.gz
-
-MD5SUM ?= md5sum
-MKOCTFILE ?= mkoctfile
-OCTAVE ?= octave
-SED ?= sed
-TAR ?= tar
-
-TOLOWER = $(SED) -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'
-
-.PHONY: help dist html release install all check run doc clean maintainer-clean
-
-help:
- @echo "Targets:"
- @echo " dist - Create $(RELEASE_TARBALL) for release"
- @echo " html - Create $(HTML_TARBALL) for release"
- @echo " release - Create both of the above and show md5sums"
- @echo
- @echo " install - Install the package in GNU Octave"
- @echo " all - Build all oct files"
- @echo " check - Execute package tests (w/o install)"
- @echo " run - Run Octave with development in PATH (no
install)"
- @echo " doc - Build Texinfo package manual"
- @echo
- @echo " clean - Remove releases, html documentation, and
oct files"
- @echo " maintainer-clean - Additionally remove all generated files"
-
-$(RELEASE_DIR): .hg/dirstate
- @echo "Creating package version $(VERSION) release ..."
- -rm -rf $@
- hg archive --exclude ".hg*" --exclude Makefile --type files $@
- chmod -R a+rX,u+w,go-w $@
-
-$(RELEASE_TARBALL): $(RELEASE_DIR)
- $(TAR) cf - --posix $< | gzip -9n > $@
- -rm -rf $<
-
-$(HTML_DIR): install
- @echo "Generating HTML documentation. This may take a while ..."
- -rm -rf $@
- $(OCTAVE) --silent \
- --eval 'graphics_toolkit ("gnuplot");' \
- --eval 'pkg load generate_html $(PACKAGE);' \
- --eval 'generate_package_html ("$(PACKAGE)", "$@", "octave-forge");'
- chmod -R a+rX,u+w,go-w $@
-
-$(HTML_TARBALL): $(HTML_DIR)
- $(TAR) cf - --posix $< | gzip -9n > $@
- -rm -rf $<
-
-dist: $(RELEASE_TARBALL)
-
-html: $(HTML_TARBALL)
-
-release: dist html
- @$(MD5SUM) $(RELEASE_TARBALL) $(HTML_TARBALL)
- @echo "Upload @ https://sourceforge.net/p/octave/package-releases/new/"
- @echo "Execute: hg tag \"$(VERSION)\""
-
-install: $(RELEASE_TARBALL)
- @echo "Installing package locally ..."
- $(OCTAVE) --silent --eval 'pkg install $(RELEASE_TARBALL);'
-
-all:
-
-check: all
- $(OCTAVE) --silent \
- --eval 'addpath (fullfile ([pwd filesep "inst"]));' \
- --eval 'runtests ("inst");'
-
-run: all
- $(OCTAVE) --silent --persist \
- --eval 'addpath (fullfile ([pwd filesep "inst"]));'
-
-doc:
-
-clean:
- -rm -rf $(RELEASE_DIR) $(RELEASE_TARBALL) $(HTML_TARBALL) $(HTML_DIR)
-
-maintainer-clean: clean
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/NEWS new/splines/NEWS
--- old/splines/NEWS 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/NEWS 2016-06-02 15:12:06.000000000 +0200
@@ -1,3 +1,17 @@
+Summary of important user-visible changes for splines x.x.x:
+-------------------------------------------------------------------
+
+Summary of important user-visible changes for splines 1.3.1:
+-------------------------------------------------------------------
+
+ ** bug fix in fnplt
+
+Summary of important user-visible changes for splines 1.3.0:
+-------------------------------------------------------------------
+
+ ** csape default is now Lagrange boundary conditions (Matlab compatible)
+ ** csaps can return the fit degrees of freedom
+
Summary of important user-visible changes for splines 1.2.9:
-------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/inst/csape.m new/splines/inst/csape.m
--- old/splines/inst/csape.m 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/inst/csape.m 2016-06-02 15:12:06.000000000 +0200
@@ -18,10 +18,15 @@
## cubic spline interpolation with various end conditions.
## creates the pp-form of the cubic spline.
##
-## the following end conditions as given in @var{cond} are possible.
+## @var{x} should be @var{n} by 1, @var{y} should be @var{n} by @var{m},
+## @var{valc} should be 2 by @var{m} or 2 by 1
+##
+## The following end conditions as given in @var{cond} are possible:
## @table @asis
## @item 'complete'
## match slopes at first and last point as given in @var{valc}
+## (default; if @var{valc} is not given, the slopes matched are those
+## of the cubic polynomials that interpolate the first and last four points)
## @item 'not-a-knot'
## third derivatives are continuous at the second and second last point
## @item 'periodic'
@@ -40,15 +45,12 @@
## Algorithms taken from G. Engeln-Muellges, F. Uhlig:
## "Numerical Algorithms with C", Springer, 1996
-## Paul Kienzle, 19 Feb 2001, csape supports now matrix y value
-## Nir Krakauer, 21 Nov 2012, fixed a bug with periodic boundary conditions
and matrix y (noticed by Ted Rippert); added more tests to verify it won't
happen again
-
function pp = csape (x, y, cond, valc)
x = x(:);
n = length(x);
if (n < 3)
- error("csape requires at least 3 points");
+ error ("csape requires at least 3 points");
endif
## Check the size and shape of y
@@ -64,16 +66,22 @@
else
a = shiftdim (reshape (y, [prod(szy(1:end-1)), szy(end)]), 1);
endif
+ m = size (a, 2);
-
- b = c = zeros (size (a));
+ b = c = zeros (n, m);
h = diff (x);
idx = ones (columns(a),1);
if (nargin < 3 || strcmp(cond,"complete"))
- # specified first derivative at end point
+
+ # set first derivative at end points
if (nargin < 4)
- valc = [0, 0];
+ valc = zeros(2, m);
+ n_use = min(n, 4);
+ for i = 1:m
+ valc(1, i) = polyval(polyder(polyfit(x(1:n_use), a(1:n_use, i),
n_use-1)), x(1));
+ valc(2, i) = polyval(polyder(polyfit(x(end-n_use+1:end),
a(end-n_use+1:end, i), n_use-1)), x(end));
+ endfor
endif
if (n == 3)
@@ -104,8 +112,8 @@
c(2:n - 1,:) = spdiags([[e(:);0],dg,[0;e(:)]],[-1,0,1],n-2,n-2) \ g;
- c(1,:) = (3 / h(1) * (a(2,:) - a(1,:)) - 3 * valc(1) - c(2,:) * h(1)) /
(2 * h(1));
- c(n,:) = - (3 / h(n - 1) * (a(n,:) - a(n - 1,:)) - 3 * valc(2) + c(n -
1,:) * h(n - 1)) / (2 * h(n - 1));
+ c(1,:) = (3 / h(1) * (a(2,:) - a(1,:)) - 3 * valc(1, :) - c(2,:) * h(1))
/ (2 * h(1));
+ c(n,:) = - (3 / h(n - 1) * (a(n,:) - a(n - 1,:)) - 3 * valc(2, :) + c(n
- 1,:) * h(n - 1)) / (2 * h(n - 1));
end
b(1:n - 1,:) = diff (a) ./ h(1:n - 1, idx)...
- h(1:n - 1,idx) / 3 .* (c(2:n,:) + 2 * c(1:n - 1,:));
@@ -115,11 +123,11 @@
if ((nargin < 4) || strcmp(cond,"variational"))
## set second derivatives at end points to zero
- valc = [0, 0];
+ valc = zeros (2, 1);
endif
- c(1,:) = valc(1) / 2;
- c(n,:) = valc(2) / 2;
+ c(1,:) = valc(1, :) / 2;
+ c(n,:) = valc(2, :) / 2;
g = 3 * diff (a(2:n,:)) ./ h(2:n - 1, idx)...
- 3 * diff (a(1:n - 1,:)) ./ h(1:n - 2, idx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/inst/csaps.m new/splines/inst/csaps.m
--- old/splines/inst/csaps.m 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/inst/csaps.m 2016-06-02 15:12:06.000000000 +0200
@@ -1,4 +1,4 @@
-## Copyright (C) 2012-2013 Nir Krakauer
+## Copyright (C) 2012-2015 Nir Krakauer
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
## along with this program; If not, see <http://www.gnu.org/licenses/>.
## -*- texinfo -*-
-## @deftypefn{Function File}{[@var{yi} @var{p} @var{sigma2} @var{unc_yi}] =}
csaps(@var{x}, @var{y}, @var{p}, @var{xi}, @var{w}=[])
+## @deftypefn{Function File}{[@var{yi} @var{p} @var{sigma2} @var{unc_yi}
@var{df}] =} csaps(@var{x}, @var{y}, @var{p}, @var{xi}, @var{w}=[])
## @deftypefnx{Function File}{[@var{pp} @var{p} @var{sigma2}] =}
csaps(@var{x}, @var{y}, @var{p}, [], @var{w}=[])
##
## Cubic spline approximation (smoothing)@*
@@ -40,6 +40,8 @@
##
## @var{unc_yi} is an estimate of the standard error of the fitted curve(s) at
the @var{xi}.
## Empty if @var{xi} is not provided.
+##
+## @var{df} is an estimate of the degrees of freedom used in the spline fit (2
for @var{p}=0, n for @var{p}=1)
##
## Reference: Carl de Boor (1978), A Practical Guide to Splines, Springer,
Chapter XIV
##
@@ -48,7 +50,7 @@
## Author: Nir Krakauer <[email protected]>
-function [ret,p,sigma2,unc_yi]=csaps(x,y,p,xi,w)
+function [ret,p,sigma2,unc_yi,df]=csaps(x,y,p,xi,w)
warning ("off", "Octave:broadcast", "local");
@@ -99,7 +101,6 @@
## QT*y can also be written as (y(3:n, :) - y(2:(n-1), :)) ./ h(2:end) -
(y(2:(n-1), :) - y(1:(n-2), :)) ./ h(1:(end-1))
u = (6*(1-p)*QT*diag(1 ./ w)*QT' + p*R) \ (QT*y);
a = y - 6*(1-p)*diag(1 ./ w)*QT'*u;
-
## derivatives for the piecewise cubic spline
aa = bb = cc = dd = zeros (n+1, m);
@@ -108,19 +109,21 @@
dd(2:n, :) = diff(cc(2:(n+1), :)) ./ h;
bb(2:n, :) = diff(a) ./ h - (h/3) .* (cc(2:n, :) + cc(3:(n+1), :)/2);
-
-## note: add knots to either end of spline pp-form to ensure linear
extrapolation
- xminus = x(1) - eps(x(1));
- xplus = x(end) + eps(x(end));
+## add knots to either end of spline pp-form to ensure linear extrapolation
+ dx_minus = eps(x(1));
+ dx_plus = eps(x(end));
+ xminus = x(1) - dx_minus;
+ xplus = x(end) + dx_plus;
x = [xminus; x; xplus];
slope_minus = bb(2, :);
slope_plus = bb(n, :) + cc(n, :)*h(n-1) + (dd(n, :)/2)*h(n-1)^2;
bb(1, :) = slope_minus; #linear extension of splines
bb(n + 1, :) = slope_plus;
- aa(1, :) = a(1, :) - eps(x(1))*bb(1, :);
+ aa(1, :) = a(1, :) - dx_minus*bb(1, :);
ret = mkpp (x, cat (2, dd'(:)/6, cc'(:)/2, bb'(:), aa'(:)), m);
-
+ clear a aa bb cc dd slope_minus slope_plus u #no longer needed
+
if ~isempty (xi)
ret = ppval (ret, xi);
endif
@@ -129,7 +132,7 @@
unc_yi = [];
endif
- if isargout (3) || (isargout (4) && ~isempty (xi))
+ if isargout (3) || (isargout (4) && ~isempty (xi)) || isargout (5)
if p == 1 #interpolation assumes no error in the given data
sigma2 = 0;
@@ -145,8 +148,8 @@
A = diag(1 ./ sqrt(w)) * A * diag(sqrt(w)); #rescale to original units; a
= A*y
MSR = mean(w .* (y - (A*y)) .^ 2); #mean square residual
Ad = diag(A);
- At = trace(A);
- sigma2 = mean(MSR(:)) * (n / (n-At)); #estimated data error variance
(wahba83)
+ df = trace(A);
+ sigma2 = mean(MSR(:)) * (n / (n-df)); #estimated data error variance
(wahba83)
if isargout (4) && ~isempty (xi)
ni = numel (xi);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/inst/fnplt.m new/splines/inst/fnplt.m
--- old/splines/inst/fnplt.m 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/inst/fnplt.m 2016-06-02 15:12:06.000000000 +0200
@@ -36,7 +36,7 @@
if (nargin < 2)
plt = "r;;";
endif
- xi = linspace(min(pp.x),max(pp.x),256)';
+ xi = linspace(min(pp.breaks),max(pp.breaks),256)';
pts = ppval(pp,xi);
if nargout == 2
x = xi;
@@ -44,7 +44,7 @@
elseif nargout == 1
x = [xi, pts];
else
- plot(xi,pts,plt,pp.x,ppval(pp,pp.x),"bx;;");
+ plot(xi,pts,plt,pp.breaks,ppval(pp,pp.breaks),"bx;;");
endif
endfunction
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/splines/inst/tps_val.m new/splines/inst/tps_val.m
--- old/splines/inst/tps_val.m 2015-11-30 14:50:57.000000000 +0100
+++ new/splines/inst/tps_val.m 2016-06-02 15:12:06.000000000 +0200
@@ -79,7 +79,7 @@
%!shared x,y,c,xi
%! x = ([1:10 10.5 11.3])'; y = sin(x);
%! c = tpaps(x,y,1);
-%!assert (tpaps(x,y,1,x), tps_val(x,c,x));
+%!assert (tpaps(x,y,1,x), tps_val(x,c,x), 100*eps);
%! x = rand(100, 2)*2 - 1;
%! y = x(:, 1) .^ 2 + x(:, 2) .^ 2;
%! c = tpaps(x,y,1);