From: <nir...@us...> - 2012-07-26 13:15:57
|
Revision: 10776 http://octave.svn.sourceforge.net/octave/?rev=10776&view=rev Author: nir-krakauer Date: 2012-07-26 13:15:46 +0000 (Thu, 26 Jul 2012) Log Message: ----------- suppressed warning about automatic broadcasting in csaps Modified Paths: -------------- trunk/octave-forge/main/splines/inst/csaps.m Modified: trunk/octave-forge/main/splines/inst/csaps.m =================================================================== --- trunk/octave-forge/main/splines/inst/csaps.m 2012-07-25 17:11:56 UTC (rev 10775) +++ trunk/octave-forge/main/splines/inst/csaps.m 2012-07-26 13:15:46 UTC (rev 10776) @@ -1,17 +1,17 @@ ## Copyright (C) 2012 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 the Free Software -## Foundation; either version 3 of the License, or (at your option) any later -## version. +## 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 +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. ## -## This program is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -## details. +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. ## -## You should have received a copy of the GNU General Public License along with -## this program; if not, see <http://www.gnu.org/licenses/>. +## You should have received a copy of the GNU General Public License +## along with this program; If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn{Function File}{[@var{yi} @var{p}] =} csaps(@var{x}, @var{y}, @var{p}, @var{xi}, @var{w}=[]) @@ -94,8 +94,14 @@ aa = bb = cc = dd = zeros (n+1, m); aa(2:end, :) = a; cc(3:n, :) = 6*p*u; #second derivative at endpoints is 0 [natural spline] + warn_state = warning ("query", "Octave:broadcast").state; + warning ("off", "Octave:broadcast"); #turn off warning message for automatic broadcasting + unwind_protect dd(2:n, :) = diff(cc(2:(n+1), :)) ./ h; bb(2:n, :) = diff(a) ./ h - (cc(2:n, :)/2).*h - (dd(2:n, :)/6).*(h.^2); + unwind_protect_cleanup + warning (warn_state, "Octave:broadcast"); + end_unwind_protect bb(1, :) = bb(2, :); #linear extension of splines bb(n + 1, :) = bb(n, :); aa(1, :) = a(1, :) - eps(x(1))*bb(1, :); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |