10#ifndef PACKAGES_XPETRA_CRSMATRIX_UTILS_HPP_
11#define PACKAGES_XPETRA_CRSMATRIX_UTILS_HPP_
15#include "Xpetra_Map.hpp"
17#ifdef HAVE_XPETRA_EPETRA
18#include "Epetra_Util.h"
21#ifdef HAVE_XPETRA_TPETRA
22#include "Tpetra_Import_Util2.hpp"
34template <
class Scalar,
37 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
39#undef XPETRA_CRSMATRIXUTILS_SHORT
49#if defined(HAVE_XPETRA_EPETRA)
50 throw(
Xpetra::Exceptions::RuntimeError(
"Xpetra::CrsMatrixUtils::sortCrsEntries only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)"));
53#ifdef HAVE_XPETRA_TPETRA
54 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
68#if defined(HAVE_XPETRA_EPETRA)
69 throw(
Xpetra::Exceptions::RuntimeError(
"Xpetra::CrsMatrixUtils::sortAndMergeCrsEntries only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)"));
72#ifdef HAVE_XPETRA_TPETRA
73 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
82#ifdef HAVE_XPETRA_EPETRA
90#undef XPETRA_CRSMATRIXUTILS_SHORT
100#if defined(HAVE_XPETRA_EPETRA)
110#ifdef HAVE_XPETRA_TPETRA
111 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
125#if defined(HAVE_XPETRA_EPETRA)
135#ifdef HAVE_XPETRA_TPETRA
136 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
152#undef XPETRA_CRSMATRIXUTILS_SHORT
162#if defined(HAVE_XPETRA_EPETRA)
172#ifdef HAVE_XPETRA_TPETRA
173 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
187#if defined(HAVE_XPETRA_EPETRA)
197#ifdef HAVE_XPETRA_TPETRA
198 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
210#define XPETRA_CRSMATRIXUTILS_SHORT
static int SortAndMergeCrsEntries(int NumRows, int *CRS_rowptr, int *CRS_colind, double *CRS_vals)
static int SortCrsEntries(int NumRows, const int *CRS_rowptr, int *CRS_colind, double *CRS_vals)
static void sortAndMergeCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort and merge the entries of the (raw CSR) matrix by column index within each row.
static void sortCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort the entries of the (raw CSR) matrix by column index within each row.
static void sortAndMergeCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort and merge the entries of the (raw CSR) matrix by column index within each row.
static void sortCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort the entries of the (raw CSR) matrix by column index within each row.
Xpetra utility class for CrsMatrix-related routines.
static void sortCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort the entries of the (raw CSR) matrix by column index within each row.
static void sortAndMergeCrsEntries(const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< LocalOrdinal > &CRS_colind, const Teuchos::ArrayView< Scalar > &CRS_vals, const UnderlyingLib lib)
Sort and merge the entries of the (raw CSR) matrix by column index within each row.
Exception throws to report errors in the internal logical of the program.
std::string toString(const T &t)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode