1 /* _______________________________________________________________________ 2 3 PECOS: Parallel Environment for Creation Of Stochastics 4 Copyright (c) 2011, Sandia National Laboratories. 5 This software is distributed under the GNU Lesser General Public License. 6 For more information, see the README file in the top Pecos directory. 7 _______________________________________________________________________ */ 8 9 #include<BoundedVariables.hpp> 10 11 namespace Pecos { 12 namespace surrogates { 13 BoundedVariables()14BoundedVariables::BoundedVariables(){} 15 ~BoundedVariables()16BoundedVariables::~BoundedVariables(){} 17 set_options(const util::OptionsList & opts)18void BoundedVariables::set_options(const util::OptionsList &opts){ 19 20 //set_ranges(ranges); 21 } 22 set_ranges(const RealVector & ranges)23void BoundedVariables::set_ranges(const RealVector &ranges){ 24 ranges_.sizeUninitialized(ranges.length()); 25 ranges_.assign(ranges); 26 set_num_vars(ranges.length()/2); 27 } 28 lb(int i) const29Real BoundedVariables::lb(int i) const{ 30 return ranges_[2*i]; 31 } 32 ub(int i) const33Real BoundedVariables::ub(int i) const{ 34 return ranges_[2*i+1]; 35 } 36 define_homogeneous_ranges(int num_vars,Real lb,Real ub,RealVector & ranges)37void define_homogeneous_ranges(int num_vars, Real lb, Real ub, 38 RealVector &ranges){ 39 ranges.sizeUninitialized(2*num_vars); 40 for (int i=0; i<num_vars; ++i){ 41 ranges[2*i] = lb; 42 ranges[2*i+1] = ub; 43 } 44 } 45 46 } // namespace surrogates 47 } // namespace Pecos 48