10#ifndef TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
11#define TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
20#include "Kokkos_Core.hpp"
55 template<
class LocalGraphType,
class LocalMapType>
87 dst.couldBeLowerTriangular =
true;
88 dst.couldBeUpperTriangular =
true;
92 join (result_type& dst,
93 const result_type& src)
const
95 dst.diagCount += src.diagCount;
96 dst.maxNumRowEnt = (src.maxNumRowEnt > dst.maxNumRowEnt) ?
97 src.maxNumRowEnt : dst.maxNumRowEnt;
98 dst.couldBeLowerTriangular &= src.couldBeLowerTriangular;
99 dst.couldBeUpperTriangular &= src.couldBeUpperTriangular;
107 using LO =
typename LocalMapType::local_ordinal_type;
108 using GO =
typename LocalMapType::global_ordinal_type;
109 using LOT = typename ::Tpetra::Details::OrdinalTraits<LO>;
127 if (ignoreMapsForTriangularStructure_) {
143 result.couldBeUpperTriangular =
false;
146 result.couldBeLowerTriangular =
false;
153 result.couldBeLowerTriangular ||
154 result.couldBeUpperTriangular);
163 result.couldBeUpperTriangular =
false;
166 result.couldBeLowerTriangular =
false;
183 bool ignoreMapsForTriangularStructure_;
205template<
class LocalGraphType,
class LocalMapType>
212 using LO =
typename LocalMapType::local_ordinal_type;
213 using execution_space =
typename LocalGraphType::device_type::execution_space;
214 using range_type = Kokkos::RangePolicy<execution_space, LO>;
219 Kokkos::parallel_reduce (
"Tpetra::Details::determineLocalTriangularStructure",
220 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.