/* * FunctionArgument.hpp * * Created on: 02.10.2012 * Author: heber */ #ifndef FUNCTIONARGUMENT_HPP_ #define FUNCTIONARGUMENT_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include /** This class encapsulates all information with respect to a single argument * for a high-dimensional model function. * * We restrict ourselves here to a function that dependent on a set of * three-dimensional vectors, i.e. a set of positions in space. And for * the moment to distances in between these sets. * */ struct argument_t { //!> grant operator access to private parts friend std::ostream& operator<<(std::ostream &ost, const argument_t &arg); //!> typedef for the two indices of the argument typedef std::pair indices_t; /** Default constructor for class argument_t. * */ argument_t() : indices( std::make_pair(0,1) ), distance(0.), globalid(-1) {} /** Constructor for class argument_t. * * This constructors uses the index pair (0,1) as default. * * \param _distance distance argument */ argument_t(const double &_distance) : indices( std::make_pair(0,1) ), distance(_distance), globalid(-1) {} /** Constructor for class argument_t. * * \param _indices pair of indices associated with the \a _distance * \param _distance distance argument */ argument_t(const indices_t &_indices, const double &_distance) : indices( _indices ), distance(_distance), globalid(-1) {} //!> indices between which the distance is given indices_t indices; //!> distance double distance; //!> global id refers to some global index, e.g. the configuration id in training set size_t globalid; }; /** Print given \a arg to stream \a ost. * * \param ost output stream to print to * \param arg argument to print * \return output stream for concatenation */ std::ostream& operator<<(std::ostream &ost, const argument_t &arg); #endif /* FUNCTIONARGUMENT_HPP_ */