Math Type Library (libmath++) 0.0.3
derive.h
1
2// Math Type Library
3// $Id: derive.h,v 1.4 2002/04/20 06:29:54 cparpart Exp $
4// (This file contains the derivation-specific interface)
5//
6// Copyright (c) 2002 by Christian Parpart <cparpart@surakware.net>
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Library General Public
10// License as published by the Free Software Foundation; either
11// version 2 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Library General Public License for more details.
17//
18// You should have received a copy of the GNU Library General Public License
19// along with this library; see the file COPYING.LIB. If not, write to
20// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21// Boston, MA 02111-1307, USA.
23#ifndef libmath_derive_h
24#define libmath_derive_h
25
26#include <math++/visitor.h>
27
28namespace math {
29
33template<class T>
34class TDeriver : public TNodeVisitor<T> {
35public:
39 static TNode<T> *derive(TNode<T> *AExpression);
40
41private:
42 TNode<T> *FResult;
43
44private:
45 TDeriver();
46
47 virtual void visit(TNumberNode<T> *);
48 virtual void visit(TSymbolNode<T> *);
49 virtual void visit(TParamNode<T> *);
50
51 virtual void visit(TPlusNode<T> *);
52 virtual void visit(TNegNode<T> *);
53
54 virtual void visit(TMulNode<T> *);
55 virtual void visit(TDivNode<T> *);
56
57 virtual void visit(TPowNode<T> *);
58 virtual void visit(TSqrtNode<T> *);
59
60 virtual void visit(TSinNode<T> *);
61 virtual void visit(TCosNode<T> *);
62 virtual void visit(TTanNode<T> *);
63 virtual void visit(TLnNode<T> *);
64
65 virtual void visit(TFuncNode<T> *);
66 virtual void visit(TIfNode<T> *);
67
68 virtual void visit(TEquNode<T> *);
69 virtual void visit(TUnEquNode<T> *);
70 virtual void visit(TGreaterNode<T> *);
71 virtual void visit(TLessNode<T> *);
72 virtual void visit(TGreaterEquNode<T> *);
73 virtual void visit(TLessEquNode<T> *);
74};
75
76} // namespace math
77
78#include <math++/derive.tcc>
79
80#endif
static TNode< T > * derive(TNode< T > *AExpression)