Mercurial > octave
comparison src/pt-mat.h @ 4219:23d06c9e1edd
[project @ 2002-12-06 21:29:17 by jwe]
author | jwe |
---|---|
date | Fri, 06 Dec 2002 21:29:19 +0000 |
parents | 8ad52ec4f374 |
children | 7cd865a8c815 |
comparison
equal
deleted
inserted
replaced
4218:4a392a01e51a | 4219:23d06c9e1edd |
---|---|
33 class octave_value_list; | 33 class octave_value_list; |
34 class tree_argument_list; | 34 class tree_argument_list; |
35 | 35 |
36 class tree_walker; | 36 class tree_walker; |
37 | 37 |
38 #include <SLList.h> | 38 #include "base-list.h" |
39 | |
40 #include "pt-exp.h" | 39 #include "pt-exp.h" |
41 | 40 |
42 // General matrices. This allows us to construct matrices from | 41 // General matrices. This allows us to construct matrices from |
43 // other matrices, variables, and functions. | 42 // other matrices, variables, and functions. |
44 | 43 |
45 class | 44 class |
46 tree_matrix : public tree_expression | 45 tree_matrix : public tree_expression, |
46 public octave_base_list<tree_argument_list *> | |
47 { | 47 { |
48 public: | 48 public: |
49 | 49 |
50 tree_matrix (tree_argument_list *row = 0, int line = -1, int column = -1) | 50 tree_matrix (tree_argument_list *row = 0, int line = -1, int column = -1) |
51 : tree_expression (line, column), lst () | 51 : tree_expression (line, column) |
52 { | 52 { |
53 if (row) | 53 if (row) |
54 lst.append (row); | 54 append (row); |
55 } | 55 } |
56 | 56 |
57 ~tree_matrix (void); | 57 ~tree_matrix (void); |
58 | |
59 int length (void) const { return lst.length (); } | |
60 | |
61 void append (tree_argument_list *&s) { lst.append (s); } | |
62 void append (tree_argument_list * const &s) { lst.append (s); } | |
63 | |
64 tree_argument_list *&operator () (Pix p) { return lst (p); } | |
65 | |
66 tree_argument_list * const &operator () (Pix p) const { return lst (p); } | |
67 | |
68 Pix first (void) const { return lst.first (); } | |
69 | |
70 void next (Pix& p) const { return lst.next (p); } | |
71 | 58 |
72 bool all_elements_are_constant (void) const; | 59 bool all_elements_are_constant (void) const; |
73 | 60 |
74 bool rvalue_ok (void) const { return true; } | 61 bool rvalue_ok (void) const { return true; } |
75 | 62 |
78 octave_value_list rvalue (int nargout); | 65 octave_value_list rvalue (int nargout); |
79 | 66 |
80 void accept (tree_walker& tw); | 67 void accept (tree_walker& tw); |
81 | 68 |
82 private: | 69 private: |
83 | |
84 // The list matrix elements for this row. | |
85 SLList<tree_argument_list *> lst; | |
86 | 70 |
87 // No copying! | 71 // No copying! |
88 | 72 |
89 tree_matrix (const tree_matrix&); | 73 tree_matrix (const tree_matrix&); |
90 | 74 |