48 namespace ConstrainedOptPack {
56 : phi_(phi), p_(p), x_(x)
59 !(1 <= p && p <= 2 ), std::invalid_argument
60 ,
"MeritFuncCalc1DQuadratic::MeritFuncCalc1DQuadratic(...) : Error! "
61 "p = " << p <<
" must be in the range 1 <= p <= 2"
72 for(
size_type i = 1; i <=
p_; ++i, alpha_i *= alpha ) {
84 std::ostream&
out,
const std::string& L
87 out << L <<
"*** MeritFuncCalc1DQuadratic\n"
88 << L <<
"x = xo + alpha*d[1] + alpha^2*d[2]\n";
AbstractLinAlgPack::size_type size_type
value_type operator()(value_type alpha) const
Returns phi( x = sum( alpha^k * d[k], k = 0...p-1 ) ).
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
const MeritFuncCalc & phi_
value_type deriv() const
Returns phi.deriv()
const_VectorWithOp_ptr d_[3]
void print_merit_func(std::ostream &out, const std::string &leading_str) const
Calls phi->print_merit_func().
Abstract iterface for n-D merit functions {abstract}.
const Vector * const_VectorWithOp_ptr
virtual value_type deriv() const =0
Calls value(d_k) on aggregate merit_func.
virtual void print_merit_func(std::ostream &out, const std::string &leading_str) const =0
Print what this merit function is.
AbstractLinAlgPack::value_type value_type
MeritFuncCalc1DQuadratic()