GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pt-mat.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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
33class octave_value;
35
36#include "pt-array-list.h"
37#include "pt-exp.h"
38#include "pt-walk.h"
39
41
42class symbol_scope;
44
45// General matrices. This allows us to construct matrices from
46// other matrices, variables, and functions.
47
49{
50public:
51
53 : tree_array_list (row)
54 { }
55
56 OCTAVE_DISABLE_COPY_MOVE (tree_matrix)
57
58 ~tree_matrix () = default;
59
60 bool is_matrix () const { return true; }
61
62 bool rvalue_ok () const { return true; }
63
64 tree_expression * dup (symbol_scope& scope) const;
65
66 octave_value evaluate (tree_evaluator&, int nargout = 1);
67
69 {
70 return ovl (evaluate (tw, nargout));
71 }
72
74 {
75 tw.visit_matrix (*this);
76 }
77};
78
79extern std::string
80get_concat_class (const std::string& c1, const std::string& c2);
81
82extern void
83maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p);
84
85OCTAVE_END_NAMESPACE(octave)
86
87#endif
void accept(tree_walker &tw)
Definition pt-mat.h:73
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:68
bool rvalue_ok() const
Definition pt-mat.h:62
tree_matrix(tree_argument_list *row=nullptr)
Definition pt-mat.h:52
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition pt-mat.cc:48
bool is_matrix() const
Definition pt-mat.h:60
~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:217
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