Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

utils.h

00001 00002 // Math Type Library 00003 // $Id: utils.h,v 1.5 2002/04/23 02:48:38 cparpart Exp $ 00004 // (This file contains the interface to some utility methods) 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_utils_h 00024 #define libmath_utils_h 00025 00026 #include <vector> 00027 #include <utility> 00028 #include <string> 00029 00030 namespace math { 00031 00032 template<class> class TNode; 00033 template<class> class TLibrary; 00034 00038 bool isPrime(unsigned ANumber); 00039 00044 unsigned primeCount(unsigned long long ANumber, 00045 unsigned long long APrime); 00046 00056 unsigned factorize(unsigned long long ANumber, 00057 std::vector<std::pair<unsigned long long, unsigned long long> >& AResult); 00058 00063 std::string factorize(unsigned long long ANumber); 00064 00069 template<class T> 00070 T calculate(const std::string& AExpression); 00071 00075 template<class T> 00076 T calculate(const std::string& AExpression, const TLibrary<T>&); 00077 00082 template<class T> 00083 TNode<T> *derive(const TNode<T> *AExpression, unsigned ACount = 1); 00084 00089 template<class T> 00090 TNode<T> *simplify(const TNode<T> *AExpression); 00091 00096 template<class T> 00097 TNode<T> *expand(const TNode<T> *AExpression); 00098 00102 template<class T> 00103 TNode<T> *copyOf(const TNode<T> *AExpression); 00104 00108 template<class T> 00109 TNode<T> *createTree(const std::string& AExprStr); 00110 00114 template<class T> 00115 TNode<T> *umkehrfunktion(const TNode<T> *ATree); 00116 00120 template<class T> 00121 TNode<T> *integral(const TNode<T> *ATree); 00122 00123 } // namespace math 00124 00125 #include <math++/utils.tcc> 00126 00127 #endif

Generated on Thu Jul 29 08:56:44 2004 for MathTypeLibrary(libmath++) by doxygen 1.3.7