derive.h

00001 
00002 //  Math Type Library
00003 //  $Id: derive.h,v 1.4 2002/04/20 06:29:54 cparpart Exp $
00004 //  (This file contains the derivation-specific interface)
00005 //
00006 //  Copyright (c) 2002 by Christian Parpart <cparpart@surakware.net>
00007 //
00008 //  This library is free software; you can redistribute it and/or
00009 //  modify it under the terms of the GNU Library General Public
00010 //  License as published by the Free Software Foundation; either
00011 //  version 2 of the License, or (at your option) any later version.
00012 //
00013 //  This library is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //  Library General Public License for more details.
00017 // 
00018 //  You should have received a copy of the GNU Library General Public License
00019 //  along with this library; see the file COPYING.LIB.  If not, write to
00020 //  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021 //  Boston, MA 02111-1307, USA.
00023 #ifndef libmath_derive_h
00024 #define libmath_derive_h
00025 
00026 #include <math++/visitor.h>
00027 
00028 namespace math {
00029 
00033 template<class T>
00034 class TDeriver : public TNodeVisitor<T> {
00035 public:
00039     static TNode<T> *derive(TNode<T> *AExpression);
00040 
00041 private:
00042     TNode<T> *FResult;
00043 
00044 private:
00045     TDeriver();
00046 
00047     virtual void visit(TNumberNode<T> *);
00048     virtual void visit(TSymbolNode<T> *);
00049     virtual void visit(TParamNode<T> *);
00050 
00051     virtual void visit(TPlusNode<T> *);
00052     virtual void visit(TNegNode<T> *);
00053 
00054     virtual void visit(TMulNode<T> *);
00055     virtual void visit(TDivNode<T> *);
00056 
00057     virtual void visit(TPowNode<T> *);
00058     virtual void visit(TSqrtNode<T> *);
00059 
00060     virtual void visit(TSinNode<T> *);
00061     virtual void visit(TCosNode<T> *);
00062     virtual void visit(TTanNode<T> *);
00063     virtual void visit(TLnNode<T> *);
00064 
00065     virtual void visit(TFuncNode<T> *);
00066     virtual void visit(TIfNode<T> *);
00067 
00068     virtual void visit(TEquNode<T> *);
00069     virtual void visit(TUnEquNode<T> *);
00070     virtual void visit(TGreaterNode<T> *);
00071     virtual void visit(TLessNode<T> *);
00072     virtual void visit(TGreaterEquNode<T> *);
00073     virtual void visit(TLessEquNode<T> *);
00074 };
00075 
00076 } // namespace math
00077 
00078 #include <math++/derive.tcc>
00079 
00080 #endif

Generated on Mon Nov 28 20:08:59 2005 for MathTypeLibrary(libmath++) by  doxygen 1.4.5