- Main Page
- Classes
- Files

- Search for |

# moeoConvertPopToObjectiveVectors.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoConvertPopToObjectiveVectors.h
    00005 // (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
    00006 /*
    00007     This library...
    00008
    00009     Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
    00010  */
    00011 //-----------------------------------------------------------------------------
    00012
    00013 #ifndef MOEOPOPTOOBJECTIVEVECTORS_H_
    00014 #define MOEOPOPTOOBJECTIVEVECTORS_H_
    00015
    00016 #include <vector>
    00017 #include <eoFunctor.h>
    00018
    00022 template < class MOEOT, class ObjectiveVector = typename MOEOT::ObjectiveVector >
    00023 class moeoConvertPopToObjectiveVectors : public eoUF < const eoPop < MOEOT >, const std::vector < ObjectiveVector > >
    00024 {
    00025 public:
    00026
    00031     const std::vector < ObjectiveVector > operator()(const eoPop < MOEOT > _pop)
    00032     {
    00033         std::vector < ObjectiveVector > result;
    00034         result.resize(_pop.size());
    00035         for (unsigned int i=0; i<_pop.size(); i++)
    00036         {
    00037             result.push_back(_pop[i].objectiveVector());
    00038         }
    00039         return result;
    00040     }
    00041
    00042 };
    00043
    00044 #endif /*MOEOPOPTOOBJECTIVEVECTORS_H_*/