]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.C
small up/down tweaking
[lyx.git] / src / mathed / math_matrixinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_matrixinset.h"
6 #include "math_parser.h"
7 #include "math_mathmlstream.h"
8 #include "Lsstream.h"
9
10
11 MathMatrixInset::MathMatrixInset(MathGridInset const & p)
12         : MathGridInset(p)
13 {}
14
15
16 MathInset * MathMatrixInset::clone() const
17 {
18         return new MathMatrixInset(*this);
19 }
20
21
22 void MathMatrixInset::write(WriteStream & os) const
23 {
24         MathGridInset::write(os);
25 }
26
27
28 void MathMatrixInset::normalize(NormalStream & os) const
29 {
30         MathGridInset::normalize(os);
31 }
32
33
34 void MathMatrixInset::maplize(MapleStream & os) const
35 {
36         os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
37         for (idx_type idx = 0; idx < nargs(); ++idx) {
38                 if (idx)
39                         os << ',';
40                 os << cell(idx);
41         }
42         os << "])";
43 }
44
45
46 void MathMatrixInset::maximize(MaximaStream & os) const
47 {
48         os << "matrix(";
49         for (row_type row = 0; row < nrows(); ++row) {
50                 if (row)
51                         os << ',';
52                 os << '[';
53                 for (col_type col = 0; col < ncols(); ++col) {
54                         if (col)
55                                 os << ',';
56                         os << cell(index(row, col));
57                 }
58                 os << ']';
59         }
60         os << ')';
61 }
62
63
64 void MathMatrixInset::mathmlize(MathMLStream & os) const
65 {
66         MathGridInset::mathmlize(os);
67 }
68
69
70 void MathMatrixInset::octavize(OctaveStream & os) const
71 {
72         os << '[';
73         for (row_type row = 0; row < nrows(); ++row) {
74                 if (row)
75                         os << ';';
76                 os << '[';
77                 for (col_type col = 0; col < ncols(); ++col)
78                         os << cell(index(row, col)) << ' ';
79                 os << ']';
80         }
81         os << ']';
82 }