Mercurial > hg > octave-lojdl
changeset 6853:02106856b8f6
[project @ 2007-08-31 22:51:29 by dbateman]
author | dbateman |
---|---|
date | Fri, 31 Aug 2007 22:51:29 +0000 |
parents | a34d59fc7a91 |
children | 364765c17648 |
files | scripts/ChangeLog scripts/deprecated/Makefile.in scripts/deprecated/polyinteg.m scripts/polynomial/Makefile.in scripts/polynomial/polyint.m scripts/polynomial/polyinteg.m |
diffstat | 6 files changed, 113 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,13 @@ -2007-08-31 David Bateman <dbateman@free.fr> - +2007-09-01 David Bateman <dbateman@free.fr> + + * polynomial/polyint.m: New function like polyinteg but with + explicit integration constant. + * polynomial/polyinteg.m: Remove. + * polynomial/Makefile.in (SOURCES): Add polyint.m and remove + polyinteg.m. + * deprecated/polyinteg.m: Move version here. + * deprecated/Makefile.in (SOURCES): Add polyinteg.m. + * geometry/voronoi.m: Add large box around data to get a good approximation of the rays to infinity.
--- a/scripts/deprecated/Makefile.in +++ b/scripts/deprecated/Makefile.in @@ -34,7 +34,7 @@ lognormal_inv.m lognormal_pdf.m lognormal_rnd.m meshdom.m normal_cdf.m \ normal_inv.m normal_pdf.m normal_rnd.m pascal_cdf.m \ pascal_inv.m pascal_pdf.m pascal_rnd.m poisson_cdf.m \ - poisson_inv.m poisson_pdf.m poisson_rnd.m setstr.m \ + poisson_inv.m poisson_pdf.m poisson_rnd.m polyinteg.m setstr.m \ struct_contains.m struct_elements.m t_cdf.m t_inv.m t_pdf.m \ t_rnd.m uniform_cdf.m uniform_inv.m uniform_pdf.m uniform_rnd.m \ weibcdf.m weibinv.m weibpdf.m weibrnd.m weibull_cdf.m \
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/polyinteg.m @@ -0,0 +1,38 @@ +## Copyright (C) 1996, 1997 John W. Eaton +## +## This file is part of Octave. +## +## Octave 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, or (at your option) +## any later version. +## +## Octave 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 Octave; see the file COPYING. If not, write to the Free +## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +## 02110-1301, USA. + +## -*- texinfo -*- +## @deftypefn {Function File} {} polyinteg (@var{c}) +## Return the coefficients of the integral of the polynomial whose +## coefficients are represented by the vector @var{c}. +## +## The constant of integration is set to zero. +## @seealso{poly, polyderiv, polyreduce, roots, conv, deconv, residue, +## filter, polyval, and polyvalm} +## @end deftypefn + +## Author: Tony Richardson <arichard@stark.cc.oh.us> +## Created: June 1994 +## Adapted-By: jwe + +function y = polyinteg (p) + + y = polyint (p); + +endfunction
--- a/scripts/polynomial/Makefile.in +++ b/scripts/polynomial/Makefile.in @@ -21,7 +21,7 @@ INSTALL_DATA = @INSTALL_DATA@ SOURCES = compan.m conv.m deconv.m mkpp.m pchip.m poly.m \ - polyder.m polyderiv.m polyfit.m polygcd.m polyinteg.m \ + polyder.m polyderiv.m polyfit.m polygcd.m polyint.m \ polyout.m polyreduce.m polyval.m polyvalm.m ppval.m residue.m \ roots.m spline.m unmkpp.m
new file mode 100644 --- /dev/null +++ b/scripts/polynomial/polyint.m @@ -0,0 +1,63 @@ +## Copyright (C) 1996, 1997 John W. Eaton +## +## This file is part of Octave. +## +## Octave 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, or (at your option) +## any later version. +## +## Octave 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 Octave; see the file COPYING. If not, write to the Free +## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +## 02110-1301, USA. + +## -*- texinfo -*- +## @deftypefn {Function File} {} polyint (@var{c}, @var{k}) +## Return the coefficients of the integral of the polynomial whose +## coefficients are represented by the vector @var{c}. The variable +## @var{k} is the constant of integration, which by default is set to zero. +## @seealso{poly, polyderiv, polyreduce, roots, conv, deconv, residue, +## filter, polyval, and polyvalm} +## @end deftypefn + +## Author: Tony Richardson <arichard@stark.cc.oh.us> +## Created: June 1994 +## Adapted-By: jwe + +function p = polyint (p, k) + + if (nargin < 1 || nargin > 2) + print_usage (); + endif + + if (nargin == 1) + k = 0; + elseif (! isscalar (k)) + error ("polyint: the constant of integration must be a scalar"); + endif + + if (! (isvector (p) || isempty (p))) + error ("argument must be a vector"); + endif + + lp = length (p); + + if (lp == 0) + p = []; + return; + end + + if (rows (p) > 1) + ## Convert to column vector + p = p.'; + endif + + p = [(p ./ [lp:-1:1]), k]; + +endfunction
deleted file mode 100644 --- a/scripts/polynomial/polyinteg.m +++ /dev/null @@ -1,58 +0,0 @@ -## Copyright (C) 1996, 1997 John W. Eaton -## -## This file is part of Octave. -## -## Octave 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, or (at your option) -## any later version. -## -## Octave 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 Octave; see the file COPYING. If not, write to the Free -## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} polyinteg (@var{c}) -## Return the coefficients of the integral of the polynomial whose -## coefficients are represented by the vector @var{c}. -## -## The constant of integration is set to zero. -## @seealso{poly, polyderiv, polyreduce, roots, conv, deconv, residue, -## filter, polyval, and polyvalm} -## @end deftypefn - -## Author: Tony Richardson <arichard@stark.cc.oh.us> -## Created: June 1994 -## Adapted-By: jwe - -function p = polyinteg (p) - - if(nargin != 1) - print_usage (); - endif - - if (! (isvector (p) || isempty (p))) - error ("argument must be a vector"); - endif - - lp = length (p); - - if (lp == 0) - p = []; - return; - end - - if (rows (p) > 1) - ## Convert to column vector - p = p.'; - endif - - p = [ p, 0 ] ./ [ lp:-1:1, 1 ]; - -endfunction