GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-mat.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2024 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 (octave_pt_mat_h)
27 #define octave_pt_mat_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
33 class octave_value;
34 class octave_value_list;
35 
36 #include "base-list.h"
37 #include "pt-array-list.h"
38 #include "pt-exp.h"
39 #include "pt-walk.h"
40 
42 
43 class symbol_scope;
44 class tree_argument_list;
45 
46 // General matrices. This allows us to construct matrices from
47 // other matrices, variables, and functions.
48 
50 {
51 public:
52 
53  tree_matrix (tree_argument_list *row = nullptr, int l = -1, int c = -1)
54  : tree_array_list (row, l, c)
55  { }
56 
57  OCTAVE_DISABLE_COPY_MOVE (tree_matrix)
58 
59  ~tree_matrix () = default;
60 
61  bool is_matrix () const { return true; }
62 
63  bool rvalue_ok () const { return true; }
64 
65  tree_expression * dup (symbol_scope& scope) const;
66 
67  octave_value evaluate (tree_evaluator&, int nargout = 1);
68 
70  {
71  return ovl (evaluate (tw, nargout));
72  }
73 
74  void accept (tree_walker& tw)
75  {
76  tw.visit_matrix (*this);
77  }
78 };
79 
80 extern std::string
81 get_concat_class (const std::string& c1, const std::string& c2);
82 
83 extern void
84 maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p);
85 
86 OCTAVE_END_NAMESPACE(octave)
87 
88 #endif
void accept(tree_walker &tw)
Definition: pt-mat.h:74
tree_expression * dup(symbol_scope &scope) const
Definition: pt-mat.cc:142
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
Definition: pt-mat.h:69
bool rvalue_ok() const
Definition: pt-mat.h:63
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition: pt-mat.cc:48
bool is_matrix() const
Definition: pt-mat.h:61
tree_matrix(tree_argument_list *row=nullptr, int l=-1, int c=-1)
Definition: pt-mat.h:53
~tree_matrix()=default
virtual void visit_matrix(tree_matrix &)
Definition: pt-walk.cc:455
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition: ovl.h:219
void maybe_warn_string_concat(bool all_dq_strings_p, bool all_sq_strings_p)
Definition: pt-mat.cc:134
std::string get_concat_class(const std::string &c1, const std::string &c2)
Definition: pt-mat.cc:63