1739
|
1 /* |
|
2 |
1827
|
3 Copyright (C) 1996 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 |
|
32 class tree_constant; |
|
33 class tree_return_list; |
|
34 |
1827
|
35 #include <SLList.h> |
|
36 |
1739
|
37 #include "pt-exp.h" |
|
38 |
|
39 // General matrices. This allows us to construct matrices from |
|
40 // other matrices, variables, and functions. |
|
41 |
|
42 class |
1827
|
43 tree_matrix_row : public SLList<tree_expression *> |
1739
|
44 { |
|
45 public: |
|
46 |
1827
|
47 tree_matrix_row (tree_expression *e = 0) : SLList<tree_expression *> () |
|
48 { |
|
49 if (e) |
|
50 append (e); |
|
51 } |
1739
|
52 |
1827
|
53 ~tree_matrix_row (void) { } |
1739
|
54 |
1827
|
55 bool is_matrix_constant (void) const; |
1739
|
56 |
|
57 tree_return_list *to_return_list (void); |
|
58 |
1827
|
59 void print_code (ostream& os); |
|
60 }; |
|
61 |
|
62 class |
|
63 tree_matrix : public tree_expression, public SLList<tree_matrix_row *> |
|
64 { |
|
65 public: |
|
66 |
|
67 tree_matrix (tree_matrix_row *mr = 0) |
|
68 : tree_expression (), SLList<tree_matrix_row *> () |
|
69 { |
|
70 if (mr) |
|
71 append (mr); |
|
72 } |
|
73 |
|
74 ~tree_matrix (void) { } |
|
75 |
|
76 bool is_matrix_constant (void) const; |
|
77 |
|
78 tree_constant eval (bool print); |
1739
|
79 |
|
80 void print_code (ostream& os); |
|
81 }; |
|
82 |
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |