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