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