MOOCHO (Single Doxygen Collection) Version of the Day

#include "RTOp.h"
Go to the source code of this file.
struct RTOp_RTOp_vtbl_t  RTOp_ROp_get_sub_vector_vtbl 
int  RTOp_ROp_get_sub_vector_construct (RTOp_index_type l, RTOp_index_type u, struct RTOp_RTOp *op) 
int  RTOp_ROp_get_sub_vector_set_range (RTOp_index_type l, RTOp_index_type u, struct RTOp_RTOp *op) 
int  RTOp_ROp_get_sub_vector_destroy (struct RTOp_RTOp *op) 
struct RTOp_SubVector  RTOp_ROp_get_sub_vector_val (RTOp_ReductTarget reduct_obj) 
Reduction operator for extracting a subvector out of the whole vector.
sub_vec < v[0](l,u)
This operator is only defined to allow one vector argument (num_vecs == 1
) v[0]
. Using a reduction operator to extract a subvector will be reasonably efficient for some types of vector subclasses (e.g. serial vectors) but very slow for others (e.g. outofcore and parallel vectors). It would be better for vector subclasses to implement this operation directly but if they don't you can use this operator to extract the required subvector.
This operator class works by allocating a dense subvector and then initializing the values to zero. During the reduction of a single vector chunk, nonzero values are set. After the global reduction is performed, the vector is compacted (i.e. the zero elements are removed if present) by the RTOp_ROp_get_sub_vector_val<tt>(...) function.
Definition in file RTOp_ROp_get_sub_vector.h.
int RTOp_ROp_get_sub_vector_construct  (  RTOp_index_type  l, 
RTOp_index_type  u,  
struct RTOp_RTOp *  op  
) 
Definition at line 489 of file RTOp_ROp_get_sub_vector.c.
int RTOp_ROp_get_sub_vector_set_range  (  RTOp_index_type  l, 
RTOp_index_type  u,  
struct RTOp_RTOp *  op  
) 
Definition at line 501 of file RTOp_ROp_get_sub_vector.c.
int RTOp_ROp_get_sub_vector_destroy  (  struct RTOp_RTOp *  op  ) 
Definition at line 513 of file RTOp_ROp_get_sub_vector.c.
struct RTOp_SubVector RTOp_ROp_get_sub_vector_val  (  RTOp_ReductTarget  reduct_obj  )  [read] 
Get the subvector.
This function should only be called after the complete reduction operation has been finished. However, RTOp_reduct_obj_free(...)
should still be called to delete the reduct_obj
once it is finished being used.
reduct_obj  [in/out] On input, this object must at least be initialized and may or may not have been through any reduction operations. 
free(reduct_obj)
and then set reduct_obj == RTOp_REDUCT_OBJ_NULL
to avoid future mistakes. Definition at line 524 of file RTOp_ROp_get_sub_vector.c.
Definition at line 478 of file RTOp_ROp_get_sub_vector.c.