GNU Octave  8.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-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 (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  // No copying!
58 
59  tree_matrix (const tree_matrix&) = delete;
60 
61  tree_matrix& operator = (const tree_matrix&) = delete;
62 
63  ~tree_matrix (void) = default;
64 
65  bool is_matrix (void) const { return true; }
66 
67  bool rvalue_ok (void) const { return true; }
68 
69  tree_expression * dup (symbol_scope& scope) const;
70 
71  octave_value evaluate (tree_evaluator&, int nargout = 1);
72 
74  {
75  return ovl (evaluate (tw, nargout));
76  }
77 
78  void accept (tree_walker& tw)
79  {
80  tw.visit_matrix (*this);
81  }
82 };
83 
84 extern std::string
85 get_concat_class (const std::string& c1, const std::string& c2);
86 
87 extern void
88 maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p);
89 
91 
92 #endif
OCTAVE_END_NAMESPACE(octave)
tree_matrix(const tree_matrix &)=delete
void accept(tree_walker &tw)
Definition: pt-mat.h:78
tree_expression * dup(symbol_scope &scope) const
Definition: pt-mat.cc:135
~tree_matrix(void)=default
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
Definition: pt-mat.h:73
tree_matrix & operator=(const tree_matrix &)=delete
bool rvalue_ok(void) const
Definition: pt-mat.h:67
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition: pt-mat.cc:48
bool is_matrix(void) const
Definition: pt-mat.h:65
tree_matrix(tree_argument_list *row=nullptr, int l=-1, int c=-1)
Definition: pt-mat.h:53
virtual void visit_matrix(tree_matrix &)
Definition: pt-walk.cc:424
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:211
void maybe_warn_string_concat(bool all_dq_strings_p, bool all_sq_strings_p)
Definition: pt-mat.cc:127
std::string get_concat_class(const std::string &c1, const std::string &c2)
Definition: pt-mat.cc:56