Mercurial > hg > octave-lyh
comparison src/pt-mat.h @ 1739:bbfca89cb1cd
[project @ 1996-01-12 11:03:26 by jwe]
Initial revision
author | jwe |
---|---|
date | Fri, 12 Jan 1996 11:03:26 +0000 |
parents | |
children | effa9400766f |
comparison
equal
deleted
inserted
replaced
1738:bb9d00aa55fb | 1739:bbfca89cb1cd |
---|---|
1 // pt-mat.h -*- C++ -*- | |
2 /* | |
3 | |
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton | |
5 | |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
10 Free Software Foundation; either version 2, or (at your option) any | |
11 later version. | |
12 | |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with Octave; see the file COPYING. If not, write to the Free | |
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | |
22 */ | |
23 | |
24 #if !defined (octave_tree_mat_h) | |
25 #define octave_tree_mat_h 1 | |
26 | |
27 #if defined (__GNUG__) | |
28 #pragma interface | |
29 #endif | |
30 | |
31 class ostream; | |
32 | |
33 class tree_constant; | |
34 class tree_return_list; | |
35 | |
36 #include "pt-exp.h" | |
37 | |
38 // General matrices. This allows us to construct matrices from | |
39 // other matrices, variables, and functions. | |
40 | |
41 class | |
42 tree_matrix : public tree_expression | |
43 { | |
44 public: | |
45 enum dir | |
46 { | |
47 md_none, | |
48 md_right, | |
49 md_down, | |
50 }; | |
51 | |
52 tree_matrix (void) | |
53 : tree_expression (), direction (tree_matrix::md_none), | |
54 element (0), next (0) { } | |
55 | |
56 tree_matrix (tree_expression *e, tree_matrix::dir d) | |
57 : tree_expression (), direction (d), element (e), next (0) { } | |
58 | |
59 ~tree_matrix (void); | |
60 | |
61 int is_matrix_constant (void) const; | |
62 | |
63 tree_matrix *chain (tree_expression *e, tree_matrix::dir d); | |
64 tree_matrix *reverse (void); | |
65 int length (void); | |
66 | |
67 tree_return_list *to_return_list (void); | |
68 | |
69 tree_constant eval (int print); | |
70 | |
71 void print_code (ostream& os); | |
72 | |
73 private: | |
74 tree_matrix::dir direction; // Direction from the previous element. | |
75 tree_expression *element; | |
76 tree_matrix *next; | |
77 }; | |
78 | |
79 #endif | |
80 | |
81 /* | |
82 ;;; Local Variables: *** | |
83 ;;; mode: C++ *** | |
84 ;;; page-delimiter: "^/\\*" *** | |
85 ;;; End: *** | |
86 */ |