diff options
author | couriersud <couriersud@gmx.org> | 2020-04-26 17:48:38 +0200 |
---|---|---|
committer | couriersud <couriersud@gmx.org> | 2020-04-28 21:08:02 +0200 |
commit | 420f4909bef170af33e99c881f9e6e807bea8aaf (patch) | |
tree | 920910bac5c2dc744eb637633dc0e3daba1657a3 /src/lib/netlist/nltypes.h | |
parent | 4c38dd6f929eca2affa88b1f8ffb95c0fe81879f (diff) |
netlist: Fix clang-tidy warnings. (nw)
Diffstat (limited to 'src/lib/netlist/nltypes.h')
-rw-r--r-- | src/lib/netlist/nltypes.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h index ed6a4dcf6b0..cc0dac87f05 100644 --- a/src/lib/netlist/nltypes.h +++ b/src/lib/netlist/nltypes.h @@ -26,9 +26,23 @@ namespace netlist { - /// \brief plib::constants struct specialized for nl_fptype. + /// \brief Constants and const calculations for the library /// - struct nlconst : public plib::constants<nl_fptype> + template<typename T> + struct nlconst_base : public plib::constants<T> + { + using BC = plib::constants<T>; + + static inline constexpr T np_VT(T n=BC::one(), T temp=BC::T0()) noexcept + { return n * temp * BC::k_b() / BC::Q_e(); } + + static inline constexpr T np_Is() noexcept + { return static_cast<T>(1e-15); } // NOLINT + }; + + /// \brief nlconst_base struct specialized for nl_fptype. + /// + struct nlconst : public nlconst_base<nl_fptype> { }; |