eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
fpe_handler.h
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
13
14
#include <fenv.h>
15
#include <mutex>
16
17
namespace
eonc
{
18
19
// Floating Point Trapping. It is platform specific!
20
// This causes the program to crash on divison by zero,
21
// invalid operations, and overflows.
22
void
enableFPE
(
void
);
23
void
disableFPE
(
void
);
24
25
class
FPEHandler
{
26
public
:
27
// Fix for gh-184, see
28
// https://github.com/numpy/numpy/issues/20504#issuecomment-985542508
29
void
eat_fpe
();
30
void
restore_fpe
();
31
32
private
:
33
fenv_t
orig_feenv
;
34
std::mutex
mutex_
;
35
};
36
37
}
// namespace eonc
eonc::FPEHandler
Definition
fpe_handler.h:25
eonc::FPEHandler::mutex_
std::mutex mutex_
Definition
fpe_handler.h:34
eonc::FPEHandler::orig_feenv
fenv_t orig_feenv
Definition
fpe_handler.h:33
eonc::FPEHandler::restore_fpe
void restore_fpe()
Definition
fpe_handler.cpp:251
eonc::FPEHandler::eat_fpe
void eat_fpe()
Definition
fpe_handler.cpp:246
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:19
eonc::enableFPE
void enableFPE()
Definition
fpe_handler.cpp:193
eonc::disableFPE
void disableFPE()
Definition
fpe_handler.cpp:229
include
eon
fpe_handler.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf