From: <nir...@us...> - 2012-03-26 17:44:31
|
Revision: 10066 http://octave.svn.sourceforge.net/octave/?rev=10066&view=rev Author: nir-krakauer Date: 2012-03-26 17:44:22 +0000 (Mon, 26 Mar 2012) Log Message: ----------- Fixed, by analogy with spline.m, bug in call to mkpp that was causing tests to fail with matrix input y; all tests passed now Modified Paths: -------------- trunk/octave-forge/main/splines/inst/csape.m Modified: trunk/octave-forge/main/splines/inst/csape.m =================================================================== --- trunk/octave-forge/main/splines/inst/csape.m 2012-03-26 10:32:49 UTC (rev 10065) +++ trunk/octave-forge/main/splines/inst/csape.m 2012-03-26 17:44:22 UTC (rev 10066) @@ -53,17 +53,18 @@ ## Check the size and shape of y ndy = ndims (y); szy = size (y); - if (ndy == 2 && (szy(1) == 1 || szy(2) == 1)) - if (szy(1) == 1) + if (ndy == 2 && (szy(1) == n || szy(2) == n)) + if (szy(2) == n) a = y.'; else a = y; szy = fliplr (szy); endif else - a = reshape (y, [prod(szy(1:end-1)), szy(end)]).'; + a = shiftdim (reshape (y, [prod(szy(1:end-1)), szy(end)]), 1); endif + b = c = zeros (size (a)); h = diff (x); idx = ones (columns(a),1); @@ -218,8 +219,7 @@ endif d = d(1:n-1,:); c=c(1:n-1,:); b=b(1:n-1,:); a=a(1:n-1,:); - coeffs = [d(:), c(:), b(:), a(:)]; - pp = mkpp (x, coeffs, szy(1:end-1)); + pp = mkpp (x, cat (2, d'(:), c'(:), b'(:), a'(:)), szy(1:end-1)); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |