30 #include <boost/lexical_cast.hpp>
31 #include <boost/numeric/conversion/converter.hpp>
53 typedef boost::numeric::converter<int,double,boost::numeric::conversion_traits<int,double>,
54 boost::numeric::def_overflow_handler,boost::numeric::RoundEven<double> >
double_to_int;
58 #ifndef PAGMO_NO_STD_VECTOR_STREAM_OVERLOADS
60 #define PAGMO_MAX_OUTPUT_LENGTH 5
66 inline ostream &operator<<(ostream &os, const vector<T> &v)
68 typename vector<T>::size_type len = v.size();
69 if (len < PAGMO_MAX_OUTPUT_LENGTH)
72 for (
typename std::vector<T>::size_type i = 0; i < v.size(); ++i) {
73 os << boost::lexical_cast<std::string>(v[i]);
74 if (i != v.size() - 1) {
81 for (
typename std::vector<T>::size_type i = 0; i < PAGMO_MAX_OUTPUT_LENGTH; ++i) {
82 os << boost::lexical_cast<std::string>(v[i]) <<
", ";
91 #undef PAGMO_MAX_OUTPUT_LENGTH
std::vector< double > decision_vector
Decision vector type.
std::vector< double > fitness_vector
Fitness vector type.
std::vector< double > constraint_vector
Constraint vector type.
boost::numeric::converter< int, double, boost::numeric::conversion_traits< int, double >, boost::numeric::def_overflow_handler, boost::numeric::RoundEven< double > > double_to_int
Double to int converter.