Zoltan2
Loading...
Searching...
No Matches
Zoltan2_Util.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Zoltan2: A package of combinatorial algorithms for scientific computing
4//
5// Copyright 2012 NTESS and the Zoltan2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
16#ifndef ZOLTAN2_UTIL_HPP
17#define ZOLTAN2_UTIL_HPP
18
19#include <Zoltan2_Standards.hpp>
20#include <Teuchos_DefaultComm.hpp>
21#include <stdexcept>
22
23namespace Zoltan2{
24
26
27template <typename scalar_t>
28 inline bool outsideRegion(scalar_t val, scalar_t mark, double epsilon){
29 return ((val < mark-epsilon) || (val > mark+epsilon));
30}
31
32static inline void
33AssertCondition(bool condition, const std::string &message,
34 const char *file = __FILE__, int line = __LINE__) {
35 if (!condition) {
36 std::ostringstream eMsg;
37 eMsg << "Error: " << file << ", " << line << ": " << message
38 << std::endl;
39 throw std::runtime_error(eMsg.str());
40 }
41}
42
43} // namespace Zoltan2
44
45#endif
Gathering definitions used in software development.
Created by mbenlioglu on Aug 31, 2020.
bool outsideRegion(scalar_t val, scalar_t mark, double epsilon)
long getProcessKilobytes()
static void AssertCondition(bool condition, const std::string &message, const char *file=__FILE__, int line=__LINE__)
#define epsilon
Definition nd.cpp:47