/************************************************************************************* * Copyright (C) 2007 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ #include "operator.h" #include "expressionwriter.h" using namespace Analitza; const char Operator::words[nOfOps][14] = { "onone", "plus", "times", "minus", "divide", "quotient", "power", "root", "factorial", "and", "or", "xor", "not", "gcd", "lcm", "rem", "factorof", "max", "min", "lt", "gt", "eq", "neq", "leq", "geq", "implies", "approx", "abs", "floor", "ceiling", "sin", "cos", "tan", "sec", "csc", "cot", "sinh", "cosh", "tanh", "sech", "csch", "coth", "arcsin", "arccos", "arctan", "arccot", //"arccoth", "arccosh", "arccsc", "arccsch", "arcsec", "arcsech", "arcsinh", "arctanh", "exp", "ln", "log",// "real", // "conjugate", "arg", "imaginary", "sum", "product", "diff", //Vector operations "card", "scalarproduct", "selector", "union", "function" }; QString Operator::visit(ExpressionWriter* e) const { return e->accept(this); } QString Operator::name() const { Q_ASSERT(m_optype* ) const { if(exp->type()!=Object::oper) return false; return ((const Operator*) exp)->operatorType()==m_optype; }