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 void MathExFuncInset::maximize(MaximaStream & os) const
62 os << "determinant(" << cell(0) << ')';
64 os << name_ << '(' << cell(0) << ')';
68 string asMathematicaName(string const & name)
70 if (name == "sin") return "Sin";
71 if (name == "sinh") return "Sinh";
72 if (name == "arcsin") return "ArcSin";
73 if (name == "cos") return "Cos";
74 if (name == "cosh") return "Cosh";
75 if (name == "arcos") return "ArcCos";
76 if (name == "tan") return "Tan";
77 if (name == "tanh") return "Tanh";
78 if (name == "arctan") return "ArcTan";
79 if (name == "cot") return "Cot";
80 if (name == "coth") return "Coth";
81 if (name == "csc") return "Csc";
82 if (name == "sec") return "Sec";
83 if (name == "exp") return "Exp";
84 if (name == "log") return "Log";
85 if (name == "ln" ) return "Log";
90 void MathExFuncInset::mathematicize(MathematicaStream & os) const
92 os << asMathematicaName(name_) << '[' << cell(0) << ']';
96 void MathExFuncInset::mathmlize(MathMLStream & os) const
98 os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
102 void MathExFuncInset::octavize(OctaveStream & os) const
104 os << name_ << '(' << cell(0) << ')';