7 #include "math_exfuncinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
13 MathExFuncInset::MathExFuncInset(string const & name)
14 : MathNestInset(1), name_(name)
18 MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
19 : MathNestInset(1), name_(name)
25 MathInset * MathExFuncInset::clone() const
27 return new MathExFuncInset(*this);
31 void MathExFuncInset::metrics(MathMetricsInfo & mi) const
33 mathed_string_dim(mi.base.font, name_, dim_);
37 void MathExFuncInset::draw(MathPainterInfo & pi, int x, int y) const
39 drawStrBlack(pi, x, y, name_);
43 string MathExFuncInset::name() const
49 void MathExFuncInset::maplize(MapleStream & os) const
52 os << "linalg[det](" << cell(0) << ')';
54 os << name_ << '(' << cell(0) << ')';
58 void MathExFuncInset::maximize(MaximaStream & os) const
61 os << "determinant(" << cell(0) << ')';
63 os << name_ << '(' << cell(0) << ')';
67 string asMathematicaName(string const & name)
69 if (name == "sin") return "Sin";
70 if (name == "sinh") return "Sinh";
71 if (name == "arcsin") return "ArcSin";
72 if (name == "cos") return "Cos";
73 if (name == "cosh") return "Cosh";
74 if (name == "arcos") return "ArcCos";
75 if (name == "tan") return "Tan";
76 if (name == "tanh") return "Tanh";
77 if (name == "arctan") return "ArcTan";
78 if (name == "cot") return "Cot";
79 if (name == "coth") return "Coth";
80 if (name == "csc") return "Csc";
81 if (name == "sec") return "Sec";
82 if (name == "exp") return "Exp";
83 if (name == "log") return "Log";
84 if (name == "ln" ) return "Log";
89 void MathExFuncInset::mathematicize(MathematicaStream & os) const
91 os << asMathematicaName(name_) << '[' << cell(0) << ']';
95 void MathExFuncInset::mathmlize(MathMLStream & os) const
97 os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
101 void MathExFuncInset::octavize(OctaveStream & os) const
103 os << name_ << '(' << cell(0) << ')';