GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
op-cell.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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
57 {
60 
62 
63  INSTALL_ASSIGNANYOP (op_asn_eq, octave_cell, assign);
64 
65  INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_matrix, null_assign);
66  INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_str, null_assign);
67  INSTALL_ASSIGNOP (op_asn_eq, octave_cell, octave_null_sq_str, null_assign);
68 }
void install_cell_ops(void)
Definition: op-cell.cc:56
Definition: Cell.h:37
#define DEFUNOP(name, t)
Definition: ops.h:172
#define DEFNULLASSIGNOP_FN(name, t, f)
Definition: ops.h:93
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:382
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:655
void error(const char *fmt,...)
Definition: error.cc:570
Cell cell_value(void) const
Definition: ov-cell.h:138
#define INSTALL_ASSIGNOP(op, t1, t2, f)
Definition: ops.h:57
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:398
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1488
Array< T > transpose(void) const
Definition: Array.cc:1616
int ndims(void) const
Definition: ov-base-mat.h:114
#define INSTALL_CATOP(t1, t2, f)
Definition: ops.h:53
#define DEFASSIGNANYOP_FN(name, t1, f)
Definition: ops.h:149
#define DEFCATOP_FN(name, t1, t2, f)
Definition: ops.h:329
#define INSTALL_UNOP(op, t, f)
Definition: ops.h:40
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1489
#define INSTALL_ASSIGNANYOP(op, t1, f)
Definition: ops.h:62
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))