From: <hi...@us...> - 2009-02-18 14:04:42
|
Revision: 5560 http://octave.svn.sourceforge.net/octave/?rev=5560&view=rev Author: highegg Date: 2009-02-18 14:04:33 +0000 (Wed, 18 Feb 2009) Log Message: ----------- remove more relics Removed Paths: ------------- trunk/octave-forge/main/general/src/ChangeLog trunk/octave-forge/main/general/src/deref.cc Deleted: trunk/octave-forge/main/general/src/ChangeLog =================================================================== --- trunk/octave-forge/main/general/src/ChangeLog 2009-02-18 14:01:44 UTC (rev 5559) +++ trunk/octave-forge/main/general/src/ChangeLog 2009-02-18 14:04:33 UTC (rev 5560) @@ -1,9 +0,0 @@ -2008-02-18 Jaroslav Hajek <hi...@gm...> - - * lookup.cc: correct behaviour not to accept right intval boundary - adjust code to meet Octave style - -2008-02-15 Jaroslav Hajek <hi...@gm...> - - * initiated ChangeLog - * lookup.cc: added Deleted: trunk/octave-forge/main/general/src/deref.cc =================================================================== --- trunk/octave-forge/main/general/src/deref.cc 2009-02-18 14:01:44 UTC (rev 5559) +++ trunk/octave-forge/main/general/src/deref.cc 2009-02-18 14:04:33 UTC (rev 5560) @@ -1,86 +0,0 @@ -/* - -Copyright (C) 2002 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, see <http://www.gnu.org/licenses/>. - -*/ - -#include <octave/oct.h> -#include <octave/ov-cell.h> - -DEFUN_DLD (deref, args,, -"-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} deref (@var{cell}, @var{n})\n\ -Return the @var{n}-th element of @var{cell}.\n\ -@deftypefnx {Built-in Function} {} deref (@var{cell}, @var{i}, @var{j})\n\ -Return the @var{i,j}-th element of @var{cell}.\n\ -@end deftypefn") -{ - octave_value retval; - int i=-1,j=-1; - - if (args.length() < 2 - || (args(0).is_list() && args.length() > 2) - || args.length() > 3) - { - print_usage (); - return retval; - } - - i = args(1).int_value (true); - if (error_state || i < 1) - { - error ("deref: second argument must be a positive integer"); - return retval; - } - - if (args.length() == 3) - { - j = args(2).int_value (true); - if (error_state || j < 1) - { - error ("deref: third argument must be a positive integer"); - return retval; - } - } - - Cell cell = args(0).cell_value (); - - if (! error_state) - { - int nr = cell.rows(); - int nc = cell.columns(); - - if (j == -1) - if (nr == 1) - if (i <= nc) - retval = cell(0,i-1); - else - error ("deref: index = %d out of range", i); - else if (nc == 1) - if (i <= nr) - retval = cell(i-1,0); - else - error ("deref: index = %d out of range", i); - else - error ("deref: single index not valid for 2-D cell array"); - else if (i <= nr && j <= nc) - retval = cell(i-1, j-1); - else - error ("deref: index = %d,%d out of range", i, j); - } - - return retval; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |