13 return slope_ *
x + intercept_;
18 std::stringstream
ss(
"");
19 ss <<
"y = " << slope_ <<
" * x + " << intercept_;
25 return constant_ *
exp(exponent_ *
x) + intercept_;
30 std::stringstream
ss(
"");
31 ss <<
"y = " << constant_
32 <<
" * exp(" << exponent_ <<
" * x) + " << intercept_;
39 if (functions_.empty() || (
x < functions_.front().xoffset)) {
42 std::list<PiecewiseFunctionInfo>::iterator f = functions_.begin();
43 while (f != functions_.end() && (
x >= f->xoffset)) {
47 ret = f->function->value(
x - f->xoffset) + f->yoffset;
54 std::stringstream
ss(
"");
55 ss <<
"Piecewise Function comprised of: ";
56 std::list<PiecewiseFunctionInfo>::iterator f;
57 for (f = functions_.begin(); f != functions_.end(); f++) {
58 ss <<
" * " << f->function->Print()
59 <<
" starting at coordinate (" << f->xoffset <<
","
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters