• 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
operations.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2007-2008 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 #ifndef OPERATIONS_H
20 #define OPERATIONS_H
21 
22 #include "operator.h"
23 #include <expressiontype.h>
24 
25 namespace Analitza
26 {
27 
28 class List;
29 class Cn;
30 class Vector;
31 class Matrix;
32 class CustomObject;
33 class ExpressionType;
34 
35 class Operations
36 {
37  public:
38  typedef Cn* (*UnaryOp)(Operator::OperatorType, Object*, QString**);
39  typedef Object * (*BinaryOp)(Operator::OperatorType op, Object *, Object *, QString** correct);
40 
41  static Object* reduce(Operator::OperatorType op, Object* oper, Object* oper1, QString** correct);
42  static Object* reduceUnary(Operator::OperatorType op, Object* oper, QString** correct);
43 
44  static QList<ExpressionType> infer(Analitza::Operator::OperatorType op);
45  static QList<ExpressionType> inferUnary(Operator::OperatorType op);
46 
47  private:
48  static UnaryOp opsUnary[Object::custom+1];
49  static BinaryOp opsBinary[Object::custom+1][Object::custom+1];
50 
51  static Cn* reduceRealReal(Operator::OperatorType op, Cn *oper, const Cn* oper1, QString** correct);
52  static Cn* reduceUnaryReal(Operator::OperatorType op, Cn *oper, QString** correct);
53 
54  static Object* reduceRealVector(Operator::OperatorType op, Cn *oper, Vector* vector, QString** correct);
55  static Object* reduceVectorReal(Operator::OperatorType op, Vector* vector, Cn *oper, QString** correct);
56  static Object* reduceVectorVector(Operator::OperatorType op, Vector* v1, Vector* v2, QString** correct);
57  static Cn* reduceUnaryVector(Operator::OperatorType op, Vector* c, QString** correct);
58 
59  static Object* reduceRealList(Operator::OperatorType op, Cn *oper, List* vector, QString** correct);
60  static Object* reduceListList(Operator::OperatorType op, List* l1, List* l2, QString** correct);
61  static Cn* reduceUnaryList(Operator::OperatorType op, List* l, QString** correct);
62 
63  static Object* reduceRealMatrix(Analitza::Operator::OperatorType op, Analitza::Cn* v, Analitza::Matrix* m1, QString** correct);
64  static Object* reduceMatrixMatrix(Operator::OperatorType op, Matrix* m1, Matrix* m2, QString** correct);
65  static Object* reduceUnaryMatrix(Analitza::Operator::OperatorType op, Analitza::Matrix* m, QString** correct);
66 
67  static Object* reduceCustomCustom(Operator::OperatorType op, CustomObject* v1, CustomObject* v2, QString** correct);
68 };
69 
70 }
71 #endif
Analitza::Operations::reduce
static Object * reduce(Operator::OperatorType op, Object *oper, Object *oper1, QString **correct)
Analitza::Cn
Cn is a value in MathML.
Definition: value.h:42
Analitza::CustomObject
Definition: customobject.h:39
Analitza::Vector
Definition: vector.h:34
expressiontype.h
Analitza::Matrix
Definition: matrix.h:38
Analitza::Object::custom
Describes a custom object.
Definition: object.h:53
operator.h
Analitza::Operations::UnaryOp
Cn *(* UnaryOp)(Operator::OperatorType, Object *, QString **)
Definition: operations.h:38
Analitza::Operations::BinaryOp
Object *(* BinaryOp)(Operator::OperatorType op, Object *, Object *, QString **correct)
Definition: operations.h:39
QString
QList
Analitza::Operations::reduceUnary
static Object * reduceUnary(Operator::OperatorType op, Object *oper, QString **correct)
Analitza::Operations::inferUnary
static QList< ExpressionType > inferUnary(Operator::OperatorType op)
Analitza::Object
Definition: object.h:38
Analitza::Operations
Definition: operations.h:35
Analitza::Operations::infer
static QList< ExpressionType > infer(Analitza::Operator::OperatorType op)
Analitza::Operator::OperatorType
OperatorType
Specifies the type of an operator.
Definition: operator.h:40
Analitza::List
Definition: list.h:34
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