A bit more re-organization.
[lyx.git] / src / mathed / InsetMathMatrix.cpp
blobb4cecfa6c3785871f3b86c3e0913d2b9de9921a9
1 /**
2 * \file InsetMathMatrix.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author André Pönitz
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "InsetMathMatrix.h"
14 #include "MathData.h"
15 #include "MathStream.h"
18 namespace lyx {
20 InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p)
21 : InsetMathGrid(p)
25 Inset * InsetMathMatrix::clone() const
27 return new InsetMathMatrix(*this);
31 void InsetMathMatrix::write(WriteStream & os) const
33 InsetMathGrid::write(os);
37 void InsetMathMatrix::normalize(NormalStream & os) const
39 InsetMathGrid::normalize(os);
43 void InsetMathMatrix::maple(MapleStream & os) const
45 os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
46 for (idx_type idx = 0; idx < nargs(); ++idx) {
47 if (idx)
48 os << ',';
49 os << cell(idx);
51 os << "])";
55 void InsetMathMatrix::maxima(MaximaStream & os) const
57 os << "matrix(";
58 for (row_type row = 0; row < nrows(); ++row) {
59 if (row)
60 os << ',';
61 os << '[';
62 for (col_type col = 0; col < ncols(); ++col) {
63 if (col)
64 os << ',';
65 os << cell(index(row, col));
67 os << ']';
69 os << ')';
73 void InsetMathMatrix::mathematica(MathematicaStream & os) const
75 os << '{';
76 for (row_type row = 0; row < nrows(); ++row) {
77 if (row)
78 os << ',';
79 os << '{';
80 for (col_type col = 0; col < ncols(); ++col) {
81 if (col)
82 os << ',';
83 os << cell(index(row, col));
85 os << '}';
87 os << '}';
91 void InsetMathMatrix::mathmlize(MathStream & os) const
93 InsetMathGrid::mathmlize(os);
97 void InsetMathMatrix::octave(OctaveStream & os) const
99 os << '[';
100 for (row_type row = 0; row < nrows(); ++row) {
101 if (row)
102 os << ';';
103 os << '[';
104 for (col_type col = 0; col < ncols(); ++col)
105 os << cell(index(row, col)) << ' ';
106 os << ']';
108 os << ']';
112 } // namespace lyx