seams-core v2.16.3
libyodaLib, the C++ engine of d-SEAMS
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
ring_count.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
#include <limits>
5
#include <stdexcept>
6
7
namespace
primitive
{
8
9
// The histogram and per-atom counts use int at the public API boundary.
10
// Refuse a count that cannot be represented before doing the addition.
11
inline
void
addRingCount
(
int
&count, std::int64_t increment = 1) {
12
if
(count < 0 || increment < 0 ||
13
increment >
static_cast<
std::int64_t
>
(std::numeric_limits<int>::max()) -
14
count) [[unlikely]] {
15
throw
std::overflow_error(
"primitive ring count exceeds int range"
);
16
}
17
count +=
static_cast<
int
>
(increment);
18
}
19
20
}
// namespace primitive
primitive
Functions for generating primitive rings.
Definition
franzblau.hpp:77
primitive::addRingCount
void addRingCount(int &count, std::int64_t increment=1)
Definition
ring_count.hpp:11
src
include
internal
ring_count.hpp
Generated by
1.18.0
Generated by
Doxygen 1.18.0
Analytics by
Antics
provided by
TurtleTech ehf