114 class init_rtop_server_t {
116 init_rtop_server_t() {
119 log_bound_barrier_targ = log_bound_barrier_op.reduct_obj_create();
122 combined_nu_comp_err_targ = combined_nu_comp_err_op.reduct_obj_create();
125 combined_nu_comp_err_lower_targ = combined_nu_comp_err_lower_op.reduct_obj_create();
128 combined_nu_comp_err_upper_targ = combined_nu_comp_err_upper_op.reduct_obj_create();
131 comp_err_with_mu_targ = comp_err_with_mu_op.reduct_obj_create();
134 max_near_feas_step_targ = max_near_feas_step_op.reduct_obj_create();
137 max_rel_step_targ = max_rel_step_op.reduct_obj_create();
140 fraction_to_boundary_targ = fraction_to_boundary_op.reduct_obj_create();
143 fraction_to_zero_boundary_targ = fraction_to_zero_boundary_op.reduct_obj_create();
146 num_bounded_targ = num_bounded_op.reduct_obj_create();
168 init_rtop_server_t init_rtop_server;
178 const Vector* vecs[1] = { &v };
179 apply_op(op,1,vecs,0,NULL,&*reduct_obj);
183 std::pair<AbstractLinAlgPack::value_type,AbstractLinAlgPack::value_type>
190 const int num_vecs = 4;
192 vecs[num_vecs] = { &xl, &x, &d, &xu };
194 max_near_feas_step_op.reduct_obj_reinit(max_near_feas_step_targ.
ptr());
196 max_near_feas_step_op, num_vecs, vecs, 0, NULL
197 ,&*max_near_feas_step_targ );
208 const int num_vecs = 2;
210 vecs[num_vecs] = { &x, &d };
211 max_rel_step_op.reduct_obj_reinit(max_rel_step_targ.
ptr());
213 max_rel_step_op, num_vecs, vecs, 0, NULL
214 ,&*max_rel_step_targ );
229 fraction_to_boundary_op.reduct_obj_reinit(fraction_to_boundary_targ.
ptr());
230 const int num_vecs = 4;
232 vecs[num_vecs] = { &x, &d, &xl, &xu };
234 fraction_to_boundary_op, num_vecs, vecs, 0, NULL
235 ,&*fraction_to_boundary_targ );
247 fraction_to_zero_boundary_op.reduct_obj_reinit(fraction_to_zero_boundary_targ.
ptr());
248 const int num_vecs = 2;
250 vecs[num_vecs] = { &x, &d };
252 fraction_to_zero_boundary_op, num_vecs, vecs, 0, NULL
253 ,&*fraction_to_zero_boundary_targ );
264 num_bounded_op.reduct_obj_reinit(num_bounded_targ.
ptr());
265 const int num_vecs = 2;
267 vecs[num_vecs] = { &xl, &xu };
269 num_bounded_op, num_vecs, vecs, 0, NULL
270 ,&*num_bounded_targ );
281 log_bound_barrier_op.reduct_obj_reinit(log_bound_barrier_targ.
ptr());
282 const int num_vecs = 3;
284 vecs[num_vecs] = { &x, &xl, &xu };
286 log_bound_barrier_op, num_vecs, vecs, 0, NULL
287 ,&*log_bound_barrier_targ
301 combined_nu_comp_err_op.reduct_obj_reinit(combined_nu_comp_err_targ.
ptr());
302 const int num_vecs = 4;
304 vecs[num_vecs] = {&v, &x, &xl, &xu };
306 combined_nu_comp_err_op, num_vecs, vecs, 0, NULL
307 ,&*combined_nu_comp_err_targ
319 combined_nu_comp_err_lower_op.reduct_obj_reinit(combined_nu_comp_err_lower_targ.
ptr());
320 const int num_vecs = 3;
322 vecs[num_vecs] = {&v, &xl, &x};
324 combined_nu_comp_err_lower_op, num_vecs, vecs, 0, NULL
325 ,&*combined_nu_comp_err_lower_targ
338 combined_nu_comp_err_upper_op.reduct_obj_reinit(combined_nu_comp_err_upper_targ.
ptr());
339 const int num_vecs = 3;
341 vecs[num_vecs] = {&v, &xu, &x};
343 combined_nu_comp_err_upper_op, num_vecs, vecs, 0, NULL
344 ,&*combined_nu_comp_err_upper_targ
361 comp_err_with_mu_op.reduct_obj_reinit(comp_err_with_mu_targ.
ptr());
362 const int num_vecs = 5;
364 vecs[num_vecs] = {&x, &xl, &xu, &vl, &vu};
366 comp_err_with_mu_op, num_vecs, vecs, 0, NULL
367 ,&*comp_err_with_mu_targ
386 const int num_vecs = 3;
388 vecs[num_vecs] = { &v, &vL, &vU };
390 op, num_vecs, vecs, 0, NULL
400 return *max_viol_i > 0.0;
411 const Vector* vecs[2] = { &xl, &xu };
413 apply_op(force_in_bounds_op,2,vecs,1,targ_vecs,NULL);
426 const Vector* vecs[2] = { &xl, &xu };
428 apply_op(force_in_bounds_buffer_op,2,vecs,1,targ_vecs,NULL);
440 const Vector* vecs[2] = { &v0, &v1 };
442 apply_op(inv_of_difference_op,2,vecs,1,targ_vecs,NULL);
452 const Vector* vecs[1] = { &xl };
454 apply_op(correct_lower_bound_multipliers_op,1,vecs,1,targ_vecs,NULL);
464 const Vector* vecs[1] = { &xu };
466 apply_op(correct_upper_bound_multipliers_op,1,vecs,1,targ_vecs,NULL);
478 const Vector* vecs[] = { &invXl, &vl, &d_k };
480 apply_op(lowerbound_multipliers_step_op,3,vecs,1,targ_vecs,NULL);
492 const Vector* vecs[] = { &invXu, &vu, &d_k };
494 apply_op(upperbound_multipliers_step_op,3,vecs,1,targ_vecs,NULL);
502 apply_op(ele_wise_sqrt_op,0,NULL,1,targ_vecs,NULL);
513 apply_op(op,0,NULL,1,targ_vecs,NULL);
524 apply_op(op,0,NULL,1,targ_vecs,NULL);
int RTOp_ROp_comp_err_with_mu_construct(RTOp_value_type mu, RTOp_value_type inf_bound, struct RTOp_RTOp *op)
RTOp_value_type RTOp_ROp_log_bound_barrier_val(RTOp_ReductTarget reduct_obj)
struct RTOp_ROp_max_inequ_viol_reduct_obj_t RTOp_ROp_max_inequ_viol_val(RTOp_ReductTarget targ_obj)
int RTOp_ROp_fraction_to_boundary_init(RTOp_value_type tau, struct RTOp_RTOp *op)
void max_vec_scalar(value_type min_ele, VectorMutable *y)
Take the maximum value of the vector elements and a scalar.
Adapter subclass that uses a RTOp_RTOp object.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
int RTOp_TOp_multiplier_step_init(RTOp_value_type mu, RTOp_value_type alpha, struct RTOp_RTOp *op)
RTOp_value_type RTOp_ROp_combined_nu_comp_err_val(RTOp_ReductTarget reduct_obj)
int RTOp_ROp_comp_err_with_mu_init(RTOp_value_type mu, RTOp_value_type inf_bound, struct RTOp_RTOp *op)
value_type IP_comp_err_with_mu(const value_type mu, const value_type inf_bound, const Vector &x, const Vector &xl, const Vector &xu, const Vector &vl, const Vector &vu)
Computes the complementarity error for a primal/dual interior point algorithm using inf norm...
void inv_of_difference(const value_type alpha, const Vector &v0, const Vector &v1, VectorMutable *z)
Computes the inverse of the difference between two vectors.
RTOp_value_type RTOp_ROp_combined_nu_comp_err_one_only_val(RTOp_ReductTarget reduct_obj)
RTOp_value_type value_type
int RTOp_TOp_inv_of_difference_init(RTOp_value_type alpha, struct RTOp_RTOp *op)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void force_in_bounds_buffer(const value_type rel_push, const value_type abs_push, const Vector &xl, const Vector &xu, VectorMutable *x)
Force a vector sufficiently within bounds according to a specified absolute and relative buffer...
void upperbound_multipliers_step(const value_type mu, const Vector &invXu, const Vector &vu, const Vector &d_k, VectorMutable *dvu)
Calculates the multiplier step for the upper bounds.
struct RTOp_ROp_max_near_feas_step_reduct_obj_t RTOp_ROp_max_near_feas_step_val(RTOp_ReductTarget targ_obj)
value_type max_element(const Vector &v)
Compute the maximum element in a vector.
void max_abs_vec_scalar(value_type min_ele, VectorMutable *y)
Take the maximum value of the absolute vector elements and a scalar.
int RTOp_TOp_force_in_bounds_buffer_init(RTOp_value_type rel_push, RTOp_value_type abs_push, struct RTOp_RTOp *op)
RTOp_value_type alpha_neg
value_type max_rel_step(const Vector &x, const Vector &d)
Computes the maximum relative step of x = x + d.
RTOp_value_type RTOp_ROp_fraction_to_zero_boundary_val(RTOp_ReductTarget reduct_obj)
int RTOp_ROp_combined_nu_comp_err_construct(struct RTOp_RTOp *op)
int RTOp_ROp_max_near_feas_step_set_beta(RTOp_value_type beta, struct RTOp_RTOp *op)
int RTOp_ROp_combined_nu_comp_err_one_only_construct(struct RTOp_RTOp *op)
int RTOp_ROp_num_bounded_construct(RTOp_value_type inf_bnd, struct RTOp_RTOp *op)
int RTOp_TOp_inv_of_difference_construct(RTOp_value_type alpha, struct RTOp_RTOp *op)
int RTOp_TOp_multiplier_step_construct(RTOp_value_type mu, RTOp_value_type alpha, struct RTOp_RTOp *op)
int RTOp_TOp_max_vec_scalar_construct(RTOp_value_type min_ele, struct RTOp_RTOp *op)
RTOp_index_type size_type
RTOp_index_type RTOp_ROp_num_bounded_val(RTOp_ReductTarget targ_obj)
int RTOp_ROp_num_bounded_set_inf_bnd(RTOp_value_type inf_bnd, struct RTOp_RTOp *op)
value_type combined_nu_comp_err(const Vector &v, const Vector &x, const Vector &xl, const Vector &xu)
Computes an estimate of the complementarity error.
int RTOp_ROp_log_bound_barrier_construct(struct RTOp_RTOp *op)
bool max_inequ_viol(const AbstractLinAlgPack::Vector &v, const AbstractLinAlgPack::Vector &vL, const AbstractLinAlgPack::Vector &vU, AbstractLinAlgPack::size_type *max_viol_i, AbstractLinAlgPack::value_type *max_viol, AbstractLinAlgPack::value_type *v_i, int *bnd_type, AbstractLinAlgPack::value_type *vLU_i)
Compute the maximum violation from a set of inequality constraints vL <= v <= vU. ...
RTOp_value_type RTOp_ROp_fraction_to_boundary_val(RTOp_ReductTarget reduct_obj)
int RTOp_ROp_fraction_to_zero_boundary_init(RTOp_value_type tau, struct RTOp_RTOp *op)
size_type num_bounded(const Vector &xl, const Vector &xu, value_type inf_bound)
Count the number of finitly bounded elements in xl <= x <= xu.
value_type fraction_to_boundary(const value_type tau, const Vector &x, const Vector &d, const Vector &xl, const Vector &xu)
value_type fraction_to_zero_boundary(const value_type tau, const Vector &x, const Vector &d)
int RTOp_ROp_max_rel_step_construct(struct RTOp_RTOp *op)
int RTOp_ROp_max_near_feas_step_construct(RTOp_value_type beta, struct RTOp_RTOp *op)
RTOp_value_type RTOp_ROp_max_val(RTOp_ReductTarget reduct_obj)
void ele_wise_sqrt(VectorMutable *z)
Calculates the sqrt of each element in the vector Pre Condition: all elements of z must be positive...
value_type log_bound_barrier(const Vector &x, const Vector &xl, const Vector &xu)
Computes the log barrier term:
int RTOp_TOp_ele_wise_sqrt_construct(struct RTOp_RTOp *op)
std::pair< value_type, value_type > max_near_feas_step(const Vector &x, const Vector &d, const Vector &xl, const Vector &xu, value_type max_bnd_viol)
Computes the maximum positive and negative step that can be taken that are within the relaxed bounds...
Abstract interface for mutable coordinate vectors {abstract}.
void apply_op(EApplyBy apply_by, const RTOpPack::RTOp &primary_op, const size_t num_multi_vecs, const MultiVector *multi_vecs[], const size_t num_targ_multi_vecs, MultiVectorMutable *targ_multi_vecs[], RTOpPack::ReductTarget *reduct_objs[]=NULL, const index_type primary_first_ele=1, const index_type primary_sub_dim=0, const index_type primary_global_offset=0, const index_type secondary_first_ele=1, const index_type secondary_sub_dim=0)
Apply a reduction/transformation operator column by column and return an array of the reduction objec...
RTOp_index_type max_viol_i
int RTOp_ROp_max_construct(struct RTOp_RTOp *op)
void force_in_bounds(const Vector &xl, const Vector &xu, VectorMutable *x)
Force a vector in bounds.
int RTOp_TOp_Correct_Multipliers_construct(RTOp_value_type inf_bound_limit, RTOp_index_type lower_or_upper, struct RTOp_RTOp *op)
int RTOp_TOp_force_in_bounds_buffer_construct(RTOp_value_type rel_push, RTOp_value_type abs_push, struct RTOp_RTOp *op)
RTOp_value_type RTOp_ROp_max_rel_step_val(RTOp_ReductTarget reduct_obj)
int RTOp_ROp_max_inequ_viol_construct(struct RTOp_RTOp *op)
void correct_lower_bound_multipliers(const Vector &xl, const value_type inf_bound_limit, VectorMutable *vl)
Corrects the lower bound multipliers with infinite bounds.
int RTOp_ROp_fraction_to_boundary_construct(RTOp_value_type tau, struct RTOp_RTOp *op)
void lowerbound_multipliers_step(const value_type mu, const Vector &invXl, const Vector &vl, const Vector &d_k, VectorMutable *dvl)
Calculates the multiplier step for lower bounds.
int RTOp_TOp_max_abs_vec_scalar_construct(RTOp_value_type min_ele, struct RTOp_RTOp *op)
int RTOp_ROp_fraction_to_zero_boundary_construct(RTOp_value_type tau, struct RTOp_RTOp *op)
int RTOp_TOp_Correct_Multipliers_init(RTOp_value_type inf_bound_limit, RTOp_index_type lower_or_upper, struct RTOp_RTOp *op)
RTOp_value_type alpha_pos
const f_int f_dbl_prec const f_int f_int const f_int f_int const f_dbl_prec & u
void correct_upper_bound_multipliers(const Vector &xu, const value_type inf_bound_limit, VectorMutable *vu)
Corrects the upper bound multipliers with infinite bounds.
RTOp_value_type RTOp_ROp_comp_err_with_mu_val(RTOp_ReductTarget reduct_obj)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
value_type combined_nu_comp_err_upper(const Vector &v, const Vector &x, const Vector &xu)
Computes an estimate of the complementarity error when only the upper bounds are non-infinite.
int RTOp_TOp_force_in_bounds_construct(struct RTOp_RTOp *op)
value_type combined_nu_comp_err_lower(const Vector &v, const Vector &x, const Vector &xl)
Computes an estimate of the complementarity error when only the lower bounds are non-infinite.