# HG changeset patch # User nir-krakauer # Date 1332783862 0 # Node ID 2da3952924f628bdf25037c4bc07bfc04c38f740 # Parent c81e7476fda35c5a8582790ce97cbc42f43aad0a 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 diff -r c81e7476fda3 -r 2da3952924f6 main/splines/inst/csape.m --- a/main/splines/inst/csape.m Mon Mar 26 10:32:49 2012 +0000 +++ b/main/splines/inst/csape.m Mon Mar 26 17:44:22 2012 +0000 @@ -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