os << "]";
}
-
-void MathAMSArrayInset::maplize(MapleStream & os) const
-{
- os << name_ << "(";
- MathGridInset::maplize(os);
- os << ")";
-}
void write(WriteStream & os) const;
///
void normalize(NormalStream &) const;
- ///
- void maplize(MapleStream &) const;
private:
///
#include <algorithm>
+#include "math_amsarrayinset.h"
#include "math_charinset.h"
#include "math_deliminset.h"
#include "math_diffinset.h"
void extractMatrices(MathArray & ar)
{
//lyxerr << "\nMatrices from: " << ar << "\n";
+ // first pass for explicitly delimited stuff
for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) {
MathDelimInset * del = (*it)->asDelimInset();
if (!del)
continue;
MathInset * arr = singleItem(del->cell(0));
- if (!arr || !arr->asArrayInset())
+ if (!arr || !arr->asGridInset())
continue;
- *it = MathAtom(new MathMatrixInset(*(arr->asArrayInset())));
+ *it = MathAtom(new MathMatrixInset(*(arr->asGridInset())));
+ }
+
+ // second pass for AMS "pmatrix" etc
+ for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) {
+ MathAMSArrayInset * ams = (*it)->asAMSArrayInset();
+ if (!ams)
+ continue;
+ *it = MathAtom(new MathMatrixInset(*ams));
}
//lyxerr << "\nMatrices to: " << ar << "\n";
}
class MathArrayInset;
+class MathAMSArrayInset;
class MathBraceInset;
class MathBoxInset;
class MathCharInset;
virtual bool validCell(idx_type) const { return true; }
/// identifies certain types of insets
+ virtual MathAMSArrayInset * asAMSArrayInset() { return 0; }
virtual MathArrayInset * asArrayInset() { return 0; }
virtual MathBraceInset * asBraceInset() { return 0; }
virtual MathBoxInset * asBoxInset() { return 0; }
}
+OctaveStream & operator<<(OctaveStream & ns, int i)
+{
+ ns.os() << i;
+ return ns;
+}
+
+
//////////////////////////////////////////////////////////////////////
OctaveStream & operator<<(OctaveStream &, char const *);
///
OctaveStream & operator<<(OctaveStream &, char);
+///
+OctaveStream & operator<<(OctaveStream &, int);
#include "Lsstream.h"
-MathMatrixInset::MathMatrixInset(MathArrayInset const & p)
- : MathArrayInset(p)
+MathMatrixInset::MathMatrixInset(MathGridInset const & p)
+ : MathGridInset(p)
{}
void MathMatrixInset::write(WriteStream & os) const
{
- MathArrayInset::write(os);
+ MathGridInset::write(os);
}
void MathMatrixInset::normalize(NormalStream & os) const
{
- MathArrayInset::normalize(os);
+ MathGridInset::normalize(os);
}
#ifndef MATH_MATRIXINSET_H
#define MATH_MATRIXINSET_H
-#include "math_arrayinset.h"
+#include "math_gridinset.h"
#ifdef __GNUG__
#pragma interface
// "shortcut" for DelimInset("(",ArrayInset,")")
-class MathMatrixInset : public MathArrayInset {
+class MathMatrixInset : public MathGridInset {
public:
///
- MathMatrixInset(MathArrayInset const &);
+ MathMatrixInset(MathGridInset const &);
///
MathMatrixInset(string const & str);
///