[roboptim-commit] [SCM] roboptim-core branch, master, updated. v0.3-36-gfff55e7
Status: Beta
Brought to you by:
flamiraux
From: Thomas M. <tho...@us...> - 2009-11-15 21:13:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "roboptim-core". The branch, master has been updated via fff55e7d16aeb9cd039d84eb1377a236ae0c0a59 (commit) from 4e6c1d585f92379c335190c05fa7364e6c0e0fbd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fff55e7d16aeb9cd039d84eb1377a236ae0c0a59 Author: Thomas Moulard <tho...@gm...> Date: Sun Nov 15 22:11:10 2009 +0100 Implement display normalization for vectors. * include/roboptim/core/visualization/gnuplot.hh: Here. Signed-off-by: Thomas Moulard <tho...@gm...> diff --git a/ChangeLog b/ChangeLog index f19faa2..77837f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-15 Thomas Moulard <tho...@gm...> + Implement display normalization for vectors. + * include/roboptim/core/visualization/gnuplot.hh: Here. + +2009-11-15 Thomas Moulard <tho...@gm...> + Normalize floating points numbers before display. * include/roboptim/core/visualization/gnuplot-function.hh, * include/roboptim/core/visualization/gnuplot.hh: Normalize before display. diff --git a/include/roboptim/core/visualization/gnuplot.hh b/include/roboptim/core/visualization/gnuplot.hh index e533095..890c38e 100644 --- a/include/roboptim/core/visualization/gnuplot.hh +++ b/include/roboptim/core/visualization/gnuplot.hh @@ -37,13 +37,27 @@ namespace roboptim /// point numbers to get a consistent output. double normalize (const double& x); - inline double normalize (const double& x) + /// \brief Apply normalize to each element of a vector. + std::vector<double> normalize (const std::vector<double>& x); + + inline double + normalize (const double& x) { if (x == -0.) return 0.; return x; } + inline std::vector<double> + normalize (const std::vector<double>& x) + { + std::vector<double> res (x.size ()); + for (unsigned i = 0; i < x.size (); ++i) + res[i] = x[i]; + return res; + } + + /// \brief Gnuplot script /// /// This class gathers Gnuplot commands ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ include/roboptim/core/visualization/gnuplot.hh | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletions(-) hooks/post-receive -- roboptim-core |