• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

Analitza

  • sources
  • kde-4.14
  • kdeedu
  • analitza
  • analitza
polynomial.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2011 by Aleix Pol <aleixpol@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License *
6  * as published by the Free Software Foundation; either version 2 *
7  * of the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the Free Software *
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17  *************************************************************************************/
18 
19 
20 #ifndef POLYNOMIAL_H
21 #define POLYNOMIAL_H
22 
23 #include <QList>
24 #include "operator.h"
25 
26 namespace Analitza {
27 
28 class Apply;
29 class Object;
30 class Operator;
31 
42 class Monomial
43 {
44  public:
45  Monomial(const Operator& o, Object* o2, bool& sign);
46  Analitza::Object* createMono(const Analitza::Operator& o) const;
47  bool isValue() const;
48  static bool isScalar(const Object* o);
49 
50  qreal first;
51  Analitza::Object* second;
52 };
53 
67 class Polynomial : public QList<Monomial>
68 {
69  public:
70  Polynomial(Apply* c);
71 
72  Analitza::Object* toObject();
73  void negate(int i);
74 
75  private:
76  void addMonomial(const Monomial& m);
77  void addValue(Analitza::Object* value);
78  void simpScalars(bool m_firstValue);
79  QList<Object*> m_scalars;
80  Operator m_operator;
81  bool m_sign;
82 };
83 
84 }
85 
86 #endif // POLYNOMIAL_H
Analitza::Monomial::Monomial
Monomial(const Operator &o, Object *o2, bool &sign)
Analitza::Monomial::first
qreal first
Definition: polynomial.h:50
Analitza::Monomial::second
Analitza::Object * second
Definition: polynomial.h:51
Analitza::Polynomial::toObject
Analitza::Object * toObject()
Analitza::Operator
Is the operator representation in the trees.
Definition: operator.h:36
Analitza::Monomial::isScalar
static bool isScalar(const Object *o)
QList< Monomial >::value
T value(int i) const
Analitza::Polynomial::negate
void negate(int i)
Analitza::Polynomial
Polynomial object.
Definition: polynomial.h:67
operator.h
QList
Analitza::Monomial::isValue
bool isValue() const
Analitza::Monomial::createMono
Analitza::Object * createMono(const Analitza::Operator &o) const
Analitza::Object
Definition: object.h:38
Analitza::Apply
This class is the one that will correspond to MathML apply tags.
Definition: apply.h:41
Analitza::Monomial
Monomial object.
Definition: polynomial.h:42
Analitza::Polynomial::Polynomial
Polynomial(Apply *c)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Analitza

Skip menu "Analitza"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal