7#include "complex_number.h"
10#include "polynomial.h"
17 void showHelpMatrices();
18 std::vector<std::string> split(
const std::string& str);
21 void handleExpression(
const std::vector<std::string>& tokens);
22 void handleDerivative(
const std::vector<std::string>& tokens);
23 void handleIntegral(
const std::vector<std::string>& tokens);
24 void handleLimit(
const std::vector<std::string>& tokens);
25 void handleSeries(
const std::vector<std::string>& tokens);
27 void handlePolynomial(
const std::vector<std::string>& tokens);
29 void handlePolynomialAdd(
const std::vector<std::string>& tokens);
33 void handlePolynomialEvaluate(
const std::vector<std::string>& tokens);
37 void handlePolynomialRoots(
const std::vector<std::string>& tokens);
41 void handleComplex(
const std::vector<std::string>& tokens);
42 void handleComplexAdd(
const std::vector<std::string>& tokens);
43 void handleComplexMultiply(
const std::vector<std::string>& tokens);
44 void handleComplexPower(
const std::vector<std::string>& tokens);
45 void handleComplexRoots(
const std::vector<std::string>& tokens);
48 void handleMatrix(
const std::vector<std::string>& tokens);
49 void handleMatrixRaw(
const std::vector<std::string>& tokens);
50 void handleMatrixAdjoint(
const std::vector<std::string>& tokens);
51 void handleMatrixDisplay(
const std::vector<std::string>& tokens);
52 void handleMatrixRank(
const std::vector<std::string>& tokens);
53 void handleMatrixSet(
const std::vector<std::string>& tokens);
54 void handleMatrixDeterminant(
const std::vector<std::string>& tokens);
55 void handleMatrixInverse(
const std::vector<std::string>& tokens);
56 void handleMatrixEigenvalues(
const std::vector<std::string>& tokens);
57 void handleMatrixEigenvectors(
const std::vector<std::string>& tokens);
60 void handleLaplace(
const std::vector<std::string>& tokens);
61 void handleFourier(
const std::vector<std::string>& tokens);
64 void handleODE(
const std::vector<std::string>& tokens);
65 void handlePDE(
const std::vector<std::string>& tokens);
79 std::shared_ptr<Expression> parseExpression(
const std::string& exprStr);
80 std::string removeWhitespace(
const std::string& str);
81 std::shared_ptr<Expression> parseAddSub(
const std::string& expr,
size_t& pos);
82 std::shared_ptr<Expression> parseMulDiv(
const std::string& expr,
size_t& pos);
83 std::shared_ptr<Expression> parsePower(
const std::string& expr,
size_t& pos);
84 std::shared_ptr<Expression> parseFactor(
const std::string& expr,
size_t& pos);
85 std::shared_ptr<Expression> parseNumber(
const std::string& expr,
size_t& pos);
86 std::shared_ptr<Expression> parseVariableOrFunction(
const std::string& expr,
90 std::map<std::string, Polynomial> polynomials;
91 std::map<std::string, ComplexNumber> complexNumbers;
92 std::map<std::string, Matrix<float>> matrices;
93 std::map<std::string, std::shared_ptr<Expression>> expressions;
94 std::map<std::string, double> variables;