|
Teuchos - Trilinos Tools Package Version of the Day
|
Teuchos version of MPI_MAXLOC. More...
Public Member Functions | |
| void | reduce (const Ordinal count, const std::pair< ScalarType, IndexType > inBuffer[], std::pair< ScalarType, IndexType > inoutBuffer[]) const |
| | |
Teuchos version of MPI_MAXLOC.
| Ordinal | The template parameter of Comm. |
| Packet | A type with value semantics; the type on which to reduce. |
MPI_MAXLOC is a standard reduction operator provided by the MPI standard. According to the standard, MPI_MAXLOC combines the (value, index) pairs (u,i) and (v,j) into (w,j), where
, and
This class implements the MPI_MAXLOC reduction operator for the Teuchos communication wrappers.
What happens to NaN ("Not a Number")? A NaN is neither less than, greater than, or equal to any floating-point number or any NaN. We can alter the above definition slightly so that a MaxLoc reduction has a well-defined result in case the array contains a NaN:
and
Defining MaxLoc in this way ensures that for any array containing a NaN, the value (w) returned is the first NaN, and the index (k) returned is the index of the first NaN.
Definition at line 104 of file Teuchos_TimeMonitor.cpp.
| void Teuchos::MaxLoc< Ordinal, ScalarType, IndexType >::reduce | ( | const Ordinal | count, |
| const std::pair< ScalarType, IndexType > | inBuffer[], | ||
| std::pair< ScalarType, IndexType > | inoutBuffer[] | ||
| ) | const [virtual] |
1.7.4