X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_matrixinset.C;h=f1343b47362f52326f42b1c13c21dc6d57cbf230;hb=57501b93064a6deed43e415beed45606054d86ad;hp=d8a02da555b5d13a930e0d3c52990c7bb35ed0f3;hpb=c93e9dcbc59d0b404561dbc7c373716f11fc13f1;p=lyx.git diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index d8a02da555..f1343b4736 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -1,37 +1,46 @@ -#ifdef __GNUG__ -#pragma implementation -#endif +/** + * \file math_matrixinset.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author André Pönitz + * + * Full author contact details are available in file CREDITS. + */ + +#include #include "math_matrixinset.h" -#include "math_parser.h" +#include "math_data.h" #include "math_mathmlstream.h" -#include "Lsstream.h" + +using std::auto_ptr; -MathMatrixInset::MathMatrixInset(MathArrayInset const & p) - : MathArrayInset(p) +MathMatrixInset::MathMatrixInset(MathGridInset const & p) + : MathGridInset(p) {} -MathInset * MathMatrixInset::clone() const +auto_ptr MathMatrixInset::clone() const { - return new MathMatrixInset(*this); + return auto_ptr(new MathMatrixInset(*this)); } void MathMatrixInset::write(WriteStream & os) const { - MathArrayInset::write(os); + MathGridInset::write(os); } void MathMatrixInset::normalize(NormalStream & os) const { - MathArrayInset::normalize(os); + MathGridInset::normalize(os); } -void MathMatrixInset::maplize(MapleStream & os) const +void MathMatrixInset::maple(MapleStream & os) const { os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",["; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -43,27 +52,38 @@ void MathMatrixInset::maplize(MapleStream & os) const } -void MathMatrixInset::mathmlize(MathMLStream & os) const +void MathMatrixInset::maxima(MaximaStream & os) const { - os << MTag("mtable"); + os << "matrix("; for (row_type row = 0; row < nrows(); ++row) { - os << MTag("mtr"); - for (col_type col = 0; col < ncols(); ++col) + if (row) + os << ','; + os << '['; + for (col_type col = 0; col < ncols(); ++col) { + if (col) + os << ','; os << cell(index(row, col)); - os << ETag("mtr"); + } + os << ']'; } - os << ETag("mtable"); + os << ')'; +} + + +void MathMatrixInset::mathmlize(MathMLStream & os) const +{ + MathGridInset::mathmlize(os); } -void MathMatrixInset::octavize(OctaveStream & os) const +void MathMatrixInset::octave(OctaveStream & os) const { os << '['; for (row_type row = 0; row < nrows(); ++row) { if (row) os << ';'; os << '['; - for (col_type col = 0; col < ncols(); ++col) + for (col_type col = 0; col < ncols(); ++col) os << cell(index(row, col)) << ' '; os << ']'; }