diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2010-12-01 16:00:50 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2010-12-01 16:00:50 +0000 |
commit | 2da52222a3310d6e204392b02c0c43c346e1b22b (patch) | |
tree | a858d40e6fdbc0a35ab1a205d42865aad2018176 /core | |
parent | e7a6f648c3bc2d398bb1960de3eecd1b25c77532 (diff) | |
download | opt-utilities-2da52222a3310d6e204392b02c0c43c346e1b22b.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@145 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'core')
-rw-r--r-- | core/freeze_param.hpp | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/core/freeze_param.hpp b/core/freeze_param.hpp index f85c1a8..1404980 100644 --- a/core/freeze_param.hpp +++ b/core/freeze_param.hpp @@ -172,6 +172,19 @@ namespace opt_utilities return result; } + freeze_param plus(const freeze_param& fp)const + { + freeze_param result(*this); + for(typename std::set<Tstr>::const_iterator i=fp.param_names.begin(); + i!=fp.param_names.end(); + ++i) + { + result.param_names.insert(*i); + } + return result; + } + + /** += operator like the plus operator @@ -198,6 +211,29 @@ namespace opt_utilities return *this; } + freeze_param& plus_eq(const freeze_param& fp) + { + //param_names.insert(param_names.end(), + //fp.param_names.begin(), + //fp.param_names.end()); + for(typename std::set<Tstr>::const_iterator i=fp.param_names.begin(); + i!=fp.param_names.end(); + ++i) + { + param_names.insert(*i); + } + try + { + update(); + } + catch(opt_exception& e) + { + throw; + } + return *this; + } + + /** un-freeze a parameter to a list of pre-frozen parameter list @@ -226,8 +262,32 @@ namespace opt_utilities return *this; } - }; + freeze_param& minus_eq(const freeze_param& fp) + { + //param_names.insert(param_names.end(), + //fp.param_names.begin(), + //fp.param_names.end()); + for(typename std::set<Tstr>::const_iterator i=fp.param_names.begin(); + i!=fp.param_names.end(); + ++i) + { + param_names.erase(*i); + } + try + { + update(); + } + catch(opt_exception& e) + { + throw; + } + return *this; + } + + }; + + /** help function to create a freeze_param object \param name the name to be frozen |