1739
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1739
|
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 the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 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, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_tree_mat_h) |
|
24 #define octave_tree_mat_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 class ostream; |
|
31 |
2086
|
32 class octave_value; |
1739
|
33 class tree_return_list; |
|
34 |
2124
|
35 class tree_walker; |
|
36 |
1827
|
37 #include <SLList.h> |
|
38 |
1739
|
39 #include "pt-exp.h" |
|
40 |
|
41 // General matrices. This allows us to construct matrices from |
|
42 // other matrices, variables, and functions. |
|
43 |
|
44 class |
1827
|
45 tree_matrix_row : public SLList<tree_expression *> |
1739
|
46 { |
|
47 public: |
|
48 |
1827
|
49 tree_matrix_row (tree_expression *e = 0) : SLList<tree_expression *> () |
|
50 { |
|
51 if (e) |
|
52 append (e); |
|
53 } |
1739
|
54 |
1827
|
55 ~tree_matrix_row (void) { } |
1739
|
56 |
2529
|
57 bool all_elements_are_constant (void) const; |
1739
|
58 |
|
59 tree_return_list *to_return_list (void); |
|
60 |
2124
|
61 void accept (tree_walker& tw); |
1827
|
62 }; |
|
63 |
|
64 class |
|
65 tree_matrix : public tree_expression, public SLList<tree_matrix_row *> |
|
66 { |
|
67 public: |
|
68 |
|
69 tree_matrix (tree_matrix_row *mr = 0) |
|
70 : tree_expression (), SLList<tree_matrix_row *> () |
|
71 { |
|
72 if (mr) |
|
73 append (mr); |
|
74 } |
|
75 |
|
76 ~tree_matrix (void) { } |
|
77 |
2529
|
78 bool all_elements_are_constant (void) const; |
1827
|
79 |
2859
|
80 octave_value eval (bool print = false); |
1739
|
81 |
2124
|
82 void accept (tree_walker& tw); |
1739
|
83 }; |
|
84 |
|
85 #endif |
|
86 |
|
87 /* |
|
88 ;;; Local Variables: *** |
|
89 ;;; mode: C++ *** |
|
90 ;;; End: *** |
|
91 */ |