RTOpPack: Extra C/C++ Code for Vector Reduction/Transformation Operators Version of the Day

#include "RTOp.h"
#include "RTOp_SparseSubVector.h"
Go to the source code of this file.
int  RTOp_TOp_set_sub_vector_construct (const struct RTOp_SparseSubVector *sub_vec, struct RTOp_RTOp *op) 
int  RTOp_TOp_set_sub_vector_set_sub_vec (const struct RTOp_SparseSubVector *sub_vec, struct RTOp_RTOp *op) 
int  RTOp_TOp_set_sub_vector_destroy (struct RTOp_RTOp *op) 
Transforamtion operator for setting a subvector in a whole vector.
z[0](sub_vec.global_offset+1,sub_vec.global_offset+sub_vec.sub_dim) < sub_vec
This operator is only defined to allow one vector argument (num_targ_vecs == 1
) z[0]
. Using a reduction operator to set a subvector will be reasonably efficient for some types of vector subclasses (e.g. dense and sparse serial vectors and parallel vectors with client in every process) but very slow for others (e.g. outofcore vectors and parallel vectors where operator object must be scattered to various processes). It would be better for vector subclasses to implement this operation directly but if they don't you can use this operator to set the required subvector.
This operator class works by allocating an internal subvector as the operator object state data.
Definition in file RTOp_TOp_set_sub_vector.h.
int RTOp_TOp_set_sub_vector_construct  (  const struct RTOp_SparseSubVector *  sub_vec, 
struct RTOp_RTOp *  op  
) 
Constructor.
Note that a copy of sub_vec is not made. Therefore, the client must not disturb sub_vec
while this operator object is in use!
Definition at line 344 of file RTOp_TOp_set_sub_vector.c.
int RTOp_TOp_set_sub_vector_set_sub_vec  (  const struct RTOp_SparseSubVector *  sub_vec, 
struct RTOp_RTOp *  op  
) 
Reinitialize the range for the subvector to extract.
Note that a copy of sub_vec is not made. Therefore, the client must not disturb sub_vec
while this operator object is in use!
Definition at line 356 of file RTOp_TOp_set_sub_vector.c.
int RTOp_TOp_set_sub_vector_destroy  (  struct RTOp_RTOp *  op  ) 
Destructor.
Definition at line 373 of file RTOp_TOp_set_sub_vector.c.