Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_Exceptions_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_EXCEPTIONS_DECL_HPP
11#define TPETRA_EXCEPTIONS_DECL_HPP
12
13#include <Tpetra_ConfigDefs.hpp>
14#include <stdexcept>
15
16namespace Tpetra {
17
35
40namespace Details {
41
47template<class GlobalOrdinal>
48class InvalidGlobalIndex : public std::domain_error {
49public:
54 InvalidGlobalIndex (const std::string& msg, const GlobalOrdinal globalIndex)
55 : std::domain_error (msg), glInd_ (globalIndex)
56 {}
57
59 GlobalOrdinal offendingIndex () const { return glInd_; }
60
61private:
63 const GlobalOrdinal glInd_;
64};
65
71template<class GlobalOrdinal>
72class InvalidGlobalRowIndex : public InvalidGlobalIndex<GlobalOrdinal> {
73public:
78 InvalidGlobalRowIndex (const std::string& msg, const GlobalOrdinal globalIndex)
79 : InvalidGlobalIndex<GlobalOrdinal> (msg, globalIndex)
80 {}
81};
82
83} // namespace Details
84} // namespace Tpetra
85
86#endif // TPETRA_EXCEPTIONS_DECL_HPP
InvalidGlobalIndex(const std::string &msg, const GlobalOrdinal globalIndex)
Constructor.
GlobalOrdinal offendingIndex() const
The offending global index.
InvalidGlobalRowIndex(const std::string &msg, const GlobalOrdinal globalIndex)
Constructor.
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.