2001-11-09 08:35:57 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_matrixinset.h"
|
|
|
|
#include "math_parser.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "Lsstream.h"
|
|
|
|
|
|
|
|
|
2002-04-24 17:07:42 +00:00
|
|
|
MathMatrixInset::MathMatrixInset(MathGridInset const & p)
|
|
|
|
: MathGridInset(p)
|
2001-11-09 08:35:57 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathMatrixInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathMatrixInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathMatrixInset::write(WriteStream & os) const
|
|
|
|
{
|
2002-04-24 17:07:42 +00:00
|
|
|
MathGridInset::write(os);
|
2001-11-09 08:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathMatrixInset::normalize(NormalStream & os) const
|
|
|
|
{
|
2002-04-24 17:07:42 +00:00
|
|
|
MathGridInset::normalize(os);
|
2001-11-09 08:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathMatrixInset::maplize(MapleStream & os) const
|
|
|
|
{
|
|
|
|
os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",[";
|
|
|
|
for (idx_type idx = 0; idx < nargs(); ++idx) {
|
|
|
|
if (idx)
|
|
|
|
os << ',';
|
|
|
|
os << cell(idx);
|
|
|
|
}
|
|
|
|
os << "])";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathMatrixInset::mathmlize(MathMLStream & os) const
|
|
|
|
{
|
2001-11-09 18:02:20 +00:00
|
|
|
MathGridInset::mathmlize(os);
|
2001-11-09 08:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathMatrixInset::octavize(OctaveStream & os) const
|
|
|
|
{
|
|
|
|
os << '[';
|
|
|
|
for (row_type row = 0; row < nrows(); ++row) {
|
|
|
|
if (row)
|
|
|
|
os << ';';
|
|
|
|
os << '[';
|
2002-03-21 17:42:56 +00:00
|
|
|
for (col_type col = 0; col < ncols(); ++col)
|
2001-11-09 08:35:57 +00:00
|
|
|
os << cell(index(row, col)) << ' ';
|
|
|
|
os << ']';
|
|
|
|
}
|
|
|
|
os << ']';
|
|
|
|
}
|