MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RTOp.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 
44 #include <stdio.h>
45 #include <assert.h>
46 #include <string.h>
47 
48 #include "RTOp.h"
49 
50 /* Misc. */
51 
53  RTOp_index_type global_offset, RTOp_index_type sub_dim
54  ,const RTOp_value_type values[], ptrdiff_t values_stride
55  ,struct RTOp_SubVector *sub_vec
56  )
57 {
58  /* Validate input */
59 #ifdef RTOp_DEBUG
60  assert( values != NULL );
61 #endif
62  /* Set members */
63  sub_vec->global_offset = global_offset;
64  sub_vec->sub_dim = sub_dim;
65  sub_vec->values = values;
66  sub_vec->values_stride = values_stride;
67 }
68 
69 void RTOp_sub_vector_null( struct RTOp_SubVector *sub_vec )
70 {
71  sub_vec->global_offset = 0;
72  sub_vec->sub_dim = 0;
73  sub_vec->values = NULL;
74  sub_vec->values_stride = 0;
75 }
76 
78  RTOp_index_type global_offset, RTOp_index_type sub_dim
79  ,RTOp_value_type values[], ptrdiff_t values_stride
80  ,struct RTOp_MutableSubVector *sub_vec
81  )
82 {
83  /* Validate input */
84 #ifdef RTOp_DEBUG
85  assert( sub_vec );
86  assert( values != NULL );
87 #endif
88  /* Set members */
89  sub_vec->global_offset = global_offset;
90  sub_vec->sub_dim = sub_dim;
91  sub_vec->values = values;
92  sub_vec->values_stride = values_stride;
93 }
94 
96 {
97 #ifdef RTOp_DEBUG
98  assert( sub_vec );
99 #endif
100  sub_vec->global_offset = 0;
101  sub_vec->sub_dim = 0;
102  sub_vec->values = NULL;
103  sub_vec->values_stride = 0;
104 }
105 
106 /* RTOp_RTOp */
107 
109  const struct RTOp_RTOp* op
110  ,const char** op_name
111  )
112 {
113 #ifdef RTOp_DEBUG
114  assert( op );
115  assert( op->vtbl );
116  assert( op->vtbl->op_name );
117  assert( op_name );
118 #endif
119  *op_name = op->vtbl->op_name;
120  return 0;
121 }
122 
124  const struct RTOp_RTOp* op
125  ,int* num_values
126  ,int* num_indexes
127  ,int* num_chars
128  )
129 {
130 #ifdef RTOp_DEBUG
131  assert( op );
132  assert( op->vtbl );
133  assert( op->vtbl->obj_data_vtbl );
135  assert( num_values );
136  assert( num_indexes );
137  assert( num_chars );
138 #endif
140  op->vtbl->obj_data_vtbl,op->obj_data
141  , num_values, num_indexes, num_chars );
142 }
143 
145  const struct RTOp_RTOp* op
146  ,int num_values
147  ,RTOp_value_type value_data[]
148  ,int num_indexes
149  ,RTOp_index_type index_data[]
150  ,int num_chars
151  ,RTOp_char_type char_data[]
152  )
153 {
154 #ifdef RTOp_DEBUG
155  assert( op );
156  assert( op->vtbl );
157  assert( op->vtbl->obj_data_vtbl );
158  assert( op->vtbl->obj_data_vtbl->extract_state );
159  if(num_values) assert( value_data );
160  if(num_indexes) assert( index_data );
161  if(num_chars) assert( char_data );
162 #endif
163  return op->vtbl->obj_data_vtbl->extract_state(
164  op->vtbl->obj_data_vtbl, NULL, op->obj_data
165  , num_values, value_data
166  , num_indexes, index_data
167  , num_chars, char_data );
168 }
169 
171  int num_values
172  ,const RTOp_value_type value_data[]
173  ,int num_indexes
174  ,const RTOp_index_type index_data[]
175  ,int num_chars
176  ,const RTOp_char_type char_data[]
177  ,struct RTOp_RTOp* op
178  )
179 {
180 #ifdef RTOp_DEBUG
181  assert( op );
182  assert( op->vtbl );
183  assert( op->vtbl->obj_data_vtbl );
184  assert( op->vtbl->obj_data_vtbl->load_state );
185  if(num_values) assert( value_data );
186  if(num_indexes) assert( index_data );
187  if(num_chars) assert( char_data );
188 #endif
189  return op->vtbl->obj_data_vtbl->load_state(
190  op->vtbl->obj_data_vtbl, NULL
191  ,num_values, value_data
192  ,num_indexes, index_data
193  ,num_chars, char_data
194  , &op->obj_data );
195 }
196 
197 int RTOp_free_op( struct RTOp_RTOp* op )
198 {
199 #ifdef RTOp_DEBUG
200  assert( op );
201  assert( op->vtbl );
202  assert( op->vtbl->obj_data_vtbl );
203  assert( op->vtbl->obj_data_vtbl->obj_free );
204 #endif
205  return op->vtbl->obj_data_vtbl->obj_free(
206  op->vtbl->obj_data_vtbl,NULL,&op->obj_data );
207 }
208 
210  const struct RTOp_RTOp* op
211  ,int* num_values
212  ,int* num_indexes
213  ,int* num_chars
214  )
215 {
216 #ifdef RTOp_DEBUG
217  assert( op );
218  assert( op->vtbl );
219  assert( op->vtbl->reduct_vtbl );
220  assert( op->vtbl->reduct_vtbl->get_obj_type_num_entries );
221  assert( num_values );
222  assert( num_indexes );
223  assert( num_chars );
224 #endif
226  op->vtbl->reduct_vtbl, op->obj_data
227  , num_values, num_indexes, num_chars );
228 }
229 
230 int RTOp_reduct_obj_create( const struct RTOp_RTOp* op
231  , RTOp_ReductTarget* reduct_obj )
232 {
233  int err = 0;
234 #ifdef RTOp_DEBUG
235  assert( op );
236  assert( op->vtbl );
237  assert( op->vtbl->reduct_vtbl );
238  assert( op->vtbl->reduct_vtbl->obj_create );
239 #endif
240  err = op->vtbl->reduct_vtbl->obj_create(
241  op->vtbl->reduct_vtbl,op->obj_data,reduct_obj );
242  if(err) return err;
243  if( op->vtbl->reduct_obj_reinit )
244  return op->vtbl->reduct_obj_reinit(
245  op->vtbl,op->obj_data,*reduct_obj );
246  return err;
247 }
248 
249 int RTOp_reduct_obj_reinit( const struct RTOp_RTOp* op
250  , RTOp_ReductTarget reduct_obj )
251 {
252 #ifdef RTOp_DEBUG
253  assert( op );
254  assert( op->vtbl );
255  assert( op->vtbl->reduct_vtbl );
256  assert( op->vtbl->reduct_vtbl->obj_reinit );
257  assert( reduct_obj != RTOp_REDUCT_OBJ_NULL );
258 #endif
259  if( op->vtbl->reduct_obj_reinit )
260  return op->vtbl->reduct_obj_reinit(
261  op->vtbl,op->obj_data,reduct_obj );
262  else
263  return op->vtbl->reduct_vtbl->obj_reinit(
264  op->vtbl->reduct_vtbl,op->obj_data,reduct_obj );
265 }
266 
267 int RTOp_reduct_obj_free( const struct RTOp_RTOp* op
268  , RTOp_ReductTarget* reduct_obj )
269 {
270 #ifdef RTOp_DEBUG
271  assert( op );
272  assert( op->vtbl );
273  assert( op->vtbl->reduct_vtbl );
274  assert( op->vtbl->reduct_vtbl->obj_free );
275 #endif
276  return op->vtbl->reduct_vtbl->obj_free(
277  op->vtbl->reduct_vtbl,op->obj_data,reduct_obj);
278 }
279 
281  const struct RTOp_RTOp* op
282  ,const RTOp_ReductTarget reduct_obj
283  ,int num_values
284  ,RTOp_value_type value_data[]
285  ,int num_indexes
286  ,RTOp_index_type index_data[]
287  ,int num_chars
288  ,RTOp_char_type char_data[]
289  )
290 {
291 #ifdef RTOp_DEBUG
292  assert( op );
293  assert( op->vtbl );
294  assert( op->vtbl->reduct_vtbl );
295  assert( op->vtbl->reduct_vtbl->extract_state );
296  if(num_values) assert( value_data );
297  if(num_indexes) assert( index_data );
298  if(num_chars) assert( char_data );
299 #endif
300  return op->vtbl->reduct_vtbl->extract_state(
301  op->vtbl->reduct_vtbl, op->obj_data, reduct_obj
302  ,num_values, value_data
303  ,num_indexes, index_data
304  ,num_chars, char_data );
305 }
306 
308  const struct RTOp_RTOp* op
309  ,int num_values
310  ,const RTOp_value_type value_data[]
311  ,int num_indexes
312  ,const RTOp_index_type index_data[]
313  ,int num_chars
314  ,const RTOp_char_type char_data[]
315  ,RTOp_ReductTarget reduct_obj
316  )
317 {
318  RTOp_ReductTarget reduct_obj_in = reduct_obj; /* Just keep a reference */
319  int err = 0;
320 #ifdef RTOp_DEBUG
321  assert( op );
322  assert( op->vtbl );
323  assert( op->vtbl->reduct_vtbl );
324  assert( op->vtbl->reduct_vtbl->load_state );
325  if(num_values) assert( value_data );
326  if(num_indexes) assert( index_data );
327  if(num_chars) assert( char_data );
328 #endif
329  err = op->vtbl->reduct_vtbl->load_state(
330  op->vtbl->reduct_vtbl, op->obj_data
331  ,num_values, value_data
332  ,num_indexes, index_data
333  ,num_chars, char_data
334  ,&reduct_obj );
335  if(err != 0) return err;
336  if( reduct_obj != reduct_obj_in )
337  return RTOp_ERR_INVALID_USAGE;
338  return 0; /* Success! */
339 }
340 
342  const struct RTOp_RTOp *op
343  ,int *coord_invariant
344  )
345 {
346 #ifdef RTOp_DEBUG
347  assert( op );
348  assert( op->vtbl );
349 /* assert( op->vtbl->coord_invariant ); */
350  assert( coord_invariant );
351 #endif
352 /* return op->vtbl->coord_invariant(op->vtbl,op->obj_data,coord_invariant); */
353  *coord_invariant = 1; /* ToDo: Implement the above code! */
354  return 0;
355 }
356 
357 int RTOp_apply_op( const struct RTOp_RTOp* op
358  , const int num_vecs, const struct RTOp_SubVector sub_vecs[]
359  , const int num_targ_vecs, const struct RTOp_MutableSubVector targ_sub_vecs[]
360  , RTOp_ReductTarget reduct_obj )
361 {
362 #ifdef RTOp_DEBUG
363  assert( op );
364  assert( op->vtbl );
365  assert( op->vtbl->apply_op );
366  if(num_vecs) assert(sub_vecs);
367  if(num_targ_vecs) assert(targ_sub_vecs);
368 #endif
369  return op->vtbl->apply_op(
370  op->vtbl,op->obj_data,num_vecs,sub_vecs,num_targ_vecs,targ_sub_vecs
371  ,reduct_obj);
372 }
373 
374 int RTOp_reduce_reduct_objs( const struct RTOp_RTOp* op
375  , RTOp_ReductTarget in_reduct_obj, RTOp_ReductTarget inout_reduct_obj )
376 {
377 #ifdef RTOp_DEBUG
378  assert( op );
379  assert( op->vtbl );
380  assert( op->vtbl->reduce_reduct_objs );
381 #endif
382  return op->vtbl->reduce_reduct_objs(op->vtbl,op->obj_data,in_reduct_obj,inout_reduct_obj);
383 }
384 
385 int RTOp_get_reduct_op( const struct RTOp_RTOp* op
386  , RTOp_reduct_op_func_ptr_t* reduct_op_func_ptr )
387 {
388 #ifdef RTOp_DEBUG
389  assert( op );
390  assert( op->vtbl );
391  assert( op->vtbl->get_reduct_op );
392 #endif
393  return op->vtbl->get_reduct_op(op->vtbl,op->obj_data,reduct_op_func_ptr);
394 }
395 
396 /* */
397 /* RTOp_Server */
398 /* */
399 
400 /* RTOp_Server data */
401 
402 static int RTOp_Server_num_ops = 0;
403 
404 #define RTOp_SERVER_MAX_NUM_ENTRIES 50
407 };
411 static RTOp_RTOp_vtbl_t_ptr
413 
414 /* */
415 /* Private RTOp_Server functions */
416 /* */
417 /* In this simplistic implementation the names and vtbl pointers */
418 /* are stored an accessed in unsorted tables. */
419 /* */
420 
421 /* returns the position in the table where this name is found. */
422 /* otherwise it returns < 0. */
423 static int find_op_name( const struct RTOp_Server_op_class_name op_name_tbl[]
424  , int num_entries, const char op_name[] )
425 {
426  int k = 0;
427  for( k = 0; k < num_entries; ++k )
428  {
429  if( strcmp( op_name_tbl[k].name, op_name ) == 0 )
430  return k;
431  }
432  return -1; /* Did not find the name */
433 }
434 
435 /* returns the position in the table where this reduct vtbl is found. */
436 /* otherwise it returns < 0. */
437 static int find_op_vtbl( const RTOp_RTOp_vtbl_t_ptr op_vtbl_tbl[]
438  , int num_entries, RTOp_RTOp_vtbl_t_ptr op_vtbl )
439 {
440  int k = 0;
441  for( k = 0; k < num_entries; ++k )
442  {
443  if( op_vtbl_tbl[k] == op_vtbl )
444  return k;
445  }
446  return -1; /* Did not find the name */
447 }
448 
449 /* */
450 /* Public RTOp_Server functions */
451 /* */
452 
453 int RTOp_Server_add_op_name_vtbl( const char op_class_name[]
454  , const struct RTOp_RTOp_vtbl_t* op_class_vtbl )
455 {
456  int k = 0;
457  if( strlen( op_class_name ) > RTOp_MAX_REDUCT_TRANS_OP_CLASS_NAME )
460  , RTOp_Server_num_ops, op_class_name ) ) >= 0 )
461  {
462  if( RTOp_Server_op_vtbl[k] != op_class_vtbl )
464  return k; /* The name exits but vtble is the same */
465  }
466  strcpy( RTOp_Server_op_names[RTOp_Server_num_ops].name, op_class_name );
467  RTOp_Server_op_vtbl[RTOp_Server_num_ops] = op_class_vtbl;
469  return 0; /* Successfully added it */
470 }
471 
472 int RTOp_Server_lookup_op_name( const struct RTOp_RTOp_vtbl_t* op_class_vtbl
473  , char op_class_name[] )
474 {
475  int k = 0;
476  if( ( k = find_op_vtbl(RTOp_Server_op_vtbl,RTOp_Server_num_ops,op_class_vtbl) ) >= 0 )
477  {
478  strcpy( op_class_name, RTOp_Server_op_names[k].name );
479  return 0; /* Success */
480  }
481  return -1; /* Did not find vtbl */
482 }
483 
485  const char op_class_name[]
486  ,int num_values
487  ,const RTOp_value_type value_data[]
488  ,int num_indexes
489  ,const RTOp_index_type index_data[]
490  ,int num_chars
491  ,const RTOp_char_type char_data[]
492  ,struct RTOp_RTOp* op
493  )
494 {
495  int k = 0;
496  int err = 0; /* success? */
497  if( strlen( op_class_name ) > RTOp_MAX_REDUCT_TRANS_OP_CLASS_NAME )
499  if( ( k = find_op_name(RTOp_Server_op_names,RTOp_Server_num_ops, op_class_name) ) >= 0 )
500  {
501  op->obj_data = NULL; /* Will be dyn allocated below! */
502  op->vtbl = RTOp_Server_op_vtbl[k];
503  err = RTOp_load_op_state(
504  num_values,value_data,num_indexes,index_data,num_chars,char_data
505  ,op);
506  return err;
507  }
508  return -1; /* op_class_name not found */
509 }
510 
511 void RTOp_Server_dump( FILE* file )
512 {
513  int k = 0;
514  int jn = 0, jv = 0;
515  fprintf( file, "Class names and vtbl pointers for RTOp_RTOp subcasses\n" );
516  for( k = 0; k < RTOp_Server_num_ops; ++k ) {
518  , RTOp_Server_num_ops, RTOp_Server_op_names[k].name );
519  jv = find_op_vtbl( RTOp_Server_op_vtbl, RTOp_Server_num_ops
520  , RTOp_Server_op_vtbl[k] );
521  fprintf( file
522  , " class name = \"%s\"\n"
523  " looked up class name = \"%s\"\n"
524  " vtbl = %p\n"
525  " looked up vtbl = %p\n"
526  , RTOp_Server_op_names[k].name
527  , RTOp_Server_op_names[jn].name
529  , RTOp_Server_op_vtbl[jv]
530  );
531  }
532 }
char name[RTOp_SERVER_MAX_NUM_ENTRIES+1]
Definition: RTOp.c:406
int RTOp_get_reduct_type_num_entries(const struct RTOp_RTOp *op, int *num_values, int *num_indexes, int *num_chars)
Definition: RTOp.c:209
ptrdiff_t values_stride
Definition: RTOp.h:305
double RTOp_value_type
Definition: RTOp.h:69
int RTOp_load_op_state(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[], struct RTOp_RTOp *op)
Definition: RTOp.c:170
ptrdiff_t values_stride
Definition: RTOp.h:338
int(* get_obj_type_num_entries)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, int *num_values, int *num_indexes, int *num_chars)
Definition: RTOp.h:907
void * RTOp_ReductTarget
Definition: RTOp.h:191
int RTOp_load_reduct_obj_state(const struct RTOp_RTOp *op, 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[], RTOp_ReductTarget reduct_obj)
Definition: RTOp.c:307
RTOp_index_type global_offset
Definition: RTOp.h:299
int RTOp_reduct_obj_create(const struct RTOp_RTOp *op, RTOp_ReductTarget *reduct_obj)
Definition: RTOp.c:230
void RTOp_mutable_sub_vector(RTOp_index_type global_offset, RTOp_index_type sub_dim, RTOp_value_type values[], ptrdiff_t values_stride, struct RTOp_MutableSubVector *sub_vec)
Definition: RTOp.c:77
int RTOp_reduce_reduct_objs(const struct RTOp_RTOp *op, RTOp_ReductTarget in_reduct_obj, RTOp_ReductTarget inout_reduct_obj)
Definition: RTOp.c:374
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 int find_op_vtbl(const RTOp_RTOp_vtbl_t_ptr op_vtbl_tbl[], int num_entries, RTOp_RTOp_vtbl_t_ptr op_vtbl)
Definition: RTOp.c:437
static int find_op_name(const struct RTOp_Server_op_class_name op_name_tbl[], int num_entries, const char op_name[])
Definition: RTOp.c:423
int RTOp_extract_reduct_obj_state(const struct RTOp_RTOp *op, const RTOp_ReductTarget 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[])
Definition: RTOp.c:280
int(* extract_state)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *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[])
Definition: RTOp.h:1052
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
const struct RTOp_obj_type_vtbl_t * reduct_vtbl
Definition: RTOp.h:821
int RTOp_reduct_obj_free(const struct RTOp_RTOp *op, RTOp_ReductTarget *reduct_obj)
Definition: RTOp.c:267
int RTOp_get_op_type_num_entries(const struct RTOp_RTOp *op, int *num_values, int *num_indexes, int *num_chars)
Definition: RTOp.c:123
int RTOp_get_op_name(const struct RTOp_RTOp *op, const char **op_name)
Definition: RTOp.c:108
#define RTOp_SERVER_MAX_NUM_ENTRIES
Definition: RTOp.c:404
char RTOp_char_type
Definition: RTOp.h:70
int RTOp_apply_op(const struct RTOp_RTOp *op, const int num_vecs, const struct RTOp_SubVector sub_vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_sub_vecs[], RTOp_ReductTarget reduct_obj)
Definition: RTOp.c:357
const RTOp_value_type * values
Definition: RTOp.h:303
int RTOp_Server_lookup_op_name(const struct RTOp_RTOp_vtbl_t *op_class_vtbl, char op_class_name[])
Definition: RTOp.c:472
int RTOp_Server_add_op_name_vtbl(const char op_class_name[], const struct RTOp_RTOp_vtbl_t *op_class_vtbl)
Definition: RTOp.c:453
RTOp_index_type sub_dim
Definition: RTOp.h:334
const char * op_name
Definition: RTOp.h:825
int RTOp_free_op(struct RTOp_RTOp *op)
Definition: RTOp.c:197
static struct RTOp_Server_op_class_name RTOp_Server_op_names[RTOp_SERVER_MAX_NUM_ENTRIES]
Definition: RTOp.c:408
int RTOp_extract_op_state(const struct RTOp_RTOp *op, int num_values, RTOp_value_type value_data[], int num_indexes, RTOp_index_type index_data[], int num_chars, RTOp_char_type char_data[])
Definition: RTOp.c:144
const struct RTOp_RTOp_vtbl_t * RTOp_RTOp_vtbl_t_ptr
Definition: RTOp.c:410
int(* obj_free)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
Definition: RTOp.h:1019
RTOp_value_type * values
Definition: RTOp.h:336
#define RTOp_ERR_INVALID_USAGE
Definition: RTOp.h:264
#define RTOp_SERVER_INCOMPATIBLE_OPS
Definition: RTOp.h:272
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
int(* apply_op)(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector sub_vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_sub_vecs[], RTOp_ReductTarget reduct_obj)
Definition: RTOp.h:842
int(* reduct_obj_reinit)(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, RTOp_ReductTarget reduct_obj)
Definition: RTOp.h:834
const struct RTOp_RTOp_vtbl_t * vtbl
Definition: RTOp.h:802
#define RTOp_MAX_REDUCT_TRANS_OP_CLASS_NAME
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)
Definition: RTOp.h:852
int RTOp_Server_construct_op(const char op_class_name[], 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[], struct RTOp_RTOp *op)
Definition: RTOp.c:484
static RTOp_RTOp_vtbl_t_ptr RTOp_Server_op_vtbl[RTOp_SERVER_MAX_NUM_ENTRIES]
Definition: RTOp.c:412
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)
Definition: RTOp.h:848
RTOp_index_type global_offset
Definition: RTOp.h:332
int(* load_state)(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_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 **obj)
Definition: RTOp.h:1097
void RTOp_mutable_sub_vector_null(struct RTOp_MutableSubVector *sub_vec)
Definition: RTOp.c:95
int RTOp_reduct_obj_reinit(const struct RTOp_RTOp *op, RTOp_ReductTarget reduct_obj)
Definition: RTOp.c:249
RTOp_index_type sub_dim
Definition: RTOp.h:301
int RTOp_get_reduct_op(const struct RTOp_RTOp *op, RTOp_reduct_op_func_ptr_t *reduct_op_func_ptr)
Definition: RTOp.c:385
static int RTOp_Server_num_ops
Definition: RTOp.c:402
#define RTOp_SERVER_OP_NAME_TOO_LONG
Definition: RTOp.h:274
void RTOp_Server_dump(FILE *file)
Definition: RTOp.c:511
void RTOp_sub_vector_null(struct RTOp_SubVector *sub_vec)
Definition: RTOp.c:69
int RTOp_coord_invariant(const struct RTOp_RTOp *op, int *coord_invariant)
Definition: RTOp.c:341
Teuchos_Ordinal RTOp_index_type
Definition: RTOp.h:68
#define RTOp_REDUCT_OBJ_NULL
Definition: RTOp.h:192