File indexing completed on 2024-05-26 11:22:06

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2009-2012 Alexander Rieder <alexanderrieder@gmail.com>
0004 */
0005 
0006 #ifndef _MAXIMAEXTENSIONS_H
0007 #define _MAXIMAEXTENSIONS_H
0008 
0009 #include "extension.h"
0010 
0011 class MaximaHistoryExtension : public Cantor::HistoryExtension
0012 {
0013   public:
0014     explicit MaximaHistoryExtension( QObject* parent );
0015     ~MaximaHistoryExtension() override;
0016   public Q_SLOTS:
0017     QString lastResult() override;
0018 };
0019 
0020 class MaximaScriptExtension : public Cantor::ScriptExtension
0021 {
0022   public:
0023     explicit MaximaScriptExtension(QObject* parent);
0024     ~MaximaScriptExtension() override;
0025   public Q_SLOTS:
0026     QString runExternalScript(const QString& file) override;
0027     QString scriptFileFilter() override;
0028     QString highlightingMode() override;
0029     QString commentStartingSequence() override;
0030     QString commentEndingSequence() override;
0031 };
0032 
0033 
0034 class MaximaCASExtension : public Cantor::CASExtension
0035 {
0036   public:
0037     explicit MaximaCASExtension( QObject* parent);
0038     ~MaximaCASExtension() override;
0039 
0040   public Q_SLOTS:
0041     QString solve(const QStringList& equations, const QStringList& variables) override;
0042     QString simplify(const QString& expression) override;
0043     QString expand(const QString& expression) override;
0044 
0045 };
0046 
0047 class MaximaCalculusExtension : public Cantor::CalculusExtension
0048 {
0049   public:
0050     explicit MaximaCalculusExtension( QObject* parent);
0051     ~MaximaCalculusExtension() override;
0052 
0053   public Q_SLOTS:
0054     QString limit(const QString& expression, const QString& variable, const QString& limit) override;
0055     QString differentiate(const QString& function,const QString& variable, int times) override;
0056     QString integrate(const QString& function, const QString& variable) override;
0057     QString integrate(const QString& function,const QString& variable, const QString& left, const QString& right) override;
0058 };
0059 
0060 /** An extension for basic Linear Algebra
0061  **/
0062 class MaximaLinearAlgebraExtension : public Cantor::LinearAlgebraExtension
0063 {
0064   public:
0065     explicit MaximaLinearAlgebraExtension(QObject* parent);
0066     ~MaximaLinearAlgebraExtension() override;
0067 
0068   public Q_SLOTS:
0069     //Commands to create Vectors/Matrices
0070     QString createVector(const QStringList& entries, VectorType type) override;
0071     QString createMatrix(const Matrix& matrix) override;
0072     QString identityMatrix(int size) override;
0073 
0074     //basic functions
0075     QString rank(const QString& matrix) override;
0076     QString invertMatrix(const QString& matrix) override;
0077     QString charPoly(const QString& matrix) override;
0078     QString eigenVectors(const QString& matrix) override;
0079     QString eigenValues(const QString& matrix) override;
0080 
0081 };
0082 
0083 class MaximaPlotExtension : public Cantor::PlotExtension
0084 {
0085   public:
0086     explicit MaximaPlotExtension(QObject* parent);
0087     ~MaximaPlotExtension() override;
0088   public Q_SLOTS:
0089     QString plotFunction2d(const QString& function, const QString& variable, const QString& left, const QString& right) override;
0090     QString plotFunction3d(const QString& function, const VariableParameter& var1, const VariableParameter& var2) override;
0091 };
0092 
0093 class MaximaVariableManagementExtension : public Cantor::VariableManagementExtension
0094 {
0095   public:
0096     explicit MaximaVariableManagementExtension( QObject* parent );
0097     ~MaximaVariableManagementExtension() override;
0098 
0099   public Q_SLOTS:
0100     QString addVariable(const QString& name, const QString& value) override;
0101     QString setValue(const QString& name,const QString& value) override;
0102     QString removeVariable(const QString& name) override;
0103 
0104     QString saveVariables(const QString& fileName) override;
0105     QString loadVariables(const QString& fileName) override;
0106     QString clearVariables() override;
0107 };
0108 
0109 
0110 #endif /* _MAXIMAEXTENSIONS_H */