10#ifndef TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
11#define TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
20#include "Kokkos_Core.hpp"
55template <
class LocalGraphType,
class LocalMapType>
85 dst.couldBeLowerTriangular =
true;
86 dst.couldBeUpperTriangular =
true;
90 join(result_type& dst,
91 const result_type& src)
const {
92 dst.diagCount += src.diagCount;
93 dst.maxNumRowEnt = (src.maxNumRowEnt > dst.maxNumRowEnt) ? src.maxNumRowEnt : dst.maxNumRowEnt;
94 dst.couldBeLowerTriangular &= src.couldBeLowerTriangular;
95 dst.couldBeUpperTriangular &= src.couldBeUpperTriangular;
102 using LO =
typename LocalMapType::local_ordinal_type;
103 using GO =
typename LocalMapType::global_ordinal_type;
104 using LOT = typename ::Tpetra::Details::OrdinalTraits<LO>;
121 if (ignoreMapsForTriangularStructure_) {
137 result.couldBeUpperTriangular =
false;
140 result.couldBeLowerTriangular =
false;
146 result.couldBeLowerTriangular ||
147 result.couldBeUpperTriangular);
155 result.couldBeUpperTriangular =
false;
158 result.couldBeLowerTriangular =
false;
175 bool ignoreMapsForTriangularStructure_;
197template <
class LocalGraphType,
class LocalMapType>
203 using LO =
typename LocalMapType::local_ordinal_type;
204 using execution_space =
typename LocalGraphType::device_type::execution_space;
205 using range_type = Kokkos::RangePolicy<execution_space, LO>;
210 Kokkos::parallel_reduce(
"Tpetra::Details::determineLocalTriangularStructure",
211 range_type(0,
G.numRows()),
Import KokkosSparse::OrdinalTraits, a traits class for "invalid" (flag) values of integer types,...
Struct that holds views of the contents of a CrsMatrix.
Implementation of Tpetra::Details::determineLocalTriangularStructure (which see below).
KOKKOS_INLINE_FUNCTION void operator()(const typename LocalMapType::local_ordinal_type lclRow, result_type &result) const
Reduction operator: result is (diagonal count, error count).
KOKKOS_INLINE_FUNCTION void init(result_type &dst) const
Set the initial value of the reduction result.
DetermineLocalTriangularStructure(const LocalGraphType &G, const LocalMapType &rowMap, const LocalMapType &colMap, const bool ignoreMapsForTriangularStructure)
Constructor.
Implementation details of Tpetra.
LocalTriangularStructureResult< typename LocalMapType::local_ordinal_type > determineLocalTriangularStructure(const LocalGraphType &G, const LocalMapType &rowMap, const LocalMapType &colMap, const bool ignoreMapsForTriangularStructure)
Count the local number of diagonal entries in a local sparse graph, and determine whether the local p...
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Return value of determineLocalTriangularStructure.
bool couldBeUpperTriangular
Whether the graph is locally structurally upper triangular.
LO diagCount
(Local) number of populated diagonal entries.
LO maxNumRowEnt
Maximum number of entries over all local rows.
bool couldBeLowerTriangular
Whether the graph is locally structurally lower triangular.