AbstractLinAlgPack_Vector.hpp File Reference

#include <iosfwd>
#include "AbstractLinAlgPack_Types.hpp"
#include "RTOpPack_RTOpT.hpp"

Include dependency graph for AbstractLinAlgPack_Vector.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  AbstractLinAlgPack

Classes

class  AbstractLinAlgPack::Vector
 Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}. More...

Functions

void apply_op (const RTOpPack::RTOp &op, const size_t num_vecs, const Vector *vecs[], const size_t num_targ_vecs, VectorMutable *targ_vecs[], RTOpPack::ReductTarget *reduct_obj, const index_type first_ele=1, const index_type sub_dim=0, const index_type global_offset=0)
 Apply a reduction/transformation,operation over a set of vectors: op(op(v[0]...v[nv-1],z[0]...z[nz-1]),(*reduct_obj)) -> z[0]...z[nz-1],(*reduct_obj).


Function Documentation

void AbstractLinAlgPack::apply_op const RTOpPack::RTOp op,
const size_t  num_vecs,
const Vector *  vecs[],
const size_t  num_targ_vecs,
VectorMutable *  targ_vecs[],
RTOpPack::ReductTarget reduct_obj,
const index_type  first_ele = 1,
const index_type  sub_dim = 0,
const index_type  global_offset = 0
 

Apply a reduction/transformation,operation over a set of vectors: op(op(v[0]...v[nv-1],z[0]...z[nz-1]),(*reduct_obj)) -> z[0]...z[nz-1],(*reduct_obj).

The logical vector passed to the op.apply_op(...) method is:


 v(k + global_offset) = this->get_ele(first_ele + k - 1)
 , for k = 1 ... sub_dim
 

where v represents any one of the input or input/output vectors. The situation where first_ele == 1 and global_offset > 1 corresponds to the case where the vectors represent consitituent vectors in a larger aggregrate vector. The situation where first_ele > 1 and global_offset == 0 is for when a sub-view of the vectors are being treated as full vectors. Other combinations of these arguments are also possible.

Preconditions:

  • [num_vecs > 0] vecs[k]->space().isCompatible(this->space()) == true , for k = 0...num_vecs-1 (throw VectorSpace::IncompatibleVectorSpaces)
  • [num_targ_vecs > 0] targ_vecs[k]->space().isCompatible(this->space()) == true , for k = 0...num_targ_vecs-1 (throw VectorSpace::IncompatibleVectorSpaces)
  • 1 <= first_ele <= this->dim() (throw std::out_of_range)
  • global_offset >= 0 (throw std::invalid_argument)
  • sub_dim - (first_ele - 1) <= this->dim() (throw std::length_error).

Parameters:
op [in] Reduction/transformation operator to apply over each sub-vector and assemble the intermediate targets into reduct_obj (if reduct_obj != NULL).
num_vecs [in] Number of nonmutable vectors in vecs[]. If vecs==NULL then this argument is ignored but should be set to zero.
vecs [in] Array (length num_vecs) of a set of pointers to nonmutable vectors to include in the operation. The order of these vectors is significant to op.
num_targ_vecs [in] Number of mutable vectors in targ_vecs[]. If targ_vecs==NULL then this argument is ignored but should be set to zero.
targ_vecs [in] Array (length num_targ_vecs) of a set of pointers to mutable vectors to include in the operation. The order of these vectors is significant to op. If targ_vecs==NULL then op is called with no mutable vectors.
reduct_obj [in/out] Target object of the reduction operation. This object must have been created by the op.reduct_obj_create_raw(&reduct_obj) function first. The reduction operation will be added to (*reduct_obj) if (*reduct_obj) has already been through a reduction. By allowing the info in (*reduct_obj) to be added to the reduction over all of these vectors, the reduction operation can be accumulated over a set of abstract vectors which can be useful for implementing composite vectors for instance. If op.get_reduct_type_num_entries(...) returns num_values == 0, num_indexes == 0 and num_chars == 0 then reduct_obj should be set to NULL and no reduction will be performed.
first_ele [in] (default = 1) The index of the first element in this to be included.
sub_dim [in] (default = 0) The number of elements in these vectors to include in the reduction/transformation operation. The value of sub_dim == 0 means to include all available elements.
global_offset [in] (default = 0) The offset applied to the included vector elements.

Definition at line 292 of file AbstractLinAlgPack_Vector.cpp.


Generated on Thu Sep 18 12:35:30 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1