44 #ifndef OPTIPACK_UNCONSTRAINED_OPT_MERIT_FUNC_1D_DEF_HPP
45 #define OPTIPACK_UNCONSTRAINED_OPT_MERIT_FUNC_1D_DEF_HPP
48 #include "OptiPack_Types.hpp"
49 #include "OptiPack_LineSearchPointEvaluatorBase.hpp"
50 #include "Thyra_ModelEvaluatorHelpers.hpp"
51 #include "Thyra_VectorStdOps.hpp"
52 #include "GlobiPack_MeritFunc1DBase.hpp"
53 #include "Teuchos_Assert.hpp"
62 template<
typename Scalar>
69 template<
typename Scalar>
73 const int responseIndex
77 model.assert_not_null();
82 paramIndex_ = paramIndex;
83 responseIndex_ = responseIndex;
87 template<
typename Scalar>
96 pointEvaluator.assert_not_null();
98 g_vec.assert_not_null();
101 pointEvaluator_ = pointEvaluator;
104 g_grad_vec_ = g_grad_vec;
111 template<
typename Scalar>
118 template<
typename Scalar>
124 using Thyra::get_ele;
126 using Thyra::eval_g_DgDp;
127 pointEvaluator_->computePoint(alpha, p_.ptr());
130 "Error, g_grad_vec has not been implemented yet!.");
136 eval_g( *model_, paramIndex_, *p_, responseIndex_, g_vec_.ptr() );
137 *phi = get_ele(*g_vec_, 0);
145 #endif // OPTIPACK_UNCONSTRAINED_OPT_MERIT_FUNC_1D_DEF_HPP
UnconstrainedOptMeritFunc1D()
Construct with default parameters.
bool is_null(const boost::shared_ptr< T > &p)
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model, const int paramIndex, const int responseIndex)
Set the model.
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
virtual void eval(const ScalarMag &alpha, const Ptr< ScalarMag > &phi, const Ptr< ScalarMag > &Dphi) const
void setEvaluationQuantities(const RCP< const LineSearchPointEvaluatorBase< Scalar > > &pointEvaluator, const RCP< Thyra::VectorBase< Scalar > > &p, const RCP< Thyra::VectorBase< Scalar > > &g_vec, const RCP< Thyra::VectorBase< Scalar > > &g_grad_vec)
Set the evaluation qualities.
#define TEUCHOS_TEST_FOR_EXCEPT_MSG(throw_exception_test, msg)
ScalarTraits< Scalar >::magnitudeType ScalarMag
virtual bool supportsDerivEvals() const
Base class interface for line search point updates.
#define TEUCHOS_ASSERT(assertion_test)