42 #ifdef CONSTRAINED_OPTIMIZATION_PACK_USE_QPOPT
78 void qphess_server_relax(
const f_int&
N,
const f_int&
LDH
79 ,
const f_int&
JTHCOL,
const f_dbl_prec*
H,
const f_dbl_prec*
X, f_dbl_prec*
HX
80 , f_int*
IW,
const f_int&
LENIW, f_dbl_prec*
W,
const f_int&
LENW )
85 using ConstrainedOptPack::QPSolverRelaxedQPOPT;
89 const QPSolverRelaxedQPOPT* qp_solver =
reinterpret_cast<const QPSolverRelaxedQPOPT*
>(
H);
102 hx(N) = qp_solver->use_as_bigM() * x(N);
110 hx(N) = qp_solver->use_as_bigM();
137 ,
const f_int&
JTHCOL,
const f_dbl_prec*
H,
const f_dbl_prec*
X, f_dbl_prec*
HX
138 , f_int*
IW,
const f_int&
LENIW, f_dbl_prec*
W,
const f_int&
LENW )
140 qphess_server_relax( N, LDH, JTHCOL, H, X, HX, IW, LENIW, W, LENW );
145 namespace LinAlgOpPack {
153 namespace ConstrainedOptPack {
155 QPSolverRelaxedQPOPT::QPSolverRelaxedQPOPT(
158 :max_qp_iter_frac_(max_qp_iter_frac)
164 QPSolverRelaxedQPOPT::~QPSolverRelaxedQPOPT()
171 void QPSolverRelaxedQPOPT::release_memory()
183 {
return NCLIN > 0 ? 2*N*N + 8*N + 5*NCLIN : N*N + 8 *
N; }
190 BIGBND_ = this->infinite_bound();
191 ITMAX_ = max_qp_iter_frac() * N_;
192 LDA_ = ( A_.rows() > 0 ? A_.rows() : 1 );
193 H_ =
reinterpret_cast<f_dbl_prec*
>(
this);
194 AX_.resize( NCLIN_ > 0 ? NCLIN_ : 1 );
198 namespace ns = QPOPT_CppDecl;
199 namespace ft = FortranTypes;
212 N_, NCLIN_, LDA_, LDH_, NCLIN_ ? &A_(1,1) : NULL, &BL_(1), &BU_(1)
215 , &ISTATE_[0], &X_(1), INFORM_, ITER_, OBJ_, &AX_(1)
216 , &CLAMDA_(1), &IWORK_[0], LIWORK_, &WORK_[0], LWORK_ );
218 EInform return_inform;
219 typedef QPSolverRelaxedQPOPTSOL bc;
221 case STRONG_LOCAL_MIN:
222 return_inform = bc::STRONG_LOCAL_MIN;
225 return_inform = bc::WEAK_LOCAL_MIN;
230 ,
"QPSolverRelaxedQPOPT::call_qp_solver() : Error,"
231 " QPOPT returned that the QP is unbounded!" );
235 ,
"QPSolverRelaxedQPOPT::call_qp_solver() : Error,"
236 " QPOPT returned that the QP is infeasible!" );
240 case MAX_DOF_TOO_SMALL:
242 true, std::runtime_error,
243 "QPSolverRelaxedQPOPT::call_qp_solver() : Error,"
244 " QPOPT says that the max dof is too small" );
248 "QPSolverRelaxedQPOPT::call_qp_solver() : Error,"
249 " QPOPT returned that the input is invalid" );
250 case PROB_TYPE_NOT_REGOG:
252 true, std::logic_error,
253 "QPSolverRelaxedQPOPT::call_qp_solver() : Error,"
254 " QPOPT says that the problem type is not recognized" );
260 return return_inform;
265 #endif // CONSTRAINED_OPTIMIZATION_PACK_USE_QPOPT
void set_real_option(EQPOPT_real_option option, const f_dbl_prec &)
Set a real valued option.
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec * HX
DVector "Adaptor" subclass for DenseLinAlgPack::DVectorSlice or DenseLinAlgPack::DVector objects...
void set_logical_option(EQPOPT_logical_option option, const f_logical &)
Set a logical valued option.
FortranTypes::f_int f_int
const f_int const f_int & JTHCOL
SparseVector< SparseElement< index_type, value_type >, std::allocator< SparseElement< index_type, value_type > > > SpVector
const f_int const f_int const f_dbl_prec const f_dbl_prec * X
FORTRAN_FUNC_DECL_UL_(void, QPOPT_SET_DEFAULTS, qpopt_set_defaults)()
FortranTypes::f_logical f_logical
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec FORTRAN_NAME_UL_(QPHESS_FUNC, qphess_func) QPHESS
VectorSliceTmpl< value_type > DVectorSlice
void qpopt(const f_int &N, const f_int &NCLIN, const f_int &LDA, const f_int &LDH, const f_dbl_prec *A, const f_dbl_prec *BL, const f_dbl_prec *BU, const f_dbl_prec *CVEC, const f_dbl_prec *H, FORTRAN_NAME_UL_(QPHESS_FUNC, qphess_func) QPHESS, f_int *ISTATE, f_dbl_prec *X, f_int &INFORM, f_int &ITER, f_dbl_prec &OBJ, f_dbl_prec *AX, f_dbl_prec *CLAMDA, f_int *IW, const f_int &LENIW, f_dbl_prec *W, const f_int &LENW)
Call QPOPT through C++ declaration.
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec * H
void set_int_option(EQPOPT_int_option option, const f_int &)
Set an integer valued option.
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec * W
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int & LENIW
Create an eta vector (scaled by alpha = default 1).
void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
Base class for all matrices that support basic matrix operations.
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
void V_MtV(VectorMutable *v_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs = op(M_rhs1) * V_rhs2.
AbstractLinAlgPack::value_type value_type
void reset_defaults()
Reset all of QPOPT's options to the defaults.
const f_int const f_int & N
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec const f_int & LENW
FortranTypes::f_dbl_prec f_dbl_prec
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int * IW