SLIDE
3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
predicate_functions.hpp
Go to the documentation of this file.
1
/*
2
* predicate_functions.cpp
3
*
4
* Predicate functions to help to write everything shorter.
5
*
6
* Created on: 07 Apr 2022
7
* Author(s): Jorn Reniers, Volkan Kumtepeli
8
*/
9
10
#pragma once
11
12
namespace
slide::util
{
13
template
<
typename
T>
14
constexpr
auto
is_zero
(T x)
15
{
16
return
x == 0;
17
}
18
19
template
<
typename
T>
20
constexpr
int
sign
(T x)
21
{
22
return
(x > T(0)) - (x < T(0));
23
}
24
25
}
// namespace slide::util
slide::util
Definition:
predicate_functions.hpp:12
slide::util::is_zero
constexpr auto is_zero(T x)
Definition:
predicate_functions.hpp:14
slide::util::sign
constexpr int sign(T x)
Definition:
predicate_functions.hpp:20
src
utility
predicate_functions.hpp
Generated by
1.9.5