8 #include "math_exfuncinset.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
11 #include "math_streamstr.h"
14 MathExFuncInset::MathExFuncInset(string const & name)
15 : MathNestInset(1), name_(name)
19 MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
20 : MathNestInset(1), name_(name)
26 MathInset * MathExFuncInset::clone() const
28 return new MathExFuncInset(*this);
32 void MathExFuncInset::metrics(MathMetricsInfo & mi) const
34 mathed_string_dim(mi.base.font, name_, dim_);
38 void MathExFuncInset::draw(MathPainterInfo & pi, int x, int y) const
40 drawStrBlack(pi, x, y, name_);
44 string MathExFuncInset::name() const
50 void MathExFuncInset::maplize(MapleStream & os) const
53 os << "linalg[det](" << cell(0) << ')';
55 os << name_ << '(' << cell(0) << ')';
59 string asMathematicaName(string const & name)
61 if (name == "sin") return "Sin";
62 if (name == "sinh") return "Sinh";
63 if (name == "arcsin") return "ArcSin";
64 if (name == "cos") return "Cos";
65 if (name == "cosh") return "Cosh";
66 if (name == "arcos") return "ArcCos";
67 if (name == "tan") return "Tan";
68 if (name == "tanh") return "Tanh";
69 if (name == "arctan") return "ArcTan";
70 if (name == "cot") return "Cot";
71 if (name == "coth") return "Coth";
72 if (name == "csc") return "Csc";
73 if (name == "sec") return "Sec";
74 if (name == "exp") return "Exp";
75 if (name == "log") return "Log";
76 if (name == "ln" ) return "Log";
81 void MathExFuncInset::mathematicize(MathematicaStream & os) const
83 os << asMathematicaName(name_) << '[' << cell(0) << ']';
87 void MathExFuncInset::mathmlize(MathMLStream & os) const
89 os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
93 void MathExFuncInset::octavize(OctaveStream & os) const
95 os << name_ << '(' << cell(0) << ')';