From e331e74e46770124fe57d078cc713636dee272e4 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 6 Sep 2012 12:09:12 +0200 Subject: [PATCH] Set the mean of adaptive normal distrib with an EOT edoNormalAdaptive is using Eigen3 vectors internally, but the user is most probably using his own EO type. This patch adds a way to change the mean with an EOT instead of an Eigen3 vector. --- edo/src/edoNormalAdaptive.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/edo/src/edoNormalAdaptive.h b/edo/src/edoNormalAdaptive.h index 3d409140f..edde019b1 100644 --- a/edo/src/edoNormalAdaptive.h +++ b/edo/src/edoNormalAdaptive.h @@ -130,7 +130,22 @@ public: Vector path_covar() const {return _p_c;} Vector path_sigma() const {return _p_s;} + //! Set the mean with an Eigen3 vector void mean( Vector m ) { _mean = m; assert( m.size() == _dim ); } + + /** Set the mean with an EOT instead of an Eigen3 mean + * + * Explicit copy of the EOT in a vector. + */ + void mean( EOT m ) + { + Vector center( m.size() ); + for( unsigned int i=0, end=m.size(); i