From: <cde...@us...> - 2010-11-23 17:34:11
|
Revision: 7941 http://octave.svn.sourceforge.net/octave/?rev=7941&view=rev Author: cdemills Date: 2010-11-23 17:34:03 +0000 (Tue, 23 Nov 2010) Log Message: ----------- A new bunch of mapping functions added Modified Paths: -------------- trunk/octave-forge/extra/dataframe/inst/@dataframe/size.m trunk/octave-forge/extra/dataframe/inst/@dataframe/sum.m trunk/octave-forge/extra/dataframe/inst/@dataframe/sumsq.m Added Paths: ----------- trunk/octave-forge/extra/dataframe/inst/@dataframe/and.m trunk/octave-forge/extra/dataframe/inst/@dataframe/cumprod.m trunk/octave-forge/extra/dataframe/inst/@dataframe/cumsum.m trunk/octave-forge/extra/dataframe/inst/@dataframe/eq.m trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m~ trunk/octave-forge/extra/dataframe/inst/@dataframe/ge.m trunk/octave-forge/extra/dataframe/inst/@dataframe/gt.m trunk/octave-forge/extra/dataframe/inst/@dataframe/horzcat.m trunk/octave-forge/extra/dataframe/inst/@dataframe/ipermute.m trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m~ trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m~ trunk/octave-forge/extra/dataframe/inst/@dataframe/max.m trunk/octave-forge/extra/dataframe/inst/@dataframe/min.m trunk/octave-forge/extra/dataframe/inst/@dataframe/ne.m trunk/octave-forge/extra/dataframe/inst/@dataframe/not.m trunk/octave-forge/extra/dataframe/inst/@dataframe/or.m trunk/octave-forge/extra/dataframe/inst/@dataframe/permute.m trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_func.m trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_mapper2.m trunk/octave-forge/extra/dataframe/inst/@dataframe/prod.m trunk/octave-forge/extra/dataframe/inst/@dataframe/vertcat.m trunk/octave-forge/extra/dataframe/inst/@dataframe/xor.m Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/and.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/and.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/and.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = and(A, B); + + %# function resu = and(A, B) + %# Implements the '&' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@and, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/and.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/cumprod.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/cumprod.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/cumprod.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = cumprod(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper(@cumprod, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/cumprod.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/cumsum.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/cumsum.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/cumsum.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = cumsum(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper(@cumsum, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/cumsum.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/eq.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/eq.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/eq.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = eq(A, B); + + %# function resu = eq(A, B) + %# Implements the '==' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@eq, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/eq.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,58 @@ +function varargout = find(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + switch nargout + case {0, 1} + nz = 0; resu = []; + for indi = 1:df._cnt(2), + resu = [resu; nz + feval(@find, df._data{indi})]; + nz = nz + prod(size(df._data{indi})); + endfor + varargout{1} = resu; + case 2 + nz = 0; idx_i = []; idx_j = []; + for indi = 1:df._cnt(2), + [dum1, dum2] = feval(@find, df._data{indi}); + idx_i = [idx_i; dum1]; + idx_j = [idx_j; nz + dum2]; + nz = nz + size(df._data{indi}, 2); + endfor + varargout{1} = idx_i; varargout{2} = idx_j; + case 3 + nz = 0; idx_i = []; idx_j = []; val = []; + for indi = 1:df._cnt(2), + [dum1, dum2, dum3] = feval(@find, df._data{indi}); + idx_i = [idx_i; dum1]; + idx_j = [idx_j; nz + dum2]; + val = [val; dum3]; + nz = nz + size(df._data{indi}, 2); + endfor + varargout{1} = idx_i; varargout{2} = idx_j; varargout{3} = val; + otherwise + print_usage('find'); + endswitch + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m~ =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m~ (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/find.m~ 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function varargout = find(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id: sin.m 7940 2010-11-23 10:51:03Z cdemills $ + %# + + resu = df_mapper(@find, df, varargin{:}); + +endfunction Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/ge.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/ge.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/ge.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = ge(A, B); + + %# function resu = ge(A, B) + %# Implements the '>=' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@ge, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/ge.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/gt.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/gt.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/gt.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = gt(A, B); + + %# function resu = gt(A, B) + %# Implements the '>' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@gt, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/gt.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/horzcat.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/horzcat.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/horzcat.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = horzcat(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cat(1, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/horzcat.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/ipermute.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/ipermute.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/ipermute.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = ipermute(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper2(@ipermute, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/ipermute.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = le(A, B); + + %# function resu = le(A, B) + %# Implements the '<=' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@le, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m~ =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m~ (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/le.m~ 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = eq(A, B); + + %# function resu = eq(A, B) + %# Implements the '==' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id: minus.m 7892 2010-10-29 07:14:29Z cdemills $ + %# + + resu = cell2mat(df_func(@eq, A, B)); + +endfunction Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = lt(A, B); + + %# function resu = minus(A, B) + %# Implements the '<' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@lt, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m~ =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m~ (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/lt.m~ 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,59 @@ +function resu = lt(A, B); + + %# function resu = minus(A, B) + %# Implements the '<' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id: minus.m 7892 2010-10-29 07:14:29Z cdemills $ + %# + + [A, B] = df_basecomp(A, B); + + if isa(B, 'dataframe') + if !isa(A, 'dataframe'), + if isscalar(A) + resu = cellfun(@(x) lt(A, x), B._data, "UniformOutput", false); + elseif ismatrix(A), + resu = cellfun(@(x, y) lt(x, y), num2cell(A, 1), B._data, \ + "UniformOutput", false); + else + error("Operator < not implemented"); + endif + else + resu = cellfun(@(x, y) lt(x, y), A._data, B._data, \ + "UniformOutput", false); + endif + else + if isscalar(B), + resu = cellfun(@(x) lt(x, B), A._data, "UniformOutput", false); + elseif ismatrix(B), + resu = cellfun(@(x, y) lt(x, y), A._data, num2cell(B, 1), \ + "UniformOutput", false); + else + error("Operator < not implemented"); + endif + endif + + resu = cell2mat(resu); + +endfunction Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/max.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/max.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/max.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = max(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper2(@max, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/max.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/min.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/min.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/min.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = min(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper2(@min, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/min.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/ne.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/ne.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/ne.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = ne(A, B); + + %# function resu = ne(A, B) + %# Implements the '!=' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@ne, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/ne.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/not.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/not.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/not.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = not(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper(@not, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/not.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/or.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/or.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/or.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = or(A, B); + + %# function resu = or(A, B) + %# Implements the '|' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@or, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/or.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/permute.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/permute.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/permute.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = permute(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = df_mapper2(@permute, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/permute.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_func.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_func.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_func.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,58 @@ +function resu = df_func(func, A, B); + + %# function resu = df_func(func, A, B) + %# Implements an iterator to apply some func when at least one + %# argument is a dataframe + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + [A, B] = df_basecomp(A, B); + + if isa(B, 'dataframe') + if !isa(A, 'dataframe'), + if isscalar(A) + resu = cellfun(@(x) feval(func, A, x), B._data, "UniformOutput", false); + elseif ismatrix(A), + resu = cellfun(@(x, y) feval(func, x, y), num2cell(A, 1), B._data, \ + "UniformOutput", false); + else + error("Function %s not implemented", func2str(func)); + endif + else + resu = cellfun(@(x, y) feval(func, x, y), A._data, B._data, \ + "UniformOutput", false); + endif + else + if isscalar(B), + resu = cellfun(@(x) feval(func, x, B), A._data, "UniformOutput", false); + elseif ismatrix(B), + resu = cellfun(@(x, y) feval(func, x, y), A._data, num2cell(B, 1), \ + "UniformOutput", false); + else + error("Operator < not implemented"); + endif + endif + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_func.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_mapper2.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_mapper2.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_mapper2.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,59 @@ +function resu = df_mapper2(func, df, varargin) + %# resu = df_mapper2(func, df) + %# small interface to iterate some vector func over the elements of a + %# dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + dim =1; resu = []; vout = varargin; + + if !isempty(varargin) && isnumeric(varargin{1}), + dim = varargin{1}; + %# the "third" dim is the second on stored data + if 3 == dim, vout(1) = 2; endif + endif + + resu = df; + + switch(dim) + case {1}, + %# remove row metadata + resu._ridx = 1; resu._name{1, 1} = []; resu._over{1, 1} = []; + for indi = resu._cnt(2):-1:1, + resu._data{indi} = feval(func, resu._data{indi}, vout{:}); + endfor + resu._cnt(1) = 1; + case {2}, + error('Operation not implemented'); + case {3}, + for indi = resu._cnt(2):-1:1; + resu._data{indi} = feval(func, resu._data{indi}, vout{:}); + endfor + if length(resu._cnt) > 2, resu._cnt = resu._cnt(1:2); endif + otherwise + error("Invalid dimension %d", dim); + endswitch + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_mapper2.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/prod.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/prod.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/prod.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,33 @@ +function resu = prod(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + if !isa(df, 'dataframe'), + resu = []; return; + endif + + resu = df_mapper2(@prod, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/prod.m ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/octave-forge/extra/dataframe/inst/@dataframe/size.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/size.m 2010-11-23 10:51:03 UTC (rev 7940) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/size.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -1,5 +1,5 @@ -function [nrow, ncol] = size(df, varargin) - %# function resu = end(df, varargin) +function varargout = size(df, varargin) + %# function resu = size(df, varargin) %# This is size operator for a dataframe object. %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> @@ -30,18 +30,18 @@ case 1 switch nargout case {0 1} - nrow = df._cnt; + varargout{1} = df._cnt; case {2} - nrow = df._cnt(1); ncol = df._cnt(2); + varargout{1} = df._cnt(1); varargout{2} = df._cnt(2); otherwise error(print_usage()); endswitch case 2 switch nargout case {0 1} - nrow = df._cnt; + varargout{1} = df._cnt; try - nrow = nrow(varargin{1}); + varargout{1} = varargout{1}(varargin{1}); catch error(print_usage()); end_try_catch Modified: trunk/octave-forge/extra/dataframe/inst/@dataframe/sum.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/sum.m 2010-11-23 10:51:03 UTC (rev 7940) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/sum.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -1,35 +1,5 @@ function resu = sum(df, varargin) - %# -*- texinfo -*- - %# @deftypefn {Function File} {} sum (@var{x}) - %# @deftypefnx {Function File} {} sum (@var{x}, @var{dim}) - %# @deftypefnx {Function File} {} sum (@dots{}, 'native') - %# @deftypefnx {Function File} {} sum (@dots{}, 'double') - %# @deftypefnx {Function File} {} sum (@dots{}, 'extra') - %# Sum of elements along dimension @var{dim}. If @var{dim} is - %# omitted, it defaults to the first non-singleton dimension. - %# - %# If the optional argument 'native' is given, then the sum is performed - %# in the same type as the original argument, rather than in the default - %# double type. For example: - %# - %# @example - %# @group - %# sum ([true, true]) - %# @result{} 2 - %# sum ([true, true], 'native') - %# @result{} true - %# @end group - %# @end example - %# - %# On the contrary, if 'double' is given, the sum is performed in double - %# precision even for single precision inputs. - %# - %# For double precision inputs, 'extra' indicates that a more accurate algorithm - %# than straightforward summation is to be used. For single precision inputs, - %# 'extra' is the same as 'double'. Otherwise, 'extra' has no effect.\n\ - %# @end deftypefn - %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> %% %% This file is part of Octave. @@ -58,53 +28,6 @@ resu = []; return; endif - dim = []; type_comp = []; + resu = df_mapper2(@sum, df, varargin{:}); - indi = 1; while indi <= length(varargin) - if isnumeric(varargin{indi}), - if !isempty(dim), - print_usage('@dataframe/sum'); - resu = []; - return - else - dim = varargin{indi}; - endif - else - if !isempty(type_comp), - print_usage('@dataframe/sum'); - resu = []; - return - else - type_comp = varargin{indi}; - endif - endif - indi = indi + 1; - endwhile; - - if isempty(dim), dim = 1; endif; - if isempty(type_comp), type_comp = 'double'; endif - - %# pre-assignation - resu = struct(df); - - switch(dim) - case {1}, - resu._ridx = 1; resu._name{1, 1} = []; resu._over{1, 1} = []; - for indi = 1:resu._cnt(2), - resu._data{1, indi} = sum(resu._data{1, indi}, dim, type_comp); - endfor - resu._cnt(1) = 1; - case {2}, - error('Operation not implemented'); - case {3}, - for indi = 1:resu._cnt(2), - resu._data{1, indi} = sum(resu._data{1, indi}, 2, type_comp) - endfor - if length(resu._cnt) > 2, resu._cnt = resu._cnt(1:2); endif - otherwise - error("Invalid dimension %d", dim); - endswitch - - resu = dataframe(resu); - endfunction Modified: trunk/octave-forge/extra/dataframe/inst/@dataframe/sumsq.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/sumsq.m 2010-11-23 10:51:03 UTC (rev 7940) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/sumsq.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -1,35 +1,5 @@ function resu = sumsq(df, varargin) - %# -*- texinfo -*- - %# @deftypefn {Function File} {} sum (@var{x}) - %# @deftypefnx {Function File} {} sum (@var{x}, @var{dim}) - %# @deftypefnx {Function File} {} sum (@dots{}, 'native') - %# @deftypefnx {Function File} {} sum (@dots{}, 'double') - %# @deftypefnx {Function File} {} sum (@dots{}, 'extra') - %# Sum of elements along dimension @var{dim}. If @var{dim} is - %# omitted, it defaults to the first non-singleton dimension. - %# - %# If the optional argument 'native' is given, then the sum is performed - %# in the same type as the original argument, rather than in the default - %# double type. For example: - %# - %# @example - %# @group - %# sum ([true, true]) - %# @result{} 2 - %# sum ([true, true], 'native') - %# @result{} true - %# @end group - %# @end example - %# - %# On the contrary, if 'double' is given, the sum is performed in double - %# precision even for single precision inputs. - %# - %# For double precision inputs, 'extra' indicates that a more accurate algorithm - %# than straightforward summation is to be used. For single precision inputs, - %# 'extra' is the same as 'double'. Otherwise, 'extra' has no effect.\n\ - %# @end deftypefn - %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> %% %% This file is part of Octave. @@ -58,48 +28,6 @@ resu = []; return; endif - dim = []; + resu = df_mapper2(@sumsq, df, varargin{:}); - indi = 1; while indi <= length(varargin) - if isnumeric(varargin{indi}), - if !isempty(dim), - print_usage('@dataframe/sumsq'); - resu = []; - return - else - dim = varargin{indi}; - endif - else - print_usage('@dataframe/sumsq'); - resu = []; - return - endif - indi = indi + 1; - endwhile; - - if isempty(dim), dim = 1; endif; - - %# pre-assignation - resu = struct(df); - - switch(dim) - case {1}, - resu._ridx = 1; resu._name{1, 1} = []; resu._over{1, 1} = []; - for indi = 1:resu._cnt(2), - resu._data{1, indi} = sumsq(resu._data{1, indi}, dim); - endfor - resu._cnt(1) = 1; - case {2}, - error('Operation not implemented'); - case {3}, - for indi = 1:resu._cnt(2), - resu._data{1, indi} = sumsq(resu._data{1, indi}, 2); - endfor - if length(resu._cnt) > 2, resu._cnt = resu._cnt(1:2); endif - otherwise - error("Invalid dimension %d", dim); - endswitch - - resu = dataframe(resu); - endfunction Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/vertcat.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/vertcat.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/vertcat.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,29 @@ +function resu = vertcat(df, varargin) + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cat(2, df, varargin{:}); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/vertcat.m ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/octave-forge/extra/dataframe/inst/@dataframe/xor.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/xor.m (rev 0) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/xor.m 2010-11-23 17:34:03 UTC (rev 7941) @@ -0,0 +1,32 @@ +function resu = xor(A, B); + + %# function resu = xor(A, B) + %# Implements the '??' operator when at least one argument is a dataframe. + + %% Copyright (C) 2009-2010 Pascal Dupuis <Pas...@uc...> + %% + %% 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, 59 Temple Place - + %% Suite 330, Boston, MA 02111-1307, USA. + + %# + %# $Id$ + %# + + resu = cell2mat(df_func(@xor, A, B)); + +endfunction Property changes on: trunk/octave-forge/extra/dataframe/inst/@dataframe/xor.m ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |