47#ifndef PACKAGES_XPETRA_CRSMATRIX_UTILS_HPP_
48#define PACKAGES_XPETRA_CRSMATRIX_UTILS_HPP_
52#include "Xpetra_Map.hpp"
54#ifdef HAVE_XPETRA_EPETRA
55#include "Epetra_Util.h"
58#ifdef HAVE_XPETRA_TPETRA
59#include "Tpetra_Import_Util2.hpp"
71 template <
class Scalar,
76#undef XPETRA_CRSMATRIXUTILS_SHORT
88#if defined(HAVE_XPETRA_EPETRA)
89 throw(
Xpetra::Exceptions::RuntimeError(
"Xpetra::CrsMatrixUtils::sortCrsEntries only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)"));
92#ifdef HAVE_XPETRA_TPETRA
93 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
108#if defined(HAVE_XPETRA_EPETRA)
109 throw(
Xpetra::Exceptions::RuntimeError(
"Xpetra::CrsMatrixUtils::sortAndMergeCrsEntries only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)"));
112#ifdef HAVE_XPETRA_TPETRA
113 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
122#ifdef HAVE_XPETRA_EPETRA
130#undef XPETRA_CRSMATRIXUTILS_SHORT
142#if defined(HAVE_XPETRA_EPETRA)
153#ifdef HAVE_XPETRA_TPETRA
154 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
169#if defined(HAVE_XPETRA_EPETRA)
180#ifdef HAVE_XPETRA_TPETRA
181 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
198#undef XPETRA_CRSMATRIXUTILS_SHORT
210#if defined(HAVE_XPETRA_EPETRA)
221#ifdef HAVE_XPETRA_TPETRA
222 Tpetra::Import_Util::sortCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
237#if defined(HAVE_XPETRA_EPETRA)
248#ifdef HAVE_XPETRA_TPETRA
249 Tpetra::Import_Util::sortAndMergeCrsEntries(CRS_rowptr, CRS_colind, CRS_vals);
261#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)