]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.C
Point fix, earlier forgotten
[lyx.git] / src / mathed / math_matrixinset.C
1 /**
2  * \file math_matrixinset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_matrixinset.h"
14 #include "math_parser.h"
15 #include "math_mathmlstream.h"
16 #include "Lsstream.h"
17
18 using std::auto_ptr;
19
20
21 MathMatrixInset::MathMatrixInset(MathGridInset const & p)
22         : MathGridInset(p)
23 {}
24
25
26 auto_ptr<InsetBase> MathMatrixInset::clone() const
27 {
28         return auto_ptr<InsetBase>(new MathMatrixInset(*this));
29 }
30
31
32 void MathMatrixInset::write(WriteStream & os) const
33 {
34         MathGridInset::write(os);
35 }
36
37
38 void MathMatrixInset::normalize(NormalStream & os) const
39 {
40         MathGridInset::normalize(os);
41 }
42
43
44 void MathMatrixInset::maple(MapleStream & os) const
45 {
46         os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
47         for (idx_type idx = 0; idx < nargs(); ++idx) {
48                 if (idx)
49                         os << ',';
50                 os << cell(idx);
51         }
52         os << "])";
53 }
54
55
56 void MathMatrixInset::maxima(MaximaStream & os) const
57 {
58         os << "matrix(";
59         for (row_type row = 0; row < nrows(); ++row) {
60                 if (row)
61                         os << ',';
62                 os << '[';
63                 for (col_type col = 0; col < ncols(); ++col) {
64                         if (col)
65                                 os << ',';
66                         os << cell(index(row, col));
67                 }
68                 os << ']';
69         }
70         os << ')';
71 }
72
73
74 void MathMatrixInset::mathmlize(MathMLStream & os) const
75 {
76         MathGridInset::mathmlize(os);
77 }
78
79
80 void MathMatrixInset::octave(OctaveStream & os) const
81 {
82         os << '[';
83         for (row_type row = 0; row < nrows(); ++row) {
84                 if (row)
85                         os << ';';
86                 os << '[';
87                 for (col_type col = 0; col < ncols(); ++col)
88                         os << cell(index(row, col)) << ' ';
89                 os << ']';
90         }
91         os << ']';
92 }