46 #define max(a,b) ( (a) > (b) ? (a) : (b) )
47 #define min(a,b) ( (a) < (b) ? (a) : (b) )
97 *targ_obj = malloc( mem_size );
103 ,
const void * obj_data
114 assert( reduct_obj );
115 assert( num_values == 3 );
116 assert( num_indexes == 3 );
117 assert( num_chars == 0 );
120 value_data[1] = targ->
v_i;
121 value_data[2] = targ->
vLU_i;
129 ,
const void* obj_data
140 assert( *reduct_obj );
141 assert( num_values == 3 );
142 assert( num_indexes == 2 );
143 assert( num_chars == 0 );
146 targ->
v_i = value_data[1];
147 targ->
vLU_i = value_data[2];
180 size_t global_offset;
204 if( num_targ_vecs != 0 )
206 if( vecs[0].global_offset != vecs[1].global_offset
207 || vecs[0].sub_dim != vecs[1].sub_dim
208 || vecs[0].global_offset != vecs[2].global_offset
209 || vecs[0].sub_dim != vecs[2].sub_dim )
236 i = global_offset + 1;
237 for( k = 0; k < sub_dim; ++k, ++i, v_val += v_val_s, vL_val += vL_val_s, vU_val += vU_val_s ) {
238 v_scale = 1.0 / (1.0 + fabs(*v_val));
240 violL = (*vL_val - *v_val) * v_scale;
242 violU = (*v_val - *vU_val) * v_scale;
251 ? ( *vL_val == *vU_val
283 io_targ->
v_i = i_targ->
v_i;
300 ,
"ROp_max_inequ_viol"
static int targ_load_state(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, int num_values, const RTOp_value_type value_data[], int num_indexes, const RTOp_index_type index_data[], int num_chars, const RTOp_char_type char_data[], void **reduct_obj)
struct RTOp_ROp_max_inequ_viol_reduct_obj_t RTOp_ROp_max_inequ_viol_val(RTOp_ReductTarget targ_obj)
RTOp_index_type global_offset
#define RTOp_ERR_INCOMPATIBLE_VECS
const RTOp_value_type * values
int RTOp_ROp_max_inequ_viol_destroy(struct RTOp_RTOp *op)
const struct RTOp_RTOp_vtbl_t RTOp_ROp_max_inequ_viol_vtbl
static int get_reduct_op(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, RTOp_reduct_op_func_ptr_t *reduct_op_func_ptr)
static int targ_extract_state(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, void *reduct_obj, int num_values, RTOp_value_type value_data[], int num_indexes, RTOp_index_type index_data[], int num_chars, RTOp_char_type char_data[])
#define RTOp_ERR_INVALID_NUM_VECS
const struct RTOp_obj_type_vtbl_t RTOp_obj_null_vtbl
static int reduce_reduct_objs(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget in_reduct_obj, RTOp_ReductTarget inout_reduct_obj)
const struct RTOp_RTOp_vtbl_t * vtbl
static int get_targ_type_num_entries(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, int *num_values, int *num_indexes, int *num_chars)
static int RTOp_ROp_max_inequ_viol_apply_op(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[], RTOp_ReductTarget targ_obj)
RTOp_index_type max_viol_i
int RTOp_ROp_max_inequ_viol_construct(struct RTOp_RTOp *op)
INSERT_GET_REDUCT_OP_FUNCS(3, 2, 0, RTOp_ROp_max_inequ_viol_reduct_obj_t, reduce_reduct_objs, targ_load_state, targ_extract_state, external_reduct_op, get_reduct_op) const
static int targ_obj_reinit(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget targ_obj)
static const struct RTOp_obj_type_vtbl_t targ_obj_vtbl
static int targ_obj_create(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget *targ_obj)
int RTOp_obj_free_free(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
#define RTOp_ERR_INVALID_NUM_TARG_VECS
static void CALL_API external_reduct_op(void *in_targ_array, void *inout_targ_array, int *len, RTOp_Datatype *datatype)
Teuchos_Ordinal RTOp_index_type