diff options
author | 2019-11-02 22:25:11 +0100 | |
---|---|---|
committer | 2019-11-02 22:25:11 +0100 | |
commit | 77ea61bac778e0eccaf2872e6d67c2eec7eb541b (patch) | |
tree | 34559a448c8c142ee5e707b567fa17d7c98cf006 /src/lib/netlist/plib/pfunction.cpp | |
parent | 7518cc226b9a6754847f67f6129b44c34be29179 (diff) |
netlist: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud]
The newly added RELTOL and VNTOL parameters implement Newton convergence
checks comparable following other SPICE implementations.
The ACCURACY solver parameter now is only used for convergence checks in
iterative solvers.
In addition, type safety was significantly improved and a lot of "magic"
numbers are identifiable now.
Diffstat (limited to 'src/lib/netlist/plib/pfunction.cpp')
-rw-r--r-- | src/lib/netlist/plib/pfunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index 3a1c2962169..48939c8236a 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -195,9 +195,9 @@ namespace plib { template <typename NT> NT pfunction<NT>::evaluate(const std::vector<NT> &values) noexcept { - std::array<NT, 20> stack = { 0 }; + std::array<NT, 20> stack = { plib::constants<NT>::zero() }; unsigned ptr = 0; - stack[0] = 0.0; + stack[0] = plib::constants<NT>::zero(); for (auto &rc : m_precompiled) { switch (rc.m_cmd) @@ -226,5 +226,6 @@ namespace plib { template class pfunction<float>; template class pfunction<double>; + template class pfunction<long double>; } // namespace plib |