/* * EmpiricalPotential.hpp * * Created on: Sep 26, 2012 * Author: heber */ #ifndef EMPIRICALPOTENTIAL_HPP_ #define EMPIRICALPOTENTIAL_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "FunctionApproximation/FunctionArgument.hpp" /** An EmpiricalPotential is a function that is given a vector of objects as * arguments which it uses to evaluate an internal function and returns a * value representing the energy of this configuration indicated by the * arguments. * * It is to be used inside an std::accumulate function after a vector of * arguments (i.e. a vector of a vector) has been prepared initially. * */ class EmpiricalPotential { public: //!> typedef for the argument vector as input to the function typedef std::vector arguments_t; //!> typedef for a single result degree of freedom typedef double result_t; //!> typedef for the result vector as returned by the function typedef std::vector results_t; //!> typedef for the components of the derivative typedef std::vector derivative_components_t; /** Default constructor for class EmpiricalPotential. * */ EmpiricalPotential() {} /** Destructor for class EmpiricalPotential. * */ virtual ~EmpiricalPotential() {} /** Evaluates the function with the given \a arguments and the current set of * parameters. * * \param arguments set of arguments as input variables to the function * \return result of the function */ virtual results_t operator()(const arguments_t &arguments) const=0; /** Evaluates the derivative of the function with the given \a arguments * for each component. * * \param arguments set of arguments as input variables to the function * \return result vector containing the derivative with respect to each * input comonent of the function */ virtual derivative_components_t derivative(const arguments_t &arguments) const=0; }; #endif /* EMPIRICALPOTENTIAL_HPP_ */