GNU Octave  4.4.1
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-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_pt_mat_h)
24 #define octave_pt_mat_h 1
25 
26 #include "octave-config.h"
27 
28 #include <iosfwd>
29 
30 class octave_value;
31 class octave_value_list;
32 
33 #include "base-list.h"
34 #include "pt-array-list.h"
35 #include "pt-exp.h"
36 #include "pt-walk.h"
37 
38 namespace octave
39 {
40  class symbol_scope;
41  class tree_argument_list;
42 
43  // General matrices. This allows us to construct matrices from
44  // other matrices, variables, and functions.
45 
47  {
48  public:
49 
50  tree_matrix (tree_argument_list *row = nullptr, int l = -1, int c = -1)
51  : tree_array_list (row, l, c)
52  { }
53 
54  // No copying!
55 
56  tree_matrix (const tree_matrix&) = delete;
57 
58  tree_matrix& operator = (const tree_matrix&) = delete;
59 
60  ~tree_matrix (void) = default;
61 
62  bool is_matrix (void) const { return true; }
63 
64  bool rvalue_ok (void) const { return true; }
65 
66  tree_expression * dup (symbol_scope& scope) const;
67 
68  void accept (tree_walker& tw)
69  {
70  tw.visit_matrix (*this);
71  }
72  };
73 
74  extern std::string
75  get_concat_class (const std::string& c1, const std::string& c2);
76 
77  extern void
78  maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p);
79 }
80 
81 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
82 
83 OCTAVE_DEPRECATED (4.4, "use 'octave::tree_matrix' instead")
84 typedef octave::tree_matrix tree_matrix;
85 
86 OCTAVE_DEPRECATED (4.4, "use 'octave::get_concat_class' instead")
87 static inline std::string
88 get_concat_class (const std::string& c1, const std::string& c2)
89 {
90  return octave::get_concat_class (c1, c2);
91 }
92 
93 OCTAVE_DEPRECATED (4.4, "use 'octave::maybe_warn_string_concat' instead")
94 static inline void
95 maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p)
96 {
97  octave::maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
98 }
99 
100 #endif
101 
102 #endif
tree_matrix & operator=(const tree_matrix &)=delete
bool rvalue_ok(void) const
Definition: pt-mat.h:64
void accept(tree_walker &tw)
Definition: pt-mat.h:68
STL namespace.
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
~tree_matrix(void)=default
void maybe_warn_string_concat(bool all_dq_strings_p, bool all_sq_strings_p)
Definition: pt-mat.cc:117
virtual void visit_matrix(tree_matrix &)=0
tree_matrix(tree_argument_list *row=nullptr, int l=-1, int c=-1)
Definition: pt-mat.h:50
bool is_matrix(void) const
Definition: pt-mat.h:62
std::string get_concat_class(const std::string &c1, const std::string &c2)
Definition: pt-mat.cc:44
tree_expression * dup(symbol_scope &scope) const
Definition: pt-mat.cc:125
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
Definition: str2double.cc:342