diff options
Diffstat (limited to 'src/lib/netlist/analog/nlid_fourterm.h')
-rw-r--r-- | src/lib/netlist/analog/nlid_fourterm.h | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h index a0984221cae..800a9d1cfb8 100644 --- a/src/lib/netlist/analog/nlid_fourterm.h +++ b/src/lib/netlist/analog/nlid_fourterm.h @@ -9,6 +9,7 @@ #define NLID_FOURTERM_H_ #include "../nl_base.h" +#include "../plib/putil.h" namespace netlist { namespace analog { @@ -40,26 +41,17 @@ namespace netlist { NETLIB_CONSTRUCTOR(VCCS) , m_G(*this, "G", 1.0) , m_RI(*this, "RI", 1e9) - , m_OP(*this, "OP") - , m_ON(*this, "ON") - , m_IP(*this, "IP") - , m_IN(*this, "IN") - , m_OP1(*this, "_OP1") - , m_ON1(*this, "_ON1") + , m_OP(*this, "OP", &m_IP) + , m_ON(*this, "ON", &m_IP) + , m_IP(*this, "IP", &m_IN) // <= this should be NULL and terminal be filtered out prior to solving... + , m_IN(*this, "IN", &m_IP) // <= this should be NULL and terminal be filtered out prior to solving... + , m_OP1(*this, "_OP1", &m_IN) + , m_ON1(*this, "_ON1", &m_IN) , m_gfac(1.0) { - m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving... - m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving... - - m_OP.m_otherterm = &m_IP; - m_OP1.m_otherterm = &m_IN; - - m_ON.m_otherterm = &m_IP; - m_ON1.m_otherterm = &m_IN; - connect(m_OP, m_OP1); connect(m_ON, m_ON1); - m_gfac = NL_FCONST(1.0); + m_gfac = plib::constants<nl_double>::one; } param_double_t m_G; @@ -137,7 +129,7 @@ namespace netlist { public: NETLIB_CONSTRUCTOR_DERIVED(CCCS, VCCS) { - m_gfac = NL_FCONST(1.0) / m_RI(); + m_gfac = plib::constants<nl_double>::one / m_RI(); } protected: @@ -180,12 +172,9 @@ namespace netlist { public: NETLIB_CONSTRUCTOR_DERIVED(VCVS, VCCS) , m_RO(*this, "RO", 1.0) - , m_OP2(*this, "_OP2") - , m_ON2(*this, "_ON2") + , m_OP2(*this, "_OP2", &m_ON2) + , m_ON2(*this, "_ON2", &m_OP2) { - m_OP2.m_otherterm = &m_ON2; - m_ON2.m_otherterm = &m_OP2; - connect(m_OP2, m_OP1); connect(m_ON2, m_ON1); } @@ -202,7 +191,7 @@ namespace netlist { }; - } -} + } // namespace analog +} // namespace netlist #endif /* NLD_FOURTERM_H_ */ |