GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
op-cell.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include "errwarn.h"
28 #include "ovl.h"
29 #include "ov.h"
30 #include "ov-cell.h"
31 #include "ov-scalar.h"
32 #include "ov-re-mat.h"
33 #include "ov-typeinfo.h"
34 #include "ov-null-mat.h"
35 #include "ops.h"
36 
37 // cell ops.
38 
40 {
41  const octave_cell& v = dynamic_cast<const octave_cell&> (a);
42 
43  if (v.ndims () > 2)
44  error ("transpose not defined for N-D objects");
45 
46  return octave_value (Cell (v.cell_value ().transpose ()));
47 }
48 
49 DEFCATOP_FN (c_c, cell, cell, concat)
50 
51 DEFASSIGNANYOP_FN (assign, cell, assign);
52 
53 DEFNULLASSIGNOP_FN (null_assign, cell, delete_elements)
54 
55 void
56 install_cell_ops (octave::type_info& ti)
57 {
60 
62 
63  INSTALL_ASSIGNANYOP_TI (ti, op_asn_eq, octave_cell, assign);
64 
66  null_assign);
67  INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_cell, octave_null_str, null_assign);
69  null_assign);
70 }
#define INSTALL_ASSIGNOP_TI(ti, op, t1, t2, f)
Definition: ops.h:62
Definition: Cell.h:37
#define DEFUNOP(name, t)
Definition: ops.h:213
#define DEFNULLASSIGNOP_FN(name, t, f)
Definition: ops.h:134
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
Definition: symrcm.cc:386
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:653
void error(const char *fmt,...)
Definition: error.cc:578
Cell cell_value(void) const
Definition: ov-cell.h:128
#define INSTALL_ASSIGNANYOP_TI(ti, op, t1, f)
Definition: ops.h:67
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
#define INSTALL_UNOP_TI(ti, op, t, f)
Definition: ops.h:45
#define INSTALL_CATOP_TI(ti, t1, t2, f)
Definition: ops.h:58
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1577
Array< T > transpose(void) const
Definition: Array.cc:1598
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
int ndims(void) const
Definition: ov-base-mat.h:109
void install_cell_ops(octave::type_info &ti)
Definition: op-cell.cc:56
#define DEFASSIGNANYOP_FN(name, t1, f)
Definition: ops.h:190
#define DEFCATOP_FN(name, t1, t2, f)
Definition: ops.h:370
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1578