op-cell.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1996-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include "gripes.h"
00028 #include "oct-obj.h"
00029 #include "ov.h"
00030 #include "ov-cell.h"
00031 #include "ov-scalar.h"
00032 #include "ov-re-mat.h"
00033 #include "ov-typeinfo.h"
00034 #include "ov-null-mat.h"
00035 #include "ops.h"
00036 
00037 // cell ops.
00038 
00039 DEFUNOP (transpose, cell)
00040 {
00041   CAST_UNOP_ARG (const octave_cell&);
00042 
00043   if (v.ndims () > 2)
00044     {
00045       error ("transpose not defined for N-d objects");
00046       return octave_value ();
00047     }
00048   else
00049     return octave_value (Cell (v.cell_value().transpose ()));
00050 }
00051 
00052 DEFCATOP_FN (c_c, cell, cell, concat)
00053 
00054 DEFASSIGNANYOP_FN (assign, cell, assign);
00055 
00056 DEFNULLASSIGNOP_FN (null_assign, cell, delete_elements)
00057 
00058 void
00059 install_cell_ops (void)
00060 {
00061   INSTALL_UNOP (op_transpose, octave_cell, transpose);
00062   INSTALL_UNOP (op_hermitian, octave_cell, transpose);
00063 
00064   INSTALL_CATOP (octave_cell, octave_cell, c_c);
00065 
00066   INSTALL_ASSIGNANYOP (op_asn_eq, octave_cell, assign);
00067 
00068   INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_matrix, null_assign);
00069   INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_str, null_assign);
00070   INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_sq_str, null_assign);
00071 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines