/[ascend]/trunk/pygtk/solverparameter.cpp
ViewVC logotype

Diff of /trunk/pygtk/solverparameter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 951 by johnpye, Wed Oct 25 06:03:04 2006 UTC revision 952 by johnpye, Tue Nov 28 23:01:50 2006 UTC
# Line 3  Line 3 
3  #include <stdexcept>  #include <stdexcept>
4  #include <vector>  #include <vector>
5  #include <string>  #include <string>
6    #include <sstream>
7  using namespace std;  using namespace std;
8    
9  SolverParameter::SolverParameter(slv_parameter *p) : p(p){  SolverParameter::SolverParameter(slv_parameter *p) : p(p){
# Line 91  SolverParameter::setIntValue(const int & Line 92  SolverParameter::setIntValue(const int &
92          throw runtime_error("Not an integer parameter");          throw runtime_error("Not an integer parameter");
93      }      }
94      if(isBounded() && (val > getIntUpperBound() || val < getIntLowerBound())){      if(isBounded() && (val > getIntUpperBound() || val < getIntLowerBound())){
95          throw runtime_error("Out of bounds");          stringstream ss;
96            ss << "Out of bounds (range is [" << getIntLowerBound() << "," << getIntUpperBound() << "])" << endl;
97            throw runtime_error(ss.str());
98      }      }
99      p->info.i.value = val;      p->info.i.value = val;
100  }  }
# Line 146  SolverParameter::setRealValue(const doub Line 149  SolverParameter::setRealValue(const doub
149          throw runtime_error("Not a real parameter");          throw runtime_error("Not a real parameter");
150      }      }
151      if(isBounded() && (val > getRealUpperBound() || val < getRealLowerBound())){      if(isBounded() && (val > getRealUpperBound() || val < getRealLowerBound())){
152          throw runtime_error("Out of bounds");          stringstream ss;
153            ss << "Out of bounds (range is [" << getRealLowerBound() << "," << getRealUpperBound() << "])" << endl;
154            throw runtime_error(ss.str());
155      }      }
156      p->info.r.value = val;      p->info.r.value = val;
157  }  }

Legend:
Removed from v.951  
changed lines
  Added in v.952

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22