VTK  9.4.20241113
Public Member Functions | List of all members
vtkCommunicator::Operation Class Referenceabstract

A custom operation to use in a reduce command. More...

#include <vtkCommunicator.h>

Public Member Functions

virtual void Function (const void *A, void *B, vtkIdType length, int datatype)=0
 Subclasses must overload this method, which performs the actual operations.
 
virtual int Commutative ()=0
 Subclasses override this method to specify whether their operation is commutative.
 
virtual ~Operation ()=default
 

Detailed Description

A custom operation to use in a reduce command.

Subclass this object to provide your own operations.

Definition at line 95 of file vtkCommunicator.h.

Constructor & Destructor Documentation

◆ ~Operation()

virtual vtkCommunicator::Operation::~Operation ( )
virtualdefault

Member Function Documentation

◆ Function()

virtual void vtkCommunicator::Operation::Function ( const void *  A,
void *  B,
vtkIdType  length,
int  datatype 
)
pure virtual

Subclasses must overload this method, which performs the actual operations.

The methods should first do a reinterpret cast of the arrays to the type suggested by datatype (which will be one of the VTK type identifiers like VTK_INT, etc.). Both arrays are considered top be length entries. The method should perform the operation A*B (where * is a placeholder for whatever operation is actually performed) and store the result in B. The operation is assumed to be associative. Commutativity is specified by the Commutative method.

◆ Commutative()

virtual int vtkCommunicator::Operation::Commutative ( )
pure virtual

Subclasses override this method to specify whether their operation is commutative.

It should return 1 if commutative or 0 if not.


The documentation for this class was generated from the following file: