44#ifndef TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
45#define TPETRA_DETAILS_DETERMINELOCALTRIANGULARSTRUCTURE_HPP
54#include "Kokkos_Core.hpp"
89 template<
class LocalGraphType,
class LocalMapType>
120 dst.maxNumRowEnt = 0;
121 dst.couldBeLowerTriangular =
true;
122 dst.couldBeUpperTriangular =
true;
126 join (result_type& dst,
127 const result_type& src)
const
129 dst.diagCount += src.diagCount;
130 dst.maxNumRowEnt = (src.maxNumRowEnt > dst.maxNumRowEnt) ?
131 src.maxNumRowEnt : dst.maxNumRowEnt;
132 dst.couldBeLowerTriangular &= src.couldBeLowerTriangular;
133 dst.couldBeUpperTriangular &= src.couldBeUpperTriangular;
141 using LO =
typename LocalMapType::local_ordinal_type;
142 using GO =
typename LocalMapType::global_ordinal_type;
143 using LOT = typename ::Tpetra::Details::OrdinalTraits<LO>;
161 if (ignoreMapsForTriangularStructure_) {
177 result.couldBeUpperTriangular =
false;
180 result.couldBeLowerTriangular =
false;
187 result.couldBeLowerTriangular ||
188 result.couldBeUpperTriangular);
197 result.couldBeUpperTriangular =
false;
200 result.couldBeLowerTriangular =
false;
217 bool ignoreMapsForTriangularStructure_;
239template<
class LocalGraphType,
class LocalMapType>
246 using LO =
typename LocalMapType::local_ordinal_type;
247 using execution_space =
typename LocalGraphType::device_type::execution_space;
248 using range_type = Kokkos::RangePolicy<execution_space, LO>;
253 Kokkos::parallel_reduce (
"Tpetra::Details::determineLocalTriangularStructure",
254 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.