diff --git a/trunk/paradiseo-mo/src/continuator/moSolutionStat.h b/trunk/paradiseo-mo/src/continuator/moSolutionStat.h index f28f0c8a5..17a997e25 100644 --- a/trunk/paradiseo-mo/src/continuator/moSolutionStat.h +++ b/trunk/paradiseo-mo/src/continuator/moSolutionStat.h @@ -53,7 +53,7 @@ public : * @param _description a description of the parameter */ moSolutionStat(std::string _description = "solution"): - moStat(EOT(), _description) {} + moStat(EOT(), _description) { } /** * Initialization the solution by copy diff --git a/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h b/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h index 66f7a6ba2..b762ded7a 100644 --- a/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h +++ b/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h @@ -54,21 +54,30 @@ public: * @param _param the parameter of type double to save in the vector */ moVectorMonitor(eoValueParam & _param) : doubleParam(&_param), intParam(NULL), eotParam(NULL) - { } + { + // precision of the output by default + precisionOutput = std::cout.precision(); + } /** * Default Constructor * @param _param the parameter of type unsigned int to save in the vector */ moVectorMonitor(eoValueParam & _param) : doubleParam(NULL), intParam(&_param), eotParam(NULL) - { } + { + // precision of the output by default + precisionOutput = std::cout.precision(); + } /** * Default Constructor * @param _param the parameter of type EOT to save in the vector */ moVectorMonitor(eoValueParam & _param) : doubleParam(NULL), intParam(NULL), eotParam(&_param) - { } + { + // precision of the output by default + precisionOutput = std::cout.precision(); + } /** * Default Constructor @@ -76,7 +85,10 @@ public: */ template moVectorMonitor(eoValueParam > & _param) : doubleParam( & (eoValueParam&)_param), intParam(NULL), eotParam(NULL) - { } + { + // precision of the output by default + precisionOutput = std::cout.precision(); + } /** * Default Constructor @@ -139,6 +151,9 @@ public: std::string getValue(unsigned int i) const { std::ostringstream os; + // set the precision of the output + os.precision(precisionOutput); + if (eotParam == NULL) os << (valueVec[i]) ; else @@ -166,6 +181,14 @@ public: return eotVec.size(); } + /** + * to set the precision of the output file + * @param _precision precision of the output (number of digit) + */ + void precision(unsigned int _precision) { + precisionOutput = _precision; + } + /** * to export the vector of values into one file * @param _filename file name @@ -209,6 +232,10 @@ protected: std::vector valueVec; std::vector eotVec; + + // precision of the output + unsigned int precisionOutput; + };