utils.h
// Math Type Library
// $Id: utils.h,v 1.5 2002/04/23 02:48:38 cparpart Exp $
// (This file contains the interface to some utility methods)
//
// Copyright (c) 2002 by Christian Parpart <cparpart@surakware.net>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#ifndef libmath_utils_h
#define libmath_utils_h
#include <vector>
#include <utility>
#include <string>
namespace math {
template<class> class TNode;
template<class> class TLibrary;
bool isPrime(unsigned ANumber);
unsigned primeCount(unsigned long long ANumber,
unsigned long long APrime);
unsigned factorize(unsigned long long ANumber,
std::vector<std::pair<unsigned long long, unsigned long long> >& AResult);
std::string factorize(unsigned long long ANumber);
template<class T>
T calculate(const std::string& AExpression);
template<class T>
T calculate(const std::string& AExpression, const TLibrary<T>&);
template<class T>
TNode<T> *derive(const TNode<T> *AExpression, unsigned ACount = 1);
template<class T>
TNode<T> *simplify(const TNode<T> *AExpression);
template<class T>
TNode<T> *expand(const TNode<T> *AExpression);
template<class T>
TNode<T> *copyOf(const TNode<T> *AExpression);
template<class T>
TNode<T> *createTree(const std::string& AExprStr);
template<class T>
TNode<T> *umkehrfunktion(const TNode<T> *ATree);
template<class T>
TNode<T> *integral(const TNode<T> *ATree);
} // namespace math
#include <math++/utils.tcc>
#endif