GNU Octave  8.1.0
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-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "errwarn.h"
31 #include "ovl.h"
32 #include "ov.h"
33 #include "ov-cell.h"
34 #include "ov-scalar.h"
35 #include "ov-re-mat.h"
36 #include "ov-typeinfo.h"
37 #include "ov-null-mat.h"
38 #include "ops.h"
39 
41 
42 // cell ops.
43 
45 {
46  const octave_cell& v = dynamic_cast<const octave_cell&> (a);
47 
48  if (v.ndims () > 2)
49  error ("transpose not defined for N-D objects");
50 
51  return octave_value (Cell (v.cell_value ().transpose ()));
52 }
53 
54 DEFCATOP_FN (c_c, cell, cell, concat)
55 
56 DEFASSIGNANYOP_FN (assign, cell, assign);
57 
58 DEFNULLASSIGNOP_FN (null_assign, cell, delete_elements)
59 
60 void
62 {
65 
67 
68  INSTALL_ASSIGNANYOP_TI (ti, op_asn_eq, octave_cell, assign);
69 
71  null_assign);
72  INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_cell, octave_null_str, null_assign);
74  null_assign);
75 }
76 
OCTAVE_END_NAMESPACE(octave)
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:418
OCTARRAY_API Array< T, Alloc > transpose(void) const
Size of the specified dimension.
Definition: Array-base.cc:1625
Definition: Cell.h:43
int ndims(void) const
Definition: ov-base-mat.h:121
Cell cell_value(void) const
Definition: ov-cell.h:139
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void error(const char *fmt,...)
Definition: error.cc:979
void install_cell_ops(octave::type_info &ti)
Definition: op-cell.cc:61
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define INSTALL_ASSIGNANYOP_TI(ti, op, t1, f)
Definition: ops.h:69
#define DEFNULLASSIGNOP_FN(name, t, f)
Definition: ops.h:100
#define DEFASSIGNANYOP_FN(name, t1, f)
Definition: ops.h:156
#define DEFCATOP_FN(name, t1, t2, f)
Definition: ops.h:337
#define DEFUNOP(name, t)
Definition: ops.h:179
#define INSTALL_CATOP_TI(ti, t1, t2, f)
Definition: ops.h:60
#define INSTALL_UNOP_TI(ti, op, t, f)
Definition: ops.h:47
#define INSTALL_ASSIGNOP_TI(ti, op, t1, t2, f)
Definition: ops.h:64
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1842
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1843
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:391