This list is closed, nobody may subscribe to it.
2000 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(14) |
Nov
(10) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
(4) |
Mar
|
Apr
(3) |
May
(13) |
Jun
(2) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(5) |
Nov
(8) |
Dec
|
2002 |
Jan
|
Feb
|
Mar
(19) |
Apr
(8) |
May
(8) |
Jun
(8) |
Jul
(4) |
Aug
(8) |
Sep
(19) |
Oct
(13) |
Nov
(37) |
Dec
(2) |
2003 |
Jan
(7) |
Feb
(23) |
Mar
(16) |
Apr
(4) |
May
(18) |
Jun
(9) |
Jul
(7) |
Aug
(6) |
Sep
(7) |
Oct
|
Nov
(39) |
Dec
(57) |
2004 |
Jan
(21) |
Feb
(15) |
Mar
(17) |
Apr
(9) |
May
(17) |
Jun
(65) |
Jul
(33) |
Aug
(48) |
Sep
(93) |
Oct
(35) |
Nov
(18) |
Dec
(4) |
2005 |
Jan
(20) |
Feb
(59) |
Mar
(17) |
Apr
(59) |
May
(77) |
Jun
(32) |
Jul
(34) |
Aug
(8) |
Sep
(34) |
Oct
(26) |
Nov
(65) |
Dec
(66) |
2006 |
Jan
(45) |
Feb
(37) |
Mar
(50) |
Apr
(32) |
May
(48) |
Jun
(42) |
Jul
(12) |
Aug
(53) |
Sep
(51) |
Oct
(79) |
Nov
(46) |
Dec
(25) |
2007 |
Jan
(120) |
Feb
(78) |
Mar
(45) |
Apr
(91) |
May
(155) |
Jun
(66) |
Jul
(96) |
Aug
(110) |
Sep
(145) |
Oct
(189) |
Nov
(68) |
Dec
(160) |
2008 |
Jan
(163) |
Feb
(212) |
Mar
(209) |
Apr
(157) |
May
(216) |
Jun
(120) |
Jul
(80) |
Aug
(83) |
Sep
(98) |
Oct
(120) |
Nov
(80) |
Dec
(129) |
2009 |
Jan
(45) |
Feb
(80) |
Mar
(174) |
Apr
(142) |
May
(133) |
Jun
(191) |
Jul
(183) |
Aug
(138) |
Sep
(77) |
Oct
(141) |
Nov
(209) |
Dec
(131) |
2010 |
Jan
(85) |
Feb
(213) |
Mar
(245) |
Apr
(222) |
May
(168) |
Jun
(82) |
Jul
(50) |
Aug
(144) |
Sep
(92) |
Oct
(80) |
Nov
(64) |
Dec
(78) |
2011 |
Jan
(58) |
Feb
(98) |
Mar
(112) |
Apr
(98) |
May
(64) |
Jun
(150) |
Jul
(126) |
Aug
(59) |
Sep
(271) |
Oct
(154) |
Nov
(321) |
Dec
(183) |
2012 |
Jan
(146) |
Feb
(217) |
Mar
(426) |
Apr
(208) |
May
(206) |
Jun
(230) |
Jul
(158) |
Aug
(170) |
Sep
(237) |
Oct
(260) |
Nov
(178) |
Dec
|
From: Paul K. <pki...@us...> - 2005-11-14 01:25:02
|
On Nov 13, 2005, at 8:00 AM, Dr.-Ing. Torsten Finke wrote: > Hello Octave-Forge developers, > > may I suggest a little improvement to the function polyarea which > calculates the > area a of a given polygon with vertices (x, y). > > Now it is calculated as (line 47 of polyarea.m): > > a = abs ( sum (x .* shift (y,-1)) - sum (y .* shift (x, -1)) ) / 2; > > Since > > sum (y .* shift (x, -1)) == sum (shift(y, 1) .* x) > > one can reduce the amount of summation and multiplication to just the > half: > > a = abs (sum (x .* (shift (y, 1) - shift (y, -1))) / 2); Applied. Thanks, - Paul > |
From: Dr.-Ing. T. F. <fi...@ig...> - 2005-11-13 13:00:45
|
Hello Octave-Forge developers, may I suggest a little improvement to the function polyarea which calculates the area a of a given polygon with vertices (x, y). Now it is calculated as (line 47 of polyarea.m): a = abs ( sum (x .* shift (y,-1)) - sum (y .* shift (x, -1)) ) / 2; Since sum (y .* shift (x, -1)) == sum (shift(y, 1) .* x) one can reduce the amount of summation and multiplication to just the half: a = abs (sum (x .* (shift (y, 1) - shift (y, -1))) / 2); Thank You and best regards Torsten Finke -- ------------------------------------------------------------------------ Dr.-Ing. Torsten Finke Ingenieurgemeinschaft IgH Heinz-Baecker-Str. 34 D-45356 Essen Tel.: +49 201 / 360-14-17 Fax.: +49 201 / 360-14-14 E-mail: tor...@ig... ------------------------------------------------------------------------ |
From: Paul K. <pki...@us...> - 2005-11-13 05:02:15
|
On Nov 12, 2005, at 11:34 PM, William Poetra Yoga H wrote: > Btw, is my usage of @sc{} appropriate? > Also, can I replace usage(...) above with this? > > help("isunix"); > error(""); No. This forces output to the terminal even if you are in an environment such as try ... catch or eval(code,catch). - Paul |
From: William P. Y. H <wil...@ya...> - 2005-11-13 04:42:08
|
Sorry, I didn't check in Octave cvs first. Please disregard previous message. William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: William P. Y. H <wil...@ya...> - 2005-11-13 04:34:50
|
I think isunix.m can be implemented this way: ## -*- texinfo -*- ## @deftypefn {Function File} {} isunix () ## Return @sc{true} if Octave is running in a Unix environment. ## @end deftypefn ## ## @seealso{ispc, isstudent, octave_config_info} function retval = isunix() if (nargin > 0) usage("isunix ()"); endif retval = octave_config_info("unix"); endfunction Note the usage of "in a Unix environment": it also returns true if we are running on Cygwin. Btw, is my usage of @sc{} appropriate? Also, can I replace usage(...) above with this? help("isunix"); error(""); William Poetra Yoga Hadisoeseno __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs |
From: William P. Y. H <wil...@ya...> - 2005-11-12 08:12:17
|
Likewise, use true/false (actually only documentation changes): ---------- _isequal.m ---------- ## Copyright (C) 2000 Paul Kienzle ## ## 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. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} _isequal (@var{_nan}, @var{x1}, @var{x2}, ...) ## Return true if @var{x1}, @var{x2}, ... are all equal and @var{_nan} is 0 or false. ## ## If @var{_nan} is nonzero or true, then assume NaN == NaN. ## @end deftypefn ## ## @seealso{isequal, isequalwithequalnans} ## Modified by William Poetra Yoga Hadisoeseno function t = _isequal(_nan,x,varargin) if nargin < 3 usage("_isequal(_nan, x1, x2, ...)"); endif l_v = nargin - 2; if isstruct(x) n_x = length(fieldnames(x)); t = true; for argn = 1:l_v y = varargin{argn}; t = t && isstruct(y) && (n_x == length(fieldnames(y))); endfor if !t, return; endif for argn = 1:l_v y = varargin{argn}; for [v,k] = x t = t && struct_contains(y,k) && _isequal(_nan,v,getfield(y,k)); endfor if !t, return; endif endfor elseif iscell(x) || islist(x) x = x(:); l_x = length(x); t = true; for argn = 1:l_v y = varargin{argn}(:); t = t && (iscell(y) || islist(y)) && (l_x == length(y)); endfor if !t, return; endif for argn = 1:l_v y = varargin{argn}(:); for p = 1:l_x t = t && _isequal(_nan,x{p},y{p}); endfor if !t, return; endif endfor elseif ischar(x) l_x = length(x); t = true; for argn = 1:l_v y = varargin{argn}; t = t && ischar(y) && (l_x == length(y)); endfor if !t, return; endif for argn = 1:l_v t = t && strcmp(x,varargin{argn}); endfor else s_x = size(x); t = true; for argn = 1:l_v t = t && (s_x == size(varargin{argn})); endfor if !t, return; endif if issparse(x) f_x = spfind(x); else f_x = find(x); endif l_f_x = length(f_x); x = x(f_x); for argn = 1:l_v y = varargin{argn}; if issparse(y) f_y = spfind(y); else f_y = find(y); endif t = (l_f_x == length(f_y)) && all(f_x == f_y); if !t, return; endif y = y(f_y); m = x == y; t = all(m); if !t if _nan f_nm = find(!m); t = isnan(x(f_nm)) && isnan(y(f_nm)); else return endif endif endfor endif endfunction --------- isequal.m --------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isequal (@var{x1}, @var{x2}, ...) ## Return true if all of @var{x1}, @var{x2}, ... are equal. ## @end deftypefn ## ## @seealso{isequalwithequalnans} function retval = isequal(x,varargin) if (nargin < 2) usage("isequal (x1, x2, ...)"); end retval = _isequal(0,x,varargin{:}); endfunction ---------------------- isequalwithequalnans.m ---------------------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isequalwithequalnans (@var{x1}, @var{x2}, ...) ## Assuming NaN == NaN, return true if all of @var{x1}, @var{x2}, ... are equal. ## @end deftypefn ## ## @seealso{isequal} function retval = isequalwithequalnans(x,varargin) if (nargin < 2) usage("isequalwithequalnans (x1, x2, ...)"); end retval = _isequal(1,x,varargin{:}); endfunction William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: William P. Y. H <wil...@ya...> - 2005-11-12 07:57:14
|
Well, I found that I should return true/false and not 1/0... sorry... --------- isfloat.m --------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isfloat (@var{A}) ## Return true if @var{A} is a floating point array. Otherwise, return false. ## @end deftypefn ## ## @seealso{isa, isinteger, isnumeric} function retval = isfloat(A) if (nargin != 1) usage("isfloat (A)"); end # Octave doesn't have a single-precision floating point data type switch class(A) case "double" retval = true; otherwise retval = false; endswitch endfunction ----------- isinteger.m ----------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isinteger (@var{A}) ## Return true if @var{A} is an integer array. Otherwise, return false. ## @end deftypefn ## ## @seealso{isa, isnumeric, isfloat} function retval = isinteger(A) if (nargin != 1) usage("isinteger (A)"); end switch class(A) case "int8" retval = true; case "int16" retval = true; case "int32" retval = true; case "int64" retval = true; case "uint8" retval = true; case "uint16" retval = true; case "uint32" retval = true; case "uint64" retval = true; otherwise retval = false; endswitch endfunction ---------- issorted.m ---------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} issorted (@var{A}, ["rows"]) ## Return true if @var{A} is equal to sort(@var{A}). Otherwise, return false. ## If "rows" is specified, return true if @var{A} is equal to sortrows(@var{A}). ## @end deftypefn ## ## @seealso{sort, sortrows} function retval = issorted(A,r) if (nargin == 1) retval = isequal(A,sort(A)); elseif ((nargin == 2) && strcmp(r,"rows")) retval = isequal(A,sortrows(A)); else usage("issorted (A, [\"rows\"])"); endif endfunction ----------- isstudent.m ----------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isstudent ## Always returns false, because when you accept Octave's License Agreement ## you always get all the features of Octave and not a stripped-down ## "student" version. ## @end deftypefn ## ## @seealso{ispc, isunix} function retval = isstudent if (nargin != 0) usage("isstudent"); end retval = false; endfunction William Poetra Yoga Hadisoeseno __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com |
From: William P. Y. H <wil...@ya...> - 2005-11-12 07:25:48
|
I got another idea (basically the same as the previous one, but simpler): function retval = isvector (x) retval = 0; if !ismatrix(x), return; endif s_x = size(x); if any(s_x < 1), return; endif if ((s_x == 1) || (length(find(s_x-1)) == 1)) retval = 1; endif endfunction P.S.: Sorry, I didn't mean to flood the list with this kind of topics... William Poetra Yoga Hadisoeseno __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com |
From: William P. Y. H <wil...@ya...> - 2005-11-12 07:11:05
|
I saw this here: http://www.octave.org/octave-lists/archive/bug-octave.2005/msg00730.html > I wrote it like this: > > if (nargin == 1) > retval = (ismatrix (x) && ! isempty (x) && prod (size (x)) == length (x)); > else > usage ("isvector (x)"); > endif > > Thanks, > > jwe But wouldn't prod(size(x)) overflow? Would this be better: function retval = isvector (x) if (nargin != 1) usage("isvector (x)"); endif retval = 0; if ismatrix(x) s_x = size(x); if (s_x > 0) f_sx1 = find(s_x-1); if (isempty(f_sx1) || (length(f_sx1) == 1)) retval = 1; endif endif endif endfunction William Poetra Yoga Hadisoeseno __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs |
From: William P. Y. H <wil...@ya...> - 2005-11-12 06:42:13
|
I've modified isequal.m and renamed it _isequal.m, and then wrote isequal.m and isequalwithequalnans.m to call _isequal.m. It passed simple tests, but I think it needs to be tested with more complex cases. Any volunteers? Oh, and there's a small problem: - isequalwithequalnans(1+nan*i,1-nan*i) returns 1, and - isequalwithequalnans(1+nan*i,1+nan*i) returns 1, too. Shouldn't the former return 0? (considering 1+nan*i => NaN - NaNi and 1-nan*i => NaN + NaNi) ---------- _isequal.m ---------- ## Copyright (C) 2000 Paul Kienzle ## ## 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. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} _isequal (@var{_nan}, @var{x1}, @var{x2}, ...) ## Return 1 if @var{x1}, @var{x2}, ... are all equal and @var{_nan} is 0. ## ## If @var{_nan} is nonzero, then NaN == NaN. ## @end deftypefn ## ## @seealso{isequal, isequalwithequalnans} ## Modified by William Poetra Yoga Hadisoeseno function t = _isequal(_nan,x,varargin) if nargin < 3 usage("_isequal(_nan, x1, x2, ...)"); endif l_v = nargin - 2; if isstruct(x) n_x = length(fieldnames(x)); t = 1; for argn = 1:l_v y = varargin{argn}; t = t && isstruct(y) && (n_x == length(fieldnames(y))); endfor if !t, return; endif for argn = 1:l_v y = varargin{argn}; for [v,k] = x t = t && struct_contains(y,k) && _isequal(_nan,v,getfield(y,k)); endfor if !t, return; endif endfor elseif iscell(x) || islist(x) x = x(:); l_x = length(x); t = 1; for argn = 1:l_v y = varargin{argn}(:); t = t && (iscell(y) || islist(y)) && (l_x == length(y)); endfor if !t, return; endif for argn = 1:l_v y = varargin{argn}(:); for p = 1:l_x t = t && _isequal(_nan,x{p},y{p}); endfor if !t, return; endif endfor elseif ischar(x) l_x = length(x); t = 1; for argn = 1:l_v y = varargin{argn}; t = t && ischar(y) && (l_x == length(y)); endfor if !t, return; endif for argn = 1:l_v t = t && strcmp(x,varargin{argn}); endfor else s_x = size(x); t = 1; for argn = 1:l_v t = t && (s_x == size(varargin{argn})); endfor if !t, return; endif if issparse(x) f_x = spfind(x); else f_x = find(x); endif l_f_x = length(f_x); x = x(f_x); for argn = 1:l_v y = varargin{argn}; if issparse(y) f_y = spfind(y); else f_y = find(y); endif t = (l_f_x == length(f_y)) && all(f_x == f_y); if !t, return; endif y = y(f_y); m = x == y; t = all(m); if !t if _nan f_nm = find(!m); t = isnan(x(f_nm)) && isnan(y(f_nm)); else return endif endif endfor endif endfunction --------- isequal.m --------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isequal (@var{x1}, @var{x2}, ...) ## Return 1 if all of @var{x1}, @var{x2}, ... are equal. ## @end deftypefn ## ## @seealso{isequalwithequalnans} function retval = isequal(x,varargin) if (nargin < 2) usage("isequal (x1, x2, ...)"); end retval = _isequal(0,x,varargin{:}); endfunction ---------------------- isequalwithequalnans.m ---------------------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isequalwithequalnans (@var{x1}, @var{x2}, ...) ## Assuming NaN == NaN, return 1 if all of @var{x1}, @var{x2}, ... are equal. ## @end deftypefn ## ## @seealso{isequal} function retval = isequalwithequalnans(x,varargin) if (nargin < 2) usage("isequalwithequalnans (x1, x2, ...)"); end retval = _isequal(1,x,varargin{:}); endfunction William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: William P. Y. H <wil...@ya...> - 2005-11-12 05:48:42
|
I think I shouldn't keep you busy with the files, so here they are: --------- isfloat.m --------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isfloat (@var{A}) ## Return 1 if @var{A} is a floating point array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isinteger, isnumeric} function retval = isfloat(A) if (nargin != 1) usage("isfloat (A)"); end # Octave doesn't have a single-precision floating point data type switch class(A) case "double" retval = 1; otherwise retval = 0; endswitch endfunction ----------- isinteger.m ----------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isinteger (@var{A}) ## Return 1 if @var{A} is an integer array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isnumeric, isfloat} function retval = isinteger(A) if (nargin != 1) usage("isinteger (A)"); end switch class(A) case "int8" retval = 1; case "int16" retval = 1; case "int32" retval = 1; case "int64" retval = 1; case "uint8" retval = 1; case "uint16" retval = 1; case "uint32" retval = 1; case "uint64" retval = 1; otherwise retval = 0; endswitch endfunction ---------- issorted.m ---------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} issorted (@var{A}, ["rows"]) ## Return 1 if @var{A} is equal to sort(@var{A}), otherwise return 0. ## If "rows" is specified, return 1 if @var{A} is equal to sortrows(@var{A}). ## @end deftypefn ## ## @seealso{sort, sortrows} function retval = issorted(A,r) switch nargin case 1 retval = isequal(A,sort(A)); case 2 if strcmp(r,"rows") retval = isequal(A,sortrows(A)); else usage("issorted (A, [\"rows\"])"); endif otherwise usage("issorted (A, [\"rows\"])"); endswitch endfunction ----------- isstudent.m ----------- ## Copyright (C) 2005 William Poetra Yoga Hadisoeseno ## ## 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 of the License, 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; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} isstudent ## Always returns 0, because when you accept Octave's License Agreement ## you always get all the features of Octave and not a stripped-down ## "student" version. ## @end deftypefn ## ## @seealso{ispc, isunix} function retval = isstudent if (nargin != 0) usage("isstudent"); end retval = 0; endfunction P.S.: It's almost final because I haven't determined the exact behaviour of issorted() yet. William Poetra Yoga Hadisoeseno __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs |
From: William P. Y. H <wil...@ya...> - 2005-11-11 18:28:09
|
--- "John W. Eaton" <jw...@be...> wrote: > On 11-Nov-2005, Paul Kienzle wrote: > > | Let me know which of these you want in octave and I will put the rest > | in octave-forge. > > Are all of them present in "core" Matlab? If so, then I would use all > of them. Did you write all of them? Is it OK to use the usual Octave > copyright notice for them (with your name in the copyright)? > I think so. I don't have access to it, but I downloaded the pdf manuals (you know, the function reference), and they're all there. I did, and I think it's OK to use that copyright. But I think my formatting is a bit different from other Octave functions, can you please change them for me? I mean, I didn't use endfunction (please add) and I started every line at column 1 (please add 2 spaces). > I might want to make isinteger and isfloat built-in functions, but > these versions are probably OK for now. > It would be more efficient then. But for issorted(), I'm not sure for the behaviour if we supply something other than "rows" as the second argument. Should it exit with an error? Should it silently return 0? Or should it ignore the option at all? William Poetra Yoga Hadisoeseno __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com |
From: John W. E. <jw...@be...> - 2005-11-11 15:22:14
|
On 11-Nov-2005, Paul Kienzle wrote: | Let me know which of these you want in octave and I will put the rest | in octave-forge. Are all of them present in "core" Matlab? If so, then I would use all of them. Did you write all of them? Is it OK to use the usual Octave copyright notice for them (with your name in the copyright)? I might want to make isinteger and isfloat built-in functions, but these versions are probably OK for now. Thanks, jwe |
From: Paul K. <pki...@us...> - 2005-11-11 15:13:53
|
John, Let me know which of these you want in octave and I will put the rest in octave-forge. - Paul On Nov 11, 2005, at 7:08 AM, William Poetra Yoga H wrote: > --- Quentin Spencer <qsp...@ie...> wrote: >> >> If we're aiming for compatibility with the Matlab functions isinteger >> and isfloat, we should look at what they do: >>>> isinteger(1) >> ans = >> 0 >> >>>> isinteger(int8(1)) >> ans = >> 1 >> >> So, the outputs of these functions are based not on whether the >> contents >> of the array happen to be integers, which can happen with a double >> array, but on whether they are _stored_ as integers. In addition to >> the >> compatibility issue, checking all elements of an array to see if they >> are an integer could be much slower with a large array than just >> checking the array type. Given this, it would seem that the correct >> implementation of isinteger would involve parsing the output of the >> typeinfo function. isfloat.m: function retval = isfloat(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isfloat (@var{A}) ## Return 1 if @var{A} is a floating point array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isinteger, isnumeric} if (nargin ~= 1) usage("isfloat (A)"); end # Octave doesn't have a single-precision floating point data type switch (class(A)) case "double" retval = 1; otherwise retval = 0; endswitch isinteger.m: function retval = isinteger(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isinteger (@var{A}) ## Return 1 if @var{A} is an integer array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isnumeric, isfloat} if (nargin ~= 1) usage("isinteger (A)"); end switch class(A) case "int8" retval = 1; case "int16" retval = 1; case "int32" retval = 1; case "int64" retval = 1; case "uint8" retval = 1; case "uint16" retval = 1; case "uint32" retval = 1; case "uint64" retval = 1; otherwise retval = 0; endswitch issorted.m: function retval = issorted(A,r) ## -*- texinfo -*- ## @deftypefn {Function File} {} issorted (@var{A}, ["rows"]) ## Return 1 if @var{A} is equal to sort(@var{A}), otherwise return 0. ## If "rows" is specified, return 1 if @var{A} is equal to sortrows(@var{A}). ## @end deftypefn ## ## @seealso{sort, sortrows} switch nargin case 1 retval = isequal(A,sort(A)); case 2 if strcmp(r,"rows") retval = isequal(A,sortrows(A)); else usage("issorted (A, [\"rows\"])"); endif otherwise usage("issorted (A, [\"rows\"])"); endswitch isstudent.m: function retval = isstudent ## -*- texinfo -*- ## @deftypefn {Function File} {} isstudent ## Always returns 0, because when you accept Octave's License Agreement ## you always get all the features of Octave and not a stripped-down ## "student" version. ## @end deftypefn ## ## @seealso{ispc, isunix} if (nargin ~= 0) usage("isstudent"); end retval = 0; |
From: William P. Y. H <wil...@ya...> - 2005-11-11 12:08:19
|
--- Quentin Spencer <qsp...@ie...> wrote: > > If we're aiming for compatibility with the Matlab functions isinteger > and isfloat, we should look at what they do: > >> isinteger(1) > ans = > 0 > > >> isinteger(int8(1)) > ans = > 1 > > So, the outputs of these functions are based not on whether the contents > of the array happen to be integers, which can happen with a double > array, but on whether they are _stored_ as integers. In addition to the > compatibility issue, checking all elements of an array to see if they > are an integer could be much slower with a large array than just > checking the array type. Given this, it would seem that the correct > implementation of isinteger would involve parsing the output of the > typeinfo function. > > -Quentin > Yeah, sorry, I don't have access to a legal copy of Matlab, so... OK, then this should be correct, right? isfloat.m: function retval = isfloat(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isfloat (@var{A}) ## Return 1 if @var{A} is a floating point array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isinteger, isnumeric} if (nargin ~= 1) usage("isfloat (A)"); end # Octave doesn't have a single-precision floating point data type switch (class(A)) case "double" retval = 1; otherwise retval = 0; endswitch isinteger.m: function retval = isinteger(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isinteger (@var{A}) ## Return 1 if @var{A} is an integer array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isnumeric, isfloat} if (nargin ~= 1) usage("isinteger (A)"); end switch class(A) case "int8" retval = 1; case "int16" retval = 1; case "int32" retval = 1; case "int64" retval = 1; case "uint8" retval = 1; case "uint16" retval = 1; case "uint32" retval = 1; case "uint64" retval = 1; otherwise retval = 0; endswitch issorted.m: function retval = issorted(A,r) ## -*- texinfo -*- ## @deftypefn {Function File} {} issorted (@var{A}, ["rows"]) ## Return 1 if @var{A} is equal to sort(@var{A}), otherwise return 0. ## If "rows" is specified, return 1 if @var{A} is equal to sortrows(@var{A}). ## @end deftypefn ## ## @seealso{sort, sortrows} switch nargin case 1 retval = isequal(A,sort(A)); case 2 if strcmp(r,"rows") retval = isequal(A,sortrows(A)); else usage("issorted (A, [\"rows\"])"); endif otherwise usage("issorted (A, [\"rows\"])"); endswitch isstudent.m: function retval = isstudent ## -*- texinfo -*- ## @deftypefn {Function File} {} isstudent ## Always returns 0, because when you accept Octave's License Agreement ## you always get all the features of Octave and not a stripped-down ## "student" version. ## @end deftypefn ## ## @seealso{ispc, isunix} if (nargin ~= 0) usage("isstudent"); end retval = 0; P.S.: I got excited and wrote those functions too... William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: Paul K. <pki...@us...> - 2005-11-08 04:18:56
|
This might be because you are remaking from CVS rather than from a=20 release package. John prebuilds some files before creating a release=20 so that users don't need all the tools that he uses. - Paul On Nov 3, 2005, at 1:30 AM, Jorge Barros de Abreu wrote: > I remake the src/DOCSTRINGS and put the results in: > > http://usr.solar.com.br/~ficmatin/DOCSTRINGS_SRC > http://usr.solar.com.br/~ficmatin/DOCSTRINGS_SRC_BAD > > Em Thursday 03 November 2005 02:57, Paul Kienzle escreveu: >> Are you sure? I rebuilt DOCSTRINGS without using omit_deps and I get >> the same result: > > --=20 > Data Estelar 2453677.885567 > http://www.solar.com.br/~ficmatin > Desejo-lhe Paz, Vida Longa e Prosperidade. > S=E3o Bem Vindas Mensagens no Formato Texto Gen=E9rico com Acentos. > > |
From: Quentin S. <qsp...@ie...> - 2005-11-07 17:45:17
|
William Poetra Yoga H wrote: >--- Andy Adler <ad...@nc...> wrote: > > >>Are you happy with the way this function will handle large >>exponents where the interger part is lost? For example >> >>octave:6> isinteger(1e10/3) >>ans = 0 >>octave:7> isinteger(1e20/3) >>ans = 1 >> >>Andy >> >> >> > >Well... I'm not. But I can't think of a better way... >Btw, actually 1e20/3 should be treated as an integer anyway (or a floating >point with zero behind the decimal point) because Octave can't handle it. I >meant to use this function to check for integer count arguments passed to >functions, and I think most people would do the same thing, so... > >In the meantime, I've modified it a bit (thanks Paul): > >function retval = isinteger(A) >## -*- texinfo -*- >## @deftypefn {Function File} {} isinteger (@var{A}) >## Return 1 if @var{A} is an integer array. Otherwise, return 0. >## @end deftypefn >## >## @seealso{isa, isnumeric, isfloat} > >if (nargin ~= 1) > usage("isinteger(A)"); >end > >retval = ismatrix(A) && all((round(A) == A)(:)); > >And now I also have an isfloat function: > >function retval = isfloat(A) >## -*- texinfo -*- >## @deftypefn {Function File} {} isfloat (@var{A}) >## Return 1 if @var{A} is a floating point array. Otherwise, return 0. >## @end deftypefn >## >## @seealso{isa, isinteger, isnumeric} > >if (nargin ~= 1) > usage("isfloat(A)"); >end > >retval = ismatrix(A) && ~all((round(A) == A)(:)); > > > > If we're aiming for compatibility with the Matlab functions isinteger and isfloat, we should look at what they do: >> isinteger(1) ans = 0 >> isinteger(int8(1)) ans = 1 So, the outputs of these functions are based not on whether the contents of the array happen to be integers, which can happen with a double array, but on whether they are _stored_ as integers. In addition to the compatibility issue, checking all elements of an array to see if they are an integer could be much slower with a large array than just checking the array type. Given this, it would seem that the correct implementation of isinteger would involve parsing the output of the typeinfo function. -Quentin |
From: William P. Y. H <wil...@ya...> - 2005-11-07 17:27:12
|
--- Andy Adler <ad...@nc...> wrote: > > Are you happy with the way this function will handle large > exponents where the interger part is lost? For example > > octave:6> isinteger(1e10/3) > ans = 0 > octave:7> isinteger(1e20/3) > ans = 1 > > Andy > Well... I'm not. But I can't think of a better way... Btw, actually 1e20/3 should be treated as an integer anyway (or a floating point with zero behind the decimal point) because Octave can't handle it. I meant to use this function to check for integer count arguments passed to functions, and I think most people would do the same thing, so... In the meantime, I've modified it a bit (thanks Paul): function retval = isinteger(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isinteger (@var{A}) ## Return 1 if @var{A} is an integer array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isnumeric, isfloat} if (nargin ~= 1) usage("isinteger(A)"); end retval = ismatrix(A) && all((round(A) == A)(:)); And now I also have an isfloat function: function retval = isfloat(A) ## -*- texinfo -*- ## @deftypefn {Function File} {} isfloat (@var{A}) ## Return 1 if @var{A} is a floating point array. Otherwise, return 0. ## @end deftypefn ## ## @seealso{isa, isinteger, isnumeric} if (nargin ~= 1) usage("isfloat(A)"); end retval = ismatrix(A) && ~all((round(A) == A)(:)); William Poetra Yoga Hadisoeseno __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs |
From: William P. Y. H <wil...@ya...> - 2005-11-07 17:17:53
|
--- Pedro Antonio Fructuoso Merino <pfr...@fa...> wrote: > Hi all, > Suport octave rescursive function? In this case, how can I implement > it? I'm trying something like that: > function res = test(a) > if (a>0) > j = test(a) > res = a + j, > else > res = 0; > endif > endfunction > but it's fauls... > Pedro > I think there's a bug in your function: if a is positive, then the function "test" will get called again and again until you reach max_recursion_depth, which is 256 by default. William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
From: Pedro A. F. M. <pfr...@fa...> - 2005-11-07 11:23:59
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Thomas Weber escribió: <blockquote cite="mid1131355902.22156.5.camel@localhost.localdomain" type="cite"> <pre wrap=""><!---->Please post a working example of your code (that is, a stripped down example of the failing code). Otherwise it's just guessing. </pre> </blockquote> I posted my code in last mail... the code was:<br> function res = test(a) <br> if (a>0) <br> j = test(a) <br> res = a + j, <br> else <br> res = 0; <br> endif <br> endfunction <br> upssss.... line 4 "j = test(a)" must be "j = test(a-1)"... it was the error of my code... :-* sorry and thanks for all.<br> Regards,<br> Pedro<br> </body> </html> |
From: Thomas W. <we...@nu...> - 2005-11-07 10:53:14
|
Hi, Am Montag, den 07.11.2005, 09:48 +0100 schrieb Pedro Antonio Fructuoso Merino: > Hi all, > Suport octave rescursive function? Yes. > In this case, how can I implement it? http://www.octave.org/doc/Recursion.html#Recursion > but it's fauls... Please post a working example of your code (that is, a stripped down example of the failing code). Otherwise it's just guessing. Regards Thomas |
From: Pedro A. F. M. <pfr...@fa...> - 2005-11-07 08:48:17
|
Hi all, Suport octave rescursive function? In this case, how can I implement it? I'm trying something like that: function res = test(a) if (a>0) j = test(a) res = a + j, else res = 0; endif endfunction but it's fauls... Pedro |
From: Andy A. <ad...@nc...> - 2005-11-06 23:15:56
|
On 11/6/05, William Poetra Yoga H <wil...@ya...> wrote: > Hi, I'm new here, and I have a question: can we implement isinteger this = way? > > function retval=3Disinteger(A) > > if ismatrix(A) && (round(A) =3D=3D A) > retval=3D1; > else > retval=3D0; > end Are you happy with the way this function will handle large exponents where the interger part is lost? For example octave:6> isinteger(1e10/3) ans =3D 0 octave:7> isinteger(1e20/3) ans =3D 1 Andy |
From: Paul K. <pki...@us...> - 2005-11-06 17:00:41
|
Or even function retval = isinteger(A) retval = ismatrix(A) && (round(A) == A); - Paul On Nov 6, 2005, at 10:00 AM, William Poetra Yoga H wrote: > Hi, I'm new here, and I have a question: can we implement isinteger > this way? > > function retval=isinteger(A) > > if ismatrix(A) && (round(A) == A) > retval=1; > else > retval=0; > end > > > William Poetra Yoga Hadisoeseno > > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev > |
From: William P. Y. H <wil...@ya...> - 2005-11-06 15:01:07
|
Hi, I'm new here, and I have a question: can we implement isinteger this way? function retval=isinteger(A) if ismatrix(A) && (round(A) == A) retval=1; else retval=0; end William Poetra Yoga Hadisoeseno __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |