MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RTOp_ROp_get_sub_vector.c
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
6 // Copyright (2003) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
39 //
40 // ***********************************************************************
41 // @HEADER
42 */
43 
45 #include "RTOp_obj_free_free.h"
46 
47 #include <stdlib.h>
48 
49 #define MY_MIN(a,b) a < b ? a : b
50 
51 /* Operator object data virtual function table */
52 
53 struct RTOp_ROp_get_sub_vector_rng_t { /* operator object instance data */
56 };
57 
59  const struct RTOp_obj_type_vtbl_t* vtbl
60  ,const void* obj_data
61  ,int* num_values
62  ,int* num_indexes
63  ,int* num_chars
64  )
65 {
66  assert( num_values );
67  assert( num_indexes );
68  assert( num_chars );
69  *num_values = 0;
70  *num_indexes = 2; /* l, u */
71  *num_chars = 0;
72  return 0;
73 }
74 
75 static int obj_create(
76  const struct RTOp_obj_type_vtbl_t* vtbl, const void* instance_data
77  , RTOp_ReductTarget* obj )
78 {
79  *obj = malloc(sizeof(struct RTOp_ROp_get_sub_vector_rng_t));
80  return 0;
81 }
82 
83 static int extract_op_state(
84  const struct RTOp_obj_type_vtbl_t* vtbl
85  ,const void * dummy
86  ,void * obj_data
87  ,int num_values
88  ,RTOp_value_type value_data[]
89  ,int num_indexes
90  ,RTOp_index_type index_data[]
91  ,int num_chars
92  ,RTOp_char_type char_data[]
93  )
94 {
95  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
96  assert(obj_data);
97  assert( num_values == 0 );
98  assert( num_indexes == 2 );
99  assert( num_chars == 0 );
100  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
101  index_data[0] = rng->l;
102  index_data[1] = rng->u;
103  return 0;
104 }
105 
106 static int load_op_state(
107  const struct RTOp_obj_type_vtbl_t* vtbl
108  ,const void * dummy
109  ,int num_values
110  ,const RTOp_value_type value_data[]
111  ,int num_indexes
112  ,const RTOp_index_type index_data[]
113  ,int num_chars
114  ,const RTOp_char_type char_data[]
115  ,void ** obj_data
116  )
117 {
118  struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
119  assert(obj_data);
120  assert( num_values == 0 );
121  assert( num_indexes == 2 );
122  assert( num_chars == 0 );
123  if(*obj_data == NULL)
124  *obj_data = malloc(sizeof(struct RTOp_ROp_get_sub_vector_rng_t));
125  rng = (struct RTOp_ROp_get_sub_vector_rng_t*)*obj_data;
126  rng->l = index_data[0];
127  rng->u = index_data[1];
128  return 0;
129 }
130 
132 {
134  ,obj_create
135  ,NULL
139 };
140 
141 /* Reduction object virtual function table */
142 
144  const struct RTOp_obj_type_vtbl_t* vtbl
145  ,const void* obj_data
146  ,int* num_values
147  ,int* num_indexes
148  ,int* num_chars
149  )
150 {
151  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
152  assert(obj_data);
153  assert( num_values );
154  assert( num_indexes );
155  assert( num_chars );
156  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
157  *num_values = rng->u - rng->l + 1; /* dense storage for elements of sub-vector to get */
158  *num_indexes = 2; /* l and u */
159  *num_chars = 0;
160  return 0;
161 }
162 
163 static int targ_obj_create(
164  const struct RTOp_obj_type_vtbl_t* vtbl, const void* obj_data
165  , RTOp_ReductTarget* targ_obj )
166 {
167  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
168  const int mem_size = sizeof(struct RTOp_SubVector);
169  struct RTOp_SubVector *sub_vec_targ = NULL;
171  /* Get the range of the sub-vector */
172  assert(obj_data);
173  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
174  sub_dim = rng->u - rng->l + 1;
175  /* Allocate the sub-vector target object */
176  *targ_obj = malloc(mem_size);
177  sub_vec_targ = (struct RTOp_SubVector*)*targ_obj;
178  /* Setup storage for the target sub-vector */
180  rng->l - 1 /* global_offset */
181  ,sub_dim /* sub_dim */
182  ,(const RTOp_value_type*)malloc(sub_dim*sizeof(RTOp_value_type)) /* values[] */
183  ,1 /* value_stride */
184  ,sub_vec_targ );
185  /* Initialize the sub-vector to zero */
186  vtbl->obj_reinit( vtbl, obj_data, *targ_obj );
187  return 0;
188 }
189 
190 static int targ_obj_reinit(
191  const struct RTOp_obj_type_vtbl_t* vtbl, const void* obj_data
192  , RTOp_ReductTarget targ_obj )
193 {
194  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
195  struct RTOp_SubVector *sub_vec_targ = NULL;
197  RTOp_value_type *values = NULL;
198  register RTOp_index_type k;
199  assert(obj_data);
200  /* Get the range of the sub-vector */
201  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
202  sub_dim = rng->u - rng->l + 1;
203  /* Get the target sub-vector */
204  sub_vec_targ = (struct RTOp_SubVector*)targ_obj;
205  assert( sub_dim == sub_vec_targ->sub_dim );
206  assert( sub_vec_targ->values );
207  /* Initialize the values to zero */
208  values = (RTOp_value_type*)sub_vec_targ->values;
209  for( k = 0; k < sub_dim; ++k )
210  *values++ = 0.0;
211  return 0;
212 }
213 
214 static int targ_obj_free(
215  const struct RTOp_obj_type_vtbl_t* vtbl, const void* obj_data
216  , RTOp_ReductTarget* targ_obj )
217 {
218  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
219  struct RTOp_SubVector *sub_vec_targ = NULL;
221  assert(obj_data);
222  /* Get the range of the sub-vector */
223  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
224  sub_dim = rng->u - rng->l + 1;
225  /* Get the target sub-vector */
226  sub_vec_targ = (struct RTOp_SubVector*)*targ_obj;
227  assert( sub_dim == sub_vec_targ->sub_dim );
228  assert( sub_vec_targ->values );
229  /* Deallocate the vectors and the object */
230  if( (void*)sub_vec_targ->values )
231  free( (void*)sub_vec_targ->values );
232  free( (void*)sub_vec_targ );
233  *targ_obj = RTOp_REDUCT_OBJ_NULL;
234  return 0;
235 }
236 
238  const struct RTOp_obj_type_vtbl_t* vtbl
239  ,const void * obj_data
240  ,void * targ_obj
241  ,int num_values
242  ,RTOp_value_type value_data[]
243  ,int num_indexes
244  ,RTOp_index_type index_data[]
245  ,int num_chars
246  ,RTOp_char_type char_data[]
247  )
248 {
249  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
250  struct RTOp_SubVector *sub_vec_targ = NULL;
252  register RTOp_index_type k;
253  assert(obj_data);
254  /* Get the range of the sub-vector */
255  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
256  sub_dim = rng->u - rng->l + 1;
257  /* Get the target sub-vector */
258  assert( targ_obj );
259  sub_vec_targ = (struct RTOp_SubVector*)targ_obj;
260  assert( sub_dim == sub_vec_targ->sub_dim );
261  assert( sub_vec_targ->values );
262  /* Extract the state */
263  assert( num_values == sub_dim );
264  assert( num_indexes == 2 );
265  assert( num_chars == 0 );
266  for( k = 0; k < sub_dim; ++k )
267  value_data[k] = sub_vec_targ->values[k];
268  index_data[0] = rng->l;
269  index_data[1] = rng->u;
270  return 0;
271 }
272 
273 static int targ_load_state(
274  const struct RTOp_obj_type_vtbl_t* vtbl
275  ,const void* obj_data
276  ,int num_values
277  ,const RTOp_value_type value_data[]
278  ,int num_indexes
279  ,const RTOp_index_type index_data[]
280  ,int num_chars
281  ,const RTOp_char_type char_data[]
282  ,void ** targ_obj
283  )
284 {
285  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
286  struct RTOp_SubVector *sub_vec_targ = NULL;
288  RTOp_value_type *values = NULL;
289  register RTOp_index_type k;
290  assert(obj_data);
291  /* Get the range of the sub-vector */
292  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
293  sub_dim = rng->u - rng->l + 1;
294  /* Get the target sub-vector */
295  assert( *targ_obj );
296  sub_vec_targ = (struct RTOp_SubVector*)*targ_obj;
297  assert( sub_dim == sub_vec_targ->sub_dim );
298  assert( sub_vec_targ->values );
299  /* Load the state */
300  assert( num_values == sub_dim );
301  assert( num_indexes == 2 );
302  assert( num_chars == 0 );
303  assert( index_data[0] == sub_vec_targ->global_offset + 1 );
304  assert( index_data[1] == sub_vec_targ->global_offset + sub_vec_targ->sub_dim );
305  values = (RTOp_value_type*)sub_vec_targ->values;
306  for( k = 0; k < sub_dim; ++k )
307  *values++ = value_data[k];
309  rng->l - 1 /* global_offset */
310  ,sub_dim /* sub_dim */
311  ,sub_vec_targ->values /* values[] */
312  ,1 /* value_stide */
313  ,sub_vec_targ );
314  return 0;
315 }
316 
318 {
325 };
326 
327 /* Implementation functions */
328 
330  const struct RTOp_RTOp_vtbl_t* vtbl, const void* obj_data
331  , const int num_vecs, const struct RTOp_SubVector vecs[]
332  , const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[]
333  , RTOp_ReductTarget targ_obj )
334 {
335  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
336  struct RTOp_SubVector *sub_vec_targ = NULL;
339  const RTOp_value_type *v0_val;
340  ptrdiff_t v0_val_s;
341  RTOp_index_type i, i_l, i_u;
342 
343  /* */
344  /* Validate the input */
345  /* */
346  if( num_vecs != 1 )
348  if( num_targ_vecs != 0 )
350  assert(targ_obj);
351  assert(vecs);
352 
353  /* */
354  /* Get pointers to data */
355  /* */
356 
357  /* Get the range of the sub-vector that we are trying to extract */
358  assert(obj_data);
359  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
360 
361  /* Get the sub-vector target object */
362  assert( targ_obj );
363  sub_vec_targ = (struct RTOp_SubVector*)targ_obj;
364  assert( sub_vec_targ->global_offset + 1 == rng->l );
365  assert( sub_vec_targ->global_offset + sub_vec_targ->sub_dim == rng->u );
366 
367  /* v0 */
368  global_offset = vecs[0].global_offset;
369  sub_dim = vecs[0].sub_dim;
370  v0_val = vecs[0].values;
371  v0_val_s = vecs[0].values_stride;
372 
373  /* */
374  /* Extract part of the sub-vector for this chunk. */
375  /* */
376  /* We only want the elements from rng->l to rng->u */
377  /* and this vector chunk only has elements from global_offset */
378  /* to global_offset + sub_dim. */
379  /* */
380 
381  if( rng->u < global_offset + 1 || global_offset + sub_dim < rng->l )
382  return 0; /* None of the sub-vector that we are looking for is not in this vector chunk! */
383 
384  i_l = ( rng->l <= ( global_offset + 1 ) ? 1 : rng->l - global_offset );
385  i_u = ( rng->u >= ( global_offset + sub_dim ) ? sub_dim : rng->u - global_offset );
386 
387  for( i = i_l; i <= i_u; ++i )
388  ((RTOp_value_type*)sub_vec_targ->values)[i-1+(global_offset-(rng->l-1))] = v0_val[(i-1)*v0_val_s];
389 
390  return 0; /* success? */
391 
392 }
393 
395  const struct RTOp_RTOp_vtbl_t* vtbl, const void* obj_data /* Can be NULL! */
396  , RTOp_ReductTarget in_reduct_obj, RTOp_ReductTarget inout_reduct_obj )
397 {
398  const struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
399  struct RTOp_SubVector
400  *in_sub_vec_targ = NULL,
401  *inout_sub_vec_targ = NULL;
403  RTOp_value_type *inout_values = NULL;
404  register RTOp_index_type k;
405  /* Get the range of the sub-vector */
406  assert(obj_data);
407  rng = (const struct RTOp_ROp_get_sub_vector_rng_t*)obj_data;
408  sub_dim = rng->u - rng->l + 1;
409  /* Get the in target sub-vector */
410  assert( in_reduct_obj );
411  in_sub_vec_targ = (struct RTOp_SubVector*)in_reduct_obj;
412  assert( sub_dim == in_sub_vec_targ->sub_dim );
413  assert( in_sub_vec_targ->values );
414  /* Get the inout target sub-vector */
415  assert( inout_reduct_obj );
416  inout_sub_vec_targ = (struct RTOp_SubVector*)inout_reduct_obj;
417  assert( sub_dim == inout_sub_vec_targ->sub_dim );
418  assert( inout_sub_vec_targ->values );
419  /* Perform the reduction */
420  inout_values = (RTOp_value_type*)inout_sub_vec_targ->values;
421  for( k = 0; k < sub_dim; ++k )
422  *inout_values++ += in_sub_vec_targ->values[k];
423  return 0;
424 }
425 
426 static void CALL_API external_reduct_op( void* in_targ_array, void* inout_targ_array
427  , int* len, RTOp_Datatype* datatype )
428 {
429  int num_values_off, num_indexes_off, num_chars_off
430  , values_off, l_off, u_off;
431  int num_values, num_indexes, num_chars;
432  const RTOp_value_type *in_values = NULL;
433  RTOp_value_type *inout_values = NULL;
434  register RTOp_index_type k;
435  /* Get the offsets for the number of elements of each data type */
436  num_values_off = 0;
437  num_indexes_off = num_values_off + sizeof(RTOp_value_type);
438  num_chars_off = num_indexes_off + sizeof(RTOp_value_type);
439  /* Get the number of elements of each data type */
440  num_values = *(RTOp_value_type*)((char*)in_targ_array + num_values_off);
441  num_indexes = *(RTOp_value_type*)((char*)in_targ_array + num_indexes_off);
442  num_chars = *(RTOp_value_type*)((char*)in_targ_array + num_chars_off);
443 #ifdef RTOp_DEBUG
444  assert( num_values > 0 );
445  assert( num_indexes == 2 );
446  assert( num_chars == 0 );
447  assert( num_values == *(RTOp_value_type*)((char*)inout_targ_array + num_values_off) );
448  assert( num_indexes == *(RTOp_value_type*)((char*)inout_targ_array + num_indexes_off) );
449  assert( num_chars == *(RTOp_value_type*)((char*)inout_targ_array + num_chars_off) );
450 #endif
451  /* Get the offsets for the sub-vector values and range l and u */
452  values_off = num_chars_off + sizeof(RTOp_value_type);
453  l_off = values_off + num_values * sizeof(RTOp_value_type);
454  u_off = l_off + sizeof(RTOp_index_type);
455 #ifdef RTOp_DEBUG
456  assert( *(RTOp_index_type*)((char*)in_targ_array + l_off)
457  == *(RTOp_index_type*)((char*)inout_targ_array + l_off) );
458  assert( *(RTOp_index_type*)((char*)in_targ_array + u_off)
459  == *(RTOp_index_type*)((char*)inout_targ_array + u_off) );
460 #endif
461  /* Perform the reduction! (just add the elements together) */
462  in_values = (const RTOp_value_type*)((char*)in_targ_array + values_off);
463  inout_values = (RTOp_value_type*)((char*)inout_targ_array + values_off);
464  for( k = 0; k < num_values; ++k )
465  *inout_values++ += *in_values++;
466 }
467 
468 static int get_reduct_op(
469  const struct RTOp_RTOp_vtbl_t* vtbl, const void* obj_data
470  , RTOp_reduct_op_func_ptr_t* reduct_op_func_ptr )
471 {
472  *reduct_op_func_ptr = external_reduct_op;
473  return 0;
474 }
475 
476 /* Public interface */
477 
479 {
481  ,&targ_obj_vtbl
482  ,"RTOp_ROp_get_sub_vector"
483  ,NULL
487 };
488 
490  RTOp_index_type l, RTOp_index_type u, struct RTOp_RTOp* op )
491 {
492  struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
494  op->vtbl->obj_data_vtbl->obj_create(NULL,NULL,&op->obj_data);
495  rng = (struct RTOp_ROp_get_sub_vector_rng_t*)op->obj_data;
496  rng->l = l;
497  rng->u = u;
498  return 0;
499 }
500 
503 {
504  struct RTOp_ROp_get_sub_vector_rng_t *rng = NULL;
505  assert( op->vtbl );
506  assert( op->obj_data );
507  rng = (struct RTOp_ROp_get_sub_vector_rng_t*)op->obj_data;
508  rng->l = l;
509  rng->u = u;
510  return 0;
511 }
512 
514 {
515 #ifdef TEUCHOS_DEBUG
516  assert( op->vtbl );
517  assert( op->obj_data );
518 #endif
519  op->vtbl->obj_data_vtbl->obj_free(NULL,NULL,&op->obj_data);
520  op->vtbl = NULL;
521  return 0;
522 }
523 
525  RTOp_ReductTarget targ_obj
526  )
527 {
528  return *((struct RTOp_SubVector*)targ_obj);
529 }
ptrdiff_t values_stride
Definition: RTOp.h:305
double RTOp_value_type
Definition: RTOp.h:69
void * RTOp_ReductTarget
Definition: RTOp.h:191
static int RTOp_ROp_get_sub_vector_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)
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 **targ_obj)
RTOp_index_type global_offset
Definition: RTOp.h:299
int(* obj_create)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
Definition: RTOp.h:941
const struct RTOp_obj_type_vtbl_t * obj_data_vtbl
Definition: RTOp.h:819
static void CALL_API external_reduct_op(void *in_targ_array, void *inout_targ_array, int *len, RTOp_Datatype *datatype)
#define CALL_API
Definition: RTOp.h:65
static int targ_extract_state(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, void *targ_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[])
void RTOp_sub_vector(RTOp_index_type global_offset, RTOp_index_type sub_dim, const RTOp_value_type values[], ptrdiff_t values_stride, struct RTOp_SubVector *sub_vec)
Definition: RTOp.c:52
char RTOp_char_type
Definition: RTOp.h:70
int RTOp_ROp_get_sub_vector_construct(RTOp_index_type l, RTOp_index_type u, struct RTOp_RTOp *op)
const RTOp_value_type * values
Definition: RTOp.h:303
static int load_op_state(const struct RTOp_obj_type_vtbl_t *vtbl, const void *dummy, 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 **obj_data)
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)
const struct RTOp_RTOp_vtbl_t RTOp_ROp_get_sub_vector_vtbl
static int extract_op_state(const struct RTOp_obj_type_vtbl_t *vtbl, const void *dummy, void *obj_data, int num_values, RTOp_value_type value_data[], int num_indexes, RTOp_index_type index_data[], int num_chars, RTOp_char_type char_data[])
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_obj_free(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget *targ_obj)
static struct RTOp_obj_type_vtbl_t targ_obj_vtbl
#define RTOp_ERR_INVALID_NUM_VECS
Definition: RTOp.h:266
static int get_op_type_num_entries(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, int *num_values, int *num_indexes, int *num_chars)
int(* obj_free)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
Definition: RTOp.h:1019
static struct RTOp_obj_type_vtbl_t instance_obj_vtbl
static int targ_obj_reinit(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget targ_obj)
MPI_Datatype RTOp_Datatype
static int targ_obj_create(const struct RTOp_obj_type_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget *targ_obj)
struct RTOp_SubVector RTOp_ROp_get_sub_vector_val(RTOp_ReductTarget targ_obj)
int RTOp_ROp_get_sub_vector_set_range(RTOp_index_type l, RTOp_index_type u, struct RTOp_RTOp *op)
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)
int(* obj_reinit)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *obj)
Definition: RTOp.h:979
void * obj_data
Definition: RTOp.h:800
const struct RTOp_RTOp_vtbl_t * vtbl
Definition: RTOp.h:802
static int obj_create(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, RTOp_ReductTarget *obj)
int RTOp_ROp_get_sub_vector_destroy(struct RTOp_RTOp *op)
int RTOp_obj_free_free(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
RTOp_index_type sub_dim
Definition: RTOp.h:301
const f_int f_dbl_prec const f_int f_int const f_int f_int const f_dbl_prec & u
#define RTOp_ERR_INVALID_NUM_TARG_VECS
Definition: RTOp.h:268
Teuchos_Ordinal RTOp_index_type
Definition: RTOp.h:68
#define RTOp_REDUCT_OBJ_NULL
Definition: RTOp.h:192