Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_TieBreak.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_DETAILS_TIEBREAK_HPP
11#define TPETRA_DETAILS_TIEBREAK_HPP
12
15
17#include "Teuchos_RCP.hpp"
18#include <utility>
19#include <vector>
20
21namespace Tpetra {
22namespace Details {
23
37template <typename LocalOrdinal, typename GlobalOrdinal>
38class TieBreak {
39 public:
53 struct Triplet {
54 LocalOrdinal LID;
55 GlobalOrdinal GID;
56 int PID;
57 };
58
68 virtual bool mayHaveSideEffects() const {
69 return true;
70 }
71
73 virtual ~TieBreak() = default;
74
95 virtual std::size_t
97 const std::vector<std::pair<int, LocalOrdinal> >& pid_and_lid) const = 0;
98};
99
100} // namespace Details
101} // namespace Tpetra
102
103#endif // TPETRA_DETAILS_TIEBREAK_HPP
Forward declaration for Tpetra::TieBreak.
Struct that holds views of the contents of a CrsMatrix.
Interface for breaking ties in ownership.
virtual ~TieBreak()=default
Virtual destructor (for memory safety of derived classes).
virtual bool mayHaveSideEffects() const
Whether selectedIndex() may have side effects.
virtual std::size_t selectedIndex(GlobalOrdinal GID, const std::vector< std::pair< int, LocalOrdinal > > &pid_and_lid) const =0
Break any ties in ownership of the given global index GID.
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Representation of a global index on a process.